﻿$.fn.cycle.transitions.scrollUpDownFade = function($cont, $slides, opts) {
	$cont.css('overflow', 'hidden');
	opts.before.push($.fn.cycle.commonReset);
	var h = $cont.height();
	opts.cssBefore = { top: h, left: 0 };
	opts.cssFirst = { top: 0 };
	opts.animIn = { top: 0 };
	opts.animOut = { opacity: 0, top: h };
};

$(document).ready(function() {
	Cufon.replace('h1', { fontFamily: 'Gotham Medium' });
	Cufon.replace('h2', { fontFamily: 'Gotham Light' });
	$('#header').cycle({
		fx: 'scrollUpDownFade',
		timeout: 6000,
		delay: -2000,
		cleartype: 1,
		cleartypeNoBg: true,
		random: true
	});
	$('#highlight_teasers').cycle({
		fx: 'fade',
		timeout: 6000,
		cleartype: 1,
		cleartypeNoBg: true,
		random: true
	});
	$(window).bind("resize", function() {
		$('#page_curl').toggle($(this).width() >= 1200);
	}).trigger("resize");

});

/*
* Copyright (C) 2009 Joel Sutherland.
* Liscenced under the MIT liscense
*/
(function($) {
	$.fn.filterable = function(settings) {
	settings = $.extend({
		useHash: true,
		animationSpeed: 1000,
		show: {
			width: 'show',
			opacity: 'show'
		},
		hide: {
			width: 'hide',
			opacity: 'hide'
		},
		useTags: true,
		tagSelector: '#references_filter a',
		selectedTagClass: 'current',
		allTag: 'all'
	}, settings); 
	return $(this).each(function() { $(this).bind("filter", function(e, tagToShow) { if (settings.useTags) { $(settings.tagSelector).removeClass(settings.selectedTagClass); $(settings.tagSelector + '[href=' + tagToShow + ']').addClass(settings.selectedTagClass) } $(this).trigger("filterportfolio", [tagToShow.substr(1)]) }); $(this).bind("filterportfolio", function(e, classToShow) { if (classToShow == settings.allTag) { $(this).trigger("show") } else { $(this).trigger("show", ['.' + classToShow]); $(this).trigger("hide", [':not(.' + classToShow + ')']) } if (settings.useHash) { location.hash = '#' + classToShow } }); $(this).bind("show", function(e, selectorToShow) { $(this).children(selectorToShow).animate(settings.show, settings.animationSpeed) }); $(this).bind("hide", function(e, selectorToHide) { $(this).children(selectorToHide).animate(settings.hide, settings.animationSpeed) }); if (settings.useHash) { if (location.hash != '') $(this).trigger("filter", [location.hash]); else $(this).trigger("filter", ['#' + settings.allTag]) } if (settings.useTags) { $(settings.tagSelector).click(function() { $('#references_list').trigger("filter", [$(this).attr('href')]); $(settings.tagSelector).removeClass('current'); $(this).addClass('current') }) } }) } })(jQuery); $(document).ready(function() { $('#references_list').filterable() });