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

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

function Palazzoframe (buttons) {
if (is_nottoplevel(window) ) {
          parent.Palazzobuttons.location = buttons;
      }    
}


function LoadHome (url) { 
if (top.length <= 1) 
 {
           window.top.location= url;   
}
}
function popupGallery(url, winname, w, h, x, y) {
var winname = "Palazzo2";var w = 580;var h = 550;var x = 100;var y = 5;
var options = "width=" + w + ",height=" + h + ",";
options += "resizable=yes,scrollbars=yes,status=no,";
options += "screenX=" + x + ",screenY=" + y + ",";
options += "left=" + x + ",top=" + y + ",";
options += "menubar=no,toolbar=no,location=no,directories=no";
var newWin = window.open(url, winname, options);
newWin.focus();
          }

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

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

function gotoWindow(url, winname) {
var newWin = window.open(url, winname);
newWin.focus();
          }
          
function gotoMain(url) {
var newWin = window.open(url, 'Palazzomain');
newWin.focus();
          }
          
function dropdownlink(mySel, winname, w, h, x, y) {
var myWin, url;
url = mySel.options[mySel.selectedIndex].value;
var options = "width=" + w + ",height=" + h + ",";
options += "resizable=yes,scrollbars=yes,status=no,";
options += "screenX=" + x + ",screenY=" + y + ",";
options += "left=" + x + ",top=" + y + ",";
options += "menubar=no,toolbar=no,location=no,directories=no";
var newWin = window.open(url, winname, options);
newWin.focus();
          }
          
function right(e) {
 var msg = "Sorry, this site is copyrighted.  Please email us for permission to use this image if for other than your own personal use. You can request permission using the link on the copyright notice found at the bottom of any page of this site.";
 if (navigator.appName == 'Netscape' && e.which == 3) {
 alert(msg);
 return false;
 }
 if (navigator.appName ==
 'Microsoft Internet Explorer' && event.button==2) {
 alert(msg);
 return false;
 }
 else return true;
 }
 
function trap() {
 if(document.images)
 for(i=0;i<document.images.length;i++)
 document.images[i].onmousedown = right;
 }

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];
    }
  }
}