$(function(){$('#contactform').slidinglabels({
/* these are all optional */
className    : 'form-slider', // the class you're wrapping the label & input with -> default = slider
topPosition  : '6px',  // how far down you want each label to start
leftPosition : '5px',  // how far left you want each label to start
axis:'x',    // can take 'x' or 'y' for slide direction
speed:'fast'  // can take 'fast', 'slow', or a numeric value
});	 
});

$(function(){
	$('img.captify').captify({
		speedOver: 'fast',
		speedOut: 'normal',
		hideDelay: 500,	
		// 'fade', 'slide', 'always-on'
		animation: 'slide',		
		// text/html to be placed at the beginning of every caption
		prefix: '',		
		opacity: '0.7',					
		className: 'caption-bottom',	
		position: 'bottom',
		spanWidth: '100%'
	});
});

var navController={
    current:Object, headNav:Object, navLink:Object, init:function(){
      	this.current=$("#navigator ul").attr("class");
		this.headNav=$("#navigator ul");
		this.navLink=$("#navigator ul li a");
		this.run()
	}, 
	
	run:function(){
		
     	// hovering over state
		this.navLink.hover(
			
			function(){
     			navController.headNav.removeClass().addClass($(this).attr("rel"))
			},
			
			function(){
     			navController.headNav.removeClass().addClass(navController.current)
			}
		);

		// on click state
		this.navLink.click(function(){
     		navController.headNav.removeClass().addClass($(this).attr("rel"))
		})
	}
},

portfolio=
{
     site:Object,large:Object,height:Number,init:function()
	{
     	this.site=$("#portfolio li:not(#portfolio li.large)");
		this.large.hover(function()
		{
     		portfolio.height=$(this).find(".descHolder").innerHeight();
			$(this).find(".description").stop(true,false).animate({height:portfolio.height},"slow","easeOutQuint")
		},function()
		{
     		$(this).find(".description").stop(true,false).animate({height:"34px"},"slow","easeInOutQuint")
		})
	}
};

function initialize(){
	navController.init();
	portfolio.init();
}

$(document).ready(function(){
	$('img#work0').hide().fadeIn('slow');
	$('img#work1').delay('300').hide().fadeIn('slow');
	$('img#work2').delay('600').hide().fadeIn('slow');
	$('img#work3').delay('900').hide().fadeIn('slow');
	$('img#work4').delay('1200').hide().fadeIn('slow');
	$('img#work5').delay('1500').hide().fadeIn('slow');
	
	$('.boxgrid.caption').hover(function(){
		$(".cover", this).stop().animate({top:'160px'},{queue:false,duration:160});
	}, function() {
	$(".cover", this).stop().animate({top:'190px'},{queue:false,duration:160});
	});
	
	initialize();
});
