var nw;

function share(url, url_var, url_param, title_var, title, note) {
    var enc_url = encodeURIComponent(url_param);
    var enc_note = encodeURIComponent(note);
    var new_url = url + url_var + enc_url;
    if (title) {
        var enc_title = encodeURIComponent(title);
        new_url = new_url + title_var + enc_title;
    }
    if (note) {
        new_url = new_url + '&notes=' + enc_note;
    }
    nw = window.open(new_url, 'TwelveSouth on Facebook', 'height=400, width=700');
    if (window.focus) {
        nw.focus()
    }
}

