﻿// Share

var title = ""; var url = ""; var options = ""; var mURL = ''; var siteDescriptionTagText = "I like BİLGİ"; //document.getElementsByName('description')[0].content;

function CustomShare(shareUrl, node) {
    url = encodeURI(shareUrl);
    title = "Pastavilla";
    options = "height=700,width=800,titlebar=no,status=no,toolbar=no,menubar=no,location=no,resizable=no,scrollbars=1";
    mURL = '';
    if (node == 1) { mURL = "http://www.facebook.com/sharer.php?u=" + url + "&amp;t=" + title; }
    if (node == 2) { mURL = "http://friendfeed.com/share/bookmarklet/frame#title=" + title + "&amp;url=" + url; }
    if (node == 7) { mURL = "http://twitter.com/intent/tweet?text=" + title + "&url=" + url; }
    window.open(mURL.replace(/amp;/gi, ''), '_blank', options);
}

function CustomSharemini(shareUrl, node) {
    url = encodeURI(shareUrl);
    title = "Pastavilla";
    options = "height=300,width=500,titlebar=no,status=no,toolbar=no,menubar=no,location=no,resizable=no,scrollbars=0";
    mURL = '';
    if (node == 1) { mURL = "http://www.facebook.com/sharer.php?u=" + url + "&amp;t=" + title; }
    if (node == 2) { mURL = "http://friendfeed.com/share/bookmarklet/frame#title=" + title + "&amp;url=" + url; }
    if (node == 7) { mURL = "http://twitter.com/intent/tweet?text=" + title + "&url=" + url; }
    window.open(mURL.replace(/amp;/gi, ''), '_blank', options);
}

function makeURL(nod) {
    title = "Pastavilla";
    url = URLRewriteReplace(decodeURI(document.URL));
    options = "height=700,width=800,titlebar=no,status=no,toolbar=no,menubar=no,location=no,resizable=no,scrollbars=1";
    mURL = '';
    if (nod == 1) { mURL = "http://www.facebook.com/sharer.php?u=" + url + "&amp;t=" + title; }
    if (nod == 2) { mURL = "http://friendfeed.com/share/bookmarklet/frame#title=" + siteDescriptionTagText + "&amp;url=" + url; }
    if (nod == 3) { mURL = "http://www.google.com/bookmarks/mark?op=edit&#38;bkmk=" + url + "&#38;title=" + title; }
    if (nod == 4) { mURL = "http://www.myspace.com/Modules/PostTo/Pages/?l=2&amp;u=" + url + "&amp;t=" + title + "&amp;c=" + title };
    if (nod == 5) { mURL = "http://del.icio.us/post?url=" + url + "&amp;title=" + title };
    if (nod == 6) { mURL = "http://www.linkedin.com/shareArticle?mini=true&amp;url=" + url + "&amp;summary=" + title };
    if (nod == 7) { mURL = "http://twitter.com/intent/tweet?text=" + title + "&url=" + url };
    if (nod == 8) { mURL = "http://digg.com/submit?url=" + url + "&amp;title=" + title };
    window.open(mURL.replace(/amp;/gi, ''), '_blank', options);
}

function makeURLmini(nod) {
    title = "Pastavilla";
    url = URLRewriteReplace(decodeURI(document.URL));
    options = "height=300,width=500,titlebar=no,status=no,toolbar=no,menubar=no,location=no,resizable=no,scrollbars=0";
    mURL = '';
    if (nod == 1) { mURL = "http://www.facebook.com/sharer.php?u=" + url + "&amp;t=" + title; }
    if (nod == 2) { mURL = "http://friendfeed.com/share/bookmarklet/frame#title=" + siteDescriptionTagText + "&amp;url=" + url; }
    if (nod == 3) { mURL = "http://www.google.com/bookmarks/mark?op=edit&#38;bkmk=" + url + "&#38;title=" + title; }
    if (nod == 4) { mURL = "http://www.myspace.com/Modules/PostTo/Pages/?l=2&amp;u=" + url + "&amp;t=" + title + "&amp;c=" + title };
    if (nod == 5) { mURL = "http://del.icio.us/post?url=" + url + "&amp;title=" + title };
    if (nod == 6) { mURL = "http://www.linkedin.com/shareArticle?mini=true&amp;url=" + url + "&amp;summary=" + title };
    if (nod == 7) { mURL = "http://twitter.com/intent/tweet?text=" + title + "&url=" + url };
    if (nod == 8) { mURL = "http://digg.com/submit?url=" + url + "&amp;title=" + title };
    window.open(mURL.replace(/amp;/gi, ''), '_blank', options);
}




function URLRewriteReplace(str) { str = str.replace(/Ü/g, "U"); str = str.replace(/Ç/g, "C"); str = str.replace(/Ö/g, "O"); str = str.replace(/Ş/g, "S"); str = str.replace(/Ğ/g, "G"); str = str.replace(/İ/g, "I"); str = str.replace(/ü/g, "u"); str = str.replace(/ö/g, "o"); str = str.replace(/ç/g, "c"); str = str.replace(/ş/g, "s"); str = str.replace(/ı/g, "i"); str = str.replace(/ğ/g, "g"); return str; }


