inputFocus = function() {
  var numInp = document.getElementsByTagName("input");
  for (var m=0; m<numInp.length; m++) {
    numInp[m].onfocus=function() {
    this.className+=" inputfocus";	}
    numInp[m].onblur=function() {
    this.className=this.className.replace(new RegExp(" inputfocus\\b"), "");}}}
if (window.attachEvent) window.attachEvent("onload", inputFocus);

selectFocus = function() {
  var numSel = document.getElementsByTagName("select");
  for (var n=0; n<numSel.length; n++) {
    numSel[n].onfocus=function() {
    this.className+=" selectfocus";	}
    numSel[n].onblur=function() {
    this.className=this.className.replace(new RegExp(" selectfocus\\b"), "");}}}

if (window.attachEvent) window.attachEvent("onload", selectFocus);

var emailfilter=/^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|\d+)$/i

function check_val(e){

  var surveyBoxes = "";
  for (i = 0; i < e.survey.length; i++) {
  if (e.survey[i].checked) {surveyBoxes ++ }}
  if (surveyBoxes=="") { alert("Section 1:\nPlease specify which survey(s) you are registering for.");
  e.survey[0].focus(); return false; }

  if ((e.survey[4].checked) && (!e.part_costs_gls[0].checked && !e.part_costs_gls[1].checked && !e.part_costs_gls[2].checked && !e.part_costs_gls[3].checked )){ alert("Section 1:\nPlease select the number of countries you will be submitting data for in the Radford Global Life Sciences Survey."); 
  e.part_costs_gls[0].focus();  return false;  }  
  
  if ((e.survey[5].checked) && (!e.part_costs_intl[0].checked && !e.part_costs_intl[1].checked && !e.part_costs_intl[2].checked && !e.part_costs_intl[3].checked && !e.part_costs_intl[4].checked && !e.part_costs_intl[5].checked && !e.part_costs_intl[6].checked )){ alert("Section 1:\nPlease select the number of countries you will be submitting data for in the Radford International Survey."); 
  e.part_costs_intl[0].focus();  return false;  }    
  
    if ((e.immediate_access[7].checked) && (!e.immediate_access_gls[0].checked && !e.immediate_access_gls[1].checked && !e.immediate_access_gls[2].checked && !e.immediate_access_gls[3].checked )){ alert("Section 1:\nPlease select the number of countries you want to receive immediate access to for the Radford Global Life Sciences Survey."); 
  e.immediate_access_gls[0].focus();  return false;  }  

    if ((e.immediate_access[8].checked) && (!e.immediate_access_intl[0].checked && !e.immediate_access_intl[1].checked && !e.immediate_access_intl[2].checked && !e.immediate_access_intl[3].checked && !e.immediate_access_intl[4].checked && !e.immediate_access_intl[5].checked && !e.immediate_access_intl[6].checked )){ alert("Section 1:\nPlease select the number of countries you want to receive immediate access to for the Radford International Survey."); 
  e.immediate_access_intl[0].focus();  return false;  }  
  
  if (e.company.value==''){ alert("Section 2: Company Information\nPlease enter your company name."); 
  e.company.focus();  return false;  }

  if (e.address1_main.value==''){alert("Section 2: Company Information\nPlease enter your company address.");
  e.address1_main.focus(); return false; }
	
  if (e.city_main.value==''){ alert("Section 2: Company Information\nPlease enter the city.");
  e.city_main.focus();  return false; }
	
  if (e.state_main.value==''){ alert("Section 2: Company Information\nPlease enter the state.");
  e.state_main.focus(); return false; }

  if (e.zip_main.value=='') { alert("Section 2: Company Information\nPlease enter the zip/postal code.");
  e.zip_main.focus(); return false; }
	
  if (e.country_main.value==''){ alert("Section 2: Company Information\nPlease select a country from the dropdown list.");
  e.country_main.focus();  return false; }
  
/*  if (e.web.value=='' || e.web.value=='http://www.' || e.web.value=='http://www. '){ alert("Section 2: Company Information\nPlease enter the website address.");
  e.web.focus();  return false; } 

  if (e.web.value.indexOf("@")!==-1){alert("Section 2: Company Information\nPlease note that the website address shouldn\'t contain the \'@\' character. Please re-enter the website address.");
  e.web.focus();  return false; } */

  if (e.address_ap_same.checked == false){
    if(e.address1_ap.value==""){alert("Section 2: Accounts Payable\nPlease enter the street address.");
    e.address1_ap.focus(); return false;}
	
    if(e.city_ap.value==""){alert("Section 2: Accounts Payable\nPlease enter the city.");
    e.city_ap.focus(); return false;}
	
    if(e.state_ap.value==""){alert("Section 2: Accounts Payable\nPlease enter the state.");
    e.state_ap.focus(); return false;}
	
    if(e.zip_ap.value==""){alert("Section 2: Accounts Payable\nPlease enter the zip/postal code.");
    e.zip_ap.focus(); return false;}

    if(e.country_ap.value==""){alert("Section 2: Accounts Payable\nPlease select a country from the dropdown list.");
    e.country_ap.focus(); return false;}}

  if(e.phone_ap.value==""){alert("Section 2: Accounts Payable\nPlease enter Accounts Payable phone number.");
  e.phone_ap.focus(); return false;} 
  
  if(e.industry.value==""){alert("Section 2:\nPlease select your company's general industry.");
  e.industry.focus(); return false;}
    
  if(e.product_line.value==""){alert("Section 2:\nPlease enter your company's specific industry/product line.");
  e.product_line.focus(); return false;}

  if(e.org_type.value==""){alert("Section 2:\nPlease select your company's organization type from the dropdown list.");
  e.org_type.focus(); return false;}
 
  if((e.org_type.value=="Division"||e.org_type.value=="Subsidiary")&&(e.parent_company.value=="")){alert("Section 2:\nPlease enter your parent company name.");
  e.parent_company.focus(); return false;}

  if(e.ownership.value==""){alert("Section 2:\nPlease select your company ownership type from the dropdown list.");
  e.ownership.focus(); return false;}
 
  if((e.ownership.value.indexOf("Public")>-1)&&(e.stock_symbol.value=="")){alert("Section 2:\nPlease enter your company stock symbol.");
  e.stock_symbol.focus(); return false;}

  if(e.fiscal_start.value==""){alert("Section 2:\nPlease select your company's Fiscal year start date from the dropdown list.");
  e.fiscal_start.focus(); return false;}

  if(e.ben_start.value==""){alert("Section 2:\nPlease select your company's Insurance plan start date from the dropdown list.");
  e.ben_start.focus(); return false;}

  if(e.comp_start.value==""){alert("Section 2:\nPlease select your company's sales compensation plan start date from the dropdown list.");
  e.comp_start.focus(); return false;}

  if(e.loc_revenue.value !=""){    
    if (isNum(e.loc_revenue) == false ){
	e.loc_revenue.focus(); return false;}}
    
  if(e.loc_revenue.value != "") {
    if(e.loc_currency.value==""){alert("Section 2:\nPlease select a currency for your reporting location revenue.");
    e.loc_currency.focus(); return false;} }

  if(e.ww_revenue.value != ""){    
    if (isNum(e.ww_revenue)  == false ){
	e.ww_revenue.focus(); return false;}}
    
  if(e.ww_revenue.value !="") {
    if(e.ww_currency.value==""){alert("Section 2:\nPlease select a currency for your worldwide revenue.");
    e.ww_currency.focus(); return false;} }	

  if(e.headcount_asia.value != ""){    
    if (isNum(e.headcount_asia)  == false ){
	e.headcount_asia.focus(); return false;}}
	
  if(e.headcount_canada.value != ""){    
    if (isNum(e.headcount_canada)  == false ){
	e.headcount_canada.focus(); return false;}}

  if(e.headcount_eu.value != ""){    
    if (isNum(e.headcount_eu)  == false ){
	e.headcount_eu.focus(); return false;}}

  if(e.headcount_me.value != ""){    
    if (isNum(e.headcount_me)  == false ){
	e.headcount_me.focus(); return false;}}

  if(e.headcount_amer.value != ""){    
    if (isNum(e.headcount_amer)  == false ){
	e.headcount_amer.focus(); return false;}}

  if(e.headcount_us.value != ""){    
    if (isNum(e.headcount_us)  == false ){
	e.headcount_us.focus(); return false;}}
	
/* COMPENSATION CYCLE */
	
  if (e.survey[0].checked || e.survey[1].checked || e.survey[2].checked || e.survey[3].checked){
    if(!(e.cycle_us_exec[0].checked || e.cycle_us_exec[1].checked)){ alert("Section 2: Compensation Cycles\nPlease answer all questions under Compensation Cycles for US Locations.");
    e.cycle_us_exec[0].focus(); return false; }
  
    if(e.cycle_us_exec[1].checked && e.cycle_us_exec_focal.value=="") {alert("Section 2: Compensation Cycles\nPlease select your company's Focal month for executives.");
    e.cycle_us_exec_focal.focus(); return false;}


    if(!(e.cycle_us_mgmt[0].checked || e.cycle_us_mgmt[1].checked)){ alert("Section 2: Compensation Cycles\nPlease answer all questions under Compensation Cycles for US Locations.");
    e.cycle_us_mgmt[0].focus(); return false; }
  
    if(e.cycle_us_mgmt[1].checked && e.cycle_us_mgmt_focal.value=="") {alert("Section 2: Compensation Cycles\nPlease select your company's Focal month for management professionals.");
    e.cycle_us_mgmt_focal.focus(); return false;}


    if(!(e.cycle_us_indPro[0].checked || e.cycle_us_indPro[1].checked)){ alert("Section 2: Compensation Cycles\nPlease answer all questions under Compensation Cycles for US Locations.");
    e.cycle_us_indPro[0].focus(); return false; }
  
    if(e.cycle_us_indPro[1].checked && e.cycle_us_indPro_focal.value=="") {alert("Section 2: Compensation Cycles\nPlease select your company's Focal month for individual contributor professional.");
    e.cycle_us_indPro_focal.focus(); return false;}


    if(!(e.cycle_us_indSpp[0].checked || e.cycle_us_indSpp[1].checked)){ alert("Section 2: Compensation Cycles\nPlease answer all questions under Compensation Cycles for US Locations.");
    e.cycle_us_indSpp[0].focus(); return false; }
  
    if(e.cycle_us_indSpp[1].checked && e.cycle_us_indSpp_focal.value=="") {alert("Section 2: Compensation Cycles\nPlease select your company's Focal month for individual contributor support.");
    e.cycle_us_indSpp_focal.focus(); return false;}}

  if (e.survey[5].checked){	
    if(!(e.cycle_intl_amer[0].checked || e.cycle_intl_amer[1].checked || e.cycle_intl_ap[0].checked || e.cycle_intl_ap[1].checked || e.cycle_intl_eu[0].checked || e.cycle_intl_eu[1].checked || e.cycle_intl_me[0].checked || e.cycle_intl_me[1].checked)){ alert("Section 2: Compensation Cycles\nPlease answer all questions under Compensation Cycles for Non-US Locations.");
    e.cycle_intl_amer[0].focus(); return false; }

    if(e.cycle_intl_amer[1].checked && e.cycle_intl_amer_focal.value=="") {alert("Section 2: Compensation Cycles\nPlease select the Focal month for The Americas \(excluding US\).");
    e.cycle_intl_amer_focal.focus(); return false;}	
	
    if(e.cycle_intl_ap[1].checked && e.cycle_intl_ap_focal.value=="") {alert("Section 2: Compensation Cycles\nPlease select the Focal month for Asia/Pacific.");
    e.cycle_intl_ap_focal.focus(); return false;}	

    if(e.cycle_intl_eu[1].checked && e.cycle_intl_eu_focal.value=="") {alert("Section 2: Compensation Cycles\nPlease select the Focal month for Europe.");
    e.cycle_intl_eu_focal.focus(); return false;}	
	
    if(e.cycle_intl_me[1].checked && e.cycle_intl_me_focal.value=="") {alert("Section 2: Compensation Cycles\nPlease select the Focal month for Middle East/Africa.");
    e.cycle_intl_me_focal.focus(); return false;}}


  if (e.survey[4].checked){	
    var country_ops_total = 0;
    for (i = 0; i < e.country_ops.length; i++) {
    if (e.country_ops[i].checked) {country_ops_total ++ }}
      if (country_ops_total>=2 || (country_ops_total==1 && !e.country_ops[20].checked)){
	    if(!(e.cycle_intl_amer[0].checked || e.cycle_intl_amer[1].checked || e.cycle_intl_ap[0].checked || e.cycle_intl_ap[1].checked || e.cycle_intl_eu[0].checked || e.cycle_intl_eu[1].checked || e.cycle_intl_me[0].checked || e.cycle_intl_me[1].checked)){
        alert("Section 2: Compensation Cycles\nPlease answer all questions under Compensation Cycles for Non-US Locations.");
        e.cycle_intl_amer[0].focus(); return false; }
		
        if(e.cycle_intl_amer[1].checked && e.cycle_intl_amer_focal.value=="") {alert("Section 2: Compensation Cycles\nPlease select the Focal month for The Americas \(excluding US\).");
        e.cycle_intl_amer_focal.focus(); return false;}	
	
        if(e.cycle_intl_ap[1].checked && e.cycle_intl_ap_focal.value=="") {alert("Section 2: Compensation Cycles\nPlease select the Focal month for Asia/Pacific.");
        e.cycle_intl_ap_focal.focus(); return false;}	

        if(e.cycle_intl_eu[1].checked && e.cycle_intl_eu_focal.value=="") {alert("Section 2: Compensation Cycles\nPlease select the Focal month for Europe.");
        e.cycle_intl_eu_focal.focus(); return false;}	
	
        if(e.cycle_intl_me[1].checked && e.cycle_intl_me_focal.value=="") {alert("Section 2: Compensation Cycles\nPlease select the Focal month for Middle East/Africa.");
        e.cycle_intl_me_focal.focus(); return false;}}		

      if (country_ops_total==1 && e.country_ops[20].checked){
        if(!(e.cycle_us_exec[0].checked || e.cycle_us_exec[1].checked)){       
        alert("Section 2: Compensation Cycles\nPlease answer all questions under Compensation Cycles for US Locations.");
        e.cycle_us_exec[0].focus(); return false; }

        if(e.cycle_intl_amer[1].checked && e.cycle_intl_amer_focal.value=="") {alert("Section 2: Compensation Cycles\nPlease select the Focal month for The Americas \(excluding US\).");
        e.cycle_intl_amer_focal.focus(); return false;}	
	
        if(e.cycle_intl_ap[1].checked && e.cycle_intl_ap_focal.value=="") {alert("Section 2: Compensation Cycles\nPlease select the Focal month for Asia/Pacific.");
        e.cycle_intl_ap_focal.focus(); return false;}	

        if(e.cycle_intl_eu[1].checked && e.cycle_intl_eu_focal.value=="") {alert("Section 2: Compensation Cycles\nPlease select the Focal month for Europe.");
        e.cycle_intl_eu_focal.focus(); return false;}	
	
        if(e.cycle_intl_me[1].checked && e.cycle_intl_me_focal.value=="") {alert("Section 2: Compensation Cycles\nPlease select the Focal month for Middle East/Africa.");
        e.cycle_intl_me_focal.focus(); return false;}}		
	}

	
 /* var country_ops_boxes = false;
  for (i = 0; i < e.country_ops.length; i++) {
  if (e.country_ops[i].checked) country_ops_boxes = true; }
  if (!country_ops_boxes) { alert("Please specify what country your company has operations in Section 4.");
  e.country_ops[0].focus(); return false; }
*/  

/* CONTACT 1 */  

  if (e.name_c1.value==''){ alert("Section 4: Contact 1\nPlease enter contact name.");
    e.name_c1.focus(); return false;  }

  if (e.title_c1.value=='')  { alert("Section 4: Contact 1\nPlease enter contact title.");
    e.title_c1.focus(); return false;  }

  if (!emailfilter.test(e.email_c1.value)){ alert("Section 4: Contact 1\nPlease enter contact e-mail address.")
    e.email_c1.focus();  return false; }      

  if (e.phone_c1.value==''){ alert("Section 4: Contact 1\nPlease enter contact's phone number.");
    e.phone_c1.focus(); return false;  }

  if(!e.address_c1_same.checked){ 
    if(e.address1_c1.value==""){alert("Section 4: Contact 1\nPlease enter the street address.");
    e.address1_c1.focus(); return false;}
	
    if(e.city_c1.value==""){alert("Section 4: Contact 1\nPlease enter the city.");
	e.city_c1.focus(); return false;}
	
    if(e.state_c1.value==""){alert("Section 4: Contact 1\nPlease enter the state/province.");
	e.state_c1.focus(); return false;}
	
    if(e.zip_c1.value==""){alert("Section 4: Contact 1\nPlease enter the zip/postal code.");
	e.zip_c1.focus(); return false;}

    if(e.country_c1.value==""){alert("Section 4: Contact 1\nPlease select a country from the dropdown list.");
	e.country_c1.focus(); return false;}} 	

  var renewalBoxes = "";
  for (i = 0; i < e.renewal.length; i++) {
  if (e.renewal[i].checked) {renewalBoxes ++ }}
  if (renewalBoxes!==1) { alert("Section 4:\nPlease select one Renewal Contact.");
  e.renewal[0].focus(); return false; }

  var primaryBoxes = "";
  for (i = 0; i < e.primary.length; i++) {
  if (e.primary[i].checked) {primaryBoxes ++ }}
  if (primaryBoxes!==1) { alert("Section 4:\nPlease select one Network Primary Contact.");
  e.primary[0].focus(); return false; }
  
  if (e.survey[0].checked){
    var bcrBoxes = "";
    for (i = 0; i < e.s_primary_bcr.length; i++) {
    if (e.s_primary_bcr[i].checked) {bcrBoxes ++ }}
    if (bcrBoxes!==1) { alert("Section 4:\nPlease select one Survey Primary Contact for the Radford Benchmark Survey.");
    e.s_primary_bcr[0].focus(); return false; }}
	
  if (e.survey[1].checked){
    var ecrBoxes = "";
    for (i = 0; i < e.s_primary_ecr.length; i++) {
    if (e.s_primary_ecr[i].checked) {ecrBoxes ++ }}
    if (ecrBoxes!==1) { alert("Section 4:\nPlease select one Survey Primary Contact for the Radford Executive Survey.");
    e.s_primary_ecr[0].focus(); return false; }}	
	
  if (e.survey[2].checked){
    var scrBoxes = "";
    for (i = 0; i < e.s_primary_scr.length; i++) {
    if (e.s_primary_scr[i].checked) {scrBoxes ++ }}
    if (scrBoxes!==1) { alert("Section 4:\nPlease select one Survey Primary Contact for the Radford Sales Survey.");
    e.s_primary_scr[0].focus(); return false; }}	

  if (e.survey[3].checked){
    var rbsBoxes = "";
    for (i = 0; i < e.s_primary_rbs.length; i++) {
    if (e.s_primary_rbs[i].checked) {rbsBoxes ++ }}
    if (rbsBoxes!==1) { alert("Section 4:\nPlease select one Survey Primary Contact for the Radford Benefits Survey.");
    e.s_primary_rbs[0].focus(); return false; }}	
	

  if (e.survey[4].checked){
    var glsBoxes = "";
    for (i = 0; i < e.s_primary_gls.length; i++) {
    if (e.s_primary_gls[i].checked) {glsBoxes ++ }}
    if (glsBoxes!==1) { alert("Section 4:\nPlease select one Survey Primary Contact for the Radford Global Life Sciences Survey.");
    e.s_primary_gls[0].focus(); return false; }}	
	

  if (e.survey[5].checked){
    var intlBoxes = "";
    for (i = 0; i < e.s_primary_intl.length; i++) {
    if (e.s_primary_intl[i].checked) {intlBoxes ++ }}
    if (intlBoxes!==1) { alert("Section 4:\nPlease select one Survey Primary Contact for the Radford International Survey.");
    e.s_primary_intl[0].focus(); return false; }}	

	
/* CONTACT 2 */
  
  if(e.nw_add_2.checked && e.name_c2.value==''){ alert("Section 4: Contact 2\nPlease enter contact name.");
    e.name_c2.focus(); return false; }

  if (e.nw_add_2.checked && e.title_c2.value=='')  { alert("Section 4: Contact 2\nPlease enter contact title.");
    e.title_c2.focus(); return false;  }

  if (e.nw_add_2.checked && !emailfilter.test(e.email_c2.value)){ alert("Section 4: Contact 2\nPlease enter contact e-mail address.")
    e.email_c2.focus();  return false; }      

  if (e.nw_add_2.checked && e.phone_c2.value==''){ alert("Section 4: Contact 2\nPlease enter contact's phone number.");
    e.phone_c2.focus(); return false;  }

  if(e.nw_add_2.checked && !e.address_c2_same.checked){ 
    if(e.address1_c2.value==""){alert("Section 4: Contact 2\nPlease enter the street address.");
    e.address1_c2.focus(); return false;}
	
	if(e.city_c2.value==""){alert("Section 4: Contact 2\nPlease enter the city.");
	e.city_c2.focus(); return false;}

    if(e.state_c2.value==""){alert("Section 4: Contact 2\nPlease enter the state/province.");
	e.state_c2.focus(); return false;}
	
    if(e.zip_c2.value==""){alert("Section 4: Contact 2\nPlease enter the zip/postal code.");
	e.zip_c2.focus(); return false;}	

    if(e.country_c2.value==""){alert("Section 4: Contact 2\nPlease select a country from the dropdown list.");
	e.country_c2.focus(); return false;}} 


/* CONTACT 3 */
  
  if(e.nw_add_3.checked && e.name_c3.value==''){ alert("Section 4: Contact 3\nPlease enter contact name.");
    e.name_c3.focus(); return false; }

  if (e.nw_add_3.checked && e.title_c3.value=='')  { alert("Section 4: Contact 3\nPlease enter contact title.");
    e.title_c3.focus(); return false;  }

  if (e.nw_add_3.checked && !emailfilter.test(e.email_c3.value)){ alert("Section 4: Contact 3\nPlease enter contact e-mail address.")
    e.email_c3.focus();  return false; }      

  if (e.nw_add_3.checked && e.phone_c3.value==''){ alert("Section 4: Contact 3\nPlease enter contact's phone number.");
    e.phone_c3.focus(); return false;  }

  if(e.nw_add_3.checked && !e.address_c3_same.checked){ 
    if(e.address1_c3.value==""){alert("Section 4: Contact 3\nPlease enter the street address.");
    e.address1_c3.focus(); return false;}
	
	if(e.city_c3.value==""){alert("Section 4: Contact 3\nPlease enter the city.");
	e.city_c3.focus(); return false;}

    if(e.state_c3.value==""){alert("Section 4: Contact 3\nPlease enter the state/province.");
	e.state_c3.focus(); return false;}
	
    if(e.zip_c3.value==""){alert("Section 4: Contact 3\nPlease enter the zip/postal code.");
	e.zip_c3.focus(); return false;}	

    if(e.country_c3.value==""){alert("Section 4: Contact 3\nPlease select a country from the dropdown list.");
	e.country_c3.focus(); return false;}} 


/* CONTACT 4 */
  
  if(e.nw_add_4.checked && e.name_c4.value==''){ alert("Section 4: Contact 4\nPlease enter contact name.");
    e.name_c4.focus(); return false; }

  if (e.nw_add_4.checked && e.title_c4.value=='')  { alert("Section 4: Contact 4\nPlease enter contact title.");
    e.title_c4.focus(); return false;  }

  if (e.nw_add_4.checked && !emailfilter.test(e.email_c4.value)){ alert("Section 4: Contact 4\nPlease enter contact e-mail address.")
    e.email_c4.focus();  return false; }      

  if (e.nw_add_4.checked && e.phone_c4.value==''){ alert("Section 4: Contact 4\nPlease enter contact's phone number.");
    e.phone_c4.focus(); return false;  }

  if(e.nw_add_4.checked && !e.address_c4_same.checked){ 
    if(e.address1_c4.value==""){alert("Section 4: Contact 4\nPlease enter the street address.");
    e.address1_c4.focus(); return false;}
	
	if(e.city_c4.value==""){alert("Section 4: Contact 4\nPlease enter the city.");
	e.city_c4.focus(); return false;}

    if(e.state_c4.value==""){alert("Section 4: Contact 4\nPlease enter the state/province.");
	e.state_c4.focus(); return false;}
	
    if(e.zip_c4.value==""){alert("Section 4: Contact 4\nPlease enter the zip/postal code.");
	e.zip_c4.focus(); return false;}	

    if(e.country_c4.value==""){alert("Section 4: Contact 4\nPlease select a country from the dropdown list.");
	e.country_c4.focus(); return false;}} 


/* CONTACT 5 */
  
  if(e.nw_add_5.checked && e.name_c5.value==''){ alert("Section 5: Contact 5\nPlease enter contact name.");
    e.name_c5.focus(); return false; }

  if (e.nw_add_5.checked && e.title_c5.value=='')  { alert("Section 5: Contact 5\nPlease enter contact title.");
    e.title_c5.focus(); return false;  }

  if (e.nw_add_5.checked && !emailfilter.test(e.email_c5.value)){ alert("Section 5: Contact 5\nPlease enter contact e-mail address.")
    e.email_c5.focus();  return false; }      

  if (e.nw_add_5.checked && e.phone_c5.value==''){ alert("Section 5: Contact 5\nPlease enter contact's phone number.");
    e.phone_c5.focus(); return false;  }

  if(e.nw_add_5.checked && !e.address_c5_same.checked){ 
    if(e.address1_c5.value==""){alert("Section 5: Contact 5\nPlease enter the street address.");
    e.address1_c5.focus(); return false;}
	
	if(e.city_c5.value==""){alert("Section 5: Contact 5\nPlease enter the city.");
	e.city_c5.focus(); return false;}

    if(e.state_c5.value==""){alert("Section 5: Contact 5\nPlease enter the state/province.");
	e.state_c5.focus(); return false;}
	
    if(e.zip_c5.value==""){alert("Section 5: Contact 5\nPlease enter the zip/postal code.");
	e.zip_c5.focus(); return false;}	

    if(e.country_c5.value==""){alert("Section 5: Contact 5\nPlease select a country from the dropdown list.");
	e.country_c5.focus(); return false;}} 


/* CONTACT 6 */
  
  if(e.nw_add_6.checked && e.name_c6.value==''){ alert("Section 6: Contact 6\nPlease enter contact name.");
    e.name_c6.focus(); return false; }

  if (e.nw_add_6.checked && e.title_c6.value=='')  { alert("Section 6: Contact 6\nPlease enter contact title.");
    e.title_c6.focus(); return false;  }

  if (e.nw_add_6.checked && !emailfilter.test(e.email_c6.value)){ alert("Section 6: Contact 6\nPlease enter contact e-mail address.")
    e.email_c6.focus();  return false; }      

  if (e.nw_add_6.checked && e.phone_c6.value==''){ alert("Section 6: Contact 6\nPlease enter contact's phone number.");
    e.phone_c6.focus(); return false;  }

  if(e.nw_add_6.checked && !e.address_c6_same.checked){ 
    if(e.address1_c6.value==""){alert("Section 6: Contact 6\nPlease enter the street address.");
    e.address1_c6.focus(); return false;}
	
	if(e.city_c6.value==""){alert("Section 6: Contact 6\nPlease enter the city.");
	e.city_c6.focus(); return false;}

    if(e.state_c6.value==""){alert("Section 6: Contact 6\nPlease enter the state/province.");
	e.state_c6.focus(); return false;}
	
    if(e.zip_c6.value==""){alert("Section 6: Contact 6\nPlease enter the zip/postal code.");
	e.zip_c6.focus(); return false;}	

    if(e.country_c6.value==""){alert("Section 6: Contact 6\nPlease select a country from the dropdown list.");
	e.country_c6.focus(); return false;}} 

  document.getElementById("part_BCR_chk").disabled=false;
  document.getElementById("part_ECR_chk").disabled=false;
  document.getElementById("part_BCR_Combo_chk").disabled=false;
  document.getElementById("part_BCR_Combo2_chk").disabled=false;
  document.getElementById("part_BCR_Combo3_chk").disabled=false;
  document.getElementById("part_SCR_chk").disabled=false;
  document.getElementById("part_SCR_Combo_chk").disabled=false;
  document.getElementById("part_RBS_chk").disabled=false;
  document.getElementById("part_GLS_chk").disabled=false;
  document.getElementById("part_INTL_chk").disabled=false;

return true;}

