var debuger="off";var boxHeight=0;var itemHeight=0;var usedBottom=0;var visibleObjects=0;var elementId="";function carouselInit(d,b,c){itemHeight=$(d).css("height").replace(/px/,"")*1;boxHeight=itemHeight*$(d).size();visibleObjects=b;elementId=d.replace(/./,"#");var a=itemHeight*visibleObjects;if(a>boxHeight){a=boxHeight}if(a<115){a=115}$(d+"-box").css({height:a,overflow:"hidden"});$(elementId).css("position","relative");debuger=c;if(debuger=="on"){debug("CAROUSEL");debug("id: "+elementId);debug("visible: "+visibleObjects);debug("box height: "+boxHeight);debug("height of main box: "+a)}}function carouselNext(){usedBottom=usedBottom+itemHeight;if(usedBottom<=(boxHeight-(visibleObjects*itemHeight))){$(elementId).animate({bottom:usedBottom},1000)}else{usedBottom=usedBottom-itemHeight}if(debuger=="on"){debug("CAROUSEL NEXT");debug("id: "+elementId);debug("bottom: "+usedBottom)}}function carouselPrev(){usedBottom=usedBottom-itemHeight;if(usedBottom>=0){$(elementId).animate({bottom:usedBottom},1000)}else{usedBottom=usedBottom+itemHeight}if(debuger=="on"){debug("CAROUSEL PREV");debug("id: "+elementId);debug("bottom: "+usedBottom)}};
