Tvivler på du har ret i det du siger, men her er en version der lader dig gøre det.
<html>
<script language="JavaScript">
<!--
refString="abcdefghijklmnopqrstuvwxyzæøåABCDEFGHIJKLMNOPQRSTUVWXYZÆØÅ1234567890.?!,- "
normalCode=new Array('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','æ','ø','å','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','Æ','Ø','Å','1','2','3','4','5','6','7','8','9','0','.','?','!',',','-',' ');
beverCode=new Array('u','å','t','s','y','q','p','o','n','m','l','k','j','i','h','g','f','x','d','c','a','z','','r','e','v','ø','æ','b','U','Å','T','S','Y','Q','P','O','N','M','L','K','J','I','H','G','F','X','D','C','A','Z','','R','E','V','Ø','Æ','B','1','2','3','4','5','6','7','8','9','0','.','?','!',',','-',' ');
beverCode2=new Array('q','l','s','t','o','u','x','y','z','ø','å','b','æ','v','e','r','a','p','c','d','f','n','','g','h','i','m','j','k','Q','L','S','T','O','U','X','Y','Z','Ø','Å','B','Æ','V','E','R','A','P','C','D','F','N','','G','H','I','M','J','K','1','2','3','4','5','6','7','8','9','0','.','?','!',',','-',' ');
ulveCode=new Array('y','x','t','s','z','r','q','p','o','n','m','ø','k','j','i','h','g','f','d','c','å','æ','','b','a','e','v','l','u','Y','X','T','S','Z','R','Q','P','O','N','M','Ø','K','J','I','H','G','F','D','C','Å','Æ','','B','A','E','V','L','U','1','2','3','4','5','6','7','8','9','0','.','?','!',',','-',' ');
ulveCode2=new Array('q','r','s','t','p','x','y','z','æ','ø','å','n','u','l','v','e','a','b','c','d','m','o','','f','g','h','i','j','k','Q','R','S','T','P','X','Y','Z','Æ','Ø','Å','N','U','L','V','E','A','B','C','D','M','O','','F','G','H','I','J','K','1','2','3','4','5','6','7','8','9','0','.','?','!',',','-',' ');
juniorCode=new Array('v','t','s','q','p','m','l','k','z','å','h','g','f','æ','y','e','d','x','c','b','ø','a','','r','o','i','n','u','j','V','T','S','Q','P','M','L','K','Z','Å','H','G','F','Æ','Y','E','D','X','C','B','Ø','A','','R','O','I','N','U','J','1','2','3','4','5','6','7','8','9','0','.','?','!',',','-',' ');
juniorCode2=new Array('t','v','x','y','z','æ','ø','å','p','k','j','u','n','m','q','i','o','s','r','a','l','b','','c','d','e','f','g','h','T','V','X','Y','Z','Æ','Ø','Å','P','K','J','U','N','M','Q','I','O','S','R','A','L','B','','C','D','E','F','G','H','1','2','3','4','5','6','7','8','9','0','.','?','!',',','-',' ');
seniorCode=new Array('v','u','t','q','ø','p','m','l','z','k','j','h','g','æ','y','f','d','x','å','c','b','a','','r','o','i','n','e','s','V','U','T','Q','Ø','P','M','L','Z','K','J','H','G','Æ','Y','F','D','X','Å','C','B','A','','R','O','I','N','E','S','1','2','3','4','5','6','7','8','9','0','.','?','!',',','-',' ');
seniorCode2=new Array('u','v','x','y','l','z','æ','ø','p','å','s','e','n','m','q','i','o','t','k','r','a','b','','c','d','f','g','h','j','U','V','X','Y','L','Z','Æ','Ø','P','Å','S','E','N','M','Q','I','O','T','K','R','A','B','','C','D','F','G','H','J','1','2','3','4','5','6','7','8','9','0','.','?','!',',','-',' ');
clanCode=new Array('æ','y','å','x','v','u','t','s','r','q','p','ø','o','z','m','k','j','i','h','g','f','e','','d','b','n','a','l','c','Æ','Y','Å','X','V','U','T','S','R','Q','P','Ø','O','Z','M','K','J','I','H','G','F','E','','D','B','N','A','L','C','1','2','3','4','5','6','7','8','9','0','.','?','!',',','-',' ');
clanCode2=new Array('q','s','o','t','u','v','x','y','z','æ','ø','p','å','r','c','l','a','n','b','d','e','f','','g','h','i','j','k','m','Q','S','O','T','U','V','X','Y','Z','Æ','Ø','P','Å','R','C','L','A','N','B','D','E','F','','G','H','I','J','K','M','1','2','3','4','5','6','7','8','9','0','.','?','!',',','-',' ');
klanCode=new Array('æ','y','x','v','u','t','s','r','q','p','å','ø','o','z','m','j','i','h','g','f','e','d','','c','b','n','a','l','k','Æ','Y','X','V','U','T','S','R','Q','P','Å','Ø','O','Z','M','J','I','H','G','F','E','D','','C','B','N','A','L','K','1','2','3','4','5','6','7','8','9','0','.','?','!',',','-',' ');
morseCode=new Array('.-/','-.../','-.-./','-../','./','..-./','--./','..../','../','.---/','-.-/','.-../','--/','-./','---/','.--./','--.-/','.-./','.../','-/','..-/','...-/','.--/','-..-/','-.--/','--../','.-.-/','---./','.--.-/','.-/','-.../','-.-./','-../','./','..-./','--./','..../','../','.---/','-.-/','.-../','--/','-./','---/','.--./','--.-/','.-./','.../','-/','..-/','...-/','.--/','-..-/','-.--/','--../','.-.-/','---./','.--.-/','.----/','..---/','...--/','....-/','...../','-..../','--.../','---../','----./','-----/','','','','','','/');
akCode=new Array('k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','æ','ø','å','a','b','c','d','e','f','g','h','i','j','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','Æ','Ø','Å','A','B','C','D','E','F','G','H','I','J','1','2','3','4','5','6','7','8','9','0','.','?','!',',','-',' ');
ak2Code=new Array('t','u','v','w','x','y','z','æ','ø','å','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','T','U','V','W','X','Y','Z','Æ','Ø','Å','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','1','2','3','4','5','6','7','8','9','0','.','?','!',',','-',' ');
byteCode=new Array(new Array('10011111','010011111'),'','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','');
function encode(trans,Ord,text,codeEle,resEle){
var code = ""
var i=0
var antal = 0
if(trans.l==1){
var refString=trans.from.join("");
for (i=0; i<text.length; i++){
var p=refString.indexOf(text.charAt(i));
if(p>-1){
code+=trans.to[p];
}else{
code+="fejl";
}
}
}else if(trans.l>1){
for(var i=0;i<text.length;i+=trans.l){
var p=trans.from.indexOf(text.substr(i,trans.l))
if(p>-1){
code+=trans.to[p];
}else{
code+="fejl";
}
}
}else{
i=0;
while(i<text.length){
var d=1;
var add="fejl"
for(var p=0;p<trans.from.length;p++){
if(trans.from[p] instanceof Array){
found=false;
for(var q=0;q<trans.from[p].length;q++){
if(trans.from[p][q]==""){continue;}//<---special hack to avoid empty eternal loop
if(text.substr(i,trans.from[p][q].length)==trans.from[p][q]){
d=trans.from[p][q].length;
add=trans.to[p];
found=true;
break;
}
}
if(found)break;
}else{
if(trans.from[p]==""){continue;}//<---special hack to avoid empty eternal loop
if(text.substr(i,trans.from[p].length)==trans.from[p]){
d=trans.from[p].length;
add=trans.to[p];
break;
}
}
}
i+=d;
code+=add;
}
}
for(j = 0;j<Ord.length;j++ ){
for (i=0; i<code.length; i++){
if(code.substring(i, i+Ord[j].length) == Ord[j] ){
antal++
}
}
}
codeEle.value = code
return {antal:antal,ele:resEle};
}
function f(a,b){
return a.antal>=b.antal;
}
function translate(text){
r=new Array(
encode({from:normalCode,to:akCode,l:1},new Array(),text,document.outData2.outText2,null)
,encode({from:normalCode,to:morseCode,l:1},new Array(),text,document.outData.outText,null)
,encode({from:normalCode,to:ak2Code,l:1},new Array(),text,document.outData3.outText3,null)
,encode({from:normalCode,to:beverCode,l:1},new Array("hej","der","som","har","er","vi"),text,document.beverData.outbeverText1,document.matchbeverData.outmatchbeverText1)
,encode({from:normalCode,to:beverCode2,l:1},new Array("hej","der","som","har","er","vi","det","post","næste"),text,document.beverData2.outbeverText2,document.matchbeverData2.outmatchbeverText2)
,encode({from:normalCode,to:ulveCode,l:1},new Array("hej","der","som","har","er","vi"),text,document.ulveData.outulveText,document.matchulveData.outmatchulveText)
,encode({from:normalCode,to:ulveCode2,l:1},new Array("hej","der","som","har","er","vi"),text,document.ulveData2.outulveText2,document.matchulveData2.outmatchulveText2)
,encode({from:normalCode,to:juniorCode,l:1},new Array("hej","der","som","har","er","vi"),text,document.juniorData.outjuniorText,document.matchjuniorData.outmatchjuniorText)
,encode({from:normalCode,to:juniorCode2,l:1},new Array("hej","der","som","har","er","vi"),text,document.juniorData2.outjuniorText2,document.matchjuniorData2.outmatchjuniorText2)
,encode({from:normalCode,to:seniorCode,l:1},new Array("hej","der","som","har","er","vi"),text,document.seniorData.outseniorText,document.matchseniorData.outmatchseniorText)
,encode({from:normalCode,to:seniorCode2,l:1},new Array(),text,document.seniorData2.outseniorText2,null)
,encode({from:normalCode,to:clanCode,l:1},new Array(),text,document.clanData.outclanText,null)
,encode({from:normalCode,to:clanCode2,l:1},new Array(),text,document.clanData2.outclanText2,null)
,encode({from:byteCode,to:normalCode,l:0},new Array(),text,byteData.byteText,null)
,encode({from:normalCode,to:klanCode,l:1},new Array(),text,document.klanData.outklanText,null)
,encode({from:morseCode,to:normalCode,l:0},new Array(),text,document.fraMorseData.fraMorseText,null));
r.sort(f);
t=document.getElementById("AutoNumber1");
for(var i=0;i<r.length;i++){
if(r[i].ele!=null){
r[i].ele.value=r[i].antal;
var row=r[i].ele.parentNode.parentNode.parentNode.parentNode;
var p_row=row.parentNode;
p_row.insertBefore(row,p_row.firstChild);
if(r[i].antal==0){
row.style.visibility="hidden";
}else{
row.style.visibility="visible";
}
}
}
}
// -->
</script>
<body link="#FFFFFF" vlink="#FFFFFF">
<center>
<table border="1" width="712" bgcolor="#0000FF">
<tr>
<td width="353" bgcolor="#000080" align="left">
<p align="center"><b>
<font face="Arial, Helvetica, sans-serif" size="4" color="#FFFFFF">Kode</font></b><font color="#FFFFFF" size="4"
face="Arial, Helvetica, sans-serif"><b>oversætteren </b></font></td>
<td width="343" bgcolor="#000080" align="left">
<p align="center"><b>
<font face="Arial, Helvetica, sans-serif" size="4" color="#FFFFFF">
Ordfinderen </font></b><font color="#FFFFFF" size="4"
face="Arial, Helvetica, sans-serif"><b> </b></font></td>
</tr>
<tr>
<td width="353"><form name="inData">
<p align="left"><font color="#FFFFFF" size="3" face="Arial, Helvetica, sans-serif"><strong>Kildetekst:</strong></font><br>
<textarea name="inText" rows="4" cols="40" wrap="PHYSICAL"></textarea></p>
<p align="center"><input type="button" name="Translate" value="Oversæt" onclick="translate(document.inData.inText.value)"> <input type="reset" name="Reset"
value=" Ryd "> </p>
</form>
<form name="beverData">
<p align="left"><strong><font color="#FFFFFF" size="3" face="Arial, Helvetica, sans-serif">
<a name="Bæverkode (korrekt):">Bæverkode (korrekt</a></font><a name="Bæverkode (korrekt):"><font
color="#FFFFFF">):</font></a></strong><br>
<textarea name="outbeverText1" rows="4" cols="40" wrap="VIRTUAL"></textarea> </p>
</form>
<form name="beverData2">
<p align="left"><strong><font color="#FFFFFF" size="3" face="Arial, Helvetica, sans-serif">
<a name="Bæverkode (omvendt):">Bæverkode (</a></font><a name="Bæverkode (omvendt):"><font face="Arial, Helvetica, sans-serif" color="#FFFFFF">omvendt</font><font
color="#FFFFFF">):</font></a></strong><br>
<textarea name="outbeverText2" rows="4" cols="40" wrap="VIRTUAL"></textarea> </p>
</form>
<form name="ulveData">
<p align="left"><strong><font color="#FFFFFF" size="3" face="Arial, Helvetica, sans-serif">
<a name="Ulvekode (korrekt):">Ulvekode (korrekt</a></font><a name="Ulvekode (korrekt):"><font
color="#FFFFFF">):</font></a></strong><br>
<textarea name="outulveText" rows="4" cols="40" wrap="VIRTUAL"></textarea> </p>
</form>
<form name="ulveData2">
<p align="left"><strong><font color="#FFFFFF" size="3" face="Arial, Helvetica, sans-serif">
<a name="Ulvekode (omvendt):">Ulvekode (omvendt</a></font><a name="Ulvekode (omvendt):"><font
color="#FFFFFF">):</font></a></strong><br>
<textarea name="outulveText2" rows="4" cols="40" wrap="VIRTUAL"></textarea> </p>
</form>
<form name="juniorData">
<p align="left"><strong>
<font face="Arial, Helvetica, sans-serif" color="#FFFFFF">
<a name="Junior (korrekt):">Junior</a></font><a name="Junior (korrekt):"><font color="#FFFFFF" size="3" face="Arial, Helvetica, sans-serif">
(korrekt</font><font
color="#FFFFFF">):</font></a></strong><br>
<textarea name="outjuniorText" rows="4" cols="40" wrap="VIRTUAL"></textarea> </p>
</form>
<form name="juniorData2">
<p align="left"><strong>
<font face="Arial, Helvetica, sans-serif" color="#FFFFFF">
<a name="Junior (omvendt):">Junior</a></font><a name="Junior (omvendt):"><font color="#FFFFFF" size="3" face="Arial, Helvetica, sans-serif">
(omvendt</font><font
color="#FFFFFF">):</font></a></strong><br>
<textarea name="outjuniorText2" rows="4" cols="40" wrap="VIRTUAL"></textarea> </p>
</form>
<form name="seniorData">
<p align="left"><strong>
<font face="Arial, Helvetica, sans-serif" color="#FFFFFF">
<a name="Senior (korrekt):">Senior </a> </font>
<a name="Senior (korrekt):"><font color="#FFFFFF" size="3" face="Arial, Helvetica, sans-serif">
(korrekt</font><font
color="#FFFFFF">):</font></a></strong><br>
<textarea name="outseniorText" rows="4" cols="40" wrap="VIRTUAL"></textarea></p>
</form>
<form name="seniorData2">
<p align="left"><strong>
<font face="Arial, Helvetica, sans-serif" color="#FFFFFF">Senior </font><font color="#FFFFFF" size="3" face="Arial, Helvetica, sans-serif">
(omvendt</font><font
color="#FFFFFF">):</font></strong><br>
<textarea name="outseniorText2" rows="4" cols="40" wrap="VIRTUAL"></textarea> </p>
</form>
<form name="clanData">
<p align="left"><strong>
<font face="Arial, Helvetica, sans-serif" color="#FFFFFF">Clan </font><font color="#FFFFFF" size="3" face="Arial, Helvetica, sans-serif">
(korrekt</font><font
color="#FFFFFF">):</font></strong><br>
<textarea name="outclanText" rows="4" cols="40" wrap="VIRTUAL"></textarea> </p>
</form>
<form name="clanData2">
<p align="left"><strong>
<font face="Arial, Helvetica, sans-serif" color="#FFFFFF">Clan </font><font color="#FFFFFF" size="3" face="Arial, Helvetica, sans-serif">
(omvendt</font><font
color="#FFFFFF">):</font></strong><br>
<textarea name="outclanText2" rows="4" cols="40" wrap="VIRTUAL"></textarea> </p>
</form>
<form name="klanData">
<p align="left"><strong>
<font face="Arial, Helvetica, sans-serif" color="#FFFFFF">Klan </font><font color="#FFFFFF" size="3" face="Arial, Helvetica, sans-serif">
(korrekt</font><font
color="#FFFFFF">):</font></strong><br>
<textarea name="outklanText" rows="4" cols="40" wrap="VIRTUAL"></textarea> </p>
</form>
<form name="outData">
<p align="left"><strong><font color="#FFFFFF" size="3" face="Arial, Helvetica, sans-serif">
Til Morsekode</font><font
color="#FFFFFF">:</font></strong><br>
<textarea name="outText" rows="4" cols="40" wrap="VIRTUAL"></textarea> </p>
</form>
<form name="fraMorseData">
<p align="left"><strong><font color="#FFFFFF" size="3" face="Arial, Helvetica, sans-serif">
Fra Morsekode</font><font
color="#FFFFFF">:</font></strong><br>
<textarea name="fraMorseText" rows="4" cols="40" wrap="VIRTUAL"></textarea> </p>
</form>
<form name="outData2">
<p align="left"><strong><font color="#FFFFFF" size="3" face="Arial, Helvetica, sans-serif">A-K
med W (omvendt)</font><font
color="#FFFFFF">:</font></strong><br>
<textarea name="outText2" rows="4" cols="40" wrap="VIRTUAL"></textarea> </p>
</form>
<form name="outData3">
<p align="left"><strong><font color="#FFFFFF" size="3" face="Arial, Helvetica, sans-serif">A-K med W (korrekt</font><font
color="#FFFFFF">):</font></strong><br>
<textarea name="outText3" rows="4" cols="40" wrap="VIRTUAL"></textarea> </p>
</form>
<form name="byteData">
<p align="left"><strong><font color="#FFFFFF" size="3" face="Arial, Helvetica, sans-serif">Byte Code</font><font
color="#FFFFFF">):</font></strong><br>
<textarea name="byteText" rows="4" cols="40" wrap="VIRTUAL"></textarea> </p>
</form>
</td>
<td width="343" valign="top">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
<tr>
<td width="100%"><form name="matchbeverData">
<p align="left">
<input name="outmatchbeverText1" size="2" wrap="VIRTUAL"><b><font color="#FFFFFF" size="3" face="Arial, Helvetica, sans-serif"><a href="#Bæverkode (korrekt):">Match
i "Bæverkode (korrekt</a></font><a href="#Bæverkode (korrekt):"><font
color="#FFFFFF">)"</font></a></b></p>
</form></td>
</tr>
<tr>
<td width="100%"><form name="matchbeverData2">
<p align="left">
<input name="outmatchbeverText2" size="2" wrap="VIRTUAL"><b><font color="#FFFFFF" size="3" face="Arial, Helvetica, sans-serif"><a href="#Bæverkode (omvendt):">Match
i "Bæverkode (</a></font><a href="#Bæverkode (omvendt):"><font face="Arial, Helvetica, sans-serif" color="#FFFFFF">omvendt</font><font
color="#FFFFFF">)"</font></a></b></p>
</form>
</td>
</tr>
<tr>
<td width="100%"><form name="matchulveData">
<p align="left">
<input name="outmatchulveText" size="2" wrap="VIRTUAL"><b><font color="#FFFFFF" size="3" face="Arial, Helvetica, sans-serif"><a href="#Ulvekode (korrekt):">Match
i "Ulvekode (korrekt</a></font><a href="#Ulvekode (korrekt):"><font
color="#FFFFFF">)"</font></a></b></p>
</form>
</td>
</tr>
<tr>
<td width="100%"><form name="matchulveData2">
<p align="left">
<input name="outmatchulveText2" size="2" wrap="VIRTUAL"><b><font color="#FFFFFF" size="3" face="Arial, Helvetica, sans-serif"><a href="#Ulvekode (omvendt):">Match
i "Ulvekode (omvendt</a></font><a href="#Ulvekode (omvendt):"><font
color="#FFFFFF">)"</font></a></b></p>
</form>
</td>
</tr>
<tr>
<td width="100%"><form name="matchjuniorData">
<p align="left">
<input name="outmatchjuniorText" size="2" wrap="VIRTUAL"><b><font color="#FFFFFF" size="3" face="Arial, Helvetica, sans-serif"><a href="#Junior (korrekt):">Match
i "Juniorkode (korrekt</a></font><a href="#Junior (korrekt):"><font
color="#FFFFFF">)"</font></a></b></p>
</form></td>
</tr>
<tr>
<td width="100%"><form name="matchjuniorData2">
<p align="left">
<input name="outmatchjuniorText2" size="2" wrap="VIRTUAL"><b><font color="#FFFFFF" size="3" face="Arial, Helvetica, sans-serif"><a href="#Junior (omvendt):">Match
i "Juniorkode (omvendt</a></font><a href="#Junior (omvendt):"><font
color="#FFFFFF">)"</font></a></b></p>
</form></td>
</tr>
<tr>
<td width="100%"><form name="matchseniorData">
<p align="left">
<input name="outmatchseniorText" size="2" wrap="VIRTUAL"><b><font color="#FFFFFF" size="3" face="Arial, Helvetica, sans-serif"><a href="#Senior (korrekt):">Match
i "Seniorkode (korrekt</a></font><a href="#Senior (korrekt):"><font
color="#FFFFFF">)"</font></a></b></p>
</form></td>
</tr>
</table>
</td>
</tr>
</table>
</center>
<p align="left"> </p>
</body>
</html>