function gotosite(site) {
  if (site != "") {
  self.location=site
  } 
}

function NewWindow(mypage, myname, w, h, scroll) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable,toolbar=no'
win = window.open(mypage, myname, winprops)
/* if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); } */
}

function popup_null() {
}

function checkString()
	{

	if (location.search) { 
	faq = location.search;

	for (i=0; i<=document.faqform.faq.length-1; i++) 
		{
		temp = document.faqform.faq.options[i].value;
		if (temp == location.search) {
		document.faqform.faq.selectedIndex = i;
		messageReveal();
alert("Your question has been selected for you automatically and the answer is being displayed in the bottom box.  ;-)");
window.location = window.location + "#faq";

         	}   
		}
	}
}



function MM_showHideLayers() { //v2.0
  var i, visStr, args, theObj;
  args = MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) { //with arg triples (objNS,objIE,visStr)
    visStr   = args[i+2];
    if (navigator.appName == 'Netscape' && document.layers != null) {
      theObj = eval(args[i]);
      if (theObj) 

{
theObj.pageY=74;
theObj.visibility = visStr;
}
    } else if (document.all != null) { //IE
      if (visStr == 'show') visStr = 'visible'; //convert vals
      if (visStr == 'hide') visStr = 'hidden';
      theObj = eval(args[i+1]);
      if (theObj) theObj.style.visibility = visStr;
  } }
}

function MM_swapImgRestore() { //v2.0
  if (document.MM_swapImgData != null)
    for (var i=0; i<(document.MM_swapImgData.length-1); i+=2)
      document.MM_swapImgData[i].src = document.MM_swapImgData[i+1];
}

function MM_preloadImages() { //v2.0
  if (document.images) {
    var imgFiles = MM_preloadImages.arguments;
    if (document.preloadArray==null) document.preloadArray = new Array();
    var i = document.preloadArray.length;
    with (document) for (var j=0; j<imgFiles.length; j++) if (imgFiles[j].charAt(0)!="#"){
      preloadArray[i] = new Image;
      preloadArray[i++].src = imgFiles[j];
  } }
}

function MM_swapImage() { //v2.0
  var i,j=0,objStr,obj,swapArray=new Array,oldArray=document.MM_swapImgData;
  for (i=0; i < (MM_swapImage.arguments.length-2); i+=3) {
    objStr = MM_swapImage.arguments[(navigator.appName == 'Netscape')?i:i+1];
    if ((objStr.indexOf('document.layers[')==0 && document.layers==null) ||
        (objStr.indexOf('document.all[')   ==0 && document.all   ==null))
      objStr = 'document'+objStr.substring(objStr.lastIndexOf('.'),objStr.length);
    obj = eval(objStr);
    if (obj != null) {
      swapArray[j++] = obj;
      swapArray[j++] = (oldArray==null || oldArray[j-1]!=obj)?obj.src:oldArray[j];
      obj.src = MM_swapImage.arguments[i+2];
  } }
  document.MM_swapImgData = swapArray; //used for restore
}



