//  DATA CREAZIONE: 21-04-2007;
//  DATA MODIFICA: 21-04-2007;
//  VERSIONE: 2007.1.0;
//  AUTORE: Dott. Cristian Lanza;
//          rezalan@tiscali.it
//  LICENSE: full or partial use of this code is prohibited.
//           If interested contact the author asking for permitting usage of code.

function showprod(src,w,h) {
  obj = document.getElementById('hidprod');
  obj.style.display = "block";
  obj.style.height = h + "px";
  obj.style.width = w + "px";
  obj.style.top = 480 + "px"; // sistemare utilizzando larghezza e altezza della finestra facendo
  obj.style.left = 480 + "px"; // uso di w e h per centrare la div perfettamente, poi metti un link chiudi per nascondere la div
  obj.innerHTML = "<img src='" + src + "' alt='immagine prodotto' title='immagine prodotto'/>";
}

function showgeo(src,w,h) {
//  alert(window.screen.availWidth);
//  alert(window.screen.availHeight);
//  alert(window.screen.width);
//  alert(window.screen.height);

//  // firefox & co.
//  alert(window.screenX);
//  alert(window.screenY);
//  alert(window.innerWidth);
//  alert(window.innerHeight);
//  alert(window.outerWidth);
//  alert(window.outerHeight);

//  // ie
//  alert(window.screenLeft);
//  alert(window.screenTop);

//  alert(window.document.body.offsetWidth);
//  alert(window.document.body.offsetHeight);
  var areaIntW = window.document.body.offsetWidth;
  var areaIntH = window.document.body.offsetHeight;
  // logica di posizionamento div
  var left = (areaIntW - w) / 2;
  var top = (areaIntH - h) / 2;
//  alert("left = " + left);
//  alert("top = " + top);
  obj = document.getElementById('hidgeo');
  obj.style.display = "block";
  obj.style.height = h + "px";
  obj.style.width = w + "px";
  obj.style.top = top + "px"; // sistemare utilizzando larghezza e altezza della finestra facendo
  obj.style.left = left + "px"; // uso di w e h per centrare la div perfettamente, poi metti un link chiudi per nascondere la div
  obj.style.backgroundImage = "url(" + src + ")";
  obj.innerHTML = "<div>&nbsp;<img src='./images/chiudi.gif' alt='chiudi' title='chiudi' onclick='hidegeo();'/></div>";
}

function hidegeo() {
  obj = document.getElementById('hidgeo');
  obj.style.display = "none";
  obj.style.speak = "none";
  obj.innerHTML = "";
}

function mostraFoto(src,width,height) {
  window.open(src,'foto','width='+width+'px,height='+height+'px,location=no,menubar=no,resizable=no,scrollbars=no,status=no,titlebar=no,toolbar=no');
}

function ridimensionami(l,a) {
  if (!document.all && document.getElementById) {
    window.resizeTo(l+6,a+32);
  }
  if (document.all && document.getElementById) {
    window.resizeTo(l+10,a+36);
  }
}

function inPrimoPiano() {
  window.focus();
}
