function openFacebook(u, t){
    window.open('http://www.facebook.com/sharer.php?u=' + encodeURIComponent(u) + '&t=' + encodeURIComponent(t), 'sharer', 'toolbar=0,status=0,width=626,height=436');
    return false;
}


function openTwitter(lang){
    console.log("twitter share");
    u="http://www.fauxgras.be";
    t=document.title;
    window.open('http://twitter.com/share?url='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer', 'toolbar=0, status=0, width=626, height=436');
    return false;
}

function openHyves(t, b){
    var url = 'http://hyves-share.nl/button/tip/?tipcategoryid=12&rating=5&title=' + encodeURIComponent(t) + '&body=' + encodeURIComponent(b);
    var features = 'toolbar=0,status=0';
    openCenteredWindow(url, 'sharer', 800, 600, features);
}

function openCenteredWindow(url, name, width, height, features){
    var width = width;
    var height = height;
    var left = parseInt((screen.availWidth / 2) - (width / 2));
    var top = parseInt((screen.availHeight / 2) - (height / 2));
    var windowFeatures = "width=" + width + ",height=" + height + ",left=" + left + ",top=" + top + "screenX=" + left + ",screenY=" + top;
    if (features) 
        windowFeatures += "," + windowFeatures;
    window.open(url, name, windowFeatures);
}

