function validate(act,strData)
// owner version
{
	var ret = true;
	if (!(strData)) strData = '';
	switch (act)
	{
        case 'estimate_hotel' :
            if (ret) ret = validate_checkbox('price_date'   , 1                  , 1, 'Prima di continuare e\'necessario selezionare UN periodo di cui richiedere il preventivo!');
          break;
		case 'estimate_new' :
		  /*
			if (ret) ret = validate_text('estimate_name'    , 'NOMINATIVO CLIENTE' , 4, -1);
			if (ret) ret = validate_text('estimate_address' , 'INDIRIZZO RESIDENZA', 4, -1);
			if (ret) ret = validate_text('estimate_city'    , 'CITTA\' RESIDENZA', 4, -1);
    		if (ret) ret = validate_int ('estimate_phone'   , 'TELEFONO'           , -1, -1);
			if (ret) ret = validate_email('estimate_email'  , 'EMAIL'             , false);
		  */

			if (ret) ret = validate_int ('estimate_person'     , 'N°PERSONE'       , 1, -1);
			if (ret) ret = validate_int ('estimate_infant'     , 'N°INFANTI'       , 0, -1);
			if (ret)
			{
				var objRoom;
				var estimate_person = document.getElementById('estimate_person');
				var estimate_infant = document.getElementById('estimate_infant');
				if ((estimate_person) && (estimate_infant))
				{
					if (Number(estimate_infant.value) >= Number(estimate_person.value))
					{
						alert('Il numero di Infanti non puo\'essere maggiore o uguale alle Persone!');
						ret = false;
					} else {
						var estimate_person_real = 0, i;
						for (i=1; i<=7; i++)
						{
							objRoom = document.getElementById('estimate_room_' + i);
							if (objRoom) estimate_person_real += Number(objRoom.value);
						}
						if (estimate_person_real != estimate_person.value - estimate_infant.value)
						{
							alert('Il numero delle stanze prenotate non corrisponde al numero di persone indicato!');
							ret = false;
						}
					}
				}
			}
			if (ret) ret = validate_radio('price_G0', 'SUPPLEMENTI OBBLIGATORI')
	      break;
        case 'estimate_final' :
			if (ret) ret = validate_checkbox('estimate_privacy'    , 1                  ,    -1, 'Prima di continuare e\'necessario leggere l\'informativa sulla privacy!');
	      break;

		case 'homepage_new' :
    case 'homepage_edt' :
			if (ret) ret = validate_text('homepage_titolo'  , 'ITOLO'            , 4, -1);
		  break;
		case 'pagina_new' :
    case 'pagina_edt' :
			if (ret) ret = validate_text('pagina_titolo'    , 'ITOLO'            , 4, -1);
		  break;
		case 'hotel_new' :
		case 'hotel_edt' :
			if (ret) ret = validate_text('hotel_name'       , 'NOME HOTEL'       , 4, -1);
		  break;
    case 'location_button':
      if (ret) ret = (validate_query('ZONA o SOTTO-ZONA', 'id'));
      break;
    case 'location_new' :
		case 'location_edt' :
			if (ret) ret = validate_text('location_name'    , 'NOME LOCALITA\''  ,     1,    -1);
          break;
		case 'offer_new' :
			if (ret) ret = validate_ext ('offer_file'       , 'IMMAGINE'         , false, 'jpg');
		case 'offer_edt' :
			if (ret) ret = validate_text('offer_hotel'      , 'NOME HOTEL'       , 4, -1);
			if (ret) ret = validate_text('offer_destination', 'DESTINAZIONE'     , 4, -1);
			if (ret) ret = validate_ext ('offer_file'       , 'IMMAGINE'         , true, 'jpg');
		  break;
		case 'gruppi_new' :
			if (ret) ret = validate_ext ('gruppi_file'       , 'IMMAGINE'         , false, 'jpg');
		case 'gruppi_edt' :
			if (ret) ret = validate_text('gruppi_hotel'      , 'NOME VIAGGIO'       , 4, -1);
			if (ret) ret = validate_text('gruppi_destination', 'DESTINAZIONE'     , 4, -1);
			if (ret) ret = validate_ext ('gruppi_file'       , 'IMMAGINE'         , true, 'jpg');
		  break;
		case 'operator_new' :
			if (ret) ret = validate_ext ('operator_logo'    , 'LOGO INTESTAZIONE', false, 'jpg');
			if (ret) ret = validate_text('operator_password', 'PASSWORD'         ,     4,    -1);
		case 'operator_edt' :
			if (ret) ret = validate_text('operator_site_name', 'INTESTAZIONE SITO',     4,    -1);
			if (ret) ret = validate_text('operator_name'    , 'RAGIONE SOCIALE'  ,     4,    -1);
			if (ret) ret = validate_text('operator_login'   , 'NOME UTENTE'      ,     4,    -1);
		  break;
		case 'mail_sub' :
			if (ret) ret = validate_text('Nominativo'        , 'NOMINATIVO'             ,     1,    -1);
			if (ret) ret = validate_email('Email'      , 'EMAIL'            );
			if (ret) ret = validate_checkbox('Informativa'    , 1                  ,    -1, 'Prima di continuare e\'necessario leggere l\'informativa sulla privacy!');
	      break;
		case 'modificatore_new' :
    case 'modificatore_edt' :
			if (ret) ret = validate_text('modificatore_titolo' , 'TITOLO'      , 4, -1);
      if (ret) ret = validate_date('modificatore_data_da', 'DATA DA'     , true);
      if (ret) ret = validate_date('modificatore_data_a' , 'DATA A'      , true);
		  break;
		case 'packet_new' :
    case 'packet_edt' :
			if (ret) ret = validate_text('packet_name'       , 'NOME PACCHETTO' , 4, -1);
			if (ret) ret = validate_text('packet_info'       , 'DESCRIZIONE'    , 4, -1);
		  break;

		case 'testata_new' :
    case 'testata_edt' :
			if (ret) ret = validate_text('testata_name'      , 'NOME TESTATA' , 4, -1);
			if (ret) ret = validate_text('testata_link'      , 'LINK'         , 4, -1);
		  break;
		case 'partner_new' :
			if (ret) ret = validate_text ('Ragione_Sociale'  , 'RAGIONE SOCIALE', 4, -1);
			if (ret) ret = validate_text ('Referente'        , 'REFERENTE'      , 4, -1);
			if (ret) ret = validate_text ('Localita'         , 'LOCALITA\''     , 4, -1);
			if (ret) ret = validate_int  ('Telefono'         , 'TELEFONO'       ,-1, -1);
			if (ret) ret = validate_email('Email'            , 'EMAIL'          );
			if (ret) ret = validate_checkbox('Informativa'   , 1                ,-1, 'Prima di continuare e\'necessario leggere l\'informativa sulla privacy!');
	      break;
        case 'pwd_change' :
            if (ret) ret = validate_text('password_new'     , 'NUOVA PASSWORD'   ,     4,    -1);
            if (ret)
            {
                var pwd1 = document.getElementById('password_new');
		        var pwd2 = document.getElementById('password_new2');
        		if (pwd1.value!=pwd2.value)
		        {
			        alert('I due campi contenenti la nuova password non corrispondono!\nRiscrivere la password corretta!');
			        pwd1.value='';
			        pwd2.value='';
			        ret = false;
		        }
            }
          break;
		case 'product_button' :
			if (ret) ret = validate_query('CATEGORIA','id');
		  break;
		case 'region_new' :
        case 'region_edt' :
			if (ret) ret = validate_text('region_name'      , 'NOME SOTTO-ZONA' , 1, -1);
			if (ret) ret = validate_text('region_info'      , 'DESCRIZIONE'     , 4, -1);
		  break;
		case 'search_new' :
			if (ret) ret = validate_int ('search_person'     , 'N°PERSONE'       , 1, -1);
			if (ret) ret = validate_int ('search_infant'     , 'N°NFANTI'       , 0, -1);
			if (ret)
			{
				var objRoom;
				var search_person = document.getElementById('search_person');
				var search_infant = document.getElementById('search_infant');
				if ((search_person) && (search_infant))
				{
					if (Number(search_infant.value) >= Number(search_person.value))
					{
						alert('Il numero di Infanti non puo\'essere maggiore o uguale alle Persone!');
						ret = false;
					} else {
						var search_person_real = 0, i;
						for (i=1; i<=7; i++)
						{
							objRoom = document.getElementById('search_room_' + i);
							if (objRoom) search_person_real += Number(objRoom.value);
						}
						if (search_person_real != search_person.value - search_infant.value)
						{
							alert('Il numero delle stanze prenotate non corrisponde al numero di persone indicato!');
							ret = false;
						}
					}
				}
			}
		case 'search_edt' :
			if (ret) ret = validate_select ('search_day'     , 'DATA DI PARTENZA', 0);
			if (ret) ret = validate_select ('search_month'   , 'DATA DI PARTENZA', 0);
            if (ret) ret = validate_select ('search_duration', 'DURATA SOGGIORNO', 0);
            if (ret) ret = validate_select ('search_zoneid'  , 'ZONA TURISTICA'  , 0);
		  break;
		case 'newsletter_new':
			if (ret) ret = validate_email  ('Email'           , 'EMAIL'          );
		  break;
		case 'touroperator_new' :
        case 'touroperator_edt' :
			if (ret) ret = validate_text('touroperator_name' , 'NOME TOUR OPERATOR' , 4, -1);
		  break;
		case 'transport_new' :
        case 'transport_edt' :
			if (ret) ret = validate_text('transport_name'   , 'NOME TRASPORTO' , 4, -1);
			if (ret) ret = validate_text('transport_info'   , 'DESCRIZIONE'    , 4, -1);
		  break;
		case 'work_new' :
			if (ret) ret = validate_text('Nominativo'       , 'NOME'           , 4, -1);
			if (ret) ret = validate_text('Luogo_Nascita'    , 'LUOGO DI NASCITA', 4, -1);
			if (ret) ret = validate_date('Data_Nascita'     , 'DATA DI NASCITA', false);
			if (ret) ret = validate_text('Indirizzo'        , 'INDIRIZZO'      , 4, -1);
			if (ret) ret = validate_text('Localita'         , 'LOCALITA\''     , 4, -1);
			if (ret) ret = validate_email('Email'           , 'EMAIL'          );
			if (ret) ret = validate_checkbox('Informativa'  , 1               ,-1, 'Prima di continuare e\'necessario leggere l\'informativa sulla privacy!');
		  break;
		case 'zone_new' :
    case 'zone_edt' :
			if (ret) ret = validate_text('zone_name'        , 'NOME ZONA'      , 1, -1);
			if (ret) ret = validate_text('zone_info'        , 'DESCRIZIONE'    , 4, -1);
		  break;
		case 'prenota_new' :
			if (ret) ret = validate_text('Nominativo'          , 'NOMINATIVO'         ,     1,    -1);
			if (ret) ret = validate_date('Data_Nascita'        , 'DATA DI NASCITA'    , false);
		  if (ret) ret = validate_text('Indirizzo_Residenza' , 'INDIRIZZO RESIDENZA', 1    ,    -1);
			if (ret) ret = validate_text('Citta_Residenza'     , 'CITTA\' RESIDENZA'  , 1    ,    -1);
			if (ret) ret = validate_int ('Telefono'            , 'TELEFONO'           ,    -1,    -1);

			var objTmp;
			for (var i = 2; document.getElementById('Cognome_' + i); i++) {
				if (ret) ret = validate_text('Cognome_' + i, 'COGNOME ' + i, 1, -1);
				if (ret) ret = validate_text('Nome_'    + i, 'NOME '    + i, 1, -1);
        // creo la data prendendo i singoli campi
        var intGiorno = document.getElementById('Giorno_' + i).value;
        var intMese   = document.getElementById('Mese_'   + i).value;
        var intAnno   = document.getElementById('Anno_'   + i).value;

        document.getElementById('Eta_' + i).value = intGiorno + '/' + intMese + '/' + intAnno;
        if (ret) ret = validate_date('Eta_'     + i, 'Data di Nascita ' + i, false)
			}
			if (ret) ret = validate_checkbox('Informativa'     , 1                  ,    -1, 'Prima di continuare e\'necessario approvare l\'informativa sulla privacy!');
      if (ret) ret = validate_checkbox('Assicurazione'   , 1                  ,    -1, 'Prima di continuare e\'necessario approvare le condizioni di assicurazione!');
      if (ret) ret = validate_checkbox('Condizioni'      , 1                  ,    -1, 'Prima di continuare e\'necessario leggere le condizioni di vendita!');
	    break;
    case 'info_new':
      if (ret) ret = validate_text('Nominativo'          , 'NOMINATIVO'         ,     1,    -1);
      if (ret) ret = validate_email  ('Email'           , 'EMAIL'          );
      if (ret) ret = validate_checkbox('Informativa'     , 1                  ,    -1, 'Prima di continuare e\'necessario leggere l\'informativa sulla privacy!');

      break;
    case 'gruppi_info':
      if (ret) ret = validate_text('Referente'           , 'REFERENTE'          ,     1,    -1);
      if (ret) ret = validate_text('Associazione'        , 'ASSOCIAZIONE / CRAL',     1,    -1);
      if (ret) ret = validate_int ('Telefono'            , 'TELEFONO'           ,    -1,    -1);
      if (ret) ret = validate_checkbox('Informativa'     , 1                    ,    -1, 'Prima di continuare e\'necessario leggere l\'informativa sulla privacy!');

      break;
		default : alert(act);
	}
	return ret;
}

