//Popup window for Uploads
function OpenWin(url,windowName, width, height, top) {
agent = navigator.userAgent;
params  = "";
params += "toolbar=0,";
params += "location=0,";
params += "directories=0,";
params += "status=0,";
params += "menubar=0,";
params += "scrollbars=1,";
params += "resizable=0,";
params += "width="+width+",";
params += "height="+height+",";
params += openCentered(width, height, top);
/*
params += "screenX=0,";
params += "screenY=0,";
params += "top=0,";
params += "left=0";  
   */
win = window.open(url, windowName , params);
win.focus();
if (agent.indexOf("Mozilla/2") != -1 && agent.indexOf("Win") == -1) {
	win = window.open(url, windowName , params);
}
if (!win.opener) {
	win.opener = window;
}
}

function OpenNewWin(url,windowName) {
OpenWin(url,windowName, 525, 225, 250);
}

function ExpandCollapse(objimg, objdiv)
{
	if (document.getElementById(objdiv).style.display =="none")
	{
		objimg.src = "/images/buttons/minus_screened_round.gif"
		document.getElementById(objdiv).style.display = "";
		objimg.title = "Click to collapse";
	}
	else
	{
		objimg.src = "/images/buttons/plus_screened_round.gif"
		document.getElementById(objdiv).style.display = "none";
		objimg.title = "Click to expand";
	}
	
}
function Status( windowstatus )
{
	window.status = windowstatus;
	return true;
}
function openCentered (width, height, top) {
  if (document.all) {
    var x = window.screenLeft;
    var y = window.screenTop;
    var w = window.document.body.offsetWidth;
    var h = window.document.body.offsetHeight;
  }
  else {
    var x = window.screenX;
    var y = window.screenY;
    var w = window.outerWidth;
    var h = window.outerHeight;
  }
  var cx = x + Math.round((w - width) / 2);
  //var cy = y + Math.round((h - height) / 2);
 
  
  return ('left=' + cx + ',top=' + top);

}
