var peopleData = {};
var personData = {};
var peopleNames = [];
var peopleIds = [];
var id;
var comboboxOutput = '';

function loadPeople()
{
	jQuery.ajax({
		url: "http://www.dentsulondon.com/blog/wp-content/themes/dentsulondon.v.2.0-thematic/xml/people.xml",
		dataType: "xml",
		success: parsePeopleData
	});
}

function parsePeopleData( xmlResponse ) {
	comboboxOutput = '<select name="people-dropdown" onchange="selectPerson(this.options[this.selectedIndex].value);" style="width: 200px; ">';
	comboboxOutput += '<option value="">Search people</option>'; 	
		
	jQuery(xmlResponse).find("person").each(function(){
		personData = {};
		personData.id = jQuery(this).attr("id");
		personData.name = jQuery(this).attr("name").toUpperCase();
		personData.src = "http://www.dentsulondon.com/images/people/" + jQuery(this).attr("src");

	    var newSrc = jQuery(this).attr("src").split(".gif")[0] + "_over.gif";

		personData.srcOver = "http://www.dentsulondon.com/images/people/" + newSrc;
		
		personData.ext = jQuery(this).attr("ext");
		personData.position = jQuery(this).attr("position");

		peopleData[jQuery(this).attr("id")] = personData;

		peopleNames.push(jQuery(this).attr("name").toUpperCase());
		peopleIds.push(jQuery(this).attr("id"));
		
		comboboxOutput += '<option value="' + jQuery(this).attr("id") + '">' + jQuery(this).attr("name") + '</option>';
	});
	
	comboboxOutput += '</select>';
	
	jQuery('#people-form').html(comboboxOutput);
	
	peopleNames.sort();
	
	splitLocation();
}



function getUrlVars()
{
    var vars = [], hash;
    var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
    for(var i = 0; i < hashes.length; i++)
    {
        hash = hashes[i].split('=');
        vars.push(hash[0]);
        vars[hash[0]] = hash[1];
    }
    return vars;
}

function splitLocation()
{
	var loc = window.location.href;
	var locSplit = loc.split("/");
	var locLength = locSplit.length - 2;
	
	if (locSplit[locLength] != "people") {
		id = locSplit[locLength];
	} else {
		id = null;
	}
	
	if (id != null) {
		showBio(id);
	}
}

