

function checkVer(){
	this.ver=navigator.appVersion
	this.dom=document.getElementById?1:0
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
	this.ie4=(document.all && !this.dom)?1:0;
	this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;
	this.ns4=(document.layers && !this.dom)?1:0;
	this.isie=(this.ie5 || this.ie4)?1:0;
	this.isns=(this.ns5 || this.ns4)?1:0;
	this.ie=(document.all)?1:0;
	this.ns=(document.layers)?1:0;
	this.ns6=(document.getElementById)?1:0;
	return this
}
bv=new checkVer();

featureFocus=0;
menuSlideAcc=0;
menuSlideX=0;
featureSlideX=0;
slideInFlag=0;
menuX=0;

function init()
{
centerIt();
preloadImages();
<!-- scrollLoop(); -->
}

<!-- centerIt group-->

function centerIt()
{
	if (bv.ie||((bv.ns||bv.ns6)&&(winH<500)))
	{
	if (bv.ie) winW = winW - 18;
	if (bv.ns||bv.ns) winW = winW - 15;
	}
	x_offset = (winW/2)-(760/2);
	y_offset = 50;
	if (y_offset<50) y_offset=50;
	if (x_offset<0) x_offset=0;
	moveTo('divBase',x_offset,y_offset,'');	
	toggleLayer('divBase','show','');
}



function moveTo(target,x,y,nest)
{
		if (bv.ie)
			{
			document.all[target].style.left=x+"px";
			document.all[target].style.top=y+"px";
			}
		if (bv.ns)
			{
			(nest=='')?document.eval(target).left=x:eval(nest).eval(target).left=x;
			(nest=='')?document.eval(target).top=y:eval(nest).eval(target).top=y;
			}
		if (bv.ns6)
			{
			document.getElementById(target).style.left=x+"px";
			document.getElementById(target).style.top=y+"px";
			}
}



function toggleLayer(target,value,nest)
{
		if (bv.ie)
			{
			if (value=="show") value="visible";
			if (value=="hide") value="hidden";
			document.all[target].style.visibility=value;
			}
		if (bv.ns)
			{			
			(nest=='')?document.eval(target).visibility=value:eval(nest).eval(target).visibility=value;
			}
		if (bv.ns6)
			{
			if (value=="show") value="visible";
			if (value=="hide") value="hidden";
			document.getElementById(target).style.visibility=value;
			}
}

<!-- end centeIt group -->


var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		tab_over = newImage("images/icn_tab_red.gif");
		pint_over = newImage("images/icn_pint_gold.gif");
		highlight_over = newImage("images/tab_highlight_red.gif");
		arrowright_anim = newImage("images/icn_tan_arrow_right.gif.gif");
		arrowleft_anim = newImage("images/icn_tan_arrow_left.gif.gif");
		btnScrollUp_over = newImage("images/btn_scroll_upo.gif");
		btnScrollDown_over = newImage("images/btn_scroll_downo.gif");
		btnEvents_over_up = newImage("images/btn_scroll_for_more_eventsod.gif");
		btnEvents_over_down = newImage("images/btn_scroll_for_more_eventsod.gif");		
		preloadFlag = true;
	}
}


<!-- scroll Loop group -->

function scrollLoop()
{
	
	if(!scrollingPaused)
	{
		backwards=false;
		if (featureFocus==0)
		{

			normalSpeed = -1;
			slideSpeed = normalSpeed*speedMultiplier;
			featureSlideX=featureSlideX+slideSpeed; //this is what dictates the movement
		
			if(slideSpeed>0)
				backwards=true;
			else
				backwards=false;
		
			
		}else
		{
			distance = (featureSlideX -(507-featureFocus*singleFeatureWidth));
			featureSlideX = (featureSlideX - distance/16);
		}
		if(backwards)
		{
			
			if(Math.round(featureSlideX)>=0) 
				featureSlideX = -((singleFeatureWidth*totalFeatureCount));
		}else
		{
			if(Math.round(featureSlideX)<-((singleFeatureWidth*totalFeatureCount))) 
				featureSlideX = featureSlideX+(singleFeatureWidth*totalFeatureCount);
		}

		if (bv.ie)
		{
			document.all.divFeatures.style.left=Math.round(featureSlideX)+"px";
		}
		else if (bv.ns)
		{
			document.divBase.document.divFeatureMask.document.eval('divFeatures').left=Math.round(featureSlideX);
		}
		else if (bv.ns6)
		{
			document.getElementById('divFeatures').style.left=Math.round(featureSlideX)+"px";
		}
		
		
		//try to highlight center div
		centerX=Math.round(viewportWidth/2);
		centerFeatures=centerX-featureSlideX;

		centerIndex = Math.round(centerFeatures/singleFeatureWidth);
		setSelectedHotel(centerIndex);
		//reset the pic for previous one

		
	}

scrollTimer=setTimeout('scrollLoop()',50);
}


