// misc functions
function noSubmit()
{
	return !(window.event && window.event.keyCode == 13);
}
function getArgs()
{
	var args = new Object();
	var query = location.search.substring(1);
	var pairs = query.split("&");
	for(var i = 0; i < pairs.length; i++){
		var nIndex = pairs[i].indexOf('=');
		if(nIndex == -1)
			continue;
		var name = pairs[i].substring(0,nIndex);
		var val = pairs[i].substring(nIndex + 1);
		args[name] = unescape(val);
	}

	return args;
}
function openWindow(url, winName, top, left, width, height, scrll)
{
	this.width = arguments.length > 4 ? width : 800;
	this.height = arguments.length > 5 ? height : 340;
	this.scrll = arguments.length > 6 ? scrll : "yes";
	
	return window.open(url,winName,"width="+this.width+",height="+this.height+",location=no,toolbar=no,menubar=no,titlebar=yes,scrollbars="+this.scrll+",resizable=yes,top="+top+",left="+left);
}
function doLink(url,w,h, bScroll)
{
	if(!isOkay)
	{
		window.location.href = url;
		return;
	}
	
	if(childWin && !childWin.closed)
	{
		if(level2)
		{
			childWin.location = url;
			childWin.focus();
			return;
		}
		else
			childWin.close();
	}
	
	var left = screen.availWidth > 800 ? 50 : 0;
	var top = screen.availHeight > 480 ? 50 : 0;
	
	var width = arguments.length > 1 ? w : 420;
	var height = arguments.length > 2 ? h : 350;
	
	var scrll = arguments.length > 3 ? "yes" : "no";
	
	childWin = openWindow(url, "ChildWindow", top, left, width, height, scrll);
}
function killChild()
{
	try
	{
		if(childWin && !childWin.closed)
			childWin.close();
	}
	catch(ex)
	{
	}
}
var childWin = null;
window.onfocus = killChild;
