    
  function fixAjaxBeginRequest(sender, args) {
       var r=args.get_request();
        if (r.get_headers()["X-MicrosoftAjax"]){
           b=r.get_body();var a="__MicrosoftAjax=" + encodeURIComponent(r.get_headers()["X-MicrosoftAjax"]);
            if (b!=null && b.length>0){
	            b+="&";}
            else
	            b="";r.set_body(b+a);}       
        }

/* "Global" Variables */

   var hdnItemIDObj;
   var ShowMoreIDObj;

/** begin calendar **/

    var checkOutPickerChangeFired = false;
    var checkInPickerChangeFired = false;
    var checkOutPicker;
    var checkInPicker;
    var defaultDateDiff;
    /*
    error states are 
    0= ok
    1 = check in date greater than or equal to the maximum date allowed
    2 = check out date too far in the future
    3 = check out date too early
    4 = check out date to same as check in date
    5 = picker is undefined
    */
    var calendarControlErrorState = 0;
    
    function OnChangeCheckInPicker(sender){
        var newDate;
        if(checkOutPicker!== undefined){
            if(!checkOutPickerChangeFired){
                if(sender.getSelectedDate() >= checkOutPicker.maximumDate){
                    newDate = sender.getSelectedDate().addDays(-1);
                    //alert('Can\'t set check in date as it would be greater than or equal to the maximum date allowed\nDate has been set to '+newDate);
                    sender.setSelectedDate(newDate);
                    return 1;
                }
                newDate = sender.getSelectedDate();
                if(newDate >=checkOutPicker.getSelectedDate()){
                 newDate = sender.getSelectedDate().addDays(defaultDateDiff);
                    if(newDate > checkOutPicker.maximumDate){
                        newDate = newDate.addDays(-1)
                        //alert('Can\'t set check out date as it would be too far in the future\nDate has been set to '+newDate);
                        checkOutPicker.setSelectedDate(newDate);
                        return 2;
                    }else if(newDate < checkOutPicker.minimumDate){
                        newDate = newDate.addDays(1)
                        //alert('Can\'t set check out date as it would be too early\nDate has been set to '+newDate);
                        checkOutPicker.setSelectedDate(newDate);
                        return 3;
                    }else{
                        checkOutPicker.setSelectedDate(newDate);
                        return 0;
                    }            
                    
                 }else{
                    return 0;
                 }
             }else{
                return 0;
             }
         }else{
            return 5;
         }
    }
    
    function OnChangeCheckOutPicker(sender){
        var newDate;
        if(checkInPicker!== undefined){
            if(!checkInPickerChangeFired){
                if(sender.getSelectedDate() <= checkInPicker.getSelectedDate()){
                    newDate = checkInPicker.getSelectedDate().addDays(1);
                    //alert('Can\'t set check out date as it would be less than or equal to the check in date \nDate has been set to '+newDate);
                    sender.setSelectedDate(newDate);
                    return 4;
                }else{
                    return 0;
                }
            }else{
                return 0;
            } 
        }else{
            return 5;
        }
    } 


//IE execute function
function readyState(fn){
	//dom is ready for interaction
	if(document.readyState == "interactive"){
		fn();
	}
}

/* Total Nights DropDown Change Event    */
function NightChangeEvent(instanceName,checkInCal,checkOutCal,pickerIn,pickerOut){
    //Fetch the Instances(always use Picker not Calendar Instance)
    var checkIn_DateSelected = window[checkInCal];
    var checkOut_DateSelected = window[checkOutCal];
    var TotalNightsDropDown = document.getElementById(instanceName);
    //temp Date
    var tempSelectedDate = new Date(checkIn_DateSelected.getSelectedDate());
    var dayDifference = TotalNightsDropDown.selectedIndex + 1;
    tempSelectedDate.setDate(tempSelectedDate.getDate() + dayDifference);
    //Fianlly setting picker and its associated Calendar
    checkOut_DateSelected.setSelectedDate(tempSelectedDate);
    window[pickerOut].setSelectedDate(tempSelectedDate);  
}


/** end calendar **/

/** begin balloon tip **/
//Rich HTML Balloon Tooltip: http://www.dynamicdrive.com/dynamicindex5/balloontooltip.htm
//Created: September 10th, 2006

var disappeardelay=250  //tooltip disappear delay (in miliseconds)
var verticaloffset=0 //vertical offset of tooltip from anchor link, if any
var enablearrowhead=1 //0 or 1, to disable or enable the arrow image
var arrowheadimg=["/images/speech-bubble/left-cut.gif", "/images/speech-bubble/right-cut.gif","/images/speech-bubble/left-cut1.gif","/images/speech-bubble/right-cut1.gif"] //path to down and up arrow images
var arrowheadheight=35 //height of arrow image (amount to reveal)

/////No further editting needed

var ie=document.all
var ns6=document.getElementById&&!document.all
//verticaloffset=(enablearrowhead)? verticaloffset+arrowheadheight : verticaloffset

var applicationIdentity = 0;

function getposOffset(what, offsettype)
{
    var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
    var parentEl=what.offsetParent;
    while (parentEl!=null)
    {
        totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
        parentEl=parentEl.offsetParent;
    }
    return totaloffset;
}


    
function ConfirmRemoveFlight(hdnHasHotelResult,hdnSearchType,message)
{
    
    delayhidemenu();
    return ValidateRmvHotel(hdnHasHotelResult,hdnSearchType,message);
}

function ValidateRmvHotel(hdnHasHotelResult,hdnSearchType,message)
{

   var hdnValue         =   document.getElementById(hdnHasHotelResult);
    var hdnSearchType         =   document.getElementById(hdnSearchType);
  
    if(hdnValue.value == "False" && hdnSearchType.value!="Hotel")
    {   alert(message);
        return false;
    }
    else
    {
       return true;
    }
   
}


function showhide(obj, e)
{
obj.visibility="visible"
}

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj)
{
    edgeoffsetx=0
    var windowedge=ie && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
    dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
    
        
    if ( windowedge < dropmenuobj.x + obj.offsetWidth + dropmenuobj.contentmeasure + arrowheadheight)
        edgeoffsetx=dropmenuobj.contentmeasure + arrowheadheight;
    else
        edgeoffsetx = (-1) * obj.offsetWidth - arrowheadheight;
    //alert("edgeoffsetx = "+edgeoffsetx);
    return edgeoffsetx;
    
}

function displayballoontip(obj, e,applicationIdentity)
{ 
try
    {
//main ballooon tooltip function
if (typeof dropmenuobj!="undefined") //hide previous tooltip?
dropmenuobj.style.visibility="hidden"
clearhidemenu();
//obj.onmouseout=delayhidemenu
dropmenuobj=document.getElementById(obj.getAttribute("rel"))
showhide(dropmenuobj.style, e)
dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top") + verticaloffset
dropmenuobj.style.left=dropmenuobj.x - clearbrowseredge(obj)+"px"
dropmenuobj.style.top=dropmenuobj.y - 46 + "px"
 if( navigator.appName == "Netscape") 
           {
            
           }
           else
            {
createbackiframe(dropmenuobj.offsetHeight,dropmenuobj.offsetWidth,dropmenuobj.x - clearbrowseredge(obj),dropmenuobj.y - 53);
}

if (enablearrowhead)
displaytiparrow(applicationIdentity)

}
catch(exp)
{}
}

function displaytiparrow(applicationIdentity)
{ 
    
    //function to display optional arrow image associated with tooltip
    tiparrow=document.getElementById("arrowhead")
    if(tiparrow == null)
        initalizetooltip(applicationIdentity);
        if(tiparrow != null)
        {
        if(applicationIdentity == 3 || applicationIdentity == 2)
             tiparrow.src=(edgeoffsetx <= 0)? arrowheadimg[2] : arrowheadimg[3]
        else
    tiparrow.src=(edgeoffsetx <= 0)? arrowheadimg[0] : arrowheadimg[1]
    var ieshadowwidth=(dropmenuobj.filters && dropmenuobj.filters[0])? dropmenuobj.filters[0].Strength-1 : 0
    //modify "left" value depending on whether there's no room on right edge of browser to display it, respectively
    //alert("navigator.appName = "+navigator.appName);
    //alert(dropmenuobj.style.left+"\n"+dropmenuobj.offsetWidth+"\n"+tiparrow.offsetWidth);
    //if( navigator.appName == "Netscape") 
    //    tiparrow.style.left=(edgeoffsetx >= 0)? parseInt(dropmenuobj.style.left)+dropmenuobj.offsetWidth - tiparrow.offsetWidth - 3 + "px" : parseInt(dropmenuobj.style.left) - 32 +"px"
    //else
        tiparrow.style.left=(edgeoffsetx >= 0)? parseInt(dropmenuobj.style.left)+dropmenuobj.offsetWidth - tiparrow.offsetWidth + 32 + "px" : parseInt(dropmenuobj.style.left) - 32 +"px"
    //modify "top" value depending on whether there's no room on right edge of browser to display it, respectively
    //tiparrow.style.top=(edgeoffsety!=0)? parseInt(dropmenuobj.style.top)+dropmenuobj.offsetHeight-tiparrow.offsetHeight-ieshadowwidth+arrowheadheight+"px" : parseInt(dropmenuobj.style.top)- arrowheadheight+"px"
    tiparrow.style.top=parseInt(dropmenuobj.style.top) +  50 + "px"
    tiparrow.style.position = "absolute"
    tiparrow.style.visibility="visible"
    tiparrow.style.zIndex = 10

    }
}

function delayhidemenu(){
try
{
if (typeof dropmenuobj!="undefined" && dropmenuobj != null)
{
dropmenuobj.style.visibility='hidden';
dropmenuobj.style.left=0; 
}
if (typeof tiparrow!="undefined" && tiparrow != null)
{

tiparrow.style.visibility='hidden';
tiparrow.style.zIndex = 0
}
var newframe = document.getElementById("BalloonIFrame")
    if(newframe != null)
                newframe.style.display='none';
}
catch(exp)
{}
}

function clearhidemenu(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}

function reltoelement(linkobj){ //tests if a link has "rel" defined and it's the ID of an element on page
var relvalue=linkobj.getAttribute("rel")
return (relvalue!=null && relvalue!="" && document.getElementById(relvalue)!=null && document.getElementById(relvalue).className=="spcwrap")? true : false
}

function initalizetooltip(applicationIdentity){
var all_links=document.getElementsByTagName("a")
if (enablearrowhead){
tiparrow=document.createElement("img")

if(applicationIdentity == 3)
tiparrow.setAttribute("src", arrowheadimg[2])
else
tiparrow.setAttribute("src", arrowheadimg[0])

tiparrow.setAttribute("id", "arrowhead")
document.body.appendChild(tiparrow)
tiparrow.style.visibility="hidden"
tiparrow.style.zIndex = 10
}
}

function ShowballonTip(obj, _verticaloffset, applicationIdentity)
{
    
    
    verticaloffset = parseInt(_verticaloffset);
    var e = this.event;
    var evtobj=window.event? window.event : e
    displayballoontip(obj, evtobj,applicationIdentity)
}
//This function will create an iframe 
function createbackiframe(divheight,divwidth,divleft,divtop)
{
	  var newframe = document.getElementById("BalloonIFrame");
	  if(newframe == null)
	  {
		var newframe = document.createElement("iframe");
	    newframe.setAttribute("id", "BalloonIFrame");
        document.body.appendChild(newframe);
       }
	  
	  newframe.height = divheight - 30 ;
	  newframe.width  = divwidth - 6;
	  newframe.style.position = "absolute";
	  newframe.style.left = divleft + 5 ;
	  newframe.style.top = divtop + 30 ;
	  newframe.style.display="";
}
/** end ballontip **/



/** begin script **/
<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->

<!--
function ChangeStatus(obj)
{
    document.getElementById('ctl00_MainContent_rbtnResorts').checked =false;
    document.getElementById('ctl00_MainContent_rbtnCities').checked =false;
    document.getElementById('ctl00_MainContent_rbtnAirports').checked =false;
    
    
   // for(i=0;i<12;i++)
   for(i=0;i<9;i++)
    {      
      document.getElementById('ctl00_MainContent_rbtnlstResorts_' + i).checked=false;
    }
    //for(i=0;i<12;i++)
     for(i=0;i<9;i++)
    {      
      document.getElementById('ctl00_MainContent_rbtnlstCity_' + i).checked=false;
    }
     document.getElementById('ctl00_MainContent_txtAirPort').value = "" ;
     
    if(obj == 'Destination')
    {
      document.getElementById('ctl00_MainContent_txtHotelName').value = "" ;
      document.getElementById('ctl00_MainContent_txtDestination').focus();
    }
    if(obj == 'HotelName')
    {
      document.getElementById('ctl00_MainContent_txtDestination').value = "" ;
      document.getElementById('ctl00_MainContent_txtHotelName').focus();
    } 
}

