/* 
	ALMAWEBSITE - Sezione ALMAPlida
	–––––––––––––––––––––––––––––––––––––––––
	kLABO 02.2009
*/

$(document).ready( function()
{
	/** IE6 - fix specifici
	(1) min-width fix
	(2) hover on non-<a> elements fix
	*/
	if ( $.browser.msie() && ($.browser.version.number()==6) ) 
	{
		//
		// (1) min-width fix [accorpabile con il min-height fix, visto che vanno tutti e due onresize]
		//
		var minWidth = 1024; // fake di min-width css non supportata dal fottuto ie6
		var currentWidth = 0;
		var minHeight = 550;  // riferito a #main
		var currentHeight = 0;  // riferito a #main

		// funzione di fake - min-width
		function fakeMinWidth_ie6() 
		{
			// legge la larghezza attuale della browser window
			if (document.documentElement) { 
				currentWidth = document.documentElement.offsetWidth; 
			} else if (window.innerWidth && window.innerHeight) { 
				currentWidth = window.innerWidth; 
			}
			// aggiorna la dichiarazione di width per l'elemento body
			if ( currentWidth <= minWidth ) { 
				$("body").css("width",minWidth-16); // tolgo la larghezza scrollbar
			} else { 
				$("body").css("width",currentWidth-16);  // tolgo la larghezza scrollbar
			}
		}

		// bind dell'evento window.resize con il fake min-width
		$(window).resize( function() {
			fakeMinWidth_ie6();
		});

		// devo eseguirla una volta onload della pagina.
		fakeMinWidth_ie6();
		
		//
		// (2) :hover fix per elementi non <a>
		//
		
//		$(".replacement-1").hover( function () { $(this).addClass("replacement-1-hover"); }, function () { $(this).removeClass("replacement-1-hover"); });
//		$(".replacement-2").hover( function () { $(this).addClass("replacement-2-hover"); }, function () { $(this).removeClass("replacement-2-hover"); });
		$(".btn_emptycart").hover( function () { $(this).addClass("btn_emptycart-hover"); }, function () { $(this).removeClass("btn_emptycart-hover"); });
		$(".btn_recalculate").hover( function () { $(this).addClass("btn_recalculate-hover"); }, function () { $(this).removeClass("btn_recalculate-hover"); });
		$(".btn_procedi").hover( function () { $(this).addClass("btn_procedi-hover"); }, function () { $(this).removeClass("btn_procedi-hover"); });
		$(".btn_neworder").hover( function () { $(this).addClass("btn_neworder-hover"); }, function () { $(this).removeClass("btn_neworder-hover"); });
//		$(".btn_submit").hover( function () { $(this).addClass("btn_submit-hover"); }, function () { $(this).removeClass("btn_submit-hover"); });
		$(".btn_cancel").hover( function () { $(this).addClass("btn_cancel-hover"); }, function () { $(this).removeClass("btn_cancel-hover"); });
		$(".btn_cart").hover( function () { $(this).addClass("btn_cart-hover"); }, function () { $(this).removeClass("btn_cart-hover"); });
		$(".btn_invia").hover( function () { $(this).addClass("btn_invia-hover"); }, function () { $(this).removeClass("btn_invia-hover"); });
		$(".btn_modcart").hover( function () { $(this).addClass("btn_modcart-hover"); }, function () { $(this).removeClass("btn_modcart-hover"); });
		$(".btn_inoltra").hover( function () { $(this).addClass("btn_inoltra-hover"); }, function () { $(this).removeClass("btn_inoltra-hover"); });
		$(".btn_aggiungi").hover( function () { $(this).addClass("btn_aggiungi-hover"); }, function () { $(this).removeClass("btn_aggiungi-hover"); });

		$(".btn_alma").hover( function () { $(this).addClass("btn_alma-hover"); }, function () { $(this).removeClass("btn_alma-hover"); });
		$(".btn_nonalma").hover( function () { $(this).addClass("btn_nonalma-hover"); }, function () { $(this).removeClass("btn_nonalma-hover"); });

		$(".btn-aggiungi").hover( function () { $(this).addClass("btn-aggiungi-hover"); }, function () { $(this).removeClass("btn-aggiungi-hover"); });


	    
	}
});