// JavaScript Document
function Latest()
{
   document.write('<object classid="clsid:D27CDB6E..." ... height="455" width="294"">\n');
   document.write('<param name="movie" value="latest3.swf"/>\n');
   document.write('<param name="quality" value="high" />\n');
   document.write('<embed src="latest3.swf" ... height="455" width="294" menu="false"></embed>\n');
   document.write('</object>\n');
}
function recruitnews()
{
   document.write('<object classid="clsid:D27CDB6E..." ... height="455" width="294"">\n');
   document.write('<param name="movie" value="recruitmentnews.swf"/>\n');
   document.write('<param name="quality" value="high" />\n');
   document.write('<embed src="recruitmentnews.swf" ... height="455" width="294" menu="false"></embed>\n');
   document.write('</object>\n');
}

function Video()
{
   document.write('<object classid="clsid:D27CDB6E..." ... height="358" width="617">\n');
   document.write('<param name="movie" value="video.swf"/>\n');
   document.write('<param name="quality" value="high" />\n');
   document.write('<param name="wmode" value="transparent">\n');
   document.write('<embed src="video.swf" ... height="358" width="617" wmode="transparent" menu="false" loop="true"></embed>\n');
   document.write('</object>\n');
}

function MM_validateForm() {
  if (document.getElementById){
    var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
    for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=document.getElementById(args[i]);
      if (val) { nm=val.name; if ((val=val.value)!="") {
        if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
          if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
        } else if (test!='R') { num = parseFloat(val);
          if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
          if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
            min=test.substring(8,p); max=test.substring(p+1);
            if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
      } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
    } if (errors) alert('The following error(s) occurred:\n'+errors);
    document.MM_returnValue = (errors == '');
} }

function echeck(email)
{
//alert(email);
var at=email.indexOf('@');
var dot=email.lastIndexOf('.');
var atpos=email.lastIndexOf('@');
var emlen=email.length;
if (at<1||dot-at<2||atpos+1==emlen||dot+1==emlen||emlen-dot<3) 
  {
  alert('Email address is invalid');
  return false
  }
else 
{
return true
}

return true;
}
function fvalid()
{
	     if(document.form.title.value=="0")
         {
         alert('Please select a Title');
	     document.form.title.focus();
	     return false;
         }	
         if(document.form.first.value=="")
         {
         alert('Please enter your First name');
	     document.form.first.focus();
	     return false;
         }	 
		 if(document.form.last.value=="")
         {
         alert('Please enter your Last name');
	     document.form.last.focus();
	     return false;
         }	
		 if(document.form.address.value=="")
         {
         alert('Please enter your Address');
	     document.form.address.focus();
	     return false;
         }	
		 if(document.form.city.value=="")
         {
         alert('Please enter your Town / City');
	     document.form.city.focus();
	     return false;
         }		
		 if(document.form.email.value=="")
         {
         alert('Please enter your Email address');
	     document.form.email.focus();
	     return false;
         }
		 if(!echeck(document.form.email.value))
	     {
	     document.form.email.focus();
		 document.form.email.value="";
	     return false;
	     }	

return true;
}

function evalid()
{
	     if(document.form.title.value=="0")
         {
         alert('Please select a Title');
	     document.form.title.focus();
	     return false;
         }	
         if(document.form.first.value=="")
         {
         alert('Please enter your First name');
	     document.form.first.focus();
	     return false;
         }	 
		 if(document.form.last.value=="")
         {
         alert('Please enter your Last name');
	     document.form.last.focus();
	     return false;
         }	
		 if(document.form.email.value=="")
         {
         alert('Please enter your Email address');
	     document.form.email.focus();
	     return false;
         }
		 if(!echeck(document.form.email.value))
	     {
	     document.form.email.focus();
		 document.form.email.value="";
	     return false;
	     }	

return true;
}

function dvalid()
{
	     if(document.form.title.value=="0")
         {
         alert('Please select a Title');
	     document.form.title.focus();
	     return false;
         }	
         if(document.form.first.value=="")
         {
         alert('Please enter your First name');
	     document.form.first.focus();
	     return false;
         }	 
		 if(document.form.last.value=="")
         {
         alert('Please enter your Last name');
	     document.form.last.focus();
	     return false;
         }	
		 if(document.form.address.value=="")
         {
         alert('Please enter your Address');
	     document.form.address.focus();
	     return false;
         }	
		 if(document.form.city.value=="")
         {
         alert('Please enter your Town / City');
	     document.form.city.focus();
	     return false;
         }	
		 if(document.form.postcode.value=="")
         {
         alert('Please enter your Postcode');
	     document.form.postcode.focus();
	     return false;
         }	
		 if(document.form.email.value=="")
         {
         alert('Please enter your Email address');
	     document.form.email.focus();
	     return false;
         }
		 if(!echeck(document.form.email.value))
	     {
	     document.form.email.focus();
		 document.form.email.value="";
	     return false;
	     }	

return true;
}

function gvalid()
{
	     if(document.form.title.value=="0")
         {
         alert('Please select a Title');
	     document.form.title.focus();
	     return false;
         }	
         if(document.form.first.value=="")
         {
         alert('Please enter your First name');
	     document.form.first.focus();
	     return false;
         }	 
		 if(document.form.last.value=="")
         {
         alert('Please enter your Last name');
	     document.form.last.focus();
	     return false;
         }	
		 if(document.form.address.value=="")
         {
         alert('Please enter your Address');
	     document.form.address.focus();
	     return false;
         }		
		 if(document.form.email.value=="")
         {
         alert('Please enter your Email address');
	     document.form.email.focus();
	     return false;
         }
		 if(!echeck(document.form.email.value))
	     {
	     document.form.email.focus();
		 document.form.email.value="";
	     return false;
	     }	

return true;
}

function toggle(element) {
	document.getElementById(element).style.display = (document.getElementById(element).style.display == "none") ? "" : "none";
}
function hideOnLoad(element) {
document.getElementById(element).style.display = "none";
}
