// formatter.js
// all js code neccessary for site formatting
// uses jquery library, include script tag to jquery.js before calling this file
//
// E. Wrubel 2009-10-17
//----------------------------------------------------------

// Global variables

// main OnDocumentReady handler
// Do all initialization here
$(document).ready(function() {
	
	if ( $.browser.msie && $.browser.version == '6.0')
	  return;

  $(window).resize(function() {ChooseStylesheet();});

  ChooseStylesheet();
}
);

// ChoseStylesheet: Determine window/screen size, set fitting style sheet accordingly
function ChooseStylesheet() {
  var WindowWidth = $('body').eq(0).outerWidth();
  
  if (WindowWidth > 1024) {
    switchStylestyle('Wide');
  }
  else if (WindowWidth < 800) {
    switchStylestyle('Small');
  }
  else {
    switchStylestyle('Normal');
  }
}

function switchStylestyle(styleName)
   {
      $('link[@rel*=style][title]').each(function(i) 
      {
         this.disabled = true;
         if (this.getAttribute('title') == styleName) this.disabled = false;
      });
//      createCookie('style', styleName, 365);
   }