function selectPerson(selectedName) {
	console.log('selectPerson: ' + selectedName)
	
	var i = 0;
	for (i = 0; i < peopleIds.length; i++)
	{
		if(peopleIds[i] == selectedName)
		{
			jQuery.scrollTo('#' + selectedName);
			
			deselectEveryoneExcept(peopleIds[i])
			makeAllPeopleUnclickable();

			jQuery("#bio").hide();

			switch(peopleIds[i])
			{
				case "simonnorth":
					jQuery("#bio").html("<h2>SIMON NORTH</h2><p>Chief Executive<br/>Tel ext. 9007</p><p>Simon was an army officer for six years during which time he was decorated twice for gallantry whilst under enemy fire.</p><p>Not content with what should have been quite enough excitement for one lifetime, Simon embarked upon a career in advertising, joining CDP in 1991 as an Account Executive and working his way up to MD in 2001 and CEO in 2005.</p><p>During his time in advertising Simon has worked across a plethora of brands in almost every industry sector, including retail, entertainment, automotives, charity and travel, and has been involved in award-winning campaigns for Hovis, Agent Provocateur, Hamlet, Canon, Becks beer, Isle of Jura Malt Whisky and National Express Railways.</p>");
					//Cufon.replace('#bio h2');
					jQuery("#bio").fadeIn(1000);
					break;
					
				case "idarezvani":
					jQuery("#bio").html("<h2>IDA REZVANI</h2><p>Managing Director<br/>Tel ext. 9012</p><p>Ida moved to Dentsu London in 2010. Prior to this she was at RKCR/Y&R where she worked on COI vehicle Crime Reduction, Virgin Trains, Marks & Spencer (This isn't just food, and Twiggy and friends campaigns), M&S Money, ghd and Visit London. She joined as a graduate in 2000 and was promoted to Head of Account Management and then to Deputy MD in 2009.</p><p>At Dentsu London Ida is responsible for the day to day running and future development of the agency as well as looking after clients such as Uniqlo and the greentomatogroup.</p><p>Ida swapped traditional advertising and her Blackberry for a more diverse approach to communications and an iPhone. She's particularly interested in the clashes possible between analogue and digital, old and new media, and unusual collaborations. Examples of this include Moving Wallpaper, Melody Road and the Canon Pixma Sound Sculptures.</p><p>Ida set up mentoring partnerships between RKCR/Y&R and local Camden schools, has chaired and tutored IPA 1 & 2 and has been part of the selecting committee for the WPP Fellowship.</p>");
					//Cufon.replace('#bio h2');
					jQuery("#bio").fadeIn(1000);
					break;

				case "beekernortham":
					jQuery("#bio").html("<h2>BEEKER NORTHAM</h2><p>Executive Strategy Director<br/>Tel ext. 9015</p><p>At Dentsu London Beeker looks after creative strategy for the agency and its clients, including Uniqlo, greentomatocars and Nintendo.</p><p>Previously Beeker led the communications strategy for Toyota, Google and Reebok at glue London, including the launch of the iQ, Google’s Chrome browser, and the pan-European repositioning of Reebok. Before that, she worked on NPD and design at Bloom, with Mr & Mrs Smith, Cadbury and Diageo.</p><p>Beeker is most interested in finding new models for communications, and in prioritising the magical and the human in the process. Examples include iPad Light Painting, Moving Wallpaper and the Canon PIXMA Sound Sculptures.</p><p>She has spoken at PSFK, Interesting, OFFF, CAT London, the IPA and Papercamp, and writes for various on and offline publications and at http://beeker.typepad.com </p><p>Beeker is named after the muppet.</p>");
					//Cufon.replace('#bio h2');
					jQuery("#bio").fadeIn(1000);
					break;

				case "chrisheathcote":
					jQuery("#bio").html("<h2>CHRIS HEATHCOTE</h2><p>Creative Technologist<br/>Tel ext. 9079</p><p>Chris left the world of robotic engineering when he got his first Internet connection in 1995.</p><p>He worked at Syzygy and Head New Media defining web experiences for Cartoon Network, Unilever, Vauxhall and startups, and helped create Crooked Tongues, the original online sneaker store and community.v<p>He's been part of the mobile revolution for the last 8 years as a customer experience manager at Orange and head of service & UI portfolio at Nokia Design. His designs and concepts have been used by tens of millions of people around the world and was a key member of the NFC RFID specification team.</p><p>Now mobiles are ubiquitous, he's interested in how technology and the Internet changes cities and influence behaviour - from urban screens and physical computing to 3d printing and synthetic biology. He's spoken at SXSWi, Reboot, LIFT, MIT Emerging Technology and Interesting.</p><p>At Dentsu London Chris infuses human and humane uses of technology into our work and partnerships.</p>");
					//Cufon.replace('#bio h2');
					jQuery("#bio").fadeIn(1000);
					break;

				case "pauljordan":
					jQuery("#bio").html("<h2>PAUL JORDAN</h2><p>Executive Creative Director<br/>Tel ext. 9096</p><p>Paul looks after the creative output of the agency. He works across all clients with Angus Macadam his creative partner. They’ve been a creative team for the past 13 years.</p><p>Paul took an unconventional route into advertising and this has informed his creative approach ever since. Whether it’s working on the world’s first TV ad shot on a mobile phone (COI), writing for the hour-long Sky TV show about Cesc Fabregas (Nike), or putting on a photographic exhibition with David Bailey (Nokia).</p><p>Before joining Dentsu London, Paul & Angus spent four years at W+ K London. There he was a Creative Director on Nokia, the COI and Yahoo! Before this Paul worked at AMV BBDO where he made Guinness “Tipping Point” and looked after the COI business. Paul and Angus have won several awards including four D&AD yellow pencils and three Cannes Gold Lions.</p><p>Paul loves his wife, three kids, eating cake and running. In that order.</p>");
					//Cufon.replace('#bio h2');
					jQuery("#bio").fadeIn(1000);
					break;

				case "angusmacadam":
					jQuery("#bio").html("<h2>ANGUS MACADAM</h2><p>Executive Creative Director<br/>Tel ext. 9097</p><p>Angus works with Paul, overseeing creative for the agency and all its clients. Before joining Dentsu, London, Angus and Paul previously spent four years as Creative Directors at Wieden+Kennedy, London. As well as looking after COI, Yahoo! and parts of the Nokia business, they also worked on Nike and Honda.</p><p>At previous agencies AMV BBDO and Leo Burnett they worked on Guinness, Road Safety campaigns for COI and Beck’s beer.</p><p>As a team, they believe in working closely with clients to explore new ways of approaching work. Some of the projects Angus is most proud of working on include a TV show for Nike, a Southbank auction of children’s art for The National Association of Children’s Hospices and creating the first TV ad shot entirely on a mobile phone for the COI.</p>");
					//Cufon.replace('#bio h2');
					jQuery("#bio").fadeIn(1000);
					break;
			}

			return;
		}
	}
}


