/* stdlib stuff */

/**
 * Trims whitespace from the left side of a string
 * @return String string with left side trimmed
 */
function strltrim() 
{
  return this.replace(/^\s+/,'');
}

/**
 * Trims whitespace from the right side of a string
 * @return String string with right side trimmed
 */
function strrtrim() 
{
  return this.replace(/\s+$/,'');
}

/**
 * Trims whitespace from beginning and end of string
 * @return String string with leading and trailing whitespace trimmed
 */
function strtrim() 
{
  return this.replace(/^\s+/,'').replace(/\s+$/,'');
}

/**
 * Checks to see if a value exists in a non-associative array
 * @return boolean true if value exists in array
 */
function arrinArray(value)
{
  var rc = false;
  
  for (var n=0; n < this.length; n++) {
    if (this[n] == value) {
      rc = true;
    }
  }
  
  return rc;
}

/**
 * Removes a single non-associative array item by value
 * @param value value to remove from array
 * @return 1 if an item was removed, false if no items removed
 */
function arrremove(value)
{
  var removed = -1;
  
  for (var n=0; n < this.length; n++) {
    if (this[n] == value) {
      removed = n;
    }    
  }
  
  if (removed > -1) {
    this.splice(removed, 1);
  } else {
    removed = false;
  }
  
  return removed;
}

/**
 * Implodes a non-associative array seperating each value
 * with the specified seperator
 * @param sep seperator to use between values
 * @return String string containing array values
 */
function arrimplode(sep)
{
  var values = new String(this.toString());
  return values.replace(/,/g,sep);
}

String.prototype.ltrim = strltrim;
String.prototype.rtrim = strrtrim;
String.prototype.trim = strtrim;
Array.prototype.inArray = arrinArray;
Array.prototype.remove = arrremove;
Array.prototype.implode = arrimplode;

/* END stdlib */

/* Added by aarondf@bu.edu 9/19/07 */

/* This script and many more are available free online at 
   The JavaScript Source!! http://javascript.internet.com */

// Set up the image files to be used.
var theImages = new Array() // do not change this
// To add more image files, continue with the
// pattern below, adding to the array.

theImages[0] = '/images/frontpage/BPC-final-23-333.gif'
theImages[1] = '/images/frontpage/movie8-333.gif'
theImages[2] = '/images/frontpage/SCVbrochure_1-333.gif'
theImages[3] = '/images/frontpage/inducer2-333-dither.gif'
theImages[4] = '/images/frontpage/q.360000-small-333.gif'
theImages[5] = '/images/frontpage/Surge39-333.gif'
theImages[6] = '/images/frontpage/movie1-333.gif'
theImages[7] = '/images/frontpage/solar-333.gif'    
theImages[8] = '/images/frontpage/cuau.gif'  
                   

// do not edit anything below this line

var ran_p = theImages.length;
var ran_preBuffer = new Array()
for (i = 0; i < ran_p; i++){
   ran_preBuffer[i] = new Image()
   ran_preBuffer[i].src = theImages[i]
}
var ran_whichImage = Math.round(Math.random()*(ran_p-1));
function showImage(){
    document.write('<img valign="top" src="'+theImages[ran_whichImage]+'" border="0">');
}

/* End Random Image script */

