function lib_bwcheck() {
	this.ver=navigator.appVersion;
	this.agent=navigator.userAgent;
	this.opera=navigator.userAgent.indexOf("Opera")>-1 ? 1 : 0;
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && !this.opera) ? 1 : 0;
	this.ie6=(this.ver.indexOf("MSIE 6")>-1 && !this.opera) ? 1 : 0;
	this.ie7=(this.ver.indexOf("MSIE 7")>-1 && !this.opera) ? 1 : 0;
	this.ie=this.ie5||this.ie6||this.ie7;
	this.mac=this.agent.indexOf("Mac")>-1;
	return this;
}

function open_center_window(url, name, width, height, param) {
    var bw=lib_bwcheck();
	var x=0; var y=0; var w=0; var h=0;
	if (bw.ie) 	{
		x = 0;
		y = 0;
		w = screen.width;
		h = screen.height;
	} else 	{
		x = window.screenX;
		y = window.screenY;
		w = window.outerWidth;
		h = window.outerHeight;
	}
	var cx = x;
	if (w > width) cx += Math.round((w - width) / 2);
	var cy = y;
	if (h > height) cy += Math.round((h - height) / 2);

	return open(url, name,'left=' + cx + 'px,top=' + cy + 'px,width=' + width + 'px,height=' + height +'px'+ param);
}


