jQuery(function($) {
	$.ajaxSetup({
		type: "POST",
		timeout: 20000
	});
	var file = jQuery.url.attr("file");
	if (file != null){
		file = file.replace(".php", "");
		$('#' + file + '_btn').addClass('actived');
	}else 
		$('#index_btn').addClass('actived');
		
	$("a.fancy").fancybox({
		'overlayShow'	:	false
	});
	jQuery('#mycarousel1').jcarousel({
        "scroll" : 1,
		"auto"	 : 2,
		"wrap": 'circular'
    });
	jQuery('#mycarousel2').jcarousel({
        "scroll" : 1,
		"auto"	 : 2,
		"wrap": 'circular'

    });

	if( !$.browser.msie ) {
		$('.opac').css('opacity', 0.4);
		
		$('.opac').hover(
			function(){
				$(this).animate({ 'opacity': 1 }, 500);	
				$(this).css('zIndex', 1000);
			},
			function(){
				$(this).animate({ 'opacity': 0.4 }, 500);	
				$(this).css('zIndex', 1);
			}
		);
	}
	
	$.ifixpng('img/pixel.gif');
	
	$('.png').ifixpng(); 
	
	$(".smartform").submit( function(){ return false; });
	if ( $(".smartform").length > 0 ) $('.smartform').smartform();
	
	$("#fancy").fancybox({
		'overlayOpacity'        : 0.7,
		'overlayColor'          : '#000',
		'centerOnScroll'		: true,
		'hideOnContentClick'    : true,
		'hideOnOverlayClick'	: true,
		'autoDimensions'        : true,
		'padding'		        : 0,
		'title'   				: '',
		'transitionIn'			: 'fade',
		'transitionOut'			: 'fade'
	});
	//altezza HOMEPage colonne
	/*if( $(".box").length > 0 ){
		var com_right = $(".col_right").height() - 14;
		$("#comunicazione_box").height( com_right + "px");
		$("#promemoria_box").height( com_right + "px");
	}*/
	
});
function vaiHome(){
	document.location.href='admin/index.php?action=home';
}
function callFancy( my_href ) {
    $('#fancy').attr("href", my_href );
	$('#fancy').trigger('click');
}

