/* Lettering.JS 0.6 by Dave Rupert  - http://daverupert.com */
(function($){var methods={init:function(){return this.each(function(){return injector($(this),'','char','')})},words:function(){return this.each(function(){return injector($(this),' ','word',' ')})},lines:function(){return this.each(function(){var t=$(this),r="eefec303079ad17405c889e092e105b0";t.children("br").replaceWith(r);return injector(t,r,'line','')})}};function injector(t,splitter,klass,after){var a=t.text().split(splitter),inject='';if(a.length>0){$(a).each(function(i,item){inject+='<span class="'+klass+(i+1)+'">'+item+'</span>'+after});t.empty();t.append(inject)}}$.fn.lettering=function(method){if(methods[method]){return methods[method].apply(this,Array.prototype.slice.call(arguments,1))}else if(method=='letters'||!method){return methods.init.apply(this,arguments)}else{$.error('Method '+method+' does not exist on jQuery.lettering')}}})(jQuery);;
// Overrides default Views filter functionality by getting rid of
// the need to click the apply button after changing the select box item.
function init ($) {
	// Make sort & filter functionality work as intended
	$('.views-exposed-form select').change(
		function () {
			$('.views-exposed-form input[type="submit"]').click();
		}
	);
	
	// Code that listens to any DOM changes initiated by AJAX.
	$('.views-exposed-form').live('click', function(e) {
		init($);
	});
}

jQuery(document).ready(function($) {
	init($);
 $(document).ready(function() {
       $.getJSON("http://api.flickr.com/services/feeds/photos_public.gne?id=37803203@N04&format=json&jsoncallback=?", function(data) {
               var target = "#latest-flickr-images ul"; // Where is it going?
               for (i = 0; i <= 0; i = i + 1) { // Loop through the 10 most recent, [0-9]
                       var pic = data.items[i];
                       var liNumber = i + 1; // Add class to each LI (1-10)
                       $(target).append("<li class='flickr-image no-" + liNumber + "'><a title='" + pic.title + "' href='" + pic.link + "'><img src='" + pic.media.m + "' /></a></li>");
               }
               
                 $(".tk-lobster").lettering();

       });
});
});


;
(function($) {
	$.fn.slideshow = function(delay, duration) {
		var
			slide = this.find('.slide');
			i     = 0,
			j     = 0
			;

		this.css({ overflow: 'hidden', position: 'relative' });

		slide
			.css({ position: 'absolute' })
			.slice(0, 1)
			    .css({ zIndex: 5 })
			;
		slide
			.slice(1)
				.css({ opacity: 0 })
				.css({ zIndex: 1 })
			;

		function slide_to(change) {
			slide.eq(j = i).css({ zIndex: 1 });

			slide
				.eq(i = ( i + change + slide.size() ) % slide.size())
					.css({ zIndex: 5 })
					.animate({ opacity: 1 }, duration)
				;

			slide.eq(j)
				.animate({ opacity: 0 }, duration);
		}

		var timer = setInterval(function() { slide_to(+1); }, delay);

		$('.slideshow-navigation li:first-child a').click(function() { clearInterval(timer); slide_to(-1); return false; });
		$('.slideshow-navigation li:last-child  a').click(function() { clearInterval(timer); slide_to(+1); return false; });
	};
})(jQuery);

function initConsultationForm() {
	$('.consultation-form input[type="text"]').click(function () {
		this.select();
	});
}

;

