var geo = new GClientGeocoder();
//Messaggi di errori in caso mancata geocoding (da usare in inserimento etc etc)
var reasons=[];
	 	reasons[G_GEO_SUCCESS]            = "Success";
	 	reasons[G_GEO_MISSING_ADDRESS]    = "Missing Address: The address was either missing or had no value.";
	 	reasons[G_GEO_UNKNOWN_ADDRESS]    = "Unknown Address:  No corresponding geographic location could be found for the specified address.";
	 	reasons[G_GEO_UNAVAILABLE_ADDRESS]= "Unavailable Address:  The geocode for the given address cannot be returned due to legal or contractual reasons.";
	 	reasons[G_GEO_BAD_KEY]            = "Bad Key: The API key is either invalid or does not match the domain for which it was given";
	 	reasons[G_GEO_TOO_MANY_QUERIES]   = "Too Many Queries: The daily geocoding quota for this site has been exceeded.";
	 	reasons[G_GEO_SERVER_ERROR]       = "Server error: The geocoding request could not be successfully processed.";
	 	
	 	
//FUNZIONI PER LA GESTIONE DEL LOGIN - template.jsp
	var viewLoginState = 'off';
	function loginView(){
		if (viewLoginState == 'off'){
			document.getElementById("divLogin").style.display = 'inline';
			viewLoginState = 'on';
		}else{
			document.getElementById("divLogin").style.display = 'none';
			viewLoginState = 'off';
		}
	}

	function loginReset(){
		document.getElementById("loginUser").value = '';
		document.getElementById("loginPwd").value = '';	
	}

	function loginSubmit(){
		if (document.getElementById("loginUser").value != ''){
			if (document.getElementById("loginPwd").value != ''){
				document.getElementById("loginForm").submit();
			}
		}
	}
	
//FUNZIONI PER LA GESTIONE DEGLI INSERIMENTI POST - addPost.jsp

	function addpostSubmit(){
		    if (document.getElementById("titolo").value == ''){
		    	alert("Attenzione, il titolo dell'articolo non è stato inserito");
		    }else if (document.getElementById("provincia").value == ''){
		    	alert("Attenzione, nessuna provincia selezionata");
		    }else if (document.getElementById("prezzo").value == ''){
		    	alert("Attenzione, non è stato inserita alcuna informazione relativa al prezzo");
		    }else if (!IsNumeric(document.getElementById("prezzo").value)){
		    	alert('Attenzione, nel campo prezzo è possibile inserire solo numeri');
		    	document.getElementById("prezzo").value = '';
			}else if (document.getElementById("prezzo").value < 50){
				alert("Attenzione, un prezzo inferiore a 50 Euro probabilmente non è veritiero");    	
		    }else if (document.getElementById("coordinate") != null){
				document.getElementById("postForm").submit();	
			}else{
				if (document.getElementById("indirizzo").value != ''){
					//CHIAMATA GOOGLE API GEOCODING
					getCoordinate(document.getElementById("indirizzo").value);
				}else{
					alert("Attenzione, è necessario specificare un indirizzo");
				}				
			}
	}
	
	function addpostReset(){		
		document.getElementById("postForm").reset();			
		document.getElementById("risultatiApiGoogle").innerHTML = "";
	}
	
	function adduniSubmit(){
		    if (document.getElementById("nome").value == ''){
		    	alert("Attenzione, il nome dell'Universita");
		    }else if (document.getElementById("link").value == ''){
		    	alert("Attenzione, inserire il link del sito web");
		    }else if (document.getElementById("coordinate") != null){
				document.getElementById("postForm").submit();	
			}else{
				if (document.getElementById("indirizzo").value != ''){
					//CHIAMATA GOOGLE API GEOCODING
					getCoordinate(document.getElementById("indirizzo").value);
				}else{
					alert("Attenzione, è necessario specificare un indirizzo");
				}				
			}
	}	

