// （スピードは120がデフォルト）speed in milliseconds
	var scrollSpeed = 120;
	// set the default position
	var current = 0;
	var currentrevers = 0;
	// set the direction
	var direction = 'h';
	function bgscroll(){
// 1 pixel row at a time
	    current -= 1;
	    currentrevers += 1;
	    // （左右幅をxとするならば、current > -((x-300)/2) ）move the background with backgrond-position css properties
	if(current > -440) {
		firstscroll();
//		} else if(currentrevers < 0){
//		secondscroll();
		}
	
}

	function firstscroll() { $('div.mask').css("backgroundPosition", (direction == 'h') ? current+"px 0" : "0 " + current+"px"); };
	function secondscroll() { $('div.mask').css("backgroundPosition", (direction == 'h') ? currentrevers+"px 0" : "0 " + currentrevers+"px"); };

	//Calls the scrolling function repeatedly
	 setInterval("bgscroll()", scrollSpeed);

