function updateOrientation(){  
    var contentType = "";  
    switch(window.orientation){  
        case 0:  
        contentType += "vert";  
        break;  
  
        case -90:  
        contentType += "horiz";  
        break;  
  
        case 90:  
        contentType += "horiz";  
        break;  
  
        case 180:  
        contentType += "vert";  
        break;  
    }  
document.getElementById("orientation").setAttribute("class", contentType);  
}