$(document).ready(function(){
	
	//$('#contentWrapper').hide();
	if ( $.cookie('positionLeft') != null ) {
		$('#contentWrapper').css( { "left": ($.cookie('positionLeft')) + "px", "top":$.cookie('positionTop') + "px" } );
	}
	
	
	$('#mainNav ul li.active:has(ul)').find('a').eq(0).css('background','black');
	
	$('#linksTrigger').click(function() {
		$("#links").slideDown();
	});
	$('#links_close').click(function() {
		$("#links").slideUp();
	});
	
	/*
	$('#staffTrigger').click(function() {
		$("#contactBox").slideDown();
	});
	$('#staff_close').click(function() {
		$("#contactBox").slideUp();
	});
	*/
	
	
	$('.popup').fancybox({
		'overlayShow': true,
		'width' : '590',
		'height' : '390'
	});
	$('#contentWrapper').fadeIn();
	$('#content').jScrollPane({scrollbarWidth:10, scrollbarMargin:10, animateStep: 10, wheelSpeed: 10, showArrows: true });
	

	$('#contentWrapper').draggable({ 
		cursor: 'move',
		opacity: 0.7,
		cancel: "#content",
		stop: function(event) { 
			var pos = $('#contentWrapper').offset();  
			$.cookie('positionLeft', null);
			$.cookie('positionTop', null); 
			$.cookie('positionLeft', pos.left);
			$.cookie('positionTop', pos.top); 
			return true;
			
		}
	});

	//Tooltips
	$('#contentWrapperInner h1').wrap('<a class="tooltip" title="drag me"></a>');


}); //Close document.ready

$(window).bind("load", function() {
	 $('#loading').hide();								
	 $('#bg').fadeIn();
});



