<!--
function caricaselect(select,val,txt,i,selected){

if(document.getElementById(select)){
	document.getElementById(select).options[i] = new Option(txt,val);
	document.getElementById(select).options[i].selected=selected;
	}
}


var loginsi;
loginsi=false;

// FUNZIONI ETA BAMBINI
function getObj(objID)
	{
	if (document.getElementById) {return document.getElementById(objID);}
	else if (document.all) {return document.all[objID];}
	else if (document.layers) {return document.layers[objID];}
	}
function ShowAges(r)
{
	var cRms=CRms(r);
	var dF=getObj('ageFrame');
	if(0==cRms)dF.style.display="none";
	else
	{
	ShowSels(r);
	if(dF.style.display=="none")
	{
	dF.style.visibility="hidden";
	dF.style.display="block";
	}
	dF.style.visibility="visible";
	
	}
}
function ShowSels(r)
{
	var da,iRm,iKd,ck;
	for(iRm=1;iRm<=7;iRm++)
	{
	ck=eval('document.getElementById("cam"+iRm+"bam")').value;
	for(iKd=1;iKd<=4;iKd++)
	{
	getObj('a'+iRm+iKd).style.display=(iKd<=ck)?"block":"none";
	}
	getObj('rk'+iRm).style.display=(ck>0&&iRm<=r)?"block":"none";
	
	}
	if(getObj('RmDrp') && getObj('RmDrp').style.display == "none")getObj('rk1').style.display="none";
}
function CRms(r)
{
	var i,n=0;
	for(i=1;i<=r;i++){n+=parseInt(eval('document.getElementById("cam"+i+"bam")').value);}
	return n;
}
function SKAR(r){SKARI(r);}
function SKARI(r)
{
	var iRm;
	for (iRm=1;iRm<=7;iRm++)
	{
	getObj('ageSel'+iRm).style.display=(iRm<=r)?"block":"none";
	
	}
	ShowAges(r);
}
function ShowIS(d,s){d.infant.style.display=(s==1)?"block":"none";}

//FINE FUZIONI ETA BAMBINI

function TogDisp(obj,flg){obj.style.display=(flg)?"block":"none";} 

function hide(){
	document.getElementById('divform').style.display="none";
	document.getElementById('divform1').style.display="none";
	document.getElementById('divform2').style.display="none";
	document.getElementById('divform3').style.display="none";
	document.getElementById('divform4').style.display="none";
	document.getElementById('divform5').style.display="none";
	document.getElementById('divform6').style.display="none";
	document.getElementById('divform7').style.display="none";
	document.getElementById('divform8').style.display="none";
	document.getElementById('divform9').style.display="none";
	document.getElementById('divinforma').style.display="none";
	document.getElementById('divinforma1').style.display="none";
	document.getElementById('divlogin').style.display="block";
	document.getElementById('divlogin2').style.display="block";
	document.getElementById('btngia').style.display="none";
	document.getElementById('nonbtngia').style.display="block";
	document.getElementById('reminddiv').style.display="block";
	document.getElementById('op').value="login";
	document.getElementById('Submit').disabled =false;
	loginsi=true;
	} 
	
	
function showdiv(){
	document.getElementById('divform').style.display="block";
	document.getElementById('divform1').style.display="block";
	document.getElementById('divform2').style.display="block";
	document.getElementById('divform3').style.display="block";
	document.getElementById('divform4').style.display="block";
	document.getElementById('divform5').style.display="block";
	document.getElementById('divform6').style.display="block";
	document.getElementById('divform7').style.display="block";
	document.getElementById('divform8').style.display="block";
	document.getElementById('divform9').style.display="block";
	document.getElementById('divinforma').style.display="block";
	document.getElementById('divinforma1').style.display="block";
	document.getElementById('divlogin').style.display="none";
	document.getElementById('divlogin2').style.display="none";
	document.getElementById('nonbtngia').style.display="none";
	document.getElementById('btngia').style.display="block";
	document.getElementById('reminddiv').style.display="none";
	document.getElementById('op').value="";
	document.getElementById('Submit').disabled =true;
	loginsi=true;
	} 
	
	
