var D=document;
function getNum(i){var d=new Date;return(Math.abs(Math.floor(Math.random(d.getTime())*i)));}
var Rnd=getNum(100000);

function Calc2(){
var nex,i,res,f;
f=D.forms[0];
res=f.year[f.year.selectedIndex].value+f.mon[f.mon.selectedIndex].value+f.day[f.day.selectedIndex].value;
while(res.length>1){
nex=0;
for(i=0;i<res.length;i++){nex+=parseInt(res.substring(i,i+1),10);}
res=""+nex;
}
f.ans.value=nex;
return true;
}

function Calc(){
var nex,i,res,f;
f=D.forms[3];
res=f.mon[f.mon.selectedIndex].value+f.day[f.day.selectedIndex].value;
while(res.length>1){
nex=0;
for(i=0;i<res.length;i++){nex+=parseInt(res.substring(i,i+1),10);}
res=""+nex;
}
f.ans.value=nex;
return true;
}

function defN(s,ct){
if((s=='À')||(s=='È')||(s=='Ñ')||(s=='Ú'))return 1;
if((s=='Á')||(s=='É')||(s=='Ò')||(s=='Û'))return 2;
if((s=='Â')||(s=='Ê')||(s=='Ó')||(s=='Ü'))return 3;
if((s=='Ã')||(s=='Ë')||(s=='Ô')||(s=='Ý'))return 4;
if((s=='Ä')||(s=='Ì')||(s=='Õ')||(s=='Þ'))return 5;
if((s=='Å')||(s=='Í')||(s=='Ö')||(s=='ß'))return 6;
if((s=='¨')||(s=='Î')||(s=='×'))return 7;
if((s=='Æ')||(s=='Ï')||(s=='Ø'))return 8;
if((s=='Ç')||(s=='Ð')||(s=='Ù'))return 9;

return 0;
}
function rrk(nf){
var nex,i,s,res,f;
f=D.forms[nf];
res=f.rk.value;
nex=0;
for(i=0;i<res.length;i++){s=res.substring(i,i+1);s=s.toUpperCase(s);nex+=defN(s,nf);}
nex=""+nex;
while(nex.length>1){
res=0;
for(i=0;i<nex.length;i++){res+=parseInt(nex.substring(i,i+1),10);}
nex=""+res;
}
f.ires.value=nex;
return false;
}