// File: $callWave/web/web site/htdocs/widgets/sms/resources/js/Session.js
// Desc: Dictionary-like class for holding global session variables.
// $Revision: 4$
// $Date: 2007-08-08 11:37:33 AM$
// $Author: Chris Phillips$

var Session_Key =
{
    WX_PHONE_VERIFIED : "phoneVerified",
    WX_PHONE_CC : "phoneCC",
    WX_PHONE_NN : "phoneNN",
    WX_CARRIER : "carrierId",
    WX_SHOW_CARRIERS : "showCarriers",
    WX_HIDE_REG_CARRIERS : "hideRegCarrier",
    WX_EMAIL : "emailAddress",
    WX_MAX_SMS_PARTS : "maxSMSParts",
    WX_SMS_BODY_OH : "smsBodyOH"
};

function Session()
{
    this.m_dictionary = new Object();
}

Session.prototype = {
    getVal : function(key)
    {
        if (typeof key == 'undefined')
        {
            return null;
        }

        if (typeof this.m_dictionary[key] != 'undefined')
        {
            return this.m_dictionary[key];
        }
        else
        {
            return null;
        }
    },

    setVal : function(key, val)
    {
        if (typeof key == 'undefined')
        {
            throw new Error('Error setting Session value.  [key] is undefined.');
        }

        if (typeof val == 'undefined')
        {
            throw new Error('Error setting Session value.  [val] is undefined.');
        }

        this.m_dictionary[key] = val;
    },

    clear : function()
    {
        this.m_dictionary = new Object();
    }
}