////////////////////////////////////////////////////////////////////////////////
//
//
//  Windows
//
//
function popUp( url, name, features ) {
	features += ",resizable=1,directories=0,menubar=0,status=0,toolbar=0";
	if ( popUpWindow && !popUpWindow.closed ) popUpWindow.close();
	var popUpWindow = window.open( "",name,features );
	popUpWindow.location.href = url;
	popUpWindow.focus();
	if ( popUpWindow.opener == null ) popUpWindow.opener = self;
}

function popUpPrint( url, name, features ) {
	features += ",resizable=1,directories=0,menubar=1,status=0,toolbar=0";
	if ( popUpWindow && !popUpWindow.closed ) popUpWindow.close();
	var popUpWindow = window.open( "",name,features );
	popUpWindow.location.href = url;
	popUpWindow.focus();
	if ( popUpWindow.opener == null ) popUpWindow.opener = self;
}

function closePopup( popUpWindow ) {
	if ( popUpWindow.opener && !popUpWindow.opener.closed ) popUpWindow.opener.focus();
	popUpWindow.close();
}


////////////////////////////////////////////////////////////////////////////////
//
//
//  Error Handling
//
//
function handleError( message, URL, lineNumber ) {
	if ( errorWindow && !errorWindow.closed ) errorWindow.close();
	var errorWindow = window.open("","errors","width=500,height=300,scrollbars=1,resizable=1,directories=0,menubar=0,status=0,toolbar=0");
	if ( errorWindow.opener == null ) errorWindow.opener = self;
	var windowHTML = "";
	windowHTML    += "<html><head><title>JavaScript Error</title></head>";
	windowHTML    += "<body bgcolor=\"white\" text=\"black\">";
	windowHTML    += "<h1>JavaScript Error [&nbsp;<a href=\"javascript:self.close();\">X</a>&nbsp;]</h1>";
	windowHTML    += "<p><font face=\"verdana\" size=\"2\">";
	windowHTML    += "Error: " + message    + "<br>";
	windowHTML    += "URL: "   + URL        + "<br>";
	windowHTML    += "Line: "  + lineNumber + "<br>";
	windowHTML    += "</font></p>";
	windowHTML    += "</body></html>\n";
	errorWindow.document.write( windowHTML );
	errorWindow.document.close();
	errorWindow.focus();
	return true;
}
window.onerror = handleError;


////////////////////////////////////////////////////////////////////////////////
//
//
//  Status Bar
//
//
function setStatus( text ) {
	window.status = text;
	return true;
}

function clearStatus() {
	window.status = "";
	return true;
}



