startList = function() {
  if (document.all&&document.getElementById) {
    navRoot = document.getElementById("navmenu");
    for (i=0; i<navRoot.childNodes.length; i++) {
      node = navRoot.childNodes[i];
      if (node.nodeName=="LI") {
         node.onmouseover=function() {
           this.className+=" iehover";
         }
         node.onmouseout=function() {
           this.className=this.className.replace(" iehover", "");
         }
      }
    }
  }
}



var slideShowSpeed = 5000
var crossFadeDuration = 3
var Pic = new Array()
Pic[0] = 'images/foto_header/hotel_fiordaliso_01_it.jpg'

var t
var j = 0
var p = Pic.length

var preLoad = new Array()
for (i = 0; i < p; i++){
   preLoad[i] = new Image()
   preLoad[i].src = Pic[i]
}

function runSlideShow() {
   if (document.all){
      document.images.SlideShow.style.filter="blendTrans(duration=2)"
      document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)"
      document.images.SlideShow.filters.blendTrans.Apply()      
   }
   document.images.SlideShow.src = preLoad[j].src
   if (document.all){
      document.images.SlideShow.filters.blendTrans.Play()
   }
   j = j + 1
   if (j > (p-1)) j=0
   t = setTimeout('runSlideShow()', slideShowSpeed)
}


// Email obfuscator script 2.1 by Tim Williams, University of Arizona
// Random encryption key feature by Andrew Moulden, Site Engineering Ltd
// This code is freeware provided these four comment lines remain intact
// A wizard to generate this code is at http://www.jottings.com/obfuscator/
function codMail() {
	coded = "O.ceZ6QFNeuZ@fe8.ef"
  key = "szYDheKc8aBNSpoIvrXuxd9O17kyFP4tgZVA6b5qQ2RTHGEMi0fnCUlLWJwm3j"
  shift=coded.length
  link=""
  for (i=0; i<coded.length; i++) {
    if (key.indexOf(coded.charAt(i))==-1) {
      ltr = coded.charAt(i)
      link += (ltr)
    }
    else {     
      ltr = (key.indexOf(coded.charAt(i))-shift+key.length) % key.length
      link += (key.charAt(ltr))
    }
  }
	var x2=document.getElementById("mail2");
  x2.innerHTML = "<a href='mailto:"+link+"'>"+link+"</a>";
}

function loadMap(lingua) {
	if(lingua == "it") {
  	document.getElementById("map").innerHTML = '<iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.it/maps?f=q&amp;source=s_q&amp;hl=it&amp;geocode=&amp;q=Hotel+Touring+livorno&amp;sll=43.285203,9.613037&amp;sspn=3.350677,7.075195&amp;gl=it&amp;ie=UTF8&amp;ll=43.555826,10.317621&amp;spn=0.013032,0.027637&amp;z=14&amp;iwloc=A&amp;cid=715950391238103827&amp;output=embed&amp;s=AARTsJrALCZKQkLQqnf3xEwcH_mjaDwr0A"></iframe><br /><small><a href="http://maps.google.it/maps?f=q&amp;source=embed&amp;hl=it&amp;geocode=&amp;q=Hotel+Touring+livorno&amp;sll=43.285203,9.613037&amp;sspn=3.350677,7.075195&amp;gl=it&amp;ie=UTF8&amp;ll=43.555826,10.317621&amp;spn=0.013032,0.027637&amp;z=14&amp;iwloc=A&amp;cid=715950391238103827" style="text-align:left">Visualizzazione ingrandita della mappa</a></small>';
	} else if(lingua == "en") {
			document.getElementById("map").innerHTML = '<iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.it/maps?f=q&amp;source=s_q&amp;hl=en&amp;geocode=&amp;q=Hotel+Touring+livorno&amp;sll=43.285203,9.613037&amp;sspn=3.350677,7.075195&amp;gl=it&amp;ie=UTF8&amp;ll=43.555826,10.317621&amp;spn=0.013032,0.027637&amp;z=14&amp;iwloc=A&amp;cid=715950391238103827&amp;output=embed&amp;s=AARTsJrALCZKQkLQqnf3xEwcH_mjaDwr0A"></iframe><br /><small><a href="http://maps.google.it/maps?f=q&amp;source=embed&amp;hl=it&amp;geocode=&amp;q=Hotel+Touring+livorno&amp;sll=43.285203,9.613037&amp;sspn=3.350677,7.075195&amp;gl=it&amp;ie=UTF8&amp;ll=43.555826,10.317621&amp;spn=0.013032,0.027637&amp;z=14&amp;iwloc=A&amp;cid=715950391238103827" style="text-align:left">Visualizzazione ingrandita della mappa</a></small>';
	} else if(lingua == "de") {
			document.getElementById("map").innerHTML = '<iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.it/maps?f=q&amp;source=s_q&amp;hl=de&amp;geocode=&amp;q=Hotel+Touring+livorno&amp;sll=43.285203,9.613037&amp;sspn=3.350677,7.075195&amp;gl=it&amp;ie=UTF8&amp;ll=43.555826,10.317621&amp;spn=0.013032,0.027637&amp;z=14&amp;iwloc=A&amp;cid=715950391238103827&amp;output=embed&amp;s=AARTsJrALCZKQkLQqnf3xEwcH_mjaDwr0A"></iframe><br /><small><a href="http://maps.google.it/maps?f=q&amp;source=embed&amp;hl=it&amp;geocode=&amp;q=Hotel+Touring+livorno&amp;sll=43.285203,9.613037&amp;sspn=3.350677,7.075195&amp;gl=it&amp;ie=UTF8&amp;ll=43.555826,10.317621&amp;spn=0.013032,0.027637&amp;z=14&amp;iwloc=A&amp;cid=715950391238103827" style="text-align:left">Visualizzazione ingrandita della mappa</a></small>';
	}
}

// controllo validita' della e-mail
function controllo_email(email) 
{
  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(email) && regv.test(email))
      return true;
    return false;
	}
  else {
    if(email.indexOf("@") >= 0)
      return true;
    return false;
  	}
}

function controllo(lingua)
{
  with (document.form) {
	
	if (Nome.value == "")
	{
		if(lingua=="it")
			alert("Non hai inserito il tuo nome!");
		else if(lingua=="en")
			alert("Fill in your name!");
		else if(lingua=="de")
			alert("Geben Sie Ihren Namen!");
		else if(lingua=="fr")
			alert("Entrez votre nom!");
		Nome.focus();
		return false;
	}
	
	if (Cognome.value == "")
	{
		if(lingua=="it")
			alert("Non hai inserito il tuo cognome!");
		else if(lingua=="en")
			alert("Fill in your surname!");
		else if(lingua=="de")
			alert("Geben Sie Ihren Vornamen!");
		else if(lingua=="fr")
			alert("Entrez votre prénom!");
		Cognome.focus();
		return false;
	}

	if (Email.value == "")
	{
		if(lingua=="it")
			alert("Non hai inserito il tuo indirizzo email!");
		else if(lingua=="en")
			alert("Fill in your email address!");
		else if(lingua=="de")
			alert("Geben Sie Ihre E-Mail-Adresse!");
		else if(lingua=="fr")
			alert("Entrez votre adresse e-mail!");
		Email.focus();
		return false;
	}

	if (Email.value != "" && controllo_email(Email.value) == false)
	{
		if(lingua=="it")
			alert("Indirizzo e-mail non valido!");
		else if(lingua=="en")
			alert("Invalid E-mail address");
		else if(lingua=="de")
			alert("");
		else if(lingua=="fr")
			alert("");
		Email.focus();
		return false;
	}

	return true;
  } // with
}
