function PositionFooterIfNecessary(PageType)
{
    var viewportheight;
    var viewportwidth;
    var footer;
    var offset;
    //var minheight = "751";
    var documentheight;
    var footerheight = "63";
    var contentheight;
    var flashhomeheight;
    
    if (PageType == "Home")
    {
        flashhomeheight = 471;
    }
    else
    {
        flashhomeheight = 0;
    }

    // the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight

    if (typeof window.innerWidth != 'undefined')
    {
        viewportheight = window.innerHeight;
    }

    // IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)

    else if (typeof document.documentElement != 'undefined'
     && typeof document.documentElement.clientWidth !=
     'undefined' && document.documentElement.clientWidth != 0)
    {
        viewportheight = document.documentElement.clientHeight;
    }

    // older versions of IE

    else
    {
        viewportheight = document.getElementsByTagName('body')[0].clientHeight;
    }
    
    footer = getElementsByClass("Footer");
    content = getElementsByClass("Content");
    
    for (var i = 0, j = content.length; i < j; i++)
    {
        contentheight = content[i].offsetHeight;
    }
        
    documentheight = parseInt(contentheight) + parseInt(footerheight) + parseInt(flashhomeheight);
    
    if (viewportheight >= documentheight)
    {
        offset = viewportheight - footerheight;
        for (var i = 0, j = footer.length; i < j; i++)
        {
            footer[i].style.position = 'absolute';
            footer[i].style.top = offset + 'px';
        }
    }
    else
    {
        for (var i = 0, j = footer.length; i < j; i++)
        {
            footer[i].style.position = 'relative';
            footer[i].style.top = '0';
        }
    }
}

function getElementsByClass(searchClass,node,tag) {
	var classElements = new Array();
	if ( node == null )
		node = document;
	if ( tag == null )
		tag = '*';
	var els = node.getElementsByTagName(tag);
	var elsLen = els.length;
	var pattern = new RegExp('(^|\\s)'+searchClass+'(\\s|$)');
	for (i = 0, j = 0; i < elsLen; i++) {
		if ( pattern.test(els[i].className) ) {
			classElements[j] = els[i];
			j++;
		}
	}
	return classElements;
}
