var winWin=null;
var winWin0=null;
var winWin2=null;
var winWin3=null;
var winWin4=null;

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

function winOpen5(url)
{winOpen(url);}

function winOpen0(url)
{
if ((winWin0==null)|| winWin0.closed)
	winWin0=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
{winWin0.location.href=url;
    winWin0.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)
{
sW=(screen.width/2)-300;
sH=(screen.height/2)-320;
if ((winWin3==null)|| winWin3.closed)
	winWin3=window.open(url,'','top='+sH+',left='+sW+',width=600,height=640,toolbar=no,directories=no,menubar=no,status=no,resizable=no,location=no,scrollbars=no,copyhistory=no,');
else
	{winWin3.location.href=url;
    winWin3.focus();}
}

function winOpen4(url)
{
sW=(screen.width/2)-375;
sH=(screen.height/2)-150;
if ((winWin4==null)|| winWin4.closed)
	winWin4=window.open(url,'','top='+sH+',left='+sW+',width=750,height=300,toolbar=no,directories=no,menubar=no,status=no,resizable=no,location=no,scrollbars=no,copyhistory=no,');
else
	{winWin4.location.href=url;
    winWin4.focus();}
}


function winOpen4de(url)
{
sW=(screen.width/2)-375;
sH=(screen.height/2)-180;
if ((winWin4==null)|| winWin4.closed)
	winWin4=window.open(url,'','top='+sH+',left='+sW+',width=750,height=360,toolbar=no,directories=no,menubar=no,status=no,resizable=no,location=no,scrollbars=no,copyhistory=no,');
else
	{winWin4.location.href=url;
    winWin4.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="#FFFFFF";
	else
		theELE.style.background="#E8E7E0";
	}

}

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.Termoplastica.it/index.php";
			break;
	case 2:document.location.href="http://www.Termoplastica.it/printer.php";
			break;
	case 3:winOpen("http://www.Termoplastica.es/");
		break;
	case 4:winOpen("http://www.Termoplasticausa.com/");
		break;
	case 5:winOpen("http://www.Termoplasticachina.com/");
		break;
	case 6:winOpen("http://www.Termoplastica.co.kr/");
		break;
	case 7:winOpen("http://www.Termoplastica.co.id/");
		break;
	}
/*["LANG"]=="FR"["LANG"]=="ES"["LANG"]=="DE"["LANG"]=="PT"*/
}

function checkContacts(str1)
{
var error =false;
if (document.contsForm.fld1.value == "")
        {
        error = true;
        }
if (document.contsForm.fld3.value == "")
        {
        error = true;
        }
if (error)
        {
        alert(str1);
		return false;
        }
document.contsForm.submit();
return true;
}

function checkContacts1(str1)
{
var error =false;
if ((document.contsForm.fld1.value == "")||(document.contsForm.fld3.value == "")||(document.contsForm.fld4.value == ""))
    {alert(str1);
	return false;}
document.contsForm.submit();
return true;
}

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 viewDOMANDA(t1,t2,mode)
{
ele1=document.getElementById('faq_domanda');
if ((ele1.style.display=='none')||(ele1.style.display==false))
	{if (navigator.appName.indexOf("Microsoft")==-1)
		ele1.style.display='table-row';
	else
		ele1.style.display='block';
	document.getElementById('linkTESTO').innerHTML=t2;}
else
	{ele1.style.display='none';
	document.getElementById('linkTESTO').innerHTML=t1;}
}