function SelectDestinationRadioButton()
{
	  document.getElementById(rbtnDestination).checked = true ;
}

function ChangeTextBoxStatus(obj)
{
    document.getElementById('ctl00_MainContent_rbtnResorts').checked =false;
    document.getElementById('ctl00_MainContent_rbtnCities').checked =false;
    document.getElementById('ctl00_MainContent_rbtnAirports').checked =false;
    
    
    //for(i=0;i<12;i++) 
    for(i=0;i<9;i++)
    {      
      document.getElementById('ctl00_MainContent_rbtnlstResorts_' + i).checked=false;
    }
    //for(i=0;i<12;i++)
     for(i=0;i<9;i++)
    {      
      document.getElementById('ctl00_MainContent_rbtnlstCity_' + i).checked=false;
    }
     document.getElementById('ctl00_MainContent_txtAirPort').value = "" ;
     

    if( obj =='tDestination')
    {
     document.getElementById('ctl00_MainContent_rbtnDestination').checked =true;
     document.getElementById('ctl00_MainContent_txtHotelName').value = "" ;
    }
    if( obj =='tHotelName')
    {
     document.getElementById('ctl00_MainContent_rbtnHotelName').checked =true;
     document.getElementById('ctl00_MainContent_txtDestination').value = "" ;
    }

}
function ChangeDestination(Object)
{


 document.getElementById('ctl00_MainContent_rbtnTopDestination').checked =true;
    if(Object == 'ResortList')
    {      
        document.getElementById('ctl00_MainContent_rbtnResorts').checked =true;       
    }
    if(Object == 'CityList')
    {
        document.getElementById('ctl00_MainContent_rbtnCities').checked =true;
    }
     if(Object == 'AirPort')
    {
        document.getElementById('ctl00_MainContent_rbtnAirports').checked =true;
    }
     

}

function ShowDetails(Obj) 
{
//    document.getElementById('ctl00_MainContent_rbtnTopDestination').checked =true;
//    //making Destination and HotelName textbox empty 
//    document.getElementById('ctl00_MainContent_txtDestination').value = "" ;
//    document.getElementById('ctl00_MainContent_txtHotelName').value = "" ;
//    if(Obj=='TopDestination')
//    {
//     document.getElementById('ctl00_MainContent_rbtnResorts').checked =true;
//    }
    
	if(Obj=='resort')
	{
	 document.getElementById('resort').style.display = "block"; 
	 document.getElementById('city').style.display = "none";
	 //document.getElementById('airport').style.display = "none";
	 
	 
//	  //for(i=0;i<12;i++)
//	   for(i=0;i<9;i++)
//      {      
//        document.getElementById('ctl00_MainContent_rbtnlstCity_' + i).checked=false;
//      } 
//	 document.getElementById('ctl00_MainContent_txtAirPort').value = "" ;
//     document.getElementById('ctl00_MainContent_txtPlaceOfInterest').value = "" ;
	 }
	 else if(Obj == 'city')
	 {
		 document.getElementById('city').style.display = "block"; 
		 document.getElementById('resort').style.display = "none";
	 	 //document.getElementById('airport').style.display = "none";
		 
		 
//		 //for(i=0;i<12;i++)
//		  for(i=0;i<9;i++)
//         {      
//          document.getElementById('ctl00_MainContent_rbtnlstResorts_' + i).checked=false;
//         }
//		 document.getElementById('ctl00_MainContent_txtAirPort').value = "" ;
//         document.getElementById('ctl00_MainContent_txtPlaceOfInterest').value = "" ;
	 }
	  else if(Obj == 'airport')
	 {
		 document.getElementById('airport').style.display = "block"; 
		 document.getElementById('resort').style.display = "none";
	 	 document.getElementById('city').style.display = "none";
		 
		 
//		 //for(i=0;i<12;i++)
//		  for(i=0;i<9;i++)
//         {      
//            document.getElementById('ctl00_MainContent_rbtnlstCity_' + i).checked=false;
//         }
//         //for(i=0;i<12;i++)
//          for(i=0;i<9;i++)
//         {      
//          document.getElementById('ctl00_MainContent_rbtnlstResorts_' + i).checked=false;
//         }
//         document.getElementById('ctl00_MainContent_txtPlaceOfInterest').value = "" ;
	 }
	  //else if(Obj == 'interest')
	  //{
	//	 document.getElementById('interest').style.display = "block"; 
	//	 document.getElementById('resort').style.display = "none";
	 //	 document.getElementById('city').style.display = "none";
	//	 document.getElementById('airport').style.display = "none";
		 
//		 //for(i=0;i<12;i++)
//		  for(i=0;i<9;i++)
//         {      
//            document.getElementById('ctl00_MainContent_rbtnlstCity_' + i).checked=false;
//         }
//         //for(i=0;i<12;i++)
//          for(i=0;i<9;i++)
//         {      
//          document.getElementById('ctl00_MainContent_rbtnlstResorts_' + i).checked=false;
//         }
//          document.getElementById('ctl00_MainContent_txtAirPort').value = "" ;
	 //}
} 

//-->
function compare()
{
if (window.document.frmsearch.butcompare.click)
	{		
		window.document.frmsearch.target="_parent";
		window.document.frmsearch.action="Compare-Quick-View-Search-Preformed.html";
		window.document.frmsearch.submit();
	}	
}
function bookingqst()
{
if (window.document.frmsearch.butbook.click)
	{		
		window.document.frmsearch.target="_parent";
		window.document.frmsearch.action="booking-questions.html";
		window.document.frmsearch.submit();
	}	
}

function fn_RadioClickEvent(netPriceVAR,discountLabel)
{
    document.getElementById(discountLabel).innerHTML = "ss";
    document.getElementById(discountLabel).innerHTML = netPriceVAR;
}function FacilityShowHideClick(control)
    {
        var control = document.getElementById(control);
        if (control != null)
        {            
            if (control.style.display == '')
                control.style.display = 'none';
            else
                control.style.display = '';
        }
        return false;
    }
    
    
   
    
    
    //Functiona below can be re-used, but we are not using original value of y coordinate as we have to show the div a bit above to the link.
    //we are doing "-22" in y coordinate...
     function ShowImageDiv(controlClientID,messageDiv) 
    {
        var draggers=document.getElementById(messageDiv);
        var controlToBindID = document.getElementById(controlClientID);
        draggers.style.display="block";
        
        if(controlToBindID != null)
        {
            var x = controlToBindID.offsetLeft + controlToBindID.offsetWidth;
              var y = controlToBindID.offsetTop ;
              var parent = controlToBindID;
              while (parent.offsetParent) 
              {
                  parent = parent.offsetParent;
                    x += parent.offsetLeft;
                    y += parent.offsetTop;
              }
            draggers.style.left =  x + "px";
            draggers.style.top =  y - 22  + "px";       // reducing value of y, as we have to display image a bit above the link
          
            draggers.style.position = "absolute";
            draggers.style.display = ""; 
           if( navigator.appName == "Netscape") 
           {
            
           }
           else
            {
                  draggers.style.display="block";
                  draggers.style.zIndex = 10000;
                
                  var x1 = draggers.offsetLeft;
                      var y1 = draggers.offsetTop ;
                        var parent1 = draggers;
                        while (parent1.offsetParent) 
                        {
                            parent1 = parent1.offsetParent;
                              x1 += parent1.offsetLeft;
                              y1+= parent1.offsetTop;
                        }
             }
           } 
    }
    function HideOverlaidDiv(messageDiv)
    {
        var draggers=document.getElementById(messageDiv);
        draggers.style.display = "none"; 
    }


  function fn_ShowHideClick(airResponseGridView)
    {
        var airResponseGridView = document.getElementById(airResponseGridView);
        if (airResponseGridView != null)
        {            
            if (airResponseGridView.style.display == '')
                airResponseGridView.style.display = 'none';
            else
                airResponseGridView.style.display = '';
        }
        
        return false;
    }
    
    function SetAlfieMessage(alfieSmallImageLabelID, message)
       { 
            if(alfieSmallImageLabelID!=null && alfieSmallImageLabelID!="" )
            {  
                var lbl2 = document.getElementById(alfieSmallImageLabelID);
                if(lbl2 != null)
                    lbl2.innerHTML = message;   
            }                                                     
      }
        
    function changeAvgHeaderText(establishmentKey, avgPriceLogicHdn, avgHeaderClientIDHdn, currentCultureID, headerTextValue, currencyValue, totalNoPass)
    {
        var totalCost = 0.0;
        
        for(var j=0;j<document.forms.length;j++)
        {
            var fromControls =  document.forms[j].elements;
              
            for(var i=0;i<fromControls.length;i++)
            {
                if(fromControls[i].type=="text")
                {   
                    var arrayElement = fromControls[i].value.split("~");
                    if (arrayElement[0] == establishmentKey)
                    {
                        if (document.getElementById(arrayElement[1]).checked)
                        {
                            totalCost = totalCost + parseFloat(arrayElement[2].toString().replace(",","."));
                        }
                    }
                }
            }
        }
        
        totalCost = parseFloat((totalCost / totalNoPass)).toFixed(2);
        totalCost = GetLocalePrice(totalCost, currentCultureID);
        if (document.getElementById(avgHeaderClientIDHdn))
        document.getElementById(avgHeaderClientIDHdn).innerHTML = headerTextValue.toString().replace("<RATE>",currencyValue + totalCost.toString());
    }
    
    /*
        Used to get the locale specific price text.
    */
    function GetLocalePrice(price, currentCultureID)
    {
        if(currentCultureID != 2057)
        {       
            return price.toString().replace(".",",");
        }
        else
        {
            return price;
        }
    }
    
     //Ski show/hide more info...
     function ShowHideDesc(ShortDescDivID, FullDescDivID, ShowFullDescription)
      {
            var ShortDescDiv = document.getElementById(ShortDescDivID);
            var FullDescDiv = document.getElementById(FullDescDivID);
            if(ShowFullDescription)
            {
                ShortDescDiv.style.display = "none";
                FullDescDiv.style.display = "";
            }
            else
            {
                ShortDescDiv.style.display = "";
                FullDescDiv.style.display = "none";
            }           
      }

      //Being used on Ski home page
      function OptionChanged(Options,Beg,Int,Adv)
        {
            var OptionsDdl = document.getElementById(Options);
            var BegDv = document.getElementById(Beg); 
            var IntDv = document.getElementById(Int); 
            var AdvDv = document.getElementById(Adv); 
            if(OptionsDdl.selectedIndex == 0)
            {
                BegDv.style.display = '';
                IntDv.style.display = 'none';
                AdvDv.style.display = 'none';
            }
            if(OptionsDdl.selectedIndex == 1)
            {
                BegDv.style.display = 'none';
                IntDv.style.display = '';
                AdvDv.style.display = 'none';
            }
            if(OptionsDdl.selectedIndex == 2)
            {
                BegDv.style.display = 'none';
                IntDv.style.display = 'none';
                AdvDv.style.display = '';
            }
        }
/** end script **/

/** header.js **/

//AMcA 2007-10-25 javascript to show / hide price promise layers
function ShowVacenzaPricePromise(d) {
    if(d.length < 1) { return; }
    document.getElementById(d).style.display = "block";
}
function HideVacenzaPricePromise(d) {
    if(d.length < 1) { return; }
    document.getElementById(d).style.display = "none";
}
function ShowHideVacenzaPricePromise(d){
    if(d.length < 1) { return; }
    if(document.getElementById(d).style.display == "none") { document.getElementById(d).style.display = "block"; }
    else { document.getElementById(d).style.display = "none"; }
}
//AMcA 2007-10-25 javascript to show / hide price promise layers




function clearGoolgeDefaultSearch()
{
       
    // clear the input box if the user clicks on it
    // and it is the default value
    if (SiteNavMsg == document.getElementById(TextInputID).value)
        document.getElementById(TextInputID).value='';
        document.getElementById(TextInputID).style.color = "Black";
}

function fireGoogleSearch(searchButton,event)
{   
    if(event.keyCode == 13)
    {   
        //var a = document.getElementById('<%=this.textInputID%>').value;

        var buttonToClick =document.getElementById(searchButton);
        event.cancelBubble = true;
        event.returnValue = false;
        buttonToClick.click();
        return false;
    }
}