function en_cost(){
  for(i=0; i<document.edocs.survey.length; i++){
  if(document.edocs.survey[i].checked){
  document.getElementById("part_notify").style.display="none"; 
  document.getElementById("access_notify").style.display="none";   }}
  
  if (document.edocs.survey[0].checked){
  document.getElementById("part_BCR").style.display="";
  document.getElementById("part_BCR_chk").checked=true;
  document.getElementById("access_BCR").style.display=""; }
  
  else {
  document.getElementById("part_BCR").style.display="none";
  document.getElementById("part_BCR_Combo").style.display="none";
  document.getElementById("part_BCR_Combo2").style.display="none";
  document.getElementById("part_BCR_Combo3").style.display="none";  
  document.getElementById("part_SCR_Combo").style.display="none";
  document.getElementById("part_BCR_chk").checked=false;
  document.getElementById("part_BCR_Combo_chk").checked=false;
  document.getElementById("part_BCR_Combo2_chk").checked=false;
  document.getElementById("part_BCR_Combo3_chk").checked=false;
  document.getElementById("part_SCR_Combo_chk").checked=false;
  
  document.getElementById("access_BCR").style.display="none";
  document.getElementById("access_BCR_Combo").style.display="none"; }  

  if (document.edocs.survey[1].checked){
  document.getElementById("part_ECR").style.display="";
  document.getElementById("part_ECR_chk").checked=true;
  document.getElementById("access_ECR").style.display="";  }
  
  else {
  document.getElementById("part_ECR").style.display="none";
  document.getElementById("part_BCR_Combo").style.display="none";
  document.getElementById("part_SCR_Combo").style.display="none";
  document.getElementById("part_BCR_Combo3").style.display="none";
  document.getElementById("part_ECR_chk").checked=false;
  document.getElementById("part_BCR_Combo_chk").checked=false;
  document.getElementById("part_SCR_Combo_chk").checked=false;
  document.getElementById("part_BCR_Combo3_chk").checked=false;
  
  document.getElementById("access_ECR").style.display="none";
  document.getElementById("access_BCR_Combo").style.display="none";}
  
  if (document.edocs.survey[0].checked && document.edocs.survey[1].checked ){
  document.getElementById("part_BCR").style.display="none";
  document.getElementById("part_ECR").style.display="none"; 
  document.getElementById("part_BCR_Combo").style.display="";
  document.getElementById("part_BCR_chk").checked=false;
  document.getElementById("part_ECR_chk").checked=false;
  document.getElementById("part_BCR_Combo_chk").checked=true;

  document.getElementById("access_BCR").style.display="none";
  document.getElementById("access_ECR").style.display="none"; 
  document.getElementById("access_BCR_Combo").style.display="";  }  

  if (document.edocs.survey[2].checked){
  document.getElementById("part_SCR").style.display="";
  document.getElementById("part_SCR_chk").checked=true;
  document.getElementById("access_SCR").style.display=""; 
  document.getElementById("access_SCR_Custom").style.display="";  }
  
  else {
  document.getElementById("part_SCR").style.display="none";
  document.getElementById("part_SCR_Combo").style.display="none";
  document.getElementById("part_SCR_chk").checked=false;
  document.getElementById("part_SCR_Combo_chk").checked=false;
  document.getElementById("access_SCR").style.display="none"; 
  document.getElementById("access_SCR_Custom").style.display="none";    }

  if ((document.edocs.survey[2].checked && document.edocs.survey[0].checked && document.edocs.survey[1].checked)|| (document.edocs.survey[2].checked && document.edocs.survey[4].checked)){
  document.getElementById("part_SCR").style.display="none";
  document.getElementById("part_SCR_Combo").style.display="";
  document.getElementById("part_SCR_chk").checked=false;
  document.getElementById("part_SCR_Combo_chk").checked=true;}
  
  if (document.edocs.survey[3].checked){
  document.getElementById("part_RBS").style.display="";
  document.getElementById("part_RBS_chk").checked=true;
  document.getElementById("access_RBS").style.display="";
  document.getElementById("access_RBS_Custom").style.display="";  }
  
  else {
  document.getElementById("part_RBS").style.display="none";
  document.getElementById("part_RBS_chk").checked=false;
  document.getElementById("access_RBS").style.display="none";
  document.getElementById("access_RBS_Custom").style.display="none";   }  
  
  if (document.edocs.survey[4].checked){
  document.getElementById("part_GLS").style.display="";
  document.getElementById("part_GLS_chk").checked=true;
  document.getElementById("access_GLS").style.display="";  }
  
  else {
  document.getElementById("part_GLS").style.display="none";
  document.getElementById("part_BCR_Combo2").style.display="none"; 
  document.getElementById("part_BCR_Combo3").style.display="none";    
  document.getElementById("part_GLS_chk").checked=false;
  document.getElementById("part_BCR_Combo2_chk").checked=false;
  document.getElementById("part_BCR_Combo3_chk").checked=false;
  document.getElementById("access_GLS").style.display="none"; }

  if (document.edocs.survey[0].checked && document.edocs.survey[4].checked ){
  document.getElementById("part_BCR").style.display="none";
  document.getElementById("part_BCR_Combo2").style.display="";
  document.getElementById("part_BCR_chk").checked=false;
  document.getElementById("part_BCR_Combo2_chk").checked=true;  }  

  if (document.edocs.survey[0].checked && document.edocs.survey[1].checked && document.edocs.survey[4].checked ){
  document.getElementById("part_BCR").style.display="none";
  document.getElementById("part_ECR").style.display="none"; 
  document.getElementById("part_BCR_Combo").style.display="none";
  document.getElementById("part_BCR_Combo2").style.display="none";  
  document.getElementById("part_BCR_Combo3").style.display="";
  document.getElementById("part_BCR_chk").checked=false;
  document.getElementById("part_ECR_chk").checked=false;
  document.getElementById("part_BCR_Combo_chk").checked=false;
  document.getElementById("part_BCR_Combo2_chk").checked=false;
  document.getElementById("part_BCR_Combo3_chk").checked=true;
  
  document.getElementById("access_BCR").style.display="none";
  document.getElementById("access_ECR").style.display="none"; 
  document.getElementById("access_BCR_Combo").style.display="";   } 
  
  if (document.edocs.survey[5].checked){
  document.getElementById("part_INTL").style.display="";
  document.getElementById("part_INTL_chk").checked=true;
  document.getElementById("access_INTL").style.display="";  }
  
  else {
  document.getElementById("part_INTL").style.display="none";
  document.getElementById("part_INTL_chk").checked=false;
  document.getElementById("access_INTL").style.display="none";  }   
  }

