function getElement(eid) {
   if (document.all) {
      return document.all[eid];
   }
      if (document.getElementById) {
		return document.getElementById(eid);
   }
}


function setBg(theRow)
{
theRow.style.background="#ffcc00";
return true;
} 

function setBgOut(theRow)
{
theRow.style.background="#999999";
return true;
} 




function setBg2(theRow)
{
theRow.style.background="#2222aa";

    return true;
} 

function setBgOut2(theRow)
{
theRow.style.background="#9999CC";
    return true;
} 


function setBg3(theRow)
{
theRow.style.background="#ccFFcc";

    return true;
} 

function setBgOut3(theRow)
{
theRow.style.background="";
    return true;
} 


function OpenCertDetails()
	{
	thewindow = window.open('https://www.thawte.com/cgi/server/certdetails.exe?code=UKNOXX1', 'anew', config='height=400,width=520,toolbar=no,menubar=no,scrollbars=yes,resizable=no,location=no,directories=no,status=yes');
	}
	
	
function setBgSA(theRow)
{
theRow.style.background="url('')";
theRow.style.background="#eeeeff";
    return true;
} 

function setBgOutSA(theRow)
{
theRow.style.background="url('http://www.thinkrecruitment.co.uk/images/button-bgSA.gif')";
//theRow.style.border="2px inset";
    return true;
} 


	
function setBgHSE(theRow)
{
theRow.style.background="url('')";
theRow.style.background="#FFFFDD";
    return true;
} 

function setBgOutHSE(theRow)
{
theRow.style.background="url('http://www.thinkrecruitment.co.uk/images/button-bgHSE.gif')";
//theRow.style.border="2px inset";
    return true;
} 

	function getId(Id)
	{
		return document.getElementById(Id);
	} // end function getID(Id)

function new_freecap()
{
        // loads new freeCap image
        if(document.getElementById)
        {
                // extract image name from image source (i.e. cut off ?randomness)
                thesrc = document.getElementById("freecap").src;
                //thesrc = thesrc.substring(0,thesrc.lastIndexOf(".")+4);
                // add ?(random) to prevent browser/isp caching
                document.getElementById("freecap").src = thesrc+"&"+Math.round(Math.random()*100000);
        } else {
                alert("Sorry, cannot autoreload freeCap image\nSubmit the form and a new freeCap will be loaded");
        }
}
	function contactcheck()
	{
		if (getId("fieldName").value == '')
		{
			alert ("Please enter your name!");
			return false;
		} // end if

		if (getId("fieldTelephone").value == '' && getId("fieldEmail").value == '')
		{
			alert ("Please enter your telephone number or email address!");
			return false;
		} // end if
		
		if (getId("fieldWord").value == '')
		{
			alert ("Please enter the word from the image!");
			return false;
		} // end if

		return true;
	} // end function

	function candidatecheck()
	{
		if (getId("fname").value == '')
		{
			alert ("Please enter your First Name!");
			return false;
		} // end if

		if (getId("name").value == '')
		{
			alert ("Please enter your Surname!");
			return false;
		} // end if

		if (getId("word").value == '')
		{
			alert ("Please enter the word from the image!");
			return false;
		} // end if
	} // end function

	function quickregcheck()
	{
		if (getId("name_reg").value == '')
		{
			alert ("Please enter your Name!");
			return false;
		} // end if

		if ((getId("email_reg").value == '') && (getId("tel_reg").value == ''))
		{
			alert ("Please enter either your telephone number or your email address!");
			return false;
		} // end if
	} // end function