function validateFormOnSubmit(theForm) 
{

var reason = "";
var reason_address= "";
var reason_fields = "";
var reason_education = "";
var reason_languages = "";
  reason += validatef_name(theForm.f_name);
  reason += validatefa_name(theForm.fa_name);
  reason += validateg_name(theForm.g_name);
  reason += validatefam_name(theForm.fam_name);
  //reason += validatepassport_number(theForm.passport_number);
  reason += validategender(theForm.gender);
  reason += validatemartial_status(theForm.martial_status);
  reason += validateplace_birth(theForm.place_birth);
  reason += validateyear_birth(theForm.year_birth);
  reason += validatemonth_birth(theForm.month_birth);
  reason += validateday_birth(theForm.day_birth);
  reason_address += validatefull_address(theForm.full_address);
  reason_address += validatecity(theForm.city);
  reason_address += validatecountry(theForm.country);
  reason_address += validatenational_number(theForm.national_number);  
  reason_address += validatetel(theForm.tel);
  reason_address += validatemobile(theForm.mobile);  
  //reason_address += validatefax(theForm.fax);  
  reason_address += validateemail(theForm.email); 
  reason_address += validateconfirmemail(theForm.confirm_email,theForm.email);
  reason_address += validateeposition_applied_for(theForm.position_applied_for);   
  reason_address += validateereferral_source(theForm.referral_source); 
  reason_address  += validateyear_work(theForm.year_work); 
  reason_address  += validatemonth_work(theForm.month_work);
  reason_address  += validateday_work(theForm.day_work); 
  reason_address += validatehave_you_ever_applied_to_CADER_beforer(theForm.have_you_ever_applied_to_CADER_beforer);  
  reason_address += validateif_yes_when(theForm.if_yes_when);  
  reason_address += validatewill_you_travel_if_the_job_requires_it(theForm.will_you_travel_if_the_job_requires_it);   
  //reason_fields  += validatejob(theForm.job);  
  
  //reason_fields  += validaterelatives(theForm.relatives);  
  reason_education  += validateacademic(theForm.academic); 
  reason_education  += validatename_school(theForm.name_school);
  reason_education  += validatemajor(theForm.major);
  reason_education  += validateeducation_country(theForm.education_country);
  reason_education  += validateyear_graduation(theForm.year_graduation);
  reason_education  += validateevaluation(theForm.evaluation);
  reason_education  += validateyear_conduct_tawjihi(theForm.conduct_tawjihi);
 reason_education  += validatecountry_of_tawjihi_certificate(theForm.country_of_tawjihi_certificate);
  reason_education  += validatetawjihi_specialization(theForm.tawjihi_specialization);
  reason_education  += validatefinal_avg(theForm.final_avg);
  reason_education  += validatedo_you_have_an_ICDL_certificate(theForm.do_you_have_an_ICDL_certificate); 
 reason_education  += validatedo_you_have_any_other_ICT_certificates(theForm.do_you_have_any_other_ICT_certificates);  
 reason_education  += validateif_yes_name(theForm.if_yes_name); 
 
reason_languages  += validatespo_ar_lang(theForm.spo_ar_lang);
  reason_languages  += validatespo_ar_lang(theForm.wri_ar_lang);
  reason_languages  += validatespo_en_lang(theForm.spo_en_lang);
  reason_languages  += validatespo_en_lang(theForm.wri_en_lang);
    reason_languages += validateexperience_year(theForm.experience_year);

  if (reason !="")
   {
    alert("Some fields need correction:\n" + reason);
    return false;
   }
   else
  if (reason_address !="")
   {
    alert("Some fields need correction:\n" + reason_address);
    return false;
   }
  else
  if (reason_fields !="")
   {
    alert("Some fields need correction:\n" + reason_fields);
    return false;
   }
   else
  if (reason_education !="")
   {
    alert("Some fields need correction:\n" + reason_education);
    return false;
   }
   if (reason_languages !="")
   {
    alert("Some fields need correction:\n" + reason_languages);
    return false;
   }
}
function validatef_name(fld) 
{
    var error = "";
    var illegalChars = /\W/; // allow letters, numbers, and underscores
 
    if (fld.value == "") 
	{
        fld.style.background = 'fde578'; 
        error = "You didn't enter first name.\n";
	}
	else
	{
		fld.style.background = 'ffffff';
	}
    return error;
}
function validatefa_name(fld) 
{
    var error = "";
    var illegalChars = /\W/; // allow letters, numbers, and underscores
 
    if (fld.value == "") 
	{
        fld.style.background = 'fde578'; 
        error="You didn't enter Father's Name. \n";
	}	
	else
	{
		fld.style.background = 'ffffff';
	}
    return error;
}
function validateg_name(fld) 
{
    var error = "";
    var illegalChars = /\W/; // allow letters, numbers, and underscores
 
    if (fld.value == "") 
	{
        fld.style.background = 'fde578'; 
        error = "You didn't enter Grand Father's Name.\n";
	}	
	else
	{
		fld.style.background = 'ffffff';
	}
    return error;
}
function validatefam_name(fld) 
{
    var error = "";
    var illegalChars = /\W/; // allow letters, numbers, and underscores
 
    if (fld.value == "") 
	{
        fld.style.background = 'fde578'; 
        error = "You didn't enter Family Name.\n";
	}	
	else
	{
		fld.style.background = 'ffffff';
	}
    return error;
}
function validatepassport_number(fld) 
{
    var error = "";
    var illegalChars = /\W/; // allow letters, numbers, and underscores
 
    if (fld.value == "") 
	{
        fld.style.background = 'fde578'; 
        error = "You didn't enter Passport Number.\n";
	}
	else
	if(!Number(fld.value))
	{
	fld.style.background = 'fde578'; 
    error = "You didn't enter Passport Number.\n";
	} 
	else
	{
		fld.style.background = 'ffffff';
	}
    return error;
}
function validategender(fld) 
{
	var error = "";
	var illegalChars = /\W/; // allow letters, numbers, and underscores
	var radio_choice = false;
	
	for (counter = 0; counter < frm.gender.length; counter++)
	{
	if (frm.gender[counter].checked)
	radio_choice = true; 
	}
	if (!radio_choice)
	{
	frm.gender[0].style.background = 'fde578';
	frm.gender[1].style.background = 'fde578';
	error = "You didn't enter Gender.\n";
	}
	else
	{
		
	frm.gender[0].style.background = 'ffffff';
	frm.gender[1].style.background = 'ffffff';
	
	}
	
	return error;
}

