var EXPLORER = "Microsoft Internet Explorer";
var MOZILLA = "Netscape";

var browser_app = window.navigator.appName;

function handleIMGrollover(event)
  {
    // IE vs Firefox
    var src_elem = event.srcElement || event.target;
    if (event.type == "mouseout")
      {
        src_elem.src = src_elem.src_store.off;
      }
    if (event.type == "mouseover")
      {
        // init image store on source element
        if (!src_elem.src_store)
          {
            src_elem.src_store = {};
          }
        // preserve original image (non-hover)
        if (!src_elem.src_store.off)
          {
            src_elem.src_store.off = src_elem.src;
          }
        // calc hover image source if none in store
        if (!src_elem.src_store.hover)
          {
            src_elem.src_store.hover = 
              src_elem.src_store.off.replace("off","hover");
          }
        src_elem.src = src_elem.src_store.hover;
      }
  }

function openWindow(url,name,params_hash)
  {
    var DEFAULTS = 
      {
        height:600,
        location:false,
        menubar:false,
        resizable:false,
        status:false,
        titlebar:false,
        toolbar:false,
        scrollbars:false,
        width:800
      }

    if (!params_hash)
      {
        params_hash = {};
      }

    // build params string from defaults and hash
    var params_string = "";
    var val;
    for (var key in DEFAULTS)
      {
        if (params_hash[key] != null)
          {
            val = params_hash[key];
          }
        else
          {
            val = DEFAULTS[key];
          }
        if (val == false)
          {
            val = "no";
          }
        if (val == true)
          {
            val = "yes";
          }
        params_string += key + "=" + val + ",";
      }

    var win = window.open(url,name,params_string);

    return win;
  }
