var C = new Array("US$","HK$","£","€","¥","Peso");
var PC = new Array("Peso","US$","HK$","£","€","¥");

var F = new Array(1,7.7956872141146,0.61809337108836,0.72605822987004,81.819501924054,43.794380309301)

var PF = new Array(100,100/F[5],100/F[5]*F[1],100/F[5]*F[2],100/F[5]*F[3],100/F[5]*F[4]);

function OKStrOfPenny(X) { var T, S=new String(Math.round(X*100))
  while (S.length<3) S='0'+S;
  return S.substr(0, T=(S.length-2)) + ',' + (S.substr(T, 2)=='00'?'-':S.substr(T, 2)); }
  
function kurs(N)
{
var prop = "innerText";

if (!document.getElementById("wa01").innerText) prop="textContent";

if (F[0]!=0) eval('document.getElementById("wa01").' + prop + ' = OKStrOfPenny(F[0])');
if (F[1]!=0) eval('document.getElementById("wa02").' + prop + ' = OKStrOfPenny(F[1])');
if (F[2]!=0) eval('document.getElementById("wa03").' + prop + ' = OKStrOfPenny(F[2])');
if (F[3]!=0) eval('document.getElementById("wa04").' + prop + ' = OKStrOfPenny(F[3])');
if (F[4]!=0) eval('document.getElementById("wa05").' + prop + ' = OKStrOfPenny(F[4])');
if (F[5]!=0) eval('document.getElementById("wa06").' + prop + ' = OKStrOfPenny(F[5])');
if (N==2) {
if (F[0]!=0) eval('document.getElementById("wa11").' + prop + ' = OKStrOfPenny(F[0])');
if (F[1]!=0) eval('document.getElementById("wa12").' + prop + ' = OKStrOfPenny(F[1])');
if (F[2]!=0) eval('document.getElementById("wa13").' + prop + ' = OKStrOfPenny(F[2])');
if (F[3]!=0) eval('document.getElementById("wa14").' + prop + ' = OKStrOfPenny(F[3])');
if (F[4]!=0) eval('document.getElementById("wa15").' + prop + ' = OKStrOfPenny(F[4])');
if (F[5]!=0) eval('document.getElementById("wa16").' + prop + ' = OKStrOfPenny(F[5])');
}
}

function pkurs(N)
{
var prop = "innerText";

if (!document.getElementById("wa01").innerText) prop="textContent";

if (PF[0]!=0) eval('document.getElementById("wa01").' + prop + ' = OKStrOfPenny(PF[0])');
if (PF[1]!=0) eval('document.getElementById("wa02").' + prop + ' = OKStrOfPenny(PF[1])');
if (PF[2]!=0) eval('document.getElementById("wa03").' + prop + ' = OKStrOfPenny(PF[2])');
if (PF[3]!=0) eval('document.getElementById("wa04").' + prop + ' = OKStrOfPenny(PF[3])');
if (PF[4]!=0) eval('document.getElementById("wa05").' + prop + ' = OKStrOfPenny(PF[4])');
if (PF[5]!=0) eval('document.getElementById("wa06").' + prop + ' = OKStrOfPenny(PF[5])');
if (N==2) {
if (PF[0]!=0) eval('document.getElementById("wa11").' + prop + ' = OKStrOfPenny(PF[0])');
if (PF[1]!=0) eval('document.getElementById("wa12").' + prop + ' = OKStrOfPenny(PF[1])');
if (PF[2]!=0) eval('document.getElementById("wa13").' + prop + ' = OKStrOfPenny(PF[2])');
if (PF[3]!=0) eval('document.getElementById("wa14").' + prop + ' = OKStrOfPenny(PF[3])');
if (PF[4]!=0) eval('document.getElementById("wa15").' + prop + ' = OKStrOfPenny(PF[4])');
if (PF[5]!=0) eval('document.getElementById("wa16").' + prop + ' = OKStrOfPenny(PF[5])');
}
}

function waehrung(W)
{
if (Z[0]=="PHP") {
 var N = PC[W];
 var f = PF[W]/100;
} else {
 var N = C[W];
 var f = F[W];
}

if (document.getElementById("waeh01")) {
 var prop = "innerText";
 
 if (!document.getElementById("waeh01").innerText) prop="textContent";

 eval('document.getElementById("waeh01").'+prop+'=N');
 if (document.getElementById("waeh02")) eval('document.getElementById("waeh02").'+prop+'=N');
 if (document.getElementById("waeh03")) eval('document.getElementById("waeh03").'+prop+'=N');
 if (document.getElementById("waeh04")) eval('document.getElementById("waeh04").'+prop+'=N');
 if (document.getElementById("waeh05")) eval('document.getElementById("waeh05").'+prop+'=N');
 if (document.getElementById("waeh06")) eval('document.getElementById("waeh06").'+prop+'=N');
 if (document.getElementById("waeh07")) eval('document.getElementById("waeh07").'+prop+'=N');
 if (document.getElementById("waeh08")) eval('document.getElementById("waeh08").'+prop+'=N');
 if (document.getElementById("waeh09")) eval('document.getElementById("waeh09").'+prop+'=N');
 if (document.getElementById("waeh10")) eval('document.getElementById("waeh10").'+prop+'=N');
 if (document.getElementById("waeh11")) eval('document.getElementById("waeh11").'+prop+'=N');
 if (document.getElementById("waeh12")) eval('document.getElementById("waeh12").'+prop+'=N');
 if (document.getElementById("waeh13")) eval('document.getElementById("waeh13").'+prop+'=N');
 if (document.getElementById("waeh14")) eval('document.getElementById("waeh14").'+prop+'=N');
 if (document.getElementById("waeh15")) eval('document.getElementById("waeh15").'+prop+'=N');

 for (var i=1;i<Z.length;i++) {
  if (i<100) {
   s = "00"+i.toString();
   if (Z[i]!=0) eval('document.getElementById("pr" + s.substring(s.length-2,s.length)).'+prop+' = OKStrOfPenny(Z[i]*f)');
  } else {
    //alert(i);
   if (Z[i]!=0) eval('document.getElementById("pr" + i.toString()).'+prop+' = OKStrOfPenny(Z[i]*f)');
  }
 }

//alert("Sie haben auf " + N + " gewechselt. Ausgangsbasis ist US$. Die Werte sind ungefähr");
}
}

