// JavaScript Document

function updateOrientation () {
    var orientation=window.orientation;
    switch(orientation)
	{
        case 0: document.body.setAttribute("class","");
				document.getElementsByName("viewport").item(0).setAttribute("content","user-scalable=no, width=320, minimum-scale=1, maximum-scale=1");
                break;
        case 90:
        case -90:
                document.body.setAttribute("class","landscape");
				document.getElementsByName("viewport").item(0).setAttribute("content","user-scalable=no, width=480, minimum-scale=1, maximum-scale=1");
                break;
    }
	
	window.scroll(0,0);
}

function appendOnLoad (fn)
{
	var wl = window.onload;
	if (wl)
		window.onload = function () { wl(); fn(); }
	else
		window.onload = fn;
}

appendOnLoad(function () {
	window.onorientationchange=updateOrientation;
	updateOrientation();

	// Removes the address bar
	window.scroll(0,0);
});
