/**
 * $Id: lib.js 46 2008-02-03 08:18:23Z Manuel $
 */

var caliso = {}; // global namespace


function ltrim(str)
{
    if (str.length == 0) return str
    var idx = 0
    while (str.charAt(idx).search(/\s/) == 0) idx++
    return str.substr(idx)
}


function rtrim(str)
{
    if (str.length == 0) return str
    var idx = str.length-1
    while (str.charAt(idx).search(/\s/) == 0) idx--
    return str.substring(0,idx+1)
}


function trim(str)
{
    return rtrim(ltrim(str))
}


caliso.cookies =
{
    disabledMessage : "" // to be reset by ASP code
    ,
    checkEnabled : function (msg)
    {
        Set_Cookie("test","test");
        if (Get_Cookie("test") == "test") return true;
        alert(caliso.cookies.disabledMessage);
        return false;
    }
}
