// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults

// Based upon http://www.netlobo.com/url_query_string_javascript.html
function get_url_parameter(name)
{
    name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
    var regexS = "[\\?&]"+name+"=([^&#]*)";
    var regex = new RegExp( regexS );
    var results = regex.exec( window.location.href );
    if( results == null )
        return "";
    else
        return results[1];
}

function start_facebook_login(){
    window.location = "/fb_connect";
    sleep();
}
function facebook_share_button()
{
    shared_url = location.href;
    shared_title = document.title;
    window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(shared_url)+'&t='+encodeURIComponent(shared_title),'sharer','toolbar=0,status=0,width=626,height=436');
    return false;
}