
var isDOM = (document.getElementById  ? true : false); 
var isIE4 = ((document.all && !isDOM) ? true : false);
var isNS4 = (document.layers          ? true : false);
var isDyn = (isDOM || isIE4 || isNS4);

var w = screen.width;
var h = screen.height;

function getRef(id)
{
	if (isDOM) return document.getElementById(id);
	if (isIE4) return document.all[id];
	if (isNS4) return document.layers[id];
}

function getSty(id) 	{ return (isNS4 ? getRef(id) : getRef(id).style); } 
function toggleDiv (id) { s = getSty(id); s.display = (s.display == 'none') ? 'block' : 'none'; }
function showDiv (id)	{ s = getSty(id); s.display = 'block'; }
function hideDiv (id)	{ s = getSty(id); s.display = 'none'; }

function user_confirm (prompt_text, url) { if (confirm(prompt_text)) self.location = url; }
function openWin(windowURL,windowName,windowFeatures) { return window.open(windowURL,windowName,windowFeatures); }

function PopWin (url,width,height,name)
{
	var left = (w - width) / 2;
	var top = (h - height) / 2;
	options = "left="+left+",top="+top+",width="+width+",height="+height;
	options += ",toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=0,resizable=0,fullscreen=no"
	openWin (url, name, options );
}

function PopWinScroll (url,width,height,name)
{
	if (height <= 0) 	{ var top = 10; var height = h-80; }
	else 				{ var top = (h - height) / 2; }
	if (width <= 0) 	{ var left = 10; var width = w-20; }
	else 				{ var left = (w - width) / 2; }
	options = "left="+left+",top="+top+",width="+width+",height="+height;
	options +=",toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=1,resizable=0,fullscreen=no"
	openWin (url, name, options );
}

function askSubmit (frm, msg)
{
	if (confirm(msg))
	{
		document.forms[frm].submit();
	}
}

function askRedirect (url, msg)
{
	if (confirm(msg)) { self.location.href = url; }
}

