// JavaScript code (originally for E-Series Business)
//
// Common routines used by both secure and non-secure parts of the application
// Version 3.01
// August 20 2001
// Mark Macrae, Experian Ltd

// ***************************************************
// Generic Base-level Functions
// ***************************************************

// Determines the value of a selected radio button

function getRadioValue(radioObject) {
	var radiovalue = null;
	for (var x=0; x<radioObject.length; x++) {
		if (radioObject[x].checked) {
			radiovalue = radioObject[x].value;
		}
	}
	return radiovalue;
}

// Returns keycode pressed (compatible with IE and Netscape)

function getKey(oEvent) {
	var key;
	
	// Only IE suports window.event
	if (window.event) {
		key = window.event.keyCode;
	} else if (oEvent) {
		key = oEvent.which;
	} else {
		return false;
	}
	return key;
}
	
// Navigate back through Browser history
	
function Back(num)
{
	window.history.go(num);
}


// ***********************************************************
// Common Validation Routines Accessible by Entire Application
// ***********************************************************
		
// Detect key pressed and use appropriate validation passed in as parameter (numeric, alpha or alphanumeric).
// Netscape 4 uses event passed in, and IE uses window.event to trap the key being pressed.
//
// If validation fails, false is returned, which when used with onKeyPress/Down/Up prevents the character
// from being displayed.

function valKeyPress(oEvent,sValType, submitFunction) {
	var key;
	var valString;
	var valExtra;

	key = getKey(oEvent);

	// If ENTER key has been pressed, execute code passed in as submitFunction.  This is usually the 
	// code that would have executed if the submit button was clicked.

	if (key == 13) {
		if (submitFunction) {
			eval(submitFunction);
			return false;
		}
	}

	// Determine what to validate against dependent on validation type.
	// valExtra contains extra allowed characters (this could later be passed as a parameter)

	valExtra = "&@.- ";

	switch (sValType) {
		case "numeric" :
			valString = "0123456789";
			break;
		case "alpha" :
			valString = "abcdefghijklmnopqrstuvwxyz" + valExtra;
			break;
		case "alphanumeric" :
			valString = "0123456789abcdefghijklmnopqrstuvwxyz" + valExtra;
			break;
		default :
			valString = "0123456789abcdefghijklmnopqrstuvwxyz" + valExtra;
			break;
	}

	keychar = String.fromCharCode(key);
	keychar = keychar.toLowerCase();

	// Ignore control keys
	if ( (key==null) || (key==0) || (key==8) || (key==9) || (key==27) ) {
		return true;
	} else if (valString.indexOf(keychar) > -1) {
		return true;
	} else {
		return false;
	}
}

// ********************************************
// Drop-down Menu Functions (eseries_script.js)
// ********************************************

var mnuSelected = '';
var server;	
	
// Sets the propeties of each menu item.  Text is the actual displayed text, link is the hyperlink
// for the menu item, target will specify a target frame.

function menuItem(text, link, target){
	this.text = text;
	this.link = link;
	if (target) {
		this.target = target;
	} else {
		this.target = "PageContent";
	}
}

// Sets up a new instance of a menu class containing properties and methods for its items.

function menu(){
	var itemArray = new Array();
	var args = menu.arguments;
	this.name = args[0];
	for(i=1; i<args.length; i++){
		itemArray[i-1] = args[i];
	}
	this.menuItems = itemArray;
	this.write = writeMenu;
	this.position = positionMenu;
}

// Positions the DIV on the screen

function positionMenu(top,left,width) {
	this.top = top;
	this.left = left;
	this.width = width;
}

// Usually called from onMouseOver event of menu heading.  Displays the DIV setting its visibility property to visible

