
// Funzione per stampare a video gli indirizzi e-m@il anti-spam
function makelink( scope, domain, ext, description ) {
  document.write( '<a href=\"mailto:' + scope + "&#64;" + domain + "." + ext + '\">' + description + '</a>' );
  document.write( "" );
}

// Funzione per aprire le immagini in una pop-up.
function afficheMaxi(idPg,idPhoto,Wdim,Hdim,nPage,tXp) {

  var maxW = screen.width;
  var maxH = screen.height;

  var TOP_pos = Math.floor((maxH - Hdim) / 2);
  var LEFT_pos = Math.floor((maxW - Wdim) / 2);

  popupImage = window.open('popup_photo.php?id_pg='+ idPg +'&photo='+ idPhoto +'&w='+ Wdim +'&h='+ Hdim +'&nPage='+ nPage +'&tXp='+ tXp +'','view_foto','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,copyhistory=yes,top='+ TOP_pos +',left='+ LEFT_pos +'');

  popupImage.moveTo(TOP_pos,LEFT_pos);
  popupImage.focus();
  popupImage.document.close();

} //end function: [afficheMaxi]

//funzione per aprire il documento da stampare
function openDocument(DOCPRINT,REFRESH_TO){
  var ie=document.all
  var dom=document.getElementById
  var ns4=document.layers

  var W ='';
  var H ='';

    if (ie) {
      W = self.screen.availWidth;
    }
    else
    if (!ie) {
      W = (window.innerWidth)?window.innerWidth:document.documentElement.clientWidth;
    }

  H = screen.height;

  win_print = window.open(DOCPRINT,'page_print_document','width='+(W)+',height='+(H)+',resizable=yes,scrollbars=yes,status=yes,menubar=yes,top=0,left=0');
  if(REFRESH_TO == 0) {
    //window.location.reload();
  }
  else
  if(REFRESH_TO != 0) {
    setTimeout(window.location.href=REFRESH_TO,500);
  }
  win_print.focus();
  return;
}
