$(window).load(function() {
	// Init Smooth Div Scroll	
	$("div#makeMeScrollable").smoothDivScroll({ autoScroll: "always", 
												autoScrollDirection: "endlessloopright",
												autoScrollStep: 2,
												autoScrollInterval: 35 });

	// Init colorbox
	$("div#makeMeScrollable a").colorbox({ speed: "500" });

	// Pause autoscrolling if the user clicks one of the images
	$("div#makeMeScrollable").bind("click", function() {
		$(this).smoothDivScroll("stopAutoScroll");
	});

	// Start autoscrolling again when the user closes
	// the colorbox overlay
	$(document).bind('cbox_closed', function(){
		$("div#makeMeScrollable").smoothDivScroll("startAutoScroll");
	});

});

$(document).ready(function(){
	//Examples of how to assign the ColorBox event to elements
	$("a[rel='example1']").colorbox();

	//Example of preserving a JavaScript event for inline calls.
	$("#click").click(function(){ 
		$('#click').css({"background-color":"#f00", "color":"#fff", "cursor":"inherit"}).text("Open this window again and this message will still be here.");
		return false;
	});
});
