/*
preload_image()
*/
function preload_image(image_name, image_src) {
    if (document.images) {
        eval(image_name + ' = new Image()');
        eval(image_name + '.src = "' + image_src + '"');
    }
}
/*
change_image()
*/
function change_image(image_name, image_src) {
    if (document.images) {
        document.images[image_name].src = image_src;
    }
}
//
function popUpDetail(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);
}

/*
sfHover()
IE Drop Down Menu
*/
sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}

/*init*/
function init() {
	if (document.all&&document.getElementById) {sfHover()};
	//alert('init loaded');
}

window.onload=init;