// Bug req # 366 ( Devendra Kumar )
function googleURL()
{
    if(document.getElementById(TextInputID).value=='')
        {   
            document.getElementById(TextInputID).style.color = "Red";
            
            document.getElementById(TextInputID).value= SiteNavMsg;
            //alert('testing');
            return false;
        }
        else
        {
            var arg;
            var str=document.getElementById(TextInputID).value;
            
            for(var i=0;i<str.length;i++)
            {
                if(str.charAt(i)=='#')
                    {
                        continue;
                    }
                    else
                    {
                        arg = str.substring(i);
                        break;
                    }
            }
            
            
            location.href="http://google.alpharooms.com/search?q="+document.getElementById(TextInputID).value+"&output=xml_no_dtd&OE=utf-8&ie=utf-8&client=default_frontend&proxystylesheet=default_frontend&site=default_collection";                
        }   
}

/* header.js **/

/** autocomplete.js **/
var BrowserDetect = {
	init: function () {
		this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
		this.version = this.searchVersion(navigator.userAgent)
			|| this.searchVersion(navigator.appVersion)
			|| "an unknown version";
		this.OS = this.searchString(this.dataOS) || "an unknown OS";
	},
	searchString: function (data) {
		for (var i=0;i<data.length;i++)	{
			var dataString = data[i].string;
			var dataProp = data[i].prop;
			this.versionSearchString = data[i].versionSearch || data[i].identity;
			if (dataString) {
				if (dataString.indexOf(data[i].subString) != -1)
					return data[i].identity;
			}
			else if (dataProp)
				return data[i].identity;
		}
	},
	searchVersion: function (dataString) {
		var index = dataString.indexOf(this.versionSearchString);
		if (index == -1) return;
		return parseFloat(dataString.substring(index+this.versionSearchString.length+1));
	},
	dataBrowser: [
		{ 	string: navigator.userAgent,
			subString: "OmniWeb",
			versionSearch: "OmniWeb/",
			identity: "OmniWeb"
		},
		{
			string: navigator.vendor,
			subString: "Apple",
			identity: "Safari"
		},
		{
			prop: window.opera,
			identity: "Opera"
		},
		{
			string: navigator.vendor,
			subString: "iCab",
			identity: "iCab"
		},
		{
			string: navigator.vendor,
			subString: "KDE",
			identity: "Konqueror"
		},
		{
			string: navigator.userAgent,
			subString: "Firefox",
			identity: "Firefox"
		},
		{
			string: navigator.vendor,
			subString: "Camino",
			identity: "Camino"
		},
		{		// for newer Netscapes (6+)
			string: navigator.userAgent,
			subString: "Netscape",
			identity: "Netscape"
		},
		{
			string: navigator.userAgent,
			subString: "MSIE",
			identity: "Explorer",
			versionSearch: "MSIE"
		},
		{
			string: navigator.userAgent,
			subString: "Gecko",
			identity: "Mozilla",
			versionSearch: "rv"
		},
		{ 		// for older Netscapes (4-)
			string: navigator.userAgent,
			subString: "Mozilla",
			identity: "Netscape",
			versionSearch: "Mozilla"
		}
	],
	dataOS : [
		{
			string: navigator.platform,
			subString: "Win",
			identity: "Windows"
		},
		{
			string: navigator.platform,
			subString: "Mac",
			identity: "Mac"
		},
		{
			string: navigator.platform,
			subString: "Linux",
			identity: "Linux"
		}
	]

};
BrowserDetect.init();
//alert();

// JScript File

		var globaliframe;
		var prev_textboxvalue;
		var queryField;
		var lookupURL;
		var divName;
		var ifName;
		var lastVal = "";
		var val = ""
		var xmlHttp;
		var cache = new Object();
		var searching = false;
		var globalDiv;
		var x;
		var y;
		
		var divFormatted = false;
		var DIV_BG_COLOR = "white";
		var DIV_HIGHLIGHT_COLOR = "#cccccc";

		var scrollBarWidth=15;

		var txt_ControlName = "";
		var Control_NoOfRecords = "";
		var Control_DisplayColumnName = "";
		var Control_SortableColumnName = "";
		var Control_NeedTitleCase = "";
		
		var Control_Layer_ClientID="";
		var hiddenControlName = "";
		
		
		//This function will create an iframe 
		function createiframe(divheight,divwidth,divleft,divtop)
		{
			  var newframe = document.getElementById("newiframe");
			  if(newframe == null)
			  {
				var newframe = document.createElement("iframe");
			    newframe.setAttribute("id", "newiframe");
			    newframe.setAttribute("frameborder", "none");
		        //document.body.appendChild(newframe);
		        //alert('getting document:'+document.getElementById(Control_Layer_ClientID));
		        //alert('autoSuggestLayer'+queryField.getAttribute("id"));
		        document.getElementById('autoSuggestLayer'+queryField.getAttribute("id")).appendChild(newframe);
		       }
			  
			  newframe.height = divheight;
			  //newframe.height="
			  newframe.width  = divwidth;
			  newframe.style.position = "absolute";
			  newframe.style.left = divleft ;
			  newframe.style.top = divtop;
			  newframe.style.display="";
			  newframe.style.border="none";
			  
		}
		/**
		Get the <DIV> we're using to display the lookup results, and create the
		<DIV> if it doesn't already exist.
		*/
		function getDiv (divID)
		{
		  	// if the div doesn't exist on the page already, create it
			if (!document.getElementById(divID)) {
				divFormatted = false;
			  var newNode = document.createElement("div");
			  newNode.setAttribute("id", divID);
			  //document.body.appendChild(newNode);
			  //alert('at get div:'+'autoSuggestLayer'+queryField.getAttribute("id"));
			  document.getElementById('autoSuggestLayer'+queryField.getAttribute("id")).appendChild(newNode);
			}
		    
			// set the globalDiv reference
			globalDiv = document.getElementById(divID);
		    
			// figure out where the top corner of the div should be, based on the
			// bottom left corner of the input field
			x = queryField.offsetLeft;
			y = queryField.offsetTop + queryField.offsetHeight;
			var parent = queryField;
			while (parent.offsetParent) {
			  parent = parent.offsetParent;
			  x += parent.offsetLeft;
			  y += parent.offsetTop;
			}
		    
			// add some formatting to the div, if we haven't already
			if (!divFormatted) 
			{
			  globalDiv.style.backgroundColor = DIV_BG_COLOR;
			  globalDiv.style.fontSize = "11px";
			  globalDiv.style.fontFamily = "Arial, Helvetica, sans-serif";
			  globalDiv.style.paddingLeft = "0px";
			  globalDiv.style.margin="0px";
			  globalDiv.style.border = "1px solid black";
                          
								  			  
			  //Request #1402 HR start
			  var ControlType = hiddenControlName.value;
			  if( ControlType != null )
			  {
			      if( ControlType == "small")
			      {			  
			            globalDiv.style.width = "150px";
			            globalDiv.style.height = "200px";
			            globalDiv.style.fontSize = "10px";
			      }
			      else if( ControlType == "medium")
			      {		
			            globalDiv.style.width = "140px";
			            globalDiv.style.height = "125px";
			            globalDiv.style.fontSize = "10px";
			      }
			      else if( ControlType == "mediumhotel")
			      {		
			            globalDiv.style.width = "175px";
			            globalDiv.style.height = "125px";
			            globalDiv.style.fontSize = "10px";
			      }
			      else if( ControlType == "large")
			      {		
			            globalDiv.style.width = "184px";
			            globalDiv.style.height = "75px";
			            globalDiv.style.fontSize = "10px";
			      }			      
			      else if( ControlType == "largehotel")
			      {		
			            globalDiv.style.width = "385px";
			            globalDiv.style.height = "74px";
			            globalDiv.style.fontSize = "10px";
			      }
			      else
			      {
			           globalDiv.style.width = "400px";
			           globalDiv.style.height = "200px";
			      }
			 }
			 else
			 {
			        globalDiv.style.width = "400px";
			       globalDiv.style.height = "200px";
			 }			 
                         			 			 
			  //Request #1402 HR start			  
			  if(BrowserDetect.browser!='Explorer')
			  { 
			        globalDiv.style.whiteSpace = "nowrap";
			  }
			  //end HR

			  globalDiv.style.color="black";
			  
			  // new overflow style to allow scrolling
			  globalDiv.style.overflow = "auto";
			  //globalDiv.style.fontSize = "100%";
		  
			  globalDiv.style.position = "absolute";
			  globalDiv.style.visibility = "hidden";
			  globalDiv.style.zIndex = 10000;
		      		      		      
			  divFormatted = true;
			}
			
			  globalDiv.style.left = x + "px";
			  
			  globalDiv.style.top = y + "px";
			  
		      
		  return globalDiv;
			}
	  
		function IsMouseOnScrollbar()
		{
            // only do this for IE
		//alert(BrowserDetect.browser);
            if ((BrowserDetect.browser=='Explorer') && (globalDiv))
            {
                var scrollBarPosition = (parseInt(globalDiv.offsetWidth) + parseInt(x));
    		    var mousePosition = 0;
    		    

                if (window.event)
                    if (window.event.x)
                       mousePosition = window.event.clientX + (document.documentElement.scrollLeft ?
                       document.documentElement.scrollLeft :
                       document.body.scrollLeft);
                   		    
		        // is the mouse at the scrollbar position in ie.		    
		        if ( (mousePosition >= scrollBarPosition - scrollBarWidth) && (mousePosition <= scrollBarPosition) )
		            //cancel events
		            {
		            return true;
		            }
		        else		   
		            return false;
		    }
		    else
		        return false;
		}
		
		function InitQueryCode (queryFieldName,DivID)
		{
		    // Change by Ankit, as the below tag is not working in Mozilla Firefox
            //queryField = document.getElementsByName(queryFieldName).item(0);
            queryField = document.getElementById(queryFieldName);
            
            // restrict from typing Special Character
            if (restrictInvalidCharacter(queryField.value) == false)
            {
                hideDiv();
                return false;
            }
            
            queryField.onblur = hideDiv;
            queryField.onkeydown = keypressHandler;            
		    divName = DivID
		}
		/**
		This is the function that should be returned by the XMLHTTP call. It will
		format and display the lookup results.
		*/
		function showQueryDiv (resultArray1,clientID)
		{
		  //alert(document.getElementById('autoSuggestLayer'));
		  var div = getDiv(divName);
		  
		  
		  // remove any results that are already there
		  while (div.childNodes.length > 0)
			div.removeChild(div.childNodes[0]);
		  
		  // add an entry for each of the results in the resultArray
		  for (var i = 0; i < resultArray1.length; i++)
		  //for (var i = 0; i < 100; i++)
		  {
			// each result will be contained within its own div
			var result = document.createElement("div");
			result.style.cursor = "pointer";
			//result.style.borderBottom = "1px solid #777777";
			result.style.padding = "2px 2px 2px 2px";
			result.style.height="16px";
			
			// check for master destination
            // if (resultArray1[i].substring(0,1)==" ")
            // alert('jamie');
			
			_unhighlightResult(result);
			
			result.onmousedown = selectResult;
			result.onmouseover = highlightResult;
			result.onmouseout = unhighlightResult;

			var result1 = document.createElement("span");
			result1.className = "result1";
			result1.style.textAlign = "left";
			//result1.style.fontWeight = "bold";
			result1.innerHTML = resultArray1[i];
		    
		    
			result.appendChild(result1);
			div.appendChild(result);
		  }
		  
		  // display the div if we had at least one result
		  showDiv(resultArray1.length > 0);
		  //create the iframe 
		  //createiframe(div.offsetHeight,div.offsetWidth,div.style.left,div.style.top);
		  createiframe(div.offsetHeight,div.offsetWidth,div.style.left,div.style.top);
		  
		}
				
		/**
		This either shows or hides the lookup div, depending on the value of
		the "show" parameter. // Change by Ankit to solve Focus Problem
		*/
        function showDiv (show)
        {		    
            var div = getDiv(divName);
            if(div != null)
            {
                if (show)
                {
                    div.style.visibility = "visible";
                    div.style.display='';
                }
                else
                {
                    div.style.visibility = "hidden";
                    div.style.display='none';
                    var newframe = document.getElementById("newiframe")
                    if(newframe != null)
                        newframe.style.display='none';
                }
            }
        }
		