function WND_confirm(act,cod)
// owner version
{
	var account;

    switch (act)
    {
        case 'agenzia_del' :
		    account=confirm('Sei sicuro di voler cancellare questa AGENZIA e tutti i dati relativi?');
		    if (account==true)
			{
			    location.href='DoCMD.asp?snd=operator&act=del&id='+cod;
			    return true;
			}
            break;
        case 'hotel_del' :
		    account=confirm('Sei sicuro di voler cancellare questa HOTEL e tutti i dati relativi?');
		    if (account==true)
			{
			    location.href='DoCMD.asp?snd=hotel&act=del&id='+cod;
			    return true;
			}
            break;
        case 'homepage_del' :
		    account=confirm('Sei sicuro di voler cancellare questo ELEMENTO e tutti i dati relativi?');
		    if (account==true)
			{
			    location.href='DoCMD.asp?snd=homepage&act=del&id='+cod;
			    return true;
			}
            break;
      case 'gruppi_del' :
		    account=confirm('Sei sicuro di voler cancellare questo GRUPPO e tutti i dati relativi?');
		    if (account==true)
			{
			    location.href='DoCMD.asp?snd=gruppi&act=del&id='+cod;
			    return true;
			}
            break;
        case 'location_del' :
		    account=confirm('Sei sicuro di voler cancellare questa LOCALITA\' e tutti i dati relativi?');
		    if (account==true)
			{
			    location.href='DoCMD.asp?snd=location&act=del&id='+cod;
			    return true;
			}
            break;
        case 'modificatore_del' :
		    account=confirm('Sei sicuro di voler cancellare questo PREZZO e tutti i dati relativi?');
		    if (account==true)
			{
			    location.href='DoCMD.asp?snd=modificatore&act=del&id='+cod;
			    return true;
			}
            break;
        case 'packet_del' :
		    account=confirm('Sei sicuro di voler cancellare questa PACCHETTO e tutti i dati relativi?');
		    if (account==true)
			{
			    location.href='DoCMD.asp?snd=packet&act=del&id='+cod;
			    return true;
			}
            break;
        case 'pagina_del' :
		    account=confirm('Sei sicuro di voler cancellare questa PAGINA e tutti i dati relativi?');
		    if (account==true)
			{
			    location.href='DoCMD.asp?snd=pagina&act=del&id='+cod;
			    return true;
			}
        case 'offer_del' :
		    account=confirm('Sei sicuro di voler cancellare questa OFFERTA e tutti i dati relativi?');
		    if (account==true)
			{
			    location.href='DoCMD.asp?snd=offer&act=del&id='+cod;
			    return true;
			}
            break;
        case 'region_del' :
		    account=confirm('Sei sicuro di voler cancellare questa SOTTO-ZONA e tutti i dati relativi?');
		    if (account==true)
			{
			    location.href='DoCMD.asp?snd=region&act=del&id='+cod;
			    return true;
			}
            break;
        case 'touroperator_del' :
		    account=confirm('Sei sicuro di voler cancellare questa TOUR OPERATOR e tutti i dati relativi?');
		    if (account==true)
			{
			    location.href='DoCMD.asp?snd=touroperator&act=del&id='+cod;
			    return true;
			}
            break;
      case 'transport_del' :
		    account=confirm('Sei sicuro di voler cancellare questa TRASPORTO e tutti i dati relativi?');
		    if (account==true)
			{
			    location.href='DoCMD.asp?snd=transport&act=del&id='+cod;
			    return true;
			}
            break;
        case 'testata_del' :
		    account=confirm('Sei sicuro di voler cancellare questa TESTATA e tutti i dati relativi?');
		    if (account==true)
			{
			    location.href='DoCMD.asp?snd=testata&act=del&id='+cod;
			    return true;
			}
            break;
        case 'zone_del' :
		    account=confirm('Sei sicuro di voler cancellare questa ZONA e tutti i dati relativi?');
		    if (account==true)
			{
			    location.href='DoCMD.asp?snd=zone&act=del&id='+cod;
			    return true;
			}
            break;
		default : alert(act);
    }

	return false;
}

