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

 
function is_nottoplevel(w) { return (w.parent != w); }

function DSVframe (buttons) {
if (is_nottoplevel(window) ) {
          parent.DSVbuttons.location = buttons;
      }    
}


function LoadHome (url) { 
if (top.length <= 1) 
 {
           window.top.location= url;   
}
}
  
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 galleryWindow(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=no,directories=no";
var galWin = window.open(url, winname, options);
galWin.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];
    }
  }
}