function changeImage(layer,imgName,imgSrc) {
	if (document.images && (preloadFlag == true)) {
		if (document.layers && layer!=null) eval('document.'+layer+'.document.images["'+imgName+'"].src = "'+imgSrc+'"')
		else document.images[imgName].src = imgSrc
	}
}



function handleMenuScroll()
{
	menuSlideX=menuSlideX+menuSlideAcc;
		getMenuWidth();
			
		if (menuSlideX>0) 
		{
		menuSlideX = menuSlideX - halfwit;
		}
		else if (menuSlideX<-halfwit) 
		{
		menuSlideX = menuSlideX + halfwit;
		}
	
	if (bv.ie)
		{
		document.all.divMenu.style.left=menuSlideX+"px";
		}
	else if (bv.ns)
		{
		document.divBase.document.divMenuMask.document.eval('divMenu').left=menuSlideX;
		}
	else if (bv.ns6)
		{
		document.getElementById('divMenu').style.left=menuSlideX+"px";
		}


}


function getMenuWidth()
{
		if (bv.ie)
			{
			halfwit=document.all.divMenu.clientWidth/2
			
			}
		if (bv.ns)
			{
			halfwit=document.divBase.document.divMenuMask.document.divMenu.clip.width/2
			}
		if (bv.ns6)
			{
			halfwit=document.all.divMenu.clientWidth/2
			}
}



<!-- end scrollLoop group -->

function resetSlide()
{
if (slideInFlag==1)
{
slideInFlag=0;
menuSlideX=menuX;
}
}


function scrollToFeature(id)
{
buffer=featureFocus;
changeImage('divBase.document.divFeatureMask.document.divFeatures.document.divFeature'+buffer,'highlight'+buffer,'../images/tab_highlight_grey.gif');
featureFocus=id;
}


function setScroll(speed)
{
menuSlideAcc=speed;
}

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function validateCorporateSignup()
{


	if(corporateSignup.txtFirstName.value==null || corporateSignup.txtFirstName.value=="")
	{
		alert("Enter a First name");
		return false;
	}

	if(corporateSignup.txtLastName.value==null || corporateSignup.txtLastName.value=="")
	{
		alert("Enter a Last name");
		return false;
	}

	if(corporateSignup.txtCompany.value==null || corporateSignup.txtCompany.value=="")
	{
		alert("Enter a Company name");
		return false;
	}

	if(corporateSignup.txtAddress1.value==null || corporateSignup.txtAddress1.value=="")
	{
		alert("Enter a Complete address");
		return false;
	}

	if(corporateSignup.txtAddress2.value==null || corporateSignup.txtAddress2.value=="")
	{
		alert("Enter a Complete address");
		return false;
	}

	if(corporateSignup.txtAddress3.value==null || corporateSignup.txtAddress3.value=="")
	{
		alert("Enter a Complete address");
		return false;
	}

	if(corporateSignup.txtEmail.value==null || corporateSignup.txtEmail.value=="")
	{
		alert("Enter an Email address");
		return false;
	}

	if(corporateSignup.txtPhone.value==null || corporateSignup.txtPhone.value=="")
	{
		alert("Enter a Phone number");
		return false;
	}

	if(corporateSignup.sltCountry.value==null || corporateSignup.sltCountry.value==0)
	{
		alert("Select a country");
		return false;
	}


	return emailCheck(corporateSignup.txtEmail.value);



	alert("wooHoo");
	return false;
}




