var digits = "0123456789";
// non-digit characters which are allowed in phone numbers
var idNumberDelimiters = "";
// characters which are allowed in international phone numbers
// (a leading + is OK)
var validWorldidChars = idNumberDelimiters + "+";
// Minimum no of digits in an international phone no.
var minDigitsIdNumber = 20;

function isInteger(s)
{   var i;
    for (i = 0; i < s.length; i++)
    {   
        // Check that current character is number.
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}

function stripCharsInBag(s, bag)
{   var i;
    var returnString = "";
    // Search through string's characters one by one.
    // If character is not in bag, append to returnString.
    for (i = 0; i < s.length; i++)
    {   
        // Check that current character isn't whitespace.
        var c = s.charAt(i);
        if (bag.indexOf(c) == -1) returnString += c;
    }
    return returnString;
}

function checkIdNum(stridnum){
s=stripCharsInBag(stridnum,idNumberDelimiters);
return (isInteger(s) && s.length <= minDigitsIdNumber);
}

//**********************************************National ID Validation*******************************************

var idchrDelimiters = "";
var minDigitsIdchr = 200;

function stripCharsInBagt(t, bag)
{   var i;
    var returnString = "";
    // Search through string's characters one by one.
    // If character is not in bag, append to returnString.
    for (i = 0; i < t.length; i++)
    {   
        // Check that current character isn't whitespace.
        var c = t.charAt(i);
        if (bag.indexOf(c) == -1) returnString += c;
    }
    return returnString;
} 




function checkIdChr(stridchr){
t=stripCharsInBagt(stridchr,idchrDelimiters);
return (t.length >= minDigitsIdchr);
}

//**********************************************National ID Validation*******************************************


//**********************************************High School Persentage*******************************************

var perhDelimiters = ".";
var minDigitsperh = 20;

function isInteger(h)
{   var i;
    for (i = 0; i < h.length; i++)
    {   
        // Check that current character is number.
        var c = h.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}

function stripCharsInBagph(h, bagph)
{   var i;
    var returnString = "";
    // Search through string's characters one by one.
    // If character is not in bag, append to returnString.
    for (i = 0; i < h.length; i++)
    {   
        // Check that current character isn't whitespace.
        var c = h.charAt(i);
        if (bagph.indexOf(c) == -1) returnString += c;
    }
    return returnString;
}

function checkperh(strperh){
h=stripCharsInBagph(strperh,perhDelimiters);
return (isInteger(h) && h.length <= minDigitsperh);
}


//**********************************************High School Persentage******************************************

//**********************************************DIPM GPA*******************************************

var gpadDelimiters = ".";
var minDigitsgpad = 20;

function isInteger(dg)
{   var i;
    for (i = 0; i < d.length; i++)
    {   
        // Check that current character is number.
        var c = dg.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}

function stripCharsInBaggd(dg, baggd)
{   var i;
    var returnString = "";
    // Search through string's characters one by one.
    // If character is not in bag, append to returnString.
    for (i = 0; i < dg.length; i++)
    {   
        // Check that current character isn't whitespace.
        var c = dg.charAt(i);
        if (baggd.indexOf(c) == -1) returnString += c;
    }
    return returnString;
}

function checkgpad(strgpad){
dg=stripCharsInBaggd(strgpad,gpadDelimiters);
return (isInteger(dg) && dg.length <= minDigitsgpad);
}


//**********************************************DIPM  GPA******************************************

//**********************************************DIPM PER*******************************************

var perdDelimiters = ".";
var minDigitsperd = 20;

function isInteger(d)
{   var i;
    for (i = 0; i < d.length; i++)
    {   
        // Check that current character is number.
        var c = d.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}

function stripCharsInBagpd(d, bagpd)
{   var i;
    var returnString = "";
    // Search through string's characters one by one.
    // If character is not in bag, append to returnString.
    for (i = 0; i < d.length; i++)
    {   
        // Check that current character isn't whitespace.
        var c = d.charAt(i);
        if (bagpd.indexOf(c) == -1) returnString += c;
    }
    return returnString;
}

function checkperd(strperd){
d=stripCharsInBagpd(strperd,perdDelimiters);
return (isInteger(d) && d.length <= minDigitsperd);
}


//**********************************************DIPM  PER******************************************


//**********************************************BACH GPA*******************************************

var gpabDelimiters = ".";
var minDigitsgpab = 20;

function isInteger(bg)
{   var i;
    for (i = 0; i < bg.length; i++)
    {   
        // Check that current character is number.
        var c = bg.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}

function stripCharsInBaggd(bg, baggb)
{   var i;
    var returnString = "";
    // Search through string's characters one by one.
    // If character is not in bag, append to returnString.
    for (i = 0; i < bg.length; i++)
    {   
        // Check that current character isn't whitespace.
        var c = bg.charAt(i);
        if (baggb.indexOf(c) == -1) returnString += c;
    }
    return returnString;
}

function checkgpab(strgpab){
bg=stripCharsInBaggd(strgpab,gpabDelimiters);
return (isInteger(bg) && bg.length <= minDigitsgpab);
}


//**********************************************BACH  GPA******************************************


//**********************************************BACH  PER*******************************************

var perbDelimiters = ".";
var minDigitsperb = 20;

function isInteger(d)
{   var i;
    for (i = 0; i < d.length; i++)
    {   
        // Check that current character is number.
        var c = d.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}

function stripCharsInBagpb(b, bagpb)
{   var i;
    var returnString = "";
    // Search through string's characters one by one.
    // If character is not in bag, append to returnString.
    for (i = 0; i < b.length; i++)
    {   
        // Check that current character isn't whitespace.
        var c = d.charAt(i);
        if (bagpb.indexOf(c) == -1) returnString += c;
    }
    return returnString;
}

function checkperb(strperb){
b=stripCharsInBagpb(strperb,perbDelimiters);
return (isInteger(b) && b.length <= minDigitsperb);
}


//**********************************************BACH   PER******************************************

//**********************************************PG GPA*******************************************

var gpapDelimiters = ".";
var minDigitsgpap = 20;

function isInteger(pg)
{   var i;
    for (i = 0; i < pg.length; i++)
    {   
        // Check that current character is number.
        var c = pg.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}

function stripCharsInBaggp(pg, baggp)
{   var i;
    var returnString = "";
    // Search through string's characters one by one.
    // If character is not in bag, append to returnString.
    for (i = 0; i < pg.length; i++)
    {   
        // Check that current character isn't whitespace.
        var c = pg.charAt(i);
        if (baggp.indexOf(c) == -1) returnString += c;
    }
    return returnString;
}

function checkgpap(strgpap){
pg=stripCharsInBaggp(strgpap,gpapDelimiters);
return (isInteger(pg) && pg.length <= minDigitsgpap);
}


//**********************************************PG  GPA******************************************

//**********************************************PG  PER*******************************************

var perpDelimiters = ".";
var minDigitsperp = 20;

function isInteger(p)
{   var i;
    for (i = 0; i < p.length; i++)
    {   
        // Check that current character is number.
        var c = p.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}

function stripCharsInBagpp(p, bagpp)
{   var i;
    var returnString = "";
    // Search through string's characters one by one.
    // If character is not in bag, append to returnString.
    for (i = 0; i < p.length; i++)
    {   
        // Check that current character isn't whitespace.
        var c = p.charAt(i);
        if (bagpp.indexOf(c) == -1) returnString += c;
    }
    return returnString;
}

function checkperp(strperp){
p=stripCharsInBagpp(strperp,perpDelimiters);
return (isInteger(p) && p.length <= minDigitsperp);
}


//**********************************************PG  PER******************************************


//**********************************************bxn*******************************************

var bxDelimiters = "";
var minDigitsbx = 20;

function isInteger(bx)
{   var i;
    for (i = 0; i < bx.length; i++)
    {   
        // Check that current character is number.
        var c = bx.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}

function stripCharsInBagbx(bx, bagbx)
{   var i;
    var returnString = "";
    // Search through string's characters one by one.
    // If character is not in bag, append to returnString.
    for (i = 0; i < bx.length; i++)
    {   
        // Check that current character isn't whitespace.
        var c = bx.charAt(i);
        if (bagbx.indexOf(c) == -1) returnString += c;
    }
    return returnString;
}

function checkbx(strbxn){
bx=stripCharsInBagbx(strbxn,bxDelimiters);
return (isInteger(bx) && bx.length <= minDigitsbx);
}


//**********************************************bxn*****************************************

//**********************************************zip*******************************************

var zipDelimiters = "";
var minDigitszp = 20;

function isInteger(zp)
{   var i;
    for (i = 0; i < zp.length; i++)
    {   
        // Check that current character is number.
        var c = zp.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}

function stripCharsInBagzp(zp, bagzp)
{   var i;
    var returnString = "";
    // Search through string's characters one by one.
    // If character is not in bag, append to returnString.
    for (i = 0; i < zp.length; i++)
    {   
        // Check that current character isn't whitespace.
        var c = zp.charAt(i);
        if (bagzp.indexOf(c) == -1) returnString += c;
    }
    return returnString;
}

function checkzip(strzip1){
zp=stripCharsInBagzp(strzip1,zipDelimiters);
return (isInteger(zp) && zp.length <= minDigitszp);
}


//**********************************************zip*****************************************


//**********************************************MOBILE*******************************************

var mobDelimiters = "";
var minDigitsmob = 20;

function isInteger(mob)
{   var i;
    for (i = 0; i < mob.length; i++)
    {   
        // Check that current character is number.
        var c = mob.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}

function stripCharsInBagmob(mob, bagmob)
{   var i;
    var returnString = "";
    // Search through string's characters one by one.
    // If character is not in bag, append to returnString.
    for (i = 0; i < mob.length; i++)
    {   
        // Check that current character isn't whitespace.
        var c = mob.charAt(i);
        if (bagmob.indexOf(c) == -1) returnString += c;
    }
    return returnString;
}

function checkmob(Phonemob1){
mob=stripCharsInBagmob(Phonemob1,mobDelimiters);
return (isInteger(mob) && mob.length <= minDigitsmob);
}


//**********************************************MOBILE*****************************************

//**********************************************phone*******************************************

var phoneDelimiters = "";
var minDigitsphone = 20;

function isInteger(phone)
{   var i;
    for (i = 0; i < phone.length; i++)
    {   
        // Check that current character is number.
        var c = phone.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}

function stripCharsInBagphone(phone, bagphone)
{   var i;
    var returnString = "";
    // Search through string's characters one by one.
    // If character is not in bag, append to returnString.
    for (i = 0; i < phone.length; i++)
    {   
        // Check that current character isn't whitespace.
        var c = phone.charAt(i);
        if (bagphone.indexOf(c) == -1) returnString += c;
    }
    return returnString;
}

function checkphone(Phone){
phone=stripCharsInBagphone(Phone,phoneDelimiters);
return (isInteger(phone) && phone.length <= minDigitsphone);
}


//**********************************************phone*****************************************

//**********************************************email*******************************************
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("العنوان غير صحيح");
		   return false;
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("العنوان غير صحيح");
		   return false;
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("العنوان غير صحيح");
		    return false;
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("العنوان غير صحيح");
		    return false;
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("العنوان غير صحيح");
		    return false;
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("العنوان غير صحيح");
		    return false;
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("العنوان غير صحيح");
		    return false;
		 }

 		 return true;					
	}






//**********************************************email*****************************************



function sel_comboNational()
{
if("Saudi Arabian"==Form1.comboNational.value)
{
document.Form1.txtNationalID.disabled = false; 
document.Form1.comboIssDay.disabled = false;
document.Form1.comboIssMnth.disabled = false;
document.Form1.comboIssYear.disabled = false;
document.Form1.txtIssLoc.disabled = false;
document.Form1.txtGOSI.disabled = false;
document.Form1.txtPassNo.disabled = true;
document.Form1.comboPassDay.disabled = true;
document.Form1.comboPassMnth.disabled = true;
document.Form1.comboPassYear.disabled = true;
document.Form1.txtIqamaNo.disabled = true;
document.Form1.txtPassNo.value="";
document.Form1.comboPassDay.value= document.Form1.comboPassDay[0].value;
document.Form1.comboPassMnth.value=document.Form1.comboPassMnth[0].value;
document.Form1.comboPassYear.value=document.Form1.comboPassYear[0].value;
document.Form1.txtIqamaNo.value="";

}
else
{
document.Form1.txtNationalID.value="";
document.Form1.comboIssDay.value=document.Form1.comboIssDay[0].value;
document.Form1.comboIssMnth.value=document.Form1.comboIssMnth[0].value;
document.Form1.comboIssYear.value=document.Form1.comboIssYear[0].value;
document.Form1.txtIssLoc.value="";
document.Form1.txtGOSI.value="";
document.Form1.txtNationalID.disabled = true ;
document.Form1.comboIssDay.disabled = true ;
document.Form1.comboIssMnth.disabled = true ;
document.Form1.comboIssYear.disabled = true ;
document.Form1.txtIssLoc.disabled = true ;
document.Form1.txtGOSI.disabled = true ;
document.Form1.txtPassNo.disabled = false;
document.Form1.comboPassDay.disabled = false;
document.Form1.comboPassMnth.disabled = false;
document.Form1.comboPassYear.disabled = false;
document.Form1.txtIqamaNo.disabled = false;

}
}


function othercomboMajorD()
{
if("Other"==Form1.comboMajorD.value)
document.Form1.txtOMajorD.disabled = false
else
{
document.Form1.txtOMajorD.value="";
document.Form1.txtOMajorD.disabled = true;
}
}



function othercomboMajorB()
{
if("Other"==Form1.comboMajorB.value)
document.Form1.txtOMajorB.disabled = false
else
{
document.Form1.txtOMajorB.value="";
document.Form1.txtOMajorB.disabled = true;
}
}

function othercomboMajorPG()
{
if("Other"==Form1.comboMajorPG.value)
document.Form1.txtOMajorPG.disabled = false
else
{
document.Form1.txtOMajorPG.value="";
document.Form1.txtOMajorPG.disabled = true;
}
}


function highschool()
{
if (document.Form1.chkHS.checked){ 
document.Form1.txtSNameH.disabled = false ; 
document.Form1.comboCountryH.disabled = false;
document.Form1.comboGradYearHS.disabled = false; 
document.Form1.txtCityH.disabled = false;
document.Form1.comboMajorH.disabled = false; 
document.Form1.txtHSPer.disabled = false;
document.Form1.comboStudyTypeH.disabled = false;
document.Form1.chkD.disabled = true;
document.Form1.chkB.disabled = true;
document.Form1.chkPG.disabled = true;
}
else
{
document.Form1.txtSNameH.value=""; 
document.Form1.comboCountryH.value= document.Form1.comboCountryH[0].value; 
document.Form1.comboGradYearHS.value=document.Form1.comboGradYearHS[0].value; 
document.Form1.txtCityH.value="";
document.Form1.comboMajorH.value="";
document.Form1.txtHSPer.value="";
document.Form1.comboStudyTypeH.value =document.Form1.comboStudyTypeH[0].value;
document.Form1.txtSNameH.disabled = true ; 
document.Form1.comboCountryH.disabled = true;
document.Form1.comboGradYearHS.disabled = true ; 
document.Form1.txtCityH.disabled = true;
document.Form1.comboMajorH.disabled = true ; 
document.Form1.txtHSPer.disabled = true;
document.Form1.comboStudyTypeH.disabled = true;
document.Form1.chkD.disabled = false;
document.Form1.chkB.disabled = false;
document.Form1.chkPG.disabled = false;
}
}


function enable_diploma()
{
if (document.Form1.chkD.checked){ 
document.Form1.txtSNameD.disabled = false ; 
document.Form1.comboCountryD.disabled = false;
document.Form1.comboGradYearDip.disabled = false ; 
document.Form1.txtCityD.disabled = false;
document.Form1.comboMajorD.disabled = false ; 
document.Form1.GPAPerD[0].disabled = false;
document.Form1.GPAPerD[1].disabled = false;
document.Form1.comboStudyTypeD.disabled = false;
document.Form1.chkHS.disabled = true;
document.Form1.chkB.disabled = true;
document.Form1.chkPG.disabled = true;
}
else
{
document.Form1.txtSNameD.value="" ; 
document.Form1.comboCountryD.value=document.Form1.comboCountryD[0].value; 
document.Form1.comboGradYearDip.value=document.Form1.comboGradYearDip[0].value; 
document.Form1.txtCityD.value=""; 
document.Form1.comboMajorD.value=document.Form1.comboMajorD[0].value; 
document.Form1.GPAPerD[0].value=""; 
document.Form1.GPAPerD[1].value=""; 
document.Form1.txtDipPer.value=""; 
document.Form1.comboGPADip.value= document.Form1.comboGPADip[0].value; document.Form1.txtGPAD.value=""; 
document.Form1.txtOMajorD.value="";
document.Form1.comboStudyTypeD.value= document.Form1.comboStudyTypeD[0].value;
document.Form1.txtSNameD.disabled = true ; 
document.Form1.comboCountryD.disabled = true ;
document.Form1.comboGradYearDip.disabled = true; 
document.Form1.txtCityD.disabled = true ;
document.Form1.comboMajorD.disabled = true; 
document.Form1.GPAPerD[0].disabled = true;
document.Form1.GPAPerD[1].disabled = true;
document.Form1.txtDipPer.disabled = true ;
document.Form1.comboGPADip.disabled = true ;
document.Form1.txtGPAD.disabled = true ;
document.Form1.txtOMajorD.disabled = true ;
document.Form1.comboStudyTypeD.disabled = true;
document.Form1.chkHS.disabled = false;
document.Form1.chkB.disabled = false;
document.Form1.chkPG.disabled = false;

}
}

function enable_Bachelor()
{
if (document.Form1.chkB.checked){ 
document.Form1.txtSNameB.disabled = false ; 
document.Form1.comboCountryB.disabled = false;
document.Form1.comboGradYearBach.disabled = false ; 
document.Form1.txtCityB.disabled = false;document.Form1.comboMajorB.disabled = false ; 
document.Form1.GPAPerB[0].disabled = false;document.Form1.GPAPerB[1].disabled = false;
document.Form1.comboStudyTypeB.disabled = false;
document.Form1.chkHS.disabled = true;
document.Form1.chkD.disabled = true;
document.Form1.chkPG.disabled = true;
}
else
{
document.Form1.txtSNameB.value=""; 
document.Form1.txtOMajorB.value=""; 
document.Form1.comboCountryB.value= document.Form1.comboCountryB[0].value; 
document.Form1.comboGradYearBach.value=document.Form1.comboGradYearBach[0].value; 
document.Form1.txtCityB.value=""; 
document.Form1.comboMajorB.value=document.Form1.comboMajorB[0].value; 
document.Form1.GPAPerB[0].value=""; document.Form1.GPAPerB[1].value=""; 
document.Form1.comboGPABach.value=document.Form1.comboGPABach[0].value; 
document.Form1.txtGPAB.value=""; document.Form1.txtBachPer.value="";
document.Form1.comboStudyTypeB.value=document.Form1.comboStudyTypeB[0].value ;
document.Form1.txtSNameB.disabled = true ; 
document.Form1.comboCountryB.disabled = true; 
document.Form1.comboGradYearBach.disabled = true ; 
document.Form1.txtCityB.disabled = true; 
document.Form1.comboMajorB.disabled =true ; 
document.Form1.txtOMajorB.disabled = true; 
document.Form1.GPAPerB[0].disabled = true;
document.Form1.GPAPerB[1].disabled = true; 
document.Form1.txtGPAB.disabled = true; 
document.Form1.comboGPABach.disabled = true; 
document.Form1.txtBachPer.disabled = true;
document.Form1.comboStudyTypeB.disabled=true;
document.Form1.chkHS.disabled = false;
document.Form1.chkD.disabled = false;
document.Form1.chkPG.disabled = false;
}
}

function enable_Post_Graduate()
{
if (document.Form1.chkPG.checked){ 
document.Form1.txtSNamePG.disabled = false ; 
document.Form1.comboCountryPG.disabled = false;
document.Form1.comboGradYearPG.disabled = false ; 
document.Form1.txtCityPG.disabled = false;
document.Form1.comboMajorPG.disabled = false ; 
document.Form1.GPAPerPG[0].disabled = false;
document.Form1.GPAPerPG[1].disabled = false;
document.Form1.comboDegEarn.disabled = false ;
document.Form1.comboStudyType.disabled = false;
document.Form1.chkHS.disabled = true;
document.Form1.chkD.disabled = true;
document.Form1.chkB.disabled = true;
}
else
{
document.Form1.comboDegEarn.value=document.Form1.comboDegEarn[0].value; document.Form1.txtSNamePG.value=""; 
document.Form1.comboCountryPG.value=document.Form1.comboCountryPG[0].value; 
document.Form1.comboGradYearPG.value=document.Form1.comboGradYearPG[0].value; 
document.Form1.txtCityPG.value=""; 
document.Form1.comboMajorPG.value=document.Form1.comboMajorPG[0].value; 
document.Form1.txtOMajorPG.value=""; document.Form1.GPAPerPG[0].value=""; 
document.Form1.GPAPerPG[1].value=""; 
document.Form1.comboGPAPG.value=document.Form1.comboGPAPG[0].value; 
document.Form1.txtGPAPG.value=""; document.Form1.txtPGPer.value="";
document.Form1.comboStudyType.value=document.Form1.comboStudyType[0].value;
document.Form1.comboGPAPG.disabled = true; 
document.Form1.txtGPAPG.disabled = true; 
document.Form1.txtPGPer.disabled = true;
document.Form1.txtSNamePG.disabled =true ; 
document.Form1.comboCountryPG.disabled = true;
document.Form1.comboGradYearPG.disabled = true ; 
document.Form1.txtCityPG.disabled = true;
document.Form1.comboMajorPG.disabled =true ; 
document.Form1.txtOMajorPG.disabled = true; 
document.Form1.GPAPerPG[0].disabled = true;
document.Form1.GPAPerPG[1].disabled = true;
document.Form1.comboDegEarn.disabled = true; 
document.Form1.comboStudyType.disabled = true;
document.Form1.chkHS.disabled = false;
document.Form1.chkD.disabled = false;
document.Form1.chkB.disabled = false;
}
}
function enable_Employment1()
{
if (document.Form1.chkEmp1.checked){ 
document.Form1.txtEmpName1.disabled = false ; 
document.Form1.txtEmpCity1.disabled = false;
document.Form1.txtEmpPos1.disabled = false ; 
document.Form1.txtSal1.disabled = false;
document.Form1.comboFrmMnth1.disabled = false ; 
document.Form1.comboFrmYearEmp1.disabled = false;
document.Form1.comboToMnth1.disabled = false ; 
document.Form1.comboToYearEmp1.disabled = false;
}
else
{
document.Form1.txtEmpName1.value=""; 
document.Form1.txtEmpCity1.value=""; 
document.Form1.txtEmpPos1.value=""; 
document.Form1.txtSal1.value=""; 
document.Form1.comboFrmMnth1.value=""; 
document.Form1.comboFrmYearEmp1.value=""; 
document.Form1.comboToMnth1.value="";
document.Form1.comboToYearEmp1.value="";
document.Form1.txtEmpName1.disabled = true ; 
document.Form1.txtEmpCity1.disabled = true;
document.Form1.txtEmpPos1.disabled = true ; 
document.Form1.txtSal1.disabled = true;
document.Form1.comboFrmMnth1.disabled = true ; 
document.Form1.comboFrmYearEmp1.disabled = true;
document.Form1.comboToMnth1.disabled = true ; 
document.Form1.comboToYearEmp1.disabled = true;
}
}
function enable_Employment2()
{
if (document.Form1.chkEmp2.checked){ 
document.Form1.txtEmpName2.disabled = false ; 
document.Form1.txtEmpCity2.disabled = false;
document.Form1.txtEmpPos2.disabled = false ; 
document.Form1.txtSal2.disabled = false;document.Form1.comboFrmMnth2.disabled = false ; 
document.Form1.comboFrmYearEmp2.disabled = false;
document.Form1.comboToMnth2.disabled = false ; 
document.Form1.comboToYearEmp2.disabled = false;
}
else
{
document.Form1.txtEmpName2.value=""; 
document.Form1.txtEmpCity2.value=""; 
document.Form1.txtEmpPos2.value=""; 
document.Form1.txtSal2.value=""; 
document.Form1.comboFrmMnth2.value=""; 
document.Form1.comboFrmYearEmp2.value=""; 
document.Form1.comboToMnth2.value="";
document.Form1.comboToYearEmp2.value="";
document.Form1.txtEmpName2.disabled = true ; 
document.Form1.txtEmpCity2.disabled = true;
document.Form1.txtEmpPos2.disabled = true ; 
document.Form1.txtSal2.disabled = true;
document.Form1.comboFrmMnth2.disabled = true ; 
document.Form1.comboFrmYearEmp2.disabled = true;
document.Form1.comboToMnth2.disabled = true ; 
document.Form1.comboToYearEmp2.disabled = true;
}
}
function enable_Employment3()
{
if (document.Form1.chkEmp3.checked){ 
document.Form1.txtEmpName3.disabled = false ; 
document.Form1.txtEmpCity3.disabled = false;
document.Form1.txtEmpPos3.disabled = false ; 
document.Form1.txtSal3.disabled = false;
document.Form1.comboFrmMnth3.disabled = false ; 
document.Form1.comboFrmYearEmp3.disabled = false;
document.Form1.comboToMnth3.disabled = false ; 
document.Form1.comboToYearEmp3.disabled = false;
}
else
{
document.Form1.txtEmpName3.value=""; 
document.Form1.txtEmpCity3.value=""; 
document.Form1.txtEmpPos3.value=""; 
document.Form1.txtSal3.value=""; 
document.Form1.comboFrmMnth3.value=""; 
document.Form1.comboFrmYearEmp3.value=""; 
document.Form1.comboToMnth3.value="";
document.Form1.comboToYearEmp3.value="";
document.Form1.txtEmpName3.disabled = true ; 
document.Form1.txtEmpCity3.disabled = true;
document.Form1.txtEmpPos3.disabled = true ; 
document.Form1.txtSal3.disabled = true;
document.Form1.comboFrmMnth3.disabled = true ; 
document.Form1.comboFrmYearEmp3.disabled = true;
document.Form1.comboToMnth3.disabled = true ; 
document.Form1.comboToYearEmp3.disabled = true;
}
}

function validateForm(Form1)
{

if(Form1.comboTargettedJobs.selectedIndex==0)
{
alert(". الرجاء ادخال الوظيفة المستهدفة");
document.Form1.comboTargettedJobs.focus();
return false;
}

if(""==document.Form1.txtFName.value)
{
alert(".الرجاء ادخال الاسم الأول");
document.Form1.txtFName.focus();
return false;
}

if(""==document.Form1.txtFathName.value)
{
alert(".الرجاء ادخال اسم الأب");
document.Form1.txtFathName.focus();
return false;
}

if(""==document.Form1.txtGFName.value)
{

alert(".الرجاء ادخال اسم الجد ");
document.Form1.txtGFName.focus();
return false;
}
if(""==document.Form1.txtLName.value)
{
alert(".الرجاء ادخال اسم العائلة");
document.Form1.txtLName.focus();
return false;
}
if (document.Form1.chkHS.checked) 
{
if(""==document.Form1.txtSNameH.value)
{
alert(".الرجاء ادخال اسم المدرسة");
document.Form1.txtSNameH.focus();
return false;
}
if (Form1.comboCountryH.selectedIndex==0) 
{
alert(".الرجاء  اختر الدولة");
document.Form1.comboCountryH.focus();
return false;
}
if (Form1.comboGradYearHS.selectedIndex==0) 
{
alert(".الرجاء اختر سنة التخرج");
document.Form1.comboGradYearHS.focus();
return false;
}

if(""==document.Form1.txtCityH.value)
{
alert(".الرجاء ادخال اسم المدينة");
document.Form1.txtCityH.focus();
return false;
}

if (Form1.comboMajorH.selectedIndex==0) 
{
alert(".الرجاء اختر التخصص");
document.Form1.comboMajorH.focus();
return false;
}
if(""==document.Form1.txtHSPer.value)
{

alert(".الرجاء ادخال النسبة");
document.Form1.txtHSPer.focus();
return false;

}


if(""!=document.Form1.txtHSPer.value)
{

var perh=document.Form1.txtHSPer
		
	if (checkperh(perh.value)==false){
		alert(".الرجاء أدخل النسبة الصحيحة ارقام فقط");
		perh.value="";
		perh.focus();
		return false
	}

        if (document.Form1.txtHSPer.value < "50"){
		alert(".النسبة يجب ان تكون 50 او اعلى");
		perh.value="";
		perh.focus();
		return false
	}

      

}




if(""==document.Form1.comboStudyTypeH.value)
{
alert(".الرجاء اختر نوع الدراسة");
document.Form1.comboStudyTypeH.focus();
return false;
}
}

if (document.Form1.chkD.checked) 
{
if(""==document.Form1.txtSNameD.value)
{
alert(".الرجاء ادخال اسم  كلية / معهد/جامعة");
document.Form1.txtSNameD.focus();
return false;
}
if (Form1.comboCountryD.selectedIndex==0) 
{
alert(".الرجاء  اختر الدولة");
document.Form1.comboCountryD.focus();
return false;
}
if (Form1.comboGradYearDip.selectedIndex==0) 
{
alert(".الرجاء اختر سنة التخرج");
document.Form1.comboGradYearDip.focus();
return false;
}

if(""==document.Form1.txtCityD.value)
{
alert(".الرجاء ادخال اسم المدينة");
document.Form1.txtCityD.focus();
return false;
}

if (Form1.comboMajorD.selectedIndex==0) 
{
alert(".الرجاء اختر التخصص");
document.Form1.comboMajorD.focus();
return false;
}
if("Other"==Form1.comboMajorD.value)
{
document.Form1.txtOMajorD.disabled = false
if(""==document.Form1.txtOMajorD.value)
{
alert(".الرجاء ادخال التخصص الاخر");
document.Form1.txtOMajorD.focus();
return false;
}
}

if((""==document.Form1.txtDipPer.value) && (""==document.Form1.txtGPAD.value))
{
alert(".الرجاء اختر النسبة او المعدل");
document.Form1.GPAPerD[0].focus();
return false;

}

if (document.Form1.GPAPerD[0].checked)
{
document.Form1.txtDipPer.value="";
if(""==document.Form1.txtGPAD.value)
{
alert(".الرجاء ادخال المعدل");
document.Form1.txtGPAD.focus();
return false;
}

if(""!=document.Form1.txtGPAD.value)
{

if("0"==document.Form1.comboGPADip.value)
{
                alert(".الرجاء اختر درجة المعدل");
		document.Form1.comboGPADip.focus();
		return false
}
var gpad=document.Form1.txtGPAD
		
	if (checkgpad(gpad.value)==false){
		alert(".الرجاء ادخال المعدل الصحيح ارقام فقط");
		gpad.value="";
		gpad.focus();
		return false
	}

         if (document.Form1.txtGPAD.value > "5"){
		alert("المعدل يجب ان يكون 5 او اقل");
		gpad.value="";
		gpad.focus();
		return false
	}
      
}
}

if (document.Form1.GPAPerD[1].checked)
{
document.Form1.txtGPAD.value="";
document.Form1.comboGPADip.value="0";
if(""==document.Form1.txtDipPer.value)
{
alert(".الرجاء ادخال النسبة");
document.Form1.txtDipPer.focus();
return false;
}
if(""!=document.Form1.txtDipPer.value)
{

var perd=document.Form1.txtDipPer
		
	if (checkperd(perd.value)==false){
		alert(".الرجاء ادخال النسبة الصحيحة ارقام فقط");
		perd.value="";
		perd.focus();
		return false
	}

        if (document.Form1.txtDipPer.value < "50"){
		alert("النسبة يجب ان تكون 50 او اعلى");
		perd.value="";
		perd.focus();
		return false
	}
      
}
}
if(""==document.Form1.comboStudyTypeD.value)
{
alert(".الرجاء اختر نوع الدراسة");
document.Form1.comboStudyTypeD.focus();
return false;
}

}


if (document.Form1.chkB.checked) 
{
if(""==document.Form1.txtSNameB.value)
{
alert(".الرجاء ادخال اسم  كلية / معهد/جامعة");
document.Form1.txtSNameB.focus();
return false;
}
if (Form1.comboCountryB.selectedIndex==0) 
{
alert(".الرجاء  اختر الدولة");
document.Form1.comboCountryB.focus();
return false;
}
if (Form1.comboGradYearBach.selectedIndex==0) 
{
alert(".الرجاء اختر سنة التخرج");
document.Form1.comboGradYearBach.focus();
return false;
}

if(""==document.Form1.txtCityB.value)
{
alert(".الرجاء ادخال اسم المدينة");
document.Form1.txtCityB.focus();
return false;
}

if (Form1.comboMajorB.selectedIndex==0) 
{
alert(".الرجاء اختر التخصص");
document.Form1.comboMajorB.focus();
return false;
}
if("Other"==Form1.comboMajorB.value)
{
document.Form1.txtOMajorB.disabled = false
if(""==document.Form1.txtOMajorB.value)
{
alert(".الرجاء ادخال التخصص الاخر");
document.Form1.txtOMajorB.focus();
return false;
}
}

if((""==document.Form1.txtGPAB.value) && (""==document.Form1.txtBachPer.value))
{
alert(".الرجاء اختر النسبة او المعدل");
document.Form1.GPAPerB[0].focus();
return false;

}

if (document.Form1.GPAPerB[0].checked)
{
document.Form1.txtBachPer.value="";
if(""==document.Form1.txtGPAB.value)
{
alert(".الرجاء ادخال المعدل");
document.Form1.txtGPAB.focus();
return false;
}


if(""!=document.Form1.txtGPAB.value)
{

if("0"==document.Form1.comboGPABach.value)
{
                alert(".الرجاء اختر درجة المعدل");
		document.Form1.comboGPABach.focus();
		return false
}
var gpab=document.Form1.txtGPAB
		
	if (checkgpab(gpab.value)==false){
		alert(".الرجاء ادخال المعدل الصحيح ارقام فقط");
		gpab.value="";
		gpab.focus();
		return false
	}

         if (document.Form1.txtGPAB.value > "5"){
		alert("المعدل يجب ان يكون 5 او اقل");
		gpab.value="";
		gpab.focus();
		return false
	}
      
}

}

if (document.Form1.GPAPerB[1].checked)
{
document.Form1.txtGPAB.value="";
document.Form1.comboGPABach.value="0";
if(""==document.Form1.txtBachPer.value)
{
alert(".الرجاء ادخال النسبة");
document.Form1.txtBachPer.focus();
return false;
}

if(""!=document.Form1.txtBachPer.value)
{

var perb=document.Form1.txtBachPer
		
	if (checkperd(perb.value)==false){
		alert(".الرجاء ادخال النسبة الصحيحة ارقام فقط");
		perb.value="";
		perb.focus();
		return false
	}

        if (document.Form1.txtBachPer.value < "50"){
		alert("النسبة يجب ان تكون 50 او اعلى");
		perb.value="";
		perb.focus();
		return false
	}
      
}


}
if(""==document.Form1.comboStudyTypeB.value)
{
alert(".الرجاء اختر نوع الدراسة");
document.Form1.comboStudyTypeB.focus();
return false;
}

}


if (document.Form1.chkPG.checked) 
{

if (Form1.comboDegEarn.selectedIndex==0) 
{
alert(".الرجاء اختر الشهادة");
document.Form1.comboDegEarn.focus();
return false;
}


if(""==document.Form1.txtSNamePG.value)
{
alert(".الرجاء ادخال اسم  كلية / معهد/جامعة");
document.Form1.txtSNamePG.focus();
return false;
}
if (Form1.comboCountryPG.selectedIndex==0) 
{
alert(".الرجاء  اختر الدولة");
document.Form1.comboCountryPG.focus();
return false;
}
if (Form1.comboGradYearPG.selectedIndex==0) 
{
alert(".الرجاء اختر سنة التخرج");
document.Form1.comboGradYearPG.focus();
return false;
}

if(""==document.Form1.txtCityPG.value)
{
alert(".الرجاء ادخال اسم المدينة");
document.Form1.txtCityPG.focus();
return false;
}

if (Form1.comboMajorPG.selectedIndex==0) 
{
alert(".الرجاء اختر التخصص");
document.Form1.comboMajorPG.focus();
return false;
}
if("Other"==Form1.comboMajorPG.value)
{
document.Form1.txtOMajorPG.disabled = false
if(""==document.Form1.txtOMajorPG.value)
{
alert(".الرجاء ادخال التخصص الاخر");
document.Form1.txtOMajorPG.focus();
return false;
}
}

if((""==document.Form1.txtGPAPG.value) && (""==document.Form1.txtPGPer.value))
{
alert(".الرجاء اختر النسبة او المعدل");
document.Form1.GPAPerPG[0].focus();
return false;

}

if (document.Form1.GPAPerPG[0].checked)
{
document.Form1.txtPGPer.value="";
if(""==document.Form1.txtGPAPG.value)
{
alert(".الرجاء ادخال المعدل");
document.Form1.txtGPAPG.focus();
return false;
}

if(""!=document.Form1.txtGPAPG.value)
{

if("0"==document.Form1.comboGPAPG.value)
{
                alert(".الرجاء اختر درجة المعدل");
		document.Form1.comboGPAPG.focus();
		return false
}
var gpap=document.Form1.txtGPAPG
		
	if (checkgpap(gpap.value)==false){
		alert(".الرجاء ادخال المعدل الصحيح ارقام فقط");
		gpap.value="";
		gpap.focus();
		return false
	}

         if (document.Form1.txtGPAPG.value > "5"){
		alert("المعدل يجب ان يكون 5 او اقل");
		gpap.value="";
		gpap.focus();
		return false
	}
      
}



}

if (document.Form1.GPAPerPG[1].checked)
{
document.Form1.txtGPAPG.value="";
document.Form1.comboGPAPG.value="0";
if(""==document.Form1.txtPGPer.value)
{
alert(".الرجاء ادخال النسبة");
document.Form1.txtPGPer.focus();
return false;
}

if(""!=document.Form1.txtPGPer.value)
{

var perp=document.Form1.txtPGPer
		
	if (checkperp(perp.value)==false){
		alert(".الرجاء ادخال النسبة الصحيحة ارقام فقط");
		perp.value="";
		perp.focus();
		return false
	}

        if (document.Form1.txtPGPer.value < "50"){
		alert("النسبة يجب ان تكون 50 او اعلى");
		perp.value="";
		perp.focus();
		return false
	}
      
}

}

if (Form1.comboStudyType.selectedIndex==0) 
{
alert(".الرجاء اختر نوع الدراسة");
document.Form1.comboStudyType.focus();
return false;
}

}

if((!document.Form1.chkHS.checked) && (!document.Form1.chkD.checked) && (!document.Form1.chkB.checked) && (!document.Form1.chkPG.checked))
{
alert(".الرجاء اختر احدى المراحل التعليمية");
document.Form1.chkHS.focus();
return false;
}

if ((document.Form1.chkEmp1.checked) || (document.Form1.chkEmp2.checked)|| (document.Form1.chkEmp3.checked))
{
if(""==document.Form1.txtTotExp.value)
{
alert(".الرجاء اختر عدد سنوات الخبرة");
document.Form1.txtTotExp.focus();
return false;
}
}

if (document.Form1.chkEmp1.checked) 
{

if(""==document.Form1.txtEmpName1.value)
{
alert(".االرجاء ادخال اسم البنك/الشركة");
document.Form1.txtEmpName1.focus();
return false;
}


if(""==document.Form1.txtEmpCity1.value)
{
alert(".الرجاء ادخال المدينة");
document.Form1.txtEmpCity1.focus();
return false;
}

if(""==document.Form1.txtEmpPos1.value)
{
alert(".الرجاء ادخال اسم الوظيفة");
document.Form1.txtEmpPos1.focus();
return false;
}

if(""==document.Form1.txtSal1.value)
{
alert(".الرجاء ادخال الراتب");
document.Form1.txtSal1.focus();
return false;
}


if (Form1.comboFrmMnth1.selectedIndex==0) 
{
alert(".الرجاء اختر الشهر من بداية تاريخ الوظيفة");
document.Form1.comboFrmMnth1.focus();
return false;
}

if (Form1.comboFrmYearEmp1.selectedIndex==0) 
{
alert(".الرجاء اختر السنة من بداية تاريخ الوظيفة");
document.Form1.comboFrmYearEmp1.focus();
return false;
}

if (Form1.comboToMnth1.selectedIndex==0) 
{
alert(" .الرجاء اختر الشهر من نهاية تاريخ الوظيفة");
document.Form1.comboToMnth1.focus();
return false;
}

if (Form1.comboToYearEmp1.selectedIndex==0) 
{
alert(".الرجاء اختر السنة من نهاية تاريخ الوظيفة");
document.Form1.comboToYearEmp1.focus();
return false;
}

}


if (document.Form1.chkEmp2.checked) 
{

if(""==document.Form1.txtEmpName2.value)
{
alert(".االرجاء ادخال اسم البنك/الشركة");
document.Form1.txtEmpName2.focus();
return false;
}


if(""==document.Form1.txtEmpCity2.value)
{
alert(".الرجاء ادخال المدينة");
document.Form1.txtEmpCity2.focus();
return false;
}

if(""==document.Form1.txtEmpPos2.value)
{
alert(".الرجاء ادخال اسم الوظيفة");
document.Form1.txtEmpPos2.focus();
return false;
}

if(""==document.Form1.txtSal2.value)
{
alert(".الرجاء ادخال الراتب");
document.Form1.txtSal2.focus();
return false;
}


if (Form1.comboFrmMnth2.selectedIndex==0) 
{
alert(".الرجاء اختر الشهر من بداية تاريخ الوظيفة");
document.Form1.comboFrmMnth2.focus();
return false;
}

if (Form1.comboFrmYearEmp2.selectedIndex==0) 
{
alert(".الرجاء اختر السنة من بداية تاريخ الوظيفة");
document.Form1.comboFrmYearEmp2.focus();
return false;
}

if (Form1.comboToMnth2.selectedIndex==0) 
{
alert(" .الرجاء اختر الشهر من نهاية تاريخ الوظيفة");
document.Form1.comboToMnth2.focus();
return false;
}

if (Form1.comboToYearEmp2.selectedIndex==0) 
{
alert(".الرجاء اختر السنة من نهاية تاريخ الوظيفة");
document.Form1.comboToYearEmp2.focus();
return false;
}


}



if (document.Form1.chkEmp3.checked) 
{

if(""==document.Form1.txtEmpName3.value)
{
alert(".االرجاء ادخال اسم البنك/الشركة");
document.Form1.txtEmpName3.focus();
return false;
}


if(""==document.Form1.txtEmpCity3.value)
{
alert(".الرجاء ادخال المدينة");
document.Form1.txtEmpCity3.focus();
return false;
}

if(""==document.Form1.txtEmpPos3.value)
{
alert(".الرجاء ادخال اسم الوظيفة");
document.Form1.txtEmpPos3.focus();
return false;
}

if(""==document.Form1.txtSal3.value)
{
alert(".الرجاء ادخال الراتب");
document.Form1.txtSal3.focus();
return false;
}


if (Form1.comboFrmMnth3.selectedIndex==0) 
{
alert(".الرجاء اختر الشهر من بداية تاريخ الوظيفة");
document.Form1.comboFrmMnth3.focus();
return false;
}

if (Form1.comboFrmYearEmp3.selectedIndex==0) 
{
alert(".الرجاء اختر السنة من بداية تاريخ الوظيفة");
document.Form1.comboFrmYearEmp3.focus();
return false;
}

if (Form1.comboToMnth3.selectedIndex==0) 
{
alert(" .الرجاء اختر الشهر من نهاية تاريخ الوظيفة");
document.Form1.comboToMnth3.focus();
return false;
}

if (Form1.comboToYearEmp3.selectedIndex==0) 
{
alert(".الرجاء اختر السنة من نهاية تاريخ الوظيفة");
document.Form1.comboToYearEmp3.focus();
return false;
}


}

if (Form1.comboEngProf.selectedIndex==0) 
{
alert(".الرجاء اختر مهارات اللغة الانجليزية");
document.Form1.comboEngProf.focus();
return false;
}


if (Form1.comboCompLit.selectedIndex==0) 
{
alert(".الرجاء اختر مهارات الحاسب الالي");
document.Form1.comboCompLit.focus();
return false;
}






if (Form1.comboDOBDayG.selectedIndex==0) 
{
alert(".الرجاء ادخال اليوم من تاريخ الميلاد");
document.Form1.comboDOBDayG.focus();
return false;
}

if (Form1.comboDOBMnthG.selectedIndex==0) 
{
alert(".الرجاء اختر الشهر من تاريخ الميلاد");
document.Form1.comboDOBMnthG.focus();
return false;
}
if (Form1.comboDOBYearEmpG.selectedIndex==0) 
{
alert(".الرجاء اختر السنة من تاريخ الميلاد");
document.Form1.comboDOBYearEmpG.focus();
return false;
}

if(""==document.Form1.txtPOB.value)
{
alert(".الرجاء ادخال مكان الميلاد ");
document.Form1.txtPOB.focus();
return false;
}

if (Form1.comboNational.selectedIndex==0) 
{
alert(".الرجاء اختر الجنسية");
document.Form1.comboNational.focus();
return false;
}

if("Saudi Arabian"==Form1.comboNational.value)
{
var idnum=document.Form1.txtNationalID
	
	if ((idnum.value==null)||(idnum.value=="")){
		alert(".االرجاء ادخال رقم البطاقة");
		idnum.focus();
		return false
	}
	if (checkIdNum(idnum.value)==false){
		alert(".الرجاء ادخال الرقم الصحيح ارقام فقط");
		idnum.value="";
		idnum.focus();
		return false
	}

if(""==document.Form1.comboIssDay.value)
{
alert(".الرجاء اختر اليوم من تاريخ اصدار البطاقة ");
document.Form1.comboIssDay.focus();
return false;
}

if(""==document.Form1.comboIssMnth.value)
{
alert(".الرجاء ادخال الشهر من تاريخ اصدار البطاقة");
document.Form1.comboIssMnth.focus();
return false;
}

if(""==document.Form1.comboIssYear.value)
{
alert(".الرجاء ادخال السنة من تاريخ اصدار البطاقة");
document.Form1.comboIssYear.focus();
return false;
}


if(""==document.Form1.txtIssLoc.value)
{
alert(".الرجاء ادخال مكان اصدار البطاقة");
document.Form1.txtIssLoc.focus();
return false;
}


}

else {

if(""==document.Form1.txtPassNo.value)
{
alert(".الرجاء ادخال رقم جواز السفر");
document.Form1.txtPassNo.focus();
return false;
}

if(""==document.Form1.comboPassDay.value)
{
alert(".الرجاء اختر اليوم من تاريخ اصدار الجواز");
document.Form1.comboPassDay.focus();
return false;
}

if(""==document.Form1.comboPassMnth.value)
{
alert(".الرجاء اختر الشهرمن تاريخ  اصدار الجواز");
document.Form1.comboPassMnth.focus();
return false;
}

if(""==document.Form1.comboPassYear.value)
{
alert(".الرجاء اختر السنة من تاريخ  اصدار الجواز");
document.Form1.comboPassYear.focus();
return false;
}

}


if (Form1.comboBlood.selectedIndex==0) 
{
alert(".الرجاء اختر فصيلة الدم");
document.Form1.comboBlood.focus();
return false;
}
if (Form1.comboMaritalStatus.selectedIndex==0) 
{
alert(".الرجاء اختر الحالة الاجتماعية");
document.Form1.comboMaritalStatus.focus();
return false;
}
if (Form1.comboGender.selectedIndex==0) 
{
alert(".الرجاء اختر الجنس");
document.Form1.comboGender.focus();
return false;
}

if(""==document.Form1.txtPBNo.value)
{
boxn=document.Form1.txtPBNo
	
	if ((boxn.value==null)||(boxn.value=="")){
		alert(".الرجاء ادخال رقم الصندوق البريدي");
		boxn.focus();
		return false
	}
	
}

if(""!=document.Form1.txtPBNo.value)
{
bxn=document.Form1.txtPBNo                
                
                if (checkbx(bxn.value)==false){
		alert(".الرجاء ادخال الرقم الصحيح ارقام فقط");
		bxn.value="";
		bxn.focus();
		return false
	}
}

if(""==document.Form1.txtCity.value)
{
alert(".الرجاء ادخال المدينة");
document.Form1.txtCity.focus();
return false;
}
if(""==document.Form1.txtZipCode.value)
{
    zib=document.Form1.txtZipCode
	
	if ((zib.value==null)||(zib.value=="")){
		alert(".الرجاء ادخال الرمز البريدي");
		zib.focus();
		return false
	}
}	

if(""!=document.Form1.txtZipCode.value)
{
zip1=document.Form1.txtZipCode                
                
                if (checkzip(zip1.value)==false){
		alert(".الرجاء ادخال الرقم الصحيح ارقام فقط");
		zip1.value="";
		zip1.focus();
		return false
	}
}

if(""==document.Form1.txtEmail.value)

{
	emailID1=document.Form1.txtEmail
	
	if ((emailID1.value==null)||(emailID1.value=="")){
		alert(".الرجاء ادخال عنوان االبريد الالكتروني ");
		emailID1.focus();
		return false;
	}

}
if(""!=document.Form1.txtEmail.value)
{
        emailID=document.Form1.txtEmail          
                
                if (echeck(emailID.value)==false){
		emailID.value="";
		emailID.focus();
		return false;
	}

}

if(""==document.Form1.txtPhone.value)
{

Phone=document.Form1.txtPhone
	
	if ((Phone.value==null)||(Phone.value=="")){
		alert("الرجاء ادخال رقم هاتف المنزل.");
		Phone.focus();
		return false
	}
}

if(""!=document.Form1.txtPhone.value)
{
Phone1=document.Form1.txtPhone            
                
                if (checkphone(Phone1.value)==false){
		alert(".الرجاء ادخال الرقم الصحيح ارقام فقط");
		Phone1.value="";
		Phone1.focus();
		return false
	}
}

if(""==document.Form1.txtMobile.value)
{

Phonemob=document.Form1.txtMobile
	
	if ((Phonemob.value==null)||(Phonemob.value=="")){
		alert(".الرجاء ادخال رقم الهاتف الجوال");
		Phonemob.focus();
		return false
	}
}

if(""!=document.Form1.txtMobile.value)
{
Phonemob1=document.Form1.txtMobile               
                
                if (checkmob(Phonemob1.value)==false){
		alert(".الرجاء ادخال الرقم الصحيح ارقام فقط");
		Phonemob1.value="";
		Phonemob1.focus();
		return false
	}
}


if(""!=document.Form1.txtProfObj.value)
{
var textObj= document.Form1.txtProfObj.value
                
                if (textObj.length > 500) {
                alert(".الأهداف المهنية يجب أن تكون أقل من 500 حرف");
                document.Form1.txtProfObj.focus();
                return false;
                  }
               
}


if(""!=document.Form1.txtAddnInfo.value)
{
var textadd= document.Form1.txtAddnInfo.value
                
                if (textadd.length > 500) {
                alert(".المعلومات إضافية يجب أن تكون أقل من 500 حرف");
                document.Form1.txtAddnInfo.focus();
                return false;
                  }
               
}


}

