var preloadFlag = false, tjpopwindow, mappopwindow;
var opicd, opfirstind=true, opcount, opval=1, opvartime, opfunfrom, optim;

window.onunload = closepopup;

function newImage(arg) 
{
	if (document.images) 
	{
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() 
{
	if (document.images && (preloadFlag == true)) 
	{
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

function opvars(funfrom, picd, timind)
{
     opicd = picd;
     opfunfrom = funfrom;
     optim = timind;
     opcount = 1;
     opvar();
}

function opvar()
{
    if (opcount < 8)
    {
       opval = opval - .1;
       opicd.style.opacity= opval;
       opcount =  opcount +1;
       opvartime = setTimeout ("opvar()", 0);
    }
    else
    {
       opfirstind = false;
       opval = 1;
       opicd.style.opacity= 1;
       clearTimeout(opvartime);
       optim = setTimeout (opfunfrom, 0);
    }
}

function tjpopup(popurl)
{
   if (tjpopwindow != null) tjpopwindow.close();
   tjpopwindow= window.open(popurl, "", "top=5, left=5, width=795, height=570, scrollbars, resizable");
}
function mappopup()
{
   if (mappopwindow != null) mappopwindow.close();
   mappopwindow= window.open("http://www.multimap.com/maps/?hloc=GB|CV37%206LF#t=l&map=52.19319,-1.71086|16|4&loc=GB:52.19319:-1.71086:16|CV37 6LF|CV37 6LF",
  		 "", "top=30, left=5, width=790, height=450, scrollbars, resizable");
}
function closepopup()
{
  if(tjpopwindow != null) tjpopwindow.close();
  if (mappopwindow != null) mappopwindow.close();
}