function stripHTML(){
var re= /<\S[^><]*>/g
for (i=0; i<arguments.length; i++)
	arguments[i].value=arguments[i].value.replace(re, "")
}


function validate(frm) {
 checkString(frm.country_of_origin,"Country of origin");
	checkString(frm.Main_language,"Main language");
	checkString(frm.Age,"Age");
	checkString(frm.Gender,"Gender");

var myOption = -1;
	for (i=frm.Current_employment_status.length-1; i > -1; i--) {
		if (frm.Current_employment_status[i].checked) {
			myOption = i; 
			i = -1;
		}
	}
if (myOption == -1) {
	addError("Current education or employment status is required",frm.Current_employment_status[0], null, frm.Current_employment_status == null);
}




	checkString(frm.Highest_Educational_Qualification,"Highest educational qualification achieved");
/*

	//checkString(frm.Training_Skills_IT_Fundamentals,"Skill training: IT Fundamentals");
myOption = -1;
	for (i=frm.Training_Skills_IT_Fundamentals.length-1; i > -1; i--) {
		if (frm.Training_Skills_IT_Fundamentals[i].checked) {
			myOption = i; 
			i = -1;
		}
	}
if (myOption == -1) {
	addError("Skill training: IT Fundamentals", frm.Training_Skills_IT_Fundamentals[0], null, frm.Training_Skills_IT_Fundamentals == null);
}


	//checkString(frm.Training_Skills_File_Management,"Skill training: File Management");
myOption = -1;
	for (i=frm.Training_Skills_File_Management.length-1; i > -1; i--) {
		if (frm.Training_Skills_File_Management[i].checked) {
			myOption = i; 
			i = -1;
		}
	}
if (myOption == -1) {
	addError("Skill training: File Management", frm.Training_Skills_File_Management[0], null, frm.Training_Skills_File_Management == null);
}


	//checkString(frm.Training_Skills_Word_Processing,"Skill training: Word Processing");
myOption = -1;
	for (i=frm.Training_Skills_Word_Processing.length-1; i > -1; i--) {
		if (frm.Training_Skills_Word_Processing[i].checked) {
			myOption = i; 
			i = -1;
		}
	}
if (myOption == -1) {
	addError("Skill training: Word Processing", frm.Training_Skills_Word_Processing[0], null, frm.Training_Skills_Word_Processing == null);
}


	//checkString(frm.Training_Skills_Spreadsheets,"Skill training: Spreadsheets");
myOption = -1;
	for (i=frm.Training_Skills_Spreadsheets.length-1; i > -1; i--) {
		if (frm.Training_Skills_Spreadsheets[i].checked) {
			myOption = i; 
			i = -1;
		}
	}
if (myOption == -1) {
	addError("Skill training: IT FundamentalsSkill training: Spreadsheets", frm.Training_Skills_Spreadsheets[0], null, frm.Training_Skills_Spreadsheets == null);
}


	//checkString(frm.Training_Skills_Databases,"Skill training: Databases");
myOption = -1;
	for (i=frm.Training_Skills_Databases.length-1; i > -1; i--) {
		if (frm.Training_Skills_Databases[i].checked) {
			myOption = i; 
			i = -1;
		}
	}
if (myOption == -1) {
	addError("Skill training: Databases", frm.Training_Skills_Databases[0], null, frm.Training_Skills_Databases == null);
}


	//checkString(frm.Training_Skills_Presentations,"Skill training: Presentations");
myOption = -1;
	for (i=frm.Training_Skills_Presentations.length-1; i > -1; i--) {
		if (frm.Training_Skills_Presentations[i].checked) {
			myOption = i; 
			i = -1;
		}
	}
if (myOption == -1) {
	addError("Skill training: Presentations", frm.Training_Skills_Presentations[0], null, frm.Training_Skills_Presentations == null);
}


	//checkString(frm.Training_Skills_Internet_Communication,"Skill training: Internet and Communication");
myOption = -1;
	for (i=frm.Training_Skills_Internet_Communication.length-1; i > -1; i--) {
		if (frm.Training_Skills_Internet_Communication[i].checked) {
			myOption = i; 
			i = -1;
		}
	}
if (myOption == -1) {
	addError("Skill training: Internet and Communication", frm.Training_Skills_Internet_Communication[0], null, frm.Training_Skills_Internet_Communication == null);
}


	//checkString(frm.Training_Skills_WebPage_Design,"Skill training: Web Page Design");
myOption = -1;
	for (i=frm.Training_Skills_WebPage_Design.length-1; i > -1; i--) {
		if (frm.Training_Skills_WebPage_Design[i].checked) {
			myOption = i; 
			i = -1;
		}
	}
if (myOption == -1) {
	addError("Skill training: Web Page Design", frm.Training_Skills_WebPage_Design[0], null, frm.Training_Skills_WebPage_Design == null);
}


	//checkString(frm.Training_Skills_Image_Creation_Editing,"Skill training: Image Creation and Editing");
myOption = -1;
	for (i=frm.Training_Skills_Image_Creation_Editing.length-1; i > -1; i--) {
		if (frm.Training_Skills_Image_Creation_Editing[i].checked) {
			myOption = i; 
			i = -1;
		}
	}
if (myOption == -1) {
	addError("Skill training: Image Creation and Editing", frm.Training_Skills_Image_Creation_Editing[0], null, frm.Training_Skills_Image_Creation_Editing == null);
}

*/



checkString(frm.main_computer_use,"Where would you most commonly use a computer");
//myOption = -1;
//	for (i=frm.main_computer_use.length-1; i > -1; i--) {
//		if (frm.main_computer_use[i].checked) {
//			myOption = i; 
//			i = -1;
//		}
//	}
//if (myOption == -1) {
//	addError("Main Computer use", frm.main_computer_use[0], null, frm.main_computer_use == null);
//}



checkString(frm.often_computer_use,"How often do you use a computer");
//myOption = -1;
//	for (i=frm.often_computer_use.length-1; i > -1; i--) {
//		if (frm.often_computer_use[i].checked) {
//			myOption = i; 
//			i = -1;
//		}
//	}
//if (myOption == -1) {
//	addError("How often do you use a computer", frm.often_computer_use[0], null, frm.often_computer_use == null);
//}


//alert("new js");
//myOption = -1;
//	for (i=frm.own_a_computer.length-1; i > -1; i--) {
//		if (frm.own_a_computer[i].checked) {
//			myOption = i; 
//			i = -1;
//		}
//	}
//if (myOption == -1) {
//	addError("Do you own a computer", frm.own_a_computer[0], null, frm.own_a_computer == null);
//}



//myOption = -1;
//	for (i=frm.type_of_internet_connection.length-1; i > -1; i--) {
//		if (frm.type_of_internet_connection[i].checked) {
//			myOption = i; 
//			i = -1;
//		}
//	}
//if (myOption == -1) {
//	addError("What kind of internet connection do you have", frm.type_of_internet_connection[0], null, frm.type_of_internet_connection == null);
//}


checkString(frm.rate_ICT_skills,"How would you rate your ICT skills overall");

//myOption = -1;
//	for (i=frm.rate_ICT_skills.length-1; i > -1; i--) {
//		if (frm.rate_ICT_skills[i].checked) {
//			myOption = i; 
//			i = -1;
//		}
//	}
//if (myOption == -1) {
//	addError("How would you rate your ICT skills overall", frm.rate_ICT_skills[0], null, frm.rate_ICT_skills == null);
//}


checkString(frm.completed_ict_training_course,"Have you ever completed an ICT training course");
checkString(frm.ecdl_icdl_certified,"Are you ECDL/ICDL certified");


	return checkError();
}


