<!--
function isNS4(){return (document.layers)?true:false;}
function isNS6(){return (document.getElementById && (navigator.appName=="Netscape"))?true:false;}
function isOP(){return (navigator.userAgent && navigator.userAgent.indexOf("Opera")!= -1)}

//Swap Images

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

function setTextOfLayerCouple(newText, outerLayerName, innerLayerName)
{
	var txt;
	txt= newText ;
	if (isNS4())
	{
		document.layers[outerLayerName].document.layers[innerLayerName].document.write(unescape(txt));
		document.layers[outerLayerName].document.layers[innerLayerName].document.close();
	}		
	else if (isNS6())
    	{
    		document.getElementById(innerLayerName).innerHTML=txt;
    	}
	else
    	{
    		document.all[innerLayerName].innerHTML = unescape(txt);
    	}
}

function initStyles()
{
	with (document)
	{
		write("<STYLE TYPE='text/css'><!--");
		if (isNS4() || isOP())
		{		
			write(".hiddenBox {display:block}\n");
			write(".openBox {display:block}");
		}
		else
		{
			write(".hiddenBox {display:none}\n");		
			write(".openBox {display:block}");
		}
		write("//--></STYLE>");
	}
}

initStyles();

function doToggle(wel)
{    
	if (isNS4() || isOP())
		return;
	else if (isNS6)
	{
		spanObj=document.getElementById(wel);
		if (spanObj.style.display!="block")
			document.getElementById(wel).style.display="block";
		else
			document.getElementById(wel).style.display="none";
	}
	else
	{        
		spanObj=document.all[wel];        
		if (spanObj.style.display!="block")
			document.all[wel].style.display="block";
		else
			document.all[wel].style.display="none";
	}
	
}

//----------------------
// search form functions
//----------------------

// Username and password validation
function validate(theForm)
{				  
	if (theForm.username.value.length < 6)
	{
		alert("Inserire Username di almeno 6 caratteri");
		theForm.username.value = "";
		theForm.username.focus();
		return false;
	}
	if (theForm.password.value.length < 6)
	{
		alert("Inserire Password di almeno 6 caratteri");
		theForm.password.value = "";
		theForm.password.focus();
		return false;
	}
}


// draw the serach box

var sb = "";

function drawSearchBox(baseuri)
{
	if ( baseuri==null ) baseuri = "";
	sb="<table width=\"440\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" height=\"30\">"+
	"<form name=\"login\"><tr><td bgcolor=\"#636363\" width=\"3\"><img src=\"img/nada.gif\"/></td>"+
	"<td width=\"1\" bgcolor=\"#ffffff\"><img src=\"img/nada.gif\"/></td>"+
	"<td bgcolor=\"#E0E0E0\" width=\"95\" align=\"right\"><img src=\"img/log_img_cosacerchi.gif\" width=\"72\" height=\"19\" alt=\"Cosa cerchi?\" title=\"Cosa cerchi?\"/></td>"+
	"<td bgcolor=\"#E0E0E0\" width=\"236\" align=\"center\">"+
	"<input type=\"text\" name=\"ricerca\" size=\"20\" style=\"width:210\"/>"+
	"</td><td width=\"40\" align=\"center\" bgcolor=\"#E0E0E0\"><a href=\"#\" onFocus=\"if(this.blur)this.blur()\"><img src=\"img/btn_vai.gif\" width=\"34\" height=\"19\" border=\"0\" alt=\"Vai\" title=\"Vai\"/></a></td>"+
	"<td width=\"65\" align=\"center\" bgcolor=\"#E0E0E0\"><a href=\"javascript:hideSearchBox()\" onFocus=\"if(this.blur)this.blur()\"><img src=\"img/btn_chiudi.gif\" width=\"53\" height=\"19\" border=\"0\" alt=\"Chiudi\" title=\"Chiudi\"/></a></td>"+
	"</form></tr></table>";
	if(!isNS4()) document.write(sb);	
}

// hide the search box

function hideSearchBox()
{
	MM_showHideLayers('hdInnerRicercaOff','','show');
	MM_showHideLayers('hdInnerRicercaOn','','hide');	
}

// show the search box

function showSearchBox()
{
	if (isNS4()) setTextOfLayerCouple(sb, "hdOuterRicerca", "hdInnerRicercaOn");
	MM_showHideLayers('hdInnerRicercaOff','','hide');
	MM_showHideLayers('hdInnerRicercaOn','','show');	
}

function showBox(number)
{   
	for (var i=1;i<5;i++)
	{
		MM_showHideLayers('divInner'+ i,'','hide');
	}
	MM_showHideLayers('divInner'+number,'','show');
	
}

function overShowLayer(layerName)
{
	if (!isNS4()){MM_showHideLayers(layerName,'','show');}	
}

function clickShowLayer(layerName)
{
	if (isNS4()){MM_showHideLayers(layerName,'','show');}	
}

function outHideLayer(layerName)
{
	if (!isNS4()){MM_showHideLayers(layerName,'','hide');}	
}

function clickHideLayer(layerName)
{
	if (isNS4()){MM_showHideLayers(layerName,'','hide');}	
}

function printClose(outerLayerName,innerLayerName,imgURINS,imgURIIE)
{
	if (isNS4())
	{
	document.layers[outerLayerName].document.layers[innerLayerName].document.write("<a href=\"#\" onClick=\"clickHideLayer('" + innerLayerName + "');\"><img src=\""+ imgURINS +"\" border=\"0\" alt=\"Chiudi\" title=\"Chiudi\"/></a>");
	}
	else
	{
	document.write("<img src=\""+ imgURIIE +"\"/>");
	}
}
//-->


										
											
											
										
										
											
											
										
									