﻿// JScript File
function moveFooter(objName, outerHName)
{
	var footer = document.getElementById(objName);
	var oElement = document.getElementById(outerHName);
    var winHeight = 0, docHeight = 0;
    
    if( typeof( window.innerWidth ) == 'number' ) // Non-IE 
        winHeight = window.innerHeight;
	else if( document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight) ) //IE 6+ in 'standards compliant mode'
		winHeight = document.documentElement.clientHeight; //works for FF
	else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) )	//IE 4 compatible
		winHeight = document.body.clientHeight;

	docHeight = oElement.clientHeight + footer.clientHeight;

	if(docHeight > winHeight) 
	{
		footer.style.top = (docHeight-footer.clientHeight) + 'px';
	}
}



//function moveFooter(objName, outerHName, innerHName)
//{
//	var footer = document.getElementById(objName);
//	var oElement = document.getElementById(outerHName);
//	var iElement = document.getElementById(innerHName);
//    var winHeight = 0, docHeight = 0;
//    
//    if( typeof( window.innerWidth ) == 'number' ) // Non-IE 
//        winHeight = window.innerHeight;
//	else if( document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight) ) //IE 6+ in 'standards compliant mode'
//		winHeight = document.documentElement.clientHeight; //works for FF
//	else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) )	//IE 4 compatible
//		winHeight = document.body.clientHeight;

//	docHeight = oElement.clientHeight + iElement.clientHeight;

//	if(docHeight + footer.clientHeight < winHeight) {
//		var iElementHeight = iElement.clientHeight + (winHeight-docHeight);
//		iElement.style.height = iElementHeight + 'px';
//		docHeight = oElement.clientHeight + iElementHeight - footer.clientHeight;
//	}
//	footer.style.top = docHeight + 'px';
//}

