/* pagelog function by S Hqxell - allows sitestate code to be in external file */
function pagelog(myurlvalue) {
	var intIndexOfMatch = myurlvalue.indexOf( "/" );
	while (intIndexOfMatch != -1){
		myurlvalue = myurlvalue.replace ( "/", "." )
		intIndexOfMatch = myurlvalue.indexOf( "/" );
		}
	intIndexOfMatch = myurlvalue.indexOf( ".html" );
	while (intIndexOfMatch != -1){
		myurlvalue = myurlvalue.replace ( ".html", "" )
		intIndexOfMatch = myurlvalue.indexOf( ".html" );
		}
	var mysitestat = "http://webarchive.nationalarchives.gov.uk/+/http://uk.sitestat.com/dti/dti/s?dti.gov.uk"  + myurlvalue;

	sitestat(mysitestat);
	
	}
							
function sitestat(ns_l){ns_l+='&amp;ns__t='+(new Date()).getTime();ns_pixelUrl=ns_l;
	ns_0=document.referrer;
	ns_0=(ns_0.lastIndexOf('/')==ns_0.length-1)?ns_0.substring(ns_0.lastIndexOf('/'),0):ns_0;
	if(ns_0.length>0)ns_l+='&amp;ns_referrer='+escape(ns_0);
	if(document.images){ns_1=new Image();ns_1.src=ns_l;}else
		document.write('<img src="'+ns_l+'" width="1" height="1" alt=""/>');
	}


