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_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_findObj(n, d) { //v4.01
  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);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

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_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

document.onload="MM_preloadImages('http://webarchive.nationalarchives.gov.uk/+/http://www.homeoffice.gov.uk/siteimages/global_inside_on.gif','http://webarchive.nationalarchives.gov.uk/+/http://www.homeoffice.gov.uk/siteimages/global_community_on.gif','http://webarchive.nationalarchives.gov.uk/+/http://www.homeoffice.gov.uk/siteimages/global_crime_on.gif','http://webarchive.nationalarchives.gov.uk/+/http://www.homeoffice.gov.uk/siteimages/global_justice_on.gif','http://webarchive.nationalarchives.gov.uk/+/http://www.homeoffice.gov.uk/siteimages/global_drugs_on.gif','http://webarchive.nationalarchives.gov.uk/+/http://www.homeoffice.gov.uk/siteimages/global_immigration_on.gif','http://webarchive.nationalarchives.gov.uk/+/http://www.homeoffice.gov.uk/siteimages/global_passports_on.gif','http://webarchive.nationalarchives.gov.uk/+/http://www.homeoffice.gov.uk/siteimages/global_research_on.gif','http://webarchive.nationalarchives.gov.uk/+/http://www.homeoffice.gov.uk/siteimages/global_visas_on.gif','http://webarchive.nationalarchives.gov.uk/+/http://www.homeoffice.gov.uk/siteimages/inside_arrow_nav.gif','http://webarchive.nationalarchives.gov.uk/+/http://www.homeoffice.gov.uk/siteimages/global_contact_on.gif','http://webarchive.nationalarchives.gov.uk/+/http://www.homeoffice.gov.uk/siteimages/global_azindex_on.gif','http://webarchive.nationalarchives.gov.uk/+/http://www.homeoffice.gov.uk/siteimages/global_search_on.gif','http://webarchive.nationalarchives.gov.uk/+/http://www.homeoffice.gov.uk/siteimages/global_whatsnew_on.gif','http://webarchive.nationalarchives.gov.uk/+/http://www.homeoffice.gov.uk/siteimages/global_home_on.gif')"

// Display date

function makeArray() {
    for (i = 0; i<makeArray.arguments.length; i++)
        this[i + 1] = makeArray.arguments[i];
}
function makeArray0() {
    for (i = 0; i<makeArray0.arguments.length; i++)
        this[i] = makeArray0.arguments[i];
}
function y2k(number) { return (number < 1000) ? number + 1900 : number; }
var months = new makeArray('January','February','March','April','May','June','July','August','September','October','November','December');
var days = new makeArray0('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');
var today = new Date();
var day   = days[today.getDay()];
var date  = today.getDate();
var month = today.getMonth() + 1;
var year  = y2k(today.getYear());


// Level 2 Nav function to replace in code event handlers
// these were throwing JS errors in NN4.x
// this alternative reduces page size, eliminates errors, etc., etc. - it's just better, trust me ;-)

// Work in progress....
// hide these lines until we've ironed the bugs out
/*
document.onmouseover = nav2on;
if (document.captureEvents) document.captureEvents(Event.MOUSEOVER);
document.onmouseout = nav2off; 
if (document.captureEvents) document.captureEvents(Event.MOUSEOUT);
*/

function nav2on(e) {
if (!e) var e = window.event
if (e.target) targ = e.target;
else if (e.srcElement) targ = e.srcElement;
if (targ.nodeType == 3) targ = targ.parentNode;

if (targ.tagName == 'TD' && targ.className && targ.className == "sitenavoff") 
		{
   		targ.className = 'sitenavon'
			if (document.all) {targ.style.cursor = 'hand';}
			else {targ.style.cursor = 'pointer';}
 		}
		
if ((targ.tagName == 'IMG' || targ.tagName == 'A') && targ.parentNode.className && targ.parentNode.className == "sitenavoff")
		{
   		targ.parentNode.className = 'sitenavon'
			if (document.all) {targ.parentNode.style.cursor = 'hand';}
			else {targ.parentNode.style.cursor = 'pointer';}
 		}	
		
}


function nav2off(e) {
if (!e) var e = window.event
if (e.target) targ = e.target;
else if (e.srcElement) targ = e.srcElement;
if (targ.nodeType == 3) targ = targ.parentNode;

if  (targ.tagName == 'TD' && targ.className && targ.className == "sitenavon") 
	{
   		targ.className = 'sitenavoff'
			targ.style.cursor = 'default';
 		}
}






