function getWindowHeight() {
	var windowHeight = 0;
	if (typeof(window.innerHeight) == 'number') {
		windowHeight = window.innerHeight;
	}
	else {
		if (document.documentElement && document.documentElement.clientHeight) {
			windowHeight = document.documentElement.clientHeight;
		}
		else {
			if (document.body && document.body.clientHeight) {
				windowHeight = document.body.clientHeight;
			}
		}
	}
	return windowHeight;
}

function getWindowWidth() {
	var windowWidth = 0;
	if (typeof(window.innerWidth) == 'number') {
		windowWidth = window.innerWidth;
	}
	else {
		if (document.documentElement && document.documentElement.clientWidth) {
			windowWidth = document.documentElement.clientWidth;
		}
		else {
			if (document.body && document.body.clientWidth) {
				windowWidth = document.body.clientWidth;
			}
		}
	}
	return windowWidth;
}
		
	function setFooter() {
		if (document.getElementById) {
			var windowHeight = getWindowHeight();
			if (windowHeight > 0) {
				var shopElement = document.getElementById('shopcontainer');
				var contentHeight = document.getElementById('content').offsetHeight + document.getElementById('marqueeScroll').offsetHeight;
				var footerElement = document.getElementById('footer');
				var marqueeElement = document.getElementById('marqueeScroll');
				var marqueeHeight = marqueeElement.offsetHeight;
				var footerHeight  = footerElement.offsetHeight;
				if (windowHeight - (contentHeight + footerHeight) >= 0) {
					footerElement.style.position = 'relative';
					marqueeElement.style.position = 'relative';
					footerElement.style.top = (windowHeight - (contentHeight + footerHeight)) + 'px';
					marqueeElement.style.top = (windowHeight - (contentHeight + footerHeight + marqueeHeight)) + 'px';
					
						if(shopElement) {
		
							var pxshift = 0;
							var divparent = shopElement.offsetParent;
							var pxshift = pxshift - divparent.offsetLeft;
							var shopframe = document.getElementById('shopframe');
							divparent = divparent.offsetParent;
							var pxshift = pxshift - divparent.offsetLeft;
							
							shopElement.style.left = pxshift + 25 + 'px';
							shopElement.style.top = '90px';
							var ww = getWindowWidth();
							var wh = getWindowHeight();
							shopElement.style.width = ww - 50 + 'px';
							shopframe.style.width = ww - 50 + 'px';
							shopElement.style.height = (wh - 270) + 'px';
							shopframe.style.height = (wh - 270) + 'px';
							
						}
					
				}
				else {
					footerElement.style.position = 'static';
					marqueeElement.style.position = 'static';
				}
			}
		}
	}
	window.onload = function() {
		setFooter();
	}
	window.onresize = function() {
		setFooter();
		positionShop();
	}
