//////////////////////////   CHECK BLANK FUNCTION   /////////////////////////
function checkblank() {
missinginfo = "";
if (document.myForm2.name.value == "") {
missinginfo += "\n - Name(English)";
}
if (document.myForm2.namt.value == "") {
missinginfo += "\n - Name(Thai)";
}
if ((document.myForm2.ema.value == "") || 
(document.myForm2.ema.value.indexOf('@') == -1) || 
(document.myForm2.ema.value.indexOf('.') == -1)) {
missinginfo += "\n - Email is not proper or empty";
}
if(!check_number(document.myForm2.hie.value) || document.myForm2.hie.value == "" )
 {
missinginfo += "\n - Hieght : Please Enter Number";
}
if (!check_number(document.myForm2.wei.value) || document.myForm2.wei.value == "" ) {
missinginfo += "\n - Wieght : Please Enter Number";
}
if (document.myForm2.dat.value == "") {
missinginfo += "\n - Date of birth";
}
if (document.myForm2.pla.value == "") {
missinginfo += "\n - Place of birth";
}
if (document.myForm2.RadioGroup1.value == "") {
missinginfo += "\n - Sex";
}
if (document.myForm2.mob.value == "") {
missinginfo += "\n - Mobile phone";
}
if (document.myForm2.pre.value == "") {
missinginfo += "\n - Present Address";
}
if (document.myForm2.tel.value == "") {
missinginfo += "\n - Tel";
}
if (document.myForm2.reg.value == "") {
missinginfo += "\n - Register address";
}
if (document.myForm2.tel2.value == "") {
missinginfo += "\n - Tel.";
}
if (document.myForm2.nat.value == "") {
missinginfo += "\n - Nationality";
}
if (document.myForm2.rac.value == "") {
missinginfo += "\n - Race";
}
if (document.myForm2.rel.value == "") {
missinginfo += "\n - Relegion";
}
if (document.myForm2.idc.value == "") {
missinginfo += "\n - ID card No.";
}
////CHECK IMAGE SIZE
im = new Image();
im.src = document.myForm2.files.value;
if(im.height>300){
missinginfo += "\n - Image size Exceed or format is not propper.";
}
//////
if (missinginfo != "") {
missinginfo ="Required field cannot be left blank\n" +
missinginfo ;
alert(missinginfo);
return false;
}
else return true;
}

///////////////////////////////// CHECK NUMBER????????????////
function check_number(ch){
var len, digit;
if(ch == " "){ 
return false;
len=0;
}else{
len = ch.length;
}
for(var i=0 ; i<len ; i++)
{
digit = ch.charAt(i)
if(digit >="0" && digit <="9"){
; 
}else{
return false; 
} 
} 
return true;
}