
	/*   **********************  AOC site ************************    */



function ValidEmail() {
	
	var oForm = document.myform;	 	if (oForm.Email.value.replace( / /g, "") != "" && isEmail(eval(oForm).Email.value)==false)	{		alert("Please enter a valid Email address, like: name@companyname.com ");		oForm.Email.focus();		return false;	} 
	return true;
}


//________________________________________________________________________________________________
//_____________________      ValidContact    _____________________________________________________________

function ValidContact() {
	
	var oForm = document.frmContact;	 	if (oForm.FirstName.value.replace( / /g, "") == "")	{		alert("Please enter First Name!");		oForm.FirstName.focus();		return false;	}
	
	if (oForm.LastName.value.replace( / /g, "") == "")	{		alert("Please enter Last Name!");		oForm.LastName.focus();		return false;	}
	
	if (oForm.Zip.value.replace( / /g, "") != "" && validateZIP(oForm.Zip)==false)	{		oForm.Zip.focus();		return false;	}		if (oForm.Phone.value.replace( / /g, "") != "" && !checkUSPhone(eval(oForm).Phone))	{		oForm.Phone.focus();		return false;	}	if (oForm.Email.value.replace( / /g, "") != "" && isEmail(eval(oForm).Email.value)==false)	{		alert("Please enter a valid Email address, like: name@companyname.com ");		oForm.Email.focus();		return false;	}  	
	if (oForm.Phone.value.replace( / /g, "") == "" && oForm.Email.value.replace( / /g, "") == "")
	{
		alert("Please enter your phone or email address!");
		oForm.Phone.focus();		return false;
	}
	if (oForm.Comments.value.replace( / /g, "") == "")	{		alert("Please enter Message!");		oForm.Comments.focus();		return false;	}	
	return true;
}
	



function ValidSend() {
	if (document.myform1.Email.value.replace( / /g, "") == "")	{		alert("Please enter your Email Address !");		document.myform1.Email.focus();		return false;	}

	if (document.myform1.Email.value.replace( / /g, "") != "" && isEmail(eval(document.myform1).Email.value)==false)	{		alert("Please enter a valid Email address, like: name@companyname.com ");		document.myform1.Email.focus();		return false;	}  

	if (document.myform1.REmail.value.replace( / /g, "") == "")	{		alert("Please enter your Friend's Email Address !");		document.myform1.REmail.focus();		return false;	}

	if (document.myform1.REmail.value.replace( / /g, "") != "" && isEmail(eval(document.myform1).REmail.value)==false)	{		alert("Please enter a valid Email address, like: name@companyname.com ");		document.myform1.REmail.focus();		return false;	}  		
}


function uncheck() {

	if (document.myform.psf22[6].checked){
		for (counter = 0; counter < 6; counter++){
				 document.myform.psf22[counter ].checked=false;
				 document.myform.Comment_psf22Other.value ="";
		}
	}		
	return true;
}


//____________________________________________________________________________________
//_____________     ValidForm      ________________________________________________

function ValidForm() {

	var theForm = document.myform;
	var nr = theForm.length;
	
	var radio_choice = false; 
	for (i = 0;  i < nr; i++)
	{
		if (theForm.elements[i].checked==true)
		radio_choice = true; 
	}

	if (!radio_choice)
	{
	     alert("Please, check at least one question!");
		return (false);
	}		
	var nr_check = 0; 
/*
	if (document.myform.psf22[6].checked){
		for (counter = 0; counter < 6; counter++){
			if (document.myform.psf22[counter].checked){
				 nr_check++;
			}
			if (!(isWhitespace(document.myform.Comment_psf22Other.value)))	{
				 nr_check++;
			}
		}
	}	
	if (nr_check>0)
	{
	     alert("Please, select either None or other Walk/Runs in the Fort Worth area !");
		return (false);
	}		*/
	if (!(isWhitespace(document.myform.PSText_152.value)))
	{
		if (validateZIP(document.myform.PSText_152)==false) 
		{
					document.myform.PSText_152.focus();
					return false;
		} 
	}
	 return true;
}


