
function filladdresses(){
	var content = document.getElementById("address").value;
	if(document.getElementById("theaddress").value == ""){
	document.getElementById("theaddress").value = content;
	}else{
	document.getElementById("theaddress2").value = content;
	}
	
}
function cambia(whattapage){
var whattadiv = document.getElementById("rigtharea");
/*whattadiv.style.display = 'none';
whattadiv.style.display = 'block';*/
whattadiv.innerHTML = "";
whattadiv.innerHTML = "<iframe name='context' id='context' src='"+whattapage+"' width='100%' height='500px'> </iframe>";
} 

function changeagain(){
document.getElementById("cordilatcasa").value = "";
document.getElementById("cordilongcasa").value = "";
document.getElementById("cordilatlavoro").value = "";
document.getElementById("cordilonglavoro").value = "";
document.getElementById("address").value = "";
document.getElementById("startaddress").style.display = "block";
document.getElementById("arriveaddress").style.display = "none";
}
function showmore(){
document.getElementById("otherdata").style.display = "block";
}



<!-- SCRIPT NO MAP -->

var point;
function hideShowstr(whatta, choice){
var choiceddiv = document.getElementById(whatta);
choiceddiv.style.display = choice;
}
function firstok(){
document.getElementById("startaddress").style.display = "none";
document.getElementById("arriveaddress").style.display = "block";
document.getElementById("address").value = "";
}
function memocordi(stringacordi){
	if(document.getElementById("cordilongcasa").value != ""){
		fettastr = stringacordi.toString();
		var punto = fettastr.indexOf(",")
		document.getElementById("cordilatlavoro").value = fettastr.substring(1, punto);
		var punto2 = fettastr.indexOf(")", punto);
		document.getElementById("cordilonglavoro").value = fettastr.substring(punto + 1, punto2);
		document.getElementById("shouldissig").style.display = "block";
	}else{
	
		fettastr = stringacordi.toString();
		var punto = fettastr.indexOf(",")
		document.getElementById("cordilatcasa").value = fettastr.substring(1, punto);
		var punto2 = fettastr.indexOf(")", punto);
		document.getElementById("cordilongcasa").value = fettastr.substring(punto + 1, punto2);
		firstok();
		}
	
}
function caricali(){
var firstfield = document.getElementById("cordilatcasa").value
var secondfield = document.getElementById("cordilongcasa").value
var thirdfield = document.getElementById("cordilatlavoro").value
var fourtfield = document.getElementById("cordilonglavoro").value
document.getElementById("cordistartlat").value = firstfield;
document.getElementById("cordistartlong").value = secondfield;
document.getElementById("cordiarrivelat").value = thirdfield;
document.getElementById("cordiarrivelong").value = fourtfield;
}


 //<![CDATA[
    var map = null;
    var geocoder = null;
    function load() {
      if (GBrowserIsCompatible()) {
 map = new GMap2(document.getElementById("map"));
 
 /*mappa - satellite - ibrida */
 map.addControl(new GMapTypeControl());
 
 /*controller con barra vert*/
 map.addControl(new GLargeMapControl());
 
 /*zoom box, in basso a dx*/
 map.addControl(new GOverviewMapControl(),
 new GControlPosition(G_ANCHOR_BOTTOM_RIGHT, new GSize(9, 9)));
 /*COORDINATE DI PARTENZA DELLA MAPPA*/
 map.setCenter(new GLatLng(45.463,  9.188), 12);
 geocoder = new GClientGeocoder();
      }
    }
 /*cerca un indirizzo*/
    function showAddress(address) {
   		if (geocoder) {
        geocoder.getLatLng(
          address,
          function(point) {
            if (!point) {
           } else {
             filladdresses();
   /*zoom*/	memocordi(point);
              map.setCenter(point, 14);
              var marker = new GMarker(point);
              map.addOverlay(marker);
              marker.openInfoWindowHtml(address);
              }
          }
        );
      }
    }
    //]]>
    
    /*function comparizione(whattaposition){
   
  		 var dynalevel = document.getElementById("dynamicdiv");
  		dynalevel.style.display = "block";
  		dynalevel.style.top=  whattaposition;
    }
    function scompari(){
    document.getElementById("dynamicdiv").style.display = "none";
    }*/
    function verifica(){
    	var primapass = document.getElementById("pw").value;
    	var secondpass = document.getElementById("confpass").value;
    	if(primapass == secondpass){
    		var valmail = document.getElementById("lamail").value;
    			if(valmail.search(/^\w+((-\w+)|(\.\w+))*\@\w+((\.|-)\w+)*\.\w+$/) != -1){
    			return true;
    			}else{
    			alert("inserire una mail valida");
    			return false;
    			
    			}
    	}else{
    	alert("le password inserite sono diverse");
    		return false;
    		
    	}
    }
