 // JavaScript Document

<!-- Java Scripts -->

//=========== MM_openBrWindow =============================================

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}  

//=========== MM_reloadPage ============================================

function MM_reloadPage(init) 
{  //reloads the window if Nav4 resized
  	if (init==true) with (navigator) 
	{
		if ((appName=="Netscape")&&(parseInt(appVersion)==4))
	 	{
    		document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage;
		}
	}
  	else
	{ 
		if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH)
		{
			location.reload();
		}
	}
}
MM_reloadPage(true);

//=========== os_change =============================================

function os_change(value)
{
	if(value=="")
	{
		document.all.div_layer2.style.visibility = "visible";
		document.frm.os_version.disabled=true;
		document.frm.os_etc.value="Please Type-In here.";
	}
}

//========= del_value ============================================

function del_value(focus)
{
	var chk = eval("document.frm." + focus);
	chk.value="";
}

//======== chk_reset ==============================================

function chk_reset(frm)
{
	var frm = document.frm;
	frm.reset();
}

//======= chk_radio ==========================================

var contrib;
var contrib_to;
var contrib_pay;
var contrib_reg;
function chk_radio2(frm_Join_Us)
{
	var frm = document.frm_Join_Us;
	var length = "0";
	contrib = "0";
	contrib_to = "0";
	contrib_pay = "0";
	contrib_reg = "0";
	
	length = frm.y_pay.length;
	for (i=0; i<length; i++)
	{
		if (frm.y_pay[i].checked==true)
		{
			contrib=i+1;
			break; //exist for loop, as target acquired.
		}
	}
	length = frm.y_pay_to.length;
	for (i=0; i<length; i++)
	{
		if (frm.y_pay_to[i].checked==true)
		{
			contrib_to=i+1;
			break; //exist for loop, as target acquired.
		}
	}
	length = frm.y_pay_type.length;
	for (i=0; i<length; i++)
	{
		if (frm.y_pay_type[i].checked==true)
		{
			contrib_pay=i+1;
			break; //exist for loop, as target acquired.
		}
	}
	length = frm.y_reg_type.length;
	for (i=0; i<length; i++)
	{
		if (frm.y_reg_type[i].checked==true)
		{
			contrib_reg=i+1;
			break; //exist for loop, as target acquired.
		}
	}
}

//========== chk_submit_Join_Us ================================

