// JavaScript Document
var bscrollSpeed = 40;       // Speed in milliseconds
var bstep = 1;               // How many pixels to move per step
var bcurrent = 0;            // The current pixel row
var bimageWidth = 1;     // Background image height
var bheaderWidth = 1600;     // How tall the header is.
//The pixel row where to start a new loop
var brestartPosition = -(bimageWidth - bheaderWidth);

function bscrollBg(){
var scrollTop = $(window).scrollTop();
//alert(scrollTop);

if((scrollTop < 955) && (scrollTop > 550)) {
   
    //Go to next pixel row.
    bcurrent -= bstep;
//	alert(current);
   
    //If at the end of the image, then go to the top.
	
    if (bcurrent < -(bimageWidth)){
        bcurrent = 0+bheaderWidth;
    }
   
    //Set the CSS of the header.
    $('#cloud1').css("background-position",bcurrent+"px"+" 0");
   
   
}
}
//Calls the scrolling function repeatedly
var binit = setInterval("bscrollBg()", bscrollSpeed);