//Hands of Time Copyright 2008//Adapted for use in an iFrame and with raw html rather than a Domino formvar isValid=[];var i=0;var nameValid=false;function DoValidate(){	var errorCheck=ValidateForm()	if (errorCheck==0){			var nameString=document.forms[0].name.value			var add1=document.forms[0].address1.value			var add2=document.forms[0].address2.value			var city=document.forms[0].city.value			var state=document.forms[0].state.value			var zip=document.forms[0].zip.value			var phone=document.forms[0].phone.value			var email=document.forms[0].email.value			var request=document.forms[0].request.value			var params=encodeURIComponent(nameString+"&"+add1+"&"+add2+"&"+city+"&"+state+"&"+zip+"&"+phone+"&"+email+"&"+request)			window.location.replace("/HandsofT.nsf/(RequestNotify)?OpenAgent&"+params)	}else{		//alert("Your request cannot be submitted until it is properly completed.\n Click the red text for an explanation of the problems.")		alert("Your request cannot be submitted until it is properly completed.\n Please fill in the boxes labelled with red text..")		i=0	}	}function ValidateForm(){var firstErrorField = null;var theField;//Namevar theValue=document.forms[0].nametheField = isBlankField(theValue, "name", "text","You must enter a name.", "#FF0033");if (!firstErrorField) {	firstErrorField = theField;	}//alert("Email Addie")var theValue=document.forms[0].emailtheField = isBlankField(theValue, "email","text","Please enter an e-mail address, telephone number, or snail mail address.", "#FF0033");if (!firstErrorField) {	firstErrorField = theField;	}			var theValue=document.forms[0].phone		theField = isBlankField(theValue, "phone","text","Please enter an e-mail address, telephone number, or snail mail address.", "#FF0033");		if (!firstErrorField) {			firstErrorField = theField;		}				//alert("address1")	//If an email address was not given check for a snail mail address		var theValue=document.forms[0].address1		theField = isBlankField(theValue,"address1", "text","Please enter an e-mail address, telephone number, or snail mail address.", "#FF0033");		if (!firstErrorField) {			firstErrorField = theField;		}		//alert("city")		var theValue=document.forms[0].city		theField = isBlankField(theValue,"city", "text","If you are entering an address, you must enter your city.", "#FF0033");		if (!firstErrorField) {			firstErrorField = theField;		}		//alert("state")		var theValue=document.forms[0].state		theField = isBlankField(theValue,"state", "text","If you are entering an address, you must enter your state.", "#FF0033");		if (!firstErrorField) {		firstErrorField = theField;		}		//alert("zip")		var theValue=document.forms[0].zip		theField = isBlankField(theValue,"zip", "text","If you are entering an address, you must enter your zip code.", "#FF0033");		if (!firstErrorField) {		firstErrorField = theField;		}if (firstErrorField==null){	errorYes=0}else{	if (nameValid==true){errorYes=extendedValidation(isValid)}	else{ errorYes=1}}	return(errorYes)}////Verify that at least one of the required fields besides name has been entered.function extendedValidation(isValid){var index;var canSubmit=false;//IE does not use indexOf on arrays!!if(!Array.indexOf){	return(ieExtended(isValid))}else{index=isValid.indexOf("phoneLabel")if (index!=-1){	canSubmit=true	return(0)	}else{	index=isValid.indexOf("emailLabel")		if (index!=-1){			canSubmit=true			return(0)			}else{			index=isValid.indexOf("address1Label")			if(index!=-1){				index=isValid.indexOf("cityLabel")				if(index!=-1){					index=isValid.indexOf("stateLabel")					if(index!=-1){						index=isValid.indexOf("zipLabel")						if(index!=-1){return(0)}else{return(1)}					}else{return(1)}				}else{return(1)}			}else{return(1)}		}		}}}//ExtendedValidation//Extended Validation for IE browser users ==================function ieExtended(isValid){var index;//index=isValid.indexOf("phoneLabel")for(var i=0; i<isValid.length; i++){	if((isValid[i]=="phoneLabel")|(isValid[i]=="emailLabel")){		canSubmit=true		return(0)		}else{			if(isValid[i]=="address1Label"){				i=i+2				//i++ = address2 which isn't required					if(isValid[i]=="cityLabel"){						i++							if(isValid[i]=="stateLabel"){								i++									if(isValid[i]=="zipLabel"){ alert("checking zip"); return(0)}else{return(1)}							}else{return(1)}					}else{return(1)}				}else{return(1)}			} //if else	} //for	} //function///Field Validation Popups=============================function isBlankField (theField, fieldName, fieldType, message, color) {var theLabel = fieldName + "Label"switch (fieldType){	case "text":			if (typeof(theField)==undefined) {						flagFieldInvalid(theLabel, message);			return theField;		}		if (typeof(theField)!=undefined) {			if ((theField.value=="") | (theField.value==null)){				flagFieldInvalid(theLabel, message);				return theField;				}		}		if (typeof(theField)!=undefined) {			if ((theField.value!="") | (theField.value!=null)){			flagFieldValid(theLabel, color);			return null;			}		}		break;	case "list":		if (theField.value== 0 ){			flagFieldInvalid(theLabel, message);			return theField;		}else{			flagFieldValid(theLabel, color);			return null;		}		break;	case "number":		if ((theField.value== 0)|| (isNaN(theField.value))){			flagFieldInvalid(theLabel, message);			return theField;		}		else {			flagFieldValid(theLabel, color);			return null;		}		break;	}}function flagFieldInvalid(labelID, message) {	document.getElementById(labelID).style.color="red";	document.getElementById(labelID).onmouseover= new Function("this.style.cursor='hand';");	document.getElementById(labelID).onmousedown= new Function("doPopup('" + message + "');");	document.getElementById(labelID).onmouseout= new Function("hidePopup();");	document.getElementById(labelID).onmouseup= new Function("hidePopup();");}function flagFieldValid(labelID, color) {	if(labelID=="nameLabel"){		nameValid=true		}else{			isValid[i]=labelID			i++		}	document.getElementById(labelID).style.color= "#663333";	document.getElementById(labelID).onmouseover= new Function("this.style.cursor='auto';");	document.getElementById(labelID).onmousedown= null;	document.getElementById(labelID).onmouseout= null;	document.getElementById(labelID).onmouseup= null;	}	function doPopup(text) {	var x=event.clientX - 50; //position approx. centered over hand	var y=event.clientY - 22; //position just above hand	showPopup(x, y, text)}function showPopup(x, y, text) {	popup.style.left=x;	popup.style.top=y;	popup.innerHTML = text;	popup.style.display="block"}function hidePopup() {	popup.style.display="none"}// Nav Bar =======================================var ContentHeight = 200;var TimeToSlide = 250.0;var openAccordion = '';function runAccordion(index){  var nID = "Accordion" + index + "Content";  if(openAccordion == nID)    nID = '';     setTimeout("animate(" + new Date().getTime() + "," + TimeToSlide + ",'"      + openAccordion + "','" + nID + "')", 33);   openAccordion = nID;}function animate(lastTick, timeLeft, closingId, openingId){    var curTick = new Date().getTime();  var elapsedTicks = curTick - lastTick;   var opening = (openingId == '') ? null : document.getElementById(openingId);  var closing = (closingId == '') ? null : document.getElementById(closingId);   if(timeLeft <= elapsedTicks)  {    if(opening != null)      opening.style.height = ContentHeight + 'px';       if(closing != null)    {      closing.style.display = 'none';      closing.style.height = '0px';    }    return;  }   timeLeft -= elapsedTicks;  var newClosedHeight = Math.round((timeLeft/TimeToSlide) * ContentHeight);  if(opening != null)  {    if(opening.style.display != 'block')      opening.style.display = 'block';    opening.style.height = (ContentHeight - newClosedHeight) + 'px';  }   if(closing != null)    closing.style.height = newClosedHeight + 'px';  setTimeout("animate(" + curTick + "," + timeLeft + ",'"      + closingId + "','" + openingId + "')", 33);}