//FUNZIONI PER LA GESTIONE DEGLI INSERIMENTI DI ELEMENTI MULTIMEDIALI DEI POST - addPostTwo.jsp

	function addpostTwoSubmit(){
			var video = document.getElementById("video").value;
			var objectStart = video.substr(0,7);
			var objectEnd = video.substr(video.length - 9,video.length);
			if 	(video != ''){
				if (objectStart != '<object' || objectEnd != '</object>'){
					alert ("Inserire un url valido per il video youtube");
				}else if( video.indexOf("www.youtube.com") == -1){
					alert ("Inserire un video caricato su youtube");			
				}else{
					document.getElementById("postForm").submit();	
				}
			}else{
				document.getElementById("postForm").submit();	
			}
	}
	
	function addpostTwoReset(){		
		document.getElementById("postForm").reset();		
	}
	
	function viewYoutube(){
		if (document.getElementById("youtubeDiv").style.display == 'none'){
			document.getElementById("youtubeDiv").style.display = 'inline'
		}else{
			document.getElementById("youtubeDiv").style.display = 'none'
		}
	}
		
//FUNZIONI PER LA GESTIONE DEGLI INSERIMENTI UTENTI - addUser.jsp

	function adduserSubmit(){
		var espressione = /^[a-z0-9]/;	
		if (!verificaIndirizzoEmail(document.getElementById("email").value)){
			alert('Attenzione, indirizzo email non valido');
		} else if (document.getElementById("username").value == '' || document.getElementById("password").value == '' || document.getElementById("denominazione").value == ''){
			alert('Attenzione, non tutti i campi obbligatori sono stati riempiti');
		} else if (document.getElementById("password").value.length < 8){
			alert('Attenzione, la password non può essere inferiore a 8 caratteri');
		} else if (document.getElementById("password").value != document.getElementById("passwordRepeat").value){
			alert('Attenzione, le 2 password non coincidono');		 
		} else if (document.getElementById("username").value == document.getElementById("password").value){
			alert('Attenzione, Username e password non possono essere uguale');	 
		} else if (verificaPassword(document.getElementById("password").value)){
			alert('Attenzione, La password deve essere alfanumerica, cioè contenere almeno un numero e una lettera');	 			
		} else{	
			if (document.getElementById("tipo").value == 'P'){
				document.getElementById("postForm").submit();
			} else if (document.getElementById("coordinate") != null){
				document.getElementById("postForm").submit();
			} else if (document.getElementById("indirizzo").value != ''){
				//CHIAMATA GOOGLE API		
				getCoordinate(document.getElementById("indirizzo").value);
			}else{	
				
				document.getElementById("postForm").submit();
			}			
		}
	}
	
	function adduserReset(){
		document.getElementById("postForm").reset();
		if (document.getElementById("risultatiApiGoogle") != null){
			document.getElementById("risultatiApiGoogle").innerHTML = "";
		}
	}	
	

	
//FUNZIONI PER LA GESTIONE DELLA MODIFICA UTENTI - editUser.jsp
	function edituserSubmit(){
			if (document.getElementById("denominazione").value == ''){
			alert('Attenzione, non tutti i campi obbligatori sono stati inseriti');
		} else if (!verificaIndirizzoEmail(document.getElementById("email").value)){
			alert('Attenzione, indirizzo email non valido');
		} else {
			if (document.getElementById("indirizzo") == null){
				document.getElementById("postForm").submit();
			}else {
					if (document.getElementById("coordinate") != null){
						document.getElementById("postForm").submit();
					}else if (document.getElementById("oldUbicazione").value!=document.getElementById("indirizzo").value && document.getElementById("indirizzo").value != ''){
						//CHIAMATA GOOGLE API		
						getCoordinate(document.getElementById("indirizzo").value);
					}else{	
						document.getElementById("risultatiApiGoogle").innerHTML="<input type='hidden' name='coordinate' id='coordinate' value='"+document.getElementById("oldCoordinate").value+"' />";				
						document.getElementById("postForm").submit();
					}
			}
		}
	}

	
	function edituserReset(){
		document.getElementById("postForm").reset();
		if (document.getElementById("risultatiApiGoogle") != null){
			document.getElementById("risultatiApiGoogle").innerHTML = "";
		}	
	}
	
