
var process_choice_type = "";
<!-- SubMaint/Customer/8/55378/SKI_LAKE_TAHOE/Default/auxdir/  -->

// FUNCTION: isblank 
// 
// Test if a string is entirely composed of whitespace 
// characters (spaces, newlines, and tabs).
//
// Params : the String - The string to be tested
//
// Returns: True  - Blank string
//  : False - Nonblank string

function isblank(theString)
{ slen = theString.length;     
  for (idx = 0; slen > idx; idx++)
 { schar = theString.charAt(idx);
   if (schar != ' ' && schar!= '\n' && schar != '\t')
  return false;
 }
  return true;
}

// FUNCTION: setProps
//
// Set up validation properties and field names for
// subscriber data elements. Executed at form load.
//
// Params : eBase - Base element location
//
// Returns: NONE

function setProps(eBase)
{ 
  //eBase.ADDRESS.field_label = "ADDRESS";
 // eBase.ADDRESS.mandatory=true;
 // eBase.CITY.field_label = "CITY";
//  eBase.CITY.mandatory=true;
//  eBase.COUNTRY.field_label = "COUNTRY";
//  eBase.COUNTRY.mandatory=true;
  eBase.EFORMAT.field_label = "EFORMAT";
  eBase.EFORMAT.mandatory=true;
  eBase.EMAIL.field_label = "E-MAIL";
  eBase.EMAIL.mandatory=true;
  eBase.FNAME.field_label = "FIRST NAME";
  eBase.FNAME.mandatory=true;
  eBase.LNAME.field_label = "LAST NAME";
  eBase.LNAME.mandatory=true;
//  eBase.STATE.field_label = "STATE";
//  eBase.STATE.mandatory=true;
//  eBase.ZIPCODE.field_label = "ZIPCODE/POSTAL CODE";
// eBase.ZIPCODE.mandatory=true;
  preloadImages();
}

// FUNCTION: validateElements 
//
// Check for the presence of mandatory text and select fields,
// and confirm modification and cancellation requests.
//
// Triggered at the time of form submission.
//
// Params : theForm - The form
//
// Returns: True  - Form contents valid and submission confirmed
//  : False - Data missing/invalid or submission cancelled

function validateElements(theForm)
{ 
// EDITING NOTE:
// The following three messages may be altered for language/customization purposes.

  var confirm_cancel_msg = "Submit cancellation request?";
  var confirm_modify_msg = "Submit modified information?";
  var missing_fields_msg = "The following mandatory fields are missing:";

  var missing_field_names = "";
  var msg_buff = "";
  var theIndex = "";
  var theValue = "";
  
  

	if (document.forms[0].elements['mailer'].checked ){

var isvc;
var svcmsg;
var svcix;
svcix=0;

svcmsg="In order to send you the\r2003-2004 Lake Tahoe Skier's and Boarder's \rWinter Vacation Guide\rWe need your complete mailing address\r";

var svcarray = new Array("FNAME","LNAME","ADDRESS","CITY","ZIPCODE");
for ( isvc=0; isvc < svcarray.length; isvc++ ) {
  			if (theForm[svcarray[isvc]].value == ""){
				svcix += 1;
				
				
			}
		}
		
if (svcix > 0){
	alert(svcmsg);
	return false;
	}


}

	





// Bypass validation checks for cancellations.

  if (process_choice_type != "C")
 { for (var i = 0; theForm.length > i; i++)
  { var e = theForm.elements[i];
    if (e.type == "text" || e.type == "textarea")
   { is_text = true;
     theIndex = 0;
     theValue = e.value;
   }
    else if (e.type == "select-one" || e.type == "select-multiple")
   { is_text = false;
     theIndex = e.selectedIndex;
     theValue = e.options[e.selectedIndex].text;
   }
    else
   continue;
    
    if (e.mandatory && (theValue == null || theValue == "" || isblank(theValue) || theIndex == -1))
   missing_field_names += e.field_label + "\n";
  }
   if (missing_field_names.length > 0)
  msg_buff += missing_fields_msg + "\n\n" + missing_field_names + "\n";
   if (msg_buff.length > 0)
  { alert(msg_buff);
    return false;
  }
 }
	
	  if (document.forms[0].elements['HOW'].selectedIndex == 19){
	alert("Please tell us how you found out about the Ski Lake Tahoe website");
	document.forms[0].elements['HOW'].focus
	return false;
	}


	
  
// Confirm the user's choice.

  if (process_choice_type == "C")
 msg_buff = confirm_cancel_msg;
  else if (process_choice_type == "M")
 msg_buff = confirm_modify_msg;
  else
 return true;
  if (confirm(msg_buff))
 return true;
  return false;
}


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

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		freetah_skiresort_over = newImage("http://www.skilaketahoe.com/images/freetah-skiresort_over.jpg");
		freetah_new_over = newImage("http://www.skilaketahoe.com/images/freetah-new_over.jpg");
		freetah_airport_over = newImage("http://www.skilaketahoe.com/images/freetah-airport_over.jpg");
		freetah_places_over = newImage("http://www.skilaketahoe.com/images/freetah-places_over.jpg");
		freetah_freetahoe_over = newImage("http://www.skilaketahoe.com/images/freetah-freetahoe_over.jpg");
		freetah_specials_over = newImage("http://www.skilaketahoe.com/images/freetah-specials_over.jpg");
		freetah_weather_over = newImage("http://www.skilaketahoe.com/images/freetah-weather_over.jpg");
		freetah_skicond_over = newImage("http://www.skilaketahoe.com/images/freetah-skicond_over.jpg");
		freetah_press_over = newImage("http://www.skilaketahoe.com/images/freetah-press_over.jpg");
		freetah_home_over = newImage("http://www.skilaketahoe.com/images/freetah-home_over.jpg");
		preloadFlag = true;
	}
}

// -->



<!-- this function sets the url of a link to intl or domestic depending on where the user came from //-->
<!-- SET VALUE OF LOCATION BASED UPON WHERE THE LINK WAS //-->
   
function check_referrer(gotourl, thislink){

if (document.forms[0].elements['LOCATION'].value == "domestic" || document.forms[0].elements['LOCATION'].value == ""){
document.links[thislink].href= "http://www.skilaketahoe.com/" + gotourl;
}
else {
document.links[thislink].href= "http://www.skilaketahoe.com/international/" + gotourl;
}
}

 // -->

