


var d=new Date();
var monthname=new Array("0","Jenuary","February","March","April","May","June","July","August","September","October","November","Dicember");
var TODAY =   d.getDate() + ", " + monthname[d.getMonth()+1] +" " + d.getFullYear();


var mese=new Array("0","Gennaio","Febbraio","Marzo","Aprile","Maggio","Giugno","Luglio","Agosto","Settembre","Ottobre","Novembre","Dicembre");
var OGGI =   d.getDate() + ", " + mese[d.getMonth()+1] +" " + d.getFullYear();



var monnat=new Array("0","Jannuar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember");

var TAGE =   d.getDate() + ", " + monnat[d.getMonth()+1] +" " + d.getFullYear();


function check(obj){
	
	if(obj.checked==true && obj.name=='naples'){
	 document.getElementById("napoli").style.visibility="visible";
	  document.getElementById("sal").checked=false
	  document.getElementById("salerno").style.visibility="hidden";
	}else if(obj.checked==false  && obj.name=='naples' ){
	 document.getElementById("napoli").style.visibility="hidden";
	
	}
	if(obj.checked==true && obj.name=='sal'){
	 document.getElementById("salerno").style.visibility="visible";
	  document.getElementById("naples").checked=false
	  document.getElementById("napoli").style.visibility="hidden";
	}else if(obj.checked==false  && obj.name=='sal'){
	 document.getElementById("salerno").style.visibility="hidden";
	
	}
	
}

function DoSubmitDE(obj) {
				
				
			
			     var iday=obj.PICKUP_DAY.value;
				 var rday=obj.RETURN_DAY.value;
				 var  imonth=0;
				 imonth=obj.PICKUP_MONTH.value;
				 var rmonth=0;
				 				 rmonth=obj.RETURN_MONTH.value;
		   
			var as=obj.as;
			var ag=obj.ag;
	        var naples=obj.naples;
			var c=obj.c;
			var b=obj.b;
			var p=obj.p;
			  var sal=obj.sal;
			var as1=obj.as1;
			var ag1=obj.ag1;
		  var sm=obj.sm;
		  var sm1=obj.sm1;
			var c1=obj.c1;
			var b1=obj.b1;
			var p1=obj.p1;
			var i=0;
		    var d=0;
			 var f=0;
			
		    var submitform = true;   
				var error      = ' Achtung\n\n';
				error         += '   \n\n';


	if(naples.checked){
		    d++;
			f++;
		}
		if(sal.checked){
		    d++;
			f++;
		}
			if(as.checked)
		d++;
		if(c.checked)
		d++;
		if(b.checked)
		d++;
		if(p.checked)
		d++;
		if(ag.checked)
		d++;
		if(sm.checked)
		d++;
		
			
		
		if(as.checked)
		f++;
		if(c1.checked)
		f++;
		if(b1.checked)
		f++;
		if(p1.checked)
		f++;
		if(ag1.checked)
		f++;
		if(sm1.checked)
		f++;
		
			
	
		
			 
	if (d>1){
			
			error     += '    + Bitte nur ein Hacken Klicken bei namietung \n';
				submitform = false;
				obj.s.value=0;
				}		 
				
				
						 
	
			if ((rmonth-imonth) >=2 ){
			
			error     += '    + Eine Vermietung kann nur auf 1 Monat erfolgen  \n';
				submitform = false;
				obj.s.value=0;
				}
				
				if  ((imonth ==4 || imonth==6 || imonth==9 || imonth==11 )&& (parseInt(iday) > 30 )){
			
				error     += '    + Bei Beginn der Vermietung beachten Sie die Monaten mit 30 Tage   \n';
				submitform = false;
				obj.s.value=0;
				}
				
				if  ((rmonth ==4 || rmonth==6 || rmonth==9 || rmonth==11) && parseInt(rday) > 30){
			
				error     += '    + Bei Beendigung der Vermietung beachten Sie die Monaten mit 30 Tage  \n';
				submitform = false;
				obj.s.value=0;
				}
				
				
				if((imonth==2) && parseInt(iday) > 28 ){
				
				error     += '    + Bei Beginn der Vermietung beachten Sie die Monaten mit 28 Tage   \n ';
				submitform = false;
				obj.s.value=0;
				}
				
				if((rmonth==2) && parseInt(rday) > 28){
				
				error     += '    + Bei Beendigung der Vermietung beachten Sie die Monaten mit 28 Tage \n';
				submitform = false;
				obj.s.value=0;
				}
				
				if ( parseInt(rmonth) < parseInt(imonth) ) {
error     += '    + Der Beginn der Vermietung kann nicht mindert sein als die Beendigung der  Vermietung   \n'   ;
				submitform = false;
				obj.s.value=0;
				}
				
				if ((parseInt(iday) == parseInt(rday))  && (imonth==rmonth)) {
error     += '    + Die Mietdauer beträgt weniger als 24 Stunden. Bitte geben Sie mindestens 1 Tag als Mietdauer ein, auch wenn Sie den Wagen weniger als 1 Tag anmieten möchten  \n';
				submitform = false;
				obj.s.value=0;
				}
				
				if (imonth==rmonth && parseInt(iday) > parseInt(rday) )  {
				error     += '    + Der Abgabetermin liegt vor dem Anmietterming \n' ;
				submitform = false;
				obj.s.value=0;
				}
				
				
				
				
				
				if (submitform) {
				obj.submit();
				}
				else {
				error += '\n**************************************************\n\n';
				alert (error);
				return false;
				}
}




