footerhandler = {
  init: function() {
    if (!document.getElementById) return;
    // set up the appropriate wrapper
    footerhandler.setFooter();
    // and make sure it gets set up again if you resize the window
    footerhandler.addEvent(window,"resize",footerhandler.setFooter);
  },

  setFooter: function() {
    // width stuff from ppk's
    var theWidth = 0;
    if (window.innerWidth) {
	theWidth = window.innerWidth
    } else if (document.documentElement &&
                document.documentElement.clientWidth) {
	theWidth = document.documentElement.clientWidth
    } else if (document.body) {
	theWidth = document.body.clientWidth
    }
    if (theWidth != 0) {
      if (theWidth < 990) {
        document.getElementById('footer').className = 'altfooter';
      } else {
        document.getElementById('footer').className = 'mainfooter';
      }
    }
  },

// addEvent stuff 
  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);