jQuery(document).ready(function ($){
	
	if($('body').hasClass('page-id-2979')) {
		$('#container').append('<div class="icon-bio ida"></div><div class="icon-bio beeker"></div><div class="icon-bio paul"></div><div class="icon-bio angus"></div><div class="icon-bio simon"></div><div class="icon-bio chris"></div>');
	}
	
	makeAllPeopleClickable();
	
	jQuery('.display_archive .campaign').each(function(){
		
		var date = $(this).text().slice(0, 10);
		var url = jQuery(this).find('a').attr('href');
		jQuery(this).empty();
		jQuery(this).append('<a href="' + url + "&iframe=true" + '" rel="prettyPhoto[iframes]" target="_blank">' + date + '</a>')
	});
	
	jQuery('[name="archive-dropdown"]').css('width', '200px');

	jQuery('img#wallpaper-2').hover(function() {
		jQuery(this).attr("src","http://www.dentsulondon.com/blog/wp-content/uploads/2011/02/wallpapper_blog_demo_state1_over.jpg");
			}, function() {
		jQuery(this).attr("src","http://www.dentsulondon.com/blog/wp-content/uploads/2011/02/wallpapper_blog_demo_state1.jpg");
	});
	
	//ipad and iphone fix
	if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)) || (navigator.userAgent.match(/iPad/i))) {
	    jQuery('img#wallpaper-2').click(function(){
	       	jQuery(this).attr("src","http://www.dentsulondon.com/blog/wp-content/uploads/2011/02/wallpapper_blog_demo_state1_over.jpg");
				}, function() {
			jQuery(this).attr("src","http://www.dentsulondon.com/blog/wp-content/uploads/2011/02/wallpapper_blog_demo_state1.jpg");
	    });
	}
	
	if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)) || (navigator.userAgent.match(/iPad/i))) {
	    jQuery('img#wallpaper-2').bind('touchstart', function(){
	        jQuery(this).attr("src","http://www.dentsulondon.com/blog/wp-content/uploads/2011/02/wallpapper_blog_demo_state1_over.jpg");
	    });
	    jQuery('img#wallpaper-2').bind('touchend', function(){
	        jQuery(this).attr("src","http://www.dentsulondon.com/blog/wp-content/uploads/2011/02/wallpapper_blog_demo_state1.jpg");
	    });
	}
		
	jQuery("#newsletter-submit").click(submitForm);
	jQuery("#newsletterform").submit(submitForm);
	
	$("#email-input").keyup(function(event){
	  if(event.keyCode == 13){
		submitForm();
	  }
	});
	
	setupCufon();
	
	loadPeople();

	$(function(){
		var slides = [];
		
		$('#slides').slides({
			preload: true,
			slidesLoaded: function() {
				$('.slide').each(function (i) {
					slides[i] = $(this).html();
				});
			},
			animationComplete: function(e) {
				$('.slide').each(function (i) {
					if ((i + 1) != e) {
						$(this).delay(50).html('');
						$(this).delay(100).html(slides[i]);
					} 
				});
			}
		});
	});
});