function DoSubmitIT(obj) {
			
				
		
			     var iday=obj.PICKUP_DAY.value;
				 var rday=obj.RETURN_DAY.value;
				 var imonth=obj.PICKUP_MONTH.value;
				 var rmonth=obj.RETURN_MONTH.value;
		    var sa=obj.sa;
			var as=obj.as;
			var ag=obj.ag;
		   
			var naples=obj.naples;
			var c=obj.c;
			var b=obj.b;
			var p=obj.p;
			  var sal=obj.sal;
			var as1=obj.as1;
			var ag1=obj.ag1;
		  var sm=obj.sm;
		  var sm1=obj.sm1;
			var c1=obj.c1;
			var b1=obj.b1;
			var p1=obj.p1;
			var i=0;
		    var d=0;
			 var f=0;
			
		       
				var submitform = true;
				var error      = ' Attenzione\n\n';
				error         += '   \n\n';
		
		
		
			if(naples.checked){
		    d++;
			f++;
		}
		if(sal.checked){
		    d++;
			f++;
		}
		
		
		if(as.checked)
		d++;
		if(c.checked)
		d++;
		if(b.checked)
		d++;
		if(p.checked)
		d++;
		if(ag.checked)
		d++;
		if(sm.checked)
		d++;
		
		if(as.checked)
		f++;
		if(c1.checked)
		f++;
		if(b1.checked)
		f++;
		if(p1.checked)
		f++;
	
		if(sm1.checked)
		f++;
		
		if(ag1.checked)
		f++;	
		
	if (d>1){
			
			error     += '    + E possibile scegliere un solo luogo di consegna  \n';
				submitform = false;
				obj.s.value=0;
				}		
			
		if (f>1){
			
			error     += '    + E possibile scegliere un solo luogo di ripresa  \n';
				submitform = false;
				obj.s.value=0;
				}
				
				if ((parseInt(iday) == parseInt(rday))  && (imonth==rmonth)) {
error     += '    + Selezionare almeno 1 giorno di noleggio  \n';
				submitform = false;
				obj.s.value=0;
				}
			if ((rmonth-imonth) >=2 ){
			
			error     += '    + Noleggio  consentito per massimo 25 giorni.Per info su noleggi superiori chiamare il 3356389719  \n';
				submitform = false;
				obj.s.value=0;
				}
				
				if  ((imonth ==4 || imonth==6 || imonth==9 || imonth==11 )&& (parseInt(iday) > 30 )){
			
				error     += '    + il campo mese di inzio Noleggio e di 30 giorni  \n';
				submitform = false;
				obj.s.value=0;
				}
				
				if  ((rmonth ==4 || rmonth==6 || rmonth==9 || rmonth==11) && parseInt(rday) > 30){
			
				error     += '    + il campo mese di fine Noleggio e di 30 giorni  \n';
				submitform = false;
				obj.s.value=0;
				}
				
				
				if((imonth==2) && parseInt(iday) > 28 ){
				
				error     += '    + il campo mese di inizio Noleggio e di 28  \n ';
				submitform = false;
				obj.s.value=0;
				}
				
				if((rmonth==2) && parseInt(rday) > 28){
				
				error     += '    + il campo mese di fine Noleggio e di 28 giorni  \n';
				submitform = false;
				obj.s.value=0;
				}

			
				
				if (imonth==rmonth && parseInt(iday) > parseInt(rday) )  {
				error     += '    +  il giorno di inizio noleggio non puo essere maggiore del giorno di fine noleggio \n';
				submitform = false;
				obj.s.value=0;
				}
				
				
				
				
				
				if (submitform) {
				obj.submit();
				}
				else {
				error += '\n**************************************************\n\n';
				alert (error);
				return false;
				}
}
			



