var preloadFlag = false, tjpopwindow, mappopwindow;

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 preloadImagesg() 
{
	if (document.images) 
	{
		hyp_pipe_over = newImage("images/hyp_pipe-over.gif");
		hyp_cctv_over = newImage("images/hyp_cctv-over.gif");
		hyp_hpwj_over = newImage("images/hyp_hpwj-over.gif");
		hyp_about_over = newImage("images/hyp_about-over.gif");
		hyp_contact_over = newImage("images/hyp_contact-over.gif");
		hyp_home_over = newImage("images/hyp_home-over.gif");
		email_over = newImage("images/email-over.gif");
		preloadFlag = true;
	}
}

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/map/browse.cgi?client=public&X=407000.971570274&Y=277000.452414344&width=500&height=300&gride=407444.971570274&gridn=276914.452414344&srec=0&coordsys=gb&db=GB&addr1=&addr2=&addr3=&pc=&advanced=&local=&localinfosel=&kw=&inmap=&table=&ovtype=&keepicon=true&zm=1&scale=25000",
  		 "", "top=30, left=5, width=790, height=450, scrollbars, resizable");
}
function closepopup()
{
  if (tjpopwindow != null) tjpopwindow.close();
  if (mappopwindow != null) mappopwindow.close();
}