(function (w, d, k) {
   var $;
   $ = w[k] = {};
   $.w = w;
   $.d = d;
   $.f = (function () {
      return {
         init : function () {
            $.s = $.d.getElementsByTagName('BODY')[0];
            $.s.addEventListener("touchmove", function (e) { e.preventDefault(); }, false);
            $.w.setTimeout($.f.orient, 0);
            $.w.onorientationchange = function () {
               $.f.orient();
            };
         },
         orient : function () {
            if ($.w.orientation === 0) {
               $.s.className = 'portrait';
            } else {
               $.s.className = 'landscape';
            }
            $.w.setTimeout($.f.home, 0);
         },
         home : function () {
            $.w.scrollTo(0, 1);
         }
      };
   }());
   $.f.init();
}(window, document, 'backchannel'));
