var restoreImg = ""; //source last image switched, for RestoreImage
var lastImg = ""; //name of last image switched, for RestoreImage

function PreloadImages() { 
  images = new Array;
  for (x=0; x<PreloadImages.arguments.length; x++) {
  	images[x]=new Image;
  	images[x].src=PreloadImages.arguments[x];
  	}
}

function SwapImage (oldimg,newimg) {
  if (document.images) {
   restoreImg = document.images[oldimg].src;
   document.images[oldimg].src=newimg;
   lastImg = oldimg;
  }
}

function RestoreImage () {
  if (document.images) {
   document.images[lastImg].src=restoreImg;
  }
}

function newWindow(url, height, width, nameW) {
    if (nameW==""){nameW='popup';}
 if (navigator.appVersion.indexOf('4') != -1) {
 // Vars for centering the new window on Version 4 Browsers
 xTop = screen.width/2 - (width/2);
 yTop = screen.height/2 - (height/2);
 window.open(url, nameW, 'height='+height+',width='+width+',scrollbars=0,resizable=0,menubar=0,toolbar=0,status=0,location=0,directories=0,left=' + xTop + ',top=' + yTop + '');
 } else {
 window.open(url, nameW, 'height='+height+',width='+width+',scrollbars=0,resizable=0,menubar=0,toolbar=0,status=0,location=0,directories=0,left=150,top=200');
 }
}
