<!-- // JavaScript Document

var d = document;

//GET THE SERVER NAME TO USE ABSOLUTE URLS WHERE NEEDED
function serverName()
{
	var server; var url = location.href;
	if(url.indexOf("localhost") != -1)	{ server = ".."; }
	else	{ if(url.indexOf("_office") != -1) { server = "http://www.klstudios.ie/_office"; }  else { server = "http://www.klstudios.ie"; } } 

	return server;
}

//DISPLAY A HIDDEN ID TAG AND IF OPPOSITE IS SET, HIDE OPPOSITE THE DIVID
function showDiv(divID,type,opposite)
{
	var x = d.getElementById(divID).style;
	if(type == "display")	{	x.display = "block"; if(opposite)		{	d.getElementById(opposite).style.display = "none"; } }
	else						{	x.visibility = "visible"; if(opposite)	{  d.getElementById(opposite).style.visibility = "hidden"; } }
}

function hideDiv(divID,type,opposite)
{
	var x = d.getElementById(divID).style;
	if(type == "display")	{	x.display = "none"; if(opposite) 		{	d.getElementById(opposite).style.display = "block"; } }
	else						{	x.visibility = "hidden"; if(opposite)	{  d.getElementById(opposite).style.visibility = "visible"; } }
}

//GET THE SELECTED INDEX VALUE OF A SELECT BOX AND RETURN IT TO THE FUNCTION CALLING IT
function getSelectedIndex(cellID)
{
	var selectedItem = d.getElementById(cellID).selectedIndex;
	var selectedvalue = d.getElementById(cellID).options[selectedItem].value;
	return selectedvalue;
}

function showHelp(type)
{
	var i = d.getElementById("legendClick");
	if(type == "open")	{ i.href = "javascript:void(showHelp('close'))"; i.title = "Close the Help Window"; d.getElementById("legendData").style.display = "block"; }
	else						{ i.href = "javascript:void(showHelp('open'))"; i.title = "Open a the Help Window with explanations of the icons shown"; d.getElementById("legendData").style.display = "none"; }
}

//CHANGE A PAGE AUTOMATICALLY FROM A SELECT BOX TO UPDATE A VIEW, ALSO ADDING ANY PAGER AND SEARCH CRITERA TO THE URL
function changeThisPage(selectBox)
{
	if(selectBox)	{ var url = getSelectedIndex(selectBox); }
	else			 	 	{ var url = getSelectedIndex("changePage"); }
	window.location = url;
}

//ADD ANY PAGER OR SEARCH CRITERA TO THE URL IF NECCASSERY
function gotoPage(filename,first,searching,order)
{
	var url = filename;
	if(first != 0) 
		{	if(first>0) 			{	if(url.indexOf("?") == -1)	{ url = url + "?"; } else { url = url + "&"; } url = url + "first=" + first; }
			if(searching != 0)	{	if(url.indexOf("?") == -1)	{ url = url + "?"; } else { url = url + "&"; } url = url + "search=" + searching; }
			if(order != 0)		{	if(url.indexOf("?") == -1)	{ url = url + "?"; } else { url = url + "&"; } url = url + "order=" + order; }
			window.location = url;
		}
}

function blowUp(id)
{
	var imageURL = serverName()+"/home/popup.php?id="+id;
	window.open(imageURL,"","width=850,height=650,location=0,scrolbars=0");
}
-->