function twitPop(myURL, myTitle, myRelated) {
		var width = 650;
		var height = 500;
		var left = (screen.width - width)/2;
		var top = (screen.height - height)/2;
		var params = 'width='+width+', height='+height;
		params += ', top='+top+', left='+left;
		params += ', directories=no';
		params += ', location=no';
 		params += ', menubar=no';
		params += ', resizable=no';
		params += ', scrollbars=no';
 		params += ', status=no';
		params += ', toolbar=no';
		newwin=window.open("http://twitter.com/share?url="+myURL+"&text="+myTitle+"&related="+myRelated,'share on Twitter', params);
		if (window.focus) {	newwin.focus();	}
 		return false;
} 
	
//jQuery.noConflict();

$(document).ready(function() {
	
	if (document.cookie.indexOf('visited=true') === -1) {
    	var expires = new Date();
    	expires.setDate(expires.getDate()+30);
    	document.cookie = "visited=true; expires="+expires.toUTCString();
		
		$.colorbox({href:"http://www.alexfrings.com/facebook.html"});
	}
		
		
	
	
	//console.log('poo');
	
	bindelements = function(){
	
	$('a.topup').colorbox({transition:"fade"});
	
	$('.post').unbind('hover');
	$('.share').unbind('click');
	
	
	$('.post').hover(function(){
			$('.img-container img', this).fadeTo("fast", 0.65).addClass('box-hover');
			$('.actions', this).fadeTo("fast", 1);
		},
		function(){
			$('img', this).fadeTo("fast", 1).removeClass('box-hover');
			$('.actions', this).fadeTo("fast", 0);
	});
	
	$('.share-container').hide();
	
	$('.share').click(function(){
		var myParent =  $(this).parent();
		$('.share-container', myParent).slideToggle('fast');				   
	});
	
	// ======== Find the spaces and replace with %20 =========
	$(".share-icons a").each(function(){
	  $(this).attr( 'href', encodeURI( $(this).attr("href") ) );
	});
	
		
	};
	
	bindelements();
	
});