function WND_open_small(link,h,w)
// v1.3
{
	var left,top,extra,name;

    extra = 'scrollbars=yes, status=yes, ';
    w += 20;

    if (h>700)
    { h = 700; }

	left=(screen.width-w) /2;
	top =(screen.height-h)/3;

    name = link;
	name = name.replace('/','_');
    name = name.replace('.','_');
    name = name.replace('-','_');
    name = name.substr(0,name.indexOf("_"));

	window.open(link, name, extra + 'left='+left+', top='+top+', height='+h+',width='+w);

	return name;
}

function WND_refresh(href)
// v1.2
{
	if (window.opener && !window.opener.closed)
	{
		if ((href=='') || (href==null)) window.opener.location.reload();
		else window.opener.location.href=href;
	}
	self.close();
}

function validate_date(objName, name, bolEmpty)
// v1.2
{
    var obj = document.getElementById(objName);
    if (obj)
    {
	    if (obj.value == '') ret = bolEmpty;
	    else
	    {
	        var ret = true;
		    var tmp=obj.value.split('/');
		    if (tmp.length!=3) ret = false
		    else
		    {
			    if ((tmp[0]<=0) || (tmp[0]>31)) ret = false;
			    if ((tmp[1]<=0) || (tmp[1]>12)) ret = false;
			    if ((tmp[2]<=1900) || (tmp[2]>2100)) ret = false;
		    }
		}
        if (!(ret)) alert('Il campo "' + name.toUpperCase() + '" non e\' valido, inserire una data nel formato gg/mm/aaaa');
		return ret;
	}
	return false;
}