function showMenu(menu,leftpos,toppos) {
	var bannerHeight;
	if (getElement('esbanner')) {
		bannerHeight = getElement('esbanner').offsetHeight;
	} else {
		bannerHeight = 54;
	}
	var divID = getElement(menu);
	if (mnuSelected != '') {
		hideMenu(mnuSelected);
	}
	if (document.getElementById) {
		divID.style.width = divID.childNodes[0].clientWidth + 20;
	} else if (document.all) {
		divID.style.width = divID.children[0].clientWidth + 20;
	} 
	if (leftpos != null) {
		if ((parseInt(divID.style.left) + parseInt(divID.style.width)) >= (document.body.clientWidth - 10)) {
			var fitleft = document.body.clientWidth - parseInt(divID.style.width);
			divID.style.left = fitleft;
		} else {
			divID.style.left = leftpos;
		}
	}
	if (toppos != null) {
		divID.style.top = toppos + bannerHeight;
	}
	divID.style.visibility = 'visible';
	mnuSelected = menu;
}

// Usually called from onMouseOut/onMouseClick events to hide the drop down menu.

function hideMenu(menu) {
	if (document.getElementById) {
		getElement(menu).style.visibility = 'hidden';
	} else {
		if (event.srcElement.tagName != "A") {
			getElement(menu).style.visibility = 'hidden';
		}
	} 
}

// Causes drop-down to dissappear when mouse moves out of menuheading area.  This is
// separate to hideMenu to prevent menus hanging around on IE4.

function hideMenuHeading(menu) {
	if (mnuSelected) {
		getElement(menu).style.visibility = 'hidden';
	}
}

// Builds the drop-down menu using the information passed in.  Keeps it hidden initially, ready
// to be displayed onMouseOver.

function writeMenu() {
	var sSap = ""
	if(server=='s')
	{
		sSap='sapphire/';
	}
	var sPath= sSap + 'images/'
	var menuText = '<div id="';
	menuText += this.name;
	menuText += '"  style="width:auto;visibility:hidden;z-index:1;position:absolute;top: ';
	menuText += this.top;
	menuText += ';left: ';
	menuText += this.left;
	menuText += ';"> '
	menuText += '<table cellpadding="0" cellspacing="0" border="0" width="';
	menuText += this.width;
	menuText += '" onClick="hideMenu(mnuSelected);" onMouseOver="showMenu(mnuSelected,null,null)" onMouseOut="hideMenu(mnuSelected)">';
	for(i=0; i<this.menuItems.length; i++){
		menuText += '<tr bgcolor="#000066">';
		menuText += '<td width="5px" class="menuside">&nbsp;</td>';
		menuText += '<td class="menulink" nowrap><span><a ';
		menuText += '" class="menulink" href="' + this.menuItems[i].link + '">';
		menuText += this.menuItems[i].text + '</a></span></td>';
		menuText += '<td width="5px" class="menuside">&nbsp;</td>';
		menuText += '</tr>';
	}
	menuText += '<tr valign="top"><td width="5px"><img src="/agents/H23007/images/mnu_bottomleft.gif" border="0"></td><td bgcolor="#000066" class="menuside">&nbsp;</td><td><img border="0" src="/agents/H23007/images/mnu_bottomright.gif"></td></tr>';
	menuText += '</table>';
	menuText += '</div>';								
	document.write(menuText);
	document.close();	
}

// Gets a handle on an element that has an ID assigned to it.  Different browsers grab elements
// in different ways, but this covers IE4+ and NS6.

function getElement(elementId) {
	if (document.getElementById) {
		return document.getElementById(elementId);
	} else if(document.all) {
		return document.all(elementId);
	} else {
		return document.layers[elementId];
	}
}

// Builds the HTML for the menu headings