function en_SCR(){ 
  if (document.edocs.immediate_access[3].checked){
  document.edocs.immediate_access[4].disabled=false;  }
  if (!document.edocs.immediate_access[3].checked){
  document.edocs.immediate_access[4].checked=false;  
  document.edocs.immediate_access[4].disabled=true; }}

function en_RBS(){ 
  if (document.edocs.immediate_access[5].checked){
  document.edocs.immediate_access[6].disabled=false;  }
  if (!document.edocs.immediate_access[5].checked){
  document.edocs.immediate_access[6].checked=false;  
  document.edocs.immediate_access[6].disabled=true; }}
  
function en_org(){ 
  if (document.edocs.org_type.value=="Independent Coporation"){
  document.getElementById("parent_co").style.display="none";
  document.edocs.parent_company.value="";}
  else { 
  document.getElementById("parent_co").style.display="inline";}}
  
function en_pub(){ 
  if (document.edocs.ownership.value.indexOf("Public")>-1){
  document.getElementById("public_co").style.display="inline";}
  else { 
  document.getElementById("public_co").style.display="none";
  document.edocs.stock_symbol.value="";}}

function clear_val(el,val){
  if (el.value==val) 
    el.value="";}

function clear_us_cycle(){
  document.edocs.cycle_us_exec[0].checked = false;
  document.edocs.cycle_us_exec[1].checked = false;
  document.edocs.cycle_us_mgmt[0].checked = false;
  document.edocs.cycle_us_mgmt[1].checked = false;
  document.edocs.cycle_us_indPro[0].checked = false;
  document.edocs.cycle_us_indPro[1].checked = false;
  document.edocs.cycle_us_indSpp[0].checked = false;
  document.edocs.cycle_us_indSpp[1].checked = false; 
  document.edocs.cycle_us_sales[0].checked = false;
  document.edocs.cycle_us_sales[1].checked = false;   }

