$(document).ready(function(){
	$("div#show-more").click(function() {$("div#grey").slideToggle(function(){$("html, body").animate({ scrollTop: $("#grey").offset().top},'slow');});});
	$("ul.full-size-buttons li a").click(function() { $('ul.full-size li').hide(); var parentID = $(this).parent().attr('id'); $('ul.full-size li#'+ parentID).slideToggle(function(){$("html, body").animate({ scrollTop: $("section.work").offset().top},'slow');}); $('ul.full-size li#'+ parentID +' iframe').attr('src', $('ul.full-size li#'+ parentID +' iframe').attr('xsrc')); return false; });
	$("div.hero-container").easySlider({auto: false, continuous: true,controlsShow: true, numeric: true});
	$("section.vimeo div").easySlider({auto: false, continuous: true,controlsShow: true, prevId: 'prevVimeo', nextId: 'nextVimeo'});
	$("section.flickr div").easySlider({auto: false, continuous: true,controlsShow: true, prevId: 'prevFlickr', nextId: 'nextFlickr'});
	
	$("section.map div.pins a.pin").click(function(){
		var location = $(this).attr('data-location');
		var photo = $(this).attr('data-image');
		var content = $(this).attr('data-description');
		$('section.map div.info h4').html(location);
		$('section.map div.info img').attr('src', photo);
		$('section.map div.info p').remove(); $('section.map div.info').append(content);
		return false;
	});
	/* $("article.our-work nav.work-categories a").click(function(){var currentId = $(this).attr('id');$("article.our-work nav.work-categories a").removeClass('selected');$(this).addClass('selected');$("article.our-work ul.work li:not(#"+ currentId +")").fadeOut(500, function(){ $("article.our-work ul.work li#"+ currentId +"").fadeIn(500); });}); */
	$("article.our-work nav.work-categories a").click(function(){
		var currentId = $(this).attr('id'); 
		if($('#single-container').is(':visible')){
			$('article.our-work ul.work li:not([category="'+ currentId +'"])').hide();
			$('article.our-work ul.work li[category="'+ currentId +'"]').show();
			$("#single-container").slideUp('slow', function(){ $("ul.work").slideDown('slow'); }).empty();
			$("article.our-work nav.work-categories a").removeClass('selected');
			$(this).addClass('selected');
		} else {
			$('article.our-work ul.work li:not([category="'+ currentId +'"])').hide();
			$('article.our-work ul.work li[category="'+ currentId +'"]').show();
			$("article.our-work nav.work-categories a").removeClass('selected');
			$(this).addClass('selected');
		}
	});
	
	$("article.our-work ul.work li a").click(function (){ var pageToLoad = $(this).attr('href'); $('#single-container').load(pageToLoad, function(){ $('ul.work').hide(); }).delay(1000).show(); return false; });
});

function changeWorkCategory() { var getHash = window.location.hash; if (!getHash==""){ $("article.our-work nav.work-categories a").removeClass('selected'); $("article.our-work nav.work-categories a#"+ getHash +"").addClass('selected'); $("article.our-work ul.work li:not(#"+ getHash +")").fadeOut(500, function(){ $("article.our-work ul.work li#"+ getHash +"").fadeIn(500); }); } }


