//==========================================
// Rollovers
//==========================================
function move_in(img_name,img_src) {
	document[img_name].src=img_src;
	}

	function move_out(img_name,img_src) {
	document[img_name].src=img_src;
	}
	
//==========================================
// CSS Dropdown menu IE fix
//==========================================
startList = function() {
if (document.all&&document.getElementById) {
navRoot = document.getElementById("nav");
for (i=0; i<navRoot.childNodes.length; i++) {
node = navRoot.childNodes[i];
if (node.nodeName=="LI") {
node.onmouseover=function() {
this.className+=" over";
  }
  node.onmouseout=function() {
  this.className=this.className.replace(" over", "");
   }
   }
  }
 }
}
window.onload=startList;

//==========================================
// Application Form
//==========================================
function checkForm(){
	var userEmail = document.form1.PImail.value;
	if (userEmail ==""){
		alert("Please provide an email address");
		document.form1.PImail.focus();
		return false;
	} else if (userEmail.indexOf("@")==-1 || userEmail.indexOf(".")==-1 || userEmail.indexOf(" ")!=-1) {
		alert("Sorry, your email address is invalid");
		document.form1.PImail.focus();
		return false;
	}
	var userSig = document.form1.signature.value;
	if (userSig ==""){
		alert("Please fill out the Signature field")
		document.form1.signature.focus();
		return false;
	}
	var userDate = document.form1.date.value;
	if (userDate ==""){
		alert("Please fill out the Date field")
		document.form1.date.focus();
		return false;
	}
}

function makeArray() {
     for (i = 0; i<makeArray.arguments.length; i++)
          this[i + 1] = makeArray.arguments[i];
}

//==========================================
// Email.js version 5
//==========================================
var tld_ = new Array()
tld_[0] = "com";
tld_[1] = "org";
tld_[2] = "net";
tld_[3] = "ws";
tld_[4] = "info";
tld_[10] = "co.uk";
tld_[11] = "org.uk";
tld_[12] = "gov.uk";
tld_[13] = "ac.uk";
var topDom_ = 13;
var m_ = "mailto:";
var a_ = "@";
var d_ = ".";

//EMAIL FUNCTION

function mail(name, dom, tl, params)
{
	var s = e(name,dom,tl);
	document.write('<a href="'+m_+s+params+'">'+s+'</a>');
}
function mail2(name, dom, tl, params, display)
{
	document.write('<a href="'+m_+e(name,dom,tl)+params+'">'+display+'</a>');
}
function e(name, dom, tl)
{
	var s = name+a_;
	if (tl!=-2)
	{
		s+= dom;
		if (tl>=0)
			s+= d_+tld_[tl];
	}
	else
		s+= swapper(dom);
	return s;
}
function swapper(d)
{
	var s = "";
	for (var i=0; i<d.length; i+=2)
		if (i+1==d.length)
			s+= d.charAt(i)
		else
			s+= d.charAt(i+1)+d.charAt(i);
	return s.replace(/\?/g,'.');
}


//==========================================
//POP UP FUNCTION
//==========================================
function popUp(vW,vH,fileName){
			vL = (screen.width) ? (screen.width-vW)/2 : 0;
			vT = (screen.height) ? (screen.height-vH)/2 : 0;features = "width=" + vW + ",height=" + vH + ",left=" + vL + ",top=" + vT + ",fullscreen=no,toolbar=no,status=no,menubar=no,scrollbars=no,resizable=no,directories=no,location=no";
			newWin = window.open(fileName, 'mvWin', features);
		}

//==========================================
// XHTML Standards New Browser Window
//==========================================
/*function externalLinks() { 
 if (!document.getElementsByTagName) return; 
 var anchors = document.getElementsByTagName("a"); 
 for (var i=0; i<anchors.length; i++) { 
   var anchor = anchors[i]; 
   if (anchor.getAttribute("href") && 
       anchor.getAttribute("rel") == "external") 
     anchor.target = "_blank"; 
 } 
} 
window.onload = externalLinks;*/