function imageSwap(arg_img, arg_src) {
  if(document.images) {
      if(top.frames["main"].document.images[arg_img]) {
        top.frames["main"].document[arg_img].src = arg_src; 
      } else {
        // couldn't find the image --
        // if this is ns try looping through the layers document object to find it
        if (document.layers) { 
            for (var i in document.layers) {
              if (typeof(document.layers[i]) == 'object') {
                s+= document.layers[i].id + " i=" + i + "\n";
                  
                for (n in document.layers[i].document.images) {
                  if (typeof(document.layers[i].document.images[n])== 'object') {
                    if (document.layers[i].document.images[n].name == arg_img) {
                      document.layers[i].document.images[n].src = arg_src; 
                      return;
                    }
                  }
                }
                
              }
            }
          }      
          //the image wasn't found...
          confirm("error: image not found: ");
      }
    
  }
}

function getParams() {
  var args = new Object();
  var query = location.search.substring(1);  // Get query string.
  var pairs = query.split(",");              // Break at comma.
  for(var i = 0; i < pairs.length; i++) {
    var pos = pairs[i].indexOf('=');       // Look for "name=value".
    if (pos == -1) continue;               // If not found, skip.
    var argname = pairs[i].substring(0,pos);  // Extract the name.
    var value = pairs[i].substring(pos+1); // Extract the value.
    args[argname] = unescape(value);          // Store as a property.
  }
  return args;                               // Return the object.
}
