

$(document).ready( function() {
    // Resize the iframe to make it takes the rest of the page. 
    // (If you have a better solution with CSS (working in every browser :-) ), use it !)
    $('iframe#content').height(ScreenHeight() - $('iframe#content').position().top - 4);
    // The 4 is arbitrary. Used for a good rendering (no global scroll bar) in Firefox
    
    // All the "#nav .RessourceLink" become cliquable and change the iframe content
    $('#nav .RessourceLink').bind('click', function(e){
        e.stopPropagation(); // prevent bubbling.
        ressourceAddress = RRA[e.currentTarget.id];
        $('iframe#content').attr('src', ressourceAddress);
    });
}
);

function ScreenHeight() {
    // Inpired from here : http://www.howtocreate.co.uk/tutorials/javascript/browserwindow
  var myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE (Opera, Firefox, etc...)
    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;
}



