function Check(form) 
{
	if (form.code.value=="" || form.code.value.lenght==0)
	{
		alert('Si prega di inserire il Codice Prodotto');
		form.code.focus();
		return false;
	} 
	return true;
}
function CheckContact(form) {
	if(form.name.value=="" || form.surname.value=="" || form.email.value=="" || form.request.value=="")
	{
		alert('I campi Nome, Cognome, E-Mail e Richiesta devono essere compilati');
		return false;
	} 
	return true;

}
function SwapForm(from)
{
	var to,setF=false;
	if(from.type=='password')
	{
		to=from.form.holder;
	}
	else 
	{
		to=from.form.password;
		setF=true;
	}
	if(setF || from.value=='')
	{
		to.style.display='block';
		from.style.display='none';
	}
	if(setF) to.focus();
}

function ValidateRequest(form)
{
	
	if(form.name.value=="" || form.company.value=="" || form.activity.value=="" || form.country.value==""  || form.phone.value==""  || form.email.value=="")
	{
		alert('I campi contrassegnati dall\'asterisco sono obbligatori \n Fields marked by * are mandatory\nLas preguntas indicadas con el asterisco, son obligatorias');
		return false;
	} 
	return true;

}
function ValidateContact(form)
{
	
	if(form.name.value=="" || form.company.value=="" || form.surname.value=="" || form.email.value=="" || form.request.value=="")
	{
		alert('I campi contrassegnati dall\'asterisco sono obbligatori \n Fields marked by * are mandatory\nLas preguntas indicadas con el asterisco, son obligatorias');
		return false;
	} 
	return true;

}
function ValidateEIH(form)
{
	
	if(form.risol.value=="" || form.risol.value <= 0 || form.risol.value > 10000 )
	{
		alert('Inserire la risoluzione desiderata\ntra 1 e 10.000');
		form.risol.focus();
		return false;
	} 
	 else if (form.serie.value=="EL" && form.alimentazione.value=="8/24")
	 {
		alert('Alimentazione 8-24V disponibile solo per la serie EH');
		form.alimentazione.focus();
		return false;
	}
	return true;
	return true;

}

var enablepersist="off"

if (document.getElementById){
	document.write('<style type="text/css">')
	document.write('.switchcontent{display:none;}')
	document.write('</style>')
}

function getElementbyClass(classname){
ccollect=new Array()
var inc=0
var alltags=document.all? document.all : document.getElementsByTagName("*")
for (i=0; i<alltags.length; i++){
	if (alltags[i].className==classname)
		ccollect[inc++]=alltags[i]
	}
}

function contractcontent(omit){
var inc=0
while (ccollect[inc]){
	if (ccollect[inc].id!=omit)
		ccollect[inc].style.display="none"
		inc++
	}
}

function expandcontent(cid){
if (typeof ccollect!="undefined"){
	contractcontent(cid)
	document.getElementById(cid).style.display=(document.getElementById(cid).style.display!="block")? "block" : "none"
	selectedItem=cid+"|"+document.getElementById(cid).style.display
}
}
function do_onload(){
getElementbyClass("switchcontent")
if (enablepersist=="on" && getselectedItem()!="")
	revivecontent()
}


if (window.addEventListener)
	window.addEventListener("load", do_onload, false)
else if (window.attachEvent)
	window.attachEvent("onload", do_onload)
else if (document.getElementById)
	window.onload=do_onload
