/* Gestione del glossario */

var GlsWin="";
var glsint=null;

function ApriGlossarioVECCHIA(percorso,termine) {
  if (parent.GlsWin.closed!=false)
    parent.GlsWin=window.open(percorso+"glsr/gloss-00.htm", "GlsWin", "width="+(screen.width*4/5)+",height="+(screen.height*4/5)+",left="+(screen.width*1/10)+",top="+(screen.height*1/10-30)+",resizable,status=yes");
  else 
    parent.GlsWin.focus();
  if (termine!="") glsint=setInterval("GlsTerm(\""+percorso+"\",\""+termine+"\")",25);
}

function GlsTerm(percorso,termine) {
  if (GlsWin.length==2) {
    clearInterval(glsint);
    iniz=termine.charAt(0);
    if (iniz>="A" && iniz<="G") parent.GlsWin.FrameB.location=percorso+"glsr/gloss-ag.htm#"+termine;
    else if (iniz>="H" && iniz<="P") parent.GlsWin.FrameB.location=percorso+"glsr/gloss-hp.htm#"+termine;
       else if (iniz>="Q" && iniz<="Z") parent.GlsWin.FrameB.location=percorso+"glsr/gloss-qz.htm#"+termine;
  }
}


function ChiudiGlossario() {
  if (parent.GlsWin.closed==false) parent.GlsWin.close();
}


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();
}