// BR_preloadImages('image-URL', ...);
// Begins loading listed images into current document.
function BR_preloadImages() {
  var d = document;
  if (d.images) {
    if (!d.BR_pics)
      d.BR_pics = new Array();
    var i, j = d.BR_pics.length, args = BR_preloadImages.arguments;
    for (i = 0; i < args.length; i++) {
        d.BR_pics[j]       = new Image;
        d.BR_pics[j++].src = args[i];
      }
  }
}


// BR_findObj('obj-name', [document]);
// Locates named object in document and returns it.
function BR_findObj(n, d) {
  var i, x;
  
  if (!d)
    d = document;

  x = d[n];
  if (x)
    return x;

  if (d.all)
    x = d.all[n];
  if (x)
    return x;

  for (i = 0; i < d.forms.length; ++i) {
    x = d.forms[i][n];
    if (x)
    	return x;
  }
    
  if (d.layers)
    for (i = 0; i < d.layers.length; ++i) {
      x = BR_findObj(n, d.layers[i].document);
      if (x)
        return x;
    }
 
  if (document.getElementById)
    x = document.getElementById(n);

  return x;
}


// BR_imageReplace('image-name', 'image-URL')
// Image must have a name="image-name" tag.
function BR_imageReplace(image_name, new_image_URL) {
  var x, d = document;
  
  x = BR_findObj(image_name, d);
  if (!x)
    return;

  x.src = new_image_URL;
}


// BR_classReplace('object-name', 'new-class')
// Object must have a name="name" tag.
function BR_classReplace(obj_name, new_class) {
  var x, d = document;

  x = BR_findObj(obj_name, d);
  if (!x)
    return;

  x.className = new_class;
}


name = "main";