function caricasel(sel){
var selectobj=document.getElementById('statcome2');
	for (m=0;m<selectobj.options.length;m++)
	selectobj.options[m]=null;
	document.getElementById('divstatcome2').style.display='none';
	
	if (sel.value=='internet'){
	selectobj.options[0]=new Option('Google','google');
	selectobj.options[1]=new Option('Yahoo','yahoo');
	selectobj.options[2]=new Option('Msn','msn');
	selectobj.options[3]=new Option('Virgilio','virgilio');
	selectobj.options[4]=new Option('Libero','libero');
	selectobj.options[5]=new Option('Altro','altro');
	document.getElementById('divstatcome2').style.display='block';
	}
	if (sel.value=='stampa'){
	selectobj.options[0]=new Option('Tv sorrisi e canzoni','tv sorrisi e canzoni');
	selectobj.options[1]=new Option('Di più','di piu');
	selectobj.options[2]=new Option('Chi','chi');
	selectobj.options[3]=new Option('Repubblica','repubblica');
	selectobj.options[4]=new Option('Corriere delle sera','corriere delle sera');
	selectobj.options[5]=new Option('Altro','altro');
	document.getElementById('divstatcome2').style.display='block';
	}
	if (sel.value=='tv'){
	selectobj.options[0]=new Option('Rai','rai');
	selectobj.options[1]=new Option('Mediaset','mediaset');
	selectobj.options[2]=new Option('Altro','altro');
	document.getElementById('divstatcome2').style.display='block';
	}
}


function SRm()
{
	var cr=document.getElementById('crom').value;
	for (var i=2;i<=7;i++)
	{
	TogDisp(document.getElementById('ROn'+i+'1'),cr >=i);
	TogDisp(document.getElementById('ROn'+i+'2'),cr >=i);
	TogDisp(document.getElementById('ROn'+i+'3'),cr >=i);
	}
	//TogDisp(document.getElementById('ROn1'),cr !=1);
}


