﻿
// This javascript file is used to create Digg.com & Del.icio.us links in the newsletters.
// I've created this file so that the links can be standardized and if a change is made, it
// doesn't have to be made in every newsletter.

function CreateDiggDeliciousLinks(anchor)
{
	var digg_image = "<img src=\"images/digg_button.gif\" alt=\"Digg!\" style=\"border:0;\" />";
	var delicious_image = "<img src=\"images/delicious_button.gif\" alt=\"Del.ico.us\" style=\"border:0;\" />";
	
	var digg_ogf_url = window.location.href.replace(/dev.corp.local/, "www.onegreatfamily.com");
	var delicious_ogf_url = window.location.href.replace(/dev.corp.local/, "www.onegreatfamily.com") + "%23" + anchor;
	
	digg_button = "<a style=\"text-decoration:none;\" onmouseover=\"javascript:this.style.color='#3C6294'; this.style.cursor='pointer';\" onmouseout=\"javascript:this.style.color='#3C6294';\" target=\"_blank\" href=\"http://www.digg.com/submit?url=" + digg_ogf_url + "&phase=2\">" + digg_image + "</a>";	
	delicious_button = "<a style=\"text-decoration:none;\" onmouseover=\"javascript:this.style.color='#3C6294'; this.style.cursor='pointer';\" onmouseout=\"javascript:this.style.color='#3C6294';\" target=\"_blank\" onclick=\"window.open('http://del.icio.us/post?v=4&partner=typepad&noui&jump=close&url=" + delicious_ogf_url + "&title=OneGreatFamily.com%20Newsletter', 'delicious', 'toolbar=no,width=700,height=400');\">" + delicious_image + "</a>";
	document.write(digg_button + "&nbsp;&nbsp;" + delicious_button);
}
