window.onload = init;

function init() {
			adjustLeftPos();
			changeStyles();// Ajusts Styles for Different Browsers
}

// Adjusts position of the ouuter Container for small screen resolution (less than 1000)
		function adjustLeftPos() {
			if(screen.width <= 800){
			
				var outerContainer = document.getElementById("outerContainer");
				var outerContainerX = getElementPosition("outerContainer").left;
			
				if(outerContainerX < 0){
					outerContainer.style.left = 0 + "%";
					outerContainer.style.marginLeft = 0 + "px";
				}else{
					outerContainer.style.left = 50 + "%";
					outerContainer.style.marginLeft = -462 + "px";
				}
			}
		}
		
		function getElementPosition(elemID){
			var offsetTrail = document.getElementById(elemID);
			var offsetLeft = 0;
			var offsetTop = 0;
			while(offsetTrail){
				offsetLeft += offsetTrail.offsetLeft;
				offsetTop += offsetTrail.offsetTop;
				offsetTrail = offsetTrail.offsetParent;
			}
			return {left:offsetLeft, top:offsetTop};
}
function changeStyles () {
			
			var ImgButton, ImgButton_Left, i;
			var isNav = (navigator.appName == "Netscape");
			var DIVs = document.getElementsByTagName("DIV");
			for (i = 0; i < DIVs.length; i++){
				if((DIVs[i].className == "greenImgButton") || (DIVs[i].className == "greenImgButton_Left")) {
					if(!isNav){
						DIVs[i].style.marginTop = 0 + "px";
					}
					
				}
			}
			
			
		}
