Cufon.replace('#service_summary', { fontFamily: 'Gotham Book' });
Cufon.replace('#banner_image_caption', { fontFamily: 'Gotham Book' });
Cufon.replace('#media_downloads h3', { fontFamily: 'Gotham Medium' });
Cufon.replace('#images_and_video h3', { fontFamily: 'Gotham Medium' });
Cufon.replace('#media_downloads td', { fontFamily: 'Gotham Medium' });
Cufon.replace('#images_and_video td', { fontFamily: 'Gotham Medium' });
Cufon.replace('#banner_large_text', { fontFamily: 'Gotham Book' });
Cufon.replace('#homepage_slideshow_captions', { fontFamily: 'Gotham Medium' });
Cufon.replace('.banner_small_text', { fontFamily: 'Gotham Medium' });
Cufon.replace('.name_element', { fontFamily: 'Gotham Medium' });
Cufon.replace('#main_menu li a', { fontFamily: 'Gotham Medium' });
Cufon.replace('#sub_menu li a', { fontFamily: 'Gotham Medium' });
Cufon.replace('#campaign_menu', { fontFamily: 'Gotham Medium' });
Cufon.replace('#tert_menu li a', { fontFamily: 'Gotham Medium' });
Cufon.replace('#links_header', { fontFamily: 'Gotham Book' });
Cufon.replace('#links_menu li a', { fontFamily: 'Gotham Medium' });
Cufon.replace('h2', { fontFamily: 'Gotham Medium' });

$(document).ready(function() {
	jQuery.preloadImages = function()
	{
	  for(var i = 0; i<arguments.length; i++)
	  {
		jQuery("<img>").attr("src", arguments[i]);
	  }
	}
	$.preloadImages('images/homepage/Kate.jpg');

	$('#homepage_slideshow_photos, #homepage_slideshow_captions ul')
		.fadeIn(1200)
		.cycle({ 
			speed:    800, 
			timeout:  5000 
		})
	;

	$('.team_photo_selector_element').hover(function(){
		$(this).children('.name_element').show();
	},function(){
		$(this).children('.name_element:not(.visible)').hide();
	});
	$('.team_photo_small a').fancybox();
	$('.image_grid a').fancybox();

	$('#campaign_menu select').change(function(){
		location.href='newsroom.php?campaign_id='+$(this).val();
	});
	$('#twitter_feed, #other_feeds').css('height', 
		Math.max($('#twitter_feed').height(), $('#other_feeds').height()) + 'px'
	);
	
	$("a.resource, a[href^='http://'], a[href^='https://'], a[href$='.pdf'], a[href$='.doc']")
		.attr('target', '_blank');

	$(".showlink").click(function() {
		$(this).hide();
		$(this).parent().children('.hidden').slideDown(1600);
		return false;
	});
	/*
	$("#main_menu ul li")
		.hover(menuFocus, menuBlur);

	function menuFocus() {
		$(this).addClass('hover');
		$(this).children('.submenu')
			.css('filter', 'progid:DXImageTransform.Microsoft.Alpha(opacity=93)')
			.show();
	}
	function menuBlur() {
		$(this).removeClass('hover');
		$(this).children('.submenu').hide();
	}
	$("#content p:first").addClass('first_paragraph');

	*/


});


function dump(arr,level) { // like php's print_r
	var dumped_text = "";
	if(!level) level = 0;

	//The padding given at the beginning of the line.
	var level_padding = "";
	for(var j=0;j<level+1;j++) level_padding += "    ";

	if(typeof(arr) == 'object') { //Array/Hashes/Objects
		for(var item in arr) {
			var value = arr[item];

			if(typeof(value) == 'object') { //If it is an array,
				dumped_text += level_padding + "'" + item + "' ...\n";
				dumped_text += dump(value,level+1);
			} else {
				dumped_text += level_padding + "'" + item + "' => \"" + value + "\"\n";
			}
		}
	} else { //Stings/Chars/Numbers etc.
		dumped_text = "===>"+arr+"<===("+typeof(arr)+")";
	}
	return dumped_text;
} 

