function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_changeProp(objName,x,theProp,theValue) { //v3.0
  var obj = MM_findObj(objName);
  if (obj && (theProp.indexOf("style.")==-1 || obj.style)) eval("obj."+theProp+"='"+theValue+"'");
}

function AddToFaves_hp(){
	var is_4up = parseInt(navigator.appVersion);
	var is_mac   = navigator.userAgent.toLowerCase().indexOf("mac")!=-1;
	var is_ie   = navigator.userAgent.toLowerCase().indexOf("msie")!=-1;
	var thePage = location.href;
	if (thePage.lastIndexOf('#')!=-1)
		thePage = thePage.substring(0,thePage.lastIndexOf('#'));
	if (is_ie && is_4up && !is_mac) 
		window.external.AddFavorite(thePage,document.title);
	else if (is_ie || document.images)
		booker_hp = window.open(thePage,'booker_','menubar,width=325,height=100,left=140,top=60');
	//booker_hp.focus();
	}
	
function CaricaFoto(img){
  foto1= new Image();
  foto1.src=(img);
  Controlla(img);
}
function Controlla(img){
  if((foto1.width!=0)&&(foto1.height!=0)){
    viewFoto(img);
  }
  else{
    funzione="Controlla('"+img+"')";
    intervallo=setTimeout(funzione,20);
  }
}
function viewFoto(img){
  largh=foto1.width+20;
  altez=foto1.height+20;
  stringa="width="+largh+",height="+altez;
  finestra=window.open(img,"",stringa);
}
   
var remnants = new Image();
var lighthouses = new Image();
var ghosttown = new Image();
var sealife = new Image();
var bridge = new Image();
var gorge = new Image();
var reflections = new Image();
var fog = new Image();

remnants.src = "graphics/FE-101-MT-bw.jpg";
lighthouses.src = "graphics/HL-184-CR-cl.jpg";
ghosttown.src = "graphics/GT-105-BA-bw.jpg";
sealife.src = "graphics/SL-105-W-cl.jpg";
bridge.src = "graphics/bridge.jpg";
gorge.src = "graphics/gorge.jpg";
reflections.src = "graphics/reflections.jpg";
fog.src = "graphics/fog.jpg";

function doButtons(picimage) {
eval("document.indexphoto.src = " + picimage + ".src");
} 

function doButtons2(picimage) {
eval("document.indexphoto2.src = " + picimage + ".src");
}  