var loop = "0";
var loop2 = "0";
var loop3 = "0";
function chk_submit_Join_Us(frm_Join_Us)
{
	var frm = document.frm_Join_Us;
	if (frm.y_first.value=="")
	{
		alert("Your First Name is required.");
		frm.y_first.focus();
		return false;
	}
	if (frm.y_last.value=="")
	{
		alert("Your Last Name is required.");
		frm.y_last.focus();
		return false;
	}
	if ((frm.y_first2.value!="") || (frm.y_last2.value1!=""))
	{
		if ((frm.y_first2.value=="") && (frm.y_last2.value!=""))
		{
			alert("The second First Name must be \ngiven with the second Last Name.");
			frm.y_last2.focus();
			return false;
		}
		if ((frm.y_first2.value!="") && (frm.y_last2.value==""))
		{
			alert("The second Last Name must be \ngiven with the second First Name.");
			frm.y_last2.focus();
			return false;
		}
	}
	if (frm.y_addr.value=="")
	{
		alert("Your Address is required.");
		frm.y_addr.focus();
		return false;
	}
	if (frm.y_city.value=="")
	{
		alert("Your City is required.");
		frm.y_city.focus();
		return false;
	}
	if (frm.y_state.value=="")
	{
		alert("Your State is required.");
		frm.y_state.focus();
		return false;
	}
	if (frm.y_zip.value=="")
	{
		alert("Your Zip Code is required.");
		frm.y_zip.focus();
		return false;
	}
	else
	{
		if (frm.y_zip.value!="")
		{
			var zipFilter = /^\d{5}$/;
			var strng = frm.y_zip.value;
			if (!(zipFilter.test(strng)))
      		{ 
	  			alert("The Zip Code format is not correct.");
        		frm.y_zip.focus();
        		return false;
      		}
 		}
	}
	if (frm.y_email.value=="")
	{
		alert("Your Email address is required.");
		frm.y_email.focus();
		return false;
	}
	else
	{
		var emailFilter=/^.+@.+\..{2,3}$/;
    	var illegalChars= /[\(\)\<\>\,\;\:\\\/\"\[\]\*]/;
      	var strng = frm.y_email.value;
      	if (!(emailFilter.test(strng)))
      	{ 
	  		alert("You have entered an invalid Email address.");
        	frm.y_email.focus();
        	return false;
      	}
      	if (strng.match(illegalChars))
      	{ 
	  		alert("Your Email address contains invalid characters.");
        	frm.y_email.focus();
        	return false;
      	}
	}
	
	if (frm.y_phone.value!="")
	{
		var phoneFilter = /^\d{3}\-\d{3}\-\d{4}$/;
		var strng = frm.y_phone.value;
		if (!(phoneFilter.test(strng)))
      	{ 
	  		alert("Your Phone format is not correct.");
        	frm.y_phone.focus();
        	return false;
      	}
 	}
	if (frm.y_bus_phone.value!="")
	{
		var bus_phoneFilter = /^\d{3}\-\d{3}\-\d{4}$/;
		var strng = frm.y_bus_phone.value;
		if (!(bus_phoneFilter.test(strng)))
      	{ 
	  		alert("Your Business Phone format is not correct.");
        	frm.y_bus_phone.focus();
        	return false;
      	}
 	}
	if (frm.y_cell.value!="")
	{
		var cell_phoneFilter = /^\d{3}\-\d{3}\-\d{4}$/;
		var strng = frm.y_cell.value;
		if (!(cell_phoneFilter.test(strng)))
      	{ 
	  		alert("Your Cell Phone format is not correct.");
        	frm.y_cell.focus();
        	return false;
      	}
 	}
	//var checked = false;
	chk_radio2();
	var agree;
	if (loop != contrib_reg)
	{
		if (frm.y_reg_type[contrib_reg-1].value!="0")
		{
			if (!(agree = confirm("Is registration type ["+ frm.y_reg_type[contrib_reg-1].value +"] correct? \nOtherwise, click on Cancel and try again.")))
			{
				return false;
			}
			else
			{
				loop = contrib_reg;
			}
		}
	}
	if (loop2 != contrib)
	{
		if (frm.y_pay[contrib-1].value!="0")
		{
			if (!(agree = confirm("Is a contribution of [$"+ frm.y_pay[contrib-1].value +".00] correct? \nOtherwise, click on Cancel and try again.")))
			{
				return false;
			}
			else
			{
				loop2 = contrib;
			}
		}
		else
		{
			if (frm.y_pay_other.value=="")
			{
				alert("Please enter a dollar amount.");
				frm.y_pay_other.focus();
				return false;
			}
			else
			{
				if (!(agree = confirm("Is a contribution of [$"+ frm.y_pay_other.value +".00] correct? \nOtherwise, click on Cancel and try again.")))
				{
					return false;
				}
				else
				{
					loop2 = contrib;
				}
			}
		}
	}
	if (loop3 != contrib_to)
	{
		if (!(agree = confirm("Is a contribution to ["+ frm.y_pay_to[contrib_to-1].value +"] correct? \nOtherwise, click on Cancel and try again.")))
		{
			return false;
		}
		else
		{
			loop3 = contrib_to;
		}
	}
	if (!(agree = confirm("Is ["+ frm.y_pay_type[contrib_pay-1].value +"] payment method correct? \nOtherwise, click on Cancel and try again.")))
	{
		return false;
	}
	if (frm.y_pay_type[contrib_pay-1].value == "On-line")
	{
		//frm.action="./Construct.php";
		frm.action="./JoinUs_send.php";
	}
	else
	{
		frm.action="./JoinUs_send.php";
	}
	frm.submit();
}

//=========== goto_page =============================================

function goto_Home(JoinUs_send_frm)
{
	var frm = document.JoinUs_send_frm;
	frm.action="./index.html";
	frm.submit();
}

//=========== chk_submit =============================================

function chk_submit(frm)
{
	var frm = document.frm;
	if (frm.y_name.value=="")
	{
		alert("Your Name is required");
		frm.y_name.focus();
		return false;
	}
	if (frm.y_zip.value!="")
	{
		var zipFilter = /^\d{5}$/;
		var strng = frm.y_zip.value;
		if (!(zipFilter.test(strng)))
      	{ 
	  		alert("The Zip Code format is not correct.");
        	frm.y_zip.focus();
        	return false;
      	}
 	}
	if (frm.y_email.value=="")
	{
		alert("Your Email address is required");
		frm.y_email.focus();
		return false;
	}
	else
	{
		var emailFilter=/^.+@.+\..{2,3}$/;
    	var illegalChars= /[\(\)\<\>\,\;\:\\\/\"\[\]\*]/;
      	var strng = frm.y_email.value;
      	if (!(emailFilter.test(strng)))
      	{ 
	  		alert("You have entered an invalid Email address.");
        	frm.y_email.focus();
        	return false;
      	}
      	if (strng.match(illegalChars))
      	{ 
	  		alert("Your Email address contains invalid characters.");
        	frm.y_email.focus();
        	return false;
      	}
	}
	if (frm.y_phone.value!="")
	{
		var phoneFilter = /^\d{3}\-\d{3}\-\d{4}$/;
		var strng = frm.y_phone.value;
		if (!(phoneFilter.test(strng)))
      	{ 
	  		alert("The Phone format is not correct.");
        	frm.y_phone.focus();
        	return false;
      	}
 	}
	frm.action="./ContactUs_send.php";
	frm.submit();
}

//======= donation chk_radio ==========================================

var contrib;
var contrib_to;
var contrib_pay;
var contrib_reg;
function chk_radio(frm_Donation)
{
	var frm = document.frm_Donation;
	var length = "0";
	contrib = "1";
	contrib_to = "0";
	contrib_pay = "0";
	contrib_reg = "0";
	
	length = frm.y_pay_to.length;
	for (i=0; i<length; i++)
	{
		if (frm.y_pay_to[i].checked==true)
		{
			contrib_to=i+1;
			break; //exist for loop, as target acquired.
		}
	}
	length = frm.y_pay_type.length;
	for (i=0; i<length; i++)
	{
		if (frm.y_pay_type[i].checked==true)
		{
			contrib_pay=i+1;
			break; //exist for loop, as target acquired.
		}
	}
}

<!--=========================================== Donation =======================================-->

//========== chk_submit_Donation ================================

var loop = "0";
var loop2 = "0";
var loop3 = "0";
function chk_submit_Donation(frm_Donation)
{
	var frm = document.frm_Donation;
	if (frm.y_first.value=="")
	{
		alert("Your First Name is required.");
		frm.y_first.focus();
		return false;
	}
	if (frm.y_last.value=="")
	{
		alert("Your Last Name is required.");
		frm.y_last.focus();
		return false;
	}
	if ((frm.y_first2.value!="") || (frm.y_last2.value1!=""))
	{
		if ((frm.y_first2.value=="") && (frm.y_last2.value!=""))
		{
			alert("The second First Name must be \ngiven with the second Last Name.");
			frm.y_last2.focus();
			return false;
		}
		if ((frm.y_first2.value!="") && (frm.y_last2.value==""))
		{
			alert("The second Last Name must be \ngiven with the second First Name.");
			frm.y_last2.focus();
			return false;
		}
	}
	if (frm.y_addr.value=="")
	{
		alert("Your Address is required.");
		frm.y_addr.focus();
		return false;
	}
	if (frm.y_city.value=="")
	{
		alert("Your City is required.");
		frm.y_city.focus();
		return false;
	}
	if (frm.y_state.value=="")
	{
		alert("Your State is required.");
		frm.y_state.focus();
		return false;
	}
	if (frm.y_zip.value=="")
	{
		alert("Your Zip Code is required.");
		frm.y_zip.focus();
		return false;
	}
	else
	{
		if (frm.y_zip.value!="")
		{
			var zipFilter = /^\d{5}$/;
			var strng = frm.y_zip.value;
			if (!(zipFilter.test(strng)))
      		{ 
	  			alert("The Zip Code format is not correct.");
        		frm.y_zip.focus();
        		return false;
      		}
 		}
	}
	if (frm.y_email.value=="")
	{
		alert("Your Email address is required.");
		frm.y_email.focus();
		return false;
	}
	else
	{
		var emailFilter=/^.+@.+\..{2,3}$/;
    	var illegalChars= /[\(\)\<\>\,\;\:\\\/\"\[\]\*]/;
      	var strng = frm.y_email.value;
      	if (!(emailFilter.test(strng)))
      	{ 
	  		alert("You have entered an invalid Email address.");
        	frm.y_email.focus();
        	return false;
      	}
      	if (strng.match(illegalChars))
      	{ 
	  		alert("Your Email address contains invalid characters.");
        	frm.y_email.focus();
        	return false;
      	}
	}
	
	if (frm.y_phone.value!="")
	{
		var phoneFilter = /^\d{3}\-\d{3}\-\d{4}$/;
		var strng = frm.y_phone.value;
		if (!(phoneFilter.test(strng)))
      	{ 
	  		alert("Your Phone format is not correct.");
        	frm.y_phone.focus();
        	return false;
      	}
 	}
	if (frm.y_bus_phone.value!="")
	{
		var bus_phoneFilter = /^\d{3}\-\d{3}\-\d{4}$/;
		var strng = frm.y_bus_phone.value;
		if (!(bus_phoneFilter.test(strng)))
      	{ 
	  		alert("Your Business Phone format is not correct.");
        	frm.y_bus_phone.focus();
        	return false;
      	}
 	}
	if (frm.y_cell.value!="")
	{
		var cell_phoneFilter = /^\d{3}\-\d{3}\-\d{4}$/;
		var strng = frm.y_cell.value;
		if (!(cell_phoneFilter.test(strng)))
      	{ 
	  		alert("Your Cell Phone format is not correct.");
        	frm.y_cell.focus();
        	return false;
      	}
 	}
	//var checked = false;
	chk_radio();
	var agree;
	if (loop2 != contrib)
	{
		if (frm.y_pay_other.value=="")
		{
			alert("Please enter a dollar amount.");
			frm.y_pay_other.focus();
			return false;
		}
		else
		{
			if (!(agree = confirm("Is a contribution of [$"+ frm.y_pay_other.value +".00] correct? \nOtherwise, click on Cancel and try again.")))
			{
				return false;
			}
			else
			{
				loop2 = contrib;
			}
		}
	}
	if (loop3 != contrib_to)
	{
		if (!(agree = confirm("Is a contribution to ["+ frm.y_pay_to[contrib_to-1].value +"] correct? \nOtherwise, click on Cancel and try again.")))
		{
			return false;
		}
		else
		{
			loop3 = contrib_to;
		}
	}
	if (!(agree = confirm("Is ["+ frm.y_pay_type[contrib_pay-1].value +"] payment method correct? \nOtherwise, click on Cancel and try again.")))
	{
		return false;
	}
	if (frm.y_pay_type[contrib_pay-1].value == "On-line")
	{
		//frm.action="./Construct.php";
		frm.action="./JoinUs_send.php";
	}
	else
	{
		frm.action="./JoinUs_send.php";
	}
	frm.submit();
}


<!-- End Java Scripts -->