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(e) 
{	
	// Recupero informazioni sull'evento
	if (!e) var e = window.event;
	//if (event && event.keyCode == 13) submitLogin() 	   
	if (e && e.keyCode == 13) submitLogin() 	   
}

function pressEnter2(e) 
{	
	// Recupero informazioni sull'evento
	if (!e) var e = window.event;
	if (e && e.keyCode == 13) submitLogin2() 	   
}
  	
function submitLogin() 
{
  if (document.LoginForm.username.value == '' || document.LoginForm.username.value == 'Username') 
  {
		alert("E' necessario indicare il nome utente");
		document.LoginForm.username.focus()
	} 
	else 
	{
	  if (document.LoginForm.password.value == '' || document.LoginForm.password.value == 'Password') 
	  {
		  alert("E' necessario indicare la password");
			document.LoginForm.password.focus()
	  } 
	  else 
	  {
		  if (document.LoginForm.agency_code.value == '' || document.LoginForm.agency_code.value == 'Cod. Agenzia') 
		  {
			  alert("E' necessario indicare il codice agenzia");
				document.LoginForm.agency_code.focus()
			} 
			else 
			{
		    document.LoginForm.OK.style.display="none"
				document.LoginForm.submit();
			}
		}
	}	       
}	

function submitLogin2() 
{
  if (document.LoginForm2.username.value == '' || document.LoginForm2.username.value == 'Username') 
  {
		alert("E' necessario indicare il nome utente");
		document.LoginForm2.username.focus()
	} 
	else 
	{
	  if (document.LoginForm2.password.value == '' || document.LoginForm2.password.value == 'Password') 
	  {
		  alert("E' necessario indicare la password");
			document.LoginForm2.password.focus()
	  } 
	  else 
	  {
		  if (document.LoginForm2.agency_code.value == '' || document.LoginForm2.agency_code.value == 'Cod. Agenzia') 
		  {
			  alert("E' necessario indicare il codice agenzia");
				document.LoginForm2.agency_code.focus()
			} 
			else 
			{
		    document.LoginForm2.OK.style.display="none"
				document.LoginForm2.submit();
			}
		}
	}
}

//funzioni personalizzate per la versione inglese
function submitLoginEng() 
{
  if (document.LoginForm.username.value == '' || document.LoginForm.username.value == 'Username') 
  {
		alert("Username field cannot be left blank");
		document.LoginForm.username.focus()
	} 
	else 
	{
	  if (document.LoginForm.password.value == '' || document.LoginForm.password.value == 'Password') 
	  {
		  alert("Password field cannot be left blank");
			document.LoginForm.password.focus()
	  } 
	  else 
	  {
		  if (document.LoginForm.agency_code.value == '' || document.LoginForm.agency_code.value == 'Agency code') 
		  {
			  alert("Agency code field cannot be left blank");
				document.LoginForm.agency_code.focus()
			} 
			else 
			{
		    document.LoginForm.OK.style.display="none"
				document.LoginForm.submit();
			}
		}
	}	       
}	

function submitLoginEng2() 
{
  if (document.LoginForm2.username.value == '' || document.LoginForm2.username.value == 'Username') 
  {
		alert("Username field cannot be left blank");
		document.LoginForm2.username.focus()
	} 
	else 
	{
	  if (document.LoginForm2.password.value == '' || document.LoginForm2.password.value == 'Password') 
	  {
		  alert("Password field cannot be left blank");
			document.LoginForm2.password.focus()
	  } 
	  else 
	  {
		  if (document.LoginForm2.agency_code.value == '' || document.LoginForm2.agency_code.value == 'Agency code') 
		  {
			  alert("Agency code field cannot be left blank");
				document.LoginForm2.agency_code.focus()
			} 
			else 
			{
		    document.LoginForm2.OK.style.display="none"
				document.LoginForm2.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();
}	


	
	