// JavaScript Document

function facebookClick(url, title){
	//alert(url, title);
	var d=document;
	var f='http://www.facebook.com/share';
	var l=d.location;
	var e=encodeURIComponent;
	var p='.php?src=bm&v=4&i=1246267058&u='+e(url)+'&t='+e(title);
	
	try{
		if (!/^(.*\.)?facebook\.[^.]*$/.test(l.host)){
			throw(0);
		}
		
		share_internal_bookmarklet(p);
	}catch(z) {
		var a=function() {
			if (!window.open(f+'r'+p,'sharer','toolbar=0,status=0,resizable=1,width=626,height=436'))l.href=f+p;
		}
		
		if (/Firefox/.test(navigator.userAgent)){
			setTimeout(a,0);
		}else{
			a();
		}
	}
	
	void(0);
}

function deliciousClick(url, title){
	var f='http://delicious.com/save?url='+encodeURIComponent(url)+'&title='+encodeURIComponent(title)+'&v=5&';
	
	var a=function(){
		if(!window.open(f+'noui=1&jump=doclose','deliciousuiv5','location=yes,links=no,scrollbars=no,toolbar=no,width=550,height=550')){
			location.href=f+'jump=yes';
		}
	}
		
	if(/Firefox/.test(navigator.userAgent)){
		setTimeout(a,0);
	}else{
		a();
	}
}

function myspaceClick(url, title, description){
	var targetUrl = 'http://www.myspace.com/index.cfm?fuseaction=postto&' + 't=' + encodeURIComponent(title) + '&c=' + encodeURIComponent(description) + '&u=' + encodeURIComponent(url);
	
    window.open(targetUrl);
}

function diggClick(url, title){
	var targetUrl = 'http://digg.com/submit?phase=2&amp;url='+encodeURIComponent(url)+'&amp;title='+encodeURIComponent(title);

	window.open(targetUrl);
	
}
