var nfield = 1;
var version = parseInt(navigator.appVersion);
var isNav = false;
isNav = navigator.appName == "Netscape";
var isIE = true;
if (navigator.appVersion.indexOf("MSIE") > -1) {isIE = true}
var stile = "";
if (isIE) {stile = ".style"}
var range = "";
if (isIE) {range = ".all"}

var isIE4 = isIE && (version > 3);

function mostra(a) {
   if (isIE) 	{a.style.visibility = 'visible';}
	else	{a.visibility = 'visible';}
}


function nascondi(a) {
   if (isIE) 	{a.style.visibility = 'hidden';}
	else	{a.visibility = 'hidden';}
}

function mostra2(obj) {
    if (document.getElementById)
	{
	p = document.getElementById(obj);
	p.style.visibility = 'visible';
	}
    else if (document.layers)
	{
	document.layers[obj].visibility = 'show';
	}
    else if (document.all)
	{
     	eval("document.all." + obj + ".style.visibility = 'visible'");
	}
}

function nascondi2(obj) {
    if (document.getElementById)
	{
	p = document.getElementById(obj);
	p.style.visibility = 'hidden';
	}
    else if (document.layers)
	{
	document.layers[obj].visibility = 'hide';
	}
    else if (document.all)
	{
     	eval("document.all." + obj + ".style.visibility = 'hidden'");
	}
}
function inserisci(a) {
   if (isIE) 	{a.style.display = '';}
	else	{a.display = '';}
}

function elimina(a) {
   if (isIE) 	{a.style.display = 'none';}
	else	{a.display = 'none';}
}

function changeColor(a, c){
	if (isIE)	{a.style.color = c;}
	else	{alert("aaa");}
}

function changeBGcolor(a, c){
	if (isIE)	{a.style.backgroundColor = c;}
	else	{a.backgroundColor = c;}
}

function changeBorderColor(a, c){
	if (isIE)	{a.style.borderColor = c;}
	else	{a.borderColor = c;}
}

function changeImage(a, fid){
	if (isIE)	{a.src = fid;}
	else	{a.src = fid;}
}


function openWin(locat){
	newWin=open( locat,'nWin','width=600,height=400,left=150,top=50,location=yes,resizable=yes,scrollbars=yes');
}


function lnk1(name, txt, locat, st1, st2){
	document.write('<a href="' + locat + '" onmouseover="' + name + '.className=\'' + st2 + '\'" onmouseout="' + name + '.className=\'' + st1 + '\'">');
	document.write('<span id="' + name + '" class="' + st1 + '">');
	document.write(txt);
	document.write('</span></a>');
}
function link1(txt, locat, st1, st2){
	nfield += 1;
	name = 'nn' + nfield;
	document.write('<a href="' + locat + '" onmouseover="' + name + '.className=\'' + st2 + '\'" onmouseout="' + name + '.className=\'' + st1 + '\'">');
	document.write('<span id="' + name + '" class="' + st1 + '">');
	document.write(txt);
	document.write('</span></a>');
}
function lnkD(txt, locat){
	nfield += 1;
	name = 'nn' + nfield;
	document.write('<a href="#top" onclick="dWin=window.open(\'../diz/testob.asp?curword=' + locat + '\',\'dWin\',\'width=600,height=400,left=150,top=50,location=yes,resizable=yes,scrollbars=yes\');" onmouseover="' + name + '.className=\'dizover\';" onmouseout="' + name + '.className=\'dizlnk\'">');
	document.write('<span id="' + name + '" class="dizlnk">');
	document.write(txt);
	document.write('</span></a>');
}
function linkD(txt, locat){
	nfield += 1;
	name = 'nn' + nfield;
	document.write('<a href="#top" onclick="dWin=window.open(\'../diz/testob.asp?curword=' + locat + '\',\'dWin\',\'width=600,height=400,left=150,top=50,location=yes,resizable=yes,scrollbars=yes\');" onmouseover="' + name + '.className=\'dizover\';" onmouseout="' + name + '.className=\'dizlnk\'">');
	document.write('<span id="' + name + '" class="dizlnk">');
	document.write(txt);
	document.write('</span></a>');
}