function buildMenuHeadings() {
	var slink= '/tv/index.shtml';
	var slabel = 'home';
	var astpath = location.pathname;

	if(astpath.indexOf('/bin/') != -1 && astpath.indexOf('/bin/login.pl') == -1) {
	  slink = '/bin/login.pl';
	  slabel = 'main menu';
	}
	var sHTML ='<div style="background:#000066" width="100%"><table  id="mnuHeadings" bgcolor="#000066" class="menulink" border="0" cellspacing="0" cellpadding="2"><tr>'
	sHTML +='<td onMouseOut="hideMenuHeading(mnuSelected);" onMouseOver="showMenu(\'mnuabout\', getElement(\'trgabout\').offsetLeft + 5, getElement(\'mnuHeadings\').offsetHeight);" id="trgabout"><a class="menulink" href="/tv/tvmenu.shtml#about">about our info</a></td><td class="menulink">|</td>'
	sHTML +='<td onMouseOut="hideMenuHeading(mnuSelected);" onMouseOver="showMenu(\'mnuopenacc\', getElement(\'trgopenacc\').offsetLeft + 5, getElement(\'mnuHeadings\').offsetHeight);" id="trgopenacc"><a class="menulink" href="/tv/tvmenu.shtml#openacc">open account</a></td><td class="menulink">|</td>'
	sHTML +='<td onMouseOut="hideMenuHeading(mnuSelected);" onMouseOver="showMenu(\'mnureports\', getElement(\'trgreports\').offsetLeft + 5, getElement(\'mnuHeadings\').offsetHeight);" id="trgreports"><a class="menulink" href="/tv/tvmenu.shtml#reports">reports</a></td><td class="menulink">|</td>'
	sHTML +='<td onMouseOut="hideMenuHeading(mnuSelected);" onMouseOver="showMenu(\'mnuprices\', getElement(\'trgprices\').offsetLeft + 5, getElement(\'mnuHeadings\').offsetHeight);" id="trgprices"><a class="menulink" href="/tv/tvprices.shtml">prices</a></td><td class="menulink">|</td>'
	sHTML +='<td onMouseOut="hideMenuHeading(mnuSelected);" onMouseOver="showMenu(\'mnuhelp\', getElement(\'trghelp\').offsetLeft + 5, getElement(\'mnuHeadings\').offsetHeight);" id="trghelp"><a class="menulink" href="http://experian.custhelp.com">on-line help</a></td><td class="menulink">|</td>'
	sHTML +='<td onMouseOut="hideMenuHeading(mnuSelected);" onMouseOver="showMenu(\'mnucontact\', getElement(\'trgcontact\').offsetLeft + 5, getElement(\'mnuHeadings\').offsetHeight);" id="trgcontact"><a class="menulink" href="/tv/tvmenu.shtml#contact">contact</a></td><td class="menulink">|</td>'
	sHTML +='<td onMouseOut="hideMenuHeading(mnuSelected);" onMouseOver="showMenu(\'mnunews\', getElement(\'trgnews\').offsetLeft + 5, getElement(\'mnuHeadings\').offsetHeight);" id="trgnews"><a class="menulink" href="/tv/news.shtml">news</a></td><td class="menulink">|</td>'

	sHTML +='<td><a class="menulink" href=' + slink + '>'+ slabel + '</a></td></tr></table></div>'
	sHTML +='<div id="pageheading"></div>'

	document.write(sHTML);
}

// Create the drop-down menus for the non-secure web pages.  Hrefs point to pages on same server.

