var Ww;
var Standw;

function tempWin(URL,ID,WID,HIT) {
var newx = window.screenX - WID;
var newy = window.screenY;
var params =  "screenX="+newx+",screenY="+newy+",toolbar=0,scrollbars=1,location=no,statusbar=0,menubar=0,resizable=1,width="+WID+",height="+HIT;
//var params =  "screenX=50,screenY=50,toolbar=0,scrollbars=1,location=no,statusbar=0,menubar=0,resizable=1,width="+WID+",height="+HIT;
Ww = window.open(URL,ID,params);
window.onunload = function()
	{
		Ww.close();
	}
}

function popWin(URL,ID,WID,HIT) {
var params =  "screenX=100,screenY=100,toolbar=0,scrollbars=1,location=no,statusbar=0,menubar=0,resizable=1,width="+WID+",height="+HIT;
var w;
w = window.open(URL,ID,params);
if (arguments.length > 4)
{
	w.focus();
}
return;
}

function setwintoclose()
{
	setInterval("window.close()", 1000);
}

function pleasestandby()
{
	var params =  "toolbar=no,scrollbars=no,location=no,statusbar=no,menubar=no,resizable=no,width=150,height=50";
	Standw = window.open("",'Standby',params);
	Standw.document.write('<body bgcolor="black"><center>Please Standby</center></body>');
	Standw.focus();
}

function pleasestandbyclose()
{
	if (Standw != null)
	{
		Standw.close();
	}
}

function force_frames(URL)
{
	if (top.frames.length == 0)
	{
		location.replace(URL);
	}
}

function topwin_update()
{
	frame_update('top','/cgi-bin/nav.cgi?top');
}

function history_update()
{
	frame_update('content','/cgi-bin/history.cgi');
	topwin_update();
}

function frame_update(FRM,URL)
{
	var str;
	// give the window time to open and cgi time to update database
	if (FRM == 'content')
	{
		str =  "top.content.location = "+"'"+URL+"'";
	}
	else if (FRM == 'top')
	{
		str =  "top.topbar.location = "+"'"+URL+"'";
	}

	setTimeout(str, 1000);
}

// instant message standard popup
function IMpopUp(URL) 
{
	var day = new Date();
	var id = day.getTime();

	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=450,height=180');");
}

// close message window and open reply window
function IMreply(URL) 
{
	window.close();
	IMpopUp(URL);
}