function toggleStatus(element_id)
{
    if (jQuery(element_id).is(':checked')) {
        jQuery('#' + element_id + ' :input').attr('disabled', true);
    } else {
        jQuery('#' + element_id + ' :input').removeAttr('disabled');
    }   
}

function deselectEveryoneExcept(name)
{
	var i = 0;
	for (i = 0; i < peopleIds.length; i++)
	{
		if(peopleIds[i] != name)
		{
			jQuery("#" + peopleIds[i]).attr("src", peopleData[peopleIds[i]].srcOver);
		}
		else
		{
			jQuery("#" + peopleIds[i]).attr("src", peopleData[peopleIds[i]].src);
		}
	}
	
	jQuery('.icon-bio').hide(500);
}

function restoreEveryone(){
	jQuery("#bio").fadeOut(500);
	
	var i = 0;
	for (i = 0; i < peopleIds.length; i++)
	{
	    jQuery("#" + peopleIds[i]).attr("src", peopleData[peopleIds[i]].src);
	}
	
	jQuery('[name="people-dropdown"]')[0].selectedIndex = 0;
	
	jQuery('.icon-bio').show(500);
	
	makeAllPeopleClickable();
}

function makeAllPeopleClickable()
{
	jQuery('#people').find("img").hover(function() {
		jQuery("#bio").hide();
		if(jQuery(this).attr("id") == "simonnorth" || jQuery(this).attr("id") == "idarezvani" || jQuery(this).attr("id") == "beekernortham" || jQuery(this).attr("id") == "chrisheathcote" || jQuery(this).attr("id") == "pauljordan" || jQuery(this).attr("id") == "angusmacadam")
		{
			jQuery("#bio").html("<h2>" + peopleData[jQuery(this).attr("id")].name + "</h2><p>" + peopleData[jQuery(this).attr("id")].position + "<br/>Tel ext. " + peopleData[jQuery(this).attr("id")].ext + "</p><p><span class='cufonme'>Click for bio</strong></p>");
			jQuery(this).css("cursor", "pointer");
		}
		else
		{
			if(peopleData[jQuery(this).attr("id")].ext == "" || peopleData[jQuery(this).attr("id")].ext == undefined)
			{
				jQuery("#bio").html("<h2>" + peopleData[jQuery(this).attr("id")].name + "</h2><p>" + peopleData[jQuery(this).attr("id")].position + "</p>");
				
			}
			else
			{
				jQuery("#bio").html("<h2>" + peopleData[jQuery(this).attr("id")].name + "</h2><p>" + peopleData[jQuery(this).attr("id")].position + "<br/>Tel ext. " + peopleData[jQuery(this).attr("id")].ext + "</p>");
			}
		}
		
		//Cufon.replace('#bio h2');
		var pos = jQuery(this).position();
		jQuery("#bio").css("top", (pos.top + 18));
		jQuery("#bio").show();
	}, function() {
    	jQuery("#bio").hide();
		jQuery(this).css("cursor", "default");
	});
	
	jQuery('#people').find("img").click(function() {
		if(jQuery(this).attr("id") == "simonnorth" || jQuery(this).attr("id") == "idarezvani" || jQuery(this).attr("id") == "beekernortham" || jQuery(this).attr("id") == "chrisheathcote" || jQuery(this).attr("id") == "pauljordan" || jQuery(this).attr("id") == "angusmacadam")
		{
			jQuery("#bio").html("<h2>" + peopleData[jQuery(this).attr("id")].name + "</h2><p>" + peopleData[jQuery(this).attr("id")].position + "<br/>Tel ext. " + peopleData[jQuery(this).attr("id")].ext + "</p>");
			setupCufon();
		}
	});
	
	jQuery("#simonnorth").click(function(){
		showBio('simonnorth');
	});
	
	jQuery("#idarezvani").click(function(){
		showBio('idarezvani');
	});
	
	jQuery("#beekernortham").click(function(){
		showBio('beekernortham');
	});
	
	jQuery("#chrisheathcote").click(function(){
		showBio('chrisheathcote');
	});

	jQuery("#pauljordan").click(function(){
		showBio('pauljordan');
	});

	jQuery("#angusmacadam").click(function(){
		showBio('angusmacadam');
	});
	
	jQuery("#close-button").unbind();
	jQuery('#close-button').hide();
	jQuery("#close-button").remove();
	jQuery('#people-names').val("");
}

