var BOARD_LINK_COLOR_BLEND_IN_DURATION = 150;var BOARD_LINK_COLOR_BLEND_OUT_DURATION = 80;var LINKS_COLOR_BLEND_IN_DURATION = 200;var LINKS_COLOR_BLEND_OUT_DURATION = 100;var MENU_COLOR_BLEND_IN_DURATION = 250;var MENU_COLOR_BLEND_OUT_DURATION = 150;var NEWS_SHOW_ANIM_DURATION = 200;var CIRCOLARI_COLOR_BLEND_IN_DURATION = 150;var CIRCOLARI_COLOR_BLEND_OUT_DURATION = 50;var AJAX_TIMEOUT = 15 * 1000;if ($.browser.msie) {	var msie_version = parseInt($.browser.version, 10);	var old_msie = (msie_version > 0 && msie_version < 9);}function read_more(elem) {	$(elem).parents('.read_more').hide();	var more_elem = $(elem).parents('.news_container').find('.more');	if (!old_msie) {		more_elem.show('blind', null, NEWS_SHOW_ANIM_DURATION);	} else {		more_elem.show();	}}function board_link_mouseover(elem, bgcolor) {	var properties = {		backgroundColor : bgcolor	};	if (!old_msie)		$(elem).animate(properties, BOARD_LINK_COLOR_BLEND_IN_DURATION);	else		$(elem).css(properties);}function board_link_mouseout(elem, bgcolor) {	var properties = {		backgroundColor : bgcolor	};	if (!old_msie)		$(elem).animate(properties, BOARD_LINK_COLOR_BLEND_OUT_DURATION);	else		$(elem).css(properties);}function more_news(board, start, last_id) {		$('.more_news').remove();		$.ajax({		url : '/action/news_ajax',		type : 'GET',		dataType : 'html',		timeout : AJAX_TIMEOUT,		beforeSend : function() {			$('.loading').show();		},		data : {			'board' : board,			'start' : start,			'last_id' : last_id		},		success : function(response) {			$('.loading').remove();			$('#board_news_container').append(response);		},		error : function() {			alert('Si è verificato un errore durante il caricamento delle news.');		}	});	}function more_circolari(start, max_num) {		$('.more_circolari').remove();		$.ajax({		url : '/action/circolari_ajax',		type : 'GET',		dataType : 'html',		timeout : AJAX_TIMEOUT,		beforeSend : function() {			$('.loading').show();		},		data : {			'start' : start,			'max_num' : max_num		},		success : function(response) {			$('.loading').remove();			$('#circolari_container').append(response);		},		error : function() {			alert('Si è verificato un errore durante il caricamento delle circolari.');		}	});	}function news_permalink(elem, enable) {	var caption_elem = $(elem).parents('.permalink').find('.permalink_caption');	var value_elem = $(elem).parents('.permalink').find('.permalink_value');	if (enable) {		caption_elem.hide();		value_elem.show();		value_elem.find('input').select();	} else {		caption_elem.show();		value_elem.hide();	}}$(document).ready(function(){	$('#menu li a').mouseover(function(){		var properties = {			backgroundColor : '#f9ec93'		};		$(this).animate(properties, MENU_COLOR_BLEND_IN_DURATION);	});	$('#menu li a').mouseout(function(){		var properties = {			backgroundColor : '#ffffff'		};		$(this).animate(properties, MENU_COLOR_BLEND_OUT_DURATION);		});	$('.blocks li a').mouseover(function(){		var properties = {			backgroundColor : '#eee'		};		if (!old_msie)			$(this).animate(properties, LINKS_COLOR_BLEND_IN_DURATION);		else			$(this).css(properties);	});	$('.blocks li a').mouseout(function(){		var properties = {			backgroundColor : '#fff'		};		if (!old_msie)			$(this).animate(properties, LINKS_COLOR_BLEND_OUT_DURATION);		else			$(this).css(properties);	});		$('.permalink .permalink_value').hide();		$('.permalink .permalink_value input').blur(function(){		news_permalink($(this), false);	});		$('.news_container .more').before(		'<div class="read_more">'+			'<a href="#" onclick="read_more(this); return false;">leggi il resto...</a>'+		'</div>'	);		$('.news_container .more').hide();			if (!old_msie)		$('.benvenuto .container').resizable({			handles: 's',			maxHeight: 800,			minHeight: 250}		);			$('.circolare_container .title, .delibera_container .title, .bando_container .title').mouseover(function(e){		var properties = {			backgroundColor : '#ddd'		};		if (!old_msie)			$(this).parent().find('.numero').animate(properties, CIRCOLARI_COLOR_BLEND_IN_DURATION);		else			$(this).parent().find('.numero').css(properties);		e.stopPropagation();	});		$('.circolare_container .title, .delibera_container .title, .bando_container .title').mouseout(function(e){		var properties = {			backgroundColor : '#ccc'		};		if (!old_msie)			$(this).parent().find('.numero').animate(properties, CIRCOLARI_COLOR_BLEND_OUT_DURATION);		else			$(this).parent().find('.numero').css(properties);		e.stopPropagation();	});		$('.circolare_container').click(function(e){		var num = $(this).find('.numero').text();		location.assign('/action/circolare?num='+num);		e.stopPropagation();	});		$('.delibera_container').click(function(e){		var num = $(this).find('.numero').text();		location.assign('/action/delibera?num='+num);		e.stopPropagation();	});		$('.bando_container').click(function(e){		var num = $(this).find('.numero').text();		location.assign('/action/bando?num='+num);		e.stopPropagation();	});	});
