var winWin=null;
var winWin2=null;
var winWin3=null;

function winOpen(url)
{
if ((winWin==null)|| winWin.closed)
	winWin=window.open(url,'','top=20,left=20,width=900,height=700,toolbar=yes,directories=no,menubar=yes,status=yes,resizable=yes,location=yes,scrollbars=yes,copyhistory=no,');
else
{winWin.location.href=url;
    winWin.focus();}
}

function winOpen2(url)
{
if ((winWin2==null)|| winWin2.closed)
	winWin2=window.open(url,'','top=20,left=20,width=1000,height=700,toolbar=no,directories=no,menubar=no,status=no,resizable=yes,location=no,scrollbars=yes,copyhistory=no,');
else
{winWin2.location.href=url;
    winWin2.focus();}
}

function winOpen3(url)
{
if ((winWin3==null)|| winWin3.closed)
	winWin3=window.open(url,'','top=20,left=20,width=900,height=700,toolbar=yes,directories=no,menubar=yes,status=yes,resizable=yes,location=yes,scrollbars=yes,copyhistory=no,');
else
{winWin3.location.href=url;
    winWin3.focus();}
}


function inset(t)
{
t.style.cursor='hand';
t.className=t.className + "_in";
}

function outset(t)
{
t.style.cursor='pointer';
var s=new String();
s=t.className;
t.className=s.substr(0,s.length-3);
}

function insetM(t)
{
t.style.color="#FF1A1A";
t.style.cursor='hand';
}

function outsetM(t)
{
t.style.color="#000066";
}

function imgON(element)
{
var s=new String();
s=element.src;
ext=s.substr(s.length-4,4);
s=s.substr(0,s.length-4) + "-ON" + ext;
element.src=s;
}

function imgOFF(element)
{
var s=new String();
s=element.src;
ext=s.substr(s.length-4,4);
s=s.substr(0,s.length-7)+ ext;
element.src=s;
}

function setWhiteBGK(elemnt)
{
for (i=0;i<8;i++)
	{elementName="divn"+i;
	var theELE=document.getElementById(elementName);
	if (!theELE)
		break;
	if (elementName==elemnt)
		theELE.style.background="#E8E7E0";
	else
		theELE.style.background="#FFFFFF";
	}

}

function checkLogin(str1,str2,str3)
{
var error =false;
var text ="";
var i=0;
if (document.login.user.value == "")
        {
        error = true;
        text = text + "\n- " + str1;
        }
if (document.login.pass.value == "")
        {
        error = true;
                text = text + "\n- " + str2;
        }
if (error)
        {
        text = str3 + text;
        alert(text);
		return false;
        }
document.login.submit();
return true;
}

function checkEmail(str)
{
if (str=="")
	return true;
var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
if (filter.test(str))
	return true;
else
	return false;
}

function submitForm2(lang)
{
if (lang=="it")
	{
	switch(document.forms[1].select3.selectedIndex)
		{
		case 1:document.location.href='stampa-su-bottiglia.php';
			break;
		case 2:document.location.href='Z5000.php';
			break;
		case 3:document.location.href='Z5000its.php';
			break;
		case 4:document.location.href='GraphJET.php';
			break;
		case 5:document.location.href='ModulPrint-stampa-codice.php';
			break;
		case 6:document.location.href='ZJET303-timbratore.php';
			break;
		}
	}
if (lang=="EN")
	{
	switch(document.forms[1].select3.selectedIndex)
		{
		case 1:document.location.href='print-on-bottle.php';
			break;
		case 2:document.location.href='Z5000-batch-printing.php';
			break;
		case 3:document.location.href='Z5000its-printer.php';
			break;
		case 4:document.location.href='GraphJET-barcodes.php';
			break;
		case 5:document.location.href='ModulPrint-print-barcode.php';
			break;
		case 6:document.location.href='ZJET303-print-on-plastic.php';
			break;
		}
	}
}

function goSITE()
{
switch (document.nelMondo.goOUT.selectedIndex)
	{
	case 1:document.location.href="http://www.zanasi.it/index.php";
			break;
	case 2:document.location.href="http://www.zanasi.it/printer.php";
			break;
	case 3:winOpen("http://www.zanasi.es/");
		break;
	case 4:winOpen("http://www.zanasiusa.com/");
		break;
	case 5:winOpen("http://www.zanasichina.com/");
		break;
	case 6:winOpen("http://www.zanasi.co.kr/");
		break;
	case 7:winOpen("http://www.zanasi.co.id/");
		break;
	}
/*["LANG"]=="FR"["LANG"]=="ES"["LANG"]=="DE"["LANG"]=="PT"*/
}






