/*
* Публикация на фейсбук, вк, яндекс и мой мир мейл ру
*/
function ShareOnFacebook( url, name ) {
    
    var w = window.open('http://www.facebook.com/sharer.php?api_key=114170128635518&locale=ru_RU&u=' + encodeURIComponent(url) + '&t=' + encodeURIComponent(name), 'topfi', 'width=700,height=400,left=100,top=10,resizable=yes,scrollbars=yes,status=no');
    if ((w == null) || (w == undefined)) {
    } else {
	try { w.focus(); } catch (wtf) { }
    }

    return false;
}

function ShareOnVK (url, title) {
    var w = window.open('http://vkontakte.ru/share.php?url=' + encodeURIComponent(url), 'topfi', 'width=700,height=400,left=100,top=10,resizable=yes,scrollbars=yes,status=no');

    if ((w == null) || (w == undefined)) {
    } else {
	try { w.focus(); } catch (wtf) { }
    }

    return false;
}

function ShareOnBuzz (url, title) {
    var w = window.open('http://www.google.com/reader/link?url=' + encodeURIComponent(url) + '&title=' + encodeURIComponent(title), 'topfi', 'width=700,height=400,left=100,top=10,resizable=yes,scrollbars=yes,status=no');

    if ((w == null) || (w == undefined)) {
    } else {
	try { w.focus(); } catch (wtf) { }
    }

    return false;
}

function ShareOnYaRu (url, title) {
    var w = window.open('http://wow.ya.ru/posts_add_link.xml?URL=' + encodeURIComponent(url) + '&title=' + encodeURIComponent(title), 'topfi', 'width=700,height=400,left=100,top=10,resizable=yes,scrollbars=yes,status=no');

    if ((w == null) || (w == undefined)) {
    } else {
	try { w.focus(); } catch (wtf) { }
    }

    return false;
}

function ShareOnMyMail (url, title) {
    var w = window.open('http://connect.mail.ru/share?share_url=' + encodeURIComponent(url), 'topfi', 'width=700,height=400,left=100,top=10,resizable=yes,scrollbars=yes,status=no');

    if ((w == null) || (w == undefined)) {
    } else {
	try { w.focus(); } catch (wtf) { }
    }

    return false;
}

function ShareOnTwitter( url, name ) {
    
    var w = window.open('http://twitter.com/home?status=' + encodeURIComponent(name) + ' ' + encodeURIComponent(url), 'width=700,height=400,left=100,top=10,resizable=yes,scrollbars=yes,status=no');
    if ((w == null) || (w == undefined)) {
    } else {
	try { w.focus(); } catch (wtf) { }
    }

    return false;
}
