ncDef=     "abcdefghijklmnopqrstuvwxyz?*<>.,!@()&^£$%=+#"
    ncConvert=["åв¢Ðэƒgн!jк╚ми¤Þqяѕтüvwx¥ž?*<>●,!@()&^£$%=+#",
               "αв¢∂єƒgнιנкℓмησρqяѕтυνωχуz؟●«».,!@()&^£$%=+#",
               "48(d3f9h!jk1mn0pqr57uvwxy2?*<>▪,!☺()&^£$٪=+#",
               "ÁßČĎĔŦĞĤĨĴĶĹМŃŐРQŔŚŤÚVŴЖŶŹ؟●«».,!@()&^£$%=+#",
               "ค๒ς๔єŦﻮђเןкl๓ภ๏קợгรtยשฬץאz؟●«».,!☺()&^£$%=+#",
			   "ДВСĐΣ₣ĠИЇЈЌĽΜΝΘΡΩŔŠŦŬVẄҲΨŻ?٭<>▪!@﴿﴾₪^£$%=+#"
               ];
   TR=function(){
      str=$$("t").value.toLowerCase()
	  stru=$$("t").value.toUpperCase()
      strout=str
	  strout2=""
	  
	  
	  
      if ($$("reverse").checked){
		 strout=""
        tmp=" "+str
        tmplen=tmp.length
        for (i=0;i<tmplen;i++){
          strout+=tmp.charAt(tmplen-i)
        }      
      }
	  
	  if ($$("alternate").checked){
		  if ($$("reverse").checked){
			  str=strout
			  stru=strout.toUpperCase()
		  }
		  strout=""
		  tmp=" "+str
        tmplen=tmp.length
		  for (i=0;i<tmplen;i++){
          strout+=stru.charAt(i)
		  i++
		  strout+=str.charAt(i)
		  }
	  }
	  
	  if ($$("splitter").checked){
		
		str=strout
		tmp=" "+str
		strout=""
        tmplen=tmp.length
		  for (i=0;i<tmplen;i++){
			strout+=$$("splittertxt").value
          strout+=str.charAt(i)
		  }
	  }
	  
      if ($$("changes").checked){
        el=$$("slchanges")
        for (i=0;i<ncDef.length;i++){
			var rnd=Math.floor(Math.random()*3)
			
          strout=strout.replaceAll(ncDef.charAt(i),ncConvert[el.selectedIndex].charAt(i))
        }
      } 
      if ($$("symbole").checked){
        el=$$("slsymbole")
        tmp=el.options[el.selectedIndex].innerHTML
        strout=tmp.replace("(NICK)",strout)
      }
     
      
	  document.getElementById("t2f").innerHTML=strout
          document.getElementById("Ascii").value=strout
   }
   
   test=function(el){
      alert(el.options[el.selectedIndex].innerHTML)
   }
   change=function(el){TR()}

   String.prototype.replaceAll=function(old, rep ){
  foundat = 0;
  ret = this;
  do{
    foundat = ret.indexOf(old, foundat);
    if (foundat!=-1){
      ret = ret.substring(0,foundat)+rep+ret.substr(foundat+1);
      foundat += rep.length;
    }
  }while (foundat!=-1);
  return ret;
}

