﻿$().ready(function() {
    updateLink("#facebook");
    updateLink("#twitter");
});

function updateLink(path) {
    var link = $(path);
    
    var currentWindowUrl = encodeURIComponent(window.location.href);
    var currentTitle = encodeURIComponent(document.title);
    
    var linkHref = link.attr("href");
    linkHref = linkHref.replace("{0}", currentWindowUrl);
    linkHref = linkHref.replace("{1}", currentTitle);
    
    link.attr("href", linkHref);
}
