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

/**
 * Function that enables the user to share a link on nettby.no
 * Stolen from vg.no. I guess they don't mind.
 *
 * @param string title
 * @param string url
 * @param string description
 * @return boolean
 */
function nettby_link_share(title, url, description) {
    nettby_link_share_window = window.open('http://www.nettby.no/user/edit_link.php?name=' + escape(title) + '&url=' + escape(url) + '&description=' + escape(description), 'edit_link', 'scrollbars=no,width=450,height=430');

    return false;
}
		
/* do sitewide effects */
$(document).ready(function(){
    $('a.mail').nospam({
      replaceText: true,   
      filterLevel: 'normal'
    });
    $('a.mailbreak').nospam({
      replaceText: true,   
	  linebreak: true,
      filterLevel: 'normal'
    });
    $('a.mailnoreplace').nospam({
      filterLevel: 'normal'
    });
	$('a.categorytitle').click(function() {
		$(this).next().slideToggle("fast");
	    return false;
	});
});
