<script type="text/javascript">
<!--
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="">');}
 
// get the HTTP_HOST name i.e www.leedsmet.ac.uk
 host=document.location.hostname;
 
//if http then protocol = 4
//if https then protocol = 5
//checking for location of :
 
protocol = document.URL.indexOf(":");
 
//remove http://
results=document.URL.replace('http://', "");
//remove https://
results=results.replace('https://', "");
 
//remove www from hostname
results=results.replace('www', "");
//remove .leedsmet.ac.uk from hostname
results=results.replace('.leedsmet.ac.uk', "");
results=results.replace('.lmu.ac.uk', "");
results=results.replace('.htm', "");
 
//left with page directoy i.e. /study/hello.htm
//or if virtual host left with hostname and page
counter_name=results;
 
//global find / and change to .
    counter_name = counter_name.replace(/\//g, ".");
//global find + and change to _
 counter_name = counter_name.replace(/\+/g, "_");
//global find ? and change to _
 counter_name = counter_name.replace(/\?/g, "_");
//global find & and change to _
    counter_name = counter_name.replace(/\&/g, "_");
//global find = and change to _
    counter_name = counter_name.replace(/\=/g, "_");
//global find %20 and change to _
 counter_name = counter_name.replace(/%20/g, "_");
//global find # and change to _
 counter_name = counter_name.replace(/\#/g, "_");
//global find ~ and change to _
 counter_name = counter_name.replace(/\~/g, "_");
//global find end . and change to 
 counter_name = counter_name.replace(/.$/,"");
 
 
 
if (protocol==4){
//accessing via http
sitestat("http://uk.sitestat.com/leedsmet/leedsmet/s?" + counter_name.substring(1));
}
else
{
//accessing via https
sitestat("https://uk.sitestat.com/leedsmet/leedsmet/s??" + counter_name.substring(1));
}
//-->
</script>