function clear_intl_cycle(){
  document.edocs.cycle_intl_amer[0].checked = false;
  document.edocs.cycle_intl_amer[1].checked = false;
  document.edocs.cycle_intl_ap[0].checked = false;
  document.edocs.cycle_intl_ap[1].checked = false;
  document.edocs.cycle_intl_eu[0].checked = false;
  document.edocs.cycle_intl_eu[1].checked = false;
  document.edocs.cycle_intl_me[0].checked = false;
  document.edocs.cycle_intl_me[1].checked = false;  }  

function checkAll(theForm, cName, allNo_stat) {
var n=theForm.elements.length;
for (var i=0;i<n;i++){
if (theForm.elements[i].className.indexOf(cName) !=-1){
if (allNo_stat.checked) {
theForm.elements[i].checked = true;
} else {
theForm.elements[i].checked = false;}}}}

function uncheckAll(theForm, cName, allNo_stat) {
var n=theForm.elements.length;
for (var i=0;i<n;i++){
if (theForm.elements[i].className.indexOf(cName) !=-1){
theForm.elements[i].checked = false;}}}

function hide(id){ document.getElementById(id).style.display ="none";}

function unhide(id){ 
  if (document.getElementById(id).style.display =="none"){
  document.getElementById(id).style.display ="";}
  else {document.getElementById(id).style.display = "none";}}
  
