	function writeUname(txt)
	{
		this.document.getElementById("c_email").value=txt; 
	}
	
	function copybyContactInfo()
	{
		var frm = document.getElementById("regform");
		frm.a_fname.value=frm.c_fname.value
		frm.a_lname.value=frm.c_lname.value
		frm.a_company.value=frm.c_company.value
		frm.a_cmpytype.value=frm.c_cmpytype.value
		frm.a_ENOEDPM.value=frm.c_ENOEDPM.value
		frm.a_address1.value=frm.c_address1.value
		frm.a_address2.value=frm.c_address2.value
		frm.a_address3.value=frm.c_address3.value
		frm.a_postcode.value=frm.c_postcode.value
		frm.a_city.value=frm.c_city.value
		frm.a_country.value=frm.c_country.value
		frm.a_phone1.value=frm.c_phone1.value
		frm.a_phone2.value=frm.c_phone2.value
		frm.a_phone3.value=frm.c_phone3.value
		frm.a_cell1.value=frm.c_cell1.value
		frm.a_cell2.value=frm.c_cell2.value
		frm.a_cell3.value=frm.c_cell3.value
		frm.a_fax1.value=frm.c_fax1.value
		frm.a_fax2.value=frm.c_fax2.value
		frm.a_fax3.value=frm.c_fax3.value
		frm.a_email.value=frm.c_email.value
		frm.a_emaila.value=frm.c_emaila.value
		frm.a_web.value=frm.c_web.value
	}
	
	function checkMail(a) 
	{ 
		var pattern=/\w+@\w+\.[a-z]+/; 
		if(pattern.test(a)) 
		{ 
			return true; 
		} 
		else 
		{ 
			return false; 
		} 
	} 

    function CheckReginfo()
    {
        var frm = document.getElementById("regform");
        if (frm.uname.value == '')
        {
            alert("please write your user name(e-miall address)");
            frm.uname.focus();
            return false;
        }
        if (frm.upassword.value == '')
        {
            alert("please write your password");
            frm.upassword.focus();
            return false;
        }
		if (frm.upassword2.value == '')
        {
            alert("please write your Confirm Password");
            frm.upassword2.focus();
            return false;
        }
        if (frm.upassword.value != frm.upassword2.value)
        {
            alert("Confirm Password need same as Password");
            frm.upassword2.focus();
            return false;
        }
		
		if (frm.c_fname.value == '')
        {
            alert("please write your Contact Information first name");
            frm.c_fname.focus();
            return false;
        }
		
		if (frm.c_lname.value == '')
        {
            alert("please write your Contact Information last name");
            frm.c_lname.focus();
            return false;
        }
		
		if (frm.c_company.value == '')
        {
            alert("please write your Contact Information company");
            frm.c_company.focus();
            return false;
        }
		
		if (frm.c_address1.value == '')
        {
            alert("please write your Contact Information address");
            frm.c_address1.focus();
            return false;
        }
		
		if (frm.c_city.value == '')
        {
            alert("please write your Contact Information city");
            frm.c_city.focus();
            return false;
        }
		
		if (frm.c_country.value == '')
        {
            alert("please write your Contact Information country");
            frm.c_country.focus();
            return false;
        }
		
		if (frm.c_email.value == '')
        {
            alert("please write your Contact Information e-mail");
            frm.c_email.focus();
            return false;
        }
		
		if(checkMail(frm.c_email.value)==false) 
		{ 
			alert("error Contact Information e-mail address"); 
			frm.c_email.focus(); 
			return false; 
		}
		
		if(frm.c_emaila.value != '')
		{
			if(checkMail(frm.c_emaila.value)==false) 
			{ 
				alert("error Contact Information e-mail(Alternative) address"); 
				frm.c_emaila.focus(); 
				return false; 
			}
		}
		
		if (frm.a_fname.value == '')
        {
            alert("please write your Billing information first name");
            frm.a_fname.focus();
            return false;
        }
		
		if (frm.a_lname.value == '')
        {
            alert("please write your Billing information last name");
            frm.a_lname.focus();
            return false;
        }
		
		if (frm.a_company.value == '')
        {
            alert("please write your Billing information company");
            frm.a_company.focus();
            return false;
        }
		
		if (frm.a_address1.value == '')
        {
            alert("please write your Billing information address");
            frm.a_address1.focus();
            return false;
        }
		
		if (frm.a_city.value == '')
        {
            alert("please write your Billing information city");
            frm.a_city.focus();
            return false;
        }
		
		if (frm.a_country.value == '')
        {
            alert("please write your Billing information country");
            frm.a_country.focus();
            return false;
        }
		
		if (frm.a_email.value == '')
        {
            alert("please write your Billing information e-mail");
            frm.a_email.focus();
            return false;
        }
		
		if(checkMail(frm.a_email.value)==false) 
		{ 
			alert("error Billing Information e-mail address"); 
			frm.a_email.focus(); 
			return false; 
		}
		
		if(frm.a_emaila.value != '')
		{
			if(checkMail(frm.a_emaila.value)==false) 
			{ 
				alert("error Billing Information e-mail(Alternative) address"); 
				frm.a_emaila.focus(); 
				return false; 
			}
		}
		
		if (frm.termcheck.checked == false)
        {
            alert("please read the Term & Conditions");
            return false;
        }

        frm.submit();
        
        return false;
    }
	
	function checkInputNumber(obj)
	{
		if ( !(((window.event.keyCode >= 48) && (window.event.keyCode <= 57)) || (window.event.keyCode == 13))) 
			window.event.keyCode = 0 ;
	}