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 contact_validation()
{
	if(document.contact.txt_name.value == "")
	{
	   alert("Please enter your name.");
	   document.contact.txt_name.focus();
	   return false;
	}
	if(document.contact.txt_email.value == "")
	{
	   alert("Please enter your email address.");
	   document.contact.txt_email.focus();
	   return false;
	}
	if(!validateEmail(document.contact.txt_email.value,1,1))
	{
	   document.contact.txt_email.focus();
	   return false;
	}
	if(document.contact.txt_sub.value == "")
	{
	   alert("Please enter subject.");
	   document.contact.txt_sub.focus();
	   return false;
	}
	if(document.contact.txt_message.value == "")
	{
	   alert("Please enter message.");
	   document.contact.txt_message.focus();
	   return false;
	}
}


//Email Validation 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;
}

//Set up for email line so not searchable
function sendmailout(name,domain,domsuper,subject) {

	thispage = window.location.pathname;
	thispage = thispage.substring(thispage.lastIndexOf('/') + 1);
	thispage = thispage.substring(0,thispage.lastIndexOf('.'));

	commandline = '<a class="maillink" href="mailto:' + name + '@' + domain + "." + domsuper + '?subject=' + subject + ' (XXX)">'+name + '@' + domain + '.' + domsuper + '</a>';
	commandline = commandline.replace("XXX",thispage);
	document.write(commandline);
}

function sendmailfrombanner(name,domain,domsuper,subject,titlealt) {
	thispage = window.location.pathname;
	thispage = thispage.substring(thispage.lastIndexOf('/') + 1);
	thispage = thispage.substring(0,thispage.lastIndexOf('.'));
	commandline = '<area shape="rect" coords="652,75,885,107" href="mailto:' + name + '@' + domain + "." + domsuper + '?subject=' + subject + ' (XXX)" alt="' + titlealt + '" title="' + titlealt + '"/>';
	commandline = commandline.replace("XXX",thispage);
	document.write(commandline);
}