function enable(id){document.getElementById(id).disabled = false;}
function disable(id){
  document.getElementById(id).value = "";
  document.getElementById(id).disabled = true;}
  
function isNum(theF){
  var ct, i
  var myValue;
  if (theF.value=="") 
  { return false; }
  ct = 0
  myValue = spaceTrim(theF.value)
  for (i = 0; i < myValue.length; i++)   {
    if ((myValue.substring(i,i+1) != "0") &&
        (myValue.substring(i,i+1) != "1") &&
        (myValue.substring(i,i+1) != "2") &&
        (myValue.substring(i,i+1) != "3") &&
        (myValue.substring(i,i+1) != "4") &&
        (myValue.substring(i,i+1) != "5") &&
        (myValue.substring(i,i+1) != "6") &&
        (myValue.substring(i,i+1) != "7") &&
        (myValue.substring(i,i+1) != "8") &&
        (myValue.substring(i,i+1) != "9") &&
        (myValue.substring(i,i+1) != "-") &&
        (myValue.substring(i,i+1) != ",") &&
        (myValue.substring(i,i+1) != "."))
    {
      alert("Please enter numeric value only.");  
      theF.value="";
      return false; }
    else if (myValue.substring(i, i+1) == ".") {
      ct = ct + 1;
      if (ct > 1) {
        alert("Please enter numeric only.");  
        theF.value="";
        return false; } }
    else if ((myValue.substring(i, i+1) == "-") &&  (i > 0))    {
      alert("Please enter numeric only.");  
      theF.value="";
      return false; } }
  return true;}

	function spaceTrim(InString) 	{
    	var LoopCtrl=true;
    	while (LoopCtrl) {
      		if (InString.indexOf("  ") != -1){
        		Temp = InString.substring(0, InString.indexOf("  "))
        		InString = Temp + InString.substring(InString.indexOf("  ")+1, InString.length)} 
			else {
        		LoopCtrl = false;}}
    	if (InString.substring(0, 1) == " ")
      		InString = InString.substring(1, InString.length)
    	if (InString.substring (InString.length-1) == " ")
    		InString = InString.substring(0, InString.length-1)
    	return (InString)  	}
  
function primary_chk(id1, id2, id3){
  if (document.getElementById(id1).checked == true)  {
    document.getElementById(id2).checked = true;
    document.getElementById(id2).disabled = true;
    document.getElementById(id3).checked = false;
    document.getElementById(id3).disabled = true;  }
  else  {
    document.getElementById(id2).checked = false;
    document.getElementById(id2).disabled = false;
    document.getElementById(id3).disabled = false;  }}

function access_chk(id2, id3){
  if (document.getElementById(id2).checked == true)  {
    document.getElementById(id3).checked = false;
    document.getElementById(id3).disabled = true;  }
  else  {
    document.getElementById(id3).disabled = false;  }}

function country_chk(id){
  if(document.getElementById(id).checked == false){
  document.getElementById(id).checked = true;}}  
