var oDocumentContainer = null ;
var oPageContainer = null ;

var oHeaderArea = null ;
var oSeparatorArea = null ;
var oPromoArea = null ;
var oBreadCrumbArea = null ;
var oContentArea = null ;
var oFooterArea = null ;

function doInitAreas () {
	oDocumentContainer = document.getElementById ("documentContainer") ;
	oPageContainer = document.getElementById ("pageContainer") ;

	oHeaderArea = document.getElementById ("headerArea") ;
	oSeparatorArea = document.getElementById ("separatorArea") ;
	oPromoArea = document.getElementById ("promoArea") ;
	oBreadCrumbArea = document.getElementById ("breadcrumbArea") ;
	oContentArea = document.getElementById ("contentArea") ;
	oFooterArea = document.getElementById ("footerArea") ;
}

function doFooterPlace () {
	var contentHeight = 0 ;
	var areasHeight = 0 ;

	if (oDocumentContainer) {
		contentHeight += oDocumentContainer.offsetHeight ;
	}

	if (oHeaderArea) {
		areasHeight += oHeaderArea.offsetHeight ;
	}
	if (oSeparatorArea) {
		areasHeight += oSeparatorArea.offsetHeight ;
	}
	if (oBreadCrumbArea) {
		areasHeight += oBreadCrumbArea.offsetHeight + 6 ;
	}
	else if (oPromoArea) {
		areasHeight += oPromoArea.offsetHeight ;
	}
	if (oContentArea) {
		areasHeight += oContentArea.offsetHeight ;
	}

	if (oFooterArea) {
		if (contentHeight > areasHeight + oFooterArea.offsetHeight) {
			oFooterArea.style.top = (contentHeight - areasHeight - oFooterArea.offsetHeight) + "px" ;
		}
		else {
			oFooterArea.style.top = "0px" ;
		}
	}
}

window.onload = function () {
	doInitAreas () ;
	doFooterPlace () ;
}

window.onresize = function () {
	doFooterPlace () ;
}

function doHighlightMenu (_obj, _img) {
	var img = _obj.childNodes [1] ;
		img.src = _img.src;
	//_obj.childNodes [1] = _img;
}

