// JavaScript Document
function checkPw(form) {
userName = form1.userName.value;
password = form1.password.value;
if (userName.length == 0 ){
alert ("\n الرجاء إدخال الرقم الوظيفي ")
form1.userName.focus();
return false;
}
if (password.length == 0 ) {
alert ("\nالرجاء إدخال كلمة المرور الصحيحة")
form1.password.focus();
return false;
}
if (password.length != 0 ){
 for (i = 0; i < password.length; i++) {
	if (!( (password.charAt(i) >= "a" || password.charAt(i) >= "A") && (password.charAt(i) <= "z" || password.charAt(i) >= "Z") || (password.charAt(i) >= "0") && (password.charAt(i) <= "9")) ){
	  alert(" الرجاء إدخال حروف لاتينية في خانة كلمة السر" )
	  return false;
	  break;
	} // inner if	
 } // END for   
} // outer if

else return true;
}

function checkPwTwo(form) {
userName = form1.userName.value;
password = form1.password.value;
if (userName.length == 0 ){
alert ("\n Please enter user name ")
return false;
}
if (password.length == 0 ) {
alert ("\n Please enter your password")
return false;
}
if (password.length != 0 ){
 for (i = 0; i < password.length; i++) {
	if (!( (password.charAt(i) >= "a" || password.charAt(i) >= "A") && (password.charAt(i) <= "z" || password.charAt(i) >= "Z") || (password.charAt(i) >= "0") && (password.charAt(i) <= "9")) ){
	  alert(" Please enter Latin letters " )
	  return false;
	  break;
	} // inner if	
 } // END for   
} // outer if

else return true;
}

function chk(form2) {
contactName = form2.contactName.value;
contactEmail = form2.contactEmail.value;
contactDetails = form2.contactDetails.value;
if (contactName.length == 0 ){
alert ("\n الرجاء إدخال الأسم ")
form2.contactName.focus();
return false;
}
if (contactEmail.length == 0 ){
alert ("\n الرجاء إدخال البريد الإلكتروني")
form2.contactEmail.focus();
return false;
}
if (contactDetails.length == 0 ){
alert ("\n الرجاء إدخال تفاصيل الإتصال")
form2.contactDetails.focus();
return false;
}
else return true;
}

function chkEnglish(form2) {
contactName = form2.contactName.value;
contactEmail = form2.contactEmail.value;
contactDetails = form2.contactDetails.value;
if (contactName.length == 0 ){
alert ("\n Please enter your name")
form2.contactName.focus();
return false;
}
if (contactEmail.length == 0 ){
alert ("\n please enter your e-mail")
form2.contactEmail.focus();
return false;
}
if (contactDetails.length == 0 ){
alert ("\n please enter your comments")
form2.contactDetails.focus();
return false;
}

else return true;
}


function checkPwThree(form2) {
companyName = form2.companyName.value;
empName = form2.empName.value;
email = form2.email.value;
idNumber = form2.idNumber.value;
password = form2.password.value;
password2 = form2.password2.value;
if (companyName.length == 0 ){
alert ("\n الرجاء إدخال أسم الشركة ")
form2.companyName.focus();
return false;
}
if (empName.length == 0 ){
alert ("\n الرجاء إدخال الأسم ")
form2.empName.focus();
return false;
}
if (email.length == 0 ){
alert ("\n الرجاء إدخال البريد الإلكتروني ")
form2.email.focus();
return false;
}
if (idNumber.length == 0 ){
alert ("\n الرجاء إدخال الرقم الوظيفي ")
form2.idNumber.focus();
return false;
}
if (password.length == 0 ) {
alert ("\nالرجاء إدخال كلمة المرور الصحيحة")
form2.password.focus();
return false;
}
if(password2.length==0){
alert("الرجاء أعادة كتابة كلمة المرور")
form2.password2.focus();
return false;
}
if(password!=password2){
alert("الرجاء أعادة كتابة كلمة المرور بصورة صحيحة")
return false;
}
if ( password2.length != 0 ){
 for (i = 0; i < password2.length; i++) {
	if (!( (password2.charAt(i) >= "a") && (password2.charAt(i) <= "z") || (password2.charAt(i) >= "0") && (password2.charAt(i) <= "9")) ){
	  alert(" الرجاء إدخال حروف لاتينية في خانة كلمة السر" )
	  return false;
	  break;
	} // inner if	
 } // END for   
} // outer if

else return true;
}

function checkSection(form) {
sectionName = form1.sectionName.value;
if (sectionName.length == 0 ){
alert ("\n الرجاء إدخال أسم القسم")
return false;
}
else return true;
}

function checkHighSection(form3) {
sectionName = form3.sectionName.value;
if (sectionName.length == 0 ){
alert ("\n الرجاء إدخال أسم القسم")
return false;
}
else return true;
}
function checkUnitField(form1) {
unitName = form1.unitName.value;
if (unitName.length == 0 ){
alert ("\n الرجاء إدخال أسم الوحدة الإدارية")
return false;
}
else return true;
}

function checkDepartment(form) {
departmentName = form1.departmentName.value;
if (departmentName.length == 0 ){
alert ("\n الرجاء إدخال أسم الإدارة")
return false;
}
else return true;
}

function checkPwFive(form2) {
companyName = form2.companyName.value;
idNumber = form2.idNumber.value;
password = form2.password.value;
if (companyName.length == 0 ){
alert ("\n الرجاء إدخال أسم الشركة ")
return false;
}
if (idNumber.length == 0 ){
alert ("\n الرجاء إدخال الرقم الوظيفي ")
return false;
}
if (password.length == 0 ) {
alert ("\nالرجاء إدخال كلمة المرور الصحيحة")
return false;
}
else return true;
}

function chkCountryFields(form2) {
	eIdNr = form2.eIdNr.value;
	productName = form2.productName.value;
	email = form2.email.value;
	if (eIdNr.length == 0 ){
		alert ("\n الرجاء إدخال رقم التسجيل الخاص بكم")
		form2.eIdNr.focus();
		return false;
	}
	if (productName.length == 0 ){
		alert ("\n الرجاء إدخال أسم المنتج أو المنتجات المراد الأستفسار عنها ")
		form2.productName.focus();
		return false;
	}
	if (email.length == 0 ){
		alert ("\n الرجاء إدخال ضرورة كتبة البريد الإلكتروني لكي يتسنى لنا الرد عليكم ")
		form2.email.focus();
		return false;
	}
else return true;
}
