	function MM_swapImgRestore() { //v3.0
	  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
	}
	
	function MM_preloadImages() { //v3.0
	  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
	    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
	    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
	}
	
	function MM_findObj(n, d) { //v4.01
		var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
			d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
		if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
		for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
		if(!x && d.getElementById) x=d.getElementById(n); return x;
	}
	
	function MM_swapImage() { //v3.0
		var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
		if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
	}
	
	function MM_openBrWindow(theURL,winName,features) { //v2.0
		window.open(theURL,winName,features);
	}
	

	
	function popUp(vUrl,popW,popH){
		var winleft = (screen.width - popW) / 2;
		var winUp = (screen.height - popH) / 2;
		winProp = 'width='+popW+',height='+popH+',left='+winleft+',top='+winUp+',scrollbars=yes,resizable'
		window.open(vUrl,"",winProp);
	}
	
	function popUpMax(vUrl){
		popUp(vUrl,900,600);
	}
	
	function popUpStream(){
		popUp(vUrl,500,300);
	}
	
	function popUpMultimedia(vUrl){
		popUp(vUrl,800,700);
	}
	
	function popUpZoom(vFile){
		popUp("popup.asp?file="+vFile,450,450);
	}
	
	function popUpMin(vUrl){
		popUp(vUrl,300,300);
	}
	
	function mainmenu_cerca_form(objForm){
		var strErroreMessaggio='';
		if(objForm.text.value==''){
			strErroreMessaggio+= 'Inseriere la parola da cercare';
		}
		if (strErroreMessaggio==''){
			return true;
		}else{
			alert(strErroreMessaggio);
			return false;
		}
	}
	
	function addLoadEvent(func) {
	    var oldonload = window.onload;
	    if (typeof window.onload != 'function') {
	        window.onload = func;
	    } else {
	        window.onload = function() {
	            if (oldonload) {
	                oldonload();
	            }
	            func();
	        }
	    }
	}
	
	function compareProducts(){      
		var iz,jz,qt,llink;
		qt=0;
		llink='';
		for (iz=0;iz<document.forms.length ;iz++)
		{
		    for (jz=0;jz<document.forms[iz].elements.length;jz++)
		    {
			if(document.forms[iz].elements[jz].type.slice(0,8)=="checkbox")
			{
			    if ((document.forms[iz].elements[jz].name=="compare_prd_id") && (document.forms[iz].elements[jz].checked))
			    {
				qt = qt + 1;
				llink = llink + document.forms[iz].elements[jz].value + ',';
			    }
			}
		    }
		}
		if (qt > 1)
		{
		    confrWin = window.open('index.asp?v=v_products_comparison&compare_prd_id=' + llink.substring(0,llink.length - 1) + '','Confronto','toolbar=0,location=0,status=1,menubar=0,scrollbars=1,resizable=1,width=800,height=500');
		}
		else
		{
		    alert('Selezionare almeno due articoli per effettuare un confronto');
		}
    }

	//http://www.htmlcodetutorial.com/linking/linking_famsupp_73.html
	function popupform(myform, windowname){
		if (! window.focus)return true;
			window.open('', windowname, 'toolbar=0,location=0,status=1,menubar=0,scrollbars=1,resizable=1,width=800,height=600');
		myform.target=windowname;
		return true;
	}
	
	
	function v_variantparameters_select_ok(parent_id,value,vvp_id){
		opener.document.getElementById(parent_id).innerHTML = value;
		opener.document.getElementById(parent_id+"__vvp_id").value = vvp_id;
		this.close();
	}
	
	function setItemImgBig(vFile){
		document.getElementById("ITEM_IMAGE").src = "../files/"+vFile;
	}
	
	
	
	var bo_ns_id = 0;

function startIeFix(){
  if(isIE()){
    document.write('<div id="bo_ns_id_' + bo_ns_id + '"><!-- ');
  }
}

function endIeFix(){
  if(isIE()){
    document.write('</div>');
    var theObject = document.getElementById("bo_ns_id_" + bo_ns_id++);
    var theCode = theObject.innerHTML;
    theCode = theCode.substring(4 ,9+theCode.indexOf("</object>"))
    document.write(theCode);
  }
}

function isIE(){
  // only for Win IE 6+
  // But not in Windows 98, Me, NT 4.0, 2000
  var strBrwsr= navigator.userAgent.toLowerCase();
  if(strBrwsr.indexOf("msie") > -1 && strBrwsr.indexOf("mac") < 0){
    if(parseInt(strBrwsr.charAt(strBrwsr.indexOf("msie")+5)) < 6){
      return false;
    }
    if(strBrwsr.indexOf("win98") > -1 ||
       strBrwsr.indexOf("win 9x 4.90") > -1 ||
       strBrwsr.indexOf("winnt4.0") > -1 ||
       strBrwsr.indexOf("windows nt 5.0") > -1)
    {
      return false;
    }
    return true;
  }else{
    return false;
  }
}
	
	