function buildNonSecureMenus() {

	buildMenuHeadings();

	var mnuabout =   new menu('mnuabout' ,new menuItem ('Data sources','/tv/sources.shtml') ,new menuItem ('Keeping our data uptodate','/tv/uptodate.shtml') ,new menuItem ('Data protection','/tv/dpa.shtml') ,new menuItem ('Why choose Experian','/tv/differences.shtml') ,new menuItem ('About Experian','/tv/aboutexperian.shtml') ,new menuItem ('Application Completion Instructions','/tv/instructions.shtml') ,new menuItem ('About Tenant Verifier','/tv/abouttv.shtml'));mnuabout.position(getElement('mnuHeadings').offsetHeight,getElement('trgabout').offsetLeft + 5,200);mnuabout.write();
	var mnuopenacc =  new menu('mnuopenacc' ,new menuItem ('On-line Account','/tv/openacc_new.shtml') ,new menuItem ('Manual Account','/tv/openacc_man.shtml'));mnuopenacc.position(getElement('mnuHeadings').offsetHeight,getElement('trgopenacc').offsetLeft + 5,200);mnuopenacc.write();
	var mnureports = new menu('mnureports' ,new menuItem ('Financial report','/tv/fin.shtml') ,new menuItem ('Full report','/tv/full.shtml') ,new menuItem ('Company let - limited business','/tv/compltd.shtml') ,new menuItem ('Company let - non-limited business','/tv/compnonltd.shtml'));mnureports.position(getElement('mnuHeadings').offsetHeight,getElement('trgreports').offsetLeft + 5,200);mnureports.write();
	var mnuprices = new menu('mnuprices' ,new menuItem ('Prices','/tv/tvprices.shtml'));mnuprices.position(getElement('mnuHeadings').offsetHeight,getElement('trgprices').offsetLeft + 5,50);mnuprices.write();
	var mnuhelp = new menu('mnuhelp' ,new menuItem ('On-line customer service','http://experian.custhelp.com'));mnuhelp.position(getElement('mnuHeadings').offsetHeight,getElement('trghelp').offsetLeft + 5,50);mnuhelp.write();
	var mnucontact = new menu('mnucontact' ,new menuItem ('Customer services','/tv/custserv.shtml') ,new menuItem ('By email','/tv/email.shtml') ,new menuItem ('By fax','/tv/fax.shtml') ,new menuItem ('Opening hours','/tv/hours.shtml') ,new menuItem ('Give us your comments','/tv/comments.shtml'));mnucontact.position(getElement('mnuHeadings').offsetHeight,getElement('trgcontact').offsetLeft + 5,180);mnucontact.write();
	var mnunews = new menu('mnunews' ,new menuItem ('News Items','/tv/news.shtml'));mnunews.position(getElement('mnuHeadings').offsetHeight,getElement('trgnews').offsetLeft + 5,115);mnunews.write	();
}
// Builds the HTML for the page headings

function buildPageHeadings(type) {
	var sHTML ='<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr bgcolor="#33CC00">'
	sHTML +='<td width="134"><a name="top"></a><img alt="Experian Logo" src="/cv/images/experian_logo.gif" wassrc="/agents/H23007/images/experianlogo.gif" width="195" height="65" waswidth="134" washeight="54"></td>'
	sHTML +='<td width="502"><img alt="candidate verifer" src="/agents/H23007/images/titlecom.gif"></td>'
	sHTML +='<td width="100%">&nbsp;</td>'
//		sHTML +='<td width="100%" bgcolor=#33cc00 align=right><!-- BEGIN WEBSIDESTORY CODE -->\n<!-- COPYRIGHT 1997-2001 WEBSIDESTORY, INC. ALL RIGHTS RESERVED. U.S.PATENT PENDING. Privacy notice at: http://websidestory.com/privacy -->\n'
//		sHTML +='<!-- webbot bot="HTMLMarkup" startspan -->\n<script language="javascript">\nvar _pn="comheader"; file://page name\nvar _acct="WQ520830E5BE62EN7";   file://account number\nvar _pndef="title";var _hcv=65;var _mn="wf144";\nvar _lp=location.protocol.indexOf(\'https\')==0?"https://":"http://";\n'
//		sHTML +='var _gn="hg1.hitbox.com";function _ps(_h){if(_h.indexOf("PUT+PAGE+NAME+HER")==0) {\nif (_pndef=="title"){return document.title?document.title:_pndef;}else{\nvar _g=location.pathname;_h=_g.substring(_g.lastIndexOf("/")+1,_g.length);\nif(_h==""){return _pndef};}};return _h;}var _sv=10;var _bn=navigator.appName;\n'
//		sHTML +='if(_bn.substring(0,9)=="Microsoft"){_bn="MSIE";};var _bv=Math.round(parseFloat(navigator.appVersion)*100);\nif((_bn=="MSIE")&&(parseInt(_bv)==2))_bv=301;var _rf=escape(document.referrer);_pn=_ps(_pn);\nvar _hbfa="<a href=\'http://rd1.hitbox.com/rd?acct="+_acct+"\' target=_top>'
//		sHTML +='<img src=\'";\nvar _hbfc="\' border=0 width=54 was=125 height=54 was=125></a><wasdiv><font face=\'MS Sans Serif,Arial,Helvetica \'"+"size=1><a href=\'http://counter.hitbox.com/a/hitboxfree.cgi\' target=\'_blank\'>privacy</a></font></wasdiv>";\n'
//		sHTML +='var _hbfb="";</script><script language="javascript1.1" id="_hbc">_sv=11;</script><script language="javascript1.1" src="http://stats.hitbox.com/js/hbf.js"></script><script language="javascript">\n'
//		sHTML +='if(_hbfb.length!=0){document.write(_hbfa+_hbfb+_hbfc);}else{if((_rf=="undefined")||(_rf=="")){\n_rf="bookmark";};document.write(_hbfa+_lp+_gn+"/HG?hc="+_mn+"&l=1&hb="+_acct+"&n="+escape(_pn)+"&cd=1&bt=2&bn="+escape(_bn)+"&bv="+_bv+"&ss=na&sc=na&dt=&sv="+_sv+"&ja=na&ln=na&pl=&rf="+_rf+_hbfc);}\n'
//		sHTML +='</script><noscript><a href="http://rd1.hitbox.com/rd?acct=WQ520830E5BE62EN7" target=_top><img src="http://hg1.hitbox.com/HG?hc=wf144&cd=1&ce=u&hb=WQ520830E5BE62EN7&n=comheader&l=1" border="0" width=54 was=125 height=54 was=125></a><wasdiv><font face="MS Sans Serif,Arial,Helvetica" size=1><a href="http://counter.hitbox.com/a/hitboxfree.cgi" target="_blank">privacy</a></font></wasdiv></noscript><!--//-->\n'
//		sHTML +='<!-- webbot bot="HTMLMarkup" endspan --><!--  END WEBSIDESTORY CODE  -->\n'
//		sHTML +='</td>'
	sHTML +='</tr></table>'

	document.write(sHTML);

}

