// JavaScript Document
// JavaScript Document
// -----------------------------------------------------------------------------
// Globals
// Major version of Flash required
var requiredMajorVersion = 7;
// Minor version of Flash required
var requiredMinorVersion = 0;
// Revision of Flash required
var requiredRevision = 0;
// the version of javascript supported
var jsVersion = 1.0;
// -----------------------------------------------------------------------------





// JavaScript Document
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];}
}


//popup
function popUp(strURL,strType,strHeight,strWidth) {
var strOptions="";
if (strType=="console") strOptions="resizable,height="+strHeight+",width="+strWidth;
if (strType=="fixed") strOptions="status,height="+strHeight+",width="+strWidth;
if (strType=="elastic") strOptions="toolbar,menubar,scrollbars,resizable,location,height="+strHeight+",width="+strWidth;
window.open(strURL, 'newWin', strOptions);
}


///


function popup1() {
window.open('clients.php','','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=auto,resizable=no,width=340,height=300,left=200,top=100');
}


// resize window
top.window.moveTo (0,0);
var w = screen.availWidth;
var h = screen.availHeight;

if (document.all) {
top.window.resizeTo(w,h);
}
else if (document.layers||document.getElementById) {
if (top.window.outerHeight < h || top.window.outerWidth <w ){
top.window.outerHeight = h;
top.window.outerWidth = w;
}
}

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


// swap html
function changeText1(newText){
document.getElementById("choice").innerHTML="<table width='75%' border='0' cellspacing='0' cellpadding='0' align='center'><tr><td><a href=\"javascript:changeText2('')\"><strong>How We Collect and Use Information</strong></a></td><td><a href=\"javascript:changeText3('')\"><strong>Third Party Disclosures</strong></a></td></tr><tr><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><a href=\"javascript:changeText4('')\"><strong>How We Store Your Information</strong></a></td><td><a href=\"javascript:changeText5('')\"><strong>Accessing Your Information</strong></a></td></tr><tr><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><a href=\"javascript:changeText6('')\"><strong>Third Party Links</strong></a></td><td><a href=\"javascript:changeText7('')\"><strong>Cookies</strong></a></td></tr><tr><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><a href=\"javascript:changeText8('')\"><strong>Pixel Tags</strong></a></td><td><a href=\"javascript:changeText9('')\"><strong>Children Under 13</strong></a></td></tr><tr><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><a href=\"javascript:changeText10('')\"><strong>Policy Changes</strong></a></td><td>&nbsp;</td></tr><tr><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td>© 2006 KSL Resorts. All Rights Reserved</td><td>&nbsp;</td></tr></table>";
}

// swap html
function changeText2(newText){
document.getElementById("choice").innerHTML="<table width='720' border='0' cellspacing='0' cellpadding='0' align='center'><tr><td><strong>How We Collect and Use Information:</strong></td><td align='right'><a href=\"javascript:changeText1('')\">Back</a></td></tr><tr><td colspan='2' height='10'></td></tr><tr><td colspan='2'>When you log onto a KSL Website, our servers log your IP addresses, the URL of your request and other information that is provided in the HTTP header. KSL collects this information in order to provide information about our products and services that will meet the expectations of our guests. This information cannot be used to identify you.</td></tr><tr><td colspan='2' height='10'></td></tr><tr><td colspan='2'>Certain requests or services, however, may require submission of information that can be used to identify you. This is known as personally identifiable information or PII. KSL will only use the PII that you submit to perform requested transactions (such as product purchases), services (such as reservations) or, if in connection with your registration on a KSL website, to provide you with information concerning KSL's products or services. This may include, by way of example, sending e-mail(s) that contain news, special offers, or promotions relating to products and services offered by KSL. You can opt-out of receiving e-mails from KSL at any time by clicking selecting the opt-out link included in the e-mail or by clicking here.</td></tr></table>";
}

// swap html
function changeText3(newText){
document.getElementById("choice").innerHTML="<table width='720' border='0' cellspacing='0' cellpadding='0' align='center'><tr><td><strong>Third Party Disclosures:</strong></td><td align='right'><a href=\"javascript:changeText1('')\">Back</a></td></tr><tr><td colspan='2' height='10'></td></tr><tr><td colspan='2'>From time to time, KSL may run a sweepstakes, contest or other promotional event that may be co-sponsored by a third party. In the event that you submit an entry or other form of information in connection with such an event, the information submitted may be shared with such third party. KSL will try to notify you of this fact at the time that you submit information in connection with such an event.</td></tr><tr><td colspan='2' height='10'></td></tr><tr><td colspan='2'>KSL may also use third party service providers to send and distribute e-mail and to perform other marketing and product support functions. While these third parties may have access to your information when performing these services, such access will be strictly limited to performing services requested by KSL. These third party service providers will have no other rights to use or otherwise distribute your information.</td></tr><tr><td colspan='2' height='10'></td></tr><tr><td colspan='2'>KSL may also be required to use or disclose your information in connection with a legal action or other proceeding. This includes any actions that may be brought by KSL against you as a result of your failure to meet your obligations under this or any related agreements.</td></tr></table>";
}



