/*
* Core functions and modules
*/

function OpenIDWindow( url ) {
    var w = window.open(url, 'openid_login', '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 AuthOnEnd () {
    document.location.href = document.location.href;
}

function ShareOnFacebook( url, title ) {
    var w = window.open('http://www.facebook.com/sharer.php?api_key=114170128635518&locale=ru_RU&u=' + encodeURIComponent(url) + '&t=' + encodeURIComponent(title), 'zvukishare', '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), 'zvukishare', '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), 'zvukishare', '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), 'zvukishare', '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), 'zvukishare', '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;
}