//FUNZIONI PER LA GESTIONE DELLA MODIFICA POST - editPost.jsp	
	function editpostSubmit(){
		    if (document.getElementById("titolo").value == ''){
		    	alert("Attenzione, il titolo dell'articolo non è stato inserito");
		    }else if (document.getElementById("provincia").value == ''){
		    	alert("Attenzione, nessuna provincia selezionata");
		    }else if (document.getElementById("prezzo").value == ''){
		    	alert("Attenzione, non è stato inserita alcuna informazione relativa al prezzo");
		    }else if (!IsNumeric(document.getElementById("prezzo").value)){
		    	alert('Attenzione, nel campo prezzo è possibile inserire solo numeri');
		    	document.getElementById("prezzo").value = '';
			}else if(document.getElementById("indirizzo").value == ''){
				alert("Attenzione, è necessario specificare un indirizzo");
			}
			else {
					if (document.getElementById("coordinate") != null){
						document.getElementById("postForm").submit();
					}else if (document.getElementById("oldUbicazione").value!=document.getElementById("indirizzo").value && document.getElementById("indirizzo").value != ''){
							//CHIAMATA GOOGLE API		
							getCoordinateEdit(document.getElementById("indirizzo").value);
						}else{	
							document.getElementById("risultatiApiGoogle").innerHTML="<input type='hidden' name='coordinate' id='coordinate' value='"+document.getElementById("oldCoordinate").value+"' />";				
							document.getElementById("postForm").submit();
						}
			}
		}
		
	function editpostReset(){
		document.getElementById("postForm").reset();
		if (document.getElementById("risultatiApiGoogle") != null){
			document.getElementById("risultatiApiGoogle").innerHTML = "";
		}	
	}				
	
	function editpostChangeRegione(){
		document.getElementById("regioneDivNoChange").style.display = 'none';	
		document.getElementById("regioneDivChange").style.display = 'inline';			
		document.getElementById("regione").name="oldRegione";
		document.getElementById("regione").id="oldRegione";
	}
	
	function editpostChangeProvincia(){
		document.getElementById("provinciaDivNoChange").style.display = 'none';	
		document.getElementById("provinciaDivChange").style.display = 'inline';		
		document.getElementById("provincia").name="oldProvincia";
		document.getElementById("provincia").id="oldProvincia";			
	}
	
	function editpostChangeZona(){
		document.getElementById("zonaDivNoChange").style.display = 'none';	
		document.getElementById("zonaDivChange").style.display = 'inline';		
		document.getElementById("zona").name="oldZona";
		document.getElementById("zona").id="oldZona";			
	}
		
	
//FUNZIONI PER LA MODIFICA DELLA PASSWORD - editPassword.jsp

	function editpasswordSubmit(){
		if (document.getElementById("newPassword").value.length < 8){
			alert('Attenzione, la password non può essere inferiore a 8 caratteri');
		}else if (document.getElementById("newPassword").value != document.getElementById("newPassword2").value){
			alert('Attenzione, le 2 password non coincidono');		  
		} else{	
			document.getElementById("userForm").submit();
		  }
	}
	
	function editpasswordReset(){
		document.getElementById("userForm").reset();
	}	
	
//FUNZIONI PER LA CANCELLAZIONE DEGLI UTENTI - listUser.jsp
	
	function deleteUser(url){
		action=confirm("Sei sicuro di voler eliminare l'utente selezionato e tutti i suoi articoli associati?");
		if (action){
			parent.self.location.href = url;
		}
	}
	
//FUNZIONI PER LA CANCELLAZIONE DEGLI ANNUNCI - listPost.jsp
	
	function deletePost(url){
		action=confirm("Sei sicuro di voler eliminare l'annuncio selezionato? Si ricorda che l'eliminazione non sara' recuperabile!");
		if (action){
			parent.self.location.href = url;
		}
	}	
	
	function deleteUni(url){
		action=confirm("Sei sicuro di voler eliminare l'universita selezionata? Si ricorda che l'eliminazione non sara' recuperabile!");
		if (action){
			parent.self.location.href = url;
		}
	}	
	
	
	
//FUNZIONI DI UTILITY
function verificaIndirizzoEmail(indirizzo) {
  if (window.RegExp) {
    var nonvalido = "(@.*@)|(\\.\\.)|(@\\.)|(\\.@)|(^\\.)";
    var valido = "^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$";
    var regnv = new RegExp(nonvalido);
    var regv = new RegExp(valido);
    if (!regnv.test(indirizzo) && regv.test(indirizzo))
      return true;
    return false;
    }else {
    	if(indirizzo.indexOf("@") >= 0)
      		return true;
    	return false;
    }
}