//____________________________________________________________________________________
//_____________     ValidFormP      ________________________________________________

function ValidFormP() {

	var theForm = document.myform;
	var nr = theForm.length;
	
	radio_choice = false; 
	for (i = 0;  i < nr; i++)
	{
		if (theForm.elements[i].checked==true)
		radio_choice = true; 
	}

	if (!radio_choice)
	{
	     alert("Please, check at least one question!");
		return (false);
	}		
	if (!(isWhitespace(document.myform.Zip.value)))
	{
		if (validateZIP(document.myform.Zip)==false) 
		{
					document.myform.Zip.focus();
					return false;
		} 
	}
	 return true;
}


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~      ValidUpload      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidUpload() {

	if (isWhitespace(document.myform.Image.value)) 
	{
	     alert("Please upload Image!  ");
	     document.myform.Image.focus();
	     return false;
	}  

	if (!(isWhitespace(document.myform.Image.value))) 
	{
		myext = getExtension(document.myform.Image.value);
		if (!myext){
			document.myform.Image.focus;
			return false; 
		}	
	}	
	 return true;
}



//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~      ValidLogin      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidLogin() {

	if (isWhitespace(document.myform.UserName.value)) 
	{
	     alert("Please enter User Name!  ");
	     document.myform.UserName.focus();
	     return false;
	}  
	if (isWhitespace(document.myform.UserPassword.value)) 
	{
	     alert("Please enter  User Password! ");
	     document.myform.UserPassword.focus();
	     return false;
	}  
	 return true;
}


//________________________________________________________________________________________________
//_____________________      ValidEEmployment     _____________________________________________________________


function ValidEEmployment() {
	if (isWhitespace(document.myform.EmplResFName.value)) 
	{
	     alert("Please enter First Name  ");
	     document.myform.EmplResFName.focus();
	     return false;
	}
	if (isWhitespace(document.myform.EmplResLName.value)) 
	{
	     alert("Please enter Last Name  ");
	     document.myform.EmplResLName.focus();
	     return false;
	}
	if (isWhitespace(document.myform.EmplResAddress.value)) 
	{
	     alert("Please enter Address  ");
	     document.myform.EmplResAddress.focus();
	     return false;
	}
	if (isWhitespace(document.myform.EmplResCity.value)) 
	{
	     alert("Please enter City  ");
	     document.myform.EmplResCity.focus();
	     return false;
	}
	if (document.myform.EmplResState.value==0) 
	{
	     alert("Please enter State  ");
	     document.myform.EmplResState.focus();
	     return false;
	}
	if (isWhitespace(document.myform.EmplResZip.value)) {
		alert("Please enter Zip code  ");
	     document.myform.EmplResZip.focus(); 
		 return false;
	} 
	if (validateZIP(document.myform.EmplResZip)==false) {
		 document.myform.EmplResZip.focus();
		 return false;
	}
	if (isWhitespace(document.myform.EmplResFile.value)) 
	{
	     alert("Please upload your resume ");
	     document.myform.EmplResFile.focus();
	     return false;
	}
	if (document.myform.EmplResPhone.value.length > 0){ 
	if (IsPhone(document.myform.EmplResPhone.value)==false) {
		document.myform.EmplResPhone.focus();
			return false;
	}
	}
	return true;
}



//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     ValidVolunteer       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidVolunteer() {
if (isWhitespace(document.myform.VolunteerFName.value)) 
	{
	     alert("Please enter First Name! ");
	     document.myform.VolunteerFName.focus();
	     return false;
	}
if (isWhitespace(document.myform.VolunteerLName.value)) 
	{
	     alert("Please enter Last Name! ");
	     document.myform.VolunteerLName.focus();
	     return false;
	}
if (isWhitespace(document.myform.VolunteerEmail.value)) 
	{
	     alert("Please enter Volunteer Email! ");
	     document.myform.VolunteerEmail.focus();
	     return false;
	}

