function showContent(nid){
	imgplus = "img/mini_arrow_plus.gif";
	imgminus ="img/mini_arrow_minus.gif";
	numblock=4;//numero di  blocchi nascosti + 1
	i=1;
	if (document.getElementById("contentpratiche"+nid).style.display != "none")
		{
			do {
				document.getElementById("officetitle"+i).style.display = "block";
				document.getElementById("officesubtitle"+i).style.display = "block";
				i++;
				}
				while(i<numblock);
				document.getElementById("contentpratiche"+nid).style.display = "none";
				document.getElementById("arrow"+nid).src= imgplus;
		}
	else
		{
			do {
				document.getElementById("officetitle"+i).style.display = "none";
				document.getElementById("officesubtitle"+i).style.display = "none";
				i++;
				}
				while(i<numblock);
				document.getElementById("officetitle"+nid).style.display = "block";
				document.getElementById("officesubtitle"+nid).style.display = "block";
				document.getElementById("contentpratiche"+nid).style.display = "block";
				document.getElementById("arrow"+nid).src= imgminus;
		}
	}
	
	
function redirectLingua()
{
  var lingua=navigator.systemLanguage;
  if (typeof(lingua) == 'undefined')
    lingua = window.navigator.language;  
  var pagina=document.URL;
  if(lingua=="it") 
  {
  	if(pagina.indexOf("ita")<0) this.document.location='/login/ita_bt_home.htm';
  }
  else 
  {
  	if(pagina.indexOf("eng")<0) this.document.location='/login/eng_bt_home.htm';
  }
}
	
	
function pressEnter() 
{	
  if (window.event && window.event.keyCode == 13) submitLogin() 	   
}
  	
function submitLogin() 
{
  if (document.LoginForm.username.value == '') 
  {
		alert("E' necessario indicare il nome utente");
		document.LoginForm.username.focus()
	} 
	else 
	{
	  if (document.LoginForm.password.value == '') 
	  {
		  alert("E' necessario indicare la password");
			document.LoginForm.password.focus()
	  } 
	  else 
	  {
		  if (document.LoginForm.agency_code.value == '') 
		  {
			  alert("E' necessario indicare il codice agenzia");
				document.LoginForm.agency_code.focus()
			} 
			else 
			{
		    document.LoginForm.OK.style.display="none"
				document.LoginForm.submit();
			}
		}
	}	       
}		
	
	
function inviaFormIta()
{
			
	var obbligatori="";
	
	if(document.forms['RichiestaForm'].cli_nome.value=="") obbligatori += "Nome dell'agenzia\n";	
	if(document.forms['RichiestaForm'].cli_nazione.value=="") obbligatori += "Nazione\n";	
	if(document.forms['RichiestaForm'].cli_telefono.value=="") obbligatori += "Telefono\n";	
	if(document.forms['RichiestaForm'].COGNOME.value=="") obbligatori += "Cognome\n";	
	if(document.forms['RichiestaForm'].NOME.value=="") obbligatori += "Nome\n";	
	if(document.forms['RichiestaForm'].DIRET_TEL.value=="") obbligatori += "Telefono\n";	
	if(document.forms['RichiestaForm'].DIRET_FAX.value=="") obbligatori += "Fax\n";	
	if(document.forms['RichiestaForm'].DIRET_EMAIL.value=="") obbligatori += "E-mail\n";
	
	if(obbligatori=="")
	{
	  document.forms['RichiestaForm'].submit();
	}
  else
  {
  	alert("I seguenti campi sono obbligatori:\n\n" + obbligatori);
  }	
}	


function inviaFormEng()
{
	alert("inviaFormEng()");
	document.forms['LoginForm'].submit();
}	


	
	