function gId(id){
	return document.getElementById(id);
}

function carouselDown(source, pixel,max){
	var div=gId(source);
	if( (-parseInt(div.style.top)) < max){
		div.style.top = (parseInt(div.style.top)-pixel) + "px";
		gId("carouseldown").style.background = "url(images/carousel-down.gif) no-repeat 50% 50%";

		if(parseInt(div.style.top) <= 0){
			gId("carouselup").style.background = "url(images/carousel-up.gif) no-repeat 50% 50%";
		}
		if( (-parseInt(div.style.top)) >= max){
			gId("carouseldown").style.background = "url(images/carousel-down-off.gif) no-repeat 50% 50%";
		}
	}
}

function carouselUp(source, pixel,max){
	var div=gId(source);
	if(parseInt(div.style.top) + pixel <= 0){
		div.style.top = (parseInt(div.style.top)+pixel) + "px";
		gId("carouselup").style.background = "url(images/carousel-up.gif) no-repeat 50% 50%";
		
		if(parseInt(div.style.top)+ pixel > 0){
			gId("carouselup").style.background = "url(images/carousel-up-off.gif) no-repeat 50% 50%";
		}

		if((-parseInt(div.style.top)) < max){
			gId("carouseldown").style.background = "url(images/carousel-down.gif) no-repeat 50% 50%";
		}
	}
}
