/*
 
Correctly handle PNG transparency in Win IE 5.5 & 6.
http://homepage.ntlworld.com/bobosola. Updated 18-Jan-2006.

Use in <HEAD> with DEFER keyword wrapped in conditional comments:
<!--[if lt IE 7]>
<script defer type="text/javascript" src="pngfix.js"></script>
<![endif]-->

*/
var blnFirstTime	= true;
var strBrowser 			= new String(window.navigator.appVersion);
var strBrowserVersion	= parseFloat(strBrowser.split("MSIE")[1]);
var strMozVer			= parseFloat(new String(window.navigator.userAgent).split("Firefox/")[1])
var blnChrome	= (strBrowser.search("Chrome")!=-1);
var blnSafari	= (strBrowser.search("Safari")!=-1);

function ManagePNG(bResize) {

	objBanner 				=  document.getElementById("sfondobanner");
	objSchermo 				=  document.getElementById("sfondoschermo");
	objContenuto			=  document.getElementById("contenuto");
	objSfondoContenuto		=  document.getElementById("sfondocontenuto");
	objFrame				=  document.getElementById("frameinterno");
	objTabellaMenu 			=  document.getElementById("tablemenu");
	//objTabellaSchermo		=  document.getElementById("tableschermo");
	objFilmato 				=  document.getElementById("filmato");
	objStatus				=  document.getElementById("status");

	objTabellaMenu.style.top		= "128px";
	objSfondoContenuto.style.top	= "0px";
	objContenuto.style.top			= "120px";
	objFrame.style.top				= "10px";
	objStatus.style.top				= "480px";
	objFilmato.style.top			= "131px";
	objSchermo.style.top			= "-8px";
	objBanner.style.left			= (document.body.clientWidth-objBanner.width)/2 + "px";
	objSfondoContenuto.style.left	= (document.body.clientWidth-objSfondoContenuto.width)/2 + "px";
	objFrame.style.left				= (document.body.clientWidth-778)/2 + "px";
	objStatus.style.left			= "0px";//(document.body.clientWidth-820)/2 + "px";
	objSchermo.style.left			= "-8px";//(document.body.clientWidth-500)/2 + "px";
	objFilmato.style.left			= (document.body.clientWidth-462)/2 + "px";

	if (strBrowserVersion >= 5.5 ) { 
		
		objBanner.style.filter 				= "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='immagini/banner_argos.png',sizingMethod='scale')";
		objSchermo.style.filter 			= "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='immagini/sfondoschermo.png',sizingMethod='scale')";
		objSfondoContenuto.style.filter 	= "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='immagini/sfondoframe.png',sizingMethod='scale')";

		objTabellaMenu.style.left		= (document.body.clientWidth-808)/2-1 + "px";
		
		//objBanner.style.top			= "128px";

		/*objTabellaMenu.style.top 			= "-44px";
		if (strBrowserVersion < 7) { 
			objContenuto.style.top 				= "-80px";
			objSchermo.style.top 				= "-30px";
			objTabellaSchermo.style.top			= "-281px";
			objStatus.style.top					= "-930px";
			objFrame.style.top					= "-354px";
		} else {
			if( !bResize ) {
				blnFirstTime = false;
				objSchermo.style.top 				= "-120px";
				objTabellaSchermo.style.top			= "-372px";
				objStatus.style.top					= "-170px";
				objFrame.style.top					= "-354px";
			} else {
				objSchermo.style.top 				= "0px";
				objTabellaSchermo.style.top			= "-252px";
				objStatus.style.top					= "-48px";
			}
		}*/
	} else {
	
		objBanner.src 					= "immagini/banner_argos.png";
		objSchermo.src 					= "immagini/sfondoschermo.png";
		objSfondoContenuto.src 			= "immagini/sfondoframe.png";
		if(strMozVer>=3 || blnChrome || blnSafari) {
			objTabellaMenu.style.left		= (document.body.clientWidth-808)/2 + "px";
		} else {
			objTabellaMenu.style.left		= "0px;"
			objSchermo.style.left			= (document.body.clientWidth-484)/2 + "px";
			objFilmato.style.left			= "0px";
		}
		//objTabellaSchermo.style.top			= "0px";
		/*if( blnChrome ) {
			objSfondoContenuto.style.top 				= "-4px";
			objTabellaSchermo.style.top					= "-248px";
		}*/
		//document.body.style.marginTop 	= "20px"
	
	}
}
