function checkCtnNo(strcntr,noTips)
{
	var hasLocale=false;
	try{
		if (Locale)
			hasLocale = true;
	}catch (ex) {
		hasLocale=false;
	}
	
    var num = new Array(10)
    for (i=0;i<11;i++)
    {
        num[i]=0;
    }
    len=strcntr.length;
    if (len != 11)
    {
    	if (!noTips)
        	alert(hasLocale?Locale.msg_ctnNoIllegal:'The Container No is wrong!');
        return false;
    }
    else 
    {
		exp=/^[a-zA-Z]{4}([0-9]){5,11}$/;
        if (! exp.exec(strcntr)) {
        	if (!noTips)
        		alert(hasLocale?Locale.msg_ctnNoIllegal:'The Container No is wrong!');
        	return false;
        }

        left=strcntr.substr(0,4);
        right=strcntr.substr(4,7);
        strcntrnum=strcntr.substr(10,1);
    
        char1=strcntr.substr(0,1);
        char2=strcntr.substr(1,1);
        char3=strcntr.substr(2,1);
        char4=strcntr.substr(3,1);
        //箱号字头
        num[0]=changechar(char1);
        num[1]=changechar(char2);
        num[2]=changechar(char3);
        num[3]=changechar(char4);

        //序列号
        num[4]=strcntr.substr(4,1);
        num[5]=strcntr.substr(5,1);
        num[6]=strcntr.substr(6,1);
        num[7]=strcntr.substr(7,1);
        num[8]=strcntr.substr(8,1);
        num[9]=strcntr.substr(9,1);
        //校验数字
        num[10]=strcntr.substr(10,1);

    	sum=num[0]+num[1]*2+num[2]*4+num[3]*8+num[4]*16+num[5]*32+num[6]*64+num[7]*128+num[8]*256+num[9]*512;
		result=sum%11;
		if (result == 10){result = 0}
		
    	if (result!= num[10]){
    		if (!noTips)
    			alert(hasLocale?Locale.msg_ctnNoIllegal:'The Container No is wrong!');
            return false;
        }else{
			return true;
		}            
    }    
}

function changechar(str){   
    if ((str=="a")||(str=="A"))
    return 10;
    else if ((str=="b")||(str=="B"))
    return 12;
        else if ((str=="c")||(str=="C"))
    return 13;
        else if ((str=="d")||(str=="D"))
    return 14;
        else if ((str=="e")||(str=="E"))
    return 15;
        else if ((str=="f")||(str=="F"))
    return 16;
        else if ((str=="g")||(str=="G"))
    return 17;
        else if ((str=="h")||(str=="H"))
    return 18;
        else if ((str=="i")||(str=="I"))
    return 19;
        else if ((str=="j")||(str=="J"))
    return 20;
        else if ((str=="k")||(str=="K"))
    return 21;
        else if ((str=="l")||(str=="L"))
    return 23;
        else if ((str=="m")||(str=="M"))
    return 24;
        else if ((str=="n")||(str=="N"))
    return 25;
        else if ((str=="o")||(str=="O"))
    return 26;
        else if ((str=="p")||(str=="P"))
    return 27;
        else if ((str=="q")||(str=="Q"))
    return 28;
        else if ((str=="r")||(str=="R"))
    return 29;
        else if ((str=="s")||(str=="S"))
    return 30;
        else if ((str=="t")||(str=="T"))
    return 31;
        else if ((str=="u")||(str=="U"))
    return 32;
        else if ((str=="v")||(str=="V"))
    return 34;
        else if ((str=="w")||(str=="W"))
    return 35;
        else if ((str=="x")||(str=="X"))
    return 36;
        else if ((str=="y")||(str=="Y"))
    return 37;
        else if ((str=="z")||(str=="Z"))
    return 38; 
        else 
    return -1000;
}

