var debuger="on";var boxHeight=0;var usedBottom=0;var elementId="";function pageCarouselInit(b,a){elementId=b.replace(/./,"#");boxHeight=$(b+"-box").height();$(elementId).css("position","relative");debuger=a;if(boxHeight>$(elementId).height()){$("#carouselNext").addClass("hidden")}if(debuger=="on"){debug("CAROUSEL");debug("id: "+elementId);debug("box height: "+boxHeight);debug("content height: "+$(elementId).height())}}function pageCarouselNext(){usedBottom=usedBottom+boxHeight;if(usedBottom<=$(elementId).height()){$(elementId).animate({bottom:usedBottom},1000);$(window).scrollTop(0);if($("#carouselPrev").hasClass("hidden")){$("#carouselPrev").removeClass("hidden")}}else{usedBottom=usedBottom-boxHeight}if(debuger=="on"){debug("CAROUSEL NEXT");debug("id: "+elementId);debug("bottom: "+usedBottom)}}function pageCarouselPrev(){usedBottom=usedBottom-boxHeight;if(usedBottom>=0){$(elementId).animate({bottom:usedBottom},1000);$(window).scrollTop(0)}else{usedBottom=usedBottom+boxHeight}if(usedBottom==0){$("#carouselPrev").addClass("hidden")}if(debuger=="on"){debug("CAROUSEL PREV");debug("id: "+elementId);debug("bottom: "+usedBottom)}};