// swap html
function changeText4(newText){
document.getElementById("choice").innerHTML="<table width='720' border='0' cellspacing='0' cellpadding='0' align='center'><tr><td><strong>How We Store Your Information:</strong></td><td align='right'><a href=\"javascript:changeText1('')\">Back</a></td></tr><tr><td colspan='2' height='10'></td></tr><tr><td colspan='2'>KSL is committed to protecting the security of any personal information you provide. For these reasons, certain financial information, such as credit card data, will generally be transferred over a Secured Socket Layer (SSL) connection (provided that it is supported or enabled on your browser). This is the best security presently offered by most standard browsers. In spite of these protections, any information submitted over the Internet could be intercepted or otherwise corrupted during transmission. As such, KSL cannot guarantee the security of any data submitted over the Internet. After your information reaches KSL, however, it is stored on a secure server that resides behind firewall technology that is designed to block external access by unauthorized third parties. The secure server is under the direct control of KSL at all times but may be hosted, managed or otherwise maintained by third party service providers. These third party service providers have no right to use or access this data other than at the direct request (or on behalf of) of KSL.</td></tr></table>";
}


// swap html
function changeText5(newText){
document.getElementById("choice").innerHTML="<table width='720' border='0' cellspacing='0' cellpadding='0' align='center'><tr><td><strong>Accessing Your Information:</strong></td><td align='right'><a href=\"javascript:changeText1('')\">Back</a></td></tr><tr><td colspan='2' height='10'></td></tr><tr><td colspan='2'>You may access and change the information that you submitted during registration at any time by providing your username and password. Fields that may be changed include: name, address, company name, e-mail address, your interests, and your password. Please keep your password in a safe place and do not provide this information to anyone. We strongly encourage you to check the accuracy of your data regularly as KSL will use your e-mail and home address to communicate with you regarding products or services that you have requested. KSL will not be liable for any problems or difficulties that arise as a result of your failure to keep your information up to date.</td></tr></table>";
}


// swap html
function changeText6(newText){
document.getElementById("choice").innerHTML="<table width='720' border='0' cellspacing='0' cellpadding='0' align='center'><tr><td><strong>Third Party Links:</strong></td><td align='right'><a href=\"javascript:changeText1('')\">Back</a></td></tr><tr><td colspan='2' height='10'></td></tr><tr><td colspan='2'>The KSL websites may list or link to third party products or services. KSL does not have any control over the quality, safety or legality of the items advertised, the truth or accuracy of the listings, the ability of suppliers to sell items or the ability of buyers to buy items. For these reasons, KSL Resorts and its affiliates cannot ensure that a buyer or supplier will actually complete a transaction. KSL will not be a party to any transactions between you and such third parties and any correspondence concerning such transactions should be conducted between you and the third party. Additionally, as described above, KSL does not have any control or access to the information that you submit to such third party.</td></tr></table>";
}


// swap html
function changeText7(newText){
document.getElementById("choice").innerHTML="<table width='720' border='0' cellspacing='0' cellpadding='0' align='center'><tr><td><strong>Cookies:</strong></td><td align='right'><a href=\"javascript:changeText1('')\">Back</a></td></tr><tr><td colspan='2' height='10'></td></tr><tr><td colspan='2'>\"Cookies\" are small files that are stored on your machine and may be used to store your personal information, For example, we use \"cookies\" to (i) customize content specific to your interests, (ii) ensure that you do not see the same advertisement repeatedly and (iii) store your password so you do not have to re-enter it each time you use the KSL Site.</td></tr></table>";
}

// swap html
function changeText8(newText){
document.getElementById("choice").innerHTML="<table width='720' border='0' cellspacing='0' cellpadding='0' align='center'><tr><td><strong>Pixel Tags:</strong></td><td align='right'><a href=\"javascript:changeText1('')\">Back</a></td></tr><tr><td colspan='2' height='10'></td></tr><tr><td colspan='2'>A \"pixel tag\" is a clear (transparent) image placed on a web page to collect information about the page view. KSL uses pixel tags to aggregate web traffic information, such as the number of unique visitors, the top paths through the site, entry pages and exit pages. KSL does not use pixel tags to collect any personal information such as your name, age, phone number, address or e-mail address from visitors and we do not have a database of individual browsing profiles.</td></tr></table>";
}