function validatemartial_status(fld) 
{
    var error = "";
    var illegalChars = /\W/; // allow letters, numbers, and underscores
 	var radio_choice =false;
	for (counter = 0; counter < frm.martial_status.length; counter++)
	{
	if (frm.martial_status[counter].checked)
	radio_choice = true; 
	}
	if (!radio_choice)
	{
	frm.martial_status[0].style.background = 'fde578';
	frm.martial_status[1].style.background = 'fde578';
	error = "You didn't enter martial status.\n";
	}	
	else
	{
		
	frm.martial_status[0].style.background = 'ffffff';
	frm.martial_status[1].style.background = 'ffffff';
	}
	return error;
}
function validateplace_birth(fld) 
{
    var error = "";
    var illegalChars = /\W/; // allow letters, numbers, and underscores
 
    if (fld.value == "") 
	{
        fld.style.background = 'fde578'; 
        error = "You didn't enter Place of Brith.\n";
	}	
	else
	{
		fld.style.background = 'ffffff';
	}
    return error;
}
function validateyear_birth(fld) 
{
    var error = "";
    var illegalChars = /\W/; // allow letters, numbers, and underscores
 
    if (fld.value == "") 
	{
        fld.style.background = 'fde578'; 
        error = "You didn't enter year birth.\n";
	}	
	else
	{
		fld.style.background = 'ffffff';
	}
    return error;
}
function validatemonth_birth(fld) 
{
    var error = "";
    var illegalChars = /\W/; // allow letters, numbers, and underscores
 
    if (fld.value == "") 
	{
        fld.style.background = 'fde578'; 
        error = "You didn't enter month birth.\n";
	}	
	else
	{
		fld.style.background = 'ffffff';
	}
    return error;
}
function validateday_birth(fld) 
{
    var error = "";
    var illegalChars = /\W/; // allow letters, numbers, and underscores

 
    if (fld.value == "") 
	{
        fld.style.background = 'fde578'; 
        error = "You didn't enter day birth.\n";
	}	
	else
	{
		fld.style.background = 'ffffff';
	}
    return error;
}
function validatefull_address(fld) 
{
    var error = "";
    var illegalChars = /\W/; // allow letters, numbers, and underscores
 
    if (fld.value == "") 
	{
        fld.style.background = 'fde578'; 
        error = "You didn't enter full address.\n";
	}	
	else
	{
		fld.style.background = 'ffffff';
	}
    return error;
}
function validatecity(fld) 
{
    var error = "";
    var illegalChars = /\W/; // allow letters, numbers, and underscores
 
    if (fld.value == "") 
	{
        fld.style.background = 'fde578'; 
        error = "You didn't enter city.\n";
	}
	else
	{
		fld.style.background = 'ffffff';
	}
    return error;
}
function validatecountry(fld) 
{
    var error = "";
    var illegalChars = /\W/; // allow letters, numbers, and underscores
 
    if (fld.value == "none") 
	{
        fld.style.background = 'fde578'; 
        error = "You didn't enter country.\n";
	}	
	else
	{
		fld.style.background = 'ffffff';
	}
    return error;
}
function validatecountry_of_tawjihi_certificate(fld) 
{
    var error = "";
    var illegalChars = /\W/; // allow letters, numbers, and underscores
 
    if (fld.value == "none") 
	{
        fld.style.background = 'fde578'; 
        error = "You didn't enter tawjihi country.\n";
	}	
	else
	{
		fld.style.background = 'ffffff';
	}
    return error;
}
function validatetel(fld) 
{
    var error = "";
    var illegalChars = /\W/; // allow letters, numbers, and underscores
 
    if (fld.value == "") 
	{
        fld.style.background = 'fde578'; 
        error = "You didn't enter Tel.\n";
	}
	else
	if(!Number(fld.value))
	{
	fld.style.background = 'fde578'; 
    error = "You didn't enter Tel.\n";
	}	
	else
	{
		fld.style.background = 'ffffff';
	}
    return error;
}
  function validatenational_number(fld) 
{
    var error = "";
    var illegalChars = /\W/; // allow letters, numbers, and underscores
 
    if (fld.value == "") 
	{
        fld.style.background = 'fde578'; 
        error = "You didn't enter national number.\n";
	}
	else
	if(!Number(fld.value))
	{
	fld.style.background = 'fde578'; 
    error = "You didn't enter national number.\n";
	}	
	else
	{
		fld.style.background = 'ffffff';
	}
    return error;
}
function validatemobile(fld) 
{
    var error = "";
    var illegalChars = /\W/; // allow letters, numbers, and underscores
 
    if (fld.value == "") 
	{
        fld.style.background = 'fde578'; 
        error = "You didn't enter Mobile.\n";
	}
	else
	if(!Number(fld.value))
	{
	fld.style.background = 'fde578'; 
    error = "You didn't enter Mobile.\n";
	}	
	else
	{
		fld.style.background = 'ffffff';
	}
    return error;
}
function validateexperience_year(fld) 
{
    var error = "";
    var illegalChars = /\W/; // allow letters, numbers, and underscores
 
    if (fld.value == "") 
	{
        fld.style.background = 'fde578'; 
        error = "You didn't enter experience year.\n";
	}
	else
	if(!Number(fld.value))
	{
	fld.style.background = 'fde578'; 
    error = "You didn't enter experience year.\n";
	}	
	else
	{
		fld.style.background = 'ffffff';
	}
    return error;
}
function validatefax(fld) 
{
    var error = "";
    var illegalChars = /\W/; // allow letters, numbers, and underscores
 
    if (fld.value == "") 
	{
        fld.style.background = 'fde578'; 
        error = "You didn't enter Fax.\n";
	}
	else
	if(!Number(fld.value))
	{
	fld.style.background = 'fde578'; 
    error = "You didn't enter Fax.\n";
	}	
	else
	{
		fld.style.background = 'ffffff';
	}
    return error;
}
function validateemail(fld) 
{
    var error = "";
    var illegalChars = /\W/; // allow letters, numbers, and underscores
 
    if (fld.value == "") 
	{
        fld.style.background = 'fde578'; 
        error = "You didn't enter Email.\n";
	}
	else
	if(fld.value.indexOf("@",1)==-1)
	{
	fld.style.background = 'fde578'; 
	error = "Invalid EMAIL ADDRESS \n";
	}
	else
	if(fld.value.indexOf("@",1)==0)
	{
	fld.style.background = 'fde578'; 
	error = "Invalid EMAIL ADDRESS \n";
	}
	else
	if(fld.value.indexOf("@",fld.value.indexOf("@",1)+1)>-1)	 
	{
	fld.style.background = 'fde578'; 
	error = "Invalid EMAIL ADDRESS \n";
	}
	else
	if(fld.value.indexOf(".",fld.value.indexOf("@",1)+2)==-1)	 
	{
	fld.style.background = 'fde578'; 
	error = "Invalid EMAIL ADDRESS \n";
	}	
	else
	{
		fld.style.background = 'ffffff';
	}
    return error;
}
function validateconfirmemail(fld,fld2) 
{
    var error = "";
    var illegalChars = /\W/; // allow letters, numbers, and underscores
 
    if (fld.value == "") 
	{
        fld.style.background = 'fde578'; 
        error = "You didn't enter confirm email.\n";
	}
	else
	 if (fld.value!=fld2.value) 
	{
        fld.style.background = 'fde578'; 
        error = "The confirmation Email doesn't match the origin one.\n";
	}
	else
	{
		fld.style.background = 'ffffff';
	}
    return error;
}
function validatejob(fld) 
{
    var error = "";
    var illegalChars = /\W/; // allow letters, numbers, and underscores
 	var radio_choice =false;
	for (counter = 0; counter < frm.job.length; counter++)
	{
	if (frm.job[counter].checked)
	radio_choice = true; 
	}
	if (!radio_choice)
	{
	for (counter = 0; counter < frm.job.length; counter++)
	{
	frm.job[counter].style.background = 'fde578';
	}
	error = "You didn't enter job.\n";
	}
	
    return error;
}
function validateeposition_applied_for(fld) 
{
     var error = "";
    var illegalChars = /\W/; // allow letters, numbers, and underscores
 
    if (fld.value == "") 
	{
        fld.style.background = 'fde578'; 
        error = "You didn't enter position applied for.\n";
	}
	else
	{
		fld.style.background = 'ffffff';
	}
    return error;
}
function validateereferral_source(fld) 
{
    var error = "";
    var illegalChars = /\W/; // allow letters, numbers, and underscores
 	var radio_choice =false;
	for (counter = 0; counter < frm.referral_source.length; counter++)
	{
	if (frm.referral_source[counter].checked)
	radio_choice = true; 
	}
	if (!radio_choice)
	{
	frm.referral_source[0].style.background = 'fde578';
	frm.referral_source[1].style.background = 'fde578';
             frm.referral_source[2].style.background = 'fde578';
             frm.referral_source[3].style.background = 'fde578';
			   frm.referral_source[4].style.background = 'fde578';
	error = "You didn't enter referral source.\n";
	}	
	else
	{
		
		frm.referral_source[0].style.background = 'ffffff';
	frm.referral_source[1].style.background = 'ffffff';
             frm.referral_source[2].style.background = 'ffffff';
             frm.referral_source[3].style.background = 'ffffff';
			   frm.referral_source[4].style.background = 'ffffff';
	}
	return error;
}
  
