// JavaScript Document for Iphone

  window.addEventListener('load', function(){
    setTimeout(scrollTo, 0, 0, 1);
  }, false);
  
  window.addEventListener('load', setOrientation, false);
  window.addEventListener('orientationchange', setOrientation, false);
  function setOrientation() {
    var orient = Math.abs(window.orientation) === 90 ? 'landscape' : 'portrait'; 
    var cl = document.body.className;
    cl = cl.replace(/portrait|landscape/, orient);
    document.body.className = cl;
  }
  
//window.onorientationchange = function() {location.reload(true);}

function checkOrientation() {
    switch (window.orientation) {
        case 0:
            alert ('Denna sida ser bättre ut om du vänder till Landskapsläge');
    }
}
addEventListener("orientationchange", checkOrientation);
checkOrientation();