<script language=\"JavaScript\" type=\"text/javascript\">
window.addEventListener('orientationchange', handleOrientation, false);
function handleOrientation() {
if (orientation == 0) {
//portraitMode
alert('portrait1');
} else if (orientation == 90) {
//landscapeMode
alert('landscape1');
} else if (orientation == -90) {
//landscapeMode
alert('landscape2');
} else if (orientation == 180) {
//portraitMode
alert('portrait2');
} else {
}
}
</script>