﻿function socialShare(type, url, title) {
    var baseUrl = "http://www.iksv.org/";
    var serviceUrl = null;

    title = encodeURIComponent(title);
    url = encodeURIComponent(url);

    try {        
        switch (type) {
            case "t":
                serviceUrl = "http://twitter.com/share?text=" + title + "&url=" + url;
                break;
            case "fb":
                serviceUrl = "http://www.facebook.com/share.php?u=" + url + "&t=" + title;
                break;
            case "ff":
                serviceUrl = "http://www.friendfeed.com/share?title=" + title + "&link=" + url;
                break;
            case "d":
                serviceUrl = "http://del.icio.us/post?url=" + url + "&title=" + title;
                break;
            case "s":
                serviceUrl = "http://www.stumbleupon.com/submit?url=" + url + "&title=" + title;
                break;
        }
            
        window.open(serviceUrl, '_blank');

    } catch (err) {

    }
}
