var doMove = true;
var monstersky=(function(){

	/* animation prefs */
	var _height_monstersky = 770;
	var _monstersky_interval;
	
	return {
		relocate:function() {
			var new_y;
			var isIE = (document.all) ? 1 : 0;
			if (isIE)	new_y=document.documentElement.scrollTop;
			else		new_y = window.pageYOffset;
			
			var micronavi_buffer = 0;
			if ( $("#micronavi").css("top") =="0px") {
				micronavi_buffer = $("#micronavi").height();
			}
			
			if ( new_y > $("#wrapper").height() - micronavi_buffer - _height_monstersky ) {
				new_y = $("#wrapper").height() - micronavi_buffer - _height_monstersky;
			}
			
			$("#monstersky").stop(true, true).animate({top: new_y}, 1900);
			$("#skyleft").stop(true, true).animate({top: new_y}, 1900);
		}
	}
})();


$(document).ready(function(){
	if ( ( $("#monstersky").size()>0 ) && (doMove==true) && ($('#monstersky').is(':visible')) ) {
		_monstersky_interval = window.setInterval("monstersky.relocate()", 2000);
	}
});
