/* Advansys miscellaneous javascript website specific functions */

function ValidateContact(form){
if (form.name.value=='') {alert('Please fill in your name'); form.name.focus(); return false}
if (form.telephone.value=='') {alert('Please fill in your contact telephone number'); form.telephone.focus(); return false}
if (form.email.value=='') {alert('Please fill in your email address'); form.email.focus(); return false}
if (!checkemail(form.email.value)) {alert('Invalid email address'); form.email.focus(); return false}
if (form.subject.value=='') {alert('Please enter a subject'); form.subject.focus(); return false}
if (form.message.value=='') {alert('Please enter your message'); form.message.focus(); return false}
}

function EmbedFlash(swf, width, height, id){
// Main Flash animation - XHTML 1.0 compliant workaround for IE and Firefox (write as javascript rather then embed HTML))
document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+width+'" height="'+height+'" id="'+id+'" align="bottom">');
document.write('<param name="allowScriptAccess" value="sameDomain" />');
document.write('<param name="movie" value="/swf/'+swf+'"/>');
document.write('<param name="quality" value="high" />');
document.write('<param name="loop" value="false"/>');
document.write('<param name="wmode" value="transparent"/>');
document.write('<embed type="application/x-shockwave-flash" src="/swf/'+swf+'" width="'+width+'" height="'+height+'" wmode="transparent"></embed>');
document.write('</object>');
}
function ShowMap(MapURL,PostCode){
window.open(MapURL+'&pc='+PostCode,'map','width=700, height=500, scrollbars=yes, location=no, status=yes');
}

// Form Validation JavaScript


function checkemail(object_value)
	{
	  if(!(object_value.indexOf("@") > -1 && object_value.indexOf(".") > -1))
         return false;    

	return true;
	}
