function brandBox(){
	var imageLength = 220;
	var selIamge = " ";//'<img class="selectedImage" src="/content/s2/images/2009-home/brandbox/brandBox_icon_sel.png"/>';//'<img class="selectedImage" src="/content/s2/images/2009-home/brandbox/brandBox_icon_sel.png"/>';
	var unselImage = " ";//'<img class="unselectedImage" src="/content/s2/images/2009-home/brandbox/brandBox_icon_unsel.png"/>';

	$(".brandBoxLeft").click(showPrevImage);
	$(".brandBoxRight").click(showNextImage);

	// add the position buttons to the bottom
	var counter = 1;
	$(".brandBoxImagesList li").each(function(){
		var target = $(this); // target.html() if you want to get some content out of it
		var elem = '<a href="#" class="png_bg" itemid="'+ counter +'">'+ selIamge +'</a> ';
		var linkElem = $(elem);

		linkElem.click(function(){
			showImage($(this).attr("itemid"));
			return false;
		});

		var listElem = $("<li/>").append(linkElem);
		$(".brandBoxLinkList").append(listElem);
		counter++;
	});

	$("#positionContainer > a:first").addClass("active");

	//number the imagesCount
	var counter = 1;
	var imagesCount = 0;
	$(".brandBoxImagesList li").each(function(){
		var target = $(this);
		target.attr("itemid", counter);
		counter++;
		imagesCount++;
	});

	var counter = 1;

	$(".brandBoxLinkContainer a").each(function(){
		var target = $(this);
		target.attr("itemid", counter);
		counter++;
	});

	// set the container width to match the images
	$(".brandBoxImagesList").css("width", (imagesCount*imageLength) +"px");

	//number the contents
	var counter = 1;
	$(".brandBoxOverayContentItem").each(function(){
		var target = $(this);
		target.attr("itemid", counter);
		var content = target.find(".heading").text();
		var tooltip = $('<div class="brandBoxToolTip" style="display:none"><div class="brandBoxToolTipContent png_bg"><div class="padding">' + content + '</div></div><div class="brandBoxToolTipFooter png_bg"> </div></div>');

		$('.brandBoxLinkList li a[itemid="'+ counter + '"]').append(tooltip);
		$('.brandBoxLinkList li a[itemid="'+ counter + '"]').hover(showToolTip,hideToolTip);

		function showToolTip(){
			$(this).children(".brandBoxToolTip").fadeIn(50);
		}
		function hideToolTip(){
			$(this).children(".brandBoxToolTip").fadeOut(50);
		}

		counter++;
	});

	var currentImage = 0;
	var prevImage = 0;

	function showImage(itemid){
		$('.brandBoxLinkContainer a[itemid="'+ prevImage + '"]').css("display","none");
		$('.brandBoxLinkContainer a[itemid="'+ itemid + '"]').css("display","block");
		$('.brandBoxOverayContentItem[itemid="'+ prevImage + '"]').fadeOut(500,function(){																				
			$('.brandBoxOverayContentItem[itemid="'+ itemid + '"]').fadeIn(500);
		});
	
		currentImage = itemid;
		prevImage = currentImage;
	
		$(".brandBoxImagesScroller").animate({ 
			left: 0 - ( (itemid-1) * imageLength)
		}, 1500 );	
	
		// updates active sign
		$(".brandBoxLinkList  a").each(function(){
			if($(this).attr("itemid") != itemid){
				$(this).removeClass("selected");
				$(this).addClass("unselected");
				$(this).find("img").each(function(){
					$(this).css("display","none");
				});
				//$(this).attr("class","unselected");
			}else{
				$(this).removeClass("unselected");
				$(this).addClass("selected");
				$(this).find("img").each(function(){
					$(this).css("display","block");
				});
			}
		}); 
	
		return false;
	}

	function showNextImage(){
		currentImage++;
		if(currentImage > imagesCount){
			currentImage = 1;
		}			
		showImage(currentImage);
		return false;
	}
	
	function showPrevImage(){
		currentImage--;
		if(currentImage < 1){
			currentImage = imagesCount;
		}			
		showImage(currentImage);
		return false;
	}
	$("#scroller").css("left","1000px");
	showImage(1);

	/* disable timers */
	$(".brandBox").hover(disableBrandTimer,enableBrandTimer);
	
	function timerToNext(){
		currentImage++;
		if(currentImage > imagesCount){
			currentImage = 1;
		}			
		showImage(currentImage);
	}

	function disableBrandTimer(){
		$(document).stopTime("brandtimer");
	}
	
	function enableBrandTimer(){
		$(document).everyTime(6000, "brandtimer",timerToNext);
	}
	$(document).everyTime(6000, "brandtimer",timerToNext);
	
	//createBrandBoxGoogleTrackings();
}
