// JavaScript Document

function launchViewer()
{

var w = screen.width;
var winwidth;
var winurl;

if (w >= 1000)
	{
		winwidth=920
		winurl = 'http://delivery.vrxstudios.com/destinations/vrxfullviewer.asp?ident=AA3416-510';
	}
else
	{
		winwidth=546
		winurl = 'http://delivery.vrxstudios.com/destinations/vrxmap.asp?ident=AA3416-510';
	}


var win = window.open(winurl,'vrxmap','width=' + winwidth + ',height=540,top=5,left=5,scrollbars=no,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no');
win.focus();
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
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 MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_showHideLayers() //Works with display:block/none
{
	var i,
		p,
		v,
		obj,
		args = MM_showHideLayers.arguments;
	for (i = 0; i < (args.length - 2); i += 3) if ((obj = MM_findObj(args[i])) != null)
	{
		v = args[i + 2];
		if (obj.style)
		{
			obj = obj.style;
			v = (v == 'show') ? 'block' : (v == 'hide') ? 'none' : v;
		}
		obj.display = v;
	}
}

//Expedia Booking Scripts
function PopUpDest(what)//PopUp destination list
{
	window.open(what,'destinations','toolbar=no,location=no,directories=no,status=no,menubar=no, scrollbars=yes,resizable=no,width=600,height=400,top=20,left=20');
}


function ValidateAirport()
{
	 if((document.frmAirport.city.value=="")||(document.frmAirport.city.value==null))
	 {
	 	return false;
	 }
	else
	{
		document.frmAirport.submit();
	}
}

function ValidateDestination()
{
	if ((document.frmDestination.id.value=="")||(document.frmDestination.id.value==null))
	{
		return false;
	}
	else
	{
		document.frmDestination.submit();
	}
}

function ValidateResort()
{
	if ((document.frmResort.id.value=="")||(document.frmResort.id.value==null))
	{
		return false;
	}
	else
	{
		document.frmResort.submit();
	}
}

function ValidateJumpTo()
{
	if ((document.frmJumpTo.id.value=="")||(document.frmJumpTo.id.value==null))
	{
		return false;
	}
	else
	{
		document.frmJumpTo.submit();
	}
}

function ValidateAPL()
{
	if ((document.frmAPLPackages.Gateway.value=="")||(document.frmAPLPackages.Gateway.value==null)||(document.frmAPLPackages.Destination.value=="")||(document.frmCCPackages.Destination.value==null))
	{
		alert('Please select a departure city and a destination');
		return false;
	}
	else
	{
		document.frmAPLPackages.submit();
	}
}


function SetCalendarParameters()
{
	SetCarCalendarParameters();
	SetFlightCalendarParameters();
	SetPackageCalendarParameters();
	SetHotelCalendarParameters();
	SetActivitiesCalendarParameters();
}

function SelectLabel(n)
{
	for(var i=4;i<=9;i++)
	{
		document.getElementById('label' + i).style.fontWeight = 'normal';
	}
	document.getElementById('label' + n).style.fontWeight = 'bold';
}

function SelectPackages()
{
	document.getElementById('label4').style.fontWeight = 'bold';
	document.getElementById('packages').checked = true;
	document.PackageSrch.PackageType.value = 2;
	MM_showHideLayers('sc1','','show','sc4','','hide','sc5','','hide','sc6','','hide','sc7','','hide','sc8','','hide');
}

function Packages1()
{
SelectLabel(4);
MM_showHideLayers('sc1','','show','sc4','','hide','sc5','','hide','sc6','','hide','sc7','','hide','sc8','','hide');
document.PackageSrch.PackageType.value = 2;
}

/*function Packages2()
{
SelectLabel(2);
MM_showHideLayers('sc1','','show','sc4','','hide','sc5','','hide','sc6','','hide','sc8','','hide');
document.PackageSrch.PackageType.value = 5;
}

function Packages3()
{
SelectLabel(3);
MM_showHideLayers('sc1','','show','sc4','','hide','sc5','','hide','sc6','','hide','sc8','','hide');
document.PackageSrch.PackageType.value = 1;
}

function Packages4()
{
SelectLabel(4);
MM_showHideLayers('sc1','','show','sc4','','hide','sc5','','hide','sc6','','hide','sc8','','hide');
document.PackageSrch.PackageType.value = 3;
}*/

function Hotels()
{
SelectLabel(5);
MM_showHideLayers('sc1','','hide','sc4','','show','sc5','','hide','sc6','','hide','sc7','','hide','sc8','','hide');
}

function Flights()
{
SelectLabel(6);
MM_showHideLayers('sc1','','hide','sc4','','hide','sc5','','show','sc6','','hide','sc7','','hide','sc8','','hide');
}
function Cars()
{
SelectLabel(7);
MM_showHideLayers('sc1','','hide','sc4','','hide','sc5','','hide','sc6','','show','sc7','','hide','sc8','','hide');
}
function Cruises()
{
SelectLabel(8);
MM_showHideLayers('sc1','','hide','sc4','','hide','sc5','','hide','sc6','','hide','sc7','','show', 'sc8','','hide');
}

function Activities()
{
SelectLabel(9);
MM_showHideLayers('sc1','','hide','sc4','','hide','sc5','','hide','sc6','','hide','sc7','','hide','sc8','','show');
}
