function mycarousel_initCallback(carousel) {
	
	//alert(carousel.startAuto);
	// Pause autoscrolling if the user moves with the cursor over the clip.
    carousel.clip.hover(function() {
        carousel.stopAuto();
    }, function() {
        carousel.startAuto();
    });
	
	
    jQuery('.jcarousel-control a').bind('click', function() {
		
		//start entering the banner names here		
		var bannerNames = getBannerArray();
						
		var bannerLength = bannerNames.length;
				
		var bannerName = jQuery(this).text();
		
		var i = 0;
		
		var bannerNumber = 0;
		
		for(var i in bannerNames){
			if(bannerName == bannerNames[i]){	
				$('#banner_'+i).css('background','url(banner_selected.gif) 0 0 repeat-x');
				$('#banner_'+i).css('background-color','#57080c');
				$('#banner_'+i).css('color','#FFFFFF');
				$('#currentBanner').val(i);
				
				if(i == 0){
					$('#banner_'+i).css('-webkit-border-bottom-left-radius','100px');
					$('#banner_'+i).css('-moz-border-radius-bottomleft','20px');
					$('#banner_'+i).css('border-bottom-left-radius','20px');   

				}
				
				bannerNumber = parseInt(i)+1;
			}
			else{
				$('#banner_'+i).css('background','url(banner_selectedtest.gif) 0 0 repeat-x');
				$('#banner_'+i).css('-webkit-border-bottom-left-radius','0');
				$('#banner_'+i).css('-moz-border-radius-bottomleft','0');
				$('#banner_'+i).css('border-bottom-left-radius','0');
				$('#banner_'+i).css('color','#ffafaf');   
			}		
		}

        carousel.scroll(jQuery.jcarousel.intval(bannerNumber));
		carousel.stopAuto();
        return false;
    });

    jQuery('.jcarousel-scroll select').bind('change', function() {
        carousel.options.scroll = jQuery.jcarousel.intval(this.options[this.selectedIndex].value);
        return false;
    });

    jQuery('#mycarousel-next').bind('click', function() {
						
			var bannerNames = getBannerArray();
								
			var bannerLength = bannerNames.length;
						
			var currentBanner;
			
			currentBanner = $('#currentBanner').val();
			
			nextBanner = parseInt(currentBanner)+1;
		
			//if its not the last banner then style and change
			if(currentBanner != parseInt(bannerLength) - 1){
			
				styleBannerNav(currentBanner,nextBanner);
			
			}
		
        carousel.next();
		carousel.stopAuto();
        return false;
    });

    jQuery('#mycarousel-prev').bind('click', function() {
		
			var bannerNames = getBannerArray();
								
			var bannerLength = bannerNames.length;
						
			var currentBanner;
			
			currentBanner = $('#currentBanner').val();
			
			nextBanner = parseInt(currentBanner)-1;
		
			//if its not the last banner then style and change
			if(currentBanner != 0){
			
				styleBannerNav(currentBanner,nextBanner);
			
			}
		
        carousel.prev();
		carousel.stopAuto();
        return false;
    });
	


};


function getBannerArray(){

	var bannerNames = new Array();
			
	bannerNames[0] = "UB40 Love Songs";
	bannerNames[1] = "Exclusive Merchandise";
	bannerNames[2] = "Rat In Mi Kitchen Remix";
	bannerNames[3] = "Dub Sessions III";
	bannerNames[4] = "The Music";
	
	return bannerNames;
	
}

function styleBannerNav(currentBanner,nextBanner){

	$('#currentBanner').val(nextBanner);
	
	$('#banner_'+nextBanner).css('background','url(banner_selected.gif) 0 0 repeat-x');
	$('#banner_'+nextBanner).css('background-color','#57080c');
	$('#banner_'+nextBanner).css('color','#FFFFFF');
	
	if(nextBanner == 0){
		$('#banner_'+nextBanner).css('-webkit-border-bottom-left-radius','100px');
		$('#banner_'+nextBanner).css('-moz-border-radius-bottomleft','20px');
		$('#banner_'+nextBanner).css('border-bottom-left-radius','20px');   
	}
	
	$('#banner_'+currentBanner).css('background','url(banner_selectedtest.gif) 0 0 repeat-x');
	$('#banner_'+currentBanner).css('color','#ffafaf');
	
	if(currentBanner == 0){
		$('#banner_'+currentBanner).css('-webkit-border-bottom-left-radius','0');
		$('#banner_'+currentBanner).css('-moz-border-radius-bottomleft','0');
		$('#banner_'+currentBanner).css('border-bottom-left-radius','0');   
	}
	
}