function makeAllPeopleUnclickable()
{
	jQuery('#people').find("img").unbind('mouseenter').unbind('mouseleave');
	
	if(!jQuery('#close-button').length)
	{
		jQuery('.entry-title').append("<div id='close-button'>SHOW ALL</div>");
		//Cufon.replace('#close-button');
	}
	
	jQuery("#close-button").click(restoreEveryone);
}

function submitForm(){
	var isValidEmail = false;
	var email = jQuery('#email-input').val();
	
	jQuery("#newsletterform_reply").css("display","block");
	
	var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
	
   	if(reg.test(email) == false) {
      	isValidEmail = false;
   	}
	else
	{
		isValidEmail = true;
	}
	
	if(isValidEmail)
	{
		jQuery("#newsletterform").hide();
		
		var dataString = 'emailinput='+ email;  
		jQuery.ajax({  
		  type: "POST",  
		  url: "http://www.dentsulondon.com/blog/wp-content/themes/dentsulondon.v.2.0-thematic/php/process.php",  
		  data: dataString,  
		  success: function() {  
			jQuery("#message").html("<br/><br/>Thanks for subscribing!");
		  }
		});
	}
	else
	{
		jQuery("#message").html("<br/><br/><span style='color:#CC0000;'>Please enter a valid email address!</span>");
		//jQuery("#newsletterform").delay(2000).show();
	}
	
	return false;  
}

function changeBackground(currentPage)
{
	jQuery('#wrapper').css('background-image', 'url(' + currentPage + ')');
}