function DoSubmitEN(obj) {
					
					
				var submitform = true;
			
			     var iday=obj.PICKUP_DAY.value;
				 var rday=obj.RETURN_DAY.value;
				 var imonth=obj.PICKUP_MONTH.value;
				 var rmonth=obj.RETURN_MONTH.value;
		
			var monthname=new Array("","Jenuary","February","March","April","May","June","July","August","September","Oktober","November","Dicember");
			

			var as=obj.as;
			var ag=obj.ag;
		    var napr=obj;
			var naples=obj.naples;
			var c=obj.c;
			var b=obj.b;
			var p=obj.p;
			  var sal=obj.sal;
			var as1=obj.as1;
			var ag1=obj.ag1;
		  var sm=obj.sm;
		  var sm1=obj.sm1;
			var c1=obj.c1;
			var b1=obj.b1;
			var p1=obj.p1;
			var i=0;
		    var d=0;
			var f=0;
		       
				var submitform = true;
				
				var error         = ' Warning :   \n\n';

	
			if(naples.checked){
		    d++;
			f++;
		}
		if(sal.checked){
		    d++;
			f++;
		}
		
		
		if(as.checked)
		d++;
		if(c.checked)
		d++;
		if(b.checked)
		d++;
		if(p.checked)
		d++;
		if(ag.checked)
		d++;
		if(sm.checked)
		d++;
		
		if(as.checked)
		f++;
		if(c1.checked)
		f++;
		if(b1.checked)
		f++;
		if(p1.checked)
		f++;
	
		if(sm1.checked)
		f++;
		
		if(ag1.checked)
		f++;	
		
			if (d>1){
					
			    error     += '    + choose one place of delivery   \n';
				submitform=false;
				//obj.s.value=0;
				}	
			
		if (f>1){
			
			error     += '    + choose one place of  collection  \n';
				submitform = false;
				obj.s.value=0;
				}	      
				

			if ((rmonth-imonth) >1){
			
			error     += '    + We may be unable to offer you a car due to the duration requested.Call us on 0039 3356389719 for furter information  \n';
				submitform = false;
				obj.s.value=0;
				}
				
				if  ((imonth ==4 || imonth==6 || imonth==9 || imonth==11 )&& (parseInt(iday) > 30 )){
			
				error     += '    + The month of start rental is of 30 days  \n';
				submitform = false;
				obj.s.value=0;
				}
				
				if  ((rmonth ==4 || rmonth==6 || rmonth==9 || rmonth==11) && parseInt(rday) > 30){
			
				error     += '    + The month of end rental is of 30 days  \n';
				submitform = false;
				obj.s.value=0;
				}
				
				
				if((imonth==2) && parseInt(iday) > 28 ){
				
				error     += '    + The month of start rental is of 28 days   \n ';
				submitform = false;
				obj.s.value=0;
				}
				
				
			if ((parseInt(iday) == parseInt(rday))  && (imonth==rmonth)) {
error     += '    + Please enter a pick-up and drop-off date  \n';
				submitform = false;
				obj.s.value=0;
				}
				
				
				if((rmonth==2) && parseInt(rday) > 28){
				
				error     += '    + The month of end rental is of 28 days  \n';
				submitform = false;
				obj.s.value=0;
				}
				
				if (parseInt(imonth) > parseInt(rmonth) ) {
error     += '    + the month of end rental is before of start rental month   \n';
				submitform = false;
				obj.s.value=0;
				}
				
				if (imonth==rmonth && parseInt(iday) > parseInt(rday) )  {
				error     += '    +  Drop off date is before the pick up date.Please re-enter \n';
				submitform = false;
				obj.s.value=0;
				}
				
				
				
				
	
				
				if (submitform) {
				obj.submit();
				}
				else {
				error += '\n**************************************************\n\n';
				alert (error);
				return false;
				}
}