//		//Result Retreived
//		function GetCallback(result,context)
//        {
//			var SuggestText = new Array();
//            if(result.length > 0)
//            {
//				SuggestText = result.split(",");
//				showQueryDiv(SuggestText);
//            }
//            else
//				return false;
//        }

        function GetSuggestion(TextBoxID,NoOfRecords,DisplayColumnName,DivID,SortableColumnName,NeedTitleCase,htxtControlTypeId)
        {
        	txt_ControlName = TextBoxID;
		    Control_NoOfRecords = NoOfRecords;
		    Control_DisplayColumnName = DisplayColumnName;
		    Control_SortableColumnName = SortableColumnName;
		    Control_NeedTitleCase = NeedTitleCase;
        
			if (InitQueryCode(TextBoxID,DivID) == false)
			    return false;
			mainloop();
			hiddenControlName = document.getElementById(htxtControlTypeId);						
        }
        
		/**
		This is called when a user mouses away from a lookup result
		*/
		function unhighlightResult()
		{
		  _unhighlightResult(this);
		}
		/** This actually unhighlights the selected result */
		function _unhighlightResult(item)
		{
		  item.style.backgroundColor = DIV_BG_COLOR;
		}
		/**
		We originally used showDiv as the function that was called by the onBlur
		event of the field, but it turns out that Firefox will pass an event as the first
		parameter of the function, which would cause the div to always be visible.
		So onBlur now calls hideDiv instead.
		*/
		function hideDiv ()
		{
		  //is mouse over scrollbars..?		  
		  var div = getDiv(divName);
		  //if (div.style.visibility == "hidden")
		  
		  if (!IsMouseOnScrollbar())
		  {
	          // get the span that's currently selected, and perform an appropriate action
	          var selNum = getSelectedSpanNum(div);
	          if (div.style.visibility != "hidden")
	          {
	              //if (selNum==-1) selNum=0;
	              var selSpan = setSelectedSpan(div, selNum);		  
                  if (selSpan)
                  {
		              _selectResult(selSpan);
	                  TextBoxCompleted();	
	              }
	          }
		      showDiv(false);
		   }
		  else if (BrowserDetect.browser=='Explorer')
    		  // make sure input box control has focus		  
	    	  queryField.focus();
		}

        // restrict from typing Special Character
        function restrictInvalidCharacter(textboxValue)
        {
            if (textboxValue.indexOf("'") != -1)
                return false;
        }		
		
				/**
		This is the key handler function, for when a user presses the up arrow,
		down arrow, tab key, or enter key from the input field.
		*/
		function keypressHandler (evt)
		{
		  // don't do anything if the div is hidden
		  var div = getDiv(divName);
		  if (div.style.visibility == "hidden")
			return true;
		  
		  // make sure we have a valid event variable
		  if(!evt && window.event) {
			evt = window.event;
		  }		  
		  var key = evt.keyCode;
		  
		  // if this key isn't one of the ones we care about, just return
		  var KEYUP = 38;
		  var KEYDOWN = 40;
		  var KEYENTER = 13;
		  var KEYTAB = 9;
		  var PGUP = 33;
		  var PGDN = 34;
		  var TAB = 48;
		  
		  
            if ((key != KEYUP) && (key != KEYDOWN) && (key != KEYENTER) && (key != KEYTAB) && (key != PGUP) && (key != PGDN)  && (key != TAB))
            {
                div.scrollTop=0;
                return true;
            }
		  
		  // get the span that's currently selected, and perform an appropriate action
		  var selNum = getSelectedSpanNum(div);
		  var selSpan = setSelectedSpan(div, selNum);
		  if ((key == KEYENTER) || (key == KEYTAB) || (key == TAB)) {
		    //select default value if none selected
		    if (selNum==-1) selNum=0;  
		    var selSpan = setSelectedSpan(div, selNum);
			if (selSpan)
			  _selectResult(selSpan);
		  	//evt.cancelBubble=true;
		    TextBoxCompleted();
			return false;
		  } 
		  else 
		  {
			if ((key == KEYUP) && (selNum > 0))
			{
			  selSpan = setSelectedSpan(div, selNum - 1);
			  
			  if (selSpan)
			      if(selSpan.offsetTop<div.scrollTop) 
			        //div.scrollTop = 0;
			        div.scrollTop = selSpan.offsetTop + selSpan.offsetHeight - selSpan.offsetHeight;
			}
			if ((key == KEYDOWN) && (selNum < getMaxSpans (div)))
			{
			   selSpan = setSelectedSpan(div, selNum + 1);
			
			if (selSpan)
			       if(selSpan.offsetTop>selSpan.offsetHeight)
			           div.scrollTop = selSpan.offsetTop - div.offsetHeight + selSpan.offsetHeight;
			}
			
			if (key == PGDN)
			{
			   if (selNum < (getMaxSpans(div) - 8))
			    selSpan = setSelectedSpan(div, selNum + 8);
			   else
			    selSpan = setSelectedSpan(div, getMaxSpans(div));

               if (selSpan)
			       if(selSpan.offsetTop>selSpan.offsetHeight)
			           div.scrollTop = selSpan.offsetTop - div.offsetHeight + selSpan.offsetHeight ;
			}
			
			if (key == PGUP)
			{
			   if (selNum > 7)
			    selSpan = setSelectedSpan(div, selNum - 7);
			   else
			    selSpan = setSelectedSpan(div, 0);

                if (selSpan)
			      if(selSpan.offsetTop<div.scrollTop) 
			           div.scrollTop = selSpan.offsetTop + selSpan.offsetHeight - selSpan.offsetHeight;
			}			
			
			if (selSpan)
			  _highlightResult(selSpan);
		  }
		  showDiv(true);
		  return true;
		}
		/**
		Get the number of the result that's currently selected/highlighted
		(the first result is 0, the second is 1, etc.)
		*/
		function getSelectedSpanNum (div)
		{
		  var count = -1;
		  var spans = div.getElementsByTagName("div");
		  if (spans) {
			for (var i = 0; i < spans.length; i++) {
			  count++;
			  if (spans[i].style.backgroundColor != div.style.backgroundColor)
				return count;
			}
		  }
		  
		  return -1;
		}

		/**
		Get the max elements in the list
		*/
		function getMaxSpans (div)
		{
		  var spans = div.getElementsByTagName("div");		  
		  if (spans)
		    return spans.length-1;
		  else
		    return -1;
		}		
		
		/**
		Select/highlight the result at the given position
		*/
		function setSelectedSpan (div, spanNum)
		{
		  var count = -1;
		  var thisSpan;
		  var spans = div.getElementsByTagName("div");
		  if (spans) {
			for (var i = 0; i < spans.length; i++) {
			  if (++count == spanNum) {
				_highlightResult(spans[i]);
				thisSpan = spans[i];
			  } else {
				_unhighlightResult(spans[i]);
			  }
			}
		  }
		  return thisSpan;
		}
		/**
		This is called when a user mouses over a lookup result
		*/
		function highlightResult()
		{
		  _highlightResult(this);
		}

		/** This actually highlights the selected result */
		function _highlightResult(item)
		{
		  item.style.backgroundColor = DIV_HIGHLIGHT_COLOR;
		}
				/**
		This is called whenever the user clicks one of the lookup results.
		It puts the value of the result in the queryField and hides the
		lookup div.
		*/
		function selectResult()
		{
		  _selectResult(this);
		  TextBoxCompleted();
		}
		/** This actually fills the field with the selected result and hides the div */
		function _selectResult(item)
		{
		  var spans = item.getElementsByTagName("span");
		  if (spans) {
			for (var i = 0; i < spans.length; i++) {
			  if (spans[i].className == "result1") {
				queryField.value = spans[i].innerHTML;
				lastVal = val = queryField.value;
				searching = false;
				mainloop();
				queryField.focus();
				showDiv(false);
				return;
			  }
			}
		  }
		}
		

        function mainloop()
        {	
        		        
			textprefix = queryField.value;
			// changed by JS, first two characters
			if(queryField.value.length > 2 && lastVal != textprefix)
			{
				lastVal = textprefix;
				//textprefix = queryField.name+"^"+queryField.value;
				var vSearchText = queryField.value;
				//var txt_Locale = "<%= base.ControlLocale %>";
       			    AutoCompleteControl.AutoSearch
                    (vSearchText,Control_NoOfRecords,Control_DisplayColumnName,txt_ControlName,txt_Locale,Control_SortableColumnName,Control_NeedTitleCase,function(result)
                    {                  
                    
                        if(result.value != "")
                        {
		                    SuggestText = result.value.split("|");
		                    // fix to correct issue with layer
		                    // not loading before div is shown
				            showQueryDiv(SuggestText);
				        }
                        else
                        {
                            hideDiv();
				            return false;
				        }
		            });
			}
			else
				return false;
        }
/** end of autocomplete.js **/

/** bookmark.js **/
function getURL(strPath)
{
  var path = strPath + StrUrl;
  window.open(path);
  return false;
}

/** bookmark.js **/

/** alfiemessage.js **/


function SetAlfieDefaultMessage()
      {
          var PeaseWaitLabel = document.getElementById(getPLeaseWaitLabel);  
          if(PeaseWaitLabel != null)                                                                                                     
            PeaseWaitLabel.innerHTML = strHotelMessage;      
      }   

 function SetMessageInFlightSearch()
      {        

        var rbFlight = document.getElementById(RbFlight);
        var rbFlightHotel = document.getElementById(RbFlightHotel);
        var rbPackages = document.getElementById(RbPackages);
        
        var GetPLeaseWaitLabel = document.getElementById(getPLeaseWaitLabel);
                             
        if( rbFlight != null && rbFlightHotel != null)
            {                                               
                if(rbFlight.checked == true || rbFlightHotel.checked == true)
                {                                                          
                    GetPLeaseWaitLabel.innerHTML = strmessage;                                                    
                }
                else if(rbPackages != null && rbPackages.checked == true)
                {
                    GetPLeaseWaitLabel.innerHTML = strPackageMessage;                               
                }
                else
                {
                    GetPLeaseWaitLabel.innerHTML = strHotelMessage;            
                }     
            }

      }

  function SetFlightMessageOnly()
       {                     
            var GetPLeaseWaitLabel = document.getElementById(getPLeaseWaitLabel);
                                                            
            if( GetPLeaseWaitLabel != null )
            {                                           
                GetPLeaseWaitLabel.innerHTML = strmessage;
            }                                        
      }
      
      
      function SetSrchAlfieMessage()
      {          
        var GetPLeaseWaitLabel = document.getElementById(_getPLeaseWaitLabel);
                                
        if( _searchType != null && _searchType != null && _searchType != null && GetPLeaseWaitLabel != null)
            {                                               
                if( _searchType == "FlightOnly" || _searchType == "FlightsAndHotel"  )
                {                                                          
                    GetPLeaseWaitLabel.innerHTML = strmessage;                               
                }
                else if(_searchType == "Packages")
                {
                    GetPLeaseWaitLabel.innerHTML = strPackageMessage;                               
                }
                else
                {
                    GetPLeaseWaitLabel.innerHTML = strHotelMessage;            
                }     
            }

      }
      
      
/** end of alfie message.js **/

/** Ski Related JS **/
function HideModelDiv(modelID, RbtnID)
{
    var divObj = document.getElementById(modelID);
    if(!document.getElementById(RbtnID).checked)
        divObj.style.display = "none";
}


function clearCheckBoxSelection(radiobtnid1,radiobtnid2,radiobtnid3,radiobtnid4, radiobtn)
{
    document.getElementById(radiobtnid1).checked = false;
    document.getElementById(radiobtnid2).checked = false;
    document.getElementById(radiobtnid3).checked = false;
    document.getElementById(radiobtnid4).checked = false;
    
    radiobtn.checked = true;
    
}

/** begin map **/
var map;

function addDraggableTabbedMarker(num,imagePath,establishmentName,address,categorySnippet,reviewSnippet,descriptionSnippet,lat,lon,url,priceFrom,categoryNum,isSelected) 
{    
        var image_html='';
	    var title_html='';
	    var link_html='<div style="float:right"><a target="_parent" rel=nofollow href="' + url + '">View Info and Book &gt; </a></div>';
    	
	    if (imagePath!=null)
	        image_html='<img align=left width=80 src="'+imagePath+'"/>';

	    title_html='<h1>' + establishmentName + '</h1><div style="width:200px">'+categorySnippet+reviewSnippet+'</div><div style="width:200px">' + address + '</div>';
	    
	    // wrap div around prices from
	    if (priceFrom.length>0)
	        priceFrom = '<div style="color:red;font-weight:bold">Prices from &pound;' + priceFrom +'</div>';
		        
        var marker = new GMarker(new GLatLng(lat,lon));
        marker.value = num;
        
        GEvent.addListener(marker,"click", function() {        
        map.openInfoWindowHtml(new GLatLng(lat,lon), '<div style="height:230px">'+title_html+'<div>' + image_html + '</div><div>' + descriptionSnippet + '</div>' + priceFrom + '<div>' +  link_html + '</div></div>',{maxWidth:250});
        });
        
        map.addOverlay(marker);
        
        // should open default marker if hotel
        if (isSelected==1)
            map.openInfoWindowHtml(new GLatLng(lat,lon), '<div style="height:230px">'+title_html+'<div>' + image_html + '</div><div>' + descriptionSnippet + '</div>' + priceFrom + '<div>' +  link_html + '</div></div>',{maxWidth:250});

}


function closeMap()
{
    document.getElementById('iframeMapLarge').style.display='none';
    document.getElementById('opacityLayer').style.display='none';
    document.getElementById('closeLayer').style.display='none';
}

