(function() {
if (typeof delicious == 'undefined') {
		delicious = {};
	}
	var src2 = 'http://badges.del.icio.us/feeds/json/url/data?url=';

	if ( delicious.url ) {
		src2 += delicious.url;
		myURL = delicious.url;
	} else {
		src2 += location.href;
		myURL = location.href;
	}
	src2 += "&amp;callback=displayURL";
	if ( delicious.title ) {
		myTitle = delicious.title;
	} else {
		myTitle =  document.title;
	} 
	var myText = '';
	if ( delicious.customText ) {
	myText = delicious.customText;
	} 
	if ( delicious.pageId ) {
		myId = 'delicious' + delicious.pageId;
	} else {
		myId =  'deliciousCount';
	} 
var src = 'http://delicious.com/save?v=5&noui&jump=close&url=' + encodeURIComponent(myURL) + "&title=" + encodeURIComponent(myTitle);  ;
	 var html = '';
if (myText == ''){
	html += '<a href="http://delicious.com/url/view?url=' + myURL + '" target="_blank" title="View details on Delicious" style="text-decoration:none;">'+'<div style="background:#d3d2d2;width:auto;height:16px; border:1px solid #929292; float:left; margin-right:2px; padding:0px 3px;"><center><span style="font:normal 12px Arial; color:#000; text-decoration:none;" id="' + myId +'">0</span></center></div></a>';
    html += '<div style="background:#3274d0;width:55px; border:1px solid #0f4b9f; height:15px; float:left; padding:1px 0 0 1px;"><center><a href="http://delicious.com/save" title="Save on Delicious" style= "font:bold 11px Arial;color:#fff; text-decoration:none;" onclick="window.open(\'' + src + '\', \'delicious\',\'toolbar=no,width=550,height=550\'); return false;"><span>Delicious</span></a></center></div>'
}
else
{
	    html += '<a href="http://delicious.com/save" title="Save on Delicious" onclick="window.open(\'' + src + '\', \'delicious\',\'toolbar=no,width=550,height=550\'); return false;">' + myText +'</a>&nbsp;('
		html += '<span id="' + myId +'">0</span>&nbsp;saves)';
}

	

	html += '<script>function displayURL(data) { var urlinfo = data[0]; if (!urlinfo.total_posts) return;document.getElementById(\'' + myId+ '\').innerHTML = urlinfo.total_posts;}</script>'
	html += '<script src = "' + src2 +'"></script>'; 
	html += '<script type="text/javascript">var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");document.write(unescape("%3Cscript src=\'" + gaJsHost + "google-analytics.com/ga.js\' type=\'text/javascript\'%3E%3C/script%3E"));</script><script type="text/javascript">try {var pageTracker = _gat._getTracker("UA-12037055-1");pageTracker._trackPageview();} catch(err) {}</script>';
   	document.write(html);
	
})();
