function centerwin(mywin)
{
	//works in firefox
	var sw = window.screen.width;
	var sh = window.screen.height;
	var w = document.getElementsByTagName('BODY')[0].clientWidth;
	var h = document.getElementsByTagName('BODY')[0].clientHeight;

	var x = (sw / 2) - (w / 2);
	var y = (sh / 2) - (h / 2);

	mywin.moveTo(x, y);
}

function maxwin(mywin)
{
	/*
	var sw = screen.Width;
	var sh = screen.Height;
	var w = mywin.document.documentElement.clientWidth;
	var h = mywin.document.documentElement.clientHeight;
	var x = sw - 30;
	var y = sh - 50;

	mywin.moveTo(10, 10);
	mywin.resizeTo(x, y);
	*/

	//works in firefox

	window.moveTo(0,0);
	window.resizeTo(screen.width,screen.height);
}

function getcookie(name)
{
	var dc = document.cookie;

	var a = dc.split("=");
	if (a[0] == "" || a[1] == "" || a[0] == null || a[1] == null)
	{
		return null;
	}
	else
	{
		var b = a[1].split(";");
		return b[0];
	}
}

function objectenum(obj)
{
	for (i in obj)
	{
	    document.write(i + " = " + obj[i]+ "<br>");
	}
}

function setcookie(name, value)
{
	document.cookie = name + "=" + value + "; expires=Sun, 14-Mar-2010 00:00:00 GMT";
}

function d_news(id)
{
	if (confirm("Are you SURE you want to delete this news post? It'll be forever lost."))
	{
		document.forms.delnews.id.value = id;
		document.forms.delnews.submit();
	}
}

function e_news(id)
{
	document.forms.addnews.id.value = id;
	document.forms.addnews.action.value = "E";
	document.forms.addnews.submit();
}
