function IsNumeric(sText,obj)
{
	var ValidChars = "0123456789";
   var IsNumber=true;
   var Char;
   for (i = 0; i < sText.length && IsNumber == true; i++) 
      { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         IsNumber = false;
         }
      }
   		if(IsNumber==false){
			alert("เฉพาะตัวเลขเท่านั้น");
			obj.value=sText.substr(0,sText.length-1);
		}
   }
   
function checkNotNull()
{
var passw,confpass;

		if(document.all.username.value == "")
	{
		alert('กรุณาใส่ username');
		document.all.username.focus();
		return false;
	}

	if(document.all.password.value == "")
	{
		alert('รหัสผ่านของคุณคือ ??');
		document.all.password.focus();		
		return false;
	}

	passw=document.all.password.value;
	confpass=document.all.password2.value;
	if(passw!=confpass)
	{
		alert('รหัสผ่านไม่ตรงกัน');
		document.all.password.focus();		
		return false;
	}
	
	if(document.all.email.value == "")
	{
		alert('ใส่ email ด้วยค่ะ');
		document.all.email.focus();
		return false;
	}

	if(document.all.name.value == "")
	{
		alert('กรุณาใส่ชื่อ');
		document.all.name.focus();
		return false;
	}

	if(document.all.lastname.value == "")
	{
		alert('กรุณาใส่นามสกุล');
		document.all.lastname.focus();
		return false;
	}

	if(document.all.province.value == "")
	{
		alert('กรุณาเลือกจังหวัดค่ะ');
		document.all.province.focus();
		return false;
	}
	
	if(document.all.phone.value == "")
	{
		alert('เบอร์โทรศัพท์ของคุณ');
		document.all.phone.focus();
		return false;
	}	
	
	document.all.submit();
}