// ***********************************************************
// Cookie Routines Accessible by Entire Application
// ***********************************************************


function setCompID(deptcode) {
//	SetCookie('DeptNum',deptcode,null,null,'192.168.16.7',null);
	SetCookie('DeptNum',deptcode,null,null,'.uk.experian.com',null);
}

function SetRadioCookie(name,rtype)
{
//	SetCookie(name,rtype,null,null,'192.168.16.7',null);
	SetCookie(name,rtype,null,null,'.uk.experian.com',null);
}

// *********************************************************
// Browser Detection and Server Access Functions
// *********************************************************


// Retrieve URL/Unix Path for Secure/Non-Secure Server

function GetServerPath(type)
{
	switch (type) {
		case "SecureHTTP":
			return "https://secure.uat.e-series.uk.experian.com/e-series";
			break;
		case "SecureUnix":
			return "/usr/netscape/server4.1/docs/8507/sapphire/";
			break;
		case "NonSecureHTTP":
			return "http://www.uat.uk.experian.com/bi/";
			break;
	}
}

// *********************************************************
// Javascript for Navigation Bar (Copyright Macromedia Inc.)
// *********************************************************

function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

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 MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

function MM_timelineGoto(tmLnName, fNew, numGotos) { //v2.0  //Copyright 1997 Macromedia, Inc. All rights reserved.
  var i,j,tmLn,props,keyFrm,sprite,numKeyFr,firstKeyFr,lastKeyFr,propNum,theObj;
  if (document.MM_Time == null) MM_initTimelines(); //if *very* 1st time
  tmLn = document.MM_Time[tmLnName];
  if (numGotos != null)
    if (tmLn.gotoCount == null) tmLn.gotoCount = 1;
    else if (tmLn.gotoCount++ >= numGotos) {tmLn.gotoCount=0; return}
  jmpFwd = (fNew > tmLn.curFrame);
  for (i = 0; i < tmLn.length; i++) {
    sprite = (jmpFwd)? tmLn[i] : tmLn[(tmLn.length-1)-i]; //count bkwds if jumping back
    if (sprite.charAt(0) == "s") {
      numKeyFr = sprite.keyFrames.length;
      firstKeyFr = sprite.keyFrames[0];
      lastKeyFr = sprite.keyFrames[numKeyFr - 1];
      if ((jmpFwd && fNew<firstKeyFr) || (!jmpFwd && lastKeyFr<fNew)) continue; //skip if untouchd
      for (keyFrm=1; keyFrm<numKeyFr && fNew>=sprite.keyFrames[keyFrm]; keyFrm++);
      for (j=0; j<sprite.values.length; j++) {
        props = sprite.values[j];
        if (numKeyFr == props.length) propNum = keyFrm-1 //keyframes only
        else propNum = Math.min(Math.max(0,fNew-firstKeyFr),props.length-1); //or keep in legal range
        if (sprite.obj != null) {
          if (props.prop2 == null) sprite.obj[props.prop] = props[propNum];
          else        sprite.obj[props.prop2][props.prop] = props[propNum];
      } }
    } else if (sprite.charAt(0)=='b' && fNew == sprite.frame) eval(sprite.value);
  }
  tmLn.curFrame = fNew;
  if (tmLn.ID == 0) eval('MM_timelinePlay(tmLnName)');
}