function expandMap() 
{
        
        document.documentElement.scrollTop='0px';
        document.getElementById('iframeMapLarge').style.display='block';
        document.getElementById('iframeMapLarge').style.left=((document.documentElement.clientWidth-774)/2)+'px';

        if (frames['iframeMapLarge'].location.href.indexOf(frameSrc) <= 0)
            frames['iframeMapLarge'].location=frameSrc;     
            
        document.getElementById('opacityLayer').style.display = 'block';
        
        pageXY = getPageSizeWithScroll();
        
        document.getElementById('opacityLayer').style.width = pageXY[0] + "px";
        document.getElementById('opacityLayer').style.height = pageXY[1] + "px";
        document.getElementById('closeLayer').style.display='block';
        document.getElementById('closeLayer').style.left = ((document.documentElement.clientWidth-774)/2)+'px';
        document.getElementById('closeLayer').style.top = '105px';
}

function getPageSizeWithScroll(){
	if (window.innerHeight && window.scrollMaxY) {// Firefox
		yWithScroll = window.innerHeight + window.scrollMaxY;
		xWithScroll = window.innerWidth + window.scrollMaxX;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		yWithScroll = document.body.scrollHeight;
		xWithScroll = document.body.scrollWidth;
	} else { // works in Explorer 6 Strict, Mozilla (not FF) and Safari
		yWithScroll = document.body.offsetHeight;
		xWithScroll = document.body.offsetWidth;
  	}
	arrayPageSizeWithScroll = new Array(xWithScroll,yWithScroll);
	//alert( 'The height is ' + yWithScroll + ' and the width is ' + xWithScroll );
	return arrayPageSizeWithScroll;
}


function googleLoadEventHandler() 
{  
}

/* end map **/

function MM_BodyInfoTrackLocal(action){
			try{
				window.mmcore._async=true;
				if (navigator.userAgent.toLowerCase().indexOf("safari")==-1){
					window.mmcore.SetAction(action,1); 
					window.mmcore.CGRequest(); 
				}
				
				//SetMessageInFlightSearch();
				//alert('MM_BodyInfoTrackLocal' + ' action = ' + action);//uncomment for testing
			}catch(e){
				//alert(e.description);;//uncomment for testing
			}
		}  
		
		
//function UpdateMaximiserValue(hdnMaximiserValue,value){    
        //if (document.getElementById(hdnMaximiserValue)){
        //var eleMax = document.getElementById(hdnMaximiserValue);
        //eleMax.value = value;        
      //alert(eleMax.value);
     //   }
    //}
    
    
    /** set r cookie **/
    
    var cookieName="AriaAffiliateEngine_ALPHA";
var affiliateSubString="Affiliate";
var referrerSubString="HttpReferrer";
var cookieSeparator=":";
var tradedoublertduidcookiename="tduid";
var phoneReferenceSubString = "PhoneReference";
var phoneRefQueryStringVar  = "ph";

// remebers the Trade Doubler TDUID
function setTDUIDCookie()
{
 var qs_tduid=queryString("tduid");
 if (qs_tduid!="false")        
    {  
    var tduidcookiestring = qs_tduid;
    //write to cookie
    setCookie(tradedoublertduidcookiename,tduidcookiestring,365,"/","","");   
    }
}

// hunts in querystring for r= parameter, and appends
// to the current cookie
function setRCookie()
{
    var phoneReferenceValue = ""; 
    var currentCookie = "";    
    var httpReferrerValue="";
    var affiliateValue="";
    var newCookie="";
    var isNewCookie=false;
    currentCookie+=getCookie(cookieName);
    
    httpReferrerValue = getCookieSubString(currentCookie,referrerSubString);
    affiliateValue = getCookieSubString(currentCookie,affiliateSubString);
    
    phoneReferenceValue = getCookieSubString(currentCookie,phoneReferenceSubString);
    
    // two parts to the current cookie, the Affiliate= and the
    // HttpReferrer part
    // e.g. 
    // HttpReferrer=http://www.travelsupermarket.com/hotels/HotelResults.aspx?masterquery=true&id=410100000000000963&p=&cid=206&t=2|0|0|1|Costa%20Del%20Sol%20|24-Feb-2007|Spain&Affiliate=http://www.alpharooms.com/:TD:TD:TD:conrad_guk:AF:AF:AF:AF:AF:travelsupermarket
    // therefore this string needs splitting further    
    
    // check for referrer
    if ((!httpReferrerValue) || (httpReferrerValue=="") || (httpReferrerValue=="false") || (httpReferrerValue==null))
    {        
        if (document.referrer)
        {            
            httpReferrerValue = document.referrer;
            isNewCookie=true;
        }            
        else
            httpReferrerValue = "www.alpharooms.com";    
    }        
    //alert("new referrer:" + httpReferrerValue);
    //alert(queryString("r"));
    var qs_phone = queryString(phoneRefQueryStringVar);
        
    if (((qs_phone!="false") && (qs_phone!="") ) || (isNewCookie))
    { 
        phoneReferenceValue+=cookieSeparator+qs_phone;
    }
    var cookieSaved = false;
    var qs_r = queryString("r");
        
    if ((qs_r!="false") || (isNewCookie))
    {        
    
        //FIX for blank R values
        //also check for new cookie to record natural search
        if ((qs_r!="") || (isNewCookie))
        {
            cookieSaved = true;
            //TODO: do we need to escape values?
            //shouldnt be escaping whole cookie..
            affiliateValue+=cookieSeparator+qs_r;
            newCookie = affiliateSubString+"="+affiliateValue + "&" + referrerSubString + "=" + httpReferrerValue + "&" + phoneReferenceSubString + "=" + phoneReferenceValue;
            setCookie(cookieName,newCookie,365,"/","","");
        }
    }
    if((cookieSaved == false) && (((qs_phone!="false") && (qs_phone!="")) || (isNewCookie)))
    {
        // create new cookie 
        newCookie = affiliateSubString+"="+affiliateValue + "&" + referrerSubString + "=" + httpReferrerValue + "&" + phoneReferenceSubString + "=" + phoneReferenceValue;
        setCookie(cookieName,newCookie,365,"/","","");
    }

}

// reusable code
function setCookie( name, value, nDays, path, domain, secure ) 
{
    // set time, it's in milliseconds
    var today = new Date();
    today.setTime( today.getTime() );

    /*
    if the expires variable is set, make the correct 
    expires time, the current script below will set 
    it for x number of days, to make it for hours, 
    delete * 24, for minutes, delete * 60 * 24
    */
    
    var expire = new Date();
    expire.setTime(today.getTime() + 3600000*24*nDays);

    document.cookie = name + "=" +value +
    ( ( expire ) ? ";expires=" + expire.toGMTString() : "" ) + 
    ( ( path ) ? ";path=" + path : "" ) + 
    ( ( domain ) ? ";domain=" + domain : "" ) +
    ( ( secure ) ? ";secure" : "" );
}
			
// this function gets the cookie, if it exists
function getCookie( name ) 
{	
    var start = document.cookie.indexOf( name + "=" );
    //alert(document.cookie);
    var len = start + name.length + 1;
    if ( ( !start ) &&
    ( name != document.cookie.substring( 0, name.length ) ) )
    {
    return null;
    }
    if ( start == -1 ) return null;
    var end = document.cookie.indexOf( ";", len );
    if ( end == -1 ) end = document.cookie.length;
    return unescape( document.cookie.substring( len, end ) );
}


// this function gets the cookie substring, if it exists
function getCookieSubString( cookieValue, name ) 
{	
    var start = cookieValue.indexOf( name + "=" );
    //alert(document.cookie);
    
    var len = start + name.length + 1;
    
    if ( ( !start ) &&
    ( name != cookieValue.substring( 0, name.length ) ) )
    {
    return null;
    }
    if ( start == -1 ) return null;
    
    // look for apostrophe in cookie
    var end = cookieValue.indexOf( "&", len );
    if ( end == -1 ) end = cookieValue.length;
    return unescape( cookieValue.substring( len, end ) );
}

			
/** query string parsing functions **/
function PageQuery(q) {
    if(q.length > 1) this.q = q.substring(1, q.length);
    else this.q = null;
    this.keyValuePairs = new Array();
    if(q) {
    for(var i=0; i < this.q.split("&").length; i++) {
    this.keyValuePairs[i] = this.q.split("&")[i];
    }
    }
    this.getKeyValuePairs = function() { return this.keyValuePairs; }
    this.getValue = function(s) {
    for(var j=0; j < this.keyValuePairs.length; j++) {
    if(this.keyValuePairs[j].split("=")[0] == s)
    return this.keyValuePairs[j].split("=")[1];
    }
    return false;
    }
    this.getParameters = function() {
    var a = new Array(this.getLength());
    for(var j=0; j < this.keyValuePairs.length; j++) {
    a[j] = this.keyValuePairs[j].split("=")[0];
    }
    return a;
    }
    this.getLength = function() { return this.keyValuePairs.length; }
}

function queryString(key){
    var page = new PageQuery(window.location.search);
    return unescape(page.getValue(key));
    }
    function displayItem(key){
    if(queryString(key)=='false')
    {
    document.write("you didn't enter a ?name=value querystring item.");
    }else{
    document.write(queryString(key));
    }
}


/** end setrcookie **/

/** room.js **/
function validateAdults(source,args)
{

    var ddlAdults = document.getElementById(adultsDropDownList);
    if (ddlAdults.value == "Adults (14+)")
         args.IsValid = false;
    else
        args.IsValid = true;       
}

function validateChildren(source,args)
{

 var ddlChildren = document.getElementById(childrenDropDownList);
    if (ddlChildren.value == "Children")
        args.IsValid = false;
    else
        args.IsValid = true; 
}
/** end room.js**/

/** alpha search control.js **/


/*
    This function is used to toggle between various Options: 
    1. Flight Only Option
    2. Flight+Hotel Option
    
    3. HotelOnly Option
    Only gets called when user clicks on Radio buttons.
*/


