
var iSortCol1, iSortCol2

function editPage(page, params, winspec, winname)
	{
	var fn = "edits.php";
	
	if (arguments.length < 3) winspec = "width=400,height=250,resizable,scrollbars";
	if (arguments.length < 4) winname = "edit";
	
	
	fn += "?page=" + page;
	fn += "&key=" + document.details.key.value;
	fn += "&" + params;
	window.open(fn, winname, winspec);
	}


function GetPopup(url,opts)
	{
	if (arguments.length > 1)
		{
		window.open(url,"popup",opts)
		}
	else
		{
		window.open(url,"popup")
		}
	}

function UserInfo(id)
	{
	editPage("userinfo.php", "id=" + id)
	}

function UserSignon(id)
	{
	editPage("signon.php", "id=" + id)
	}

var dpEnable = false;

function DPDisable() 
	{
	dpEnable = false; 
	}

if(navigator.appName != "Microsoft Internet Explorer") {	document.captureEvents(Event.KEYPRESS); }
document.onkeypress = EventCheckIE

function DPEnable() 
	{
	if(document.details.keytarget) 
		{
		dpEnable = true;
		document.details.keytarget.onfocus = DPDisable;
		}
	}

if(navigator.appName != "Microsoft Internet Explorer") {	document.captureEvents(Event.KEYPRESS); }
document.onkeypress = EventCheckIE
function EventCheckIE(e) 
	{
	if(navigator.appName == "Microsoft Internet Explorer") 
		{
		if(window.event.keyCode == 13) 
			{
			DPSubmitForm(); 
			}
		}
	else 
		{
		if(e.which == 13) { DPSubmitForm(); }
		}
		
	function DPSubmitForm() 
		{
		if(document.details.keytarget) 
			{
			if(dpEnable) 
				{
				if((document.getElementById) && (window.event)) window.event.keyCode = 0;
				document.details.keytarget.onmouseup();
				}
			}
		}
	}

function spaceforzero(n)
	{
	if (n == 0) return "";
	return n;
	}

function doTimeout()
	{
	document.details.action = "edits/timeout.php";
	document.details.submit();
	}

function popup(n)
	{
	if (bName == "Netscape") 
		{
		document.layers [n].visibility = "show";
		}
	else 
		{
		document.all[n].style.visibility = "visible";
		}
	}

function popdown(n)
	{
	if (bName == "Netscape") 
		{
		document.layers [n].visibility = "hide";
		}
	else 
		{
		document.all [n].style.visibility = "hidden";
		}
	}

function refresh()
	{
	document.details.act.value = "MENU";
	document.details.submit();
	}


function sortArray(obj,col1,col2)
	{
	if (arguments.length > 2)
		{
		iSortCol1 = col1;
		iSortCol2 = col2;
		obj.sort(sort2)
		}
	else if (arguments.length == 2)
		{
		iSortCol1 = col1;
		obj.sort(sort1)
		}
	}

function sort1(a,b)
	{
	if (a[0] == "id") return -1;
	if (b[0] == "id") return 1;
	if (a[iSortCol1] < b[iSortCol1]) return -1;
	if (a[iSortCol1] > b[iSortCol1]) return 1;
	return 0;
	}

function sort2(a,b)
	{
	if (a[0] == "id") return -1;
	if (b[0] == "id") return 1;
	if (a[iSortCol1] < b[iSortCol1]) return -1;
	if (a[iSortCol1] > b[iSortCol1]) return 1;
	if (a[iSortCol2] < b[iSortCol2]) return -1;
	if (a[iSortCol2] > b[iSortCol2]) return 1;


	return 0;
	}

