
window.onload = init;

function init() {
			adjustLeftPos();
			changeStyles();// Ajusts Styles for Different Browsers
			adjustBlockHeight();// For the homepage only
			rollovers();// Sets Rollovers 
}
// 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 adjustBlockHeight() {
			var minTop = 460;
			var blockFixer = document.getElementById("blockFixer");
			var bg_EP_bottom = document.getElementById("bg_EP_bottom");
			var bg_EP_bottomY = getElementPosition("bg_EP_bottom").top;
			
			if(blockFixer && bg_EP_bottom){
				if(bg_EP_bottomY < minTop) {
					blockFixer.style.display = "block";
					blockFixer.style.height = parseInt(minTop - bg_EP_bottomY) + "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 isNav = (navigator.appName == "Netscape");
			var menu = document.getElementById("menu");
			var contentArea = document.getElementById("contentArea");
			var employerProfiles_Middle = document.getElementById("employerProfiles_Middle");
			var RFP_Middle = document.getElementById("RFP_Middle");
			var infoMiddle = document.getElementById("infoMiddle");
			var contentDrill = document.getElementById("contentDrill");
			var spacer_drill = document.getElementById("spacer_drill");
			
			if(!isNav && menu) {
				menu.style.marginBottom = 0 + "px";
			}
			
			if(isNav && contentArea) {
				contentArea.style.marginTop = -2 + "px";
			}
			if(isNav && employerProfiles_Middle) {
				employerProfiles_Middle.style.marginTop = -2 + "px";
			}
			if(isNav && RFP_Middle) {
				RFP_Middle.style.marginTop = -2 + "px";
			}
			if(isNav && infoMiddle) {
				infoMiddle.style.marginTop = -2 + "px";
			}
			if(isNav && contentDrill) {
				contentDrill.style.marginTop = -2 + "px";
			}
			if(!isNav && spacer_drill) {
				spacer_drill.style.display = "none";
			}
			
		}