if (!(isWhitespace(document.myform.VolunteerEmail.value))) {		
	 if (isEmail(document.myform.VolunteerEmail.value)==false) {
			alert("Please enter a valid E-Mail address, like: name@companyname.com ");
			document.myform.VolunteerEmail.focus();
			return false;
	 }
	 }
/*if (!(isWhitespace(document.myform.VolunteerPhone.value))) 	{ 
	if (document.myform.VolunteerPhone.value !="" && !checkUSPhone(document.myform.VolunteerPhone)) {
		document.myform.VolunteerPhone.focus();
		return false;
	}
	}*/
	 return true;
}



//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~   Valid_Date   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function Valid_Date(datein){
        
        var indate=datein;
        if (indate.indexOf("-")!=-1){
                var sdate = indate.split("-")
        }
        else {
                var sdate = indate.split("/")
        }
        var chkDate=new Date(Date.parse(indate))
        var cmpDate=(chkDate.getMonth()+1)+"/"+(chkDate.getDate())+"/"+(chkDate.getFullYear())
        var indate2=(Math.abs(sdate[0]))+"/"+(Math.abs(sdate[1]))+"/"+(Math.abs(sdate[2]))

		if ((chkDate.getFullYear() > 3000)||(chkDate.getFullYear() < 1900)) {
                alert("You've entered an invalid year");
				return false;
		}				
		if ((Math.abs(sdate[2]) > 3000)||(Math.abs(sdate[2])< 1900)) {
                alert("You've entered an invalid year");
				return false;
		}				
   if (indate2=="0/NaN/NaN"){
				return true;
   }        
	else {
 		
        if (indate2!=cmpDate){
                alert("You've entered an invalid date or date format.  Please use the MM/DD/YYYY format.");
				return false;
        }
        else {
                if (cmpDate=="NaN/NaN/NaN"){
                        alert("You've entered an invalid date or date format. Please use the MM/DD/YYYY format.");
						return false;
                }
                else {
						return true;
                }       
        }
}        
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
function valid_xdatex() {

	var xDate = new Date();
	var zDate = new Date(document.myform.HitDate.value);

	if (xDate < zDate) {
		alert("The Hits Date must be earlier than today!");
		document.myform.HitDate.focus();
		return false;
	} 
	return true;
}


var reWhitespace = /^\s+$/
// warnEmpty (theField, s)             Notify user that required field theField is empty.


// Notify user that required field theField is empty.
// String s describes expected contents of theField.value.
// Put focus in theField and return false.

function warnEmpty (theField, s)
{   theField.focus()
    alert(mPrefix + s + mSuffix)
    return false
}

// Check whether string s is empty.

function isEmpty(s)
{   return ((s == null) || (s.length == 0))
}


// Returns true if string s is empty or 
// whitespace characters only.

function isWhitespace (s)
{
 // Is s empty?
//    return (isEmpty(s));
    return (isEmpty(s) || reWhitespace.test(s));
}



//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     validateZIP      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


function validateZIP(field) {
var valid = "0123456789-";
var hyphencount = 0;

if (field.value.length!=5 && field.value.length!=10) {
alert("Please enter your 5 digit or ( 5 + 4 ) digit  ZIP  code.");
return false;
}
for (var i=0; i < field.value.length; i++) {
temp = "" + field.value.substring(i, i+1);
if (temp == "-") hyphencount++;
if (valid.indexOf(temp) == "-1") {
alert("Invalid characters in your ZIP code.  Please try again.");
return false;
}
if ((hyphencount > 1) || ((field.value.length==10) && ""+field.value.charAt(5)!="-")) {
alert("The hyphen character should be used with a properly formatted 5 digit+four  ZIP  code, like '12345-6789'.   Please try again.");
return false;
   }
}
return true;
}



//________________________________________________________________________________________________
//_____________________      NonSpace     _____________________________________________________________

