﻿$(document).ready(function() {
    
    if($("#ancTwitter").length)
    {
        var twitterHref = "http://twitter.com/home?status="+encodeURIComponent(location.href)+"&t="+encodeURIComponent(document.title);
        $("#ancTwitter").attr("href", twitterHref);
        var facebookHref="http://www.facebook.com/sharer.php?u="+encodeURIComponent(location.href)+"&t="+encodeURIComponent(document.title);
        $("#ancFacebook").attr("href", facebookHref);
        var diggHref = "http://digg.com/submit?url="+encodeURIComponent(location.href)+"&title="+encodeURIComponent(document.title);
        $("#ancDigg").attr("href", diggHref);
    }
    
    if($("#ancTwitterLeft").length)
    {
        var twitterHref = "http://twitter.com/home?status="+encodeURIComponent(location.href)+"&t="+encodeURIComponent(document.title);
        $("#ancTwitterLeft").attr("href", twitterHref);
        var facebookHref="http://www.facebook.com/sharer.php?u="+encodeURIComponent(location.href)+"&t="+encodeURIComponent(document.title);
        $("#ancFacebookLeft").attr("href", facebookHref);
        var diggHref = "http://digg.com/submit?url="+encodeURIComponent(location.href)+"&title="+encodeURIComponent(document.title);
        $("#ancDiggLeft").attr("href", diggHref);
    }
    
});

