// addLoadEvent Created by: Simon Willison
// http://simon.incutio.com/archive/2004/05/26/addLoadEvent
function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}

addLoadEvent(setScreenClass);
// =====================

window.onresize = setScreenClass;

//  Following transition classes will be declared:
//
//	classname		  screenwidth
//	------------------------------------------
//	screen_lo		  < 1280px	
//	screen_hi		  > 1280px			

function setScreenClass(){
		var fmt = document.documentElement.clientWidth;
		var cls = (fmt<=1100)?'screen_lo':(fmt>1100)?'screen_high':'screen_high';
		document.getElementById('banner').className='margin_'+cls;	
		document.getElementById('page').className='margin_'+cls;	
		document.getElementById('footer').className='margin_'+cls;
};
