var $j = jQuery.noConflict();

$j(document).ready(function(){
    $j('.fb a').click(function(){
		fbs_click();
	});

	$j('.twitter a').click(function(){
		twitter_click();
	});
});


function fbs_click() {
	u=location.href;
	t = getPageTitle();
	window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436');
	return false;
}


function twitter_click() {
	u=location.href;
	t = getPageTitle();
	
	window.open('http://twitter.com/share?status='+encodeURIComponent(t)+'&url='+encodeURIComponent(u)+'&text='+encodeURIComponent(t)+'&via=novmac','sharer','toolbar=0,status=0,width=626,height=436');
	return false;
}

function getPageTitle()
{
	var result = '';
	var t = document.getElementsByTagName('title')[0];
	if ( !!t.childNodes.length ) {
		//alert( t.firstChild.data );
		var result = t.firstChild.data;
	} else if ( t.innerHTML ) {
		//alert( t.innerHTML );
		var result = t.innerHTML;
	}
	
	return result;
}
