/* VARIE SCRIPTS */

$(document).ready(function()
{
	
	/* ============ */
	/* = generici = */
	/* ============ */
	
	/* TOGLI TESTO ON FOCUS */
	$("input").searchField();
	$("textarea").searchField();
	
	/* FADE IN FADE OUT 10-100% */
	if($(".fadeTen").hover(
			function () {
		        $(this).fadeTo(200, 1);
		    },
			function () {
		        $(this).fadeTo(500, .1);
		    }
		)
	);
	
	/* FADE IN FADE OUT 100-40% */
	if($(".fadeOppFourty").hover(
			function () {
		        $(this).fadeTo(200, .4);
		    },
			function () {
		        $(this).fadeTo(500, 1);
		    }
		)
	);
	
	
	/* FADE IN FADE OUT 100-55% */
	if($(".fadeOppFifty").hover(
			function () {
		        $(this).fadeTo(200, .55);
		    },
			function () {
		        $(this).fadeTo(500, 1);
		    }
		)
	);
	
		if($(".fadeOppSeventyb").hover(
			function () {
		        $(this).fadeTo(500, 1);
		    },
			function () {
		        $(this).fadeTo(200, .5);
		    }
		)
	);
	
	/* FADE IN FADE OUT 100-70% */
	if($(".fadeOppSeventy").hover(
			function () {
		        $(this).fadeTo(200, .7);
		    },
			function () {
		        $(this).fadeTo(500, 1);
		    }
		)
	);
	
	// fix altezza p per elenco prodotti
	if($(".box-elenco-prod").length > 0)
	{
		var heightbox = 73;
		var paddingbox;
		$('.box-elenco-prod p').each(function(index) {
		     //alert(index + ': ' + $(this).height());
			paddingbox = heightbox - $(this).height();
			$(this).css('padding-top',paddingbox/2);
		 });
	}
	
	if($(".series-prod").length > 0)
	{
		var heightbox = 68;
		var marginbox;
		$('.series-prod p').each(function(index) {
		     //alert(index + ': ' + $(this).height());
			marginbox = heightbox - $(this).height();
			$(this).css('margin-top',marginbox/2);
		 });
	}
	
	// fix altezza footer per scheda prodotto
	if($("#scheda-dettaglio").length > 0)
	{
		var heightbox = $("#scheda-dettaglio").height();
		var topbox = heightbox;
		$("#footer").css('top',heightbox+409);
	} else {
		
	}
	
});




/* ================ */
/* = WINDOW LOAD  = */
/* ================ */

$(window).load( function()
{

});
