pic1 = new Image(18,18);
pic1.src = "img/foto1.jpg";
pic2 = new Image(18,18);
pic2.src = "img/foto2.jpg";
pic3 = new Image(18,18);
pic3.src = "img/foto3.jpg";
pic4 = new Image(18,18);
pic4.src = "img/foto4.jpg";

picNumAtt = 1;
NMaxFoto = 4;

function replacePic(imgDocID,imgObjName) 
	{
	document.images[imgDocID].src = eval(imgObjName + ".src")
	}

function changePic() 
	{
	passa1 = "pic1";
	passa2 = "pic" + picNumAtt;
	replacePic(passa1, passa2);

	picNumAtt++
	
	if(picNumAtt > NMaxFoto)
		picNumAtt = 1;

	setTimeout("changePic();", 4000);
	}

function openInfoWind(fileName) 
	{
	msg=open(fileName,"","toolbar=no,scrollbars=yes,directories=no,menubar=no,width=580,height=500,resizable=no");
	}



function mOvrN(element)
	{
	element.bgColor = '#70B7FF'
	element.style.cursor = 'hand'; 
	}

function mClkN(element, tipo) { 
	if(event.srcElement.tagName=='TD'){
		if(tipo == "Home")
			parent.centro.location.href = "ita/home.asp"	
		if(tipo == "Condizioni")
			parent.centro.location.href = "Condizioni.asp"	
		if(tipo == "Carrello")
			parent.centro.location.href = "VisCarrello.asp"	
		if(tipo == "Prodotti")
			parent.centro.location.href = "ecommerce.asp"	
	}
}

function mOutN(element)
	{
	element.bgColor = '#0000AF'
	element.style.cursor = 'default'; 
	}


function mOvr(src, color) { 
	if (!src.contains(event.fromElement)) { 
		src.style.cursor = 'hand'; 
		src.bgColor = color; 
		//src.fontcolor('#ff0000')
		//src.children.tags('A')[0]. = '#ff0000'
	}
}

function mOut(src, color) { 
	if (!src.contains(event.toElement)) { 
		src.style.cursor = 'default'; 
		src.bgColor = color; 
	}
}

function mClk(src) { 
	if(event.srcElement.tagName=='TD'){
		src.children.tags('A')[0].click();
	}
}


function changeRiga(tipo)
	{
	if(tipo == "ecommerce") 
		parent.riga.location.href = "RigaEcomm.asp"		
	if(tipo == "normale") 
		parent.riga.location.href = "RigaNorm.htm"		
	}


function validateOrd(form)
	{
	if (form.Cognome.value=="") 
		{
		alert("Inserire il cognome!");
		return false; 
		}
	if (form.Nome.value=="") 
		{
		alert("Inserire il nome!");
		return false; 
		}

	if (form.Azienda.value=="") 
		{
		alert("Inserire il l'Azienda!");
		return false; 
		}
	if (form.Indirizzo.value=="") 
		{
		alert("Inserire l'indirizzo!");
		return false; 
		}

	if (form.Citta.value=="") 
		{
		alert("Inserire la Cittą!");
		return false; 
		}

	if (form.Provincia.value=="") 
		{
		alert("Inserire il la Provincia!");
		return false; 
		}
	
	if (form.CAP.value=="") 
		{
		alert("Inserire il CAP!");
		return false; 
		}

	if (form.Tel.value=="") 
		{
		alert("Inserire il Telefono!");
		return false; 
		}

	var s = form.Mail.value 
	if (s.search("@")== -1 || s.search(".")== -1)
		{
		alert("Inserire un indirizzo email corretto!");
		return false; 
		}

	if (form.PIva.value=="") 
		{
		alert("Inserire il Codice Fiscale / Partita IVA!");
		return false; 
		}

	if (form.condizione.value == "nonaccetto") 
		{
		alert("Impossibile procedere se non si accettano\nle condizioni sulla tutela dei dati personali.");
		return false; 
		}
	
	return true;
	}





function validate(form, lang) {	
	if (form.Cognome.value=="") 
	{
		if (lang =="ita")
		{
			alert("Inserire il cognome!");
			return false; 
		}
		if (lang =="eng")
		{
			alert("Insert the surname!");
			return false; 
		}
		if (lang =="fra")
		{
			alert("Insert the surname!");
			return false; 
		}
	}
	
	
	if (form.Nome.value=="") 
	{
		if (lang =="ita")
		{
			alert("Inserire il nome!");
			return false; 
		}
		if (lang =="eng")
		{
			alert("Insert the name!");
			return false; 
		}
		if (lang =="fra")
		{
			alert("Insert the surname!");
			return false; 
		}
	}
		
	
	var s = form.Mail.value 
	
	if (s.search("@")== -1 || s.search(".")== -1)
	{
		if (lang =="ita")
		{
			alert("Inserire un indirizzo email corretto!");
			return false; 
		}
		if (lang =="eng")
		{
			alert("Insert a valid address email!");
			return false; 
		}
		if (lang =="fra")
		{
			alert("Inserire un indirizzo email corretto!");
			return false; 
		}
	}
		

	if (form.condizione.value == "nonaccetto") 
	{
		if (lang =="ita")
		{
			alert("Impossibile procedere se non si accettano\nle condizioni sulla tutela dei dati personali.");
			return false; 
		}
		if (lang =="eng")
		{
			alert("Impossible to proceed if the condition on the\nprotection of the personal data are not accept.");
			return false; 
		}
		if (lang =="fra")
		{
			alert("Impossibile procedere se non si accettano\nle condizioni sulla tutela dei dati personali.");
			return false; 
		}
	}
	
	else { return true; }
}
