function changeColor(obj, c) {
    if (document.getElementById)
	{
	p = document.getElementById(obj);
	p.style.color = c;
	}
    else if (document.layers)
	{
	document.layers[obj].color = c;
	}
    else if (document.all)
	{
     	eval("document.all." + obj + ".style.color = " + c);
	}
}

function changeBGcolor(obj, c) {
    if (document.getElementById)
	{
	p = document.getElementById(obj);
	p.style.backgroundColor = c;
	}
    else if (document.layers)
	{
	document.layers[obj].backgroundColor = c;
	}
    else if (document.all)
	{
     	eval("document.all." + obj + ".style.backgroundColor = " + c);
	}
}

function mostra(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 nascondi(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(obj) {
    if (document.getElementById)
	{
	p = document.getElementById(obj);
	p.style.display = '';
	}
    else if (document.layers)
	{
	document.layers[obj].display = '';
	}
    else if (document.all)
	{
     	eval("document.all." + obj + ".style.display = ''");
	}
}
function elimina(obj) {
    if (document.getElementById)
	{
	p = document.getElementById(obj);
	p.style.display = 'none';
	}
    else if (document.layers)
	{
	document.layers[obj].display = 'none';
	}
    else if (document.all)
	{
     	eval("document.all." + obj + ".style.display = 'none'");
	}
}

function get_winHeight() {
 if (typeof(window.innerHeight) == 'number') {get_winHeight = window.innerHeight;}
 else if (typeof(window.document.body.clientHeight) == 'number') {get_winHeight = window.document.body.clientHeight;}
}
function get_winWidth() {
 if (typeof(window.innerWidth) == 'number') {get_winWidth = window.innerWidth;}
 else if (typeof(window.document.body.clientWidth) == 'number') {get_winWidth = window.document.body.clientWidth;}
}

function lnk1(){
// parametri: testo, locazione, stile base, stile per mouseover
	style1 = "lnk"; style2 = "lnko";
	if (typeof(lnk1.arguments[2]) != "undefined" && lnk1.arguments[2] != "") {style1 = lnk1.arguments[2]}
	if (typeof(lnk1.arguments[3]) != "undefined" && lnk1.arguments[3] != "") {style2 = lnk1.arguments[3]}
	if (document.getElementById)
		{
		document.write('<a href="' + lnk1.arguments[1] + '"><span class="' + style1 + '" onmouseover="this.className=\'' + style2 + '\'" onmouseout="this.className=\'' + style1 + '\'">');
		document.write(lnk1.arguments[0]);
		document.write('</span></a>');
		}
	else if (document.layers)
		{
		document.write('<a href="' + lnk1.arguments[1] + '">');
		document.write(lnk1.arguments[0]);
		document.write('</a>');
		}
	else 
		{
		document.write('<a href="' + lnk1.arguments[1] + '"><span class="' + style1 + '" onmouseover="this.className=\'' + style2 + '\'" onmouseout="this.className=\'' + style1 + '\'">');
		document.write(lnk1.arguments[0]);
		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");
	if (document.getElementById)
		{
		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>');
		}
	else if (document.layers)
		{
		document.write('<a href="' + lnk2.arguments[1] + '" target="newWin">');
		document.write(lnk2.arguments[0]);
		document.write('</a>');
		}
	else 
		{
		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 lnk2b(){
// parametri: testo, locazione, stile base, stile per mouseover, nome finestra, opzioni finestra
	style1 = "lnk"; style2 = "lnko";
	wname = "newWin";
	if (typeof(lnk2b.arguments[2]) != "undefined" && lnk2b.arguments[2] != "") {style1 = lnk2b.arguments[2]}
	if (typeof(lnk2b.arguments[3]) != "undefined" && lnk2b.arguments[3] != "") {style2 = lnk2b.arguments[3]}
	if (typeof(lnk2b.arguments[4]) != "undefined" && lnk2b.arguments[4] != "") {wname = lnk2b.arguments[4]}
	ss = " "; if (typeof(lnk2b.arguments[5]) != "undefined") {ss = lnk2b.arguments[5]}
	opt = getopt(ss, "width=", "740");
	opt = opt + "," + getopt(ss, "height=", "500");
	opt = opt + "," + getopt(ss, "left=", "30");
	opt = opt + "," + getopt(ss, "top=", "50");
	opt = opt + "," + getopt(ss, "location=", "yes");
	opt = opt + "," + getopt(ss, "resizable=", "yes");
	opt = opt + "," + getopt(ss, "scrollbars=", "yes");
	opt = opt + ",menubar=yes,toolbar=yes,status=yes";
	if (document.getElementById)
		{
		document.write('<span class="' + style1 + '" onmouseover="this.className=\'' + style2 + '\'" onmouseout="this.className=\'' + style1 + '\'" onclick="' + wname + '=window.open(\'' + lnk2b.arguments[1] + '\',\'' + wname + '\',\'' + opt + '\')">');
		document.write(lnk2b.arguments[0]);
		document.write('</span>');
		}
	else 
		{
		document.write('<a href="' + lnk2b.arguments[1] + '" target="newWin">');
		document.write(lnk2b.arguments[0]);
		document.write('</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 clsAllW(){
	if (typeof(newWin)!='undefined'){window.newWin.close()}
	if (typeof(newW2)!='undefined'){window.newW2.close()}
	if (typeof(dicWin)!='undefined'){window.dicWin.close()}
	if (typeof(bacWin)!='undefined'){window.bacWin.close()}
}