function MM_timelinePlay(tmLnName, myID) { //v1.2
  //Copyright 1997 Macromedia, Inc. All rights reserved.
  var i,j,tmLn,props,keyFrm,sprite,numKeyFr,firstKeyFr,propNum,theObj,firstTime=false;
  if (document.MM_Time == null) MM_initTimelines(); //if *very* 1st time
  tmLn = document.MM_Time[tmLnName];
  if (myID == null) { myID = ++tmLn.ID; firstTime=true;}//if new call, incr ID
  if (myID == tmLn.ID) { //if Im newest
    setTimeout('MM_timelinePlay("'+tmLnName+'",'+myID+')',tmLn.delay);
    fNew = ++tmLn.curFrame;
    for (i=0; i<tmLn.length; i++) {
      sprite = tmLn[i];
      if (sprite.charAt(0) == 's') {
        if (sprite.obj) {
          numKeyFr = sprite.keyFrames.length; firstKeyFr = sprite.keyFrames[0];
          if (fNew >= firstKeyFr && fNew <= sprite.keyFrames[numKeyFr-1]) {//in range
            keyFrm=1;
            for (j=0; j<sprite.values.length; j++) {
              props = sprite.values[j]; 
              if (numKeyFr != props.length) {
                if (props.prop2 == null) sprite.obj[props.prop] = props[fNew-firstKeyFr];
                else        sprite.obj[props.prop2][props.prop] = props[fNew-firstKeyFr];
              } else {
                while (keyFrm<numKeyFr && fNew>=sprite.keyFrames[keyFrm]) keyFrm++;
                if (firstTime || fNew==sprite.keyFrames[keyFrm-1]) {
                  if (props.prop2 == null) sprite.obj[props.prop] = props[keyFrm-1];
                  else        sprite.obj[props.prop2][props.prop] = props[keyFrm-1];
        } } } } }
      } else if (sprite.charAt(0)=='b' && fNew == sprite.frame) eval(sprite.value);
      if (fNew > tmLn.lastFrame) tmLn.ID = 0;
  } }
}

function MM_timelineStop(tmLnName) { //v1.2
  //Copyright 1997 Macromedia, Inc. All rights reserved.
  if (document.MM_Time == null) MM_initTimelines(); //if *very* 1st time
  if (tmLnName == null)  //stop all
    for (var i=0; i<document.MM_Time.length; i++) document.MM_Time[i].ID = null;
  else document.MM_Time[tmLnName].ID = null; //stop one
}

