<!--
//scripts to enable roll-over states for graphics
//preload the images
var aryNavItems = new Array("home","directory","events","visitor","group","hours","gift","employment","newsletter");
var i = 0;

for(i=0;i<=aryNavItems.length -1;i++){
	if(location.href.indexOf("ip91433r") != -1){
		var imgLoc = "https://www207.safesecureweb.com/ip91433r/images";
	}
	else{
		var imgLoc = "/images";
	}
	eval("var " + aryNavItems[i] + "_off = new Image()");
	eval("" + aryNavItems[i] + "_off.src ='" + imgLoc + "/ui_nav_" + aryNavItems[i] + "_off.gif'");
	eval("var " + aryNavItems[i] + "_on = new Image()");
	eval("" + aryNavItems[i] + "_on.src = '" + imgLoc + "/ui_nav_" + aryNavItems[i] + "_on.gif'");
}
	
function imgOn(imgName){
	if(document.images){
		document[imgName].src = eval(imgName + "_on.src");
	}
}

function imgOff(imgName){
	if(document.images){
		document[imgName].src = eval(imgName + "_off.src");
	}
}

//generic function for loading pages into a new window
function newWin(pageURL,pageW,pageH){
	var winParams = "newWindow = window.open('" + pageURL + "','newWin','height=" + pageH + ",width=" + pageW + ",status,resizable=1')";
	//alert(winParams);
	eval(winParams);
}

var movieName = "homefeature";

function thisMovie(movieName) {
  // IE and Netscape refer to the movie object differently.
  // This function returns the appropriate syntax depending on the browser.
  if (navigator.appName.indexOf ("Microsoft") !=-1) {
    return window[movieName]
  } else {
    return document[movieName]
  }
}

// Checks if movie is completely loaded.
// Returns true if yes, false if no.
function movieIsLoaded (theMovie) {
  // First make sure the movie's defined.
  if (typeof(theMovie) != "undefined") {
    // If it is, check how much of it is loaded.
    return theMovie.PercentLoaded() == 100;
  } else {
    // If the movie isn't defined, it's not loaded.
    return false;
  }
}

function playMovie() {
  if (movieIsLoaded(thisMovie(movieName))) {
    thisMovie(movieName).Play();
  }
}

//generic email format validator
function isValidEmail(str) {
   return (str.indexOf(".") > 2) && (str.indexOf("@") > 0);
}

function checkForm(formName){
	var passed = false;
	var thisForm = document[formName];
	var errTxt = "";
	//validate the form based on the formName provided - each form has different required inputs
	master :
	switch (formName) {
		case 'strikeapose':
			if(thisForm.spName.value == ''){
				errTxt = errTxt + "Please enter your name.\n";
			}
			if(thisForm.spAge.value == ''){
				errTxt = errTxt + "Please enter your age.\n";
			}
			if(thisForm.spBirthday.value == ''){
				errTxt = errTxt + "Please enter your birthday.\n";
			}
			if(thisForm.spHomePhone.value == ''){
				errTxt = errTxt + "Please enter your home phone number.\n";
			}
			if(!isValidEmail(thisForm.spEmail.value)){
				errTxt = errTxt + "Please enter a properly formatted email address.\n";
			}
			if(thisForm.spAddress.value == ''){
				errTxt = errTxt + "Please enter your address.\n";
			}
			if(thisForm.spCity.value == ''){
				errTxt = errTxt + "Please enter your city.\n";
			}
			if(thisForm.spState.value == ''){
				errTxt = errTxt + "Please enter your state.\n";
			}
			if(thisForm.spHeightFeet.value == ''){
				errTxt = errTxt + "Please enter your height (feet).\n";
			}
			if(thisForm.spHeightInches.value == ''){
				errTxt = errTxt + "Please enter your height (inches).\n";
			}
			if(thisForm.spExperience[0].checked && thisForm.spPreviousAgency.value == ''){
				errTxt = errTxt + "You indicated previous modeling experience--please tell us with what agency.\n";
			}
			if(thisForm.spAge.value <= 17 && thisForm.spGuardianName.value == ''){
				errTxt = errTxt + "You indicated that you were younger than 18--please include your parent or guardian's name.\n";
			}
			if(thisForm.spReferrer.options[thisForm.spReferrer.options.selectedIndex].value == ''){
				errTxt = errTxt + "Please enter tell use how you heard about this contest.\n";
			}
			if(thisForm.spPhotograph.value == ''){
				errTxt = errTxt + "Please select a photo of yourself for upload.\n";
			}
			break master;
	}
	if (errTxt.length > 0){
		errTxt = "FORM ERRORS FOUND:\n" + errTxt;
		alert(errTxt);
	}
	else {
		// put a modal dialog call here for progress bar
		passed = true;
	}
	return passed;
}

function jump2center(selectElement){
	thisURL = selectElement.options[selectElement.options.selectedIndex].value;
	if(thisURL){
		window.location.href=thisURL;
	}
}

//-->