function messageReveal() {

faq=document.faqform.faq.options[document.faqform.faq.selectedIndex].value;

if (faq=="?giving_1")
display = "A. Gifts can be sent to: 9Health Fair, 1139 Delaware Street, Denver, CO 80204-3607";

else if (faq=="?giving_2")
display = "A. Yes, we accept donations over the phone. You can put your gift on your Visa or MasterCard credit card. All we need is your name, credit card number and expiration date. Please contact the Director of Development for any credit card donations at (800) 332-3078.  Our office hours are Monday - Friday 8:00 A.M. - 5:00 P.M. Mountain time.";

else if (faq=="?giving_3")
display = "A. Yes. We receive many donations from people who want to pay tribute or memorialize a friend or loved one. When we receive such a donation, we send a card to the person or family being memorialized or honored. You would receive an acknowledgment for this gift.";

else if (faq=="?giving_4")
display = "A. No. This information is kept confidential.";

else if (faq=="?giving_5")
display = "A. Absolutely. We have a great number of projects and programs that need funding. To learn about all of your funding options, please contact our Director of Development for details.";

else if (faq=="?giving_6")
display = "A. We need volunteers for fund raising events held throughout the year. Please contact our the Director of Volunteers and Community Outreach for more information about how you can help!";

else if (faq=="?giving_7")
display = "A. We would gladly send you our latest annual report. Please contact the Director of Development to obtain your copy.";

else if (faq=="?community_1")
display = "A. The only cost you pay at a 9Health Fair site is the optional blood screening and take-home colorectal screening kit.  For detailed costs, click here [Link to What You Get]. All other screenings and health education is free.";

else if (faq=="?community_2")
display = "A. Cash or personal checks are accepted at all 9Health Fair sites. Many Metro Denver sites will also accept payment by either Visa or MasterCard.";

else if (faq=="?community_3")
display = "A. Every 9Health Fair offers the blood chemistry panel and the PSA (prostate blood screening for men).";

else if (faq=="?community_4")
display = "A. Diabetics should never fast before the 9Health Fair because their blood sugar level may get dangerously low. Fasting means not consuming any calories. To get the most accurate cholesterol and glucose (sugar), you should fast for 12 hours before the blood chemistry screening.  It is important to continue to drink water while fasting so that you do not get dehydrated. It is important to continue to take your prescription medications. If you are unable to fast for 12 hours, your glucose, cholesterol, and triglycerides may be slightly elevated. None of the other results will be affected.";

else if (faq=="?community_5")
display = "A. Participants must be at least 18 years of age.";

else if (faq=="?community_6")
display = "A. Most participants spend about 2 hours learning about their health. Depending on your interests and the site you choose, the health fair takes from 30 minutes to 4 hours.";

else if (faq=="?community_7")
display = "A. [Link to Blood Results Explanation page]";

else if (faq=="?community_8")
display = "A. Two copies of your results will be mailed to you at the address you provided on your participant form. You will receive your results within 6 weeks.";

else if (faq=="?community_9")
display = "A. No appointments are necessary. All 9Health Fair sites are first come, first served.";

else if (faq=="?community_10")
display = "A. If you or your organization are interested in providing health information to participants at a 9Health Fair site, please click here [Link to IEC Application]and review the provided information.";

else if (faq=="?community_11")
display = "A. You can sign up to volunteer right here on this website by clicking here [Link to Volunteer page] or you can contact our office and speak to our Director of Volunteers and Community Outreach to learn more about our exciting volunteer opportunities.";

else if (faq=="?community_12")
display = "A. 9Health Fair is a community-based project staffed entirely by dedicated volunteers. If you are interested in coordinating a site in your community, please review our criteria and mail the completed application [link to IntheCommunityApplication on Resource page] and/or contact our Director of Logistics for more information.";

else display = "";
document.faqform.field.value = display;
}






function ValidateForm(theform) {
// Verify that required data exists prior
// to submitting review to server.

   	// MUST SELECT PROGRAM
    if (theform.program[0].selected == true) {
        alert("Please select Program");
        return false;
    }

   	// MUST ENTER FIRST NAME
	if (theform.fname.value.length == 0) {
		alert( "Please enter your First Name");
		theform.fname.focus();
		return false
	}

   	// MUST ENTER LAST NAME
	if (theform.lname.value.length == 0) {
		alert( "Please enter your Last Name");
		theform.lname.focus();
		return false
	}

   	// MUST ENTER ORGANIZATION
	if (theform.organization.value.length == 0) {
		alert( "Please enter your Organization");
		theform.organization.focus();
		return false
	}

   	// MUST ENTER STREET ADDRESS
	if (theform.street.value.length == 0) {
		alert( "Please enter your Street Address");
		theform.street.focus();
		return false
	}

   	// MUST ENTER CITY
	if (theform.city.value.length == 0) {
		alert( "Please enter your City");
		theform.city.focus();
		return false
	}

   	// MUST SELECT STATE
    if (theform.state[0].selected == true) {
        alert("Please select your State");
        return false;
    }

   	// MUST ENTER ZIP CODE
	if (theform.zip.value.length == 0) {
		alert( "Please enter your Zip Code");
		theform.zip.focus();
		return false
	}


   	// MUST ENTER EMAIL
	if (theform.email.value.length == 0) {
		alert( "Please enter your E-Mail Address");
		theform.email.focus();
		return false
	}

    //CHECK EMAIL FORMAT
    var input_str=theform.email.value;
    var input_len1=input_str.length;
    var iserror=0;
    input_len1=input_str.length;
    var lastdot=-1;
    var lastat=-1;
    var numberat=0;

    if (theform.email.value.length != 0) {

        for (var j = 0; j < input_len1; j++) {
             var ch2 = input_str.substring(j, j + 1);
             if (((ch2 < "a") ||  (ch2 > "z")) && ((ch2 < "A") || (ch2 > "Z")) && ((ch2 < "0") ||  (ch2 > "9")) && (ch2 != "@" ) && (ch2 != ".") && (ch2 != "_") && (ch2 != "-")){
                 alert("Please input a valid email address!\nValid characters include A-Z, a-z, 0-9, -, _, . and @");
                 iserror=1;
             }
             if (ch2==".") {
                 if ( j == lastdot + 1) {
                     alert("Please input a valid email address!\nYou can't have two dots next to\neach other'..'.");
                     iserror=1;
                 }
                 lastdot=j;
             }
             if (ch2=="@") {
                 lastat=j;
                 numberat=numberat+1
             }
             if (ch2==" ") {
                 alert("Please input a valid email address!\nYou can't have any spaces in the address.");
                 iserror=1;
             }
        }
        if (lastat == -1) {
             alert("Please input a valid email address!\nYou don't have an '@'.");
             iserror=1;
        }
        if (lastat == 0) {
             alert("Please input a valid email address!\nYou don't have a name before the '@'.");
             iserror=1;
        }
        if (numberat > 1) {
             alert("Please input a valid email address!\nYou may have only one '@'.");
             iserror=1;
        }
        if ((lastdot <= lastat) || (lastdot > input_len1 - 3 ) || (input_len1 - lastdot > 4)) {
             alert("Please input a valid email address!\nYou don't have a proper domain name!\nUse .com, .org, .net, .us, etc");
             iserror=1;
        }
        if (lastdot == lastat + 1) {
             alert("Please input a valid email address!\nYou don't have a proper organization name!\nUse name@organization.domain");
             iserror=1;
        }
        if (iserror==1) {
             theform.email.focus();
             return false;
        }

    }

   	// MUST ENTER WORK PHONE
	if (theform.wphone.value.length == 0) {
		alert( "Please enter your Work Phone Number");
		theform.wphone.focus();
		return false
	}


   	return true;
}



