// JavaScript Document
$(document).ready(function(){
						   
	//news ed eventi
	var offDiv = $('li.offDiv');
  offDiv.find('ul.show-hide').hide();
  offDiv.find('a.hideLink').hide();
  
	//$('li.offDiv span.show-hide').hide();
	//$('li.offDiv span.hideLink').hide();
	
	var onDiv = $('li.onDiv');
  onDiv.find('a.hideLink').show();
  onDiv.find('a.showLink').hide();
	//$('li.onDiv a.hideLink').show();
	//$('li.onDiv a.showLink').hide();
	
			// showLink shows the content  http://www.mredesign.com/demos/jquery-show-hide/#thedemo
	$('a.showLink').click(function(){
	$(this).siblings('.show-hide').slideToggle('slow');
	$(this).parents('.offDiv').removeClass().addClass('on onDiv');
	$(this).hide();
	$(this).parents(".titolo").find("a.hideLink").show().css('display','block');
	return false;
  });
			// hideLink hides the content
	$('a.hideLink').click(function(){
	$(this).siblings('.show-hide').slideToggle('slow');
	$(this).parents('.onDiv').removeClass().addClass('offDiv');
	$(this).hide();
	$(this).parents(".titolo").find("a.showLink").show().css('display','block');
	return false;
  });
	
	// altri articoli
	var other = $('.other_articles');
  //other.find('ul.vedi').hide();
	$('#agenda .other_articles ul').show();
	other.find('h4 a').click(function(){
	$(this).parent().next().slideToggle('slow');
	return false;
  });
	
	$(document).ready(function() {
    $("a.spip_out").each(function(){  
	   this.target = "_blank";  
	  });
  });
});

	$(document).ready(function(){
	var sinistra = $('#left').height(), destra = $('#right').height();
 	if(sinistra<destra) $('#left').css('min-height',destra+'px');
 	if(sinistra>destra) $('#right').css('min-height',sinistra+'px');
 });
 	
