	function invia(theForm, theField, theLang) {
		f = document.forms[theForm];
		theVal = f.elements[theField].value;

		if(theVal != "") {
			if(theField == "azienda") {
				theVDir = "";
			} else {
				el = f.elements[theField];
				theFather = document.getElementById(theVal);
				theLabel = theFather.parentNode.label;
				theVDir = theVal + "/" + theLabel + "_" + el.options[el.selectedIndex].text + "/";
			}

		//alert(theVDir);

			if(theLang == "it") {
				theVRoot = "abbigliamento-bambino";
				thePage = "risultati";
			} else {
				theVRoot = "child-apparel";
				thePage = "results";
			}


			f.action = theVRoot + "/" + theVDir.replace(" ", "") + thePage + ".html";
			//alert("abbigliamento-bambino/" + theVDir + "risultati.html");
			f.submit();
		} else {
			//alert("Inserire un valore nel campo " + theField + "!");
			//f.elements[theField].focus();
		}
	}

	function runSlideShow(){
	   if (document.all){
		  document.images.SlideShow.style.filter="blendTrans(duration=2)"
		  document.images.SlideShow.filters.blendTrans.Apply()      
	   }
	   document.images.SlideShow.src = preLoad[j].src
	   if (document.all){
		  document.images.SlideShow.filters.blendTrans.Play()
	   }
	   j = j + 1
	   if (j > (p-1)) j=0
	   t = setTimeout('runSlideShow()', slideShowSpeed)
	}

function inviaMail(theLang) {
	f = document.forms["formcontatti"];

	if (!campiVuoti('nome','Nome','Name','cognome','Cognome','Last Name','indirizzo','Indirizzo','Address','citta','Città','Country','telefono','Telefono','Telephone','email','E-mail','E-mail', theLang,f)) {
		f.submit();
	}

}

	function campiVuoti() {


		var args = campiVuoti.arguments;
		lLangArg = args.length-2;
		lFormArg = args.length-1;

		f = args[lFormArg];
		lLang = args[lLangArg];



		for (i=0;i<=args.length-4;i+=3) {
			if (f.elements[args[i]].value == '') {
				switch(lLang) {
					case "it":
						lAlert = "Il campo " + args[i+1] + " è obbligatorio.";
						break;

					case "en":
						lAlert = "The field " + args[i+2] + " is mandatory.";
						break;
				}
				alert (lAlert);
				f.elements[args[i]].focus();
				return true;
			}
		}
	}


function writeDate() {
	today = new Date();

	if(today.getMinutes() < 10) {
		pad = "0";
	} else {
		pad = "";
	}

	if((today.getHours() < 12) && (today.getHours() >= 6))
	{document.write("<FONT SIZE=1 face=Verdana color=C7C7C7><b>Buongiorno</b>! </FONT>")}

	if((today.getHours() >= 12) && (today.getHours() < 18))
	{document.write("<FONT SIZE=1 face=Verdana color=C7C7C7>Buon pomeriggio! </FONT>")}

	if((today.getHours() >= 18) && (today.getHours() <= 23))
	{document.write("<FONT SIZE=1 face=Verdana color=C7C7C7>Buonasera! </FONT>")}

	if((today.getHours() >= 0) && (today.getHours() < 4))
	{document.write("<FONT SIZE=1 face=Verdana color=C7C7C7>Buonanotte! </FONT>")}

	if((today.getHours() >= 4) && (today.getHours() <= 6))
	{document.write("<FONT SIZE=1 face=Verdana color=C7C7C7>Buon giorno! </FONT>")}

	document.write("<FONT SIZE=1 face=Verdana color=C7C7C7>Sono le ",today.getHours(),":",pad,today.getMinutes()," di ");

	var days = new Array(7)
	days[1] = "Domenica";
	days[2] = "Lunedì";
	days[3] = "Martedì";
	days[4] = "Mercoledì";
	days[5] = "Giovedì";
	days[6] = "Venerdì";
	days[7] = "Sabato";

	var months = new Array(12)
	months[1] = "Gennaio";
	months[2] = "Febbraio";
	months[3] = "Marzo";
	months[4] = "Aprile";
	months[5] = "Maggio";
	months[6] = "Giugno";
	months[7] = "Luglio";
	months[8] = "Agosto";
	months[9] = "Settembre";
	months[10] = "Ottobre";
	months[11] = "Novembre";
	months[12] = "Dicembre";


	var today = new Date();
	var day = days[today.getDay() + 1];
	var month = months[today.getMonth() + 1];
	var date = today.getDate();
	var year = today.getYear();

	document.write(day + " " + date + " " + month + ", " + year);
}