var message = 'This link takes you to www.uk.multimap.com, which allows' +
 ' you to view a uk street map and also zoom in or out to a' +
 ' variety of different scales.\n\nUnfortunately, this site often' +
 ' carries advertisements which are sometimes disguised as Windows' +
 ' dialogue boxes to fool users into clicking on them.' +
 ' After entering the offending site, it may not be possible' +
 ' to exit using the \'Back\' button on your browser.';

var wid=300,
ht=232,
dogimage = 1,
inc1 = 1,
image1 = "",
photo = 0,
photonum = 10,
bigphoto = 10,
oddphoto = 0;
captions = new Array(12);
large = new Array(6);
 
function wagtail() {
dogimage = dogimage + inc1;
if (dogimage > 3) {dogimage = 2; inc1 = -1;}
if (dogimage < 1) {dogimage = 2; inc1 = 1;}
document.images[6].src = "dog" + dogimage + "b.jpg";
window.setTimeout("wagtail();",100);
}

function showImg(imageNo)
{
  oddphoto = (photonum % 2);
  bigphoto = photonum - oddphoto + imageNo;
  window.document.forms[0].caption.value = captions[bigphoto - 10];
  document.images[3].height = 450;
  document.images[3].width = 600;
  document.images[3].src = "photo" + bigphoto + "b.jpg";
  document.images[3].src = "photo" + bigphoto + "a.jpg";
}

function next() 
{
  photo = 2 - photo;
  photonum ++;
  if (photonum >= 22) { photonum = 10 } 
  document.images[photo].src = "photo" + photonum + "b.jpg";
  window.setTimeout("next();",2000);
}

function warn ()
{
 alert (message)
}
  
function switchImg(imageNo, smallImg, smallWid, smallHt, bigImg, bigWid, bigHt)
{ if (large[imageNo] == false) {
  wid = smallWid; ht = smallHt; image1 = smallImg }
  else { wid = bigWid; ht = bigHt; image1 = bigImg }
}
var expDays = 1; // number of days the cookie should last

function GetCookie (name) {  
var arg = name + "=";  
var alen = arg.length;  
var clen = document.cookie.length;  
var i = 0;  
while (i < clen) {    
var j = i + alen;    
if (document.cookie.substring(i, j) == arg)      
return getCookieVal (j);    
i = document.cookie.indexOf(" ", i) + 1;    
if (i == 0) break;   
}  
return null;
}
function SetCookie (name, value) {  
var argv = SetCookie.arguments;  
var argc = SetCookie.arguments.length;  
var expires = (argc > 2) ? argv[2] : null;  
var path = (argc > 3) ? argv[3] : null;  
var domain = (argc > 4) ? argv[4] : null;  
var secure = (argc > 5) ? argv[5] : false;  
document.cookie = name + "=" + escape (value) + 
((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + 
((path == null) ? "" : ("; path=" + path)) +  
((domain == null) ? "" : ("; domain=" + domain)) +    
((secure == true) ? "; secure" : "");
}
function DeleteCookie (name) {  
var exp = new Date();  
exp.setTime (exp.getTime() - 1);  
var cval = GetCookie (name);  
document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
}
var exp = new Date(); 
exp.setTime(exp.getTime() + (expDays*24*60*60*1000));
function amt(){
var count = GetCookie('mapcount')
if(count == null) {
SetCookie('churchcount','1')
return 1
}
else {
var newcount = parseInt(count) + 1;
DeleteCookie('churchcount')
SetCookie('churchcount',newcount,exp)
return count
   }
}
function getCookieVal(offset) {
var endstr = document.cookie.indexOf (";", offset);
if (endstr == -1)
endstr = document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));
}

function checkCount()
{
  var count = GetCookie('mapcount');
  if (count == null) 
  { count = 1;
    SetCookie('mapcount', count, exp);
    warn();}
  else 
  { count++;
    SetCookie('mapcount', count, exp);}
}

