var newWin = null;

function closeWin()
{
	if (newWin != null)
		if(!newWin.closed)
			newWin.close();
}

function MM_openBrWindow(theURL,winName,features) 
{ //v2.0
	var table = features.split(',');
	if (table[2])
	{
		var table_w =table[1].split('width=');
		var table_h =table[2].split('height=');
	}
	else
	{
		var table_w =table[0].split('width=');
		var table_h =table[1].split('height=');
	}
	var top=(screen.height-table_h[1])/2;
	var left=(screen.width-table_w[1])/2;
	
 	closeWin();
  	newWin = window.open(theURL,winName,features+",top="+top+",left="+left);
	newWin.focus();
}