 function validateuser_register1(frm) {
    checkString(frm.firstname,"First name");
	checkString(frm.secondname,"Surname");
	checkEmail(frm.email,"Email",1);
	checkNumber(frm.site_user_custom1,"Phone number",1);
	checkString(frm.password,"Password");
    checkString(frm.passwordconfirm,"Confirm password");
	//checkString(frm.cv,"CV");
		
	if (frm.password.value.length > 0 && frm.passwordconfirm.value.length > 0){
		if (frm.password.value != frm.passwordconfirm.value){
			addError("Password and Confirm password do not match");
		}
	}
	if (frm.password.value.length <6){
		addError("Password must be minimum 6 characters");		
	}
	

	if (!frm.site_user_custom4.checked) {
        	addError("Agreement that you accept the terms and conditions");		
   	}
	//checkString(frm.site_user_custom12,"Where did you hear about us");
	//checkString(frm.file1,"Your CV");
	if (frm.file1.value.length < 1 && frm.paste_cv.value.length < 1){
			addError("Please either upload or paste in a CV");
	}

	
	return checkError();
}
   
function validateuser_register2(frm) {
    checkString(frm.firstname,"First name");
	checkString(frm.secondname,"Surname");
	checkEmail(frm.email,"Email",1);
	checkNumber(frm.site_user_custom1,"Phone number",1);
	checkString(frm.password,"Password");
    checkString(frm.passwordconfirm,"Confirm password");
	//checkString(frm.cv,"CV");
		
	if (frm.password.value.length > 0 && frm.passwordconfirm.value.length > 0){
		if (frm.password.value != frm.passwordconfirm.value){
			addError("Password and Confirm password do not match");
		}
	}
	if (frm.password.value.length <6){
		addError("Password must be minimum 6 characters");		
	}

	
	if (!frm.site_user_custom4.checked) {
        	addError("Agreement that you accept the terms and conditions");
   	}
	//checkString(frm.site_user_custom12,"Where did you hear about us");
	return checkError();
}


function validateuser_register3(frm) {
    checkString(frm.firstname,"First name");
	checkString(frm.surname,"Surname");
	checkEmail(frm.email,"Email",1);		
	checkNumber(frm.phone,"Phone number",1);
	if (frm.file1.value.length < 1 && frm.paste_cv.value.length < 1){
			addError("Please either upload or paste in a CV");
	}
	
	return checkError();
}
function validate_register4(frm) {
    	checkEmail(frm.email,"Email",1);		
               
	checkString(frm.file1,"Your CV");
	
	return checkError();
}
function validate_job(frm) {
	checkString(frm.company_name,"Company Name");
 	checkString(frm.your_title,"Your title");
	checkString(frm.firstname,"Your Firstname")
    checkString(frm.secondname,"Your Surname");
       
    checkEmail(frm.email,"Your Email",1);		
    checkNumber(frm.telephone,"Telephone number",1);
	checkString(frm.address1,"Your Address");
    checkString(frm.vacancy_title,"Job Title");
    checkString(frm.vacancy_type,"Job Type");
   
	if (frm.file1.value.length < 1 && frm.paste_info.value.length < 1){
			addError("Please either upload or paste in a Job specification");
	}
   return checkError();
}

function validate_contact(frm) {
    checkString(frm.firstname,"Firstname")
    checkString(frm.surname,"Surname");
    checkEmail(frm.email,"Email",1);	
	//checkString(frm.wherehear,"Where did you hear about us");
    checkString(frm.subject,"Subject")
    checkString(frm.query,"Query")
    

   return checkError();
}
function validate_referfriend(frm) {
    checkString(frm.firstname,"Your Firstname")
    checkString(frm.surname,"Your Surname");
    checkString(frm.friendfirstname,"Friend/Colleagues Firstname")
    checkString(frm.friendsurname,"Friend/Colleagues Surname");
	checkString(frm.friendphone,"Friend/Colleagues Phone")
	checkEmail(frm.friendemail,"Friend/Colleagues Email",1);	
    //checkString(frm.friendemail,"Friend/Colleagues Email");
    checkString(frm.position,"Recommended Position")
    
   return checkError();
}

function showcallback(frm){
	target = document.getElementById('group3');
	if (frm.site_user_custom2[0].checked) {
		target.style.display = "";
	} 
	else {
		//frm.email.value = '';
		target.style.display = "none";
	}	
}

   
 function validatealertform(frm) {
    checkString(frm.alert_title,"Alert Title");
    checkString(frm.category_id,"At least 1 Category");
    checkString(frm.subcategory_id,"At least 1 Subcategory");
    checkString(frm.location_id,"At least 1 Location");
    checkString(frm.frequency,"Frequency");
	if (!frm.delivery[0].checked && !frm.delivery[1].checked){
			addError("Please select Email or SMS delivery");
	}
	if (frm.delivery[0].checked && frm.email.value.length < 3){
				checkEmail(frm.email,"Email",1);
	}
	if (frm.delivery[1].checked && frm.sms.value.length < 3){
			checkString(frm.sms,"SMS Number");
	}
    
	
	if (checkError()) {
		 document.awpform.action ="process_add_alert.jsp";		
		 awpform.submit();
	} else {
		 return false;
	}
	
}

function validateeditalertform(frm) {
    checkString(frm.alert_title,"Alert Title");
    checkString(frm.category_id,"At least 1 Category");
    checkString(frm.subcategory_id,"At least 1 Subcategory");
    checkString(frm.location_id,"At least 1 Location");
    checkString(frm.frequency,"Frequency");
	if (!frm.delivery[0].checked && !frm.delivery[1].checked){
			addError("Please select Email or SMS delivery");
	}
	if (frm.delivery[0].checked && frm.email.value.length < 3){
				checkEmail(frm.email,"Email",1);
	}
	if (frm.delivery[1].checked && frm.sms.value.length < 3){
			checkString(frm.sms,"SMS Number");
	}
	if (checkError()) {
		 document.awpform.action ="process_edit_alert.jsp";		
		 awpform.submit();
	} else {
		 return false;
	}
}


function validateform3(frm) {
    checkString(frm.firstname,"First name");
	checkString(frm.secondname,"Surname");
	checkNumber(frm.phone,"Phone number",1);
	//checkString(frm.cv,"CV");
		
	if (!frm.site_user_custom4.checked) {
        	addError("Please give your agreement that you accept the terms and conditions");
   	}
	
	return checkError();
}

function confirm_basket_clear(frm) {

			return confirm("Are you sure you want to clear your basket?");
}