/*
// Purpose:     Hide scrollbars when window forfills minimum size requirements
// Requires:    jQuery library
// Author:      Eelco Weijmans, 3 nov 2009
*/


// set default page dimensions
var minimum_page_height = 650;
var minimum_page_width = 950;


// add event handlers to ready() and resize() events
$(document).ready(function(){ check_window_size(); });
$(window).resize(function(){ check_window_size(); });

// function to check if window forfills minimum size requirements
function check_window_size() {
  
  // if the window is higher than minimum height, hide overflow-y
  if($(window).height() > minimum_page_height) { $("body").css("overflow-y", "hidden"); }
  else { $("body").css("overflow-y", "auto"); }
  
  // if the window is wider than minimum width, hide overflow-x
  if($(window).width() > minimum_page_width) { $("body").css("overflow-x", "hidden"); }
  else { $("body").css("overflow-x", "auto"); }
}

