<!--//--><![CDATA[//><!--

sfHover = function() {
    var sfEls = document.getElementById("nav").getElementsByTagName("LI");
    for (var i=0; i<sfEls.length; i++) {
        sfEls[i].onmouseover=function() {
            this.className+=" sfhover";
        }
        sfEls[i].onmouseout=function() {
            this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
        }
    }
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

function OpenBrowser(theURL,winName,features) {
  window.open(theURL,winName,features);
}

function load_it() {
  var d=document; if(d.images){ if(!d.p) d.p=new Array();
    var i,j=d.p.length,a=load_it.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.p[j]=new Image; d.p[j++].src=a[i];}}
}

function changeFormBooking(po_this) {
    switch(po_this.value) {
        case 'hotel':
            montre('small-book-hotel','small-book-flight');
            break;
        case 'flight':
            montre('small-book-flight','small-book-hotel');
            break
    }
}
 
function setDeparture(po_form) {
    document.forms['frm-book'].out_month.selectedIndex = po_form.selectedIndex ;
}

function setDeparture2(po_form) {
    document.forms['frm-rate'].out_month.selectedIndex = po_form.selectedIndex ;
}

function BookIt(po_form) {
    po_form.submit();
}

function UpdateDeparture(po_form, po_element) {
    po_element.selectedIndex = po_form.selectedIndex ;
}

function montre(show, hiden) {
    var dShow = document.getElementById(show);
    var dHiden = document.getElementById(hiden);

    if (dShow) {dShow.style.display='block';}
    if (dHiden) {dHiden.style.display='none';}
}

function submitUnitForm(ps_form, pi_AccomodationId, pi_unitNb)
{
    // Check if there is any unit
    if (pi_unitNb>=1)
    {
        var sErrorNoValue = 'You need to choose a number of room';
        var sErrorOneUnit = 'You must select only one unit';
        
        var bError = true;
        
        var iValue = 0;
        // Loop under unit(s)
        for(i=1; i<=(pi_unitNb); i++)
        {
            sUnitName = 'unit_'+pi_AccomodationId+'_'+i;
            if (document.getElementById(sUnitName).value>0)
            {
                iValue++;
            }
        }
        
        switch (String(iValue))
        {
            case "0" :
                alert(sErrorNoValue);
                break;
            default :
                document.getElementById(ps_form).submit();
        } 
    }
    else
    {
        alert('Fatal error');
        return false;
    }
}

/* PER ALS POPUP DE LES IMATGES 

function PopUp(img){
  foto1= new Image();
  foto1.src=(img);
  Control(img);
  }
function Control(img){if((foto1.width!=0)&&(foto1.height!=0)){  verFoto(img);}  else{funcion="Control('"+img+"')";  intervalo=setTimeout(funcion,20);}}function verFoto(img){  ancho=foto1.width+20;  alto=foto1.height+20;  cadena="width="+ancho+",height="+alto;  ventana=window.open(img,"",cadena);  }

*/

var cssmenuids=["NavCSS"] //Enter id(s) of CSS Horizontal UL menus, separated by commas
var csssubmenuoffset=-1 //Offset of submenus from main menu. Default is 0 pixels.

function createcssmenu2(){
for (var i=0; i<cssmenuids.length; i++){
  var ultags=document.getElementById(cssmenuids[i]).getElementsByTagName("ul")
    for (var t=0; t<ultags.length; t++){
			ultags[t].style.top=ultags[t].parentNode.offsetHeight+csssubmenuoffset+"px"
    	var spanref=document.createElement("span")
			spanref.className="arrowdiv"
			spanref.innerHTML="&nbsp;&nbsp;&nbsp;&nbsp;"
			ultags[t].parentNode.getElementsByTagName("a")[0].appendChild(spanref)
    	ultags[t].parentNode.onmouseover=function(){
					this.style.zIndex=100
    	this.getElementsByTagName("ul")[0].style.visibility="visible"
					this.getElementsByTagName("ul")[0].style.zIndex=0
    	}
    	ultags[t].parentNode.onmouseout=function(){
					this.style.zIndex=0
					this.getElementsByTagName("ul")[0].style.visibility="hidden"
					this.getElementsByTagName("ul")[0].style.zIndex=100
    	}
    }
  }
}

if (window.addEventListener)
window.addEventListener("load", createcssmenu2, false)
else if (window.attachEvent)
window.attachEvent("onload", createcssmenu2)