function IsArray(obj) { return obj instanceof Array; }
function IncludeLibraries(libraries) {
  libraries.each(function(library) {
    document.write('<script type="text/javascript" src="' + library + '"></script>');
  });
}
function SetNotice(content, status) {
  // :KLUDGE: having to force background colors
  //          highlight effect isn't reading new color
  //          from dynamically set classname
  // status related colors
  var colors = new Array();
  colors['success'] = '#e2f9e3';
  colors['error']   = '#ffcfce';
  var bgcolor = (status) ? colors[status] : colors['success'];
  
  // update notice
  var e = $('notice');
  e.update(unescape(content));
  e.className = 'notice-' + ((status) ? status : 'info');
  e.show();
  new Effect.Highlight(e, {duration:1.5, keepBackgroundImage:true, startcolor:'#ffff88', endcolor:bgcolor, restorecolor:bgcolor});
}
function ClearNotice() {
  var e = $('notice');
  e.update('');
  e.hide();
}
function Mailto(address) {
  var url    = '/ajax_mailto.php';
  var pars   = 'address=' + address;
  new Ajax.Request(
    url,
    {
      method:'post',
      parameters:pars,
      onComplete:function(req) {
        window.location = req.responseText;
      }
    }
  );
}