/*
    This function is used to toggle between various Options: 
    1. Flight Only Option
    2. Flight+Hotel Option
    
    3. HotelOnly Option
    Only gets called when user clicks on Radio buttons.
*/
function fn_RadioSelected()
{


    //var _flightMode                             =   document.getElementById();
    var totalPassengersForFlightOnly            =   document.getElementById(TotalPassengersForFlightOnly);
    var totalPassengersForFlightHotelOnly       =   document.getElementById(TotalPassengersForFlightHotelOnly);
    var hotelOnlyOption                         =   document.getElementById(HotelOnlyOption);
    var flight_HotelDiv                         =   document.getElementById(Flight_HotelDiv);
//    var GoingToLabel_ID                         =   document.getElementById(goingToLabel_ID);
   // var _toShowGoingToDivs                      =   document.getElementById();
    var _optionsHyperLink                       =   document.getElementById(_OptionsHyperLink);
    var departFromreq                           =   document.getElementById(DepartFromreq);
    var flightOnlyRadio                         =   document.getElementById(FlightOnlyRadio);
    var flightHotelOnlyRadio                    =   document.getElementById(FlightHotelOnlyRadio);
    var RbtnHotel                               =   document.getElementById(rbtnHotel);
    var RbtnPackages                            =   document.getElementById(rbtnPackages);
    var SearchFromTab                           =  searchFromTab; 
    var fltHotelRoomDiv                         = document.getElementById(FlightHotelRoomDiv);
    var lblNoOfRooms                            = document.getElementById(LblNoOfRooms);
    
      if(_toShowGoingToDivs == "True")
      {
           var airport_Div             =   document.getElementById(Airport_Div);
           var destination_Div         =   document.getElementById(Destination_Div);
      }
       
        //in case of flightOnly Option , hide the Room control(for child ages)
        if (flightOnlyRadio.checked == true)
        {

            lblNoOfRooms.style.display = 'none';
            fltHotelRoomDiv.style.display = 'none';
            flight_HotelDiv.style.display = '';
            totalPassengersForFlightOnly.style.display ='';
            hotelOnlyOption.style.display = 'none';
            SearchFromTab = "Flight";
            if(_toShowGoingToDivs == "True")
            {
                if (airport_Div != null)
                airport_Div.style.display = '';
                
                if (destination_Div != null)
                destination_Div.style.display = 'none'; 
                
                //TODO : Remove the Hard-coded value.
//                GoingToLabel_ID.innerHTML = "Arrival (City or Airport)";

            }
            
            departFromreq.enabled   =   true;
            
            if(_optionsHyperLink != null)
            {
                _optionsHyperLink.innerText=  flightLinkMsg;
                _optionsHyperLink.href = "/cheap-flights.aspx";

            }
          
        }
        else if (flightHotelOnlyRadio.checked == true)
        {
            lblNoOfRooms.style.display = '';
            fltHotelRoomDiv.style.display = '';
         SearchFromTab = "Flight+Hotel";
            flight_HotelDiv.style.display = '';
            totalPassengersForFlightOnly.style.display ='none';
            hotelOnlyOption.style.display = 'none';
            
            if(_toShowGoingToDivs == "True")
            {
                if(airport_Div != null)
                airport_Div.style.display = 'none';
                
                destination_Div.style.display = '';   

            }
           
            departFromreq.enabled   =   true;
            
             if(_optionsHyperLink != null)
             {
                _optionsHyperLink.innerText= flighthotelMsg;
                _optionsHyperLink.href = "/build-your-holiday.aspx";
              }
         

        }
        else if (RbtnHotel.checked == true)
        {
         SearchFromTab = "Hotel";
         fltHotelRoomDiv.style.display = 'none';
            hotelOnlyOption.style.display = '';
            flight_HotelDiv.style.display = 'none';
            totalPassengersForFlightOnly.style.display ='none';
            
            if(_toShowGoingToDivs == "True")
            {
               if(airport_Div != null)
                airport_Div.style.display = 'none';
                
                destination_Div.style.display = 'none';    
            }
            else
            {
                
                departFromreq.enabled=false;
            }
                
            if(_optionsHyperLink != null)
            {
                _optionsHyperLink.innerText= hotelLinkMsg;
                _optionsHyperLink.href = "/discount-hotels.aspx";

            }   
       
        }
        else if (RbtnPackages.checked == true)
        {
                flight_HotelDiv.style.display = '';
                fltHotelRoomDiv.style.display = 'none';
                 SearchFromTab = "Package";
                hotelOnlyOption.style.display = 'none';
                totalPassengersForFlightOnly.style.display ='';
                _currentSearch ='Packages';
                if(_toShowGoingToDivs == "True")
                {
                    if(airport_Div != null)
                    airport_Div.style.display = 'none';
                    
                    destination_Div.style.display = '';   
        
                }
                
                departFromreq.enabled   =   true;
                
             if(_optionsHyperLink != null)
             {
                _optionsHyperLink.innerText= flighthotelMsg;
               _optionsHyperLink.href = "/build-your-holiday.aspx";

              }


}
}

 /*Gp-1843-*/
     function clearDropDown(objSelect)
     {
    
             for (var i = (objSelect.options.length-1); i >= 0; i--)
             {
                 objSelect.options[i]=null;
             }
             
    }



     /*Gp-1843-*/
    function beginDropDownRequest(sender, args)
    { 
    
         var prm = Sys.WebForms.PageRequestManager.getInstance();
         fixAjaxBeginRequest(sender,args);
         var elem = args.get_postBackElement();
    
         if (elem.id.indexOf("countryDDL") != -1)
         {
         
             var destDDL = document.getElementById(DestDDL);
                 clearDropDown(destDDL);
                  if(destDDL != null)
                  {
                    // Create an Option object                
                    var opt = document.createElement("option");
                      // Add an Option object to Drop Down/List Box
                      destDDL.options.add(opt);        // Assign text and value to Option object
                       opt.text = LoadDest;
                       opt.value = 0;
                      destDDL.disabled = true;
                      
                      
                  }
         }
          else if (elem.id.indexOf("CountryDDL") != -1)
         {
         
             var fltAirportDDl = document.getElementById(FltAirportDDL);
                 clearDropDown(fltAirportDDl);
                  if(fltAirportDDl != null)
                  {
                    // Create an Option object                
                    var opt = document.createElement("option");
                      // Add an Option object to Drop Down/List Box
                      fltAirportDDl.options.add(opt);        // Assign text and value to Option object
                       opt.text = LoadAirprt;
                       opt.value = 0;
                      fltAirportDDl.disabled = true;
                      
                      
                  }
         }
         
            else  if(elem.id.indexOf("DestDDL") != -1)
              {
                    var Resort = document.getElementById(ResortDDL);
                       clearDropDown(Resort);
                    if(Resort != null)
                    {
                       // Create an Option object                
                        var opt = document.createElement("option");
                          // Add an Option object to Drop Down/List Box
                          Resort.options.add(opt);        // Assign text and value to Option object
                           opt.text = LoadRsrt;
                           opt.value = 0;
                          Resort.disabled = true;
                         
                    }
                }
                else  if(elem.id.indexOf("ResortDDL") != -1)
              {
                    var ArrAirport = document.getElementById(ArrAirportDDL);
                       clearDropDown(ArrAirport);
                    if(ArrAirport != null)
                    {
                       // Create an Option object                
                        var opt = document.createElement("option");
                          // Add an Option object to Drop Down/List Box
                          ArrAirport.options.add(opt);        // Assign text and value to Option object
                           opt.text = LoadAirprt;
                           opt.value = 0;
                          ArrAirport.disabled = true;
                         
                    }
                }
         var status = prm.get_isInAsyncPostBack();
         if(status)
         {
           args.set_cancel(true);
       
         }
    }
    
    
     /*Gp-1843-*/
    function endDropDownRequest( sender, e )
    {
    
        //Hide any Tool Tip visible.
        delayhidemenu();
    }



/** end of alphasearchcontrol.js **/

/** hotel seach control.js **/


function PerformValidation(s,args)
{
    if(document.getElementById(errorDIV) == 'True')
    {
       if(document.getElementById(viewDestination) == document.getElementById(destinationTextBoxUserControl).value)
       {
           document.getElementById(errorDIV).style.display = "none";
           args.IsValid = false;
       }
       else
       {
           document.getElementById(errorDIV).style.display = "none";
           args.IsValid = true;
       }
    }
    else
    {
        args.IsValid = true;
    }
}

/*
    Used to set the backGround of the selected DIV...     
*/	
function HighlightControl(Obj) 
{
    if (document.getElementById(rbtnDestination))
        document.getElementById(rbtnDestination).checked = true;
    if (document.getElementById(rbtnResorts))
        document.getElementById(rbtnResorts).checked = false;
    if (document.getElementById(rbtnCities))
        document.getElementById(rbtnCities).checked = false;
    if(document.getElementById(alternateDestinationRadioButton))
        document.getElementById(alternateDestinationRadioButton).checked = false;
        
    if(Obj == 'resort' || Obj == 'city')     // When user clicks the TopDestiantion(having Resort options) Div...
    {
         document.getElementById(lblDestinationDIV).style.backgroundColor = "";	        
         
         ////PAwan 01/05/07 disabling required field validator for destination text box
         req = document.getElementById(destinationTextBoxValidatorClientID)
         req.enabled=false;
         custVal = document.getElementById(custValidator)
         custVal.enabled = false;
    }
    
    if(Obj == 'resort')
    {
         document.getElementById('resort').style.display = "block"; 
         document.getElementById('city').style.display = "none";
         document.getElementById(rbtnResorts).checked = true;
    }
    else if(Obj == 'city') //city
    {
	     document.getElementById('city').style.display = "block"; 
	     document.getElementById('resort').style.display = "none";
	     document.getElementById(rbtnCities).checked = true;
    }
    
    else if(Obj == 'Destination')   // When user clicks the AutoSuggestBox of its respective RadioButton..
    {
         document.getElementById(lblDestinationDIV).style.backgroundColor = "#DBEEFF";
         document.getElementById(rbtnDestination).checked = true;
                  
         ////PAwan 01/05/07 enabling required field validator for destination text box
         req = document.getElementById(destinationTextBoxValidatorClientID)
         req.enabled=true;
         custVal = document.getElementById(custValidator)
         custVal.enabled = true;

	}
	
	else if(Obj == 'AlternateDestinations')     //When the user clicks the Alternate Destination DIV/Panel
	{
	    var _lblDestinationDIV = document.getElementById(lblDestinationDIV);
	    document.getElementById(alternateDestinationRadioButton).checked = true;
	    
	    if(_lblDestinationDIV != null)
	    {
	        _lblDestinationDIV.style.backgroundColor = "";	
	        
	        //disabling required field validator for destination text box
             req = document.getElementById(destinationTextBoxValidatorClientID)
             req.enabled=false;
             custVal = document.getElementById(custValidator)
             custVal.enabled = false;
	    }
	}	
}


function SetCurrency(ddl1,ddl2)
{
    tempddl = document.getElementById(ddl1);
    currencyddl = document.getElementById(ddl2);
    currencyddl.selectedIndex = tempddl.selectedIndex;
}

     
     function clearHotelDD(objSelect)
     {
    
             for (var i = (objSelect.options.length-1); i >= 0; i--)
             {
                 objSelect.options[i]=null;
             }
             
    }



    
    function beginHotelDDRequest(sender, args)
    { 
         var prm = Sys.WebForms.PageRequestManager.getInstance();
         fixAjaxBeginRequest(sender,args);
         var elem = args.get_postBackElement();
    
         if(elem.id.indexOf("CountryDDL") != -1)
         {
                 var Dest = document.getElementById(DestDDl);
                 clearHotelDD(Dest);
                  if(Dest != null)
                  {
                    // Create an Option object                
                    var opt = document.createElement("option");
                      // Add an Option object to Drop Down/List Box
                      Dest.options.add(opt);        // Assign text and value to Option object
                       opt.text = LoadDest;
                       opt.value = 0;
                      Dest.disabled = true;
                      
                  }
             
         }
              
            else  if(elem.id.indexOf("DestDDL") != -1)
              {
                    var Resort = document.getElementById(ResortDDl);
                       clearHotelDD(Resort);
                    if(Resort != null)
                    {
                       // Create an Option object                
                        var opt = document.createElement("option");
                          // Add an Option object to Drop Down/List Box
                          Resort.options.add(opt);        // Assign text and value to Option object
                           opt.text = LoadRsrt;
                           opt.value = 0;
                          Resort.disabled = true;
                         
                    }
                }
            
         var status = prm.get_isInAsyncPostBack();
         if(status)
         {
           args.set_cancel(true);
       
         }
    }
   
     
     /** end of hotel search control.js **/


/*** floating hotel control**/


function HideDiv()
{
    var draggers=document.getElementById(floatingDiv);
    draggers.style.display = "none"; 
}
function InitilizeControl()
{
    var draggers=document.getElementById(floatingDiv);
    var controlToBindID = document.getElementById(controlClientID);
    
    if(controlToBindID != null)
    {
        var x = controlToBindID.offsetLeft + controlToBindID.offsetWidth;
	    var y = controlToBindID.offsetTop;
	    var parent = controlToBindID;
	    while (parent.offsetParent) 
	    {
	        parent = parent.offsetParent;
		    x += parent.offsetLeft;
		    y += parent.offsetTop;
	    }
         
        draggers.style.left =  x - 2 +"px";
        draggers.style.top =  y - 1  + "px";
        
        draggers.style.position = "absolute";
        draggers.style.display = ""; 
    }
}
/** end of floating hotel control **/

