function findObj(n,d) {
  var p,i,x,d;
  if (!d) d=document;
  if(!(x=d[n])&&d.all) x=d.all[n];
  return x;
}

/* Functions that swaps images. */
function swapImage() {
  var i,j=0,x,a=swapImage.arguments;
  document.sr=new Array;
  for(i=0;i<(a.length-1);i+=2)
   if ((x=findObj(a[i]))!=null){
    document.sr[j++]=x;        //stores the reference of the object
    if(!x.oSrc) x.oSrc=x.src;  //stores the original source
    x.src=a[i+1];              //changes the source
    }
}

function swapImgRestore() {
  var i,x,a=document.sr;
  for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++)
    x.src=x.oSrc;
}