function conferma(){

	if(confirm("conferma cancellazione")){
		return true;
		}else{
		return false;
	}
}
function chiudi(){
	document.getElementById("delayexplain").style.display = "none";
}
function gointer(){
	var elemento = document.getElementById("spaninter");
	elemento.style.fontSize = "16px";
	elemento.style.textTransform = "uppercase";
	
}
function ritornagointer(){
	var elemento = document.getElementById("spaninter");
	elemento.style.fontSize = "9px";
	elemento.style.textTransform = "none";
	
}
function today(cheanno, chemese, chegiorno, cheora, cheminuto){
var ilmese ="";
var theday ="";
	var otiempo = new Date()
	var oanno = otiempo.getFullYear();
	var omese = otiempo.getMonth();
	var ogiorno = otiempo.getDate();
	var aora = otiempo.getHours();
	var ominuto = otiempo.getMinutes();
	document.getElementById(cheanno).value = oanno;
	switch(omese){
		case 0:
		ilmese = "01";
		break;
		case 1:
		ilmese = "02";
		break;
		case 2:
		ilmese = "03";
		break;
		case 3:
		ilmese = "04";
		break;
		case 4:
		ilmese = "05";
		break;
		case 5:
		ilmese = "06";
		break;
		case 6:
		ilmese = "07";
		break;
		case 7:
		ilmese = "08";
		break;
		case 8:
		ilmese = "09";
		break;
		case 9:
		ilmese = "10";
		break;
		case 10:
		ilmese = "11";
		break;
		case 11:
		ilmese = "12";
		break;
	}
	if(ogiorno < 10){
	theday = "0" + ogiorno;
	}else{
		theday = ogiorno;
	}
	document.getElementById(chemese).value = ilmese;
	document.getElementById(chegiorno).value = theday;
	if(aora < 10){
		document.getElementById(cheora).value = "0" + aora;
	}else{
	document.getElementById(cheora).value = aora;
	}
	if(ominuto < 10){
	document.getElementById(cheminuto).value = "0" + ominuto;
	}else{
		document.getElementById(cheminuto).value = ominuto;
	}
} 


function mostraday(){
	document.getElementById("day").style.display = "inline";
	
}
function hideday(){
	document.getElementById("day").style.display = "none";
	
}
function mailservper(){
	var quale = document.getElementById("mittente").value;
	if(quale == "null"){
		document.getElementById("mittente").value = "Inserire vostra mail";
	}
}
function mostarora(){
	var data3 = new Date();
	var ora3 = data3.getHours();
	var minutes3 = data3.getMinutes();
	document.getElementById("hour2").value = ora3;
	document.getElementById("minute2").value = minutes3;
	document.getElementById("joinselect").style.display = "inline";
	}
function hideora(){
	document.getElementById("joinselect").style.display = "none";
	document.getElementById("hour2").value = "no";
	document.getElementById("minute2").value = "no";
	}
	function trattagiorno(scelta){
		if(scelta == "no"){
			document.getElementById("whattaday").style.display = "none";
		}else{
			var otiempo2 = new Date();
			var giorno2 = otiempo2.getDate();
			document.getElementById("day2").value = giorno2;
			document.getElementById("whattaday").style.display = "inline";
			
		}
	}
	function azzeragiorno(){
		document.getElementById("day2").value = "no";
		document.getElementById("hour2").value = "no";
		document.getElementById("minute2").value = "no";
		
	}
	
function controllo(primoc, secondoc){
	var campo1 = document.getElementById(primoc).value;
	var campo2 = document.getElementById(secondoc).value;
	if((campo1 == "") || (vampo2 == "")){
		return false;
		alert("inserire user e password");
	}else{
		return true;
	}
}