// JavaScript Document
function bcarousel(){
							var containerHeight = 311;
							var productItemWidth = 0;
							var productListLength = 0;
							var carouselMarginT = 0;
							var carouselMarginB = 7;
							var carouselMarginL = 0;
							var carouselMarginR = 0;
							var productsToShow = 4;
							var scrollLength = 0;
							var visibleLength = 0;
							var currentScrollPos = "";
							var remainderLength = 0;
							var scrollMov = 0;
							var curentItemId = 0;
							var count = 0;
							
							// set width / height of container, float the list item and set the margin
							$j(".product-carousel").css({height: ""+containerHeight+"px", overflow: "hidden"});
							$j(".product-carousel-vertical li").css({margin: ""+carouselMarginT+"px "+carouselMarginR+"px "+carouselMarginB+"px "+carouselMarginL+"px"});
							// calculate the length of the items in the list to set the width/height of the ul
							
							$j(".product-carousel-vertical li").each(function(){
								count ++;
								productItemHeight = $j(this).height();
								productListLength += (productItemHeight+carouselMarginB);
								curentItemId += (productItemHeight+carouselMarginB);
								$j(this).attr({id: ""+curentItemId+""});
								$j(this).css({position:"absolute", top: ""+(curentItemId-(productItemHeight+carouselMarginB))+"px", left: "0px", zoom: "1"});
							});
							// add the container elements and the controls
							$j("#vertical-carousel-container").addClass("jscript");
							$j(".product-carousel-vertical").wrap("<div class=\"bcarousel-container bcarousel-container-vertical\"><div class=\"bcarousel-clip bcarousel-clip-vertical\"></div></div>");
							if(count > productsToShow){
								$j(".bcarousel-container-vertical").prepend("<div class=\"bcarousel-prev bcarousel-prev-vertical bcarousel-prev-disabled-vertical\" style=\"display: block;\"></div><div class=\"bcarousel-next bcarousel-next-vertical\" style=\"display: block;\"></div>");
							}else{
								$j(".bcarousel-container-vertical").css({margin: "-29px 0"});
							}
								
							$j(".bcarousel-container-vertical span.details").hide();
							// get the current scroll position and set the disabled buttons
							currentScrollPos = $j(".product-carousel-vertical").css("top");
								if(currentScrollPos == "0px" || currentScrollPos == "auto"){
									$j(".bcarousel-prev").addClass("bcarousel-prev-disabled");
									$j(".product-carousel-vertical").css({top: "0px"});
									currentScrollPos = $j(".product-carousel-vertical").css("top");
								}
							
							// calculate the scroll length
							for(var i = 0; i < productsToShow; i++){
								visibleLength += productItemHeight + carouselMarginB;
							}
							var trueVisibleLength = (productItemHeight + carouselMarginB) * productsToShow;
							if(remainderLength > 0){
								var lastScrollPoint = (Math.abs(remainderScroll) - Math.abs(productListLength)) + Math.abs(visibleLength);
							}
							
							scrollLength = visibleLength;
							var endLength = scrollLength - productListLength;
							// set button disabled if nowhrere to scroll to
							
							if(trueVisibleLength >= productListLength){
								$j(".bcarousel-next").addClass("bcarousel-next-disabled")
							};
							
							
							
							function calculateScroll(cScroll, direction){
								pLength = Math.abs(productListLength);
								
								//showPos(trueVisibleLength+"  "+productListLength);
								if(direction == "top"){
									if(trueVisibleLength <= productListLength){
										$j(".bcarousel-next").removeClass("bcarousel-next-disabled");
									}
									if(cScroll != 0){
										
									}else{
										scrollLength = 0;
									}
									
									if(Math.abs(cScroll) > visibleLength){
										scrollLength = visibleLength;
									}else{
										scrollLength = Math.abs(cScroll);
										$j(".bcarousel-prev").addClass("bcarousel-prev-disabled");
									}
									if(parseInt(cScroll) == 0){
										if(parseInt(cScroll) != 0){
											$j(".bcarousel-next").addClass("bcarousel-next-disabled");
										}
									}
									 /////
								}else if(direction =="bottom"){
									
									if(trueVisibleLength <= productListLength){
										$j(".bcarousel-prev").removeClass("bcarousel-prev-disabled");
									}
									if(cScroll != 0 || cScroll <= visibleLength){
										remainderLength =(pLength-Math.abs(cScroll))-visibleLength;
									}else{
										remainderLength = pLength;
									}
									//showPos(remainderLength);
									var rScrollMov = pLength - remainderLength;
									
									if(remainderLength < visibleLength){
										scrollLength = remainderLength;
										$j(".bcarousel-next").addClass("bcarousel-next-disabled");
									}else{
										scrollLength = visibleLength;
									}
									if(parseInt(cScroll) == 0 && trueVisibleLength >= productListLength){
										$j(".bcarousel-prev").addClass("bcarousel-prev-disabled");
									}
								}
								
							};
							
							
							function scrollDown(){
								
								currentScrollPos = parseInt($j(".product-carousel-vertical").css("top"));
								if(currentScrollPos == "0px" || currentScrollPos == "auto"){
									$j(".product-carousel-vertical").css({top: "0px"});
									currentScrollPos = parseInt($j(".product-carousel-vertical").css("top"));
								}
								calculateScroll(currentScrollPos, 'bottom');
								$j(".product-carousel-vertical").animate({top: "-"+scrollLength+"px"}, 500);
								setTimeout(function(){
									$j(".bcarousel-next").bind('click', function(){
									$j(this).unbind('click');
									scrollDown();
									});
								}, 500);
							}
							function scrollUp(){
								currentScrollPos = parseInt($j(".product-carousel-vertical").css("top"));
								if(currentScrollPos == "0px" || currentScrollPos == "auto"){
									$j(".product-carousel-vertical").css({top: "0px"});
									currentScrollPos = parseInt($j(".product-carousel-vertical").css("top"));
								}
								calculateScroll(currentScrollPos, 'top');
								$j(".product-carousel-vertical").animate({top: "+"+scrollLength+"px"}, 500);
								setTimeout(function(){
									$j(".bcarousel-prev").bind('click', function(){
									$j(this).unbind('click');
									scrollUp();
									});
								}, 500);
							}
								
							$j(".bcarousel-prev").bind('click', function(){
								$j(this).unbind('click');
								scrollUp();
							});
							$j(".bcarousel-next").bind('click', function(){
								$j(this).unbind('click');
								scrollDown();
							});
							
							
							function convertToNumber(num){
								var numLength = num.length;
								if(num == "auto"){
									s = 0;
								}else{
									s = num.substring(0, numLength-2);
								}
								return(parseInt(s));
							}
							
							
							
							$j(".bcarousel-clip ul li").hover(function(){
								var indx = parseInt($j(this).index(this));
								// reserved for hovere fascility
								
							}, function(){
								var indx = $j(this).children("a");
									// reserved for hovere fascility
							});
							
							function showPos(posElems){
								var tracer = "";
								tracer += posElems
							
								$j("div#scrollpos").html(""+tracer+"");
							
							}
						};