function detectMinHeight()
{
 for (var s in sheets)
 {
  if (window.screen && window.screen.height >= sheets[s][1])
  {
   var sheet = document.getElementById(sheets[s][0]);
   if (sheet && sheet.setAttribute) sheet.setAttribute('rel', 'stylesheet');
  }
 }
}
if (window.addEventListener) window.addEventListener('load', detectMinHeight, false);
else window.onload = detectMinHeight;

// Instructions: Comma-separated arrays of stylesheet IDs and minimum widths.
// This is activating 'normalscreen' at widths >= 800 and 'widescreen' when >= 1024.
var sheets = [ ['normalscreen', 861],
 ['widescreen', 400]
]; 