lck=0;
        
        function View(hval)
        {
if (lck == 1){
                     if (document.hrform.customiseoption[0].checked){
							document.getElementById('testbgchange1').style.background=hval;
							document.hrform.nfc.value=hval;
							} else if (document.hrform.customiseoption[1].checked){
							document.getElementById('testbgchange2').style.background=hval;
							document.hrform.nbc.value=hval;
							} else if (document.hrform.customiseoption[2].checked){
							document.getElementById('testbgchange3').style.background=hval;
							document.hrform.nrofc.value=hval;
							} else if (document.hrform.customiseoption[3].checked){
							document.getElementById('testbgchange4').style.background=hval;
							document.hrform.nrobc.value=hval;
							} else if (document.hrform.customiseoption[4].checked){
							document.getElementById('testbgchange5').style.background=hval;
							document.hrform.sbc1.value=hval;
							} else	if (document.hrform.customiseoption[5].checked){
							document.getElementById('testbgchange6').style.background=hval;
							document.hrform.sbc2.value=hval;
							} else {
lck = 0;
}
}
       
        }
        
        function Set(){
        if (lck == 1){
lck = 0;
document.padlock.src='lock_icon.jpg';
                                } else if (lck == 0) {
document.padlock.src='unlock_icon.jpg';
lck = 1;
}
        }

function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,status=0,menubar=0,resizable=0,width=290,height=250,left = 382,top = 284');");
}

function popUp2(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,status=0,menubar=0,resizable=0,width=350,height=250,left = 382,top = 284');");
}

function write_jobtitle(URL){
window.opener.document.hrform,vacancytitle.value=URL;
window.close();
}

function write_this(URL){
opener.document.hrform.searchjobtitle.value=URL;
window.close();
}

function write_this2(URL){
opener.document.add_cv_step_two.cvidealjobtitle.value=URL;
window.close();
}

function write_this3(URL){
opener.document.add_cv_step_three.cvemploymentjobtitle.value=URL;
window.close();
}

function write_this4(URL){
opener.document.hrform.vacancytitle.value=URL;
window.close();
}

function write_this5(URL){
document.addnote.notemessage.value=URL;
}

function write_this6(URL){
document.composemessage.messagecontent.value=URL;
}

function checkAll(field)
{
for (i = 0; i < field.length; i++)
	field[i].checked = true ;
}
function uncheckAll(field)
{
for (i = 0; i < field.length; i++)
	field[i].checked = false ;
}

	// validate that the user has checked one of the radio buttons
	function isValidRadio(radio) {
  	  var valid = false;
    	for (var i = 0; i < radio.length; i++) {
      	  if (radio[i].checked) {
        	    return true;
        	}
    	}
	}
		function valLogin(which){
			if (which.loginusername.value == ''){
				alert ("Please enter your Username");
				which.loginusername.focus();
				return false;
				
			}else if (which.loginpassword.value == ''){
				alert ("Please enter your Password");
				which.loginpassword.focus();
				return false;
				
			}else if (!isValidRadio(which.loginaccounttype)){
				alert ("Please select whether your account type is 'Recruiter' or 'Candidate'");
				return false;
			}else {
				return true;
			}
		}