/** flighthotelsearchcontrol.js alt radio selection */
 
 // used to hide/show divs on toggling of radio buttons
   // used to hide/show divs on toggling of radio buttons
    function fn_RadioSelectedFH()
    {

          var rbtnFlight = document.getElementById(flgihtOnlyRadio);
          var rbtnFlightHotel = document.getElementById(flgihtHotelOnlyRadio);
          var rbtnHotel = document.getElementById(RbtnHotel);
          var rbtnPackages = document.getElementById(RbtnPackages);
          var roomControlForFlight            =   document.getElementById(RoomControlForFlight);
          var roomControlForFlightAndHotel    =   document.getElementById(RoomControlForFlightAndHotel);
          var flight_HotelDiv                 =   document.getElementById(Flight_HotelDiv); 
          
          var returnDateChkDiv                =   document.getElementById(ReturnDateChkDiv);
          var checkOutPickerDivObject         =   document.getElementById(CheckOutPickerDivObject);
          var returnDateChk                   =   document.getElementById(ReturnDateChk); 
          var DvHotelOnly                     =   document.getElementById(dvHotelOnly);
          var moreThanLink                    =   document.getElementById(MoreThanLink);
          var flightHotelDropDownList         =   document.getElementById(FlightHotelDropDownList);
          var hotelDestinationDiv             =   document.getElementById(HotelDestinationDiv);
          var hotelNameDiv                    =   document.getElementById(HotelNameDiv);
          var departFromreq                   =   document.getElementById(DepartFromreq);
          var flight_checkOutPickerObj        =   document.getElementById(Flight_checkOutPickerObj);
          
          if(_toShowGoingToDivs == "True") // will be visible in all the cases except guide section
          {
               var airport_Div             =   document.getElementById(Airport_Div);
               var destination_Div         =   document.getElementById(Destination_Div);
          }
            
            //in case of flightOnly Option , hide the Room control(for child ages)
            if (rbtnFlight.checked == true)
            {

                flight_HotelDiv.style.display = '';
                roomControlForFlight.style.display ='';
                roomControlForFlightAndHotel.style.display = 'none';
                DvHotelOnly.style.display = 'none';
                _currentSearch ='Flight';
                if(_toShowGoingToDivs == "True")
                {
                    if (airport_Div != null)
                    airport_Div.style.display = '';
                    destination_Div.style.display = 'none'; 
                    //TODO : move to resx file
                    //GoingToLabel_ID.innerHTML = "<%= Resources.AlphaRooms.Vacenza_FSControl_GoingTo_Label%>";  
                }
                if(departFromreq != null)
                    departFromreq.enabled   =   true;
                    
             // sets the hyperlink value
                moreThanLink.innerHTML = flightLinkMsg ;
                switch(_searchMode)
                {
                    
                     case "HomePage":
                        roomControlForFlight.style.display ='';
                        roomControlForFlightAndHotel.style.display = 'none';
                    break;
                    
                    case "FlightsPage":
                    case "FlightsAndHotelsPage":
                    case "HotelsPage":
                        roomControlForFlightAndHotel.style.display = 'none';
                        roomControlForFlight.style.display ='';
                        returnDateChkDiv.style.display = '';
//                        if(returnDateChk.checked)
//                            {
//                                //flight_checkOutPickerObj.set_enabled(true);
//                                checkOutPickerDivObject.disabled= false;
//                            }
//                        else
//                            {
//                                //flight_checkOutPickerObj.set_enabled(false);
//                                checkOutPickerDivObject.disabled= true;
//                            }
                   break;
                   
                   case "GuidesPage":
                        if(roomControlForFlightAndHotel != null)
                            roomControlForFlightAndHotel.style.display = 'none';
                        roomControlForFlight.style.display ='';
                        returnDateChkDiv.style.display = 'none';
                   break;
                   
                   case "SearchResultsPage":
                        
                        if(roomControlForFlightAndHotel != null)
                            roomControlForFlightAndHotel.style.display = 'none';
                        _flightMode = "FlightOnly";
                        
                       
                       
                  break;
              } // end of switch block
         }// end of if block

            else if (rbtnFlightHotel.checked == true)
            {

                flight_HotelDiv.style.display = '';
                roomControlForFlight.style.display ='none';
                roomControlForFlightAndHotel.style.display = '';
                DvHotelOnly.style.display = 'none';
                _currentSearch ='FlightAndHotel';
                
                if(_toShowGoingToDivs == "True")
                {
                 if(airport_Div != null)
                    airport_Div.style.display = 'none';
                    
                    destination_Div.style.display = '';   

                }
                if(departFromreq != null)
                    departFromreq.enabled   =   true;
                
                // fills the rooms dropdown list
                flightHotelDropDownList.options.length = 0;
                // add new values
                flightHotelDropDownList.options.add(new Option('1','1'));
                flightHotelDropDownList.options.add(new Option('2','2'));
                flightHotelDropDownList.options.add(new Option('3','3'));
               
                // sets the hyperlink value
                moreThanLink.innerHTML = FlightHotel_MoreThanLink;  
                
                switch(_searchMode)
                {
                    
                    case "HomePage":
                        roomControlForFlight.style.display ='';
                        roomControlForFlightAndHotel.style.display = 'none';
                    break;
                
                    case "FlightsPage":
                    case "FlightsAndHotelsPage":
                    case "HotelsPage":
                            roomControlForFlight.style.display ='none';
                            if(roomControlForFlightAndHotel != null)
                                roomControlForFlightAndHotel.style.display = '';
                            returnDateChkDiv.style.display = 'none';
                            //flight_checkOutPickerObj.set_enabled(true);
                            checkOutPickerDivObject.disabled= false;   
                     break;
                     
                     case "GuidesPage":  
                            roomControlForFlight.style.display ='none';
                            if(roomControlForFlightAndHotel != null)
                                roomControlForFlightAndHotel.style.display = '';
                            returnDateChkDiv.style.display = 'none';
                      break;
                   
                    case "SearchResultsPage":
                            roomControlForFlightAndHotel.style.display = '';
                           
                           
                    break;
              } // end of switch block
        
      } // end of else if block
       else if (rbtnHotel.checked == true)
        {
            DvHotelOnly.style.display = '';
            flight_HotelDiv.style.display = 'none';
            roomControlForFlight.style.display ='none';
             hotelNameDiv.style.display ='';
            roomControlForFlightAndHotel.style.display = '';
            _currentSearch ='Hotel';
            
            if(_toShowGoingToDivs == "True")
            {
                if(airport_Div != null)
                airport_Div.style.display = 'none';
                
                destination_Div.style.display = 'none';    
            }
            
            // fills the rooms dropdown list
            flightHotelDropDownList.options.length = 0;
            // add new values
            flightHotelDropDownList.options.add(new Option('1','1'));
            flightHotelDropDownList.options.add(new Option('2','2'));
            flightHotelDropDownList.options.add(new Option('3','3'));
            flightHotelDropDownList.options.add(new Option('4','4'));
            flightHotelDropDownList.options.add(new Option('5','5'));
            
            // sets the hyperlink value
            moreThanLink.innerHTML = Search_MoreThanFive;            
            
             switch(_searchMode)
                {
                    case "HomePage":
                        roomControlForFlight.style.display ='';
                        roomControlForFlightAndHotel.style.display = 'none';
                    break;
                    case "FlightsPage":
                    case "FlightsAndHotelsPage":
                    case "HotelsPage":
                            roomControlForFlight.style.display ='none';
                            if(roomControlForFlightAndHotel != null)
                                roomControlForFlightAndHotel.style.display = '';
                     break;
                     
                     case "GuidesPage":  
                            roomControlForFlight.style.display ='none';
                            hotelDestinationDiv.style.display ='none';
                            hotelNameDiv.style.display ='';
                            
                            if(roomControlForFlightAndHotel != null)
                                roomControlForFlightAndHotel.style.display = '';
                      break;
                   
                    case "SearchResultsPage":
                            roomControlForFlightAndHotel.style.display = '';
                    break;
              } // end of switch block
        } // end of else if block
        else if (rbtnPackages.checked == true)
        {
                flight_HotelDiv.style.display = '';
                roomControlForFlight.style.display ='';
                roomControlForFlightAndHotel.style.display = 'none';
                DvHotelOnly.style.display = 'none';
                _currentSearch ='Packages';
                if(_toShowGoingToDivs == "True")
                {
                 if(airport_Div != null)
                    airport_Div.style.display = 'none';
                    
                    destination_Div.style.display = '';   

                }
                if(departFromreq != null)
                    departFromreq.enabled   =   true;
                
                switch(_searchMode)
                {
                    
                     case "HomePage":
                        roomControlForFlight.style.display ='';
                        roomControlForFlightAndHotel.style.display = 'none';
                    break;
                    
                    case "FlightsPage":
                    case "FlightsAndHotelsPage":
                    case "HotelsPage":
                        roomControlForFlightAndHotel.style.display = 'none';
                        roomControlForFlight.style.display ='';
                        returnDateChkDiv.style.display = 'none';
//                        if(returnDateChk.checked)
//                            {
//                                //flight_checkOutPickerObj.set_enabled(true);
//                                checkOutPickerDivObject.disabled= false;
//                            }
//                        else
//                            {
//                                //flight_checkOutPickerObj.set_enabled(false);
//                                checkOutPickerDivObject.disabled= true;
//                            }
                   break;
                   
                   case "GuidesPage":
                        if(roomControlForFlightAndHotel != null)
                            roomControlForFlightAndHotel.style.display = 'none';
                        roomControlForFlight.style.display ='';
                        returnDateChkDiv.style.display = 'none';
                   break;
                   
                   case "SearchResultsPage":
                        if(roomControlForFlightAndHotel != null)
                            roomControlForFlightAndHotel.style.display = 'none';
                        
                       
                  break;
              } // end of switch block
        
        }    
}

function clearDD(objSelect)
  {   
         for (var i = (objSelect.options.length-1); i >= 0; i--)
         {
            objSelect.options[i]=null;
         }
             
    }



    
    function beginDropDownRequestFH(sender, args)
    { 
          
         var prm = Sys.WebForms.PageRequestManager.getInstance();
         fixAjaxBeginRequest(sender,args);
         var elem = args.get_postBackElement();
    
         if(elem.id.indexOf("FltCountryDDL") != -1)
         {
                 var Airport = document.getElementById(FltAirportDDL);
                 clearDD(Airport);
                  if(Airport != null)
                  {
                    // Create an Option object                
                    var opt = document.createElement("option");
                      // Add an Option object to Drop Down/List Box
                      Airport.options.add(opt);        // Assign text and value to Option object
                       opt.text = LoadAirprt;
                       opt.value = 0;
                      Airport.disabled = true;
                      
                  }
             
         }
              
            else  if(elem.id.indexOf("countryDDL") != -1)
              {
                    var DestDDLobj = document.getElementById(DestDDL);
                       clearDD(DestDDLobj);
                    if(DestDDLobj != null)
                    {
                       // Create an Option object                
                        var opt = document.createElement("option");
                          // Add an Option object to Drop Down/List Box
                          DestDDLobj.options.add(opt);        // Assign text and value to Option object
                           opt.text = LoadDest;
                           opt.value = 0;
                          DestDDLobj.disabled = true;
                         
                    }
                }
                    
            else  if(elem.id.indexOf("DestDDL") != -1)
              {
    
                    var ResortDDLobj = document.getElementById(ResortDDL);
                       clearDD(ResortDDLobj);
                    if(ResortDDLobj != null)
                    {
                       // Create an Option object                
                        var opt = document.createElement("option");
                          // Add an Option object to Drop Down/List Box
                          ResortDDLobj.options.add(opt);        // Assign text and value to Option object
                           opt.text = LoadRsrt;
                           opt.value = 0;
                          ResortDDLobj.disabled = true;
                         
                    }
                }
                
                 else  if(elem.id.indexOf("ResortDDL") != -1)
              {
                    var ArrAirDDLObj = document.getElementById(ArrAirportDDL);
                       clearDD(ArrAirDDLObj);
                    if(ArrAirDDLObj != null)
                    {
                       // Create an Option object                
                        var opt = document.createElement("option");
                          // Add an Option object to Drop Down/List Box
                          ArrAirDDLObj.options.add(opt);        // Assign text and value to Option object
                           opt.text = LoadAirprt;
                           opt.value = 0;
                          ArrAirDDLObj.disabled = true;
                         
                    }
                }
                
                  else  if(elem.id.indexOf("DDLHotelCountry") != -1)
              {
                    var DDLHotelDestObj = document.getElementById(DDLHotelDest);
                       clearDD(DDLHotelDestObj);
                    if(DDLHotelDestObj != null)
                    {
                       // Create an Option object                
                        var opt = document.createElement("option");
                          // Add an Option object to Drop Down/List Box
                          DDLHotelDestObj.options.add(opt);        // Assign text and value to Option object
                           opt.text = LoadDest;
                           opt.value = 0;
                          DDLHotelDestObj.disabled = true;
                         
                    }
                }
                
                 else  if(elem.id.indexOf("DDLHotelDest") != -1)
              {
                    var HotelResortObj = document.getElementById(DDLHotelResort);
                       clearDD(HotelResortObj);
                    if(HotelResortObj != null)
                    {
                       // Create an Option object                
                        var opt = document.createElement("option");
                          // Add an Option object to Drop Down/List Box
                          HotelResortObj.options.add(opt);        // Assign text and value to Option object
                           opt.text = LoadRsrt;
                           opt.value = 0;
                          HotelResortObj.disabled = true;
                         
                    }
                }
                
         var status = prm.get_isInAsyncPostBack();
         if(status)
         {
           args.set_cancel(true);
       
         }
    }

 
 

/* end of flighthotelsearchcontrol.js**/

/* mailinglistsignup */

function clickButton(e, buttonid){

      var bt = document.getElementById(buttonid);
      if (typeof bt == 'object'){
            if(navigator.appName.indexOf("Netscape")>(-1)){
                  if (e.keyCode == 13){
                        bt.click();
                        return false;
       }
            }
            if (navigator.appName.indexOf("Microsoft Internet Explorer")>(-1)){
                  if (event.keyCode == 13){
                        bt.click();
                        return false;
       }
     } 
      }
    }
    
function LogOCSale()
{
    logOCSale('isconv=1|iscomp=1|pover=Newsletter Signup|itemcount=1|itemvalue=0|m1=Newsletter SignUp|m2=0');
}

function ViewNewsletterExample( strUrl)
    {
        window.open(strUrl + 'Images/cobrand/NewsletterEx.JPG','','width=550,height=340,scrollbars=1,resizable=1')	
        
    }
    