function validate_sdate(date)
// v1.0
{
    // Modificare la riga sottostante se date='' NON e'consentito
	if (date=='') return true
	else
	{
		var tmp=date.split('/');
		if (tmp.length!=2) return false
		else
		{
			if ((tmp[0]<=0) || (tmp[0]>12)) return false;
			if ((tmp[1]<=2000) || (tmp[1]>2100)) return false;
		}
		return true;
	}
}

function validate_int(objName, name, min_val, max_val)
// v1.2
{
    var obj = document.getElementById(objName);
    if (obj)
    {
        var ret = true;
        var re = new RegExp("^(\\d+)$");
        var m = re.exec(obj.value);

		if (m == null)
        {
            alert('Il campo "' + name.toUpperCase() + '" non e\' valido, inserire un valore numerico');
            ret = false;
        }
        else
        {
            if ((obj.value < min_val) && (min_val != -1))
            {
	            alert('Il campo "' + name.toUpperCase() + '" non e\' valido, inserire un valore superiore o uguale a ' + min_val + '!');
	            ret = false;
            }
            if ((obj.value > max_val) && (max_val != -1))
            {
	            alert('Il campo "' + name.toUpperCase() + '" non e\' valido, inserire un valore inferiore o uguale a ' + max_val + '!');
	            ret = false;
	        }
        }
        return ret;
    }
    return false;
}