function NonSpace(field) {

	var xpos =0;
	var xlen =field.length;
	var xpos1 =0;
	var xpos2 =xlen;

	for (var i=0; i < xlen; i++) {
		temp = "" + field.substring(i, i+1);
		if (temp == " ") {xpos++;}
		else {var xpos1=xpos;break;  }
	}
	field = field.substring(xpos1, xlen)
	var xlen1 = field.length;

	for (var i=0; i < xlen1; i++) {
		temp = "" + field.substring(i, i+1);
		if (temp != " ") {xpos1++;}
		else {xpos2=i;break;  }
	}
	field = field.substring(0, xpos2)
	return field;
}


//________________________________________________________________________________________________
//_____________________      isEmail     _____________________________________________________________

function isEmail(string) {
	string = NonSpace(string);
    if (string.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1)
        return true;
    else
        return false;
}




//________________________________________________________________________________________________
//_____________________      IsPhone     _____________________________________________________________

function IsPhone(str)          // is phone str valid
    {
    if (str.length != 12) 
              // nope - wrong str length
		{
		alert('Invalid PhoneNo. Must be in the form NNN-NNN-NNNN.');
		return false;
	}		
  for (i=0; i<12; i++)
    {
    if (i == 3 || i == 7)
    {
      if (str.charAt(i) != "-")     // nope - "-" missing
			{
			alert(' Missing - . PhoneNo  must be in the form NNN-NNN-NNNN.');
			return false;
			}
	}		
	else
    {
      if (!isNum(str.charAt(i)))
		{
		alert('Non-numeric characters. PhoneNo must be in the form NNN-NNN-NNNN.');
		return false;
		}
	}		
  }
  return true;                     

}



//________________________________________________________________________________________________
//_____________________      IsFax     _____________________________________________________________

function IsFax(str)          // is Fax str valid
    {
    if (str.length != 12) 
              // nope - wrong str length
		{
		alert('Invalid FaxNo. Must be in the form NNN-NNN-NNNN.');
		return false;
	}		
  for (i=0; i<12; i++)
    {
    if (i == 3 || i == 7)
    {
      if (str.charAt(i) != "-")     // nope - "-" missing
			{
			alert(' Missing - . FaxNo  must be in the form NNN-NNN-NNNN.');
			return false;
			}
	}		
	else
    {
      if (!isNum(str.charAt(i)))
		{
		alert('Non-numeric characters. FaxNo must be in the form NNN-NNN-NNNN.');
		return false;
		}
	}		
  }
  return true;                     

}



//________________________________________________________________________________________________
//_____________________      validateZIP     _____________________________________________________________

function validateZIP(field) {
var valid = "0123456789-";
var hyphencount = 0;

if (field.value.length!=5 && field.value.length!=10) {
alert("Please enter your 5 digit or ( 5 + 4 ) digit  ZIP  code.");
return false;
}
for (var i=0; i < field.value.length; i++) {
temp = "" + field.value.substring(i, i+1);
if (temp == "-") hyphencount++;
if (valid.indexOf(temp) == "-1") {
alert("Invalid characters in your ZIP code.  Please try again.");
return false;
}
if ((hyphencount > 1) || ((field.value.length==10) && ""+field.value.charAt(5)!="-")) {
alert("The hyphen character should be used with a properly formatted 5 digit+four  ZIP  code, like '12345-6789'.   Please try again.");
return false;
   }
}
return true;
}


//________________________________________________________________________________________________
//_____________________      isNum     _____________________________________________________________

function isNum(chr)            // is character a number?
  {
  if (chr < "0" || chr > "9")  // nope
    return false;
  else                         // yep
    return true;
  }


//________________________________________________________________________________________________
//_____________________      isNumber19     _____________________________________________________________

function isNumber19(InString)  {
        RefString="123456789";

        for (Count=0; Count < InString.length; Count++)  {
            TempChar= InString.substring (Count, Count+1);
            if (RefString.indexOf (TempChar, 0)==-1) { 
				alert("Please enter numbers only: 1 - 9 ");
				return false;
			}
		}
        return true;
}


//________________________________________________________________________________________________
//_____________________      isNumber09     _____________________________________________________________

