function showOpenTimes(content)
{
        if (content=="opentimes")
        {
	    document.getElementById("helpimagediv").style.visibility="hidden";
	    document.getElementById("helpimagediv").style.display="none";
	    document.getElementById("helpcontactdiv").style.visibility="visible";
	    document.getElementById("helpcontactdiv").style.display="block";
        }
        else
        {
	    document.getElementById("helpcontactdiv").style.visibility="hidden";
	    document.getElementById("helpcontactdiv").style.display="none";
	    document.getElementById("helpimagediv").style.visibility="visible";
	    document.getElementById("helpimagediv").style.display="block";
        }
}

function openSignup(close)
{
	winWidth = 800;
	winHeight = 750;
	xPos = (screen.width - winWidth) / 2;
	yPos = 100;
	signUp = window.open('http://www.carreg.co.uk/join','signup_window','toolbar=0,menubar=0,scrollbars=yes,scrolling=auto,status=0,resizable=0,top=' + yPos + ',left=' + xPos + ',width=' + winWidth + ',height=' + winHeight);
	signUp.blur();
	if(close == 'true')
	{
		signUp.window.close();
	}
	window.focus();
}

ns = ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) >= 3));
ie = ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4));

function openWindow(url)
{
	if ((ns))window.open(url,"displayWindow","toolbar=no,width=100,height=100,left=0,top=0,directories=no,status=no,scrollbars=no,resizable=yes,menubar=no");
	if ((ie))window.open(url,"displayWindow","type=fullWindow,toolbar=no,width=100,height=100,left=0,top=0,directories=no,status=no,scrollbars=no,resizable=yes");
}

function open_window(url, width, height, x_pos, y_pos)
{
	if ((ns))window.open(url,"displayWindow","toolbar=no,width=" + width + ",height=" + height + ",left=" + x_pos + ",top=" + y_pos + ",directories=no,status=no,scrollbars=yes,resizable=yes,menubar=no");
	if ((ie))window.open(url,"displayWindow","type=fullWindow,toolbar=no,width=" + width + ",height=" + height + ",left=" + x_pos + ",top=" + y_pos + ",directories=no,status=no,scrollbars=yes,resizable=yes");
}

function openThawte(url)
{
dn="www.carreg.co.uk";
lang="en";
sealid=0;
splash_url="https://sealinfo.thawte.com";
seal_url="https://seal.thawte.com";
var gmt_offset = (new Date()).
getTimezoneOffset();
u1 = splash_url+"/thawtesplash?form_file=fdf/thawtesplash.fdf&dn="+dn+"&lang="+lang;

u2 = seal_url+"/getthawteseal?at=0&sealid="+sealid+"&dn="+dn+"&lang="+lang+"&gmtoff="+gmt_offset;
url=u1;

	if ((ns))window.open(url,"displayWindow","toolbar=no,width=500,height=625,left=0,top=0,directories=no,status=no,scrollbars=no,resizable=no,menubar=no");
	if ((ie))window.open(url,"displayWindow","type=fullWindow,toolbar=no,width=500,height=625,left=0,top=0,directories=no,status=no,scrollbars=no,resizable=no");
}

function sendQuery(loc)
{
	if(loc == 'home')
	{
		term = document.getElementById("query_home").value.toUpperCase();
	}
	else
	{
		term = document.getElementById("query").value.toUpperCase();
	}
	term = term.replace(' ', '_');
	term = term.replace('+', '_');
	loc = 'http://www.carreg.co.uk/number_plates/search/' + term
	document.location = loc;
}

function addFavNum(url, title)
{
	if(document.all)
	{
		window.external.AddFavorite(url, title)
	}
}

function favorites(url, title)
{
	if(url == '' || title == '')
	{
		url = 'http://www.carreg.co.uk';
		title = 'Personalised Number Plates';
	}
	if(document.all)
	{
		window.external.AddFavorite(url, title)
	}
}

function buypopup(url)
{
	var String;
	var leftmid; 
    
	leftmid=parseInt((screen.width-776)/2);
	hgt=540;
	if (screen.height>600)
	{
     		hgt=640;
	}

	String =  "toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=1,copyhistory=0,";
	String += ",width=";
	String += '776';
	String += ",height=";
	String += hgt;
	String += ",top=";
	String += '10';
	String += ",left=";
	String += leftmid;
	WinPicOrder=window.open(url,0,String);
}

function showhide(layer_ref)
{
	if(document.all)
	{
		if(eval( "document.all." + layer_ref + ".style.display") == 'none')
		{
			state = 'block';
		}
		else
		{
			state = 'none';
		}
		eval( "document.all." + layer_ref + ".style.display = state");
	}
	if(document.layers)
	{
		if(document.layers[layer_ref].display == 'none')
		{
			state = 'block';
		}
		else
		{
			state = 'none';
		}
		document.layers[layer_ref].display = state; 
	}
	if(document.getElementById && !document.all)
	{ 
		hza = document.getElementById(layer_ref);
		if(hza.style.display == 'none')
		{
			state = 'block';
		}
		else
		{
			state = 'none';
		}
		hza.style.display = state;
	}
}