function ValidateForm2(theform) {
// Verify that required data exists prior
// to submitting review to server.

   	// MUST ENTER GROUP NAME
	if (theform.groupname.value.length == 0) {
		alert( "Please enter your Group Name");
		theform.groupname.focus();
		return false
	}

   	// MUST ENTER CITY
	if (theform.city.value.length == 0) {
		alert( "Please enter your City");
		theform.city.focus();
		return false
	}

   	// MUST SELECT STATE
    if (theform.state[0].selected == true) {
        alert("Please select your State");
        return false;
    }

   	// MUST ENTER DATE FORMED
	if (theform.dateformed.value.length == 0) {
		alert( "Please enter Date Formed");
		theform.dateformed.focus();
		return false
	}

   	// MUST ENTER FACILITATOR NAME
	if (theform.facilitatorname.value.length == 0) {
		alert( "Please enter Facilitator Name");
		theform.facilitatorname.focus();
		return false
	}


   	// MUST ENTER EMAIL
	if (theform.email.value.length == 0) {
		alert( "Please enter your E-Mail Address");
		theform.email.focus();
		return false
	}

    //CHECK EMAIL FORMAT
    var input_str=theform.email.value;
    var input_len1=input_str.length;
    var iserror=0;
    input_len1=input_str.length;
    var lastdot=-1;
    var lastat=-1;
    var numberat=0;

    if (theform.email.value.length != 0) {

        for (var j = 0; j < input_len1; j++) {
             var ch2 = input_str.substring(j, j + 1);
             if (((ch2 < "a") ||  (ch2 > "z")) && ((ch2 < "A") || (ch2 > "Z")) && ((ch2 < "0") ||  (ch2 > "9")) && (ch2 != "@" ) && (ch2 != ".") && (ch2 != "_") && (ch2 != "-")){
                 alert("Please input a valid email address!\nValid characters include A-Z, a-z, 0-9, -, _, . and @");
                 iserror=1;
             }
             if (ch2==".") {
                 if ( j == lastdot + 1) {
                     alert("Please input a valid email address!\nYou can't have two dots next to\neach other'..'.");
                     iserror=1;
                 }
                 lastdot=j;
             }
             if (ch2=="@") {
                 lastat=j;
                 numberat=numberat+1
             }
             if (ch2==" ") {
                 alert("Please input a valid email address!\nYou can't have any spaces in the address.");
                 iserror=1;
             }
        }
        if (lastat == -1) {
             alert("Please input a valid email address!\nYou don't have an '@'.");
             iserror=1;
        }
        if (lastat == 0) {
             alert("Please input a valid email address!\nYou don't have a name before the '@'.");
             iserror=1;
        }
        if (numberat > 1) {
             alert("Please input a valid email address!\nYou may have only one '@'.");
             iserror=1;
        }
        if ((lastdot <= lastat) || (lastdot > input_len1 - 3 ) || (input_len1 - lastdot > 4)) {
             alert("Please input a valid email address!\nYou don't have a proper domain name!\nUse .com, .org, .net, .us, etc");
             iserror=1;
        }
        if (lastdot == lastat + 1) {
             alert("Please input a valid email address!\nYou don't have a proper organization name!\nUse name@organization.domain");
             iserror=1;
        }
        if (iserror==1) {
             theform.email.focus();
             return false;
        }

    }


   	return true;
}






















function ValidateZip( theform )
{
	if ( theform.Recordset13_Zip.value == null || theform.Recordset13_Zip.value == "" ) 
	{    
		alert("You must enter a valid zipcode.");
		theform.Recordset13_Zip.focus();
		return false;
    }
    
    return true;
}

function ValidateZip_sp( theform )
{
	if ( theform.Recordset13_Zip.value == null || theform.Recordset13_Zip.value == "" ) 
	{    
		alert("Usted debe incorporar un zipcode válido.");
		theform.Recordset13_Zip.focus();
		return false;
    }
    
    return true;
}