
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;
  nome="_blank"
  finestra=window.open(img,nome,stringa);
}

   function trim_string(a){
      var r, re; 
            
      re = /^\s*|\s*$/g;

      r = a.replace(re, "");
      return(r);
   }

   function apriTesto(url){
      var largh
      var altez

      largh = "400";
      altez = "400";
      //url = "ZoomFoto.asp?linkid=" + id +'&<%= cstsQSUsrParam & "=" & Session (cstsCodUser) & "&" & cstsQSCodLinguaParam & "=" & Session (cstsCodLingua)%>'; //se tolgo i parametri per le statistiche esce l'aler del codlingua e coduser anche se nel link ci sono

      window.open (url, "Testo", "width=" + largh + ", height=" + altez);
   }
      function apriVideo(url){
      var largh
      var altez
      var url

      largh = "400";
      altez = "400";
      //url = "Video.asp?linkid=" + id;

      window.open (url, "Testo", "width=" + largh + ", height=" + altez);
   }

