Собственно вот сам код:
function message(name,surname,age){
MyReg = new RegExp("\\D+");
if (!MyReg.test(age)) {
a=true;
}
else{
a=false;
}
var var1=name- ((name/1 | 0)*1);
var var2=surname - ((surname/1 | 0)*1);
if ((a==false) && (var1 ==0) && (var2 == 0) && ((age!="")&&(surname!="")&&(name!=""))){
if ((age==1)||(age==21)||(age==31)||(age==41)||(age==51)||(age==61)||(age==71)||(age==81)||(age==91)||(age==101)){
alert("Вы-"+name+surname+ "и вам"+' ' +age+"год");
}
else if ((age=>2 & age<=4)||(age=>22 & age<=24)||(age=>32 & age<=34)||(age=>42 & age<=44)||(age=>52 & age<=54)||(age=>62 & age<=64)||(age=>72 & age<=74)||(age=>82 & age<=84)||(age=>92 & age<=94)){
alert("Вы-"+name+surname+ "и вам"+' ' +age+"года");
}
else if ((age=>5 & age<=20)||(age=>25 & age<=30)||(age=>35 & age<=40)||(age=>34 & age<=50)||(age=>55 & age<=60)||(age=>65 & age<=70)||(age=>75 & age<=80)||(age=>85 & age<=90)||(age=>95 & age<=100)){
alert("Вы-"+name+surname+ "и вам"+' ' +age+"лет");
}
if (a==true) {
alert("ERROR!!!");
}
Начиная с 16 строки.
Может кто поможет...моя почта:
mister.cypukat@gmail.com
Screen:
http://imgdepo.ru/id/i6714583