function checkselect()
{
	if (document.frm.memtype[0].checked == true)
	{
		if (document.frm.memtype[1].checked == true)
		{
			document.frm.memtype[1].checked = false;
		}
	}
	if (navigator.appName != "Microsoft Internet Explorer")
	{
	trrow = document.getElementById("trow1")
	trrow.style.display ='table-row';
	trrow1 = document.getElementById("trow2")
	trrow1.style.display ='table-row';
	trrow2 = document.getElementById("trow3")
	trrow2.style.display ='table-row';
	}
	else
	{
	trrow = document.getElementById("trow1")
	trrow.style.display ='block';
	trrow1 = document.getElementById("trow2")
	trrow1.style.display ='block';
	trrow2 = document.getElementById("trow3")
	trrow2.style.display ='block';
	}
}
function checkselect1()
{
	if (document.frm.memtype[1].checked == true)
	{
		if (document.frm.memtype[0].checked == true)
		{
			document.frm.memtype[0].checked = false;
		}
	}
	trrow = document.getElementById("trow1")
	trrow.style.display ='none';
	trrow1 = document.getElementById("trow2")
	trrow1.style.display ='none';
	trrow2 = document.getElementById("trow3")
	trrow2.style.display ='none';
	
}
function shformvalidation()
{
	if(document.frm.shaddress.value == "")
		{
			alert("Enter Shipping Address")
			document.frm.shaddress.focus()
			return false;
		}
		else
		{
			if(isWhitespace(document.frm.shaddress.value))
			{
				alert("Shipping Address cannnot contain only space")
				document.frm.shaddress.focus()
				return false;
			}
		}
		if(document.frm.shcity.value=="")
		{
			alert("Enter City")
			document.frm.shcity.focus()
			return false;
		}
		
		
		if(document.frm.shstate.value == "")
		{
			alert("Enter State")
			document.frm.shstate.focus()
			return false;
		}
		if(document.frm.shzipcode.value == "")
		{
			alert("Enter Zip code")
			document.frm.shzipcode.focus()
			return false;
		}
		else
		{
			if(isWhitespace(document.frm.shzipcode.value))
			{
				alert("Zip code cannnot contain only space")
				document.frm.shzipcode.focus()
				return false;
			}
			
		}
		if(document.frm.shcountry.value == "")
		{
			alert("Select Country")
			document.frm.shcountry.focus()
			return false;
		}
		if(document.frm.shcountry.value != "USA")
		{
			alert("Dear Shopper, Currently Moksha ships products only within USA. Moksha can make special shipping arrangements at an additional cost for bulk orders which comprise of more that 15 peices and an order value above USD 3000. For bulk requirements outside of the US kindly get in touch with us.")
			document.frm.shcountry.focus()
			return false;
		}
		if(document.frm.shphoneno.value == "")
		{
					alert("Enter Day phone number")
					document.frm.shphoneno.focus()
					return false;
		}
		else 
		{
			if(isWhitespace(document.frm.shphoneno.value))
				{
					alert("Day phone number cannnot contain only space")
					document.frm.shphoneno.focus()
					return false;
				}
			if(isNaN(parseInt(document.frm.shphoneno.value)))
				{
					alert("Day phone number should be numeric only")
					document.frm.shphoneno.focus()
					return false;
				}
				
		}
		if(document.frm.shnightphoneno.value == "")
		{
					alert("Enter Night phone number")
					document.frm.shnightphoneno.focus()
					return false;
		}
		else 
		{
			if(isWhitespace(document.frm.shnightphoneno.value))
				{
					alert("Night phone number cannnot contain only space")
					document.frm.shnightphoneno.focus()
					return false;
				}
			if(isNaN(parseInt(document.frm.shnightphoneno.value)))
				{
					alert("Night phone number should be numeric only")
					document.frm.shnightphoneno.focus()
					return false;
				}
				
		}
			
}
		
