/* Gestione indirizzo di posta elettronica */

var emailaddr="vallo_alpino@yahoo.it";

function scriveteci() {
  document.write("<a href=\"mailto:Vallo Alpino<"+emailaddr+">?subject="+top.document.title+"\"><img border=\"0\" src=\"ico-post.gif\" alt=\"Inviateci i vostri commenti\"></a>");
}

//-------------------------------------

/* Visualizzazione foto secondo la risoluzione dello schermo */

function ph_land(f,t) {
  document.write("<td>")
  if(screen.width>=1024){
    document.write("<img src=\""+f+"\" alt=\""+t+"\">")
  }
  else{
    document.write("<img src=\""+f+"\" alt=\""+t+"\" width=\"360\">")
  }
  document.write("</td>")
}

function ph_port(f,t) {
  document.write("<td>")
  if(screen.width>=1024){
    document.write("<img src=\""+f+"\" alt=\""+t+"\">")
  }
  else{
    document.write("<img src=\""+f+"\" alt=\""+t+"\" height=\"360\">")
  }
  document.write("</td>")
}

function ph_pano(f,t) {
  document.write("<td>")
  if(screen.width>=1024){
    document.write("<img src=\""+f+"\" alt=\""+t+"\">")
  }
  else{
    document.write("<img src=\""+f+"\" alt=\""+t+"\" width=\"750\">")
  }
  document.write("</td>")
}

//-------------------------------------

/* Gestione cambio colore pallini menù generale */

function switchit(obj,img){obj.src=img}

//-------------------------------------

/* Gestione del glossario */

var GlsWin="";

function ApriGlossario(percorso,termine) {
	if (termine!="") iniziale=termine.charAt(0);	//Ricava la lettera iniziale del termine del glossario, se specificato.
	else iniziale="";								//Altrimenti stringa vuota.
	switch (iniziale) {								//Ricava il nome del file da caricare.
		case "A":
		case "B":
		case "C":
		case "D":
		case "E":
		case "F":
		case "G":
			nomefile=percorso+"glsr/gloss-ag.php#"+termine;
			break;
		case "H":
		case "I":
		case "J":
		case "K":
		case "L":
		case "M":
		case "N":
		case "O":
		case "P":
			nomefile=percorso+"glsr/gloss-hp.php#"+termine;
			break;
		case "Q":
		case "R":
		case "S":
		case "T":
		case "U":
		case "V":
		case "W":
		case "X":
		case "Y":
		case "Z":
			nomefile=percorso+"glsr/gloss-qz.php#"+termine;
			break;
		default:
			nomefile=percorso+"glsr/gloss-00.php";
	}
	if (parent.GlsWin.closed!=false)
		parent.GlsWin=window.open(nomefile, "GlsWin", "width=800,height=600,left="+(screen.width-800)/2+",top="+(screen.height-600)/2+",resizable,status=yes");
	if (termine!="") parent.GlsWin.location=nomefile;
	parent.GlsWin.focus();
}
function ChiudiGlossario() {
  if (GlsWin.closed==false) GlsWin.close();
}

//-------------------------------------

/* Funzioni per mostrare o nascondere oggetti */

var ns4 = document.layers ? 1 : 0;
var ie4 = document.all && navigator.userAgent.indexOf("Opera") == -1 ? 1 : 0;
var ns6 = document.getElementById && !document.all ? 1 : 0;

var NASCOSTO = (ns4) ? 'hide' : 'hidden';
var VISIBILE = (ns4) ? 'show' : 'visible';

/*  Le variabili che identificano gli oggetti da mostrare o nascondere devono essere
    definite nel BODY del documento HTML dopo che è stato definito il nome dell'oggetto
    stesso (ad esempio id="strato01"), utilizzando la seguente sintassi:

    if (ie4 || ns6) {
	d01 = (ns6) ? document.getElementById("strato01").style : document.all.strato01.style;
	}
    else if (ns4) {
	d01 = document.layers.strato00.layers.strato01;
	}

    Da notare che per Netscape 4 è necessario fare riferimento all'intera struttura ad albero:
    in questo caso strato01 è contenuto all'interno di strato00.
*/

function showObject(oggetto) {
  oggetto.visibility = VISIBILE;
}

function hideObject(oggetto) {
  oggetto.visibility = NASCOSTO;
}

//-------------------------------------

/* Gestione album fotografico */

var AlbWin="";
var marg_alt = screen.height>600 ? (screen.height-550)/2-45 : 0;
var marg_sin = screen.width>800  ? (screen.width-800)/2     : 0;

function ApriAlbum(filealbum) {
  if (AlbWin.closed!=false)
    AlbWin=window.open(filealbum, "AlbWin", "width=800,height=550,left="+marg_sin+",top="+marg_alt+",resizable,toolbar=yes,status=yes");
  else 
    AlbWin.focus();
}

function ChiudiAlbum() {
  if (AlbWin.closed==false) AlbWin.close();
}

//-------------------------------------


