/*
 * landscape.js
 */

// time set
h = (new Date()).getHours();
if((h >= 0) && (h < 5)) document.write("<div id='landscape' style='background:url(/img/landscape/landscape_kagoshima_midnight.png)'></div>");
if((h >= 5) && (h < 8)) document.write("<div id='landscape' style='background:url(/img/landscape/landscape_kagoshima_sunrise.png)'></div>");
if((h >= 8) && (h < 12)) document.write("<div id='landscape' style='background:url(/img/landscape/landscape_kagoshima_morning.png)'></div>");
if((h >= 12) && (h < 16)) document.write("<div id='landscape' style='background:url(/img/landscape/landscape_kagoshima_noon.png)'></div>");
if((h >= 16) && (h < 18)) document.write("<div id='landscape' style='background:url(/img/landscape/landscape_kagoshima_sunset.png)'></div>");
if((h >= 18) && (h < 23)) document.write("<div id='landscape' style='background:url(/img/landscape/landscape_kagoshima_night.png)'></div>");
if((h >= 23) && (h < 24)) document.write("<div id='landscape' style='background:url(/img/landscape/landscape_kagoshima_midnight.png)'></div>");

// landscape scroll
var scrollSpeed = 100;
var current = 0;
var direction = 'h';
function bgscroll(){
current -= 1;
$('div#landscape').css("backgroundPosition", (direction == 'h') ? current+"px 0" : "0 " + current+"px");
}
setInterval("bgscroll()", scrollSpeed);	

