//positioning of footer 
function getWindowHeight() {
	var windowHeight = 0,
	windowWidth=0;
	if (typeof(window.innerHeight) == 'number') {
		windowHeight = window.innerHeight;
		windowWidth = window.innerWidth;
	}
	else {
		if (document.documentElement && document.documentElement.clientHeight) {
			windowHeight = document.documentElement.clientHeight;
			windowWidth = document.documentElement.clientWidth;
		}
		else {
			if (document.body && document.body.clientHeight) {
				windowHeight = document.body.clientHeight;
				windowWidth = document.body.clientWidth;
			}
		}
	}
	return [windowHeight,windowWidth];
}
function setFooter() {
	if(!document.getElementById('footer'))
		return setTimeout(setFooter,300);
	if (document.getElementById) {
		var o = getWindowHeight(),windowHeight=o[0],windowWidth=o[1];
		if (windowHeight > 0) {
			var wp_admin_margin = document.getElementById('wpadminbar');
			if(wp_admin_margin)wp_admin_margin=28;
			var resizedBox = document.getElementById('wrap4');
			var contentElement = document.getElementById('wrap1');
			var contentHeight = contentElement.offsetHeight;
			var footerElement = document.getElementById('footer');
			var footerHeight  = footerElement.offsetHeight;
			var difference = windowHeight - (contentHeight + footerHeight)
			if (difference >= 0) {
				// footerElement.style.position = 'absolute';
				// footerElement.style.top = (windowHeight - footerHeight) + 'px';
				// footerElement.style.width = windowWidth + 'px';
				resizedBox.style.height = (resizedBox.offsetHeight + difference-10-wp_admin_margin) + 'px';
			}
			else {
				/* footerElement.style.position = 'static'; */
				// footerElement.style.position = 'fixed';
				// footerElement.style.bottom = '0';
				// footerElement.style.width = windowWidth + 'px';
			}
		}
	}
}
window.onload = function() {
	setFooter();
}
window.onresize = function() {
	setFooter();
}