function isNumber09(InString)  {
        RefString="0123456789";

        for (Count=0; Count < InString.length; Count++)  {
            TempChar= InString.substring (Count, Count+1);
            if (RefString.indexOf (TempChar, 0)==-1) { 
				alert("Please enter numbers only: 0 - 9 ");
				return false;
			}
		}
        return true;
}

//________________________________________________________________________________________________
//_____________________      isNumberZip     _____________________________________________________________

function isNumberZip(InString)  {
        RefString="0123456789-";

        for (Count=0; Count < InString.length; Count++)  {
            TempChar= InString.substring (Count, Count+1);
            if (RefString.indexOf (TempChar, 0)==-1) { 
				alert("Please enter a valid Zip Code! ");
				return false;
			}
		}
        return true;
}


//________________________________________________________________________________________________
//_____________________      ValidPercent     _____________________________________________________________

function ValidPercent(field)  {
        RefString="0123456789.";
        for (Count=0; Count < field.length; Count++)  {
            TempChar= field.substring (Count, Count+1);
            if (RefString.indexOf (TempChar, 0)==-1) { 
						alert ("Please enter a valid percent (99.99 or a number <=100) !");
				return false;
			}
		}
		
	var xpos =0;
	var xlen =field.length;
	for (var i=0; i < xlen ; i++) {
		temp = field.substring(i, i+1);
		if (temp == ".") {xpos=i;}
	}

	if (xpos == 0) {var per=field;}
	else {var per =field.substring(0,xpos);}
	if (per > 100) {
			alert ("Please enter a valid percent (99.99 or a number <=100) !");
			return false; }
	else
		{ return true;}

}



//________________________________________________________________________________________________
//_____________________      getExtension     _____________________________________________________________

function getExtension(field) {
	var xpos =0;
	var xlen =field.length;
	for (var i=xlen; i > 0 ; i--) {
		temp = "" + field.substring(i, i-1);
		if (temp != ".") {xpos--;}
			else {break;
		}
	}
	var myext =field.substring(xlen+xpos, xlen).toLowerCase();
		if ((myext != "gif") && (myext != "jpg") && (myext != "jpeg") && (myext != "bmp") && (myext != "jpe") && (myext != "swf")){
				alert ("Please Upload an Image with GIF,JPEG,JPE,JPG,BMP or SWF extension !");
		return false; }
		else
		{ return true;}

}





//________________________________________________________________________________________________
//_____________________      warnEmpty     _____________________________________________________________
var reWhitespace = /^\s+$/
// warnEmpty (theField, s)             Notify user that required field theField is empty.


// Notify user that required field theField is empty.
// String s describes expected contents of theField.value.
// Put focus in theField and return false.

function warnEmpty (theField, s)
{   theField.focus()
    alert(mPrefix + s + mSuffix)
    return false
}


//________________________________________________________________________________________________
//_____________________      isEmpty     _____________________________________________________________
function isEmpty(s)
{   return ((s == null) || (s.length == 0))
}



//________________________________________________________________________________________________
//_____________________      isWhitespace     _____________________________________________________________

function isWhitespace (s)

{   // Is s empty?
//    return (isEmpty(s));
    return (isEmpty(s) || reWhitespace.test(s));
}






function Start(page) {
	OpenWin = this.open(page, "CtrlWindow", "toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes,width=550,height=250,top=50,left=50");
}



//---------------- valid phone ----------------
// VARIABLE DECLARATIONS

var digits = "0123456789";

// whitespace characters
var whitespace = " \t\n\r";

// decimal point character differs by language and culture
var decimalPointDelimiter = "."

// non-digit characters which are allowed in phone numbers
var phoneNumberDelimiters = "()-./ ";

// characters which are allowed in US phone numbers
var validUSPhoneChars = digits + phoneNumberDelimiters;

// U.S. phone numbers have 10 digits.
// They are formatted as 123-456-7890 or (123) 456-7890.
var digitsInUSPhoneNumber = 10;

// CONSTANT STRING DECLARATIONS

// m = "missing"

var mPrefix = "You did not enter a value into the "
var mSuffix = " field. This is a required field. Please enter it now."

// s --- "string"

var sPhone = "Phone Number"

