/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */


function debugMode()
{
    debug = this.document.getElementById('mode_switch');

    if(debug.innerHTML.toLowerCase() == 'hide')
    {
        phpdump('off');
        debug.innerHTML = 'show';
    }
    else
    {
        phpdump('on');
        debug.innerHTML = 'hide';
    }
}
function toggleDebug()
{
    if($('#mode_status').css('display') == 'block')
    {
        $('#mode_status').css('display','none')
        $('#mode_status_btn').html('+');
    }
    else
    {
        $('#mode_status').css('display','block')
        $('#mode_status_btn').html('-');
        $.cookie('showDebug', true,{expires:1, secure: false});
    }
}
function checkDebugCookie()
{
    if($.cookie('showDebug') == 'true')
    {
        $('#mode_status').css('display','block')
    }
    else
    {
        $('#mode_status').css('display','none')
    }
}
function getCookie(c_name)
{
    if (document.cookie.length>0)
    {
        c_start=document.cookie.indexOf(c_name + "=");
        if (c_start!=-1)
        {
            c_start=c_start + c_name.length+1;
            c_end=document.cookie.indexOf(";",c_start);

            if (c_end==-1)
            {
                c_end=document.cookie.length;
            }

            return unescape(document.cookie.substring(c_start,c_end));
        }
    }
    return "";
}
// TODO: is this the right place for this function??
onExecute[onExecute.length] = 'checkDebugCookie()';
