var update='2008-12-1 14:05:28';
ac.length++;
ac[ac.length-1]=100;
function showAc(){
document.write('');
document.write('
更新 '+update+' 北京時間 ');
document.write('
| 通貨種類 | 人民元 CNY | 米ドル USD | 日本円 JPY | 欧州通貨 XEU |
');
document.write('| 人民元 | 1 | '+getfloor(ac[0]/100)+' | '+getfloor(ac[1]/100)+' | '+getfloor(ac[2]/100)+' |
');
document.write('| 米ドル | '+getfloor(100/ac[0])+' | 1 | '+getfloor(ac[1]/ac[0])+' | '+getfloor(ac[2]/ac[0])+' |
');
document.write('| 日本円 | '+getfloor(100/ac[1])+' | '+getfloor(ac[0]/ac[1])+' | 1 | '+getfloor(ac[2]/ac[1])+' |
');
document.write('| 欧州通貨 | '+getfloor(100/ac[2])+' | '+getfloor(ac[0]/ac[2])+' | '+getfloor(ac[1]/ac[2])+' | 1 |
');
document.write('
');
}
function getfloor(vnum){
return Math.round(vnum*10000)/10000;
}
function sumAc(){
document.write('');
document.write('
');
document.write(' 為替計算機(レート更新/北京時間:'+update+' ):');
document.write('
');
initCalc();
}
function initCalc(){
document.getElementById('inp').value='';
document.getElementById('ans').value='';
initAc();
}
function initAc(){
document.getElementById('c1').options[0].value=ac[1];
document.getElementById('c1').options[2].value=ac[0];
document.getElementById('c1').options[3].value=ac[2];
document.getElementById('c2').options[0].value=ac[1];
document.getElementById('c2').options[2].value=ac[0];
document.getElementById('c2').options[3].value=ac[2];
document.getElementById('c1').options[1].value=ac[ac.length - 1];
document.getElementById('c2').options[1].value=ac[ac.length - 1];
outAc();
}
function outAc(){
document.getElementById('se').value=getfloor(document.getElementById('c2').options[document.getElementById('c2').selectedIndex].value/document.getElementById('c1').options[document.getElementById('c1').selectedIndex].value);
if (isnum(document.getElementById('inp').value)){
calc();
}
}
function calc(){
if (isnum(document.getElementById('inp').value)){
document.getElementById('ans').value=getfloor(document.getElementById('inp').value*document.getElementById('c1').options[document.getElementById('c1').selectedIndex].value/document.getElementById('c2').options[document.getElementById('c2').selectedIndex].value);
}else{
alert('Please input a Number');
document.getElementById('inp').focus;
}
}
function isnum(vnum){
if(vnum*1!=vnum){
return false;
}else{
return true;
}
}