function IsNumeric(sText){
   var ValidChars = "0123456789";
   var IsNumber=true;
   var Char;

 
   for (i = 0; i < sText.length && IsNumber == true; i++) 
      { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         IsNumber = false;
         }
      }
   return IsNumber;  
}

function verificaPassword(password) {
	return true;
}


function getCoordinate(indirizzo) {
	geo.getLocations(indirizzo, function (result){
		 if (result.Status.code == G_GEO_SUCCESS) {
		 	var text = "";
		 	if (result.Placemark.length > 1){
			  alert ("Sono stati trovati " + +result.Placemark.length + " indirizzi, seleziona quello corretto");	
			  text = "<a href='javascript:newIndirizzo()'>Clicca qui se vuoi cambiare l'indirizzo</a>";	 	
		 	  var p = result.Placemark[0].Point.coordinates;
			  text = text + "<br/>" + "<input type='radio' name='coordinate' id='coordinate' checked='checked' value='"+p[0]+"$"+p[1]+"$"+result.Placemark[0].address+"'/> " + result.Placemark[0].address;
              for (var i=1; i<result.Placemark.length; i++) {
                var p = result.Placemark[i].Point.coordinates;
                text = text + "<br/>" + "<input type='radio' name='coordinate' id='coordinate' value='"+p[0]+"$"+p[1]+"$"+result.Placemark[i].address+"'/> " + result.Placemark[i].address;
              }
              text = text + "<br/>";
   			  document.getElementById("risultatiApiGoogle").innerHTML=text;
   			  var indirizzoText = document.getElementById("indirizzo").value;
   			  document.getElementById("indirizzoDiv").innerHTML="<input type='text' readonly='readonly' value='"+indirizzoText+"' name='indirizzo' class='form-field-grigio-bordo-11px-large' id='indirizzo' maxlength='100' />";
   			}
		 	if (result.Placemark.length == 1){
				 var p = result.Placemark[0].Point.coordinates;
				 text = "<input type='radio' name='coordinate' id='coordinate' checked='checked' value='"+p[0]+"$"+p[1]+"$"+result.Placemark[0].address+"'/> " + result.Placemark[0].address;
	   			 document.getElementById("risultatiApiGoogle").innerHTML=text;					 
				 document.getElementById("postForm").submit();				 
		 	}
		 } else {
            var reason="Code "+result.Status.code;
            if (reasons[result.Status.code]) {
                reason = reasons[result.Status.code]
            } 
             alert('Nessun risultato trovato per :  "'+ indirizzo + '" - ' + reason);
		 }
	});
}

function getCoordinateEdit(indirizzo) {
	geo.getLocations(indirizzo, function (result){
		 if (result.Status.code == G_GEO_SUCCESS) {
		 	var text = "";
		 	if (result.Placemark.length > 1){
			  alert ("Sono stati trovati " + +result.Placemark.length + " indirizzi, seleziona quello corretto");	
			  text = "<a href='javascript:newIndirizzo()'>Clicca qui se vuoi cambiare l'indirizzo</a>";	 	
		 	  var p = result.Placemark[0].Point.coordinates;
			  text = text + "<br/>" + "<input type='radio' name='coordinate' id='coordinate' checked='checked' value='"+p[1]+"$"+p[0]+"$"+result.Placemark[0].address+"'/> " + result.Placemark[0].address;
              for (var i=1; i<result.Placemark.length; i++) {
                var p = result.Placemark[i].Point.coordinates;
                text = text + "<br/>" + "<input type='radio' name='coordinate' id='coordinate' value='"+p[1]+"$"+p[0]+"$"+result.Placemark[i].address+"'/> " + result.Placemark[i].address;
              }
              text = text + "<br/>";
   			  document.getElementById("risultatiApiGoogle").innerHTML=text;
   			  var indirizzoText = document.getElementById("indirizzo").value;
   			  document.getElementById("indirizzoDiv").innerHTML="<input type='text' readonly='readonly' value='"+indirizzoText+"' name='indirizzo' class='form-field-grigio-bordo-11px-large' id='indirizzo' maxlength='100' />";
   			}
		 	if (result.Placemark.length == 1){
				 var p = result.Placemark[0].Point.coordinates;
				 text = "<input type='radio' name='coordinate' id='coordinate' checked='checked' value='"+p[1]+"$"+p[0]+"$"+result.Placemark[0].address+"'/> " + result.Placemark[0].address;
	   			 document.getElementById("risultatiApiGoogle").innerHTML=text;					 
				 document.getElementById("postForm").submit();				 
		 	}
		 } else {
            var reason="Code "+result.Status.code;
            if (reasons[result.Status.code]) {
                reason = reasons[result.Status.code]
            } 
             alert('Nessun risultato trovato per :  "'+ indirizzo + '" - ' + reason);
		 }
	});
}

