﻿function GetJumpDestination()
	{
	    window.location='/pages/specials/deals/Default.aspx?CityCode='+document.forms[0]["ctl00_ddlTopDestinations"].value;
	}
	
	function GetAnchor()
	{	
		this.location.href = "#" + document.forms[0]["ctl00_ddlTopDestinations"].value;	
	}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

    
//START OLD CODE
function changeImagesArray(array) {
	if (preloadFlag == true) {
		var d = document; var img;
		for (var i=0; i<array.length; i+=2) {
			img = null; var n = array[i];
			if (d.images) {img = d.images[n];}
			if (!img && d.getElementById) {img = d.getElementById(n);}
			if (img) {img.src = array[i+1];}
		}
	}
}
function changeImages() {
	changeImagesArray(changeImages.arguments);
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		pre_nav_home_over = newImage('/media/homepage/nav_home_over.gif');
		pre_nav_holidays_over = newImage('/media/homepage/nav_holidays_over.gif');
		pre_nav_specials_over = newImage('/media/homepage/nav_specials_over.gif');
		pre_nav_hotels_over = newImage('/media/homepage/nav_hotels_over.gif');
		pre_nav_flights_over = newImage('/media/homepage/nav_flights_over.gif');
		pre_nav_build_over = newImage('/media/homepage/nav_build_over.gif');
		pre_nav_car_over = newImage('/media/homepage/nav_car_over.gif');
		pre_nav_guides_over = newImage('/media/homepage/nav_guides_over.gif');
		pre_holiday_hotline_over = newImage('/media/homepage/holiday_hotline_over.gif');
		preloadFlag = true;
	}
}
//END OLD CODE

//Opens a window with the requsite attributes


CSAg = window.navigator.userAgent; CSBVers = parseInt(CSAg.charAt(CSAg.indexOf("/")+1),10);
CSIsW3CDOM = ((document.getElementById) && !(IsIE()&&CSBVers<6)) ? true : false;
function IsIE() { return CSAg.indexOf("MSIE") > 0;}
function CSIEStyl(s) { return document.all.tags("div")[s].style; }
function CSNSStyl(s) { if (CSIsW3CDOM) return document.getElementById(s).style; else return CSFindElement(s,0);  }

function OpenWindow(url, name, width, height, scroll)
{
	var winl = (screen.width - width) / 2;
	var wint = (screen.height - height) / 2;
	if (scroll != 'no')
	{
		scroll='yes';
	}
	var winprops = 'height='+height+',width='+width+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable=yes';
	window.open(url, name, winprops);
}

//Unmunge's the faux results page URL and load it
function UnmungeUrl(url)
{
	var colonIndex = url.indexOf(':');

	//Replace colons with ampersands in the faux URL
	while(colonIndex > -1)
	{
		url = url.replace(':','&');
		colonIndex = url.indexOf(':', colonIndex + '&'.length + 1);
	}	
	
	return url;
}

//Replace the current page with the page at the given URL
function LoadPage(url)
{
	window.location.replace(UnmungeUrl(url));
}

//Handles the enter key being pressed by delegating the click to the given button
function EnterHandler(delegateButton)
{
	//Only process the 'Enter' key
	if (event.keyCode == 13)
	{
		//Cancel the default submit
		event.returnValue = false;
		event.cancel = true;
		
		//'Click' the specified button
		delegateButton.click();
	}
}
//START BOOKING REQUEST FORM FUNCTIONS
function resetForm(){
    document.brochureForm.reset;
    }
function submitForm(){
 document.brochureForm.value('Submit Form');
 }
 
function formButtonFever(formName,action){
 var myString = "document."+formName+"."+action+"();";
 eval(myString);
 }
 
function MM_findObj(n, d) { //v4.0
  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 && document.getElementById) x=document.getElementById(n); return x;
}
 
function MM_setTextOfTextfield(objName,x,newText) { //v3.0
  var obj = MM_findObj(objName); if (obj) obj.value = newText;
}
 
function MM_displayStatusMsg(msgStr) { //v1.0
  status=msgStr;
  document.MM_returnValue = true;
}
<!--
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_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];}
}
//END BOOKING REQUEST FORM FUNCTIONS