function link2(txt, locat, st1, st2){
	nfield += 1;
	name = 'nn' + nfield;
	document.write('<a onclick="newWin=window.open(\'' + locat + '\',\'newWin\',\'width=600,height=400,left=150,top=50,location=no,resizable=yes,menubar=yes,scrollbars=yes\');" onmouseover="' + name + '.className=\'' + st2 + '\'" onmouseout="' + name + '.className=\'' + st1 + '\'">');
	document.write('<span id="' + name + '" class="' + st1 + '">');
	document.write(txt);
	document.write('</span></a>');
}
function lnk2(){
// parametri: testo, locazione, stile base, stile per mouseover, nome finestra, opzioni finestra
	style1 = "lnk"; style2 = "lnko";
	wname = "newWin";
	if (typeof(lnk2.arguments[2]) != "undefined" && lnk2.arguments[2] != "") {style1 = lnk2.arguments[2]}
	if (typeof(lnk2.arguments[3]) != "undefined" && lnk2.arguments[3] != "") {style2 = lnk2.arguments[3]}
	if (typeof(lnk2.arguments[4]) != "undefined" && lnk2.arguments[4] != "") {wname = lnk2.arguments[4]}
	ss = " "; if (typeof(lnk2.arguments[5]) != "undefined") {ss = lnk2.arguments[5]}
	opt = getopt(ss, "width=", "600");
	opt = opt + "," + getopt(ss, "height=", "400");
	opt = opt + "," + getopt(ss, "left=", "150");
	opt = opt + "," + getopt(ss, "top=", "50");
	opt = opt + "," + getopt(ss, "location=", "yes");
	opt = opt + "," + getopt(ss, "resizable=", "yes");
	opt = opt + "," + getopt(ss, "scrollbars=", "yes");
	document.write('<span class="' + style1 + '" onmouseover="this.className=\'' + style2 + '\'" onmouseout="this.className=\'' + style1 + '\'" onclick="' + wname + '=window.open(\'' + lnk2.arguments[1] + '\',\'' + wname + '\',\'' + opt + '\')">');
	document.write(lnk2.arguments[0]);
	document.write('</span>');
}
function link3(txt, locat1, locat2, st1, st2){
	nfield += 1;
	name = 'nn' + nfield;
	document.write('<a onclick="document.location=\'' + locat1 + '\'; if (typeof(newW3)!=\'undefined\'){window.newW3.close()}; newW3=window.open(\'' + locat2 + '\',\'newW3\',\'width=600,height=400,left=150,top=50,location=no,resizable=yes,menubar=yes,scrollbars=yes\'); newW3.focus(); " onmouseover="' + name + '.className=\'' + st2 + '\'" onmouseout="' + name + '.className=\'' + st1 + '\'">');
	document.write('<span id="' + name + '" class="' + st1 + '">');
	document.write(txt);
	document.write('</span></a>');
}
function getopt(str, param, defval) {
	n = str.indexOf(param);
	if (n < 0) {
		return param + defval}
	else	{
		ss1 = str.substr(n+param.length);
		n = ss1.indexOf(",");
		if (n < 0) 
			{return param + ss1}
		else	
			{return param + ss1.substr(0, n)}
		}
}
function wrlev0b(nome, ll0, locat, txt) {
document.write('<img src="../images/vuoto.gif" width=130 height=10>');
cccc = "";
if (ll0) {cccc="s"}
	{if(locat != "")
		{document.write('<a href="' + locat + '" onmouseover="' + nome + '.className=\'ColDesLev0over' + cccc + '\';" onmouseout="' + nome + '.className=\'ColDesLev0' + cccc + '\';">');
		document.write('<div id="' + nome + '" class="ColDesLev0' + cccc + '">' + txt + '</div></a>');}
	else
		{document.write('<div class="ColDesLev0no">' + txt + '</div>')}
	}
}

