
function showChicPick(chicPickDetailContainer, chicPickURL) {
	if (!chicPickURL) {return false;}
	//TODO: Display 'loading' animation here
	$(chicPickDetailContainer).children().fadeOut('normal');
	$.get(chicPickURL, function (data) {
		//TODO: Hide 'loading' animation here, attach image 'loading' animation if possible
		$(chicPickDetailContainer).html(data);
		$(chicPickDetailContainer).fadeIn('slow');
	});
}

// Bind to Chic Pick Carousel items for AJAX Load
$(document).ready( function () {
	$('.chic_pick_carousel_link').live('click',function () {
		showChicPick('#chic_pick_detail_content',$(this).attr('href'));
		window.location.hash = $(this).attr('rel');
		return false;
	});
	
	// Check for a hash.  If it exists, raise the click event corresponding to the deep-link
	if (window.location.hash) {
		var whichID = window.location.hash.replace('#','');
		$('a.chic_pick_carousel_link[rel=' + whichID + ']').click();
	} else {
		// There isn't a default item, find our hash from the sitewide container
		var currentCP = $("div#chic_pick_right_col a").attr('href').split('#')[1];
		$('a.chic_pick_carousel_link[rel=' + currentCP + ']').click();
	}
	
	// Initialize the chic pick carousel
	$('#chic_pick_carousel').sscarousel(5);	//Slides visible at a time (5)
});

