function winfocus () {
 if (window.focus) {
        self.focus();
     }
 }    

   
function popupWindow(url, winname, w, h, x, y) {
var options = "width=" + w + ",height=" + h + ",";
options += "resizable=yes,scrollbars=yes,status=yes,";
options += "screenX=" + x + ",screenY=" + y + ",";
options += "left=" + x + ",top=" + y + ",";
options += "menubar=no,toolbar=no,location=yes,directories=no";
var newWin = window.open(url, winname, options);
newWin.focus();
          }
          
function gotoWindow(url, winname) {
var newWin = window.open(url, winname);
newWin.focus();
          }

function preloadImages() {
  // Don't bother if there's no document.images
  if (document.images) {
    var loadedImages = new Array;
    // Loop through all the arguments.
    for(arg=0;arg<preloadImages.arguments.length;arg++) {
      // For each arg, create a new image.
      loadedImages[arg] = new Image;
      // Then set the source of that image to the current argument.
      loadedImages[arg].src = preloadImages.arguments[arg];
    }
  }
}