function validate_email(objName, name)
// v1.2
{
  var re = /(^[a-z0-9]([a-z0-9_\.]+)[a-z0-9])@[a-z0-9]([a-z0-9_\.]+)[a-z0-9]\.([a-z]{2,4})$/i;
  var obj = document.getElementById(objName);

  if (obj)
  {
	  if (re.exec(obj.value) != null) return true;
	  else
	  {
	      alert('Il campo "' + name.toUpperCase() + '" non e\' valido, inserire un email valida');
		  return false;
	  }
  }


  else return true;
}
function validate_text(objName, name, min_len, max_len)
// v1.1
{
    var obj = document.getElementById(objName);
    if (obj)
    {
        if ((obj.value.length < min_len) && (min_len != -1))
        {
	        alert('Il campo "' + name.toUpperCase() + '" non e\' valido, inserire almeno ' + min_len + ' caratteri!');
	        return false;
        }
        if ((obj.value.length > max_len) && (max_len != -1))
        {
	        alert('Il campo "' + name.toUpperCase() + '" non e\' valido, sono consentiti al massimo ' + max_len + ' caratteri!');
	        return false;
        }
    }
    return true
}

function validate_checkbox(objName, match_min, match_max, strError)
// v1.1
{
    var i = 1, intMatch = 0, ret = true;
    var obj = document.getElementById(objName + i);
    while (obj)
    {
        if (obj.checked) intMatch++;
        i++;
        obj = document.getElementById(objName + i);
    }
    if ((intMatch < match_min) && (match_min > -1)) ret = false;
    if ((intMatch > match_max) && (match_max > -1)) ret = false;
    if (!(ret)) alert(strError);
    return ret;
}

