<!-- GESTORE DI PAGINE AVULSE -->

var urlFrmSetOut="../../fevi.htm";
var urlFrmSetIn="../frameset/ho_sabbiatrici.htm"; //dafault
var myLoc=window.document.location;
var winPointer=window;
var myParentLoc=window.parent.document.location;

	function doAvHandler(){
		if (myLoc.href.indexOf("italiano")!=-1){document.location.href="http://www.fevi.it/-ita/home.php"}
		else{
			if (myLoc.href.indexOf("/accessori/")!=-1)				{urlFrmSetIn="../frameset/ho_accessori.htm";}
			else if (myLoc.href.indexOf("/novita/")!=-1)				{urlFrmSetIn="../frameset/ho_accessori.htm";}
			else if (myLoc.href.indexOf("/azienda/")!=-1) 			{urlFrmSetIn="../frameset/ho_azienda.htm";}
			else if (myLoc.href.indexOf("/compressori/")!=-1) 		{urlFrmSetIn="../frameset/ho_compressori.htm";}
			else if (myLoc.href.indexOf("/effetto_fotografico/")!=-1){urlFrmSetIn="../frameset/ho_fotografico.htm";}
			else if (myLoc.href.indexOf("/sabbiatrici/")!=-1) 		{urlFrmSetIn="../frameset/ho_sabbiatrici.htm";}
			else if (myLoc.href.indexOf("/plotter/")!=-1) 			{urlFrmSetIn="../frameset/ho_plotter.htm";}
			else if (myLoc.href.indexOf("/aspiratori/")!=-1) 			{urlFrmSetIn="../frameset/ho_aspiratori.htm";}
			if (myLoc==myParentLoc){
				//pagina avulsa
				if (myLoc.href.indexOf("home.htm")!=-1){
				//homepage
					document.location.href="fevi.htm";
				}else{
				//pagine prodotti	
					document.body.innerHTML="<iframe border=0 frameborder=no framespacing=0 scrolling=no width='100%' height='98%' src='"+urlFrmSetOut+"'></iframe> ";
					document.body.scroll="no";
					winPointer=frames[0];
					setTimeout("step1()",10);
				}
			}
		}
	}
	
	function step1(){//attende il caricamento del frameset piu esterno
		
		if (winPointer.frames.length==0){setTimeout("step1()",10);}
		else {
			//alert("step 1: "+winPointer.document.location+" load");
			winPointer=winPointer.frames[1]; setTimeout("step2()",10);}
	}
	
	function step2(){//attende il caricamento del successivo frameset
		if (winPointer.frames.length==0){setTimeout("step2()",10);}
		else {
			//alert("step 2: "+winPointer.document.location+" load");
			winPointer=winPointer.frames[1];winPointer.navigate(urlFrmSetIn); setTimeout("step3()",10);}
	}
	
	function step3(){//attende il caricamento dell'ultimo frameset
		if (winPointer.frames.length==0){setTimeout("step3()",10);}
		else {
			//alert("step 3: "+winPointer.document.location+" load");
			winPointer=winPointer.frames[1];winPointer.navigate(myLoc);}
	}
	
