function adjustFooter(){ 
    var sideLen, threeColLen, artistLen, albumLen, songLen, e, headerHeight, bannerHeight, 
        flashHomeBannerHeight, bannerTitleHeight, searchResultHeight, getHeight1, getHeight2, getHeight3, len;
    headerHeight = 80;
    bannerTitleHeight = xHeight('ctl00_TitleCtrl_pTitle');
    bannerHeight = xHeight('ctl00_Banner_banner_pagebanner');     
    flashHomeBannerHeight = xHeight('homepromo');  
    searchResultHeight = xHeight('searchresultheight');
    getHeight1 = xHeight('getheight1');
    getHeight2 = xHeight('getheight2');
    getHeight3 = xHeight('getheight3');
    len = headerHeight + bannerTitleHeight + bannerHeight + flashHomeBannerHeight + searchResultHeight + getHeight1 + getHeight2 + getHeight3 + 5;
    sideLen = headerHeight + xHeight('sidenav_wrapper') - 60;
    artistLen = xHeight('topartist');
    albumLen = xHeight('topalbum');
    songLen = xHeight('topsong');       
    threeColLen = 0; 
    if (artistLen > threeColLen)
        threeColLen = artistLen;
    if (albumLen > threeColLen)
        threeColLen = albumLen;
    if (songLen > threeColLen)
        threeColLen = songLen;                    
    len = len + threeColLen;        
    if (sideLen > len)
        len = sideLen;
    var file = window.location.href;
    var filename = getFilename(file,true);
    filename=filename.toLowerCase();
    if (filename=='register.aspx') // dynamic css (validation error messages), make room for error box, temp fix
        len = len + 60;     
    if (filename=='album.aspx') // Caculation is not fit for album.aspx page
        len = len + 50;     
    if (filename=='bryanadams.aspx') // Caculation is not fit for album.aspx page
        len = len + 190;     
    if (filename=='songsofsummer.aspx') // Caculation is not fit for album.aspx page
        len = len + 130;     
    e = xGetElementById('footer');        
    xTop(e, len);
    e.style.display = 'block';    
}
function getFilename(text,ifLocal) {
    var lastB;
    if (!ifLocal)lastB = text.lastIndexOf("\\");
    else lastB = text.lastIndexOf("/");
    text = text.substr(lastB+1,text.length);
    var paramPos = text.indexOf("?");
    if (paramPos>0) text = text.substr(0,paramPos);    
    return text;
}