// swap html
function changeText9(newText){
document.getElementById("choice").innerHTML="<table width='720' border='0' cellspacing='0' cellpadding='0' align='center'><tr><td><strong>Children Under 13:</strong></td><td align='right'><a href=\"javascript:changeText1('')\">Back</a></td></tr><tr><td colspan='2' height='10'></td></tr><tr><td colspan='2'>Children under the age of 13 should not attempt to register with any KSL websites or otherwise acquire any products or services. KSL will not knowingly contact children under age 13 about special offers or for marketing purposes. Additionally, KSL will not knowingly ask a child under age 13 for personal information, as a condition of participation. Children under age 13 are strictly prohibited from participating in any activity or promotion in which personal information is reasonably necessary.</td></tr></table>";
}

// swap html
function changeText10(newText){
document.getElementById("choice").innerHTML="<table width='720' border='0' cellspacing='0' cellpadding='0' align='center'><tr><td><strong>Policy Changes:</strong></td><td align='right'><a href=\"javascript:changeText1('')\">Back</a></td></tr><tr><td colspan='2' height='10'></td></tr><tr><td colspan='2'>KSL may update this policy from time to time. We will notify you about significant changes in the way we treat your personal information by sending a notice to the primary e-mail address specified in your account (if any) or by placing a notice on our websites.</td></tr></table>";
}


// Fix Google Toolbar Autofill


  if(window.attachEvent)
    window.attachEvent("onload",setListeners);

  function setListeners(){
    inputList = document.getElementsByTagName("INPUT");
    for(i=0;i<inputList.length;i++){
      inputList[i].attachEvent("onpropertychange",restoreStyles);
      inputList[i].style.backgroundColor = "";
    }
    selectList = document.getElementsByTagName("SELECT");
    for(i=0;i<selectList.length;i++){
      selectList[i].attachEvent("onpropertychange",restoreStyles);
      selectList[i].style.backgroundColor = "";
    }
  }

  function restoreStyles(){
    if(event.srcElement.style.backgroundColor != "")
      event.srcElement.style.backgroundColor = "";
  }


///
function validZip(inZip) {
		for (i=0; i<inZip.length; i++) {
			if (inZip.charAt(i) < "0") {
				return false
			}
			if (inZip.charAt(i) > "9") {
				return false
			}
			if (inZip.length < 5) {
				return false
			}
		}
		return true
	}
	
	
function validTelAreaCode(inTelAreaCode) {
		for (i=0; i<inTelAreaCode.length; i++) {
			if (inTelAreaCode.charAt(i) < "0") {
				return false
			}
			if (inTelAreaCode.charAt(i) > "9") {
				return false
			}
			if (inTelAreaCode.length < 3) {
				return false
			}
		}
		return true
	}
	


function validEmail(Email) {
		invalidChars = " /:,;"
		
		for (i=0; i<invalidChars.length; i++) {
			badChar = invalidChars.charAt(i)
			if (Email.indexOf(badChar,0) > -1) {
				return false
			}
		}
		atPos = Email.indexOf("@",1)
		if (atPos == -1) {
			return false
		}
		if (Email.indexOf("@",atPos+1) != -1) {
			return false
		}
		periodPos = Email.indexOf(".",atPos)
		if (periodPos == -1) {
			return false
		}
		if (periodPos+3 > Email.length) {
			return false
		}
		return true
	}
	
