	function trimAll(sString) 
	{
		while (sString.substring(0,1) == ' ')
		{
		sString = sString.substring(1, sString.length);
		}
		while (sString.substring(sString.length-1, sString.length) == ' ')
		{
		sString = sString.substring(0,sString.length-1);
		}
		return sString;
	}	
	
	function echeck(oText) 
	{
		var oObj;
		oObj = window.document.getElementById(oText);
		str = trimAll(oObj.value.toLowerCase());		
		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   return(false);
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   return(false);
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    return(false);
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    return(false);
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    return(false);
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    return(false);
		 }
		
		 if (str.indexOf(" ")!=-1){
		    return(false);
		 }

 		 return(true);					
	}

	function fnCheckForBlank(sTextBox, sLabel, bSilent)
	{
		var oText;
		
		oText = window.document.getElementById(sTextBox);
		if (oText.value == "")
		{	
			if (!bSilent){alert("Please enter a \"" + sLabel + "\"");}
			return(false);
		}
		oText = "";	
		return(true);
	}
	
	function fnCheckForEqual(sTextBox1, sTextBox2, sLabel)
	{
		var oText1;
		var oText2;
		
		oText1 = window.document.getElementById(sTextBox1);
		oText2 = window.document.getElementById(sTextBox2);
		if (oText1.value != oText2.value)
		{
			alert('\"' + sLabel + '\" are not the same.  Please correct.');
			return(false);
		}
		oText1 = "";	
		oText2 = "";
		return(true);
	}	

	function fnSubmit2()
	{
		var oObj;
		var sTemp;
		
		if (!fnCheckForBlank("fname", "Name"))
		{
			return(false);
		}	

		if (!fnCheckForBlank("email", "E-Mail Address"))
		{
			return(false);
		}	
		
		//check e-mail address
		if (!echeck("email"))
		{
			alert("Your E-Mail address does not appear to be a valid E-Mail address.  Please check and correct it.");
			oObj = "";
			return(false);
		}
		oObj = "";
		oObj = window.document.getElementById("B2");
		oObj.disabled = true;
		oObj = "";
		return(true);
	}		
	
	function fnSubmit3()
	{
		var oObj;
		var oObj2;
		var sTemp;
		
		if (!fnCheckForBlank("first_name", "First Name"))
		{
			return(false);
		}
		
		if (!fnCheckForBlank("last_name", "Last Name"))
		{
			return(false);
		}	
			
		if (!fnCheckForBlank("address1", "Address"))
		{
			return(false);
		}	
		if (!fnCheckForBlank("city", "City"))
		{
			return(false);
		}		
		if (!fnCheckForBlank("state", "State"))
		{
			return(false);
		}			
		if (!fnCheckForBlank("zip", "Zip Code"))
		{
			return(false);
		}	

		if (!fnCheckForBlank("email", "E-Mail Address"))
		{
			return(false);
		}	
		
		//check e-mail address
		if (!echeck("email"))
		{
			alert("Your E-Mail address does not appear to be a valid E-Mail address.  Please check and correct it.");
			oObj = "";
			return(false);
		}
		
		//assign amount from drop down
		oObj = "";
		oObj = window.document.getElementById("item_name");	
		oObj2 = "";
		oObj2 = window.document.getElementById("amount");	
		switch(oObj.value)
		{
			case "WHS Bulldogs General Booster Membership":
			{
				oObj2.value = "25.00";
				break;
			}
			case "WHS Bulldogs Student Booster Membership":
			{
				oObj2.value = "50.00";
				break;
			}
			case "WHS Bulldogs Bulldog Booster Membership":
			{
				oObj2.value = "150.00";
				break;
			}
			case "WHS Bulldogs Big Dog Booster Membership":
			{
				oObj2.value = "300.00";
				break;
			}
			case "WHS Bulldogs Top Dog Booster Membership":
			{
				oObj2.value = "500.00";
				break;
			}		
			case "WHS Bulldogs Ultra Dog Booster Membership":
			{
				oObj2.value = "1000.00";
				break;
			}			
		}
		oObj2 = "";
		oObj = "";
		oObj = window.document.getElementById("B3");
		oObj.disabled = true;
		oObj = "";
		return(true);
	}	
	
	function newImage(arg) {
		if (document.images) {
			rslt = new Image();
			rslt.src = arg;
			return rslt;
		}
	}	