function ClassWindow() {
	this.m_oObjWindow = null;
}

function window_init() {
	
}

function window_close(a_sObjWindow) {
	if (oObjWindow = document.getElementById(a_sObjWindow)) {
		oObjWindow.style.display = 'none';
	
		if (oObjFader = document.getElementById('content_fader')) {
			oObjFader.style.display = 'none';
		}
	}
}

function window_open(a_sObjWindow, a_iID) {
//function window_window_open(a_sObjWindow, a_sURL) {
	
	if (oObjFader = document.getElementById('content_fader')) {
		
		if (window.innerHeight != undefined && window.scrollMaxY  != undefined) {// Firefox
			yWithScroll = window.innerHeight + window.scrollMaxY;
			xWithScroll = window.innerWidth + window.scrollMaxX;
		} else if (window.innerHeight && document.body.scrollHeight > document.body.offsetHeight) {
			yWithScroll = (window.innerHeight >document.body.scrollHeight)?window.innerHeight:document.body.scrollHeight;
			xWithScroll = (window.innerWidth >document.body.scrollWidth)?window.innerWidth:document.body.scrollWidth;
		} else if (document.body.scrollHeight > document.body.offsetHeight) { // all but Explorer Mac
			yWithScroll = document.body.scrollHeight;
			xWithScroll = document.body.scrollWidth;
		} else { // works in Explorer 6 Strict, Mozilla (not FF) and Safari
			yWithScroll = document.body.offsetHeight;
			xWithScroll = document.body.offsetWidth;
	  	}

		oObjFader.style.height = yWithScroll+'px';
		oObjFader.style.width = xWithScroll+'px';
		
		oObjFader.style.display = 'block';
	}
	if (oObjWindow = document.getElementById(a_sObjWindow)) {
		this.m_oObjWindow = oObjWindow;
		
		oObjWindow.style.display = 'block';
		oObjWindow.style.position = 'absolute';
		
		// Center the window object.
		OBJ_center_horizontal(oObjWindow);
		OBJ_center_vertical(oObjWindow);
		
		if (a_iID) {
			oClassSlider.slider_slide(a_iID);
		}
//		AJAX_getXMLmanual(a_sURL, 'window_window_content_content', 'replacechildren');
	}
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

ClassWindow.prototype.window_init			= window_init;
ClassWindow.prototype.window_close			= window_close;
ClassWindow.prototype.window_open			= window_open;

oClassWindow = new ClassWindow();

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

window.onresize = function() {
	if (oObjFader = document.getElementById('content_fader')) {
		
		if (oObjFader.style.display=='block') {
			if (window.innerHeight != undefined && window.scrollMaxY  != undefined) {// Firefox
				yWithScroll = window.innerHeight + window.scrollMaxY;
				xWithScroll = window.innerWidth + window.scrollMaxX;
			} else if (window.innerHeight && document.body.scrollHeight > document.body.offsetHeight) {
				yWithScroll = (window.innerHeight >document.body.scrollHeight)?window.innerHeight:document.body.scrollHeight;
				xWithScroll = (window.innerWidth >document.body.scrollWidth)?window.innerWidth:document.body.scrollWidth;
			} else if (document.body.scrollHeight > document.body.offsetHeight) { // all but Explorer Mac
				yWithScroll = document.body.scrollHeight;
				xWithScroll = document.body.scrollWidth;
			} else { // works in Explorer 6 Strict, Mozilla (not FF) and Safari
				yWithScroll = document.body.offsetHeight;
				xWithScroll = document.body.offsetWidth;
		  	}
	
			oObjFader.style.height = yWithScroll+'px';
			oObjFader.style.width = xWithScroll+'px';
		}
		
		// Center the window object.
		if (oClassWindow.m_oObjWindow) {
			OBJ_center_horizontal(oClassWindow.m_oObjWindow);
			OBJ_center_vertical(oClassWindow.m_oObjWindow);
		}
	}
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
