function ValidateForm(strForm)
{
	var x;
	var alertmsg;
	x=0;
	alertmsg = "The following fields are required: \n";
	if(strForm=="addressform")
	{
		if (document.getElementById("aaddress1").value==""){alertmsg = alertmsg + "\nAddress 1";x = x + 1;}
		if (document.getElementById("acity").value==""){alertmsg = alertmsg + "\nCity";x = x + 1;}
		if (parseInt(document.getElementById("astate").selectedIndex)<1){alertmsg = alertmsg + "\nZip";x = x + 1;}
		if (document.getElementById("azip").value==""){alertmsg = alertmsg + "\nZip";x = x + 1;}
	}
	if(strForm=="registerform")
	{
		if (document.getElementById("rfirst").value==""){alertmsg = alertmsg + "\nFirst Name";x = x + 1;}
		if (document.getElementById("rlast").value==""){alertmsg = alertmsg + "\nLast Name";x = x + 1;}
		if (document.getElementById("rusername").value==""){alertmsg = alertmsg + "\nUsername";x = x + 1;}
		if (document.getElementById("rpassword").value==""){alertmsg = alertmsg + "\nPassword";x = x + 1;}
		if (document.getElementById("remail").value==""){alertmsg = alertmsg + "\nEmail";x = x + 1;}
		if (document.getElementById("rphone1a").value=="" || document.getElementById("rphone1b").value=="" || document.getElementById("rphone1c").value==""){alertmsg = alertmsg + "\nPhone";x = x + 1;}
		if (document.getElementById("raddress1").value==""){alertmsg = alertmsg + "\nAddress 1";x = x + 1;}
		if (document.getElementById("rcity").value==""){alertmsg = alertmsg + "\nCity";x = x + 1;}
		if (parseInt(document.getElementById("rstate").selectedIndex)<1){alertmsg = alertmsg + "\nState";x = x + 1;}
		if (document.getElementById("rzip").value==""){alertmsg = alertmsg + "\nZip";x = x + 1;}
		document.getElementById("rphone").value = document.getElementById("rphone1a").value + document.getElementById("rphone1b").value + document.getElementById("rphone1c").value;
	}
	if(strForm=="accountform")
	{
		if (document.getElementById("rfirst").value==""){alertmsg = alertmsg + "\nFirst Name";x = x + 1;}
		if (document.getElementById("rlast").value==""){alertmsg = alertmsg + "\nLast Name";x = x + 1;}
		if (document.getElementById("rpassword").value==""){alertmsg = alertmsg + "\nPassword";x = x + 1;}
		if (document.getElementById("remail").value==""){alertmsg = alertmsg + "\nEmail";x = x + 1;}
		if (document.getElementById("rphone1a").value=="" || document.getElementById("rphone1b").value=="" || document.getElementById("rphone1c").value==""){alertmsg = alertmsg + "\nPhone";x = x + 1;}
		if (document.getElementById("raddress1").value==""){alertmsg = alertmsg + "\nAddress 1";x = x + 1;}
		if (document.getElementById("rcity").value==""){alertmsg = alertmsg + "\nCity";x = x + 1;}
		if (parseInt(document.getElementById("rstate").selectedIndex)<1){alertmsg = alertmsg + "\nState";x = x + 1;}
		if (document.getElementById("rzip").value==""){alertmsg = alertmsg + "\nZip";x = x + 1;}
		document.getElementById("rphone").value = document.getElementById("rphone1a").value + document.getElementById("rphone1b").value + document.getElementById("rphone1c").value;
	}
	if(strForm=="passwordform")
	{
		if (document.getElementById("pemail").value==""){alertmsg = alertmsg + "\nEmail";x = x + 1;}
	}
	if(strForm=="loginform")
	{
		if (document.getElementById("lusername").value==""){alertmsg = alertmsg + "\nUsername";x = x + 1;}
		if (document.getElementById("lpassword").value==""){alertmsg = alertmsg + "\nPassword";x = x + 1;}
	}
	if(strForm=="contactform")
	{
		if (document.getElementById("ename").value==""){alertmsg = alertmsg + "\nName";x = x + 1;}
		if (document.getElementById("eemail").value==""){alertmsg = alertmsg + "\nEmail";x = x + 1;}
		if (document.getElementById("esubject").value==""){alertmsg = alertmsg + "\nSubject";x = x + 1;}
		if (document.getElementById("ebody").value==""){alertmsg = alertmsg + "\nBody";x = x + 1;}
	}
	if(strForm=="shippingform")
	{
		if (document.getElementById("aaddress1").value==""){alertmsg = alertmsg + "\nAddress 1";x = x + 1;}
		if (document.getElementById("acity").value==""){alertmsg = alertmsg + "\nCity";x = x + 1;}
		if (parseInt(document.getElementById("astate").selectedIndex)<1){alertmsg = alertmsg + "\nZip";x = x + 1;}
		if (document.getElementById("azip").value==""){alertmsg = alertmsg + "\nZip";x = x + 1;}
	}
	if(x!=0){alert(alertmsg);return false;}
}

function ValidateProduct()
{
	var x;
	var alertmsg;
	x=0;
	alertmsg = "The following fields are required: \n";
	if (document.getElementById("pid").value!="")
	{
		if(document.getElementById("opt").value!="")
		{
			if(parseInt(document.getElementById("sel").selectedIndex)==0)
			{
				alertmsg = alertmsg + "\nOption";x = x + 1;
			}
		} 
	}
	else
	{
		alertmsg = alertmsg + "\nInvalid Product";x = x + 1;
	}
	if(x!=0)
	{
		alert(alertmsg);
		return false;
	}	
}