startList = function() {
	
	//code only for IE
	if(!document.body.currentStyle) return;
	var subs = document.getElementsByName('submenu');
	for(var i=0; i<subs.length; i++) {
		var li = subs[i].parentNode;
		if(li && li.lastChild.style) {
			li.onmouseover = function() {
				this.lastChild.style.visibility = 'visible';
			}
			li.onmouseout = function() {
				this.lastChild.style.visibility = 'hidden';
			}
		}
	}
}
window.onload=startList;

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function contact_validation(){
		var txtname = document.frmcontact.txtname.value;
		 if (txtname == "" )
		 { 
			 alert ("Please enter Name");
			 document.frmcontact.txtname.focus();
			 return false;
		 }
		 var txtcompany = document.frmcontact.txtcompany.value;
		 if (txtcompany == "" )
		 { 
			 alert ("Please enter Company");
			 document.frmcontact.txtcompany.focus();
			 return false;
		 }
var txtaddress = document.frmcontact.txtaddress.value;
		 if (txtaddress == "" )
		 { 
			 alert ("Please enter Address1");
			 document.frmcontact.txtaddress.focus();
			 return false;
		 }		
		 var txtcity = document.frmcontact.txtcity.value;
		 if (txtcity == "" )
		 { 
			 alert ("Please enter Town/City");
			 document.frmcontact.txtcity.focus();
			 return false;
		 }	
		  var txtcounty = document.frmcontact.txtcounty.value;
		 if (txtcounty == "" )
		 { 
			 alert ("Please enter County");
			 document.frmcontact.txtcounty.focus();
			 return false;
		 }	
var txtcountry = document.frmcontact.txtcountry.value;
		 if (txtcountry == "" )
		 { 
			 alert ("Please enter  Country");
			 document.frmcontact.txtcountry.focus();
			 return false;
		 }
var txtpostcode = document.frmcontact.txtpostcode.value;
		 if (txtpostcode == "" )
		 { 
			 alert ("Please enter  Post Code");
			 document.frmcontact.txtpostcode.focus();
			 return false;
		 }		 
var txtemail = document.frmcontact.txtemail.value;
		 if (txtemail == "" )
		 { 
			 alert ("Please enter  Email");
			 document.frmcontact.txtemail.focus();
			 return false;
		 }		 
	 if (!validateEmail(document.frmcontact.txtemail.value,1,1)) 
	 {
		 document.frmcontact.txtemail.focus();
		 return false;
	 } 
	 
	var txtquestion = document.frmcontact.txtquestion.value;
		 if (txtquestion == "" )
		 { 
			 alert ("Please enter Question");
			 document.frmcontact.txtquestion.focus();
			 return false;
		 }
	 return true;
}


// Valid Email  Script
function validateEmail(addr,man,db) {
	if (addr == '' && man) {
	   if (db) alert('Email address is mandatory');
	   return false;
	}
	var invalidChars = '\/\'\\ ";:?!()[]\{\}^|';
	for (i=0; i<invalidChars.length; i++) {
	   if (addr.indexOf(invalidChars.charAt(i),0) > -1) {
		  if (db) alert('Email address contains invalid characters');
		  return false;
	   }
	}
	for (i=0; i<addr.length; i++) {
	   if (addr.charCodeAt(i)>127) {
		  if (db) alert("Email address contains non ascii characters.");
		  return false;
	   }
	}

	var atPos = addr.indexOf('@',0);
	if (atPos == -1) {
	   if (db) alert('Email address must contain an @');
	   return false;
	}
	if (atPos == 0) {
	   if (db) alert('Email address must not start with @');
	   return false;
	}
	if (addr.indexOf('@', atPos + 1) > - 1) {
	   if (db) alert('Email address must contain only one @');
	   return false;
	}
	if (addr.indexOf('.', atPos) == -1) {
	   if (db) alert('Email address must contain a period in the domain name');
	   return false;
	}
	if (addr.indexOf('@.',0) != -1) {
	   if (db) alert('period must not immediately follow @ in email address');
	   return false;
	}
	if (addr.indexOf('.@',0) != -1){
	   if (db) alert('period must not immediately precede @ in email address');
	   return false;
	}
	if (addr.indexOf('..',0) != -1) {
	   if (db) alert('two periods must not be adjacent in email address');
	   return false;
	}
	var suffix = addr.substring(addr.lastIndexOf('.')+1);
	if (suffix.length != 2 && suffix != 'com' && suffix != 'net' && suffix != 'org' && suffix != 'edu' && suffix != 'int' && suffix != 'mil' && suffix != 'gov' & suffix != 'arpa' && suffix != 'biz' && suffix != 'aero' && suffix != 'name' && suffix != 'coop' && suffix != 'info' && suffix != 'pro' && suffix != 'museum') {
	   if (db) alert('invalid primary domain in email address');
	   return false;
	}
return true;
}
