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