function swapWork(){
	id = $('#look .active').attr('id').split('-');
	newId = parseInt(id[1])+1;
	if (newId > 5){newId = 1;}
	$('#look #sample-'+newId).css('width','580px').show('slide',10,function(){
		$('#look .active').hide('slide',400, function(){
			$(this).removeClass('active');
			$('#look #sample-'+newId).addClass('active');
		});
	});		
	$('#learn #descriptions .active').removeClass('active').fadeOut(200,function(){
		$('#learn #descriptions #desc-'+newId).addClass('active').fadeIn(200);
	});
}

function cycle(startWidth){
	newId = $('.rotator .active').attr('id');
	newId = parseInt(newId)+1;
	if (newId > 5){newId = 1;}
	$('.rotator #'+newId).css('width',startWidth).css('z-index','4').show('slide',10,function(){
		$('.rotator .active').animate({ width:'0'},300,function(){
			$(this).removeClass('active');
			$('.rotator #'+newId).addClass('active').css('z-index','5');
		});
		
	});	
}


$(document).ready(function() { 
	$('#find ul li a').click(function() {
		//index = $(this).parent().attr('id');
		swapWork();
	});
	
	$('#inspiration .next').click(function() {
		cycle('290px');
		return false;
	});
	
	if (!$.browser.msie) { 
	$('.work .job').hover(
      function () {
        $(this).children('.wrapper').animate({marginTop:'0'},500,'easeOutQuad',function() {$(this).css('position', 'relative').css('left', 0).css('top', 0);});
  	  }, 
      function () {
        $(this).children('.wrapper').animate({marginTop:'156px'},200,'easeInQuad');
      }
    );}
	
	$('#info #contact form #c_email, #info #contact form #c_message').focus(function(){
		if ($(this).hasClass('changed')){}else{
			val = $(this).attr('value');
			$(this).attr('value','').addClass('active');
			$(this).change(function(){
				$(this).removeClass('active').addClass('changed');
			});
		}
	});
	$('#info #contact form #c_email, #info #contact form #c_message').blur(function(){
		$('#info #contact form .active').removeClass('active');
	});
	
		
});