$(document).ready(function() {
													 
	$('.ri').cycle('fade');
	
		
	// Navigation
	$('#nav > ul ul').hide();
	$('#nav > ul > li').mouseover(function(){ $(this).children('ul').show(); }).mouseout(function(){ $(this).children('ul').hide(); });	
	
	
	$("#nav ul li ul li").hover(function(){
	 $("img",this).addClass('nav-img-over');
	},function(){
	 $("#nav ul li ul li img").removeClass("nav-img-over");
	});
	
	
	
//	$("#nav ul li ul li a").hover(function(){
//	 $(this).prev().addClass('nav-img-over');
//	},function(){
//	 $("#nav ul li ul li img").removeClass("nav-img-over");
//	});
	
	


	// Sidebar
	$('#in-brief-content').hide();
	$('#recent-work-content').hide();
	
	$("#in-brief-link").toggle(
		function () {
			$('#in-brief-content').fadeIn(250);
		},
		function () {
			$('#in-brief-content').fadeOut(250);
		}		
	);
	
	$("#in-brief-content").click(function () {
		$("#in-brief-content").hide();
	});
		
	$("#recent-work-home-content").click(function () {
		$("#recent-work-home-content").hide();
	});
	
	$("#recent-work-content").click(function () {
		$("#recent-work-content").hide();
	});
	
	
	
	$("#recent-work-link").toggle(
		function () {
			$('#recent-work-content').fadeIn(250);
		},
		function () {
			$('#recent-work-content').fadeOut(250);
		}		
	);
	
	
	// set up rollover
	$("img.rollover").hover(
		function()
		{
			this.src = this.src.replace("-off","-hover");
		},
		function()
		{
			this.src = this.src.replace("-hover","-off");
		}
	);


	// set up rollover
	$("img.homerollover").hover(
		function()
		{
			this.src = this.src.replace("-0","-1");
		},
		function()
		{
			this.src = this.src.replace("-1","-0");
		}
	);


	
	
	$(".tweet").tweet({
			username: "orbitaldesign",
			join_text: "auto",
			count: 5,
			//avatar_size: 32,
			auto_join_text_default: " - we said,",
			auto_join_text_ed: "we",
			auto_join_text_ing: "we were",
			auto_join_text_reply: "we replied to",
			auto_join_text_url: "we were checking out",
			loading_text: "loading tweets..."
	});	
	
					
});