	var dhxWins;
	function init() {
		var ua = navigator.userAgent.toLowerCase();
		dhxWins=new dhtmlXWindows();
		dhxWins.setImagePath("Scripts/dhtmlxWindows/codebase/imgs/");
		dhxWins.enableAutoViewport(false);
		if (ua.indexOf("msie")==-1) {
			document.getElementById('windowCont').height = truebody_().scrollHeight;
			dhxWins.attachViewportTo("windowCont");
		}
		else {
			dhxWins.setViewport(0, 0, truebody_().scrollWidth, truebody_().scrollHeight);
		}
	}
	function showwindow(url,width,height) {
		hidetrail();
		if( width == 0 ) width = 900;
		if( height == 0 ) height = 800;
		if (dhxWins.isWindow("w1")) dhxWins.window("w1").close();
		var w1=dhxWins.createWindow("w1",1,1,width,height);
		w1.setText('');
		w1.denyResize();
		w1.setModal(true);
//		dhxWins.window("w1").center();
		x = screen.availWidth / 2 - width / 2;
		if (truebody_().scrollTop + height > truebody_().scrollHeight) y = truebody_().scrollHeight - height - 60;
		else y = truebody_().scrollTop;
		dhxWins.window("w1").setPosition(x,y);
		dhxWins.window("w1").bringToTop();
		dhxWins.window("w1").attachURL(url);
	}
	function truebody_(){
		var ua = navigator.userAgent.toLowerCase();
		if (ua.indexOf("safari") != -1) return document.body;
		return document.documentElement;
	}
