function fillthescreen() { var w; //width w = (document.compatMode != 'CSS1Compat') ? document.body.scrollWidth : document.documentElement.scrollWidth; //don't apply to small screen devices if (w > 767) { var heightNeeded = $('.main-content-after-nav').outerHeight()-11; if(document.getElementById('res-nav1')){ //console.log($('#res-nav1').outerHeight()); //console.log(heightNeeded); var nav1Height = $('#res-nav1').outerHeight(); if (heightNeeded > nav1Height) { if( typeof( window.innerWidth ) != 'number' ) { //Explorer doesn't recognize minHeight document.getElementById('res-nav1').style.height=heightNeeded+'px'; //So, we use height (and explorer bug) } document.getElementById('res-nav1').style.minHeight=heightNeeded+'px'; //For every other browser, we use minHeight } } if(document.getElementById('res-nav2')){ var nav2Height = $('#res-nav2').outerHeight(); if (heightNeeded > nav2Height) { if( typeof( window.innerWidth ) != 'number' ) { //Explorer doesn't recognize minHeight document.getElementById('res-nav2').style.height=heightNeeded+'px'; //So, we use height (and explorer bug) } document.getElementById('res-nav2').style.minHeight=heightNeeded+'px'; //For every other browser, we use minHeight } } } else { // reset height of columns to 100% as if going from large to narrow if(document.getElementById('res-nav1')){ if( typeof( window.innerWidth ) != 'number' ) { //Explorer doesn't recognize minHeight document.getElementById('res-nav1').style.height="100%"; //So, we use height (and explorer bug) } document.getElementById('res-nav1').style.minHeight="100%"; //For every other browser, we use minHeight } if(document.getElementById('res-nav2')){ if( typeof( window.innerWidth ) != 'number' ) { //Explorer doesn't recognize minHeight document.getElementById('res-nav2').style.height="100%"; //So, we use height (and explorer bug) } document.getElementById('res-nav2').style.minHeight="100%"; //For every other browser, we use minHeight } } } function resizeStuff() { //Time consuming resize stuff here if(document.getElementById('res-nav1')){ $(document.getElementById('res-nav1')).css("display","none"); // display none so that the pre existing height of the div doesn't effect height of page } if(document.getElementById('res-nav2')){ $(document.getElementById('res-nav2')).css("display","none"); // display none so that the pre existing height of the div doesn't effect height of page } fillthescreen(); if(document.getElementById('res-nav1')){ $(document.getElementById('res-nav1')).css("display","block"); // display none so that the pre existing height of the div doesn't effect height of page } if(document.getElementById('res-nav2')){ $(document.getElementById('res-nav2')).css("display","block"); // display none so that the pre existing height of the div doesn't effect height of page } } /* for the search bar */ function addClass() { var w; //width w = (document.compatMode != 'CSS1Compat') ? document.body.scrollWidth : document.documentElement.scrollWidth; if ((w > 599) && (w < 910)) { $('.res-search-form').addClass('res-search-field-expanded'); } }; function removeClass() { var w; //width w = (document.compatMode != 'CSS1Compat') ? document.body.scrollWidth : document.documentElement.scrollWidth; if ((w > 599) && (w < 910)) { $('.res-search-form').removeClass('res-search-field-expanded'); } } var tabs; var tabsearch; $(document).ready(function(){ var w; //width w = (document.compatMode != 'CSS1Compat') ? document.body.scrollWidth : document.documentElement.scrollWidth; if (w > 767) { if ($('.res-tab-content').length > 0) { tabs = $(".res-tab-style").accessibleTabs({ tabhead:'article > h3', fx:"fadeIn", tabsListClass:"res-tab-style-list", autoAnchor:true }); } if ($('.res-tab-search').length > 0) { tabsearch = $(".res-tab-style").accessibleTabs({ tabhead:'h2', fx:"fadeIn", tabsListClass:"res-tab-style-list", autoAnchor:true }); } // FOR VERTICAL TABS, SO HEIGHT OF BOXES IS AT LEAST THE SAME HEIGHT AS THE TABS UL var listHeight = $('.res-vertical-tabs > ul.res-tab-style-list').innerHeight(); $('.res-vertical-tabs .tabbody').each(function() { if( typeof( window.innerWidth ) != 'number' ) { //Explorer doesn't recognize minHeight $(this).css("min-height",listHeight); } if ($.browser.msie && navigator.userAgent.indexOf('Trident')!==-1){ // IE8 knows min height $(this).css("min-height",listHeight); } $(this).css("min-height",listHeight); }); } //delay so everything is initalised before column resize happens setTimeout ( "resizeStuff()", 400 ); }); $(window).bind("load", function() { fillthescreen(); }); var TO = false; $(window).resize(function(){ if (TO !== false) clearTimeout(TO); TO = setTimeout(resizeStuff, 200); //200 is time in miliseconds }); function is_touch_device() { return !!('ontouchstart' in window) || !!('onmsgesturechange' in window); }; function convertToTouchFriendly() { $(".res-nav-w-dropdown > a").bind("click", function(e) { e.handled = true; e.stopPropagation(); e.preventDefault(); return false; }); $(".res-nav-w-dropdown > a").bind("touchend", function(e) { //var dropdown = $(this).closest("li.res-nav-w-dropdown");//.find("div.res-nav-dropdown-wrapper") var dropdown = $(this).closest("li.res-nav-w-dropdown"); var body = $('html'); body.toggleClass('opened'); if (body.hasClass('opened')) { $('
' ).appendTo( 'body' ); } var blocker = $('#blocker'); if (!body.hasClass('opened')) { blocker.remove(); } blocker.on('click', function() { if (body.hasClass("opened")) { body.removeClass("opened"); blocker.remove(); $(".res-nav-w-dropdown").removeClass("hover"); } }); if (!dropdown.hasClass("hover")) { //alert("hello"); if (e.handled != true ) { //alert("hi"); $(".res-nav-w-dropdown").removeClass("hover"); dropdown.addClass("hover"); } } else { $(location).attr('href', $(this).attr("href") ); return true; } e.handled = true; e.stopPropagation(); e.preventDefault(); return false; }); /* $("html").bind("touchend", function(e) { var dropdown = $(this).closest("li.res-nav-w-dropdown"); if (!dropdown.hasClass("hover")) { if (e.handled != true ) { $(".res-nav-w-dropdown").removeClass("hover"); } } e.handled = true; e.stopPropagation(); e.preventDefault(); return false; });*/ } if (is_touch_device() ) { if ($(window).innerWidth() >= 768) { setTimeout(convertToTouchFriendly, 1000); } }