
var _ScFotoGall;

function ApriFotoGall(Scheda, strTit, strNum, strFil) {
  Scheda = window.open("/ris_galleria/popup.htm?Tit=" + escape(strTit) + "&Num=" + escape(strNum) + "&Fil=" + strFil, "Scheda", "width=400,height=250,toolbar=no,status=no,resizable=yes");
  Scheda.focus();
}

function ApriFotoGallEx(strTit, strNum, strFil) {
  ApriFotoGall(_ScFotoGall, strTit, strNum, strFil)
}

function LeggiQS(strCampo) {
  var REQS = new RegExp("(\\?|\\&)" + strCampo + "\\=([\\w\\%\\.\\-\\/]+)");
  if (REQS.exec(window.location.search))
    return unescape(RegExp.$2);
  else
    return "";
}
  
function CaricaImg(strTit, strNum, strFil) {
  var Img = document.images[0];
  Img.onload = AdeguaPag;
  Img.src = "/database_img/" + strNum + "/img_grandi/" + strFil;
  Img.alt = strTit;
}

function CaricaPag(strTit) {
  if (strTit != "") document.title = strTit;
}

function AdeguaPag() {
  var Img = document.images[0];
  window.resizeTo(Img.width + 10, Img.height + 70);
}

function CaricaQS() {
  var strTit = LeggiQS("Tit");
  var strNum = LeggiQS("Num");
  var strFil = LeggiQS("Fil");

  CaricaImg(strTit, strNum, strFil);
  CaricaPag(strTit);
  
}

function ApriAutoGall(strIDGall, objImgOrig) {
  var RENome = new RegExp("([\\w-]+\\.\\w+)$");
  RENome.exec(objImgOrig.src)
  var strNomeImg = RegExp.$1;
  ApriFotoGall(_ScFotoGall, objImgOrig.alt, strIDGall, strNomeImg);
}

function ApriLinkGall() {}


