function repositionAndRedraw(){
	//window.onresize = function(){
		if ((document.getElementById("bigImageContainer")) && (document.getElementById("bigImage"))  && (document.getElementById("onTop"))){
			var bigImageContainer = document.getElementById("bigImageContainer");
			var bigImage = document.getElementById("bigImage");
			bigImageContainer.style.width = bigImage.width + "px";
			var rightSide = document.getElementById("rightSide");
			
			var windowWidth;
			var windowHeight;
			if(self.innerWidth!=undefined){
				windowWidth = self.innerWidth;
				windowHeight = self.innerHeight;
			}
			else{
				windowWidth = document.documentElement.clientWidth;	
				windowHeight = document.documentElement.clientHeight;			
			}
			rightSide.style.marginLeft = bigImage.width + Math.max(30, (windowWidth - bigImage.width - 520) / 2) + "px";
			
			document.getElementById("onTop").style.width = windowWidth + "px";
			document.getElementById("bg").style.width = windowWidth + "px";
			document.getElementById("onTop").style.height = windowHeight + "px";
			
			if (windowWidth < 940){
				document.getElementById("onTop").style.width = "940px";
				document.getElementById("bg").style.width = "940px";
				//document.getElementById("myBody").style.overflowX = "scroll";
			}
			else{
				//document.getElementById("onTop").style.overflowX = "hidden";
			}
			
			if (windowHeight < 500){
				document.getElementById("onTop").style.height = "500px";
				//document.getElementById("onTop").style.overflowY = "scroll";
			}
			else{
				//document.getElementById("onTop").style.overflowY = "hidden";
			}
			//alert(document.getElementById("onTop").style.width);
			//if (document.getElementById("onTop").width < 500){
				//alert(document.getElementById("onTop").style.width);
			//}
			/*if (rightSide.style.marginLeft == '0px'){
				document.getElementById("myBody").style.overflow = "auto";
			}*/
			
			var content = document.getElementById("content");
			content.style.height = (windowHeight - 210) + "px";
		}
	}
	setInterval(repositionAndRedraw, 100);