var win = new Object();

function newWindow(url,name,width,height,scroll,x,y,status,resize)
{
	try
	{
		
	
		   if (new String(url) == 'undefined' || !url.length) return;
		
		   if (new String(name) == 'undefined' || !name.length)
		   {
			  var dobj = new Date();
			  name = 'win' + dobj.getSeconds();
		   }
		
		   //if (new String(width) == 'undefined' || width <= 0) width = 525;
		   //if (new String(height) == 'undefined' || height <= 0) height = 600;
		
		   if (new String(x) == 'undefined' || x < 0)
		   {
			  xMax = 800;
			  if (document.all) xMax = screen.width;
			  else if (document.layers) xMax = window.outerWidth;
			  x = (xMax - width ) / 2;
		   }
		   if (new String(y) == 'undefined' || y < 0)
		   {
			  yMax = 600;
			  if (document.all) yMax = screen.height;
			  else if (document.layers) yMax = window.outerHeight;
			  y = (yMax - height ) / 2;
		   }
		
		   if (new String(scroll) == 'undefined') scroll = 1;
		
		   if (new String(status) == 'undefined') status = 0;
		   
		   if (new String(resize) == 'undefined') resize = 0;
		   
		   var attr = 'resizable=' + resize;
		   if (width) attr += ',width='  + width;
		   if (height) attr += ',height=' + height;
		   if (width) attr += ',screenX=' + x;
		   if (height) attr += ',screenY=' + y;
		   if (width) attr += ',top=' + y;
		   if (height) attr += ',left=' + x;
		   attr += ',scrollbars=' + scroll;
		   attr += ',status=' + status;
		   attr += ',toolbar=0';
		   attr += ',location=0';
		   attr += ',menubar=0';
		   attr += ',directories=0';
		   //window.open(url,name,attr,true);   
		   win[name] = window.open(url,name,attr,true);
		   win[name].focus();
		   
	}
	catch (e)
	{
		alert("An exception occurred in newWindow. Error name: " + e.name + ". Error message: " + e.message);
	}
}