function formvalidation()
{
	
if (document.frm.memtype[0].checked == false && document.frm.memtype[1].checked == false)
{
	alert("Select Member Type")
	document.frm.memtype[0].focus()
	return false;
}
if(document.frm.loginname.value=="")
{
	alert("Enter Login name")
	document.frm.loginname.focus()
	return false;
}
else
{
	if(isWhitespace(document.frm.loginname.value))
	{
		alert("Login name cannnot contain only space")
		document.frm.loginname.focus()
		return false;
	}
}
if(document.frm.txtpassword.value=="")
{
	alert("Enter Password")
	document.frm.txtpassword.focus()
	return false;
}
if(document.frm.txtpassword.value.length < 6)
{
	alert("Password should be more than 6 character")
	document.frm.txtpassword.focus()
	return false;
}
if(document.frm.txtrepassword.value=="")
{
	alert("Enter Re-type Password")
	document.frm.txtrepassword.focus()
	return false;
}
if(document.frm.txtrepassword.value.length < 6)
{
	alert("Re-type Password should be more than 6 character")
	document.frm.txtpassword.focus()
	return false;
}
if (document.frm.txtpassword.value != document.frm.txtrepassword.value)
{
	alert("Enter Re-type Password not match")
	document.frm.txtrepassword.focus()
	return false;
}
if(document.frm.memtype[1].checked != true)
{
	if(document.frm.company.value=="")
	{
		alert("Enter Company Name")
		document.frm.company.focus()
		return false;
	}
	else
	{
		if(isWhitespace(document.frm.company.value))
		{
			alert("Company Name cannnot contain only space")
			document.frm.company.focus()
			return false;
		}
	}
}
if(document.frm.memtype[1].checked != true)
{
	if(document.frm.resalerno.value=="")
	{
		alert("Enter Resaler no.")
		document.frm.resalerno.focus()
		return false;
	}
	else
	{
		if(isWhitespace(document.frm.resalerno.value))
		{
			alert("Resaler no. cannnot contain only space")
			document.frm.resalerno.focus()
			return false;
		}
		if(isNaN(parseInt(document.frm.resalerno.value)))
		{
			alert("Resaler no. should be numeric only")
			document.frm.resalerno.focus()
			return false;
		}
	}
}

if(document.frm.firstname.value=="")
{
	alert("Enter Firstname")
	document.frm.firstname.focus()
	return false;
}
else
{
	if(isWhitespace(document.frm.firstname.value))
	{
		alert("First name cannnot contain only space")
		document.frm.firstname.focus()
		return false;
	}
}

if(document.frm.lastname.value=="")
{
	alert("Enter Last name")
	document.frm.lastname.focus()
	return false;
}
else
{
	if(isWhitespace(document.frm.lastname.value))
	{
		alert("Last name cannnot contain only space")
		document.frm.lastname.focus()
		return false;
	}
}

if(document.frm.address.value=="")
{
	alert("Enter Address")
	document.frm.address.focus()
	return false;
}
else
{
	if(isWhitespace(document.frm.address.value))
	{
		alert("Address cannnot contain only space")
		document.frm.address.focus()
		return false;
	}
}
if(document.frm.city.value=="")
{
	alert("Enter City")
	document.frm.city.focus()
	return false;
}


if(document.frm.state.value == "")
{
	alert("Select State")
	document.frm.state.focus()
	return false;
}
if(document.frm.zipcode.value == "")
{
	alert("Enter Zip code")
	document.frm.zipcode.focus()
	return false;
}
else
{
	if(isWhitespace(document.frm.zipcode.value))
	{
		alert("Zip code cannnot contain only space")
		document.frm.zipcode.focus()
		return false;
	}	
}
if(document.frm.country.value == "")
{
	alert("Select Country")
	document.frm.country.focus()
	return false;
}
if(document.frm.email.value == "")
{
	alert("Enter Email")
	document.frm.email.focus()
	return false;
}
else
{
	if(isWhitespace(document.frm.email.value))
	{
		alert("Email cannnot contain only space")
		document.frm.email.focus()
		return false;
	}
	if(emailCheck(document.frm.email.value)==false)
	{
		alert("Invalid Email ID")
		document.frm.email.focus()
		return false;
	}
}
if(document.frm.phoneno.value == "")
{
			alert("Enter Day phone number")
			document.frm.phoneno.focus()
			return false;
}
else 
{
	if(isWhitespace(document.frm.phoneno.value))
		{
			alert("Day phone number cannnot contain only space")
			document.frm.phoneno.focus()
			return false;
		}
	if(isNaN(parseInt(document.frm.phoneno.value)))
		{
			alert("Day phone number should be numeric only")
			document.frm.phoneno.focus()
			return false;
		}
		
}
if(document.frm.nightphoneno.value == "")
{
			alert("Enter Night phone number")
			document.frm.nightphoneno.focus()
			return false;
}
else 
{
	if(isWhitespace(document.frm.nightphoneno.value))
		{
			alert("Night phone number cannnot contain only space")
			document.frm.nightphoneno.focus()
			return false;
		}
	if(isNaN(parseInt(document.frm.nightphoneno.value)))
		{
			alert("Night phone number should be numeric only")
			document.frm.nightphoneno.focus()
			return false;
		}
		
}
if(document.frm.memtype[1].checked != true)
{
	if (document.frm.business[0].checked == false && document.frm.business[1].checked == false && document.frm.business[2].checked == false && document.frm.business[3].checked == false && document.frm.business[4].checked == false && document.frm.business[5].checked == false && document.frm.business[6].checked == false && document.frm.business[7].checked == false && document.frm.business[8].checked == false)
	{
			alert("Select Business Category")
			document.frm.business[0].focus()
			return false;
	}
}
}
