function OpenEventsDetails(id)
{
	var OpenWindow=window.open("events_details.php?UniversityEventsID="+id,"logwindow",'left=100,top=70,width=700,height=600,toolbar=0,resizable=0,scrollbars=1,addressbar=0');
	OpenWindow.focus();
	return false;
}

function OpenNewsDetails(id)
{
	var OpenWindow=window.open("news_details.php?UniversityNewsID="+id,"logwindow",'left=100,top=70,width=700,height=600,toolbar=0,resizable=0,scrollbars=1,addressbar=0');
	OpenWindow.focus();
	return false;
}

function OpenForgotPass()
{
	var OpenWindow=window.open("forgotpassword.php","logwindow",'left=350,top=250,height=190,width=450,toolbar=0,resizable=0,addressbar=0');
	return false;
}

function Validation_ContactUS()
{
	var Obj    = document.form1;
	var Filter =/^.+@.+..{2,3}$/
	if ( (Obj.FirstName.value.charAt(0) == " ") || (Obj.FirstName.value.charAt(1) == " ") || ((Obj.FirstName.value.charAt(0) == " ") && (Obj.FirstName.value.charAt(1) == " ") && (Obj.FirstName.value.charAt(2) == " ")) || (Obj.FirstName.value == "") || (Obj.FirstName.value.length <= 3) )
	{
		alert("Please insert the First Name correctly.");
		Obj.FirstName.focus();
		return false;
	}
	if ( (Obj.LastName.value.charAt(0) == " ") || (Obj.LastName.value.charAt(1) == " ") || ((Obj.LastName.value.charAt(0) == " ") && (Obj.LastName.value.charAt(1) == " ") && (Obj.LastName.value.charAt(2) == " ")) || (Obj.LastName.value == "") || (Obj.LastName.value.length <= 3) )
	{
		alert("Please insert the Last Name correctly.");
		Obj.LastName.focus();
		return false;
	}
	if ( (Obj.Position.value.charAt(0) == " ") || (Obj.Position.value.charAt(1) == " ") || ((Obj.Position.value.charAt(0) == " ") && (Obj.Position.value.charAt(1) == " ") && (Obj.Position.value.charAt(2) == " ")) || (Obj.Position.value == "") || (Obj.Position.value.length <= 3) )
	{
		alert("Please insert the Position correctly.");
		Obj.Position.focus();
		return false;
	}
	if ( Obj.Email.value == "" || !Filter.test(Obj.Email.value) )
	{
		alert("Please insert the Email correctly.");
		Obj.Email.focus();
		return false;
	}
	else
	{
		return true;
	}
}