function showBio(name)
{
	switch(name)
	{
		case "simonnorth":
			jQuery("#bio").hide();
			jQuery("#bio").html("<h2>SIMON NORTH</h2><p>Chief Executive<br/>Tel ext. 9007</p><p>Simon was an army officer for six years during which time he was decorated twice for gallantry whilst under enemy fire.</p><p>Not content with what should have been quite enough excitement for one lifetime, Simon embarked upon a career in advertising, joining CDP in 1991 as an Account Executive and working his way up to MD in 2001 and CEO in 2005.</p><p>During his time in advertising Simon has worked across a plethora of brands in almost every industry sector, including retail, entertainment, automotives, charity and travel, and has been involved in award-winning campaigns for Hovis, Agent Provocateur, Hamlet, Canon, Becks beer, Isle of Jura Malt Whisky and National Express Railways.</p>");
			//Cufon.replace('#bio h2');
			jQuery("#bio").fadeIn(1000);

			deselectEveryoneExcept("simonnorth");
			makeAllPeopleUnclickable();
			break;
			
		case "idarezvani":
			jQuery("#bio").hide();
			jQuery("#bio").html("<h2>IDA REZVANI</h2><p>Managing Director<br/>Tel ext. 9012</p><p>Ida moved to Dentsu London in 2010. Prior to this she was at RKCR/Y&R where she worked on COI vehicle Crime Reduction, Virgin Trains, Marks & Spencer (This isn't just food, and Twiggy and friends campaigns), M&S Money, ghd and Visit London. She joined as a graduate in 2000 and was promoted to Head of Account Management and then to Deputy MD in 2009.</p><p>At Dentsu London Ida is responsible for the day to day running and future development of the agency as well as looking after clients such as Uniqlo and the greentomatogroup.</p><p>Ida swapped traditional advertising and her Blackberry for a more diverse approach to communications and an iPhone. She's particularly interested in the clashes possible between analogue and digital, old and new media, and unusual collaborations. Examples of this include Moving Wallpaper, Melody Road and the Canon Pixma Sound Sculptures.</p><p>Ida set up mentoring partnerships between RKCR/Y&R and local Camden schools, has chaired and tutored IPA 1 & 2 and has been part of the selecting committee for the WPP Fellowship.</p>");
			//Cufon.replace('#bio h2');
			jQuery("#bio").fadeIn(1000);

			deselectEveryoneExcept("idarezvani")
			makeAllPeopleUnclickable();
			break;

		case "beekernortham":
			jQuery("#bio").hide();
			jQuery("#bio").html("<h2>BEEKER NORTHAM</h2><p>Executive Strategy Director<br/>Tel ext. 9015</p><p>At Dentsu London Beeker looks after creative strategy for the agency and its clients, including Uniqlo, greentomatocars and Nintendo.</p><p>Previously Beeker led the communications strategy for Toyota, Google and Reebok at glue London, including the launch of the iQ, Google’s Chrome browser, and the pan-European repositioning of Reebok. Before that, she worked on NPD and design at Bloom, with Mr & Mrs Smith, Cadbury and Diageo.</p><p>Beeker is most interested in finding new models for communications, and in prioritising the magical and the human in the process. Examples include iPad Light Painting, Moving Wallpaper and the Canon PIXMA Sound Sculptures.</p><p>She has spoken at PSFK, Interesting, OFFF, CAT London, the IPA and Papercamp, and writes for various on and offline publications and at http://beeker.typepad.com </p><p>Beeker is named after the muppet.</p>");
			//Cufon.replace('#bio h2');
			jQuery("#bio").fadeIn(1000);

			deselectEveryoneExcept("beekernortham")
			makeAllPeopleUnclickable();
			break;

		case "chrisheathcote":
			jQuery("#bio").hide();
			jQuery("#bio").html("<h2>CHRIS HEATHCOTE</h2><p>Creative Technologist<br/>Tel ext. 9079</p><p>Chris left the world of robotic engineering when he got his first Internet connection in 1995.</p><p>He worked at Syzygy and Head New Media defining web experiences for Cartoon Network, Unilever, Vauxhall and startups, and helped create Crooked Tongues, the original online sneaker store and community.</p><p>He's been part of the mobile revolution for the last 8 years as a customer experience manager at Orange and head of service & UI portfolio at Nokia Design. His designs and concepts have been used by tens of millions of people around the world and was a key member of the NFC RFID specification team.</p><p>Now mobiles are ubiquitous, he's interested in how technology and the Internet changes cities and influence behaviour - from urban screens and physical computing to 3d printing and synthetic biology. He's spoken at SXSWi, Reboot, LIFT, MIT Emerging Technology and Interesting.</p><p>At Dentsu London Chris infuses human and humane uses of technology into our work and partnerships.</p>");
			//Cufon.replace('#bio h2');
			jQuery("#bio").fadeIn(1000);

			deselectEveryoneExcept("chrisheathcote")
			makeAllPeopleUnclickable();
			break;

		case "pauljordan":
			jQuery("#bio").hide();
			jQuery("#bio").html("<h2>PAUL JORDAN</h2><p>Executive Creative Director<br/>Tel ext. 9096</p><p>Paul looks after the creative output of the agency. He works across all clients with Angus Macadam his creative partner. They’ve been a creative team for the past 13 years.</p><p>Paul took an unconventional route into advertising and this has informed his creative approach ever since. Whether it’s working on the world’s first TV ad shot on a mobile phone (COI), writing for the hour-long Sky TV show about Cesc Fabregas (Nike), or putting on a photographic exhibition with David Bailey (Nokia).</p><p>Before joining Dentsu London, Paul & Angus spent four years at W+ K London. There he was a Creative Director on Nokia, the COI and Yahoo! Before this Paul worked at AMV BBDO where he made Guinness “Tipping Point” and looked after the COI business. Paul and Angus have won several awards including four D&AD yellow pencils and three Cannes Gold Lions.</p><p>Paul loves his wife, three kids, eating cake and running. In that order.</p>");
			//Cufon.replace('#bio h2');
			jQuery("#bio").fadeIn(1000);

			deselectEveryoneExcept("pauljordan")
			makeAllPeopleUnclickable();
			break;

		case "angusmacadam":
			jQuery("#bio").hide();
			jQuery("#bio").html("<h2>ANGUS MACADAM</h2><p>Executive Creative Director<br/>Tel ext. 9097</p><p>Angus works with Paul, overseeing creative for the agency and all its clients. Before joining Dentsu, London, Angus and Paul previously spent four years as Creative Directors at Wieden+Kennedy, London. As well as looking after COI, Yahoo! and parts of the Nokia business, they also worked on Nike and Honda.</p><p>At previous agencies AMV BBDO and Leo Burnett they worked on Guinness, Road Safety campaigns for COI and Beck’s beer.</p><p>As a team, they believe in working closely with clients to explore new ways of approaching work. Some of the projects Angus is most proud of working on include a TV show for Nike, a Southbank auction of children’s art for The National Association of Children’s Hospices and creating the first TV ad shot entirely on a mobile phone for the COI.</p>");
			//Cufon.replace('#bio h2');
			jQuery("#bio").fadeIn(1000);

			deselectEveryoneExcept("angusmacadam")
			makeAllPeopleUnclickable();
			break;
	}		
}

