	function validateForm(strAction)
	{

		var bValid = true;
		var objForm = document.frmStandard;
		var strReason = "Could not submit the form because the following required fields are invalid:\n";
		objForm.strACTION.value = strAction;
		//if(strAction == "DELETE")
		//{
		//	objForm.submit();
		//}
		if(!objForm.strUserName.value)
		{
			strReason += "\n  - User Name"
			bValid = false;
		}
		if(!objForm.strFullName.value)
		{
			strReason += "\n  - Your full or nick name"
			bValid = false;
		}
		if(!objForm.strEmail.value)
		{
			strReason += "\n  - Email Address"
			bValid = false;
		}
		if(!objForm.strPassword.value)
		{
			strReason += "\n  - Password"
			bValid = false;
		}
		if(objForm.bUserNameOK.value == "false")
		{
			strReason += "\n  - Username is already in use"
			bValid = false;
		}
		if(!objForm.strHow.value)
		{
			strReason += "\n  - How you found out about netGallery"
			bValid = false;
		}
		
		if(document.frmStandard.strPassword.value != document.frmStandard.strPasswordConfirm.value)
		{
			bValid = false;
			strReason += "\n  - passwords do not match";
			document.frmStandard.strPassword.select();
			document.frmStandard.strPassword.focus();
			document.frmStandard.strPasswordConfirm.value = "";
		}

		if(echeck(objForm.strEmail.value) == false)
		{
			strReason += "\n  - Please enter a valid email address"; 
			bValid = false;
		}

		if(bValid || strAction == "DELETE")
		{
			objForm.submit();
		}
		else
		{
			alert(strReason);
		}
		//document.location="createWebFolder.asp?nUserId=" + nUserId + "&strUserName=" + strUserName;
	}
	function checkUserName(strUserName)
	{
		window.frames["ifCheckUser"].document.location = "checkUser.asp?strUserName=" + strUserName;
	}
	function showConfirmPassword()
	{
		document.all.objConfirm.style.display="";
		document.frmStandard.strPasswordConfirm.focus();
	}
	function checkTsCs(bChecked)
	{
		document.frmStandard.butSAVE.disabled=!bChecked;
	}
	function checkPasswords()
	{
		var bReturn = true;
		if(document.frmStandard.strPassword.value != document.frmStandard.strPasswordConfirm.value)
		{
			bReturn = false;
			alert("Error, passwords do not match");
			document.frmStandard.strPassword.select();
			document.frmStandard.strPassword.focus();
			document.frmStandard.strPasswordConfirm.value = "";
		}
		return bReturn;
	}
	function openTerms()
	{
			objTerms = window.open("terms.asp", 'objTerms', 'height=500, width=500, resize=no, toolbar=no, status=yes');
			objTerms.focus();
	}

	function echeck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   //alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   //alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		   // alert("Invalid E-mail ID")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		   // alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		   // alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		   /// alert("Invalid E-mail ID")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		   // alert("Invalid E-mail ID")
		    return false
		 }

 		 return true					
	}
