function addLoadEvent(func) {
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;
		}
	else {
		window.onload = function() {
			oldonload();
			func();
			}
		}
	};
	
function addResizeEvent(func) {
	var oldresize = window.onresize;
	if (typeof window.onresize != 'function') {
		window.onresize = func;
		}
	else {
		window.onresize = function() {
			oldresize();
			func();
			}
		}
	};
	
getScreenDimension = function(bHeight) {
	
	var d = 0;
	if( typeof( window.innerWidth ) == 'number' ) {
		// non IE
		bHeight ? d = window.innerHeight : d = window.innerWidth;
		}
	else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
		//IE 6+ in 'standards compliant mode'
		bHeight ? d = document.documentElement.clientHeight : d = document.documentElement.clientWidth;
		}
	else if (document.body && (document.body.clientWidth || document.body.clientHeight)) {
		bHeight ? d = document.body.clientHeight : d = document.body.clientWidth;
		}
	return d;
	
	}