function numberCode(inNumber) {
	if (inNumber == "") {
		return false
	}
	for (i=0; i<inNumber.length; i++) {
		if (inNumber.charAt(i) < "0") {
			return false
		}
		if (inNumber.charAt(i) > "9") {
			return false
		}
	}
	return true
}
	
	

	
function submitIt(passForm) {

	if (passForm.firstName.value == "") {
		alert("Please enter your First Name")
		passForm.firstName.focus()
		return false
	}

	if (passForm.lastName.value == "") {
		alert("Please enter your Last Name")
		passForm.lastName.focus()
		return false
	}

	if (passForm.phoneCode.value != "") {
		if (!validTelAreaCode(passForm.phoneCode.value)) {
			alert("Please enter a valid Telephone Area Code")
			passForm.phoneCode.focus()
			passForm.phoneCode.select()
			return false
		}
	}
	
	if (passForm.phoneNum.value != "") {	
		if (!validTelNumber(passForm.phoneNum.value)) {
			alert("Please enter a valid Telephone Number")
			passForm.phoneNum.focus()
			passForm.phoneNum.select()
			return false
		}
	}
	if (passForm.cellCode.value != "") {
		if (!validTelAreaCode(passForm.cellCode.value)) {
			alert("Please enter a valid Cell Phone Area Code")
			passForm.cellCode.focus()
			passForm.cellCode.select()
			return false
		}
	}
	
	if (passForm.cellNum.value != "") {
		if (!validTelNumber(passForm.cellNum.value)) {
			alert("Please enter a valid Cell Number")
			passForm.cellNum.focus()
			passForm.cellNum.select()
			return false
		}
	}
	
	if (passForm.faxCode.value != "") {
		if (!validTelAreaCode(passForm.faxCode.value)) {
			alert("Please enter a valid Fax Area Code")
			passForm.faxCode.focus()
			passForm.faxCode.select()
			return false
		}
	}
	
	if (passForm.faxNum.value != "") {
		if (!validTelNumber(passForm.faxNum.value)) {
			alert("Please enter a valid Fax Number")
			passForm.faxNum.focus()
			passForm.faxNum.select()
			return false
		}
	}
	
	if (passForm.email.value == "") {
		alert("Please enter your Email Address")
		passForm.email.focus()
		return false
	}

	if (passForm.email.value != "") {
		if (!validEmail(passForm.email.value)) {
			alert("Invalid Email Address - Please enter a valid Email Address")
			passForm.email.focus()
			passForm.email.select()
			return false
		}	
	}
	if (passForm.zip.value != "") {
		if (!validZip(passForm.zip.value)) {
			alert("Please enter a valid Zip Code")
			passForm.zip.focus()
			passForm.zip.select()
			return false
		}
	}
		
	
	
	return true
}







//-->
// begin absolutely positioned scrollable area object scripts 
// Extension developed by David G. Miles 
// Original Scrollable Area code developed by Thomas Brattli 
function verifyCompatibleBrowser(){ 
    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.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5) 
    return this 
} 
bw=new verifyCompatibleBrowser() 
 
 
var speed=50 
 
var loop, timer 
 
function ConstructObject(obj,nest){ 
    nest=(!nest) ? '':'document.'+nest+'.' 
    this.el=bw.dom?document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?eval(nest+'document.'+obj):0; 
    this.css=bw.dom?document.getElementById(obj).style:bw.ie4?document.all[obj].style:bw.ns4?eval(nest+'document.'+obj):0; 
    this.scrollHeight=bw.ns4?this.css.document.height:this.el.offsetHeight 
    this.clipHeight=bw.ns4?this.css.clip.height:this.el.offsetHeight 
    this.up=MoveAreaUp;this.down=MoveAreaDown; 
    this.MoveArea=MoveArea; this.x; this.y; 
    this.obj = obj + "Object" 
    eval(this.obj + "=this") 
    return this 
} 
function MoveArea(x,y){ 
    this.x=x;this.y=y 
    this.css.left=this.x 
    this.css.top=this.y 
} 
 
function MoveAreaDown(move){ 
	if(this.y>-this.scrollHeight+objContainer.clipHeight){ 
    this.MoveArea(0,this.y-move) 
    if(loop) setTimeout(this.obj+".down("+move+")",speed) 
	} 
} 
function MoveAreaUp(move){ 
	if(this.y<0){ 
    this.MoveArea(0,this.y-move) 
    if(loop) setTimeout(this.obj+".up("+move+")",speed) 
	} 
} 
 
function PerformScroll(speed){ 
	if(initialised){ 
		loop=true; 
		if(speed>0) objScroller.down(speed) 
		else objScroller.up(speed) 
	} 
} 
 
function CeaseScroll(){ 
    loop=false 
    if(timer) clearTimeout(timer) 
} 
var initialised; 
function InitialiseScrollableArea(){ 
    objContainer=new ConstructObject('divContainer') 
    objScroller=new ConstructObject('divContent','divContainer') 
    objScroller.MoveArea(0,0) 
    objContainer.css.visibility='visible' 
    initialised=true; 
}
function InitialiseScrollableAreaSm(){ 
    objContainer=new ConstructObject('divContainerSm') 
    objScroller=new ConstructObject('divContentSm','divContainerSm') 
    objScroller.MoveArea(0,0) 
    objContainer.css.visibility='visible' 
    initialised=true; 
} 
// end absolutely positioned scrollable area object scripts 