footerhandler = {
  init: function() {
    if (!document.getElementById) return;
	footerhandler.setFooter();
	footerhandler.addEvent(window,"resize",footerhandler.setFooter);
  },

  setFooter: function() {
    var theHeight = 0;
    if (window.innerHeight) {
	theHeight = window.innerHeight
    } else if (document.documentElement &&
                document.documentElement.clientHeight) {
	theHeight = document.documentElement.clientHeight
    } else if (document.body) {
	theHeight = document.body.clientHeight
    }
    if (theHeight != 0) {
      if (theHeight < 645) {
      	document.getElementById('footer').className = 'normal-layout';
      } else {
        document.getElementById('footer').className = 'small-layout';
      }

    }
  },
  addEvent: function( obj, type, fn ) {
    if ( obj.attachEvent ) {
      obj['e'+type+fn] = fn;
      obj[type+fn] = function(){obj['e'+type+fn]( window.event );}
      obj.attachEvent( 'on'+type, obj[type+fn] );
    } else {
      obj.addEventListener( type, fn, false );
    }
  }
}

footerhandler.addEvent(window,"load",footerhandler.init);

