function logout()
{
    $.post('/actions/logout',
    {},
    function(){
         history.go(0);
    });
   
}

function firebugLog(my_message)
{
    $.post(absoluteFilepath('actions/logMessage'),
    {'message' : my_message});
}

function absoluteFilepath(path)
{
    return "http://" + window.location.hostname + "/" + path;
}

function stringToUnixTime(datetime_string)
{
    if(!datetime_string)
    {
        return false;
    }

    var split = datetime_string.split(' ');

    var date_string = split[0];
    var time_string = split[1];
    var ampm_string = split[2];

    var split_date = date_string.split('/');

    var month = parseInt(split_date[0], 10);
    var day = parseInt(split_date[1], 10);
    var year = parseInt(split_date[2], 10);

    var split_time = time_string.split(':');

    var hour = parseInt(split_time[0], 10);
    var minute = parseInt(split_time[1], 10);

    if(ampm_string.toLowerCase() == 'pm' && hour != 12)
    { 
        hour += 12;
    }
    if(hour == 12 && ampm_string.toLowerCase() == 'am')
    {
        hour = 0;
    }

    var date = new Date(year, month - 1, day, hour, minute, 0, 0);
    return Math.floor(date.getTime() / 1000);
}
