maxsec = 12;
maximg = 24;
bi = new Array('home','foto','paese','sport','prezzi','storia','mappa','links','info','meteo','prev','wcam');
iit = new Array(maxsec);
pmenu = 0;

function SwitchImg()
{
  var rem, keep=0, store, obj, switcher=new Array, history=document.Data;
    for (rem=0; rem < (SwitchImg.arguments.length-2); rem+=3) {
    	store = SwitchImg.arguments[(navigator.appName == 'Netscape')?rem:rem+1];
    if ((store.indexOf('document.layers[')==0 && document.layers==null) ||
        (store.indexOf('document.all[')==0 && document.all==null))
         store = 'document'+store.substring(store.lastIndexOf('.'),store.length);
         obj = eval(store);
    if (obj != null) {
   	   switcher[keep++] = obj;
      switcher[keep++] = (history==null || history[keep-1]!=obj)?obj.src:history[keep];
      obj.src = SwitchImg.arguments[rem+2];
  } }
  document.Data = switcher;
}

function RestoreImg()
{
  if (document.Data != null)
    for (var rem=0; rem<(document.Data.length-1); rem+=2)
      document.Data[rem].src=document.Data[rem+1];
}

function Loadimages(lang)
{
ipath = "images/"
for (i=0; i<maxsec; i++)
{
 iit[i] = new Image();
 iit[i].src = ipath+"m"+lang+i+".gif";
 iit[i+maxsec] = new Image();
 iit[i+maxsec].src = ipath+"m"+lang+i+"a.gif";
}
}

function Writemenu(lang)
{
for (i=0; i<maxsec; i++)
{
 restr = "";
 restr = bi[i]+lang+".htm";	
 if (restr != "")
 {
  document.write('<a href="'+restr+'" onMouseOut="RestoreImg()" onMouseOver="SwitchImg(\'document.'+bi[i]+'\',\'document.'+bi[i]+'\',\''+iit[i+maxsec].src+'\')"><img src="'+iit[i].src+'" name="'+bi[i]+'" width="162" height="25" alt="Sezione '+bi[i]+'" border="0"></a>\n');
 } 
}
}

function QuickInfo(islong)
{
 if (islong == true) 
   document.write('<div class="quickinfo">32020 Voltago Agordino - Belluno - Italia | Tel. +39/0437 669001 | Fax +39/0437 669241<br> email: <a href="mailto:info@hotelstellaalpina.org?subject=Informazioni" target="_self" name="hsamail">info@hotelstellaalpina.org</a> | PI: 01059590255')
 else	
 document.write('<div class="quickinfo">32020 Voltago Agordino - Belluno - Italia | Tel. +39/0437 669001 | Fax +39/0437 669241 | email: <a href="mailto:info@hotelstellaalpina.org?subject=Informazioni" target="_self" name="hsamail">info@hotelstellaalpina.org</a>');
}

function WriteAutor()
{
 document.write('<div id="autor">- &copy; <img src="images/logo.gif" width="20" height="20" hspace="2" vspace="2" border="0" alt="Logo autore" align="absmiddle"> Creato da Michele Rossa 2007-2011 -</div>');
}

function Writeoverlaymenu(lang)
{
 isrc = 'images/showmenu'+lang+'.gif';
 proc = 'SwapSizePanel(\''+lang+'\');';
 document.write('<img id="shm" src="'+isrc+'" width="160" height="18" border="0" alt="Mostra menu" align="left" onclick="'+proc+'">');	
}

function SwapSizePanel(lang)
{	
 if (pmenu==0)
   {
	pmenu = 1;
	document.getElementById("sxm").style.visibility = "visible";
	document.getElementById("sezionim").style.visibility = "visible";
	document.images["shm"].src = 'images/hidemenu'+lang+'.gif';
   }
 else {
      pmenu = 0;
 	  document.getElementById("sxm").style.visibility = "hidden";
	  document.getElementById("sezionim").style.visibility = "hidden";
	  document.images["shm"].src = 'images/showmenu'+lang+'.gif';	
 	  }  	
}

function UpdateWebcamImage(isrc)
{
 if (isrc!='')
   {
    document.getElementById("wii").src = 'webcam/'+isrc+'.jpg';
    if (isrc.indexOf('hour')>=0)
      {document.getElementById("wii").alt = 'Situazione alle ore / Situation at '+isrc.slice(4);}
        else { document.getElementById("wii").alt = 'Panorama /view'; }
   }
}

function UpdateWebcamImageFF(isrc)
{
 if (! document.all) { UpdateWebcamImage(isrc); }
}










