var Dom = YAHOO.util.Dom;
var Anim = YAHOO.util.Anim;
var Ev = YAHOO.util.Event;
var actPage = 0;
	
	function moveGall(e, direction){
		Ev.stopEvent(e);
		var pages = parseInt((Math.ceil(Dom.getElementsByClassName('footer-gallery-picture-box').length)/6))
		if (direction=="prev"){
			if (actPage-1==(-1)) {
				return false
			} else {
				var attributes = {
					   left : {
							to : ((actPage-1)*942)*(-1),
							units:"px"
						}
					}
				actPage--	
			}
			
		} else if (direction=="next"){

			if (actPage==pages) {
				return false;
			} else {
				var attributes = {
					   left : {
							to : ((actPage+1)*942)*(-1),
							units:"px"
						}
					}
				actPage++
			}
		}
		var animation = new YAHOO.util.Anim(Dom.get('footer-gallery-row'),attributes,1.0,YAHOO.util.Easing.easeBoth);
		animation.animate();
	}

	function footerGalleryInit() {
		Ev.addListener(Dom.get('footer-gallery-prev-button'), 'click', moveGall, 'prev')
		Ev.addListener(Dom.get('footer-gallery-next-button'), 'click', moveGall, 'next')
		
		
	}
	
	Ev.onDOMReady(footerGalleryInit);