function validatehave_you_ever_applied_to_CADER_beforer(fld) 
{
     var error = "";
    var illegalChars = /\W/; // allow letters, numbers, and underscores
 	var radio_choice =false;
	for (counter = 0; counter < frm.have_you_ever_applied_to_CADER_beforer.length; counter++)
	{
	if (frm.have_you_ever_applied_to_CADER_beforer[counter].checked)
	radio_choice = true; 
	}
	if (!radio_choice)
	{
	frm.have_you_ever_applied_to_CADER_beforer[0].style.background = 'fde578';
	frm.have_you_ever_applied_to_CADER_beforer[1].style.background = 'fde578';
      	error = "You didn't enter have you_ever applied to CADER beforer.\n";
	}	
	else
	{
	
		frm.have_you_ever_applied_to_CADER_beforer[0].style.background = 'ffffff';
	frm.have_you_ever_applied_to_CADER_beforer[1].style.background = 'ffffff';
	}
	
	return error;
        

}
function validateif_yes_when(fld) 
{
    var error = "";
    var illegalChars = /\W/; // allow letters, numbers, and underscores
	
    for (counter = 0; counter < frm.have_you_ever_applied_to_CADER_beforer.length; counter++)
	{
	
	if (frm.have_you_ever_applied_to_CADER_beforer[counter].checked)
	
	
	if (fld.value == "" && frm.have_you_ever_applied_to_CADER_beforer[counter].value=="yes") 
	{
        fld.style.background = 'fde578'; 
        error = "You didn't enter if yes when.\n";
	}
	else
	{
		fld.style.background = 'ffffff';
	}
	radio_choice = true; 
    }
    return error;
}
function validatewill_you_travel_if_the_job_requires_it(fld) 
{
     var error = "";
    var illegalChars = /\W/; // allow letters, numbers, and underscores
 	var radio_choice =false;
	for (counter = 0; counter < frm.will_you_travel_if_the_job_requires_it.length; counter++)
	{
	if (frm.will_you_travel_if_the_job_requires_it[counter].checked)
	radio_choice = true; 
	}
	if (!radio_choice)
	{
	frm.will_you_travel_if_the_job_requires_it[0].style.background = 'fde578';
	frm.will_you_travel_if_the_job_requires_it[1].style.background = 'fde578';
      	error = "You didn't enter will you travel if the job requires it.\n";
	}	
	else
	{
			
			frm.will_you_travel_if_the_job_requires_it[0].style.background = 'ffffff';
	frm.will_you_travel_if_the_job_requires_it[1].style.background = 'ffffff';
	}
	return error;
        

}
function validateyear_work(fld) 
{
    var error = "";
    var illegalChars = /\W/; // allow letters, numbers, and underscores
 
    if (fld.value == "") 
	{
        fld.style.background = 'fde578'; 
        error = "You didn't enter year work.\n";
	}
	else
	{
		fld.style.background = 'ffffff';
	}
    return error;
}
function validatemonth_work(fld) 
{
    var error = "";
    var illegalChars = /\W/; // allow letters, numbers, and underscores
 
    if (fld.value == "") 
	{
        fld.style.background = 'fde578'; 
        error = "You didn't enter month work.\n";
	}
	else
	{
		fld.style.background = 'ffffff';
	}
    return error;
}
function validateday_work(fld) 
{
    var error = "";
    var illegalChars = /\W/; // allow letters, numbers, and underscores
 
    if (fld.value == "") 
	{
        fld.style.background = 'fde578'; 
        error = "You didn't enter day work.\n";
	}
	else
	{
		fld.style.background = 'ffffff';
	}
    return error;
}
function validaterelatives(fld) 
{
    var error = "";
    var illegalChars = /\W/; // allow letters, numbers, and underscores
 
	var radio_choice = false;
	
	for (counter = 0; counter < frm.relatives.length; counter++)
	{
	if (frm.relatives[counter].checked)
	radio_choice = true; 
	}
	if (!radio_choice)
	{
	frm.relatives[0].style.background = 'fde578';
	frm.relatives[1].style.background = 'fde578';
	error = "You didn't enter relatives.\n";
	}
	else
	{
		
		frm.relatives[0].style.background = 'ffffff';
	frm.relatives[1].style.background = 'ffffff';
	}
    return error;
}
function validateacademic(fld) 
{
    var error = "";
    var illegalChars = /\W/; // allow letters, numbers, and underscores
 
    if (fld.value == "") 
	{
        fld.style.background = 'fde578'; 
        error = "You didn't enter academic level.\n";
	}
	else
	{
		fld.style.background = 'ffffff';
	}
    return error;
}
  function validatename_school(fld) 
{
    var error = "";
    var illegalChars = /\W/; // allow letters, numbers, and underscores
 
    if (fld.value == "") 
	{
        fld.style.background = 'fde578'; 
        error = "You didn't enter Name of your School / College / university.\n";
	}
	else
	{
		fld.style.background = 'ffffff';
	}
    return error;
}
function validatemajor(fld) 
{
    var error = "";
    var illegalChars = /\W/; // allow letters, numbers, and underscores
 
    if (fld.value == "") 
	{
        fld.style.background = 'fde578'; 
        error = "You didn't enter major.\n";
	}
	else
	{
		fld.style.background = 'ffffff';
	}
    return error;
}
function validateeducation_country(fld) 
{
    var error = "";
    var illegalChars = /\W/; // allow letters, numbers, and underscores
 
    if (fld.value == "none") 
	{
        fld.style.background = 'fde578'; 
        error = "You didn't enter Education country.\n";
	}
	else
	{
		fld.style.background = 'ffffff';
	}
    return error;
}
function validateyear_graduation(fld) 
{
    var error = "";
    var illegalChars = /\W/; // allow letters, numbers, and underscores
 
    if (fld.value == "") 
	{
        fld.style.background = 'fde578'; 
        error = "You didn't enter year graduation.\n";
	}
	else
	if(!Number(fld.value))
	{
	fld.style.background = 'fde578'; 
    error = "You didn't enter year graduation.\n";
	}
	else
	{
		fld.style.background = 'ffffff';
	}
    return error;
}
function validateevaluation(fld) 
{
    var error = "";
    var illegalChars = /\W/; // allow letters, numbers, and underscores
 
    if (fld.value == "") 
	{
        fld.style.background = 'fde578'; 
        error = "You didn't enter Evaluation.\n";
	}
	else
	{
		fld.style.background = 'ffffff';
	}
    return error;
}  
function validateyear_conduct_tawjihi(fld) 
{
    var error = "";
    var illegalChars = /\W/; // allow letters, numbers, and underscores
 
    if (fld.value == "") 
	{
        fld.style.background = 'fde578'; 
        error = "You didn't enter Year conduct the Tawjihi exams.\n";
	}
	else
	if(!Number(fld.value))
	{
	fld.style.background = 'fde578'; 
    error = "You didn't enter Year conduct the Tawjihi exams.\n";
	}
	else
	{
		fld.style.background = 'ffffff';
	}
    return error;
}
function validatetawjihi_specialization(fld) 
{
    var error = "";
    var illegalChars = /\W/; // allow letters, numbers, and underscores
	var radio_choice = false;
	
	for (counter = 0; counter < frm.tawjihi_specialization.length; counter++)
	{
	if (frm.tawjihi_specialization[counter].checked)
	radio_choice = true; 
	}
	if (!radio_choice)
	{
	frm.tawjihi_specialization[0].style.background = 'fde578';
	frm.tawjihi_specialization[1].style.background = 'fde578';
	error = "You didn't enter Tawjihi Specialization.\n";
	}
	else
	{
		
		frm.tawjihi_specialization[0].style.background = 'ffffff';
	frm.tawjihi_specialization[1].style.background = 'ffffff';
	}
    return error;
}
function validatefinal_avg(fld) 
{
    var error = "";
    var illegalChars = /\W/; // allow letters, numbers, and underscores
 
    if (fld.value == "") 
	{
        fld.style.background = 'fde578'; 
        error = "You didn't enter final average in Tawjihi.\n";
	}
	if(!Number(fld.value))
	{
	fld.style.background = 'fde578'; 
    error = "You didn't enter final average in Tawjihi.\n";
	}
	else
	{
		fld.style.background = 'ffffff';
	}
    return error;
}  
function validatedo_you_have_an_ICDL_certificate(fld) 
{
 var error = "";
    var illegalChars = /\W/; // allow letters, numbers, and underscores
	var radio_choice = false;
	
	for (counter = 0; counter < frm.do_you_have_an_ICDL_certificate.length; counter++)
	{
	if (frm.do_you_have_an_ICDL_certificate[counter].checked)
	radio_choice = true; 
	}
	if (!radio_choice)
	{
	frm.do_you_have_an_ICDL_certificate[0].style.background = 'fde578';
	frm.do_you_have_an_ICDL_certificate[1].style.background = 'fde578';
	error = "You didn't enter Do you have an ICDL certificate.\n";
	}
	else
	{
		
			frm.do_you_have_an_ICDL_certificate[0].style.background = 'ffffff';
	frm.do_you_have_an_ICDL_certificate[1].style.background = 'ffffff';
	}
    return error;
        
}
function validatedo_you_have_any_other_ICT_certificates(fld) 
{
 var error = "";
    var illegalChars = /\W/; // allow letters, numbers, and underscores
	var radio_choice = false;
	
	for (counter = 0; counter < frm.do_you_have_any_other_ICT_certificates.length; counter++)
	{
	if (frm.do_you_have_any_other_ICT_certificates[counter].checked)
	radio_choice = true; 
	}
	if (!radio_choice)
	{
	frm.do_you_have_any_other_ICT_certificates[0].style.background = 'fde578';
	frm.do_you_have_any_other_ICT_certificates[1].style.background = 'fde578';
	error = "You didn't enter do you have any other ICT certificates.\n";
	}
	else
	{
	frm.do_you_have_any_other_ICT_certificates[0].style.background = 'ffffff';
	frm.do_you_have_any_other_ICT_certificates[1].style.background = 'ffffff';
	}
	
    return error;
        
}

