function changelanguageid()
{
  
  ln = document.all("languageid").value
  oldloc = document.location.href
  i = oldloc.lastIndexOf('/')
  newloc = oldloc.substr(0,i - 2) + ln + oldloc.substr(i)
  window.location = newloc
}

function langfromurl(u)
{
  i = u.lastIndexOf('/')
  return(u.substr(i - 2,2))
}

function submitgoogle()
{
	objq = document.forms("google").all("q")
	objq.value = document.all("googlefind").value
	formg = document.forms("google") 
	formg.submit()
}

function submitcomment()
{
	objq = document.forms("comment").all("text")
	objq.value = document.all("commenttext").value
	formg = document.forms("comment") 
	formg.submit()
}

function UserLang()
{
  ln = window.navigator.userLanguage.substr(0,2)
  alert(ln)
  //alert("BROWSER=" + window.navigator.browserLanguage + " USER=" + window.navigator.userLanguage + " SYSTEM=" + window.navigator.systemLanguage)
  //ln = window.navigator.browserLanguage.substr(0,2)
  //ln = 'en'
  return(ln)	
}

function MT(Text)
{

  ln = langfromurl(document.location.href)
	//1
	if (ln.toLowerCase() == "en")
	{
		if (Text.toLowerCase() == "title")
		  return("Assistant to english pronunciation")
		if (Text.toLowerCase() == "preview")
		  return("Preview")
		if (Text.toLowerCase() == "home")
		  return("Home page")
		if (Text.toLowerCase() == "download")
		  return("Download")
		if (Text.toLowerCase() == "buy")
		  return("Buy")
		if (Text.toLowerCase() == "contact")
		  return("Contact us")
		if (Text.toLowerCase() == "links")
		  return("Links")
		if (Text.toLowerCase() == "comment")
		  return("Comment")
		if (Text.toLowerCase() == "send")
		  return("Send")
		if (Text.toLowerCase() == "find")
		  return("Search")
		if (Text.toLowerCase() == "help")
		  return("Manual")
	}  
	//2
	if (ln.toLowerCase() == "it")
	{
		if (Text.toLowerCase() == "title")
		  return("Assistente alla pronuncia inglese")
		if (Text.toLowerCase() == "preview")
		  return("Anteprima")
		if (Text.toLowerCase() == "home")
		  return("Pagina iniziale")
		if (Text.toLowerCase() == "download")
		  return("Scarica")
		if (Text.toLowerCase() == "buy")
		  return("Compra")
		if (Text.toLowerCase() == "contact")
		  return("Contatto")
		if (Text.toLowerCase() == "links")
		  return("Links")
		if (Text.toLowerCase() == "comment")
		  return("Commento")
		if (Text.toLowerCase() == "send")
		  return("Invia")
		if (Text.toLowerCase() == "find")
		  return("Ricerca")
		if (Text.toLowerCase() == "help")
		  return("Manuale")
	}  
	//3
	if (ln.toLowerCase() == "fr")
	{
		if (Text.toLowerCase() == "title")
		  return("Programme de assistance à prononce de l'anglais")
		if (Text.toLowerCase() == "preview")
		  return("Preview")
		if (Text.toLowerCase() == "home")
		  return("Home page")
		if (Text.toLowerCase() == "download")
		  return("Download")
		if (Text.toLowerCase() == "buy")
		  return("acquérir")
		if (Text.toLowerCase() == "contact")
		  return("Contact us")
		if (Text.toLowerCase() == "links")
		  return("Links")
		if (Text.toLowerCase() == "comment")
		  return("Comment")
		if (Text.toLowerCase() == "send")
		  return("Send")
		if (Text.toLowerCase() == "find")
		  return("Search")
		if (Text.toLowerCase() == "help")
		  return("Manual")
	}  
	//4
	if (ln.toLowerCase() == "es")
	{
		//
		if (Text.toLowerCase() == "title")
		  return('programa de la atención a pronuncia de inglés')
		  //return('programa de la atencion a pronuncia de ingles')
		if (Text.toLowerCase() == "preview")
		  return("Preview")
		if (Text.toLowerCase() == "home")
		  return("Home page")
		if (Text.toLowerCase() == "download")
		  return("Download")
		if (Text.toLowerCase() == "buy")
		  return("Buy")
		if (Text.toLowerCase() == "contact")
		  return("Contact us")
		if (Text.toLowerCase() == "links")
		  return("Links")
		if (Text.toLowerCase() == "comment")
		  return("Comment")
		if (Text.toLowerCase() == "send")
		  return("Send")
		if (Text.toLowerCase() == "find")
		  return("Search")
		if (Text.toLowerCase() == "help")
		  return("Manual")
	}  
	//5
	if (ln.toLowerCase() == "pt")
	{
		if (Text.toLowerCase() == "title")
		  return("programa do comparecimento a pronuncia do inglês")
		if (Text.toLowerCase() == "preview")
		  return("Preview")
		if (Text.toLowerCase() == "home")
		  return("Home page")
		if (Text.toLowerCase() == "download")
		  return("Download")
		if (Text.toLowerCase() == "buy")
		  return("Buy")
		if (Text.toLowerCase() == "contact")
		  return("Contact us")
		if (Text.toLowerCase() == "links")
		  return("Links")
		if (Text.toLowerCase() == "comment")
		  return("Comment")
		if (Text.toLowerCase() == "send")
		  return("Send")
		if (Text.toLowerCase() == "find")
		  return("Search")
		if (Text.toLowerCase() == "help")
		  return("Manual")
	}  
	//6
	if (ln.toLowerCase() == "de")
	{
		if (Text.toLowerCase() == "title")
		  return("Programm von Anwesenheit zu ausspricht von Englisch")
		if (Text.toLowerCase() == "preview")
		  return("Preview")
		if (Text.toLowerCase() == "home")
		  return("Home page")
		if (Text.toLowerCase() == "download")
		  return("Download")
		if (Text.toLowerCase() == "buy")
		  return("Buy")
		if (Text.toLowerCase() == "contact")
		  return("Contact us")
		if (Text.toLowerCase() == "links")
		  return("Links")
		if (Text.toLowerCase() == "comment")
		  return("Comment")
		if (Text.toLowerCase() == "send")
		  return("Send")
		if (Text.toLowerCase() == "find")
		  return("Search")
		if (Text.toLowerCase() == "help")
		  return("Manual")
	}  

}