function ViewPrivatePolicy( strUrl)
    {
        window.open(strUrl + 'webpages/cobrand/0/privacy.aspx','','width=800,height=500,scrollbars=1,resizable=1')	
    }
    
    /* end of mailinglistsignup */ 



/* Offers.js */

//Function for hide/show policy data
    function showMoreOffers()
    {
        if(document.getElementById(hdnItemIDObj).value.length > 0)
            OffersDivIDList = document.getElementById(hdnItemIDObj).value.split(',');
            
        if(document.getElementById(ShowMoreIDObj).innerHTML == showmoreText)
        {
            for(con=0; con < OffersDivIDList.length - 1  ; con++)
            {
                var offerItemDiv = document.getElementById(OffersDivIDList[con]);
                offerItemDiv.style.display = "block";
            }
            document.getElementById(ShowMoreIDObj).innerHTML = hideText;
        }
        else
        {
             for(con=0; con < OffersDivIDList.length - 1  ; con++)
            {
                var offerItemDiv = document.getElementById(OffersDivIDList[con]);
                offerItemDiv.style.display = "none";
            }
            document.getElementById(ShowMoreIDObj).innerHTML = showmoreText;
        }
    }
    
    


    
    /* end of Offers.js */

/* script for sign up link */    
function SignUpredirect()
{
    var emailid = '';
    if(document.getElementById(SignUpInput).value != SignupText)
        emailid = document.getElementById(SignUpInput).value;
        
    window.location.href = hosturl + "webpages/cobrand/0/SignUp.aspx?id=" + emailid;
}

/* end of sign up script */    

  function showHideHotelPanel(pricedivdisplay,ShowHideLinkbtn,ShowHideLinkbtn2)
    {
        var obj = document.getElementById(pricedivdisplay);
        var btn1 = document.getElementById(ShowHideLinkbtn);
        var btn2 = document.getElementById(ShowHideLinkbtn2);
        if(obj != null && obj.style.display == 'none')
        {
            obj.style.display = '';
            btn1.style.display = 'none';    
            btn2.style.display = '';   
        }
        else
        {
            obj.style.display = 'none';
            btn1.style.display = '';    
            btn2.style.display = 'none';       
        }
    }
    
function showEstabLink(pricedivdisplay,ShowHideLinkbtn,ShowHideLinkbtn2)
{
    var showLnk1 = showLnk;
    if( document.getElementById(pricedivdisplay) != null)
    {
    if(showLnk1 == "True")
    {
        document.getElementById(ShowHideLinkbtn2).style.display = 'block';
        document.getElementById(ShowHideLinkbtn).style.display = 'none';
        document.getElementById(pricedivdisplay).style.display = 'block';
    }
    else
    {
          document.getElementById(ShowHideLinkbtn2).style.display = 'none';
        document.getElementById(ShowHideLinkbtn).style.display = 'block';
        document.getElementById(pricedivdisplay).style.display = 'none';
    }
    }
} 
        
//Start Kampyle Exit-Popup Code
var k_push_vars = {
     "display_after": 30,
	"view_percentage": 0,
	"popup_font_color": "#000000",
	"popup_background": "#ffffff",
	"popup_separator": "#D4E2F0",
	"header": "Your feedback is important to us!",
	"question": "Would you be willing to give us a short (1 minute) feedback?",
	"footer": "Thank you for helping us improve our website",
	"remind": "Remind me later",
	"remind_font_color": "#3882C3",	
	"yes": "Yes",
	"no": "No",
	"text_direction": "ltr",
	"images_dir": "http://cf.kampyle.com/",
	"yes_background": "#76AC78",
	"no_background": "#8D9B86",
	"site_code": 3014408
}
//End Kampyle Exit-Popup Code

// destination page js for photos 

function storePhotos(photosJSON)
{

   var photos = photosJSON.photos;
  for (var i = 0; i < photos.length; i++) 
  {
	var aTag = document.createElement('a');
	aTag.href = "javascript:ShowPhoto('" + 'http://mw2.google.com/mw-panoramio/photos/square/' + escape(photos[i].photo_id) + '.jpg' + "','" +   unescape(photos[i].photo_title) + "');"
    if (navigator.appName == 'Microsoft Internet Explorer')
    {           
	var imgTag = document.createElement('<img class=\"thumbsize\">');
	}
	else
	{
	var imgTag = document.createElement('img');
	}
    imgTag.src = 'http://mw2.google.com/mw-panoramio/photos/square/' + escape(photos[i].photo_id) + '.jpg';
    imgTag.setAttribute("alt",unescape(photos[i].photo_title));
    imgTag.setAttribute("title",unescape(photos[i].photo_title));

    imgTag.setAttribute("class","thumbsize");
   
	aTag.appendChild(imgTag);
	document.getElementById(imgDiv).appendChild(aTag);

    if(document.getElementById(giantImg).src == '')
    {
	    document.getElementById(giantImg).src = 'http://mw2.google.com/mw-panoramio/photos/small/' + escape(photos[i].photo_id) + '.jpg';
	    var imTitle = unescape(photos[i].photo_title).toString();
	    document.getElementById(giantImg).alt = imTitle;
	    document.getElementById(giantImg).title = imTitle;
	    if(ieBrowser)
		    document.getElementById(imgTitle).innerText = imTitle;
		else
		    document.getElementById(imgTitle).textContent = imTitle;
    }

  }
  if(photos.length > 0)
  {
    document.getElementById(_photos).style.display = 'block';
    if(photosLnk != null)
        document.getElementById(photosLnk).style.display = 'block';
    }
  else
  {
    document.getElementById(_photos).style.display = 'none';
    document.getElementById(photoTab).style.display = 'none';
  }
}

function ShowPhoto(imgURL, title)
{
    document.getElementById(giantImg).src = imgURL.replace("square","small");
    document.getElementById(giantImg).alt = title;
    document.getElementById(giantImg).title = title;
    if(ieBrowser)
	    document.getElementById(imgTitle).innerText = title;
	else
		document.getElementById(imgTitle).textContent = title;
}


// end of photos script


///* CRITEO Widgets Loader Version 1.1c */
var CRITEO=function(){var f={F:[],C:function(){if(arguments.callee.ag){return;}arguments.callee.ag=true;for(var i=0;i<f.F.length;i++){f.F[i]();}},Q:function(R){this.F[this.F.length]=R;if(document.addEventListener){document.addEventListener("DOMContentLoaded",f.C,null);}if(/KHTML|WebKit/i.test(navigator.userAgent)){var P=setInterval(function(){if(/loaded|complete/.test(document.readyState)){clearInterval(P);delete P;f.C();}},10);}/*@cc_on@if(@_win32)var T="src='javascript:void(0)'";if(location.protocol=="https:")T="src=//0";document.write("<scr"+"ipt id=__cto_ie_onload defer "+T+"><\/scr"+"ipt>");var s=document.getElementById("__cto_ie_onload");s.onreadystatechange=function(){if(this.readyState=="complete"){f.C();}};@end@*/;if(typeof window.onload!='function'){window.onload=f.C;}else{var D=window.onload;window.onload=function(){f.C();if(D){D();}};}}};function A(s){if(document.getElementsByTagName){var h=document.getElementsByTagName('head')[0];if(!h){h=document.createElement('HEAD');document.documentElement.appendChild(h);}if(h&&h.appendChild){h.appendChild(s);}}};function B(){if(typeof(window.encodeURIComponent)==='undefined'){var r={ab:function(H){H=""+H;var t,s,G="",i=0;while(i<H.length){t=H.charCodeAt(i++);if(t>=0xDC00&&t<0xE000){continue;}if(t>=0xD800&&t<0xDC00){if(i>=H.length){continue;}s=H.charCodeAt(i++);if(s<0xDC00||t>=0xDE00){continue;}t=((t-0xD800)<<10)+(s-0xDC00)+0x10000;}if(t<0x80){G+=String.fromCharCode(t);}else if(t<0x800){G+=String.fromCharCode(0xC0+(t>>6),0x80+(t&0x3F));}else if(t<0x10000){G+=String.fromCharCode(0xE0+(t>>12),0x80+(t>>6&0x3F),0x80+(t&0x3F));}else{G+=String.fromCharCode(0xF0+(t>>18),0x80+(t>>12&0x3F),0x80+(t>>6&0x3F),0x80+(t&0x3F));}}return G;},I:"0123456789ABCDEF",V:function(n){return r.I.charAt(n>>4)+r.I.charAt(n&0xF);},K:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-"};window.encodeURIComponent=function(s){s=r.ab(s);var G="";for(var i=0;i<s.length;i++){if(r.K.indexOf(s.charAt(i))== -1){G+="%"+r.V(s.charCodeAt(i));}else{G+=s.charAt(i);}}return G;};}};function L(){if(document.getElementsByTagName){var n=1;var o=[];var l=[];var U,O,M,aa,ae,ac;var a=document.getElementsByTagName('div');for(var i=0;i<a.length;i++){if(a[i].id&&a[i].id.substring(0,3).toLowerCase()=="cto"&&a[i].childNodes){U=O=M=aa=ac=null;ae=2;for(var j=0;j<a[i].childNodes.length;j++){var t=a[i].childNodes[j];if(t&&t.tagName&&t.tagName.toLowerCase()=="div"&&t.className&&t.className.substring(0,3).toLowerCase()=="cto"){var v=(t.textContent?t.textContent:(t.innerText?t.innerText:null));switch(t.className.toLowerCase()){case 'ctowidgetserver':U=v;break;case 'ctodatatype':O=v;break;case 'ctowidgettype':M=v;break;case 'ctoparams':aa=v;break;case 'ctoversion':ae=v;break;case 'ctodata':ac=t.innerHTML;break;}}}if(U&&((!O&&M)||(O&& !M))){var u="v="+ae;if(aa){u+="&"+aa;}u="p"+n+"="+encodeURIComponent(u);if(ac){u+="&d"+n+"="+encodeURIComponent(ac);}if(M){u+="&w"+n+"="+M;}else{u+="&t"+n+"="+O;}var s;for(s=0;s<o.length;s++){if(o[s]==U){break;}}if(s!=o.length&&l[s]&&(l[s].length+u.length)>2000){CRITEO.AddScript(l[s]);l[s]=null;}if(s==o.length|| !l[s]){o[s]=U;l[s]=U+"display.js?";}else{l[s]+="&";}l[s]+=u;n++;}}}for(var k=0;k<l.length;k++){if(l[k]){CRITEO.AddScript(l[k]);}}}};function J(){B();L();};return{Q:function(){if(typeof(CRITEO_Loaded)!="undefined"){return;}CRITEO_Loaded=1;f.Q(function(){J();});},AddStyle:function(ad){if(document.createElement){var s=document.createElement('style');if(s){s.setAttribute('type','text/css');A(s);if(s.styleSheet){try{s.styleSheet.cssText=ad;}catch(e){}}else{var t=document.createTextNode(ad);s.appendChild(t);}}}},AddScript:function(u){if(document.createElement){var s=document.createElement('script');if(s){s.type='text/javascript';s.src=u;A(s);}}},AddImage:function(a,u){if(document.createElement){var af=document.createElement('IMG');if(af){if(a){var d=document.getElementById(a);if(d===null){d=document.createElement('DIV');d.id=a;d.style.display="none";document.body.appendChild(d);}if(d!==null&&d.appendChild){d.appendChild(af);}}af.src=u;}}},NewGuid:function(m){var g="";for(var i=0;i<m;i++){g+=Math.floor(Math.random()*0xF).toString(0xF);}return g+"";}};}();var CRITEO_Loaded;CRITEO.Q();
// end of photos script

// Search-Offers js

function showMoreInfoLink()
{
 
    var hoteldes = document.getElementById(hoteldesc);
    var hotelfulldes = document.getElementById(hotelFullDesc);
    var showlnk = document.getElementById(showMoreInfolnk);
    if(hotelfulldes.innerHTML == '' )
    {
        showlnk.style.display = "none";
    }
    else
    {
        showlnk.style.display = "";
    }
}

function ShowHotelDesc(IsShow)
{
    
    var showlnk = document.getElementById(showMoreInfolnk);
    var hidelnk = document.getElementById(hideMoreInfolnk);
    var hoteldes = document.getElementById(hoteldesc);
    var hotelfulldes = document.getElementById(hotelFullDesc);
   
    if(IsShow == true)
    {
        hoteldes.style.display = "none";
        hotelfulldes.style.display = "";
        showlnk.style.display = "none";
        hidelnk.style.display = "";
    }
    else
    {
        hoteldes.style.display = "";
        hotelfulldes.style.display = "none";
        showlnk.style.display = "";
        hidelnk.style.display = "none";
    }
    
    return false;
}
