
 // Browser Supports JavaScript 
  var browserOK = false;
  var pics;
//

 // Broser Supports JavaScript 1.1 
  browserOK = true;
  pics = new Array();
// 


// number of (changing) images on web-page
var objCount = 0; 

function preload(name, first, second) {  

  // PRELOAD IMAGES

  if (browserOK) {     
    pics[objCount] = new Array(25);
    pics[objCount][0] = new Image();
    pics[objCount][0].src = first;
    pics[objCount][1] = new Image();
    pics[objCount][1].src = second;
    pics[objCount][2] = name;
    objCount++;
  }
}

function on(name){
  if (browserOK) {
     for (i = 0; i < objCount; i++) {
      if (document.images[pics[i][2]] != null)
        if (name != pics[i][2]) { 
          document.images[pics[i][2]].src = pics[i][0].src;
        } else {
           document.images[pics[i][2]].src = pics[i][1].src;
        }
    }
  }
}

function off(){
  if (browserOK) {
     for (i = 0; i < objCount; i++) {
      if (document.images[pics[i][2]] != null) 
        document.images[pics[i][2]].src = pics[i][0].src;
    }
  }
}
preload("HOMEIMG","http://www.waylandtravel.com/images/header/home.gif" , "http://www.waylandtravel.com/images/header/home2.gif");
preload("CRUISESIMG","http://www.waylandtravel.com/images/header/cruises.gif" , "http://www.waylandtravel.com/images/header/cruises2.gif");
preload("SPECIALSIMG","http://www.waylandtravel.com/images/header/specials.gif" , "http://www.waylandtravel.com/images/header/specials2.gif");
preload("LANDIMG","http://www.waylandtravel.com/images/header/vacations.gif" , "http://www.waylandtravel.com/images/header/vacations2.gif");
preload("ABOUTIMG","http://www.waylandtravel.com/images/header/about.gif" , "http://www.waylandtravel.com/images/header/about2.gif");
preload("RECIMG","http://www.waylandtravel.com/images/header/tools.gif" , "http://www.waylandtravel.com/images/header/tools2.gif");
preload("CONTACTIMG","http://www.waylandtravel.com/images/header/contact.gif" , "http://www.waylandtravel.com/images/header/contact2.gif");


// 


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_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 CALLAHAH(url, pageElement, callMessage) 
{
document.getElementById(pageElement).innerHTML = (
'<table style="border-collapse:collapse; width: 100%; height: 100%;"><tr><td style="text-align: center; vertical-align: middle;">' +
'<img src="http://www.waylandtravel.com/images/global/loading.gif" />' + 
'</td></tr></table>'
); 


try { req = new XMLHttpRequest(); /* e.g Firefox*/ } catch(e) 
	{
	try	
		{ req = new ActiveXObject("Msxml2.XMLHTTP");  /* Some Versions IE */ } catch (e) 
		{
			try 
			{ req = new ActiveXObject("Microsoft.XMLHTTP"); /* Some Versions IE */ } catch (E) 
	  		{ req = falce; }
		}
	}

	req.onreadystatechange = function() {responseAHAH(pageElement);};
	req.open("GET",url,true);
	req.send(null);
}

function responseAHAH(pageElement) 
		{
	var output = '';
		if(req.readyState == 4) 
			{
			if(req.status == 200) 
				{
				output = req.responseText;
				document.getElementById(pageElement).innerHTML = output;
				}
			}
		}







function CALLSEARCH()
{
	document.getElementById('xssearch').style.display='block';
	document.getElementById('xssearchbg').style.display='block';
}

function CLOSESEARCH()
{	
	document.getElementById('xssearch').style.display='none';
	document.getElementById('xssearchbg').style.display='none';
}

function CALLPOPUP()
{
	document.getElementById('xspopup').style.display='block';
	document.getElementById('xspopupbg').style.display='block';
}

function CLOSEPOPUP()
{	
	document.getElementById('xspopup').style.display='none';
	document.getElementById('xspopupbg').style.display='none';
}















var newwindow;
function OPENWIN(url, name, width, height)
{
newwindow=window.open(url, name, 'width=' + width + ',height=' + height + ', scrollbars=yes, top=15, left=15');
if (window.focus) {newwindow.focus()}
}


function isEmailAddr(email)
{
  var result = false
  var theStr = new String(email)
  var index = theStr.indexOf("@");
  if (index > 0)
  {
    var pindex = theStr.indexOf(".",index);
    if ((pindex > index+1) && (theStr.length > pindex+1))
	result = true;
  }
  return result;
}

function CRUISESEARCH(theForm)
{
  if (theForm.yy.value == "")
  	{alert("Please select a year.");
    theForm.yy.focus();
    return (false);}
  return (true);
}

function VACATIONSEARCH(theForm)
{
  if (theForm.yy.value == "")
  	{alert("Please select a year.");
    theForm.yy.focus();
    return (false);}
  return (true);
}


function OFFERSEARCH(theForm)
{
  if (theForm.OfferID.value == "")
  {alert("Please the offer ID number before submitting.");
    theForm.OfferID.focus();
    return (false);}
  return (true);
}

