﻿	Cufon.replace('h2');
	Cufon.replace('h4');
	Cufon.replace('h5');
	Cufon.replace('p.intro');
	Cufon.replace('#banner p.sub-intro');
	Cufon.replace('.back-button a, .button');
	Cufon.replace('.back a');
	Cufon.replace('#main-add .tel');
	Cufon.replace('body#Work .work li p.action a');
	Cufon.replace('.back a, .prev a, .next a, .more a, #content-secondary dl dd.text, .case-study .actions .no');
	Cufon.replace('.work li p.meta-data .desc');
	Cufon.replace('ul.team li p .name');
	Cufon.replace('#primary-nav li, h3', {
		hover: true
    });
    Cufon.replace('#Home #content-primary p.intro');
    Cufon.replace('#Services .services > li', {
        hover: true,
        hoverables: { li: true, h3: true },
        ignore: { p: true },
        textless: { li: true }
    });
	Cufon.replace('.more a, #main-add .map, #main-add .email', {
		hover: true
	});

	$(document).ready(function () {
	    $("#Services #main-img img").hide();
	    $("#Services #main-img img").fadeIn(2000);
	    //$(".shard").fadeIn(3000);


	    // Greyscale hover effect 
	    $("ul.work li").hover(function () { //On hover...

	        var thumbOver = $(this).find("img").attr("src"); //Get image url and assign it to 'thumbOver'

	        //Set a background image(thumbOver) on the <a> tag - Set position to bottom
	        $(this).find("a.img").css({ 'background': 'url(' + thumbOver + ') no-repeat center bottom' });

	        //Animate the image to 0 opacity (fade it out)
	        $(this).find("a.img span.wrap").stop().fadeTo('normal', 0, function () {
	            $(this).hide() //Hide the image after fade
	        });
	    }, function () { //on hover out...
	        //Fade the image to full opacity 
	        $(this).find("a.img span.wrap").stop().fadeTo('normal', 1).show();
	    });

	    //About us team hover effect
	    $('ul.team li').hover(function () {
	        $(this).find('p').animate({ top: '0' }, { queue: false, duration: 500 });
	    }, function () {
	        $(this).find('p').animate({ top: '-161px' }, { queue: false, duration: 500 });
	    });

	    //Grey to blue colour animation
	    $(".back-button a, a.button").hover(function () {
	        $(this).stop().animate({ backgroundColor: "#00aeef" }, 800);
	    }, function () {
	        $(this).stop().animate({ backgroundColor: "#474747" }, 800);
	    });

	    //Lavalamp menu effect
	    $("#primary-nav").lavaLamp({ fx: "swing", speed: 400 });

	    // Background colour blend effect 
	    $('p.cta a, ul.team li.action a, a.twitter:not(ul.team li p a.twitter), a.flickr, a.linkedin:not(ul.team li p a.linkedin), a.facebook, .social-media li a, .map a, .vcard a.email, p.cta.launch a').append('<span class="hover"></span>')

	    $('.social-media li a .hover').css('opacity', 0);

	    $('p.cta a, ul.team li.action a, a.twitter:not(ul.team li p a.twitter), a.flickr, a.linkedin:not(ul.team li p a.linkedin), a.facebook, .social-media li a, .map a, .vcard a.email, p.cta.launch a').hover(function () {

	        // Stuff that happens when you hover on + the stop()
	        $('.hover', this).stop().animate({
	            'opacity': 1
	        }, 700, 'easeOutSine')

	    }, function () {

	        // Stuff that happens when you unhover + the stop()
	        $('.hover', this).stop().animate({
	            'opacity': 0
	        }, 500, 'easeOutExpo')

	    });

	    //Flickr plugin
	    $('ul#flickr').jflickrfeed({
	        feedapi: 'photoset.gne',
	        limit: 3,
	        qstrings: {
	            set: '72157624324626128',
	            nsid: '40436067@N02'
	        },
	        itemTemplate: '<li><a href="http://www.flickr.com/photos/volumegroup/collections/72157627557921883/" target="_blank"><img alt="{{title}}" src="{{image_s}}" /></a></li>'
	    });

	});
