
	u = "" + document.location
	function changeL(){
		rExp1 = /_Italiano_/gi
		rExp2 = /_Inglese_/gi
		rExp3 = /_Spagnolo_/gi
		if (u.indexOf("_Italiano_") != -1)
		{
			lng="E";
			u = u.replace(rExp1,"_Inglese_"); 
		}
		else{
			lng="I";
			u = u.replace(rExp2,"_Italiano_")
		}
		top.elabora.location="../cambiaL.asp?lng="+lng
		document.location = u
	}
	
function changeL2(des){
	     
		rExp1 = /_Italiano_/gi
		rExp2 = /_Inglese_/gi
		rExp3 = /_Spagnolo_/gi
		/*if (u.indexOf("_Italiano_") != -1)
		{
				lng="E";
			u = u.replace(rExp1,"_Inglese_"); 
			
		}
		else{
			lng="I";
			u = u.replace(rExp2,"_Italiano_")
		} */
		
		switch (des)  {
		  case "I" : 
		       lng="I";
			   if (u.indexOf("_Spagnolo_") != -1)
				{
					u = u.replace(rExp3,"_Italiano_"); 
				}
				else{
					u = u.replace(rExp2,"_Italiano_")
				}    
				break
		  case "E" : 
		       lng="E";
			   if (u.indexOf("_Spagnolo_") != -1)
				{  
					u = u.replace(rExp3,"_Inglese_"); 
				}
				else{
					u = u.replace(rExp1,"_Inglese_")
				} 
				break
		  case "S" : 
			   lng="S";
			   if (u.indexOf("_Italiano_") != -1)
				{
				  	u = u.replace(rExp1,"_Spagnolo_"); 
				}
				else{
					u = u.replace(rExp2,"_Spagnolo_")
				} 
				break
		}
		
		top.elabora.location="../cambiaL.asp?lng="+lng
		document.location = u
	}
	
	function popPrev(lnk)
	{
		var prev;
		prev=window.open(lnk,"prev","width=673,height=400,scrollbars=YES");
		prev.focus();
	}
	function popUp(lnk,w,h){
		var popUpV;
		popUpV=window.open(lnk,"popUpV","width="+w+",height="+h+",scrollbars=yes");
	}
	function popUpMod(lnk,w,h){
		var popUpM;
		popUpM=window.open(lnk,"popUpM","width="+w+",height="+h+",scrollbars=yes,resizable=1");
	}
	function popUpInfoAgg(idBox){
		pgInfoAgg = window.open("infoAggFrame.asp?idBox="+idBox,"InfoAggiuntive","menubar=no,toolbar=0,resizable=no,scrollbars=0,screenX=50,screenY=100,left=50,top=100,width=700,height=350");
		pgInfoAgg.focus();
	}
	function pop(){
		newPg=window.open('ersascopePopFrame.htm','Ersa','menubar=1,toolbar=1,location=1,status=1,resizable=1,scrollbars=1,width=730,height=500')
		newPg.focus()
	}
	
	function popUpPg(id,w,h){
		window.open("tabella.asp?tabella="+id,"ELCART2","width="+w+",height="+h+",menubar=no,toolbar=1,resizable=no,scrollbars=Yes")
	}
	
	function link(codice,idBox)
	{
		var prev;
		prev=window.open("preventivo.asp?codice="+codice+"&idBox="+idBox,"prevaGG","width=210,height=150");
		prev.focus();
	}

	function Opencontenitore(cod){
		var cont;
		cont=window.open("contenitore.asp?cod=" + cod ,"ELCART2","menubar=no,scrollbars=auto,status=no,width=412,height=412,scrollbars=yes")
		cont.focus();
	}
	
	function changeImg(indice,lnk)
	{
		img="img"+indice+"";
		//alert(lnk);
		docobj.images[img].src = lnk;
	}
	function goTo(lnk)
	{
		document.location=lnk+"&isN4="+isN4;
	}
var newPopUp
function MM_openBrWindow(pg,w,h,rs,sc){
	if (newPopUp){
		if (!newPopUp.closed)	newPopUp.close()
	}
	
	var windowX = Math.ceil( (window.screen.width  - w) / 2 );
	var windowY = Math.ceil( (window.screen.height - h) / 2 );
		
	newPopUp = window.open(pg,"PopUp","menubar=no,toolbar=0,resizable=" + rs + ",scrollbars=" + sc + ",width=" + w + ",height=" + h + ",screenX=" + windowX + ",screenY=" + windowY + ",left=" + windowX + ",top=" + windowY);
	
	newPopUp.focus();
}
	
	
