//Opens new Window

function openNewWindow(winName,location,height,width,top,left,toolbar,addressbar,directories,status,menubar,scrollbars,resizable,copyhistory)
{
	
	if (document.all || document.layers){	
	           w = screen.availWidth;	
	           h = screen.availHeight;	
	}
	else
	{
		w = 800;
		h = 600;
		
	}
	
	if (height=="" || height=="undefined")                        {height=600;}
	if (width=="" || width=="undefined")                             {width=800;}
	if (top=="" || top=="undefined")                                   {top=(h-height)/2;}
	if (left=="" || left=="undefined")                         {left=(w-width)/2;}
	if (toolbar=="" || toolbar=="undefined")                        {toolbar="no";}
	if (addressbar=="" || addressbar=="undefined")           {addressbar="no";}
	if (directories=="" || directories=="undefined")              {directories="no";}
	if (status=="" || status=="undefined")                          {status="no";}
	if (menubar=="" || menubar=="undefined")                             {menubar="no";}
	if (scrollbars=="" || scrollbars=="undefined")                {scrollbars="no";}
	if (resizable=="" || resizable=="undefined")                  {resizable="no";}
	if (copyhistory=="" || copyhistory=="undefined")             {copyhistory="no";}
	atts = "width=" + width + ",height=" + height + ",top=" + top + ",left=" + left;
	atts += ",toolbar=" + toolbar + ",location=" + addressbar + ",directories=" + directories;
	atts += ",status=" + status + ",menubar=" + menubar + ",scrollbars=" + scrollbars;
	atts += ",resizable=" + resizable + ",copyhistory=" + copyhistory;
	//alert(atts);
	NewWindow=window.open(location, winName, atts);
	NewWindow.focus();	
}

