jQuery(document).ready(function(){

	jQuery(document).pngFix();
	
	var heightContenuto = jQuery('.contenuto').outerHeight();
	var heightLink = jQuery('.links').outerHeight();

	jQuery('#news').innerfade({
		animationtype: 'slide',
		speed: 750,
		timeout: 2000,
		type: 'random',
		containerheight: '1em'
	});

	if(heightLink>heightContenuto){
		jQuery('.contenutotop').css({height:(heightLink-30)+'px'});
		jQuery('.contenutobottom').css({background:'url(immagini/cbottom_g.png)'});
	}
	
	
	
	jQuery('.date-pick').val(new Date().asString()).DatePicker({
	format:'d/m/Y',
	date: jQuery('.date-pick').val(),
	current: jQuery('.date-pick').val(),
	starts: 1,
	position: 'r',
	onBeforeShow: function(){
		jQuery('.date-pick').DatePickerSetDate(jQuery('.date-pick').val(), true);
	},
	onChange: function(formated, dates){
		jQuery('.date-pick').val(formated);
		if ($('#closeOnSelect input').attr('checked')) {
			jQuery('.date-pick').DatePickerHide();
		}
	}
});;
});