var popUpWin=0;
function Popup(URLStr, left, top, width, height)
{
  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }
  popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menub ar=no,scrollbars=yes,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}


           function handleMouseMove(oEvent) {
                var oDiv = document.getElementById("null");
                oDiv.style.left = oEvent.clientX-250;
                oDiv.style.top=oEvent.clientY;
			}
	
            function handleEvent(oEvent,image) {
                var img = document.getElementById("image");
                img.src= "./images/tratti/"+image;
            }
      
	function myfunc(lan){
		
	if(lan=="it")
	lan=mese;
	if(lan=="en")
	lan=monthname;
	if(lan=="de")
	lan=monnat;
	
document.write("<select name='PICKUP_DAY'  >");
		
	
		var v;
		for(v=1;v<=31;v++){
		if(v!= d.getDate()){
		 document.write("<option value='"+v+"'> "+v+"</option>");
		}else{
		document.write("<option value='"+v+"'selected>"+v+"</option>");
		}  }
		document.write("</select> <SELECT NAME='PICKUP_MONTH'  >");
		
     document.write("<option value=''> </option>");        
			 
			  var v;
		for(v=1;v<13;v++){
		if(v!= (d.getMonth()+1)){
		 document.write("<option value='"+v+"'> "+lan[v]+"</option>");
		}else{
	document.write("<option value='"+v+"'selected>"+lan[v]+"</option>");
		}  
}
               
          document.write("  </SELECT></td> <td class='Stile4'> </td> <td class='Stile4'><select name='RETURN_DAY'  >");
       
       
     
	
		
		for(v=1;v<=31;v++){
		if(v!= d.getDate()){
		 document.write("<option value='"+v+"'> "+v+"</option>");
		}else{
		document.write("<option value='"+v+"'selected>"+v+"</option>");
		}  }
		document.write("</select><SELECT NAME='RETURN_MONTH'  >");
		
              
			document.write("<option value=''> </option>");
			 
		for(v=1;v <13;v++){
		if(v!= (d.getMonth()+1)){
		 document.write("<option value='"+v+"'> "+lan[v]+"</option>");
		}else{
		document.write("<option value='"+v+"'selected>"+lan[v]+"</option>");
	
	}  

}
               
            
            document.write("</SELECT>");
	}
	
	
	
	function myfunct(lan){
		
	if(lan=="it")
	lan=mese;
	if(lan=="en")
	lan=monthname;
	if(lan=="de")
	lan=monnat;
	
document.write("<select name='PICKUP_DAY'  >");
		
	
		var v;
		for(v=1;v<=31;v++){
		if(v!= d.getDate()){
		 document.write("<option value='"+v+"'> "+v+"</option>");
		}else{
		document.write("<option value='"+v+"'selected>"+v+"</option>");
		}  }
		document.write("</select> <SELECT NAME='PICKUP_MONTH'  >");
		
     document.write("<option value=''> </option>");        
			 
			  var v;
		for(v=1;v<13;v++){
		if(v!= (d.getMonth()+1)){
		 document.write("<option value='"+v+"'> "+lan[v]+"</option>");
		}else{
	document.write("<option value='"+v+"'selected>"+lan[v]+"</option>");
		}  
}
               
          document.write("  </SELECT> ");


	}
	
	
	
	
	function myfunct2(lan){
		
	if(lan=="it")
	lan=mese;
	if(lan=="en")
	lan=monthname;
	if(lan=="de")
	lan=monnat;
	
document.write("<select name='PICKUP_DAY2'  >");
		
	
		var v;
		for(v=1;v<=31;v++){
		if(v!= d.getDate()){
		 document.write("<option value='"+v+"'> "+v+"</option>");
		}else{
		document.write("<option value='"+v+"'selected>"+v+"</option>");
		}  }
		document.write("</select> <SELECT NAME='PICKUP_MONTH2'  >");
		
     document.write("<option value=''> </option>");        
			 
			  var v;
		for(v=1;v<13;v++){
		if(v!= (d.getMonth()+1)){
		 document.write("<option value='"+v+"'> "+lan[v]+"</option>");
		}else{
	document.write("<option value='"+v+"'selected>"+lan[v]+"</option>");
		}  
}
               
          document.write("  </SELECT>");
	}
	
	
	
	