$(window).load(function ()
{
	$("#leader .scrollable").scrollable({ circular: true }).navigator(".navi").autoscroll(
	{
	    autoplay: true, 
    	api: true,
	    autopause: true,
	    autostop: true,
    	interval: 10000
	});

	if($("#sidecar").length > 0)
	{
		var headerimgOffset = $("#headerimg").offset();
		var sidecarOffset = $("#sidecar").offset();
		$("#sidecar").css("margin-left", (($("#sidecar").width()+sidecarOffset.left)*-1)+"px");
		$("#sidecar").css("margin-top", (headerimgOffset.top+(($("#headerimg").height()-$("#sidecar").height())/2)-sidecarOffset.top)+"px");
		//$("#sidecar").css("margin-top", headerimgOffset.top+"px");
		$("#sidecar").show();
		//$("#sidecar").css("margin-top", ($("#sidecar").width())*-1);
	}
});

$(document).ready(function()
{
	$("a[rel]").overlay(
		{
			top: "center",
			fixed: false,
			mask: {
					color: '#000000',
					loadSpeed: 200,
					opacity: 0.75					
				}
		}
	);
});
