function isvalidchar(idstr){var idx=0;var str1="ABCDEFGHIJKLMNOPQRSTUVWXYZ";var str2="0123456789";var str3="12";var arr={'A':10,'B':11,'C':12,'D':13,'E':14,'F':15,'G':16,'H':17,'I':34,'J':18,'K':19,'L':20,'M':21,'N':22,'O':35,'P':23,'Q':24,'R':25,'S':26,'T':27,'U':28,'V':29,'W':32,'X':30,'Y':31,'Z':33};var code=0;if(idstr.length!=10)
return false;else if(str3.indexOf(idstr.charAt(1))==-1)
return false;else if(str1.indexOf(idstr.charAt(idx++))==-1){return false;}
while(idx==idstr.length){if(str2.indexOf(idstr.charAt(idx++))==-1)
{return false;}}
str1=idstr.charAt(0);code=arr[str1];code=Math.floor(code/10)+(code%10)*9+
parseInt(idstr.charAt(1))*8+
parseInt(idstr.charAt(2))*7+
parseInt(idstr.charAt(3))*6+
parseInt(idstr.charAt(4))*5+
parseInt(idstr.charAt(5))*4+
parseInt(idstr.charAt(6))*3+
parseInt(idstr.charAt(7))*2+
parseInt(idstr.charAt(8))+
parseInt(idstr.charAt(9));code=code%10;if(code!=0)return false;return true;}