/*
	widebight window methods
	(c) 2000- Q-Affairs
	www.q-affairs.de
*/

function wbWindowOpen(pageURL, windowName, windowWidth, windowHeight, posX, posY, useScrollbars, canResize) {
	var c = (document.all&&navigator.userAgent.indexOf("Win")!=-1)?1:0
	var v = navigator.appVersion.substring(navigator.appVersion.indexOf("MSIE ")+5,navigator.appVersion.indexOf("MSIE ")+8)
	
	var screenWidth = window.screen.width;
	var screenHeight = window.screen.height
	var windowWidth = windowWidth;
	var windowHeight = windowHeight;
	
	var posX = posX || Math.ceil((screenWidth - windowWidth) / 2);
	var posY = posY || Math.ceil((screenHeight - windowHeight) / 2);
	var features = ",width=" + windowWidth + ",height=" + windowHeight + ",status=yes" + ((useScrollbars) ? ",scrollbars=yes" : "") + ((canResize) ? ",resizable=yes" : "");

	var windowHandle = window.open(pageURL, windowName, features,true)
	
	windowHandle.moveTo(posX,posY)
	
	windowHandle.focus()
	windowHandle.setURL = function(u) { 
		if (this && !this.closed) { 
			if (this.frames.main) {
				this.frames.main.location.href=u; 
			} else { 
				this.location.href=u;
			} 
		}
	}
	windowHandle.closeIT = function() {
		if (this && !this.closed) this.close() 
	}
	
	return windowHandle
}

