(function($) {
//解码
	$.GSMDecode = function(strCode, encode) {
		if(!strCode) return '';
		var charLen = (encode && encode.toLowerCase() == 'ascii') ? 2 : 4;
		var str = '';
		for(var i=0, len=strCode.length/charLen; i<len; i++) {
			var code = parseInt(strCode.substr(i*charLen, charLen), 16);
			str += String.fromCharCode(code);
		}
		return str;
	}
//编码
	$.GSMEncode = function(str, encode) {
		var strCode = '';
		var codeLen = (encode && encode.toLowerCase() == 'ascii') ? 2 : 4;
		var zero = '0000000000';
		for(var i=0, len=str.length; i<len; i++) {
			var code = str.charCodeAt(i).toString(16);
			var zeroNeed = Math.max(codeLen-code.length, 0);
			strCode += zero.substr(0, zeroNeed) + code;
		}
		return strCode.toUpperCase();	
		//return strCode;
	}
})(jQuery);