function Validation_careers(){
	var x    = document.form;
	var Filter =/^.+@.+..{2,3}$/
    err="";
	
	if ( (x.last.value.charAt(0) == " ") || (x.last.value.charAt(1) == " ") || ((x.last.value.charAt(0) == " ") && (x.last.value.charAt(1) == " ") && (x.last.value.charAt(2) == " ")) || (x.last.value == "") || (x.last.value.length <= 3) ){
	  alert("Please enter last name correctly");
	  x.last.focus();
	  return false
	}
	
	if ( (x.firstname.value.charAt(0) == " ") || (x.firstname.value.charAt(1) == " ") || ((x.firstname.value.charAt(0) == " ") && (x.firstname.value.charAt(1) == " ") && (x.firstname.value.charAt(2) == " ")) || (x.firstname.value == "") || (x.firstname.value.length <= 3) ){
	  alert("Please enter first name  correctly");
	  x.firstname.focus();
	  return false
	}
	
	if ( (x.city.value.charAt(0) == " ") || (x.city.value.charAt(1) == " ") || ((x.city.value.charAt(0) == " ") && (x.city.value.charAt(1) == " ") && (x.city.value.charAt(2) == " ")) || (x.city.value == "") || (x.city.value.length <= 3) ){
	  alert("Please enter Permanent Address: city  correctly");
	  x.city.focus();
	  return false
	}
	
	if(x.country.value==''){
	  alert("Please select Permanent Address: country");
	  x.country.focus();
	  return false
	}
	
	if ( (x.street.value.charAt(0) == " ") || (x.street.value.charAt(1) == " ") || ((x.street.value.charAt(0) == " ") && (x.street.value.charAt(1) == " ") && (x.street.value.charAt(2) == " ")) || (x.street.value == "") || (x.street.value.length <= 3) ){
	  alert("Please enter Permanent Address: street  correctly");
	  x.street.focus();
	  return false
	}
	
	if(x.position.value==''){
	  alert("Please enter Position applied for  correctly");
	  x.position.focus();
	  return false
	}
	
	if(x.home.value=='' && x.cell.value==''){
	  alert("Please enter at least one tel. number  correctly");
	  x.home.focus();
	  return false
	}
	
	if(x.day.value=='' || x.month.value=='' || x.year.value==''){
	  alert("Please enter birth date  correctly");
	  x.day.focus();
	  return false
	}
	
	if(x.hearus.value==''){
	  alert("Please enter How did you hear about us  correctly");
	  x.hearus.focus();
	  return false
	}
	
	if(x.datejoin.value==''){
	  alert("Please enter Available date to join  correctly");
	  x.datejoin.focus();
	  return false
	}
   
	
	if(x.insured_yesno[0].checked==true && x.insured_company.value==''){
	  alert("Please enter Insurance company");
	  x.insured_company.focus();
	  return false
	}
	
	
	
	if(x.email.value==''  || !Filter.test(x.email.value)){
	  alert("Please enter valid email address");
	  x.email.focus();
	  return false
	}
	
	if(x.salary.value==''){
	  alert("Please enter valid salary");
	  x.salary.focus();
	  return false
	}
	 
	
	if(x.weeklyhours.value=='' || isNaN(x.weeklyhours.value)){
	  alert("Please enter weekly hours correctly");
	  x.weeklyhours.focus();
	  return false
	}
	
	if(x.hourlysalary.value==''){
	  alert("Please enter hourly salary correctly");
	  x.hourlysalary.focus();
	  return false
	}
	
	if(x.agreement1.checked==false){
	  alert("Please check Applicant's Agreement to continue");
	  x.agreement1.focus();
	  return false
	}
	
	  return true
     
 }
 
 
 
 function Validation_application(){
	var x    = document.form;
	var Filter =/^.+@.+..{2,3}$/
    err="";
	
	if ( (x.campus.value.charAt(0) == " ") || (x.campus.value.charAt(1) == " ") || ((x.campus.value.charAt(0) == " ") && (x.campus.value.charAt(1) == " ") && (x.campus.value.charAt(2) == " ")) || (x.campus.value == "") || (x.campus.value.length <= 3) ){
	  alert("Please enter Campus applying for");
	  x.campus.focus();
	  return false
	}
	
	if ( (x.lastarabic.value.charAt(0) == " ") || (x.lastarabic.value.charAt(1) == " ") || ((x.lastarabic.value.charAt(0) == " ") && (x.lastarabic.value.charAt(1) == " ") && (x.lastarabic.value.charAt(2) == " ")) || (x.lastarabic.value == "") || (x.lastarabic.value.length <= 3) ){
	  alert("Please enter arabic last name");
	  x.lastarabic.focus();
	  return false
	}
	
	if ( (x.fatherarabic.value.charAt(0) == " ") || (x.fatherarabic.value.charAt(1) == " ") || ((x.fatherarabic.value.charAt(0) == " ") && (x.fatherarabic.value.charAt(1) == " ") && (x.fatherarabic.value.charAt(2) == " ")) || (x.fatherarabic.value == "") || (x.fatherarabic.value.length <= 3) ){
	  alert("Please enter arabic father name");
	  x.fatherarabic.focus();
	  return false
	}
	
	if ( (x.firstarabic.value.charAt(0) == " ") || (x.firstarabic.value.charAt(1) == " ") || ((x.firstarabic.value.charAt(0) == " ") && (x.firstarabic.value.charAt(1) == " ") && (x.firstarabic.value.charAt(2) == " ")) || (x.firstarabic.value == "") || (x.firstarabic.value.length <= 3) ){
	  alert("Please enter arabic first name");
	  x.firstarabic.focus();
	  return false
	}
	
	if ( (x.first.value.charAt(0) == " ") || (x.first.value.charAt(1) == " ") || ((x.first.value.charAt(0) == " ") && (x.first.value.charAt(1) == " ") && (x.first.value.charAt(2) == " ")) || (x.first.value == "") || (x.first.value.length <= 3) ){
	  alert("Please enter first name");
	  x.first.focus();
	  return false
	}
	
	if ( (x.father.value.charAt(0) == " ") || (x.father.value.charAt(1) == " ") || ((x.father.value.charAt(0) == " ") && (x.father.value.charAt(1) == " ") && (x.father.value.charAt(2) == " ")) || (x.father.value == "") || (x.father.value.length <= 3) ){
	  alert("Please enter father name");
	  x.father.focus();
	  return false
	}
	
	if ( (x.last.value.charAt(0) == " ") || (x.last.value.charAt(1) == " ") || ((x.last.value.charAt(0) == " ") && (x.last.value.charAt(1) == " ") && (x.last.value.charAt(2) == " ")) || (x.last.value == "") || (x.last.value.length <= 3) ){
	  alert("Please enter last name");
	  x.last.focus();
	  return false
	}
	
	if ( (x.city.value.charAt(0) == " ") || (x.city.value.charAt(1) == " ") || ((x.city.value.charAt(0) == " ") && (x.city.value.charAt(1) == " ") && (x.city.value.charAt(2) == " ")) || (x.city.value == "") || (x.city.value.length <= 3) ){
	  alert("Please enter Place of birth: city");
	  x.city.focus();
	  return false
	}
	
	if(x.country.value==''){
	  alert("Please select Place of birth: country");
	  x.country.focus();
	  return false
	}
	
	if ( (x.birthdate.value.charAt(0) == " ") || (x.birthdate.value.charAt(1) == " ") || ((x.birthdate.value.charAt(0) == " ") && (x.birthdate.value.charAt(1) == " ") && (x.birthdate.value.charAt(2) == " ")) || (x.birthdate.value == "") || (x.birthdate.value.length <= 3) ){
	  alert("Please enter date of birth");
	  x.birthdate.focus();
	  return false
	}
	
	if ( (x.area.value.charAt(0) == " ") || (x.area.value.charAt(1) == " ") || ((x.area.value.charAt(0) == " ") && (x.area.value.charAt(1) == " ") && (x.area.value.charAt(2) == " ")) || (x.area.value == "") || (x.area.value.length <= 3) ){
	  alert("Please enter Residential Address: area");
	  x.area.focus();
	  return false
	}
	
	if ( (x.building.value.charAt(0) == " ") || (x.building.value.charAt(1) == " ") || ((x.building.value.charAt(0) == " ") && (x.building.value.charAt(1) == " ") && (x.building.value.charAt(2) == " ")) || (x.building.value == "") || (x.building.value.length <= 3) ){
	  alert("Please enter Residential Address: building");
	  x.building.focus();
	  return false
	}
	
	if ( (x.street.value.charAt(0) == " ") || (x.street.value.charAt(1) == " ") || ((x.street.value.charAt(0) == " ") && (x.street.value.charAt(1) == " ") && (x.street.value.charAt(2) == " ")) || (x.street.value == "") || (x.street.value.length <= 3) ){
	  alert("Please enter Residential Address: street");
	  x.street.focus();
	  return false
	}
	
	if ( (x.residentialcity.value.charAt(0) == " ") || (x.residentialcity.value.charAt(1) == " ") || ((x.residentialcity.value.charAt(0) == " ") && (x.residentialcity.value.charAt(1) == " ") && (x.residentialcity.value.charAt(2) == " ")) || (x.residentialcity.value == "") || (x.residentialcity.value.length <= 3) ){
	  alert("Please enter Residential Address: city");
	  x.residentialcity.focus();
	  return false
	}
	
	if(x.residentialcountry.value==''){
	  alert("Please select Residential Address: country");
	  x.residentialcountry.focus();
	  return false
	}
	
	if ( (x.cell.value.charAt(0) == " ") || (x.cell.value.charAt(1) == " ") || ((x.cell.value.charAt(0) == " ") && (x.cell.value.charAt(1) == " ") && (x.cell.value.charAt(2) == " ")) || (x.cell.value == "") || (x.cell.value.length <= 3) ){
	  alert("Please enter Residential Address: cell");
	  x.cell.focus();
	  return false
	}
	
	if(x.email.value==''  || !Filter.test(x.email.value)){
	  alert("Please enter valid email address");
	  x.email.focus();
	  return false
	}
	
	if ( (x.nationality1.value.charAt(0) == " ") || (x.nationality1.value.charAt(1) == " ") || ((x.nationality1.value.charAt(0) == " ") && (x.nationality1.value.charAt(1) == " ") && (x.nationality1.value.charAt(2) == " ")) || (x.nationality1.value == "") || (x.nationality1.value.length <= 3) ){
	  alert("Please enter nationality");
	  x.nationality1.focus();
	  return false
	}
	
	if ( (x.passport.value.charAt(0) == " ") || (x.passport.value.charAt(1) == " ") || ((x.passport.value.charAt(0) == " ") && (x.passport.value.charAt(1) == " ") && (x.passport.value.charAt(2) == " ")) || (x.passport.value == "") || (x.passport.value.length <= 3) ){
	  alert("Please enter passport No.");
	  x.passport.focus();
	  return false
	}
	
	if ( (x.schoolname1.value.charAt(0) == " ") || (x.schoolname1.value.charAt(1) == " ") || ((x.schoolname1.value.charAt(0) == " ") && (x.schoolname1.value.charAt(1) == " ") && (x.schoolname1.value.charAt(2) == " ")) || (x.schoolname1.value == "") || (x.schoolname1.value.length <= 3) ){
	  alert("Please enter school name");
	  x.schoolname1.focus();
	  return false
	}
	
	if ( (x.schoolfromto1.value.charAt(0) == " ") || (x.schoolfromto1.value.charAt(1) == " ") || ((x.schoolfromto1.value.charAt(0) == " ") && (x.schoolfromto1.value.charAt(1) == " ") && (x.schoolfromto1.value.charAt(2) == " ")) || (x.schoolfromto1.value == "") || (x.schoolfromto1.value.length <= 3) ){
	  alert("Please enter school attendance from-to");
	  x.schoolfromto1.focus();
	  return false
	}
	
	if ( (x.schoolclass1.value.charAt(0) == " ") || (x.schoolclass1.value.charAt(1) == " ") || ((x.schoolclass1.value.charAt(0) == " ") && (x.schoolclass1.value.charAt(1) == " ") && (x.schoolclass1.value.charAt(2) == " ")) || (x.schoolclass1.value == "") || (x.schoolclass1.value.length <= 3) ){
	  alert("Please enter class completed");
	  x.schoolclass1.focus();
	  return false
	}
	
	if ( (x.schooldiploma1.value.charAt(0) == " ") || (x.schooldiploma1.value.charAt(1) == " ") || ((x.schooldiploma1.value.charAt(0) == " ") && (x.schooldiploma1.value.charAt(1) == " ") && (x.schooldiploma1.value.charAt(2) == " ")) || (x.schooldiploma1.value == "") || (x.schooldiploma1.value.length <= 3) ){
	  alert("Please enter diploma obtained");
	  x.schooldiploma1.focus();
	  return false
	}
	
	if ( (x.certificate.value.charAt(0) == " ") || (x.certificate.value.charAt(1) == " ") || ((x.certificate.value.charAt(0) == " ") && (x.certificate.value.charAt(1) == " ") && (x.certificate.value.charAt(2) == " ")) || (x.certificate.value == "") || (x.certificate.value.length <= 3) ){
	  alert("Please enter name of certificate");
	  x.certificate.focus();
	  return false
	}
	
	if ( (x.certdate.value.charAt(0) == " ") || (x.certdate.value.charAt(1) == " ") || ((x.certdate.value.charAt(0) == " ") && (x.certdate.value.charAt(1) == " ") && (x.certdate.value.charAt(2) == " ")) || (x.certdate.value == "") || (x.certdate.value.length <= 3) ){
	  alert("Please enter certificate date received/expected");
	  x.certdate.focus();
	  return false
	}
	
	if ( (x.languages1.value.charAt(0) == " ") || (x.languages1.value.charAt(1) == " ") || ((x.languages1.value.charAt(0) == " ") && (x.languages1.value.charAt(1) == " ") && (x.languages1.value.charAt(2) == " ")) || (x.languages1.value == "") || (x.languages1.value.length <= 3) ){
	  alert("Please enter languages spoken");
	  x.languages1.focus();
	  return false
	}
	
	if ( (x.languages2.value.charAt(0) == " ") || (x.languages2.value.charAt(1) == " ") || ((x.languages2.value.charAt(0) == " ") && (x.languages2.value.charAt(1) == " ") && (x.languages2.value.charAt(2) == " ")) || (x.languages2.value == "") || (x.languages2.value.length <= 3) ){
	  alert("Please enter languages spoken");
	  x.languages2.focus();
	  return false
	}
	
	if ( (x.major1.value.charAt(0) == " ") || (x.major1.value.charAt(1) == " ") || ((x.major1.value.charAt(0) == " ") && (x.major1.value.charAt(1) == " ") && (x.major1.value.charAt(2) == " ")) || (x.major1.value == "") || (x.major1.value.length <= 3) ){
	  alert("Please enter major of choice");
	  x.major1.focus();
	  return false
	}
	
	if ( (x.department1.value.charAt(0) == " ") || (x.department1.value.charAt(1) == " ") || ((x.department1.value.charAt(0) == " ") && (x.department1.value.charAt(1) == " ") && (x.department1.value.charAt(2) == " ")) || (x.department1.value == "") || (x.department1.value.length <= 3) ){
	  alert("Please enter department of choice");
	  x.department1.focus();
	  return false
	}
	
	if ( (x.howwhy.value.charAt(0) == " ") || (x.howwhy.value.charAt(1) == " ") || ((x.howwhy.value.charAt(0) == " ") && (x.howwhy.value.charAt(1) == " ") && (x.howwhy.value.charAt(2) == " ")) || (x.howwhy.value == "") || (x.howwhy.value.length <= 3) ){
	  alert("Please enter how did you hear about us");
	  x.howwhy.focus();
	  return false
	}
	
	
	if(x.agreement1.checked==false){
	  alert("Please check I agree to continue");
	  x.agreement1.focus();
	  return false
	}
	
	  return true
     
 }
