/*
 * Common funcions for all the site
 */

function create_station_only_loggedin () {
    alert("You must login to create a station. Please login using your Facebook or Twitter account");
}

function showtime(t) {
    if (typeof t !== "undefined") {
        var sec = parseInt(t % 60, 10);
        return parseInt(t / 60, 10) + ":" +
            (sec > 9 ? sec : "0" + sec);
    } else {
        return "0:00";
    }
}

function getTime(now, duration) {
    return showtime(now) + "/" + showtime(duration);
}

function html5supported() {
    try {
        var audio = new Audio();
        if (audio.canPlayType("audio/mpeg")) {
            return true;
        }
        return false;
    }
    catch (err) {
        return false;
    }
}