function validate_query(name, match)
// v1.0
{
	var querystring = window.location.search;

	if (querystring.indexOf(match + '=') == -1)
	{
		alert('Prima di continuare e\' necessario selezionare una ' + name.toUpperCase());
		return false;
	}
	else
	{	return true;	}
}

function validate_ext(objName, name, bolEmpty, ext)
// v1.0
{
	var obj = document.getElementById(objName);
	if (obj)
	{	var i, ret = false;
		var fileName = obj.value;
		var ext_list = (ext.toLowerCase()).split(',')

		if (fileName == '')
		{	ret = bolEmpty;  }
		else
		{
			fileName = fileName.substring(fileName.lastIndexOf('.') + 1,fileName.length);
			for (i = 0 ; i < ext_list.length ; i++)
			{	if (ext_list[i] == fileName) ret = true;	}
		}

		if (!(ret)) alert('Il campo ' + name.toUpperCase() + ' contiene un file con estensione non valida. Sono permessi i formati: ' + ext);
		return ret;
	}
}

function validate_select(objName, name, strError)
{
    var obj = document.getElementById(objName);
    if (obj)
    {
        if (obj.options[obj.selectedIndex].value == strError)
        {
            alert('Selezionare un valore valido per il campo ' + name.toUpperCase());
            return false;
        }
        else return true;
    }
}

function validate_radio(objName, name, strConfirm)
{
	var ret = false, i = 1;
    var obj = document.getElementById(objName + i);
    if (!obj) return true;
    else {
	while (obj)
	{
		if (obj.checked) { ret = true; break; }
		i++;
		obj = document.getElementById(objName + i);
	}
	if (!(ret))
	{
        alert('E\'necessario selezionare almeno un valore in ' + name.toUpperCase());
		ret = false;
	}
	else
	{
		if ((strConfirm) && (obj.value != strConfirm))
		{
			alert('Per continuare e\'necessario selezionare il valore ' + strConfirm.toUpperCase() + ' nel campo ' + name.toUpperCase());
			ret = false;
		}
	}
    return ret;
    }
}
function WND_flash_load(strName, intWidth, intHeight)
// v1.0
{
    document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,63,0" width="' + intWidth + '" height="' + intHeight + '">');
    document.write('<param name="movie" value="' + strName + '">');
    document.write('<param name="quality" value="high">');
    document.write('<param name="wmode" value="transparent">');
    document.write('<embed src="' + strName + '" wmode=transparent quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + intWidth + '" height="' + intHeight + '"></embed>');
    document.write('</object>');
}

var geocoder = null;

function showAddress(objAddress) {
  var address = objAddress.value;
  if (GBrowserIsCompatible() && address.length > 0) {
    if (!geocoder) geocoder = new GClientGeocoder();
	if (geocoder) {
	  geocoder.getLatLng(address,
		function(point) {
		  if (!point) {
		    alert(address + " non trovato!");
		  } else {
		    document.getElementById('hotel_latitudine').value = point.lat();
		    document.getElementById('hotel_longitudine').value = point.lng();
		    alert(address + " localizzato!");
		  }
	    }
	  );
	}
  }
}

  document.write('<script type="text/javascript" src="../js/fckeditor/fckeditor.js"></script>');

  if (self.location.href.indexOf('/admin/') >= 0) {
    var tmpLoad = window.onload;
    window.onload = function()
      {
        if (tmpLoad) tmpLoad();
        // Automatically calculates the editor base path based on the _samples directory.
        // This is usefull only for these samples. A real application should use something like this:
        /* oFCKeditor.BasePath = '/fckeditor/' ;	// '/fckeditor/' is the default value. */
        var sBasePath = '../js/fckeditor/';
        var oTextarea = document.getElementsByTagName('textarea');

        for (var i = 0; i < oTextarea.length; i++) {
          if (oTextarea[i].id.indexOf("_ridotto") < 0) {
            var oFCKeditor = new FCKeditor(oTextarea[i].id) ;
            oFCKeditor.Config["CustomConfigurationsPath"] = "fckconfig.js";
            oFCKeditor.ToolbarSet = 'Default' ;;
            oFCKeditor.BasePath	= sBasePath ;
            oFCKeditor.ReplaceTextarea() ;
          }
        }
      }
  }

  var objHiderName = '';

  function showmenu(elmnt) {
    document.getElementById(elmnt).style.display="block";
  }
  function hidemenu(elmnt) {
    document.getElementById(elmnt).style.display="none";
  }

