$(document).ready(function() {
	
	
	//Account drop down	
	$("#loginIcon").click(function() {
		$("#loginBox").slideToggle();
		return false;
	});
	
	//Twitter footer
	
	var jsonTwitterFeed = "http://api.twitter.com/1/statuses/user_timeline.json?screen_name=hrf_europe"
	
	$.ajax({
		url: jsonTwitterFeed,
		data: {},
		dataType: "jsonp",
		callbackParameter: "jsoncallback",
		timeout: 5000,
		success: function(data){
			$("#twitterStatus").html(replaceURLWithHTMLLinks(data[0].text));
		}
	});

	function replaceURLWithHTMLLinks(text) {
		var exp = /(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig;
		return text.replace(exp,"<a href='$1'>$1</a>");
	}
	
	
	
	
});
