/*  Dashscript JavaScript utility functions, version 0.1
 *  (c) 2006 Nathan Clapham 
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  A full copy of the licence can be obtained from: 
 *  http://www.gnu.org/licenses/gpl.html
 *
 *  A paper copy can be obtained by writing to write the Free Software
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */

var Prefs = {
  get: function(pref) {
    return widget.preferenceForKey(pref);
  },

  set: function(pref,pref_value) {
    widget.setPreferenceForKey(pref_value,pref);
    return;
  },

  load: function(element, pref) {
    $(element).value = $P(pref);
    return;
  }
}

var $P = Prefs.get;