function setupCufon()
{
	// Cufon.replace('li#flexipages-2 + ul', {hover:true});
	// Cufon.replace('.page-title');
	// Cufon.replace('.entry-title', {hover:true, textTransform:'uppercase'});
	// Cufon.replace('.slide-title', {hover:true});
	// Cufon.replace('.widgettitle');
	// Cufon.replace('span.author');
	// Cufon.replace('span.vcard');
	// Cufon.replace('.entry-date');
	// Cufon.replace('.work-title', {hover:true});
	// Cufon.replace('.product_text', {hover:true});
	// Cufon.replace('.cufonme');
	// Cufon.replace('#content-work h3');
	// Cufon.replace('#content-work h2');
	// Cufon.replace('.work-title-reg', {fontFamily:"Dentsu 1451",fontWeight:400})
	
	Cufon.CSS.ready(function() {
		jQuery('#wrapper').css('visibility', 'visible');
	})
}

// usage: log('inside coolFunc', this, arguments);
window.log = function(){
  log.history = log.history || [];   // store logs to an array for reference
  log.history.push(arguments);
  if(this.console) {
      arguments.callee = arguments.callee.caller;
      console.log( Array.prototype.slice.call(arguments) );
  }
};
(function(b){function c(){}for(var d="assert,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,markTimeline,profile,profileEnd,time,timeEnd,trace,warn".split(","),a;a=d.pop();)b[a]=b[a]||c})(window.console=window.console||{});

