var Html = 
{
	base_url : false,
	
	showPause: function() {
		Html.showBlocker();
		windowsize = Html.getWindowsize();
		xpos = (windowsize[0] / 2) - (40 / 2);
		ypos = (windowsize[1] / 2) - (40 / 2) - 50 + document.documentElement.scrollTop;
		Html.createElement({
			tag: 'div',
			id: 'html_pause_container',
			parent: document.body,
			styles: {
				position: 'absolute',
				left: '0px',
				top: '0px',				
				zIndex: 1001,
				background: '#000000'
			},
			childs: {
				1: {
					tag: 'img',
					id: 'html_pause_image',
					attributes: {
						src: Html.base_url+'/plugins/Html/misc/pause.gif'
					},
					styles: {
						position: 'absolute',
						top: ypos+'px',
						left: xpos+'px',
						zIndex: 1002
					}
				}
			}
		});
	},
	
	hidePause: function() {
		Html.hideBlocker();
		document.body.removeChild(document.getElementById('html_pause_container'));
	},
	
	showBlocker: function() {
		//window.scrollTo(0, 0);
		//alert(document.documentElement.scrollTop);		
		windowsize = Html.getWindowsize();
		if (document.body.offsetHeight > windowsize[1]) { // content higher than window			
			bg_height = document.body.offsetHeight;
		} else {
			bg_height = windowsize[1];
		}
		Html.createElement({
			tag: 'div',
			id: 'html_page_blocker',
			parent: document.body,
			styles: {
				position: 'absolute',
				left: '0px',
				top: '0px',
				width: '100%',
				height: bg_height+'px',
				zIndex: 1000								
			}
		});
	},
	
	hideBlocker: function() {	
		if (blocker = document.getElementById('html_page_blocker')) {
			document.body.removeChild(blocker);
		}
	},
	
	getWindowsize: function() {
		if (self.innerWidth) { // mozilla
			size = new Array(self.innerWidth, self.innerHeight);
		} else if (document.documentElement && document.documentElement.clientWidth) { // IE 6
			size = new Array(document.documentElement.clientWidth, document.documentElement.clientHeight);
		} else if (document.body) { // other IE
			size = new Array(document.body.clientWidth, document.body.clientHeight);
		}
		return size;
	},
	
	createElement: function(data, parent) {
		var elem = document.createElement(data.tag);
		if (data.id) {
			eval("elem.setAttribute('id', '"+data.id+"')");
		}
		if (data.class_name) {
			eval("elem.className = '"+data.class_name+"'");
		}
		if (data.html) {
			eval("elem.innerHTML = '"+data.html+"'");
		}
		// attributes
		for (i in data.attributes) {
		    eval("elem.setAttribute('"+i+"', '"+data.attributes[i]+"')");
		}
		// styles
		for (i in data.styles) {
			if (i == 'float') {
				// 'float' must be treated special
				eval("elem.style.cssFloat = '"+data.styles[i]+"'"); // all browsers
				eval("elem.style.styleFloat = '"+data.styles[i]+"'"); // IE
			} else {
				eval("elem.style."+i+" = '"+data.styles[i]+"'");
			}
		}
		// childs
		for (i in data.childs) {
		    Html.createElement(data.childs[i], elem);
		}
		// assign to parent
		if (data.parent) {
			data.parent.appendChild(elem);
		} else if (parent) {
			parent.appendChild(elem);
		}
	}
}