popWindow=null;
function open_window(url,width,height,feat) {

	windowName="detail";
	agent=navigator.appVersion;
	version=parseInt(agent);
	
	//figure out the top/left of the screen
	//taking the menu bar into consideration
	if (version>=4) {
		leftCorner=screen.width/2 - width/2;
		topCorner=screen.height/2 - height/2;
	}else{
		leftCorner=20;
		topCorner=20;
	}
	features=",screenX="+leftCorner+",screenY="+topCorner+",left="+leftCorner+",top="+topCorner;
	features=features+",titlebar=1";
        if ( feat != null )
        {
        features=features+","+feat;
        }
	if (popWindow==null) {
		popWindow=open(url,windowName, "width="+width+",height="+height+ features);
		// for IE3, focus, closed, and opener doesn't work, so we have to tell
		// the window opened who's the opener
		if (version<3) 
			setTimeout("popWindow.mama=window",250);
	}else{
		if (version<3) {
			popWindow.close();
			popWindow=null;
			setTimeout("open_window('"+url+"',"+width+","+height+")", 250);
			setTimeout("popWindow.mama=window",500);
		}else if (!popWindow.closed){
			popWindow.close();
			popWindow=null;
			setTimeout("open_window('"+url+"',"+width+","+height+")", 250);
			
		}else{
			popWindow=null;
			popWindow=open(url,windowName, "width="+width+",height="+height+features);
		}
	}
}
 