function MM_initTimelines() {
    //MM_initTimelines() Copyright 1997 Macromedia, Inc. All rights reserved.
    var ns = navigator.appName == "Netscape";
    document.MM_Time = new Array(7);
    document.MM_Time[0] = new Array(1);
    document.MM_Time["aboutmenuoff"] = document.MM_Time[0];
    document.MM_Time[0].MM_Name = "aboutmenuoff";
    document.MM_Time[0].fps = 15;
    document.MM_Time[0][0] = new String("behavior");
    document.MM_Time[0][0].frame = 5;
    document.MM_Time[0][0].value = "MM_showHideLayers('aboutmenu','','hide')";
    document.MM_Time[0].lastFrame = 5;
    document.MM_Time[1] = new Array(1);
    document.MM_Time["openaccmenuoff"] = document.MM_Time[1];
    document.MM_Time[1].MM_Name = "openaccmenuoff";
    document.MM_Time[1].fps = 15;
    document.MM_Time[1][0] = new String("behavior");
    document.MM_Time[1][0].frame = 5;
    document.MM_Time[1][0].value = "MM_showHideLayers('openaccmenu','','hide')";
    document.MM_Time[1].lastFrame = 5;
    document.MM_Time[2] = new Array(1);
    document.MM_Time["reportsmenuoff"] = document.MM_Time[2];
    document.MM_Time[2].MM_Name = "reportsmenuoff";
    document.MM_Time[2].fps = 15;
    document.MM_Time[2][0] = new String("behavior");
    document.MM_Time[2][0].frame = 5;
    document.MM_Time[2][0].value = "MM_showHideLayers('reportsmenu','','hide')";
    document.MM_Time[2].lastFrame = 5;
    document.MM_Time[3] = new Array(1);
    document.MM_Time["pricesmenuoff"] = document.MM_Time[3];
    document.MM_Time[3].MM_Name = "pricesmenuoff";
    document.MM_Time[3].fps = 15;
    document.MM_Time[3][0] = new String("behavior");
    document.MM_Time[3][0].frame = 5;
    document.MM_Time[3][0].value = "MM_showHideLayers('pricesmenu','','hide')";
    document.MM_Time[3].lastFrame = 5;
    document.MM_Time[4] = new Array(1);
    document.MM_Time["helpmenuoff"] = document.MM_Time[4];
    document.MM_Time[4].MM_Name = "helpmenuoff";
    document.MM_Time[4].fps = 15;
    document.MM_Time[4][0] = new String("behavior");
    document.MM_Time[4][0].frame = 5;
    document.MM_Time[4][0].value = "MM_showHideLayers('helpmenu','','hide')";
    document.MM_Time[4].lastFrame = 5;
    document.MM_Time[5] = new Array(1);
    document.MM_Time["contactmenuoff"] = document.MM_Time[5];
    document.MM_Time[5].MM_Name = "contactmenuoff";
    document.MM_Time[5].fps = 15;
    document.MM_Time[5][0] = new String("behavior");
    document.MM_Time[5][0].frame = 5;
    document.MM_Time[5][0].value = "MM_showHideLayers('contactmenu','','hide')";
    document.MM_Time[5].lastFrame = 5;
    document.MM_Time[6] = new Array(1);
    document.MM_Time["newsmenuoff"] = document.MM_Time[6];
    document.MM_Time[6].MM_Name = "newsmenuoff";
    document.MM_Time[6].fps = 15;
    document.MM_Time[6][0] = new String("behavior");
    document.MM_Time[6][0].frame = 5;
    document.MM_Time[6][0].value = "MM_showHideLayers('newsmenu','','hide')";
    document.MM_Time[6].lastFrame = 5;

    for (i=0; i<document.MM_Time.length; i++) {
        document.MM_Time[i].ID = null;
        document.MM_Time[i].curFrame = 0;
        document.MM_Time[i].delay = 1000/document.MM_Time[i].fps;
    }
}

// Change colour of browser object, eg table cell (NB only works in IE4+)

function changeColour(oObj,colour)
{
	oObj.bgColor = colour; 
}

function CheckTerms(frm) {
	if (frm.chkAgreeTerms.checked==false) {
		alert("You must agree to the Terms and Conditions before you can submit your application.");
	} else {
		frm.submit();
	}
}