function emailCheck (emailStr) {

/* The following variable tells the rest of the function whether or not
to verify that the address ends in a two-letter country or well-known
TLD.  1 means check it, 0 means don't. */

var checkTLD=1;

/* The following is the list of known TLDs that an e-mail address must end with. */

var knownDomsPat=/^(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum)$/;

/* The following pattern is used to check if the entered e-mail address
fits the user@domain format.  It also is used to separate the username
from the domain. */

var emailPat=/^(.+)@(.+)$/;

/* The following string represents the pattern for matching all special
characters.  We don't want to allow special characters in the address. 
These characters include ( ) < > @ , ; : \ " . [ ] */

var specialChars="\\(\\)><@,;:\\\\\\\"\\.\\[\\]";

/* The following string represents the range of characters allowed in a 
username or domainname.  It really states which chars aren't allowed.*/

var validChars="\[^\\s" + specialChars + "\]";

/* The following pattern applies if the "user" is a quoted string (in
which case, there are no rules about which characters are allowed
and which aren't; anything goes).  E.g. "jiminy cricket"@disney.com
is a legal e-mail address. */

var quotedUser="(\"[^\"]*\")";

/* The following pattern applies for domains that are IP addresses,
rather than symbolic names.  E.g. joe@[123.124.233.4] is a legal
e-mail address. NOTE: The square brackets are required. */

var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/;

/* The following string represents an atom (basically a series of non-special characters.) */

var atom=validChars + '+';

/* The following string represents one word in the typical username.
For example, in john.doe@somewhere.com, john and doe are words.
Basically, a word is either an atom or quoted string. */

var word="(" + atom + "|" + quotedUser + ")";

// The following pattern describes the structure of the user

var userPat=new RegExp("^" + word + "(\\." + word + ")*$");

/* The following pattern describes the structure of a normal symbolic
domain, as opposed to ipDomainPat, shown above. */

var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$");

/* Finally, let's start trying to figure out if the supplied address is valid. */

/* Begin with the coarse pattern to simply break up user@domain into
different pieces that are easy to analyze. */

var matchArray=emailStr.match(emailPat);

if (matchArray==null) {

/* Too many/few @'s or something; basically, this address doesn't
even fit the general mould of a valid e-mail address. */

alert("Email address seems incorrect (check @ and .'s)");
return false;
}
var user=matchArray[1];
var domain=matchArray[2];

// Start by checking that only basic ASCII characters are in the strings (0-127).

for (i=0; i<user.length; i++) {
if (user.charCodeAt(i)>127) {
alert("Ths username contains invalid characters.");
return false;
   }
}
for (i=0; i<domain.length; i++) {
if (domain.charCodeAt(i)>127) {
alert("Ths domain name contains invalid characters.");
return false;
   }
}

// See if "user" is valid 

if (user.match(userPat)==null) {

// user is not valid

alert("The username doesn't seem to be valid.");
return false;
}

/* if the e-mail address is at an IP address (as opposed to a symbolic
host name) make sure the IP address is valid. */

var IPArray=domain.match(ipDomainPat);
if (IPArray!=null) {

// this is an IP address

for (var i=1;i<=4;i++) {
if (IPArray[i]>255) {
alert("Destination IP address is invalid!");
return false;
   }
}
return true;
}

// Domain is symbolic name.  Check if it's valid.
 
var atomPat=new RegExp("^" + atom + "$");
var domArr=domain.split(".");
var len=domArr.length;
for (i=0;i<len;i++) {
if (domArr[i].search(atomPat)==-1) {
alert("The domain name does not seem to be valid.");
return false;
   }
}

/* domain name seems valid, but now make sure that it ends in a
known top-level domain (like com, edu, gov) or a two-letter word,
representing country (uk, nl), and that there's a hostname preceding 
the domain or country. */

if (checkTLD && domArr[domArr.length-1].length!=2 && 
domArr[domArr.length-1].search(knownDomsPat)==-1) {
alert("The address must end in a well-known domain or two letter " + "country.");
return false;
}

// Make sure there's a host name preceding the domain.

if (len<2) {
alert("This address is missing a hostname!");
return false;
}

// If we've gotten this far, everything's valid!
return true;
}




//cookie handling functions
/*
   name - name of the cookie
   value - value of the cookie
   [expires] - expiration date of the cookie
     (defaults to end of current session)
   [path] - path for which the cookie is valid
     (defaults to path of calling document)
   [domain] - domain for which the cookie is valid
     (defaults to domain of calling document)
   * an argument defaults when it is assigned null as a placeholder
   * a null placeholder is not required for trailing omitted arguments
*/

function setCookie(name, value) 
{
  var curCookie = name + "=" + escape(value);

  document.cookie = curCookie;
}


/*
  name - name of the desired cookie
  return string containing value of specified cookie or null
  if cookie does not exist
*/

function getCookie(name) 
{
  var dc = document.cookie;
  var prefix = name + "=";
  var begin = dc.indexOf("; " + prefix);
  if (begin == -1) 
  {
    begin = dc.indexOf(prefix);
    if (begin != 0) return null;
  } else
    begin += 2;
  var end = document.cookie.indexOf(";", begin);
  if (end == -1)
    end = dc.length;
  return unescape(dc.substring(begin + prefix.length, end));
}


/*
   name - name of the cookie
   [path] - path of the cookie (must be same as path used to create cookie)
   [domain] - domain of the cookie (must be same as domain used to
     create cookie)
   path and domain default if assigned null or omitted if no explicit
     argument proceeds
*/

function deleteCookie(name) 
{
  if (getCookie(name)) 
  {
    document.cookie = name + "=" +
    "; expires=Thu, 01-Jan-70 00:00:01 GMT";
  }
}

// date - any instance of the Date object
// * hand all instances of the Date object to this function for "repairs"

function fixDate(date) 
{
  var base = new Date(0);
  var skew = base.getTime();
  if (skew > 0)
    date.setTime(date.getTime() - skew);
}