function validateif_yes_name(fld) 
{
   var error = "";
    var illegalChars = /\W/; // allow letters, numbers, and underscores
	
    for (counter = 0; counter < frm.do_you_have_any_other_ICT_certificates.length; counter++)
	{
	
	if (frm.do_you_have_any_other_ICT_certificates[counter].checked)
	
	
	if (fld.value == "" && frm.do_you_have_any_other_ICT_certificates[counter].value=="yes") 
	{
        fld.style.background = 'fde578'; 
        error = "You didn't enter if yes name.\n";
	}
	else
	{
		fld.style.background = 'ffffff';
	}
	
    }
    return error;
	
        
}

function validatespo_ar_lang(fld) 
{
    var error = "";
    var illegalChars = /\W/; // allow letters, numbers, and underscores
 
    if (fld.value == "") 
	{
        fld.style.background = 'fde578'; 
        error = "You didn't enter Evaluation Arabic language.\n";
	}
	else
	{
		fld.style.background = 'ffffff';
	}
    return error;
}  
function validatewri_ar_lang(fld) 
{
    var error = "";
    var illegalChars = /\W/; // allow letters, numbers, and underscores
 
    if (fld.value == "") 
	{
        fld.style.background = 'fde578'; 
        error = "You didn't enter Evaluation Arabic language.\n";
	}
	else
	{
		fld.style.background = 'ffffff';
	}
    return error;
}  
function validatespo_en_lang(fld) 
{
    var error = "";
    var illegalChars = /\W/; // allow letters, numbers, and underscores
 
    if (fld.value == "") 
	{
        fld.style.background = 'fde578'; 
        error = "You didn't enter Evaluation English language.\n";
	}
	else
	{
		fld.style.background = 'ffffff';
	}
    return error;
}
function validatewri_en_lang(fld) 
{
    var error = "";
    var illegalChars = /\W/; // allow letters, numbers, and underscores
 
    if (fld.value == "") 
	{
        fld.style.background = 'fde578'; 
        error = "You didn't enter Evaluation English language.\n";
	}
	else
	{
		fld.style.background = 'ffffff';
	}
    return error;
} 

