function TTS_OnOff(dir){
var DRS = dir.split("/");
var ob = new Array();
ob[0]='tts_source';
ob[1]='tts_target';
 for (var i=0; i<2; i++){
  if(DRS[i] == "zh" || DRS[i] == "en" || DRS[i] == "enf" || DRS[i] == "fr" || DRS[i] == "de" || DRS[i] == "it" || DRS[i] == "ja" || DRS[i] == "ko" || DRS[i] == "pt" || DRS[i] == "ru" || DRS[i] == "es")	
	document.getElementById(ob[i]).style.display='block';
  else  document.getElementById(ob[i]).style.display='none';
 }
}

function StartTTS(ob){
dir = document.getElementById('langs').value;
var obName;
var segdir = dir.split("/");
 if(ob==1) {dir = segdir[0]; obName = "source";}
 else      {dir = segdir[1]; obName = "target";}
 text = window.frames[obName].document.form.text.value;
 

  for(var i=0; i<text.length; i++) {
     if (text.indexOf("&")!=-1)           text = text.replace("&"," ");
     if (text.indexOf("\r")!=-1)           text = text.replace("\r"," ~|~");
  }

//--------------------------------------------------------------------------------
if(dir=="en") dir="enf"; // Switching the dafault English Character to the Female.
//--------------------------------------------------------------------------------


 document.location.href ="http://free-translator.imtranslator.net/speech.asp?url=FT&dir="+dir+"&text="+text;
}


function Baner300x250(){
window.frames['ifr300x250'].document.location.reload();
}

