if (typeof (window.orientation) != "undefined") {
  window.onload = function() {
    var setupOrientationClass = function() {
      var html = document.getElementsByTagName("html")[0];
      switch (window.orientation) {
        case 0:
          html.className = 'portrait';
        break;
        case 90:
          html.className = 'landscape';
        break;
      }
    };
    window.onorientationchange = setupOrientationClass;
    setupOrientationClass();
  }  
    
}


