$(function () {
	$('#loginContainer > div').hide();  
	
/*	$("a[href^=http]").each(function(){
		if(this.href.indexOf(location.hostname) == -1) {
			$(this).attr('target', '_blank');
		}
	});  
*/	  
	$('.defaultValue').each(function () {
		var default_value = this.value;
		$(this).focus(function () {
			if (this.value === default_value) {
				this.value = '';
			}
		});
		
		$(this).blur(function () {
			if (this.value === '') {
				this.value = default_value;
			}
		});
	});
	
	$('#loginTab').click(function () {
		if ($(this).hasClass('closed')) {
			$('#loginContainer > div').slideDown(500);
			$(this).removeClass('closed');
		} else {
			$('#loginContainer > div').slideUp(500);
			$(this).addClass('closed');
		}
		return false;
	});
	
	$('.videoIcon').each(function (i) {  
		var iconConta = parseInt($(this).parents('div').outerHeight(), 10),
			iconContb = (iconConta - 10),
			positionH = parseInt((iconContb / 2) - 12, 10);
		$(this).css("top", positionH);
    });
    
    $('a.contributors').hover(function () {
		$(this).children('img').animate({'opacity' : 0.7});
	}, function () {
		$(this).children('img').animate({'opacity' : 1});
	});
	
	$.ajax({
		url : "http://everythingconference.org/scripts/footertwitter.php",
		success : function (data) {
			$('#recentTweet').html(data);
		}
	});
});
