

var rtcutils = {
        prefs: Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch),

    getPref: function(prefName)
    {
        var type = rtcutils.prefs.getPrefType(prefName);
        if (type == 32)
            return rtcutils.prefs.getCharPref(prefName);
        else if (type == 64)
            return rtcutils.prefs.getIntPref(prefName);
        else if (type == 128)
            return rtcutils.prefs.getBoolPref(prefName);
        else
            return null;
            //alert("Invalid preference "+prefName+" check that it is listed in defaults/prefs.js");
    },

    setPref: function(prefName, value)
    {
        var type = rtcutils.prefs.getPrefType(prefName);
        if (type == 32)
            rtcutils.prefs.setCharPref(prefName, value);
        else if (type == 64)
            rtcutils.prefs.setIntPref(prefName, value);
        else if (type == 128)
            rtcutils.prefs.setBoolPref(prefName, value);
        else
            alert("Invalid preference "+prefName+" check that it is listed in defaults/prefs.js");

    },

    clearPref: function(prefName)
    {
        if (rtcutils.prefs.prefHasUserValue(prefName))
            rtcutils.prefs.clearUserPref(prefName);
    },
    
};