/*
NEWWIN v2
*/
function newwin(FILE,NAME,WIDTH,HEIGHT,RESIZABLE,CENTER,ENABLEPOS,POSX,POSY,SCROLLBARS,STATUS,MENUBAR,TOOLBAR,LOCATION,PERSONALBAR)
{
	RESIZABLE = (RESIZABLE == "1") ? "yes" : "no";
	SCROLLBARS  = (SCROLLBARS == "1") ? "yes" : "no";
	STATUS = (STATUS == "1") ? "yes" : "no";
	MENUBAR = (MENUBAR == "1") ? "yes" : "no";
	TOOLBAR = (TOOLBAR == "1") ? "yes" : "no";
	LOCATION = (LOCATION == "1") ? "yes" : "no";
	PERSONALBAR = (PERSONALBAR == "1") ? "yes" : "no";

	if(CENTER == "1")
	{
		scr_width = screen.width;
		scr_height = screen.height;

		scr_width = scr_width - WIDTH;
		scr_height = scr_height - HEIGHT - 25;

		scr_width = scr_width/2;
		scr_height = scr_height/2;

		LEFT = scr_width;
		TOP = scr_height;
	}
	if(ENABLEPOS == "1")
	{
		LEFT = POSX;
		TOP = POSY;
	}

 options = '"';
 // width, height
 options += 'width=' + WIDTH + ',height=' + HEIGHT;
 // resizeable
 options += ',resizable=' + RESIZABLE;
 // window postion x,y (if enabled)
	if(CENTER == "1" || ENABLEPOS == "1")
	{
		options += ',left=' + LEFT + ',top=' + TOP + ',screenX=' + LEFT + ',screenY=' + TOP;
	}
	// scrollbars
	options += ',scrollbars=' + SCROLLBARS;
	// status
	options += ',status=' + STATUS;
	// menubar
	options += ',menubar=' + MENUBAR;
	// toolbar
	options += ',toolbar=' + TOOLBAR;
	// locations
	options += ',location=' + LOCATION;
	// personalbar
	options += ',personalbar=' + PERSONALBAR;
	options += '"';

	// open window
	newwin_open = window.open(FILE,NAME,eval(options));
	newwin_open.focus();
}
