// Redirection after time interval
redirTime = "8000";
redirURL = "home.asp";
function redirTimer() { self.setTimeout("self.location.href = redirURL;",redirTime); 
}

var ns4 = (document.layers); 
var ie4 = (document.all && !document.getElementById);
var ie5 = (document.all && document.getElementById);
var ns6 = (!document.all && document.getElementById);

function layer_attach(id)
{
	var obj;
	if(ns4) obj = document.layers[id];
	else if(ie4) obj = document.all[id];
	else if(ie5 || ns6) obj = document.getElementById(id);
	return obj;
}




//Central Popup Window
function GeldartPopup(url,theWidth,theHeight)
{
  var theTop=(screen.height/2)-(theHeight/2);
  var theLeft=(screen.width/2)-(theWidth/2);
  var features='height='+theHeight+',width='+theWidth+',top='+theTop+',left='+theLeft+",scrollbars=yes,resizable=yes";
  theWin=window.open(url,'theWin',features);
}




//Drop Down List
function goToAdmin(adminSection, adminAction, adminFormId)
{
	if(adminFormId[adminFormId.selectedIndex].value == "")
	{ alert("Please select an option from " + adminSection + "!"); adminFormId.focus(); }
	else
	{
		if(adminAction == "delete")
		{
			if(confirm("Are you sure you want to delete this " + adminSection + "?"))
			{ document.location.href = adminAction  + "_" + adminSection + ".asp?id=" + adminFormId[adminFormId.selectedIndex].value; }
		}
		else
		{ document.location.href = adminAction  + "_" + adminSection + ".asp?id=" + adminFormId[adminFormId.selectedIndex].value; }
	}
}

//Paging function
function pageText(id,inCrement)
{
	textArray[0] += inCrement;
	if(textArray[0] == textArray.length) { textArray[0] = 1; }
	else if(textArray[0] == 0) { textArray[0] = textArray.length - 1; }
	writeInDiv(textArray[textArray[0]], id);
}

function writeInDiv(text, id)
{
	if (document.getElementById)
	{ x = document.getElementById(id); x.innerHTML = ''; x.innerHTML = text; }
	else if (document.all)
	{ x = document.all[id]; x.innerHTML = text; }
	else if (document.layers)
	{ x = document.layers[id]; text2 = '<p>' + text + '</p>'; x.document.open(); x.document.write(text2); x.document.close(); }
}


