
var _ScFotoGall;

function ApriFotoGall(Scheda, strTit, strNum, strFil) {
  Scheda = window.open("/ris_galleria/popup.htm?Tit=" + escape(strTit) + "&Num=" + strNum + "&Fil=" + strFil, "Scheda", "width=400,height=250,toolbar=no,status=no,resizable=no");
  Scheda.focus();
}

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 = "/ris_galleria/" + strNum + "/grandi/" + strFil;
  Img.alt = strTit;
}

function CaricaPag(strTit) {
  if (strTit != "") document.title = strTit;
}

function AdeguaPag() {
  var Img = document.images[0];
  window.resizeTo(Img.width, Img.height + 25);
}

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() {}

