function viewport_adjust()
{
	var vp = document.getElementById('viewport');

	if (screen.width < 768) {
		if (screen.width < 640) {
			vp.setAttribute('content', 'width=640');
		} else {
			vp.setAttribute('content', 'width=device-width');
		}
	} else {
		if (window.orientation == 0 || window.orientation == 180)
			vp.setAttribute('content', 'width=device-width');
		else
			vp.setAttribute('content', 'width=device-height');
	}
}

viewport_adjust();

