function reverse_string(string_to_reverse)
{
 temp_string = "";
 for(i=1; i<= string_to_reverse.length; i++)
 {
  temp_string += string_to_reverse.charAt(string_to_reverse.length - i);
 }
 string_to_reverse = temp_string;
 return  string_to_reverse;
}

function get_filename(file_source)
{
 extension = ".gif";
 if(file_source.indexOf("_over.gif") > - 1)
 extension = "_over.gif";
 if(file_source.indexOf("_push.gif") > - 1)
 extension = "__push.gif";
 
 file_source = reverse_string(file_source);
 filename = file_source.substring(file_source.indexOf(reverse_string(extension)) + extension.length, file_source.indexOf("/"))
 filename = reverse_string(filename);
 return filename;
}

function swapIt(imgName, swap_type)
{
 switch (swap_type)
 {
 case "show":
  ext = "_over.gif";
  break;
 case "hide":
  ext = ".gif";
  break;
 case "push":
  ext = "_push.gif";
  break;
 }
 if (document.images)
 {
  if (typeof(imgName) == 'string')
  {
   // This whole objStr nonesense is here solely to gain compatability
   // with ie3 for the mac.
    objStr = 'document.' + imgName;
    obj = eval(objStr);
    obj.src = "images/" + imgName + ext;
  }
  else
  if ( (typeof(imgName) == 'object') && imgName && imgName.src )
  {
   img_file = get_filename(imgName.src);
   imgName.src = "images/" + img_file + ext;
  }
 }
}

function showIt(imgName)
{
 if (document.images)
 {
  document[imgName].src = "images/" + imgName + "_over.gif";
 }
}

function hideIt(imgName)
{
 if (document.images)
 {
  document[imgName].src = "images/" + imgName + ".gif";
 }
}

function pushIt(imgName)
{
 if (document.images)
 {
  document[imgName].src = "images/" + imgName + "_push.gif";
 }
}