function changeReadOnly1(){
	var ticked = document.thisform.Current_employment_status[5].checked;
	//alert(ticked);
	if(ticked==0){
		document.thisform.Current_employment_status_Other.readOnly=true;
		document.thisform.Current_employment_status_Other.value="";
		document.thisform.Current_employment_status_Other.style.background="#EFEFEF";
		document.thisform.Current_employment_status_Other.style.display="none";
	}else{
		document.thisform.Current_employment_status_Other.readOnly=false;
		document.thisform.Current_employment_status_Other.style.background="#FFFFFF";
		document.thisform.Current_employment_status_Other.style.display="block";
		document.thisform.Current_employment_status_Other.focus();
	}
}

function changeReadOnly2(){
var el= document.getElementById("Highest_Educational_Qualification");
var el_other= document.getElementById("Highest_Educational_Qualification_Other");
if (el.value=='Other') {
	//el_other.readOnly = false;
	document.thisform.Highest_Educational_Qualification_Other.readOnly=false;
	document.thisform.Highest_Educational_Qualification_Other.style.background="#FFFFFF";
	document.thisform.Highest_Educational_Qualification_Other.style.display="block";
	document.thisform.Highest_Educational_Qualification_Other.focus();
}else {	document.thisform.Highest_Educational_Qualification_Other.style.display="none";}
}

function changeReadOnly3(){
var el= document.getElementById("type_of_internet_connection");
var el_other= document.getElementById("type_of_internet_connection_Other");
if (el.value=='Other') {
	//el_other.readOnly = false;
	document.thisform.type_of_internet_connection_Other.readOnly=false;
	document.thisform.type_of_internet_connection_Other.style.background="#FFFFFF";
	document.thisform.type_of_internet_connection_Other.style.display="block";
	document.thisform.type_of_internet_connection_Other.focus();
}else {	document.thisform.type_of_internet_connection_Other.style.display="none";}
}

