	String.prototype.linkify = function() {
		return this.replace(/[A-Za-z]+:\/\/[A-Za-z0-9-_]+\.[A-Za-z0-9-_:%&\?\/.=]+/, function(m) {
			return m.link(m);
		});
	}; 
	
	  function relative_time(time_value) {
		  var values = time_value.split(" ");
		  time_value = values[1] + " " + values[2] + ", " + values[5] + " " + values[3];
		  var parsed_date = Date.parse(time_value);
		  var relative_to = (arguments.length > 1) ? arguments[1] : new Date();
		  var delta = parseInt((relative_to.getTime() - parsed_date) / 1000);
		  delta = delta + (relative_to.getTimezoneOffset() * 60);
		  
		  var r = '';
		  if (delta < 60) {
		    r = 'a minute ago';
		  } else if(delta < 120) {
		    r = 'couple of minutes ago';
		  } else if(delta < (45*60)) {
		    r = (parseInt(delta / 60)).toString() + ' minutes ago';
		  } else if(delta < (90*60)) {
		    r = 'an hour ago';
		  } else if(delta < (24*60*60)) {
		    r = '' + (parseInt(delta / 3600)).toString() + ' hours ago';
		  } else if(delta < (48*60*60)) {
		    r = '1 day ago';
		  } else {
		    r = (parseInt(delta / 86400)).toString() + ' days ago';
		  }
		  
		  return r;
	}

	function twitter_callback ()
	{
		return true;
	}

