	function emailChk() {
		var obj = document.getElementById("frmMemReg");
		if ( isEmpty(obj["email"].value) ) {
			alert("Please enter your E-mail Address.");
			obj["email"].focus();
			return false;
		}
		if ( isSpecialChrEmail(obj["email"].value) ) {
			alert("Email can not include Special Character. Please input again.");
			obj["email"].focus(); 
			return false;
		}
		if ( !isEmail(obj["email"].value) ) {
			alert("This is not a valid email address. Please confirm you have typed it correctly");
			obj["email"].focus(); 
			return false;
		}
		return true;
	}
	
	function isEmpty(str) {
		var strChk = str;
		var Is_Empty = false ;
		if ( strChk.length == 0 )
			Is_Empty = true;
		return ( Is_Empty )
	}
	function isEmpty(str) {
		var strChk = str;
		var Is_Empty = false ;
		if ( strChk.length == 0 )
			Is_Empty = true;
		return ( Is_Empty )
	}
	
	function isLenth(str,minnum,maxnum) {
		var is_Lenth = false ;
		var strLen = str.length;
		if ( strLen >= minnum && strLen <= maxnum )
			is_Lenth = true;
		return ( is_Lenth )
	}
	
	function maxLenth(str,maxnum) {
		var max_Lenth = false ;
		var strLen = str.length;
		if ( strLen <= maxnum )
			max_Lenth = true;
		return ( max_Lenth )
	}
	
	function isSpecialChrEmail(str) {
		var strChk = str;
		var result = (/[^a-zA-Z0-9_@.-]/).test(strChk);
		return ( result );
	}
	
	function isSpecialChr(str) {
		var strChk = str;
		var result = (/[^a-zA-Z0-9_-]/).test(strChk);
		return ( result );
	}
	
	function isSpace(str) {
		 var strChk = str + "";
		 var is_Space = false;
		 for ( j = 0; j < strChk.length ;j++){
			 if( strChk.substring( j , j+1 ) == " " )
				   is_Space = true;
		 }
		 return ( is_Space );
	}
	
	function isNumeric(str) {
		var obj = document.getElementById("frmMemReg");
		if(isNaN(obj[str].value)) {
			alert("Please use only numbers.")
			obj[str].value = "";
			obj[str].focus();
		}	
	}
	
	function isEmail(str) {
	  // regular expression
		var supported = 0;
		if (window.RegExp) {
			var tempStr = "a";
			var tempReg = new RegExp(tempStr);
			if (tempReg.test(tempStr)) supported = 1;
		}
		if (!supported)
			return (str.indexOf(".") > 2) && (str.indexOf("@") > 0);
		var r1 = new RegExp("(@.*@)|(\\.\\.)|(@\\.)|(^\\.)");
		var r2 = new RegExp("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$");
		return (!r1.test(str) && r2.test(str));
	}
	
	function accRefundSel() {
		var obj = document.getElementById("frmMemReg");
		var myOption = -1;
		var sel_accRefund = true;
		for( i=0; i<obj["accRefund"].length; i++ ) {
			if( obj["accRefund"][i].checked ) {
				myOption = i;
			}
		}
		if( myOption == -1 ) {
			sel_accRefund = false;
		}
		return ( sel_accRefund );
	}
	
	function accRefundChk() {
		var obj = document.getElementById("frmMemReg");
		if ( !accRefundSel() )	{
			alert("Please choose Account History or Request Refund.");
			obj["accRefund"][0].focus();
			return false;
		}
		return true;
	}
	
	function orderIdChk() {
		var obj = document.getElementById("frmMemReg");
		if ( isEmpty(obj["orderId"].value) ) {
			alert("Please enter your order Number."); 
			obj["orderId"].focus(); 
			return false;
		}
		if ( !isLenth(obj["orderId"].value,13,13)) {
			alert("Your order Number must be 13 characters. Please Re-enter.");
			obj["orderId"].focus(); 
			return false;
		}
		if ( isSpecialChr(obj["orderId"].value) ) {
			alert("order Number can not include Special Character. Please input again.");
			obj["orderId"].focus(); 
			return false;
		}
		return true;
	}
	
	function frmCheck() {
	//alert("");
		var obj = document.getElementById("frmMemReg");
	
		if ( accRefundChk() != true ) return false;
		if ( emailChk() != true ) return false;
		if ( orderIdChk() != true ) return false;
		obj.action="/member/accountProc.asp";
		return true;
	}