function newIndirizzo() {
	document.getElementById("indirizzoDiv").innerHTML="<input type='text' name='indirizzo' class='form-field-grigio-bordo-11px-large' id='indirizzo' maxlength='100' />";
	document.getElementById("risultatiApiGoogle").innerHTML="";	
}

function changeFormAddPost(){
	if (document.getElementById("tipologia").value == 'AC'){
		document.getElementById("distuniTxtDiv").style.display = 'inline';		
		document.getElementById("distuniDiv").style.display = 'inline';				
		document.getElementById("uniTxtDiv").style.display = 'inline';	
		document.getElementById("uniDiv").style.display = 'inline';
		document.getElementById("metroTxtDiv").style.display = 'inline';
		document.getElementById("metroDiv").style.display = 'inline';				
	}else if (document.getElementById("tipologia").value == 'AV'){
		document.getElementById("distuniTxtDiv").style.display = 'none';		
		document.getElementById("distuniDiv").style.display = 'none';				
		document.getElementById("uniTxtDiv").style.display = 'none';	
		document.getElementById("uniDiv").style.display = 'none';						
		document.getElementById("metroTxtDiv").style.display = 'none';
		document.getElementById("metroDiv").style.display = 'none';						
	}
}

//FUNZIONI PER GESTIRE IL FORM DI RICERCA IN HOMEPAGE
function changeFormSearch(){
	if (document.getElementById("tipologia").value == 'AC'){
		document.getElementById("provinciaTxtDiv").style.display = 'inline';		
		document.getElementById("provinciaDiv").style.display = 'inline';	
		document.getElementById("regioneTxtDiv").style.display = 'none';		
		document.getElementById("regioneDiv").style.display = 'none';
		document.getElementById("regione").value = null;
	}
	else if (document.getElementById("tipologia").value == 'AV'){
		document.getElementById("regioneTxtDiv").style.display = 'inline';	
		document.getElementById("regioneDiv").style.display = 'inline';
		document.getElementById("provinciaTxtDiv").style.display = 'none';							
		document.getElementById("provinciaDiv").style.display = 'none';	
		document.getElementById("zonaTxtDiv").style.display = 'none';	
		document.getElementById("zonaDivMi").style.display = 'none';
		document.getElementById("zonaDivRo").style.display = 'none';
		document.getElementById("provincia").value = null;
		var arrayzona = document.getElementsByName("zona");
		for(var i=0;i<arrayzona.length;i++){
		arrayzona[i].value=null;
		}
								
	}
}

function changeFormSearchProvincia(){
	if (document.getElementById("provincia").value == 'MI'){
		document.getElementById("zonaTxtDiv").style.display = 'inline';	
		document.getElementById("zonaDivMi").style.display = 'inline';
		document.getElementById("zonaDivRo").style.display = 'none';
	}else if (document.getElementById("provincia").value == 'RO'){
		document.getElementById("zonaTxtDiv").style.display = 'inline';	
		document.getElementById("zonaDivRo").style.display = 'inline';	
		document.getElementById("zonaDivMi").style.display = 'none';
	}else {	
		document.getElementById("zonaTxtDiv").style.display = 'none';
		document.getElementById("zonaDivRo").style.display = 'none';	
		document.getElementById("zonaDivMi").style.display = 'none';
	}
}