function validateFormOnSubmit_2(theForm) 
{
var reason = "";
  reason += validateq1(theForm.q1);
  reason += validateq2(theForm.q2);
  reason += validateq3(theForm.q3);
  reason += validateq4(theForm.q4);
  reason += validateq5(theForm.q5);
  reason  += validate_agree(theForm.agree);
  /*reason += validateq6(theForm.q6);
  reason += validateb1(theForm.icdl);
  reason += validateb1_1(theForm.if_yes_obtain);
  reason += validateb_1_2(theForm.where_conduct);
  reason += validateb2(theForm.ict_certificate);
  reason += validateb2_1(theForm.what_kind_certificates);
  reason += validateb2_2(theForm.when_did_obtain);
  reason += validateb3(theForm.yes_icdl);
  reason += validateb3_1(theForm.do_you_keep);
  reason += validateb4(theForm.can_you_example);
  reason += validateb5(theForm.yes_do_you_use_ict);
  reason += validateb6(theForm.are_you_familiar);
  reason += validateb7(theForm.can_you_advise);
  reason += validateb8(theForm.do_you_agree);*/
  if (reason !="")
   {
    alert("Some fields need correction:\n" + reason);
    return false;
   }
}
function validateq1(fld) 
{
 var error = "";
    var illegalChars = /\W/; // allow letters, numbers, and underscores
 
    if (fld.value=="") 
	{
       	fld.style.background = 'fde578'; 
        error = "You didn't enter Q 1.\n";
	}
	else
	{
		fld.style.background = 'ffffff';
	}
    return error;
}
function validateq2(fld) 
{
 var error = "";
    var illegalChars = /\W/; // allow letters, numbers, and underscores
 
    if (fld.value=="") 
	{
       	fld.style.background = 'fde578'; 
        error = "You didn't enter Q 2.\n";
	}
	else
	{
		fld.style.background = 'ffffff';
	}
    return error;
}
function validateq3(fld) 
{
 var error = "";
    var illegalChars = /\W/; // allow letters, numbers, and underscores
 
    if (fld.value=="") 
	{
       	fld.style.background = 'fde578'; 
        error = "You didn't enter Q 3.\n";
	}
	else
	{
		fld.style.background = 'ffffff';
	}
    return error;
}
function validateq4(fld) 
{
 var error = "";
    var illegalChars = /\W/; // allow letters, numbers, and underscores
 
    if (fld.value=="") 
	{
       	fld.style.background = 'fde578'; 
        error = "You didn't enter Q 4.\n";
	}
	else
	{
		fld.style.background = 'ffffff';
	}
    return error;
}
function validateq5(fld) 
{
 var error = "";
    var illegalChars = /\W/; // allow letters, numbers, and underscores
 
    if (fld.value=="") 
	{
       	fld.style.background = 'fde578'; 
        error = "You didn't enter Q 5.\n";
	}
	else
	{
		fld.style.background = 'ffffff';
	}
    return error;
}
function validateq6(fld) 
{
 var error = "";
    var illegalChars = /\W/; // allow letters, numbers, and underscores
 
    if (fld.value=="") 
	{
       	fld.style.background = 'fde578'; 
        error = "You didn't enter A 6.\n";
	}
    return error;
}
function validateb1(fld) 
{
    var error = "";
    var illegalChars = /\W/; // allow letters, numbers, and underscores
 	var radio_choice =false;
	for (counter = 0; counter < frm_2.icdl.length; counter++)
	{
	if (frm_2.icdl[counter].checked)
	radio_choice = true; 
	}
	if (!radio_choice)
	{
	frm_2.icdl[0].style.background = 'fde578';
	frm_2.icdl[1].style.background = 'fde578';
	error = "You didn't enter B 1.\n";
	}	
	return error;
}
function validateb1_1(fld) 
{
 var error = "";
    var illegalChars = /\W/; // allow letters, numbers, and underscores
 
    if (fld.value=="") 
	{
       	fld.style.background = 'fde578'; 
        error = "You didn't enter B 1.\n";
	}
    return error;
}
function validateb_1_2(fld) 
{
 var error = "";
    var illegalChars = /\W/; // allow letters, numbers, and underscores
 
    if (fld.value=="") 
	{
       	fld.style.background = 'fde578'; 
        error = "You didn't enter B 1.\n";
	}
    return error;
}
function validateb2(fld) 
{
    var error = "";
    var illegalChars = /\W/; // allow letters, numbers, and underscores
 	var radio_choice =false;
	for (counter = 0; counter < frm_2.ict_certificate.length; counter++)
	{
	if (frm_2.ict_certificate[counter].checked)
	radio_choice = true; 
	}
	if (!radio_choice)
	{
	frm_2.ict_certificate[0].style.background = 'fde578';
	frm_2.ict_certificate[1].style.background = 'fde578';
	error = "You didn't enter B 2.\n";
	}	
	return error;
}
function validateb2_1(fld) 
{
 var error = "";
    var illegalChars = /\W/; // allow letters, numbers, and underscores
 
    if (fld.value=="") 
	{
       	fld.style.background = 'fde578'; 
        error = "You didn't enter B 2.\n";
	}
    return error;
}
function validateb2_2(fld) 
{
 var error = "";
    var illegalChars = /\W/; // allow letters, numbers, and underscores
 
    if (fld.value=="") 
	{
       	fld.style.background = 'fde578'; 
        error = "You didn't enter B 2.\n";
	}
    return error;
}
function validateb3(fld) 
{
    var error = "";
    var illegalChars = /\W/; // allow letters, numbers, and underscores
 	var radio_choice =false;
	for (counter = 0; counter < frm_2.yes_icdl.length; counter++)
	{
	if (frm_2.yes_icdl[counter].checked)
	radio_choice = true; 
	}
	if (!radio_choice)
	{
	frm_2.yes_icdl[0].style.background = 'fde578';
	frm_2.yes_icdl[1].style.background = 'fde578';
	error = "You didn't enter B 3.\n";
	}	
	return error;
}
function validateb3_1(fld) 
{
 var error = "";
    var illegalChars = /\W/; // allow letters, numbers, and underscores
 
    if (fld.value=="") 
	{
       	fld.style.background = 'fde578'; 
        error = "You didn't enter B 3.\n";
	}
    return error;
}
function validateb4(fld) 
{
 var error = "";
    var illegalChars = /\W/; // allow letters, numbers, and underscores
 
    if (fld.value=="") 
	{
       	fld.style.background = 'fde578'; 
        error = "You didn't enter B 4.\n";
	}
    return error;
}
function validateb5(fld) 
{
    var error = "";
    var illegalChars = /\W/; // allow letters, numbers, and underscores
 	var radio_choice =false;
	for (counter = 0; counter < frm_2.yes_do_you_use_ict.length; counter++)
	{
	if (frm_2.yes_do_you_use_ict[counter].checked)
	radio_choice = true; 
	}
	if (!radio_choice)
	{
	frm_2.yes_do_you_use_ict[0].style.background = 'fde578';
	frm_2.yes_do_you_use_ict[1].style.background = 'fde578';
	error = "You didn't enter B 5.\n";
	}	
	return error;
}
function validateb6(fld) 
{
 var error = "";
    var illegalChars = /\W/; // allow letters, numbers, and underscores
 
    if (fld.value=="") 
	{
       	fld.style.background = 'fde578'; 
        error = "You didn't enter B 6.\n";
	}
    return error;
}
function validateb7(fld) 
{
 var error = "";
    var illegalChars = /\W/; // allow letters, numbers, and underscores
 
    if (fld.value=="") 
	{
       	fld.style.background = 'fde578'; 
        error = "You didn't enter B 7.\n";
	}
    return error;
}
function validateb8(fld) 
{
    var error = "";
    var illegalChars = /\W/; // allow letters, numbers, and underscores
 	var radio_choice =false;
	for (counter = 0; counter < frm_2.do_you_agree.length; counter++)
	{
	if (frm_2.do_you_agree[counter].checked)
	radio_choice = true; 
	}
	if (!radio_choice)
	{
	frm_2.do_you_agree[0].style.background = 'fde578';
	frm_2.do_you_agree[1].style.background = 'fde578';
	error = "You didn't enter B 8.\n";
	}	
	return error;
}
function validate_agree(fld) 
{
    var error = "";
    var illegalChars = /\W/; // allow letters, numbers, and underscores
 
    if (fld.checked==false) 
	{
       	fld.style.background = 'fde578'; 
        error = "You didn't checked provided data.\n";
	}
    return error;
}
