if (navigator.userAgent.indexOf("Mozilla/4.0") != -1) {
	version = 4;
} else if (navigator.userAgent.indexOf("Mozilla/3.0") != -1) {
	version = 3;
} else if (navigator.userAgent.indexOf("Mozilla/2.0") != -1) {
	version = 2;
} else if (navigator.userAgent.indexOf("MSIE") != -1) {
	version = 1;
} else {
	version = 0;
}

function BrowserCheck() {
	var b = navigator.appName
	if (b=="Netscape") this.b = "ns"
	else if (b=="Microsoft Internet Explorer") this.b = "ie"
	else this.b = b
	this.version = navigator.appVersion
	this.v = parseInt(this.version)
	this.ns = (this.b=="ns" && this.v>=4)
	this.ns4 = (this.b=="ns" && this.v==4)
	this.ns5 = (this.b=="ns" && this.v==5)
	this.ns6 = (this.b=="ns" && this.v==6)
	this.ie = (this.b=="ie" && this.v>=4)
	this.ie4 = (this.version.indexOf('MSIE 4')>0)
	this.ie5 = (this.version.indexOf('MSIE 5')>0)
	this.min = (this.ns||this.ie)
}
is = new BrowserCheck()

var zoomwindow;

function deplace(window,width,height) {
	var scr_x = screen.width;
	var scr_y = screen.height;
	if (is.v >= 4) {
		if (is.ns) {
			window.moveTo((scr_x/2)-(width/2), (scr_y/2)-(height/2));
		} else {
			window.moveTo(parent.window.screenLeft+300, parent.window.screenTop+50);
		}
	}
}
	
var movePopup = true;
var scrollPopup = 1;

function popup(url,width,height) {
	movePopup = true;
	scrollPopup = 1;
	if (popup.arguments.length >= 4) {
		if (popup.arguments[3]) {
			movePopup = true;
		} else {
			movePopup = false;
		}
		if (popup.arguments[4] == 0 || popup.arguments[4] == 1) {
			scrollPopup = popup.arguments[4];
		}
	}
	if (url != "") {
		var features;
		features = "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=" + scrollPopup + ",resizable=0,width=" + width + ",height=" + height + "'";
		if (zoomwindow != null) {
			if (!zoomwindow.closed)
				zoomwindow.close();
		}
		zoomwindow = window.open(url,"ZOOMWINDOW",features);
		if (version == 3 || version == 4) {
			zoomwindow.focus();
		}
		if (movePopup) deplace(zoomwindow,width,height);
	}
}