	function BrowserCheck() {

		var version = parseInt(navigator.appVersion);
		var browser = '';

		if (navigator.userAgent.indexOf("Win")!=-1) browser = "win";
		else if (navigator.userAgent.indexOf("Mac")!=-1) browser = "mac";

		if (navigator.appName == "Netscape") {
			if (version >= 4 && version < 5) browser += 'NS4';
			else if (version >= 5) browser += 'NS6';
		} else if (navigator.appName == "Microsoft Internet Explorer") {
			if (navigator.userAgent.indexOf("4.5") != -1) browser += 'IE45';
			else if (navigator.userAgent.indexOf("5.") != -1) browser += 'IE5';
			else if (navigator.userAgent.indexOf("6.") != -1) browser += 'IE6';
		}

		return browser;
	}

	var browser = BrowserCheck();


	function Popup(filename, windowWidth, windowHeight, ResizableOpt, ScrollbarsOpt, sName) {

		var windowProperties = "toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=" + ResizableOpt + ",scrollbars=" + ScrollbarsOpt;
		var screenWidth = 0;
		var screenHeight = 0;
		var browserT = BrowserCheck();
		
		if (sName == "") 
		{
			sName = "win";
		}
			
		//get the available window space
		if ((browserT == 'winIE45') || (browserT == 'winIE5') || (browserT == 'winIE6') || (browserT == 'macIE45') || (browserT == 'macIE5')) {
			screenWidth = Math.round(document.body.offsetWidth);
			screenHeight = Math.round(document.body.offsetHeight);
		} else if ((browserT == 'macNS4') || (browserT == 'winNS4') || (browserT == 'macNS6') || (browserT == 'winNS6')) {
			screenWidth = Math.round(window.innerWidth)
			screenHeight = Math.round(window.innerHeight);
		}

		//write the popup window size attributes
		windowProperties += ",width=" + windowWidth + ",height=" + windowHeight;
		windowProperties += ",left=" + ((screenWidth - windowWidth) / 2);
		windowProperties += ",top=" + ((screenHeight - windowHeight) / 2);
		boo = window.open(filename,sName,windowProperties);
		boo.focus();
	}