function check_dates(bam,bad,bay,bdm,bdd,bdy)
{ var currentTime = new Date();
  var month = currentTime.getMonth() + 1;
  if(month<10)
  { month="0"+month;
  }


  if(bad<10)
  { bad="0"+bad;
  }
      if(bdd<10)
  { bdd="0"+bdd;
  }

  var day = currentTime.getDate();
  var year = currentTime.getFullYear();
  
  if(bay.value<year)
  { alert("Arrival date must be after today");
  	return false;
  }
  if(bay.value==year && bam.value<month)
  { alert("Arrival date must be after today");
    return false;
  }
  if(bay.value==year && bam.value==month && bad.value<day)
  { alert("Arrival date must be after today");
    return false;
  }
  if(bdy.value<year)
  { alert("Departure date must be after today");
  	return false;
  }
  if(bdy.value==year && bam.value<month)
  { alert("Departure date must be after today");
    return false;
  }
  if(bdy.value==year && bam.value==month && bad.value<day)
  { alert("Departure date must be after today");
    return false;
  }
  if(bdy.value<bay.value)
  { alert("Departure date must be after Arrival date");
  	return false;
  }
  if(bdy.value==bay.value && bdm.value<bam.value)
  { alert("Departure date must be after Arrival date");
    return false;
  }
  if(bdy.value==bay.value && bdm.value==bam.value && bdd<bad)
  { alert("Departure date must be after Arrival date");
    return false;
  }
  
  return true;
	
}

function checkPropertyValue(obj)
{
	var propValue = obj.options[obj.selectedIndex].name;
	if (propValue == "Calgary" || "Edmonton Airport" || "Kananaskis" || "West Edmonton" || "Harrison Hot Springs" || "Kamloops" || "Whistler" || "Burnaby" || "Coquitlam" || "Richmond Airport Plaza" || "Richmond Express" || "Vancouver Downtown" || "San Francisco - Nob Hill" || "San Francisco - Union Square" || "Seattle Downtown")
	{
		return false;
	}
}
function GoToUrl(obj,noa,noc,bam,bad,bay,bdm,bdd,bdy,promocode)
{	
	var d = obj.options[obj.selectedIndex].value;
	//var arrivalString = arrivalDate.split("-");
	//var departureString = departureDate.split("-");
	if(d == "exit") {
		return false;
	}
	if (d != null || d != "")
	{
	d += "&arrive="+bam.options[bam.selectedIndex].value+"/"+bad.options[bad.selectedIndex].value+"/"+bay.options[bay.selectedIndex].value+"&depart="+bdm.options[bdm.selectedIndex].value+"/"+bdd.options[bdd.selectedIndex].value+"/"+bdy.options[bdy.selectedIndex].value+"&Adult="+noa.options[noa.selectedIndex].value+"&Child="+noc.options[noc.selectedIndex].value+"&promo="+promocode.value;
	//d += "&noa="+noa.options[noa.selectedIndex].value+"&noc="+noc.options[noc.selectedIndex].value+"&bam="+arrivalString[0]+"&bad="+arrivalString[1]+"&bay="+arrivalString[2]+"&bdm="+departureString[0]+"&bdd="+departureString[1]+"&bdy="+departureString[2];
		if (d != "")
		{	//window.top.location.href = d;
			if(check_dates(bam,bad,bay,bdm,bdd,bdy) == true)
			{ window.top.location.href = d;
			}
		}
		return false;
	}
	else {
		return true;
	}
}

window.name = 'main'
<!-- Begin
// Set slideShowSpeed (milliseconds)
var slideShowSpeed = 9000;
// Duration of crossfade (seconds)
//var crossFadeDuration = 0;
// Specify the image files
var Pic = new Array();
// to add more images, just continue
// the pattern, adding to the array below

Pic[0] = 'main.jpg'
Pic[1] = 'main02.jpg'
Pic[2] = 'main03.jpg'
Pic[3] = 'main04.jpg'

// do not edit anything below this line
var t;
var j = 0;
var p = Pic.length;
var preLoad = new Array();
for (i = 0; i < p; i++) {
	preLoad[i] = new Image();
	preLoad[i].src = Pic[i];
}
function runSlideShow() {
if (document.all) {
document.images.SlideShow.style.filter="blendTrans(duration=2)";
document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)";
document.images.SlideShow.filters.blendTrans.Apply();
}

//document.images.SlideShow.src = preLoad[j].src;

if (document.all) {
document.images.SlideShow.filters.blendTrans.Play();
}
j = j + 1;
if (j > (p - 1)) j = 0;
t = setTimeout('runSlideShow()', slideShowSpeed);
}
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_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_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 resizer(x, y) {window.resizeTo(x, y)}

//-->                                                                                                                                                                                                                                                                                      //800,570

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
// next script

if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) <= 3))
        {
        //IE 3
        alter = 15;
        }else
        {
        // All others 15pix less than ie 3
        alter = 0;
        }

function openslide1() {
window.open ("home/packages_pop.shtml", "packages", "statusbar=no,location=no,name=services,directories=no,resizable=no,scrollbars=yes,menubar=no,toolbar=no,height=" + (500 - alter) + ",width=420");
}
// next script

var bookmarkurl="http://www.executivehotels.net"
var bookmarktitle="Executive Hotels & Resorts"

function addbookmark(){
if (document.all)
window.external.AddFavorite(bookmarkurl,bookmarktitle)
}

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;
}
