/* namespace for utility functions */
var utils = {};


utils.evalJSON = function(text) {
    return eval("(" + text + ")");
}

/*
 * This is a reimplementation of javascript standard split function.
 * The standard split function returns and Array with empty string
 * when spliting an empty string.
 * This function returns an empty Array when splitting an empty
 * string.
 */
utils.split = function(text, sep) {
    sep = typeof sep == "undefined" ? "," : sep;
    if (text == "") {
        var arr = new Array();
    } else {
        var arr = text.split(sep);
    }
    return arr;
}

/*
 * Used for checking if cookies are enabled
 */
utils.cookie_test_name = "test_cookie";
utils.cookies_enabled = function() {
    var value = jQuery.cookie(utils.cookie_test_name);
    if (!value)
        return false;
    return true;
}