// useExtendedStyles is necessary to get Font Collections to work!
// If you don’t enabled extended styles, then you will always get the default font for the collection.
// The other options are not required to use Font Collections.
var gillsansmtcondensed = new FLIRStyle({ cFont:'gillsansmtcondensed', realFontHeight:false, useExtendedStyles:false, output:'png' });
var georgiabolditalic = new FLIRStyle({ cFont:'georgiabolditalic', realFontHeight:false, output:'png' });
var georgiabolditalicWRAP = new FLIRStyle({ mode:'wrap', cFont:'georgiabolditalic', realFontHeight:false, output:'png' });
var serifmediumitalic = new FLIRStyle({ cFont:'serifmediumitalic', realFontHeight:false, output:'png' });
var centurygothic = new FLIRStyle({ cFont:'centurygothic', realFontHeight:false, output:'png' });
var verdanaItalic = new FLIRStyle({ cFont:'verdanaItalic', realFontHeight:false, output:'png' });
var centurygothicitalic = new FLIRStyle({ cFont:'centurygothicitalic', realFontHeight:false, output:'png' });
// Facelift will detect the bold and italic children.
//FLIR.replace(document.getElementById('navigation'), navigationFont);
$(document).ready(function(){
/*
	$(".past-events .blue-background .event-list h3").each( function() { FLIR.replace(this, georgiabolditalicWRAP); } );
	$(".past-events .blue-background h2").each( function() { FLIR.replace(this, centurygothicitalic); } );
	$(".sponsors .blue-background h2").each( function() { FLIR.replace(this, centurygothicitalic); } );
	$(".blue-background .current-party-details em").each( function() { FLIR.replace(this, centurygothicitalic); } );
	$(".blue-background .current-party-details span").each( function() { FLIR.replace(this, centurygothic); } );
	$(".blue-background .current-party-details h1").each( function() { FLIR.replace(this, georgiabolditalic); } );
	$(".home .blue-background h3").each( function() { FLIR.replace(this, georgiabolditalic); } );
	$(".home .blue-background h2").each( function() { FLIR.replace(this, centurygothicitalic); } );
	$(".contribute .blue-background h2").each( function() { FLIR.replace(this, centurygothicitalic); } );
	$(".upcoming-events .blue-background h2").each( function() { FLIR.replace(this, centurygothicitalic); } );
	$(".help-promote .blue-background h2").each( function() { FLIR.replace(this, centurygothicitalic); } );
	$("#navigation .not-active").each( function() { FLIR.replace(this, gillsansmtcondensed); } );
	$("#navigation span.active").each( function() { FLIR.replace(this, georgiabolditalic); } );
	$(".subpage h1").each( function() { FLIR.replace(this, georgiabolditalic); } );
	$(".bookmarks-wrapper .the-internet-marketers").each( function() { FLIR.replace(this, serifmediumitalic); } );
	$(".bookmarks-wrapper .charity-party").each( function() { FLIR.replace(this, centurygothic); } );
	*/
	//$(".bookmarks-wrapper .bookmarklet dd dl dd").each( function() { FLIR.replace(this, verdanaItalic); } );
	//$(".twitter span").each( function() { FLIR.replace(this, centurygothicitalic); } );
	/*
	var profile = "http://www.twitter.com/imcharity/";
	var url = "http://twitter.com/status/user_timeline/imcharity.json?count=1&callback=?";
	$.getJSON(url,
		function(data){
			$.each(data, function(i, item) {
			$(".twitter .tweet").prepend("<span class='quotes'>\"</span> " + "<a href='" + profile + "'>" + item.text.linkify() + "</a><span class='quotes'>\"</span><br/><span class='created_at'>- " + relative_time(item.created_at) + " via " + item.source + "</span>");
		});
	});
	*/
	/*
	$(".name-1").click(function () {
      if ($(".event-1").is(":hidden")) {
        $(".event-1").slideDown("slow");
		$(".name-1 small").html("Close Details").css({"background":"#ccc","border":"1px solid #9f9f9f","color":"#444"});
      } else {
        $(".event-1").hide();
		$(".name-1 small").html("Open Details").css({"background":"#efefef","border":"1px solid #ccc","color":"#000"});
		$(".name-1 small").hover(
		  function () {
			$(this).css({"background":"#ccc","border":"1px solid #9f9f9f","color":"#444"});
		  },
		  function () {
			$(this).css({"background":"#efefef","border":"1px solid #ccc","color":"#000"});
		  });
	  }
    });

	$(".name-2").click(function () {
      if ($(".event-2").is(":hidden")) {
        $(".event-2").slideDown("slow");
		$(".name-2 small").html("Close Details").css({"background":"#ccc","border":"1px solid #9f9f9f","color":"#444"});
      } else {
        $(".event-2").hide();
		$(".name-2 small").html("Open Details").css({"background":"#efefef","border":"1px solid #ccc","color":"#000"});
		$(".name-2 small").hover(
		  function () {
			$(this).css({"background":"#ccc","border":"1px solid #9f9f9f","color":"#444"});
		  },
		  function () {
			$(this).css({"background":"#efefef","border":"1px solid #ccc","color":"#000"});
		  });
	  }
    });
	
	$(".name-3").click(function () {
      if ($(".event-3").is(":hidden")) {
        $(".event-3").slideDown("slow");
		$(".name-3 small").html("Close Details").css({"background":"#ccc","border":"1px solid #9f9f9f","color":"#444"});
      } else {
        $(".event-3").hide();
		$(".name-3 small").html("Open Details").css({"background":"#efefef","border":"1px solid #ccc","color":"#000"});
		$(".name-3 small").hover(
		  function () {
			$(this).css({"background":"#ccc","border":"1px solid #9f9f9f","color":"#444"});
		  },
		  function () {
			$(this).css({"background":"#efefef","border":"1px solid #ccc","color":"#000"});
		  });
	  }
    });
	
	$(".name-4").click(function () {
      if ($(".event-4").is(":hidden")) {
        $(".event-4").slideDown("slow");
		$(".name-4 small").html("Close Details").css({"background":"#ccc","border":"1px solid #9f9f9f","color":"#444"});
      } else {
        $(".event-4").hide();
		$(".name-4 small").html("Open Details").css({"background":"#efefef","border":"1px solid #ccc","color":"#000"});
		$(".name-4 small").hover(
		  function () {
			$(this).css({"background":"#ccc","border":"1px solid #9f9f9f","color":"#444"});
		  },
		  function () {
			$(this).css({"background":"#efefef","border":"1px solid #ccc","color":"#000"});
		  });
		
	  }
    });
	
	$(".name-5").click(function () {
      if ($(".event-5").is(":hidden")) {
        $(".event-5").slideDown("slow");
		$(".name-5 small").html("Close Details").css({"background":"#ccc","border":"1px solid #9f9f9f","color":"#444"});
      } else {
        $(".event-5").hide();
		$(".name-5 small").html("Open Details").css({"background":"#efefef","border":"1px solid #ccc","color":"#000"});
		$(".name-5 small").hover(
		  function () {
			$(this).css({"background":"#ccc","border":"1px solid #9f9f9f","color":"#444"});
		  },
		  function () {
			$(this).css({"background":"#efefef","border":"1px solid #ccc","color":"#000"});
		  });
	  }
    });
	*/

});


