function returnWidth() {
    var myWidth = 0
    if( typeof( window.innerWidth ) == 'number' ) {
        //Non-IE
        myWidth = window.innerWidth;
    } else {
        if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
            //IE 6+ in 'standards compliant mode'
            myWidth = document.documentElement.clientWidth;
        } else {
            if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
                //IE 4 compatible
                myWidth = document.body.clientWidth;
            }
        }
    }
    return myWidth;
}

function returnHeight() {
    myHeight = 0;
    if( typeof( window.innerWidth ) == 'number' ) {
        //Non-IE
        myHeight = window.innerHeight;
    } else {
        if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
            //IE 6+ in 'standards compliant mode'
            myHeight = document.documentElement.clientHeight;
        } else {
            if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
                //IE 4 compatible
                myHeight = document.body.clientHeight;
            }
        }
    }
    return myHeight;
}

function resizeMe() {
    var contel = document.getElementById("wrapper");
    var navel = document.getElementById("sitenav");
    var winHeight = returnHeight();
    var contHeight = contel.offsetHeight;
    var navHeight = navel.offsetHeight;
    //alert(winHeight + "\n" + contHeight + "\n" + navHeight);
    //Browser detection script
    var xy = navigator.appVersion;
    xz = xy.substring(0,4);
    var load = true;
    if (navigator.userAgent.toLowerCase().indexOf("mac") == -1) {
        if (navigator.appName.indexOf("Netscape") == -1) {
            var agent=navigator.userAgent.toLowerCase();
            var ieVersionNum;
            var ieIndex = agent.indexOf("msie");
            if (ieIndex > -1) {
                //ie
                if (contHeight > winHeight) {
                    if (navHeight < contHeight) {
                        navel.style.height = contHeight + 32;
                    }
                } else {
                    navel.style.height = winHeight;
                }
            }
        } else {
            //netscape
            if (contHeight > winHeight) {
                if (navHeight < contHeight) {
                    navel.style.height = contHeight + 45;
                }
            } else {
                navel.style.height = winHeight;
            }
        }
    } else {
        //mac
        if (contHeight > winHeight) {
            if (navHeight < contHeight) {
                navel.style.height = contHeight + 45;
            }
        } else {
            navel.style.height = winHeight;
        }
    }
}

//BEGINNING OF SETUP ABARTABLES FUNCTION
function setupABarTables() {
   // set classes for Action bar
   var vTable = document.getElementsByTagName("Table")[0];
   vTable.className = "ABTable";
   var ac = vTable.getElementsByTagName("TR" );
   for (i=0; i < ac.length; i++) {
      ac[i].className = "ABRow";
   } 
   var ac = vTable.getElementsByTagName("TD" );
   for (i=0; i < ac.length;i++) {
      ac[i].className = "ABCell";
      ac[i].onmouseover = function() {this.className = "ieHover";}
      ac[i].onmousedown = function() {this.className = "ieClick";}
      ac[i].onmouseout = function() {this.className = "ABCell";}
   } 
} 
//END OF SETUPABARTABLES FUNCTION
