window.onresize = doResize;

function doResize(){
    var screenheight;
 
     // the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight
     if (typeof window.innerHeight != 'undefined')
     {
          screenheight = 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.clientHeight !=
         'undefined' && document.documentElement.clientHeight != 0)
     {
           screenheight = document.documentElement.clientHeight
     }
     
     // older versions of IE
     else
     {
           screenheight = document.getElementsByTagName('body')[0].clientHeight
     }                                                                          

     if(screenheight > 400){
     
        var baseheight = screenheight - 118;
        
        var container2 = getElement("container2");
        var container3 = getElement("container3");
        var modulebox = getElement("modulebox");
        var currentmodule = getElement("currentmodule");
        var accordion = getElement("accordionpanel");

        container2.style.height = (baseheight - 0) + "px";
        container3.style.height = (baseheight - 73) + "px";
        accordion.style.height = (baseheight - modulebox.offsetHeight - currentmodule.offsetHeight) + "px";
     }
}
