$(function(){
	$('a.lightbox').lightBox({
		overlayBgColor: '#000',
		overlayOpacity: 0.7,
		imageLoading: '/frames/lightbox/loading.gif',
		imageBtnClose: '/frames/lightbox/close.gif',
		imageBtnPrev: '/frames/lightbox/prev.gif',
		imageBtnNext: '/frames/lightbox/next.gif',
		containerResizeSpeed: 350,
		txtImage: 'Imagem',
		txtOf: 'de'
	   });

	picScroll();
	
});

var scrolltimer;
var move = 'dn';
function picScroll() {
	var oDiv, oContent;
	var speed = 1;

	scrolltimer = null;

	BOX = document.getElementById('slider_box');
	SLIDER = document.getElementById('slider');

	if ((move == "dn") && ((SLIDER.offsetWidth + SLIDER.offsetLeft) > BOX.offsetWidth)) {
		SLIDER.style.left = (SLIDER.offsetLeft - speed) + 'px';
	} else {
		if ((move == "up") && (SLIDER.offsetLeft < 0)) {
			SLIDER.style.left = (SLIDER.offsetLeft + speed) + 'px';
		} else {
			if (move == "top") {
				SLIDER.style.left = 0 + 'px';
			}
		}
	}

	if((SLIDER.offsetWidth + SLIDER.offsetLeft) <= BOX.offsetWidth){
		move = 'up';
	}else if(SLIDER.offsetLeft >= 0){
		move = 'dn';
	}

	scrolltimer = setTimeout("picScroll()", 1);

}
function stopScroll() {
	clearTimeout(scrolltimer);
}