function wrlev0(nome, ll0, locat, txt) {
document.write('<img src="../images/vuoto.gif" width=130 height=5>');
cccc = "";
if (ll0) {cccc="s"}
	{if(locat != "")
		{document.write('<p>&nbsp;<a href="' + locat + '" class="ColDesLev0' + cccc + '" onmouseover="this.className=\'ColDesLev0over' + cccc + '\';" onmouseout="this.className=\'ColDesLev0' + cccc + '\';">' + txt + '</a>');}
	else
		{document.write('&nbsp;<div class="ColDesLev0no">' + txt + '</div>')}
	}
}
function wrlev1b(nome, ll0, ll1, locat, txt) {
cccc = "";
if (ll0) {
	if (ll1) {cccc="s"}
	if(locat != "")
		{document.write('<a href="' + locat + '" onmouseover="' + nome + '.className=\'ColDesLev1over' + cccc + '\';" onmouseout="' + nome + '.className=\'ColDesLev1' + cccc + '\';">');
		document.write('<div id="' + nome + '" class="ColDesLev1' + cccc + '">- ' + txt + '</div></a>');}
	else
		{document.write('<div class="ColDesLev1no">- ' + txt + '</div>')}
	}
}

function wrlev1(nome, ll0, ll1, locat, txt) {
cccc = "";
if (ll0) {
	if (ll1) {cccc="s"}
	if(locat != "")
		{document.write('<br>&nbsp;- <a href="' + locat + '" class="ColDesLev1' + cccc + '" onmouseover="this.className=\'ColDesLev1over' + cccc + '\';" onmouseout="this.className=\'ColDesLev1' + cccc + '\';">' + txt + '</a>');}
	else
		{document.write('<br>&nbsp;- <div class="ColDesLev1no">' + txt + '</div>')}
	}
}
function wrlev2b(nome, ll0, ll1, ll2, locat, txt) {
cccc = "";
if (ll0 && ll1) {
 	if (ll2) {cccc="s"}
	if(locat != "")
		{document.write('<a href="' + locat + '" onmouseover="' + nome + '.className=\'ColDesLev2over' + cccc + '\';" onmouseout="' + nome + '.className=\'ColDesLev2' + cccc + '\';">');
		document.write('<div id="' + nome + '" class="ColDesLev2' + cccc + '">' + txt + '</div></a>');}
	else
		{document.write('<div class="ColDesLev2no">' + txt + '</div>')}
	}
}
function wrlev2(nome, ll0, ll1, ll2, locat, txt) {
cccc = "";
if (ll0 && ll1) {
 	if (ll2) {cccc="s"}
	if(locat != "")
		{document.write('<br>&nbsp; &nbsp;<a href="' + locat + '"  class="ColDesLev2' + cccc + '" onmouseover="this.className=\'ColDesLev2over' + cccc + '\';" onmouseout="this.className=\'ColDesLev2' + cccc + '\';">' + txt + '</a>');}
	else
		{document.write('<br>&nbsp; &nbsp;<div class="ColDesLev2no">&nbsp; &nbsp;' + txt + '</div>')}
	}
}

function wrlev3(nome, ll0, ll1, ll2, ll3, locat, txt) {
cccc = "";
if (ll0 && ll1 && ll2)	{
 	if (ll3) {cccc="s"}
	if(locat != "")
		{document.write('<a href="' + locat + '" onmouseover="' + nome + '.className=\'ColDesLev3over' + cccc + '\';" onmouseout="' + nome + '.className=\'ColDesLev3' + cccc + '\';">');
		document.write('<div id="' + nome + '" class="ColDesLev3' + cccc + '">' + txt + '</div></a>');}
	else
		{document.write('<div class="ColDesLev3no">' + txt + '</div>')}
	}
}

function wrDicLev() {
	document.write('<p>');
	document.write('&nbsp;<a onclick="dicWin=window.open(\'../diz/home.htm\',\'dicWin\',\'width=551,height=450,status=no,resizable=no,toolbar=no,menubar=no\');" onmouseover="this.className=\'ColDesDizover\'" onmouseout="this.className=\'ColDesDiz\';" class="ColDesDiz"><span class="init">D</span>izionario</a>');
}

function clsAllW(){
	if (typeof(newWin)!='undefined'){window.newWin.close()}
	if (typeof(newW)!='undefined'){window.newW.close()}
	if (typeof(newW2)!='undefined'){window.newW2.close()}
	if (typeof(dicWin)!='undefined'){window.dicWin.close()}
	if (typeof(bacWin)!='undefined'){window.bacWin.close()}
}