function window_open(pageToLoad,winName,width,height,center,menubar)
{

	var saw = screen.availWidth;
	var sah = screen.availHeight;
	var sw = screen.width;
	var sh = screen.height;


	var xposition = 0;
	var yposition = 0;
	var winwidth = 100;
	var winheight = 100;

	popupwin = null;
	if(width == 0)
	{
		winwidth = saw - 10;
	} else {
		winwidth = width;
	}
	if (height == 0)
	{
		winheight = sah - 40;
	} else {
		winheight = height;
	}
	if (center == 1 || center == true)
	{
	  xposition = (screen.width - winwidth) * 0.5;
	  if(height != 0) yposition = 50 ; 
	}
	
	args = "width=" + winwidth + "," 
	+ "height=" + winheight + "," 
	+ "location=0," 
	+ "menubar=" + menubar + ","
	+ "resizable=1,"
	+ "scrollbars=1,"
	+ "status=1," 
	+ "titlebar=0,"
	+ "toolbar=0,"
	+ "hotkeys=0,"
	// firefoxim
	+ "screenx=" + xposition + "," 
	+ "screeny=" + yposition + ","
	
	// msie
	+ "left=" + xposition + ","  
	+ "top=" + yposition;       
	
	if (pageToLoad != '')
	{
	  popupwin=window.open(pageToLoad,winName,args);
	} else {
	  popupwin = window.open("",winName,args );
	}
	
	if (popupwin != null)
	{
	  popupwin.name = winName;
	  if(popupwin.opener == null)
		{ 
	     popupwin.opener = self; 
	  }
	  popupwin.focus();
	}
}