function Form_Validator(theForm){
	
	if ( !isDate(theForm.DATE_IN.value) ){
    	//alert("Please enter correct value for the \"CHECK-IN\" field.");
    	alert("Inserire la data di arrivo");
    	theForm.DATE_IN.focus();
    	return false;
	}
	if ( !CompareDate(theForm.DATE_IN_H.value,theForm.DATE_IN.value) ){
    	//alert("\"CHECK-OUT\" date must be later then \"CHECK-IN\" date.");
    	if (!confirm("Gentile navigatore la sua data di arrivo non corrisponde alla data del soggiorno della nostra offerta, se vuole modificare la data di arrivo clicchi su annulla, se invece, vuole confermare la sua richiesta d'informazioni con la nuova date clicchi su ok, un operatore la contatterà in brevissimo tempo al suo numero telefonico o via email."))
    	{
    	theForm.DATE_IN.focus();
    	return false;}
 	}
 	if ( !CompareDate(theForm.DATE_IN.value,theForm.DATE_OUT_H.value) ){
    	//alert("\"CHECK-OUT\" date must be later then \"CHECK-IN\" date.");
    	if (!confirm("Gentile navigatore la sua data di arrivo non corrisponde alla data del soggiorno della nostra offerta, se vuole modificare la data di arrivo clicchi su annulla, se invece, vuole confermare la sua richiesta d'informazioni con la nuova date clicchi su ok, un operatore la contatterà in brevissimo tempo al suo numero telefonico o via email."))
    	{
    	theForm.DATE_IN.focus();
    	return false;}
 	}
	if ( !isDate(theForm.DATE_OUT.value) ){
    	//alert("Please enter correct value for the \"CHECK-OUT\" field.");
    	alert("Inserire la data di partenza");
    	theForm.DATE_OUT.focus();
    	return false;
	}
	if ( !CompareDate(theForm.DATE_OUT.value,theForm.DATE_OUT_H.value) ){
    	if (!confirm("Gentile navigatore la sua data di partenza non corrisponde alla data del soggiorno della nostra offerta, se vuole modificare la data di partenza clicchi su annulla, se invece, vuole confermare la sua richiesta d'informazioni con la nuova date clicchi su ok, un operatore la contatterà in brevissimo tempo al suo numero telefonico o via email."))
    	{
    	theForm.DATE_OUT.focus();
    	return false;}
 	}
 	if ( !CompareDate(theForm.DATE_IN_H.value,theForm.DATE_OUT.value) ){
    	if (!confirm("Gentile navigatore la sua data di partenza non corrisponde alla data del soggiorno della nostra offerta, se vuole modificare la data di partenza clicchi su annulla, se invece, vuole confermare la sua richiesta d'informazioni con la nuova date clicchi su ok, un operatore la contatterà in brevissimo tempo al suo numero telefonico o via email."))
    	{
    	theForm.DATE_OUT.focus();
    	return false;}
 	}
 	
	if ( !CompareDate(theForm.DATE_IN.value,theForm.DATE_OUT.value) ){
    	//alert("\"CHECK-OUT\" date must be later then \"CHECK-IN\" date.");
    	alert("La data di partenza deve essere successiva alla data di arrivo");
    	theForm.DATE_OUT.focus();
    	return false;
 	}
 	
 	date_arr=theForm.DATE_IN.value;
	date_part=theForm.DATE_OUT.value;
	minstay=theForm.minstay.value;
	if ( (date_arr!="")&(date_part!="") ){
		year=date_arr.substring(6);
		day = date_arr.substring(0,2);
		month = date_arr.substring(3,5);
		month2=getMonthNumber(month);
		var Date_IN  = new Date( year, month, day);
		//alert(Date_IN);
		year=date_part.substring(6);
		day = date_part.substring(0,2);
		month = date_part.substring(3,5);
		month2=getMonthNumber(month);
		var Date_OUT  = new Date( year, month, day);
		//alert(Date_OUT);
		var MinMilli = 1000 * 60;
		var HrMilli = MinMilli * 60;
  		var DyMilli = HrMilli * 24;
		//--------------------------
		d1=Date_IN.getTime();
		d2=Date_OUT.getTime();
		diff=d2-d1;
		df=Math.round(diff/DyMilli);
		//alert (minstay);
		
		if(parseFloat(df) < minstay)
		{
			if (!confirm("Gentile navigatore il soggiorno minimo per l\'offerta da lei scelta e di "+ minstay +" gg, se vuole puo comunque chiedere informazioni per un soggiorno minore cliccando su ok o correggere la richiesta cliccando su annulla, un operatore la contatterà in brevissimo tempo al suo numero telefonico o via email."))
    			{
    			return false;
    			}
		}
	}	 
 	var cam1childNum = parseInt(theForm.cam1bam.value);
	for(var i = 1;i<=cam1childNum;i++){
		//alert(cam1childNum);
		if(getObj("age1"+i).value=="-1"){
			alert("specificare eta dei bambini");
			getObj("age1"+i).focus();
			return false;
		}
	}
	var camNum = parseInt(theForm.crom.value);
		for(var j =2;j<=camNum;j++){
		var childNum = parseInt(getObj("cam"+j+"bam").value);
		for(var i = 1;i<=childNum;i++){
			//alert(cam1childNum);
			if(getObj("age"+j+i).value=="-1"){
				alert("specificare eta dei bambini");
				getObj("age"+j+i).focus();
				return false;
			}
		}		
	}
	
 	
 	if ( theForm.nome.value=="" && !loginsi){
    	alert("Inserire il nome");
    	theForm.nome.focus();
    	return false;
	}
	if ( theForm.cognome.value=="" && !loginsi ){
    	alert("Inserire il cognome");
    	theForm.cognome.focus();
    	return false;
	}
	if ( theForm.citta.value=="" && !loginsi ){
    	alert("Inserire la città");
    	theForm.citta.focus();
    	return false;
	}
	if ( theForm.indirizzo.value=="" && !loginsi ){
    	alert("Inserire l'indirizzo");
    	theForm.indirizzo.focus();
    	return false;
	}
	if ( theForm.telefono.value=="" && !loginsi ){
    	alert("Inserire il telefono");
    	theForm.telefono.focus();
    	return false;
	}
	
	//alert (isEmail(theForm.email.value));
	
	if ( theForm.email.value=="" ){
    	alert("Inserire l'email");
    	theForm.email.focus();
    	return false;
	}else{
		if(!isEmail(theForm.email.value)){
			alert("L'email non è nel formato corretto");
    		theForm.email.focus();
    		return false;
		}
	}
	
	if ( theForm.password.value=="" && loginsi ){
    	alert("Inserire la password");
    	theForm.password.focus();
    	return false;
	}
}

function reminder(theForm){
	if ( theForm.email.value=="" ){
    	alert("Inserire l'email");
    	theForm.email.focus();
    	return false;
	}
	else
	{
		theForm.action="reminder.asp";
		theForm.submit();
	}
}

function privacys(){
//alert('ff');  
window.open("../privacy.htm","Informativa_sulla_privacy","width=363,height=427,toolbar=no,scrollbars=no,status=no,center=yes,resizable=yes,left=200,top=200");
}

-->