function checkContacts()
{

var email = new String();
var error = "OK";

email = document.contsForm.fld3.value;
//NOME E COGNOME
if ((document.contsForm.fld1.value == ""))
{
coloracampo("fld1");
error=false;
}
else decoloracampo("fld1");

//AZIENDA
if ((document.contsForm.fld2.value == ""))
{
coloracampo("fld2");
error=false;
}
else decoloracampo("fld2");

//MESSAGGIO
if ((document.contsForm.fld5.value == ""))
{
$("#fld5").css("backgroundColor","#EE7777");
error=false;
}
else{
	$("#fld5").css("backgroundColor","#FFFFFF");
}
//EMAIL
if(email.search('@')==-1 || email.length<6 || email.search('.')==-1){
error=false;
coloracampo("fld3");
}
else decoloracampo("fld3");

if(!document.contsForm.privacy.checked)
{
error=false;
$("#privacy").css("backgroundColor","#EE7777");
}
else{
	$("#privacy").css("backgroundColor","#FFFFFF");
}

return error;
}


function decoloracampo(campo){
  	$("input[name='"+campo+"']").css("backgroundColor","#FFFFFF")
}

function coloracampo(campo){
  	$("input[name='"+campo+"']").css("backgroundColor","#EE7777")
}






function checkUPL(txt1,txt2,txt3,txt4,enc)
{
errore=0;
testo="";
/*if (document.upload.tipoFILE.selectedIndex<1)
	{errore=1;
	testo= txt1 + "\n";}
if (enc)
	{if (document.upload.encripted.selectedIndex<1)
		{errore=1;
		testo= testo + txt2+ "\n";}
	}*/
if (document.upload.upFile.value=="")
	{testo=testo + txt3 + "\n";
	errore=1;}
if (errore)
	{alert(txt4 + "\n"+testo);
	return false;
	}
else
	{
	document.upload.azione.value=2;
	document.upload.submit();
	return true;
	}
}

function checkRicerca(txt,mode)
{if ((document.forms[0].categoria.selectedIndex==0)&&(document.forms[0].norme.selectedIndex==0))
	{alert(txt);
	return false;}
if (!mode)
	document.forms[0].submit();
else
	return true;
}

function showMap(map){
	if (GBrowserIsCompatible()){
		map.addControl(new GSmallMapControl());
		map.addControl(new GMapTypeControl());
		map.enableScrollWheelZoom();
		map.enableContinuousZoom();
		map.setCenter(new GLatLng(45.1,9.85 ),7);
		
		var point1 = new GLatLng(44.625819, 10.71526);
		var indirizzo1 = "";
		var testo1 = "<b>Reco Tech</b><br>Sede Legale, amministrativa e operativa Via per Reggio E., 30/E 42019 Arceto di Scandiano Reggio Nell'Emilia(RE). Tel e Fax 0522-989100.";
		
		var point2 = new GLatLng(45.772400, 8.992153);
		var indirizzo2 = "";
		var testo2 = "<b>Reco Tech</b><br>Sede operativa magazzino di Como Via Resistenza 13C- 22075 Lurate Caccivio Como(CO). Tel e Fax 031-494207. ";

	//	var point3 = new GLatLng(44.53877940099704, 10.47932596206665);
	//	var indirizzo3 = "Piazza Fabbrica Rubbiani, 52 CAP : 41049 - Sassuolo (Mo)";
	//	var testo3 = "<b>Reco Tech</b> Piazza Fabbrica Rubbiani, 52 41049  Sassuolo (Mo) Italy";

		var formus1 = '<div style="width:195px;height:80px;">'+testo1+'</div>';
		var formus2 = '<div style="width:195px;height:80px;">'+testo2+'</div>';
		//var formus3 = '<div style="width:180px;height:50px;">'+testo3+'</div>';

      var marker1 = createMarker(point1,formus1);
	  var marker2 = createMarker(point2,formus2);
	//	var marker3 = createMarker(point3,formus3);

        map.addOverlay(marker1);
        map.addOverlay(marker2);
      //  map.addOverlay(marker3);
       }
	}


function newmap(indirizzo){
		indirizzo='Largo G.Garibaldi , 2 41124 - Modena';
         var arrivo=indirizzo;
         var partenza=document.forms[0].start.value;
        var url='http://maps.google.it/maps?f=d&saddr='+partenza+'&daddr='+arrivo;
         weblink=window.open(url);
         }

function createMarker(point,html) {
	        var marker = new GMarker(point);
	        GEvent.addListener(marker, "click", function() {
	         marker.openInfoWindowHtml(html);
	     });
	      return marker;
	}
function LoadPrivacy(){
	$("#privacy2").load("AjaxPrivacy.php");
	$("#privacy2").dialog({
		title:"Privacy",
		height: 400,
		width: 600,
		modal: true
	});
	}