// i is an abbreviation for "invalid"
var iUSPhone = "This field must be a 10 digit U.S. phone number (like 415-555-1212). Please reenter it now."
// p is an abbreviation for "prompt"
var pEntryPrompt = "Please enter a "
var pUSPhone = "10 digit U.S. phone number (like 415-555-1212)."
var defaultEmptyOK = false
// Check whether string s is empty.

function isEmpty(s)
{   return ((s == null) || (s.length == 0))
}function stripCharsInBag (s, bag)

{   var i;
    var returnString = "";

    // Search through string's characters one by one.
    // If character is not in bag, append to returnString.

    for (i = 0; i < s.length; i++)
    {   
        // Check that current character isn't whitespace.
        var c = s.charAt(i);
        if (bag.indexOf(c) == -1) returnString += c;
    }

    return returnString;
}function isDigit (c)
{   return ((c >= "0") && (c <= "9"))
}
function isInteger (s)

{   var i;

    if (isEmpty(s)) 
       if (isInteger.arguments.length == 1) return defaultEmptyOK;
       else return (isInteger.arguments[1] == true);

    // Search through string's characters one by one
    // until we find a non-numeric character.
    // When we do, return false; if we don't, return true.

    for (i = 0; i < s.length; i++)
    {   
        // Check that current character is number.
        var c = s.charAt(i);

        if (!isDigit(c)) return false;
    }

    // All characters are numbers.
    return true;
}
function reformat (s)

{   var arg;
    var sPos = 0;
    var resultString = "";

    for (var i = 1; i < reformat.arguments.length; i++) {
       arg = reformat.arguments[i];
       if (i % 2 == 1) resultString += arg;
       else {
           resultString += s.substring(sPos, sPos + arg);
           sPos += arg;
       }
    }
    return resultString;
}


function isUSPhoneNumber (s)
{   if (isEmpty(s)) 
       if (isUSPhoneNumber.arguments.length == 1) return defaultEmptyOK;
       else return (isUSPhoneNumber.arguments[1] == true);
    return (isInteger(s) && s.length == digitsInUSPhoneNumber)
}

// Notify user that contents of field theField are invalid.
// String s describes expected contents of theField.value.
// Put select theField, pu focus in it, and return false.

function warnInvalid (theField, s)
{   theField.focus()
    theField.select()
    alert(s)
    return false
}

function reformatUSPhone (USPhone)
{   return (reformat (USPhone, "", 3, "-", 3, "-", 4))
}


function checkUSPhone (theField, emptyOK)
{   if (checkUSPhone.arguments.length == 1) emptyOK = defaultEmptyOK;
    if ((emptyOK == true) && (isEmpty(theField.value))) return true;
    else
    {  var normalizedPhone = stripCharsInBag(theField.value, phoneNumberDelimiters)
       if (!isUSPhoneNumber(normalizedPhone, false)) 
          return warnInvalid (theField, iUSPhone);
       else 
       {  // if you don't want to reformat as (123) 456-789, comment next line out
          theField.value = reformatUSPhone(normalizedPhone)
          return true;
       }
    }
}


function isInt(chr)           
{
	if (isNaN(chr))
	{return false; }
	else
	  {
		if (chr>0)
		{ return true;	}
		else
		  { return false; }	  
	   }
}


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//~~~~~~~     isZip      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~function validZIP(field) {	var valid = "0123456789-";	var hyphencount = 0;	if (field.length!=5 && field.length!=10) {		alert("Please enter your 5 digit or 5 digit+4 zip code.");		return false;	}	for (var i=0; i < field.length; i++) {		temp = "" + field.substring(i, i+1);		if (temp == "-") hyphencount++;			if (valid.indexOf(temp) == "-1") {				alert("Invalid characters in your zip code.  Please try again.");		return false;	}	if ((hyphencount > 1) || ((field.length==10) && ""+field.charAt(5)!="-")) {		alert("The hyphen character should be used with a properly formatted 5 digit+four zip code, like '12345-6789'.   Please try again.");		return false;	}}return true;}  