function changeFormRegistration(){
	if (document.getElementById("tipo").value == 'A' || document.getElementById("tipo").value == 'B' || document.getElementById("tipo").value == 'G'){
		document.getElementById("agenziaDiv").style.display = 'inline';
		document.getElementById("privatodiv").style.display = 'none';
		document.getElementById("agenziadivden").style.display = 'inline';
		document.getElementById("textFaxDiv").innerHTML = 'Fax';
		document.getElementById("webText").style.display = 'inline';
		document.getElementById("webValue").style.display = 'inline';
		document.getElementById("webLabel").style.display = 'inline';	
		if (document.getElementById("tipo").value == 'B' || document.getElementById("tipo").value == 'G'){
			document.getElementById("textPivaDiv").innerHTML = 'Partiva Iva o Codice Fiscale [*]';
			document.getElementById("textUbiDiv").innerHTML = 'Indirizzo sede';
		}else if (document.getElementById("tipo").value == 'A'){
			document.getElementById("textPivaDiv").innerHTML = 'Partiva Iva [*]';
			document.getElementById("textUbiDiv").innerHTML = 'Ubicazione';
		}			
	}
	else if (document.getElementById("tipo").value == 'P'){
		document.getElementById("privatodiv").style.display = 'inline';
		document.getElementById("agenziadivden").style.display = 'none';
		document.getElementById("agenziaDiv").style.display = 'none';
		document.getElementById("textFaxDiv").innerHTML = 'Cellulare';
		document.getElementById("webText").style.display = 'none';
		document.getElementById("webValue").style.display = 'none';
		document.getElementById("webLabel").style.display = 'none';
	}
	
}

//FUNZIONI PER LA GESTIONE DEGLI INSERIMENTI UTENTI AREA PUBBLICA - registration.jsp

	function registrationSubmit(){
		var espressione = /^[a-z0-9]/;
		var parametro = true;
		if(document.getElementById("tipo").value == 'P'){
			if(document.getElementById('nome').value == '' || document.getElementById('cognome').value == ''){
				alert('Attenzione, il campo nome o cognome non è stato riempito');
				parametro = false;
			}
		}else{
			if(document.getElementById('denominazione').value == ''){
				alert('Attenzione, il campo denominazione non è stato riempito');
				parametro = false
			}else if(document.getElementById('piva').value == ''){
					alert('Attenzione, il campo Partita Iva non è stato riempito');
					parametro = false
				}else if(document.getElementById('referente').value == ''){
						alert('Attenzione, il campo referente non è stato riempito');
						parametro = false
					}else if(document.getElementById('telefono').value == ''){
						alert('Attenzione, il campo telefono non è stato riempito');
						parametro = false
					}				
		}
	
		if (parametro == true){
			if (!verificaIndirizzoEmail(document.getElementById("email").value)){
				alert('Attenzione, indirizzo email non valido');
			} else if (document.getElementById("username").value == '' || document.getElementById("password").value == ''){
				alert('Attenzione, non tutti i campi obbligatori sono stati riempiti');
			} else if (document.getElementById("username").value.indexOf(' ') != -1 ){
				alert('Attenzione, il campo username non può contenere il carattere spazio');
			} else if (document.getElementById("password").value.length < 8){
				alert('Attenzione, la password non può essere inferiore a 8 caratteri');
			} else if (document.getElementById("password").value != document.getElementById("passwordRepeat").value){
				alert('Attenzione, le 2 password non coincidono');		 
			} else if (document.getElementById("username").value == document.getElementById("password").value){
				alert('Attenzione, Username e password non possono essere uguale');	 
			} else if (!verificaPassword(document.getElementById("password").value)){
				alert('Attenzione, La password deve essere alfanumerica, cioè contenere almeno un numero e una lettera');	 			
			} else if (document.getElementById("regolamento").checked == false){
				alert('Attenzione, è necessario accettare il regolamento e le condizioni di utilizzo');
			} else{	
				if (document.getElementById("tipo").value == 'P'){
					document.getElementById("postForm").submit();
				} else if (document.getElementById("coordinate") != null){
					document.getElementById("postForm").submit();
				} else if (document.getElementById("indirizzo").value != ''){
					//CHIAMATA GOOGLE API		
					getCoordinate(document.getElementById("indirizzo").value);
				}else{	
					
					document.getElementById("postForm").submit();
				}			
			  }
			}
		}
	function registrationReset(){
		document.getElementById("postForm").reset();
		if (document.getElementById("risultatiApiGoogle") != null){
			document.getElementById("risultatiApiGoogle").innerHTML = "";
		}
	}		
	
//FUNZIONI PER LA MODIFICA DELLE IMMAGINI - editImage.jsp

	function editFoto(id){
		if (document.getElementById(id).style.display == 'none'){
			document.getElementById(id).style.display = 'inline';
		}else{
			document.getElementById(id).style.display = 'none';
		}
	}
	
	