if(typeof window.getComputedStyle!="function") {
	window.getComputedStyle=function(elt,pseudoElt) {
		return (elt!=null && typeof	elt.currentStyle=="object")?elt.currentStyle:null;
	}
}

if(!(document.getElementById)){ 
	document.getElementById=function(id) {
		if(document.all && document.all[id] && document.all[id].style) return document.all[id];
		else if(document.layers && document.layers[id]) {
			document.layers[id].style=document.layers[id];
			return document.layers[id];
		} else return null;
	}
}

function getBrowserHeight(){
	if (window.innerHeight)	return window.innerHeight;
	else if(document.documentElement && document.documentElement.clientHeight != 0)	return document.documentElement.clientHeight; 
	else if(document.body) return document.body.clientHeight;
	return 0;
}

function setPosition() {
	var thispage = document.getElementById('container');
	var pageHeight = parseInt(getComputedStyle(thispage,'').height);
	var browserHeight = (getBrowserHeight() - pageHeight)/2;
	if(browserHeight<0) browserHeight=0;
	thispage.style.top = browserHeight+"px";
}

function addEvent(obj, type, fn) {
	if(obj.addEventListener) obj.addEventListener(type, fn, false);
	else if(obj.attachEvent){
		obj["e"+type+fn] = fn;
		obj[type+fn] = function(){obj["e"+type+fn](window.event);}
		obj.attachEvent("on"+type, obj[type+fn]);
	}
}
