﻿function SNDA_CheckAccount() {
	// 唯一计数器
	this.jsc = new Date().getTime();
	
	// SessionId
	this.sessionId = "";

	// SessionId 表单对象
	this.sessionIdObj = null
	
	// 是否是XHTML
	this.isXhtml = (function ()
	{
		return /-\/\/W3C\/\/DTD\s+XHTML/i.test((document.doctype && document.doctype.publicId) || document.childNodes[0].nodeValue);
	})();

	// 账号对象
	this.accountObj = null;

	// 账号显示对象
	this.accountShowObj = null;

	// 密码对象
	this.passwordObj = null;

	// 弹出框
	this.alertBox = null;

	// 弹出框背景
	this.alertBoxBg = null;

	// 弹出框标题
	this.alertBoxTitle = null;

	// 弹出框主体
	this.alertBoxBody = null;
	
	// 弹出框主体背景
	this.alertBoxBodyBg = null;

	// 弹出框提示信息
	this.alertBoxMessage = null;

	// 弹出框内容
	this.alertBoxContent = null;

	// 弹出框底部
	this.alertBoxFoot = null;

	// 是否验证成功
	this.isSuccess = false;	
	
	// 扩展信息
	this.ExpendInfo = new Object();

	// 接口URL
	this.interfaceUrl = function() {
		return this.BaseUrl + "CheckService.ashx?jsonp={jsonp}";
	}

	this.LoginFailedFunc = function(data) {
		alert("系统错误，请稍候再试!");
	}

	this.LoginSuccessFunc = function(data) {
		this.sessionId = data.sessionId;
		var thisObj = this;
		var doc = this.BoxWindow.document;

		switch (data.nextAction) {
			// 静态密码界面       
			case "ValidatePTStaticPassword":
				if (!data.isSuccess) {
					alert(data.title);
				}
				break;
			// 验证码界面       
			case "ValidateVerifyCode":
				this.ShowBox(data.title, data.message, "<img id='check_verifyImage' /><div id='check_verifyChangeImage'><span>看不清，换一张</span></div><div><input type='text' id='check_verifyCode' maxlength='10' /></div><div style='margin-top:5px;'><input type='button' id='check_verifyCode_submit' class='check_box_button' value='确认'>&nbsp;<input type='button' id='check_verifyCode_close' class='check_box_button' value='关闭'></div>");
				var verifyCodeObj = doc.getElementById("check_verifyCode");
				var verifyImageObj = doc.getElementById("check_verifyImage");
				var verifyChangeImage = doc.getElementById("check_verifyChangeImage");
				var verifyCodeSumitObj = doc.getElementById("check_verifyCode_submit");
				var verifyCodeCloseObj = doc.getElementById("check_verifyCode_close");

				var checkVerifyCode = function() {
					if (verifyCodeObj.value == "") {
						alert("请输入验证码");
						verifyCodeObj.focus();
						return;
					}

					thisObj.HideBox.apply(thisObj);
					thisObj.SubmitInfo.apply(thisObj, [{verifyCode:verifyCodeObj.value}]);
				}

				verifyCodeSumitObj.onclick = function() {
					checkVerifyCode();
				}
				
				verifyCodeCloseObj.onclick = function() {
					thisObj.HideBox();
					thisObj.sessionId = "";
				}

				verifyCodeObj.onkeypress = function(e) {
					e = e || thisObj.BoxWindow.event;
					if (e.keyCode == 13) {
						checkVerifyCode();
					}
				}

				verifyImageObj.className = "check_verifyImage";
				verifyChangeImage.className = "check_verifyImage_change";
				var changeVerifyImage = verifyImageObj.onclick = verifyChangeImage.onclick = function() {
					verifyImageObj.src = thisObj.BaseUrl + "VerifyCodeImage.ashx?getnew=true&accountType=" + thisObj.AccountType + "&sessionId=" + thisObj.sessionId + "&t=" + thisObj.jsc++;
				}

				changeVerifyImage();

				setTimeout(function() {
					try
					{
						verifyCodeObj.focus();
					}
					catch(e){}
				}, 300);

				break;
			// 密宝界面       
			case "ValidatePTDynamicPassword":
				this.ShowBox(data.title, data.message, "<div id='check_dynPassword_bg'><input type='text' id='check_dynPassword' /></div><div style='margin-top:5px;'><input type='button' id='check_dynPassword_submit' class='check_box_button' value='确认'>&nbsp;<input type='button' id='check_dynPassword_close' class='check_box_button' value='关闭'></div>");
				var dynPasswordObj = doc.getElementById("check_dynPassword");
				var dynPasswordBgObj = doc.getElementById("check_dynPassword_bg");
				var dynPasswordSubmitObj = doc.getElementById("check_dynPassword_submit");
				var dynPasswordCloseObj = doc.getElementById("check_dynPassword_close");

				var keylength = data.expendInfo.keyLength;
				if (data.expendInfo.eKeyType == "A8") {
					dynPasswordBgObj.className = "check_dynBgPassword_a8";
					dynPasswordObj.className = "check_dynPassword_a8";
				}
				else {
					dynPasswordBgObj.className = "check_dynBgPassword_normal";
					dynPasswordObj.className = "check_dynPassword_normal";
					dynPasswordObj.value = new Array(keylength + 1).join("_");
					dynPasswordObj.keylist = data.expendInfo.keyList.split(',');
					dynPasswordObj.inputkey = [];
					dynPasswordObj.onkeydown = function(e)
					{
						e = e || thisObj.BoxWindow.event;
						code = e.keyCode;
						
						if (code == 116) {
							return true;
						}
						
						if (this.inputkey.length > 0 && code == 8) {
							this.inputkey.length--;
						}
						
						if (this.inputkey.length >= this.keylist.length) {
							return false;
						}						
						
						if (	(e.keyCode >= 96 && e.keyCode <= 105) ||
								(e.keyCode >= 48 && e.keyCode <= 57)) {
							var num = code >= 96 ? code - 96 : code - 48;							
							this.inputkey[this.inputkey.length] = num;
						}
						
						var showstr = "";
						for (var i=0,j=0; i<keylength; i++) {
							if ((i + 1) == this.keylist[j]) {
								showstr += isNaN(this.inputkey[j]) ? "_" : this.inputkey[j];
								j++;
							}
							else {
								showstr += "_";
							}
						}
						this.value = showstr;
						return false;						
					}
				}

				dynPasswordObj.maxLength = keylength;

				var submitDynPassword = function() {
					if (dynPasswordObj.value == "") {
						alert("请输入动态密码");
						dynPasswordObj.focus();
						return;
					}

					thisObj.HideBox.apply(thisObj);
					thisObj.SubmitInfo.apply(thisObj, [{dynPassword:dynPasswordObj.value}]);
				}

				dynPasswordSubmitObj.onclick = function() {
					submitDynPassword();
				}

				dynPasswordCloseObj.onclick = function() {
					thisObj.HideBox();
					thisObj.sessionId = "";
				}

				dynPasswordObj.onkeypress = function(e) {
					e = e || thisObj.BoxWindow.event;
					if (e.keyCode == 13) {
						submitDynPassword();
					}
				}

				setTimeout(function() {
					try
					{
						dynPasswordObj.focus();
					}
					catch(e){}
				}, 300);

				break;
			// 安全卡界面       
			case "ValidatePTECard":
				this.ShowBox(data.title, data.message, "<input type='text' id='check_ecardPassword' /><div style='margin-top:5px;'><input type='button' id='check_ecardPassword_submit' class='check_box_button' value='确认'>&nbsp;<input type='button' id='check_ecardPassword_close' class='check_box_button' value='关闭'></div>");
				var ecardPasswordObj = doc.getElementById("check_ecardPassword");
				var ecardPasswordSubmitObj = doc.getElementById("check_ecardPassword_submit");
				var ecardPasswordCloseObj = doc.getElementById("check_ecardPassword_close");

				var submitEcardPassword = function() {
					if (ecardPasswordObj.value == "") {
						alert("请输入安全卡密码");
						ecardPasswordObj.focus();
						return;
					}

					thisObj.HideBox.apply(thisObj);
					thisObj.SubmitInfo.apply(thisObj, [{EcardPwd:ecardPasswordObj.value}]);
				}

				ecardPasswordSubmitObj.onclick = function() {
					submitEcardPassword();
				}

				ecardPasswordCloseObj.onclick = function() {
					thisObj.HideBox();
					thisObj.sessionId = "";
				}

				ecardPasswordObj.onkeypress = function(e) {
					e = e || thisObj.BoxWindow.event;
					if (e.keyCode == 13) {
						submitEcardPassword();
					}
				}

				setTimeout(function() {
					try
					{
						ecardPasswordObj.focus();
					}
					catch(e){}
				}, 300);

				break;
			// 盛大用户认证       
			case "ValidateSndaDynPassword":
				this.ShowBox(data.title, data.message, "<input type='text' id='check_sndaDynPassword' /><div style='margin-top:5px;'><input type='button' id='check_sndaDynPassword_submit' class='check_box_button' value='确认'>&nbsp;<input type='button' id='check_sndaDynPassword_close' class='check_box_button' value='关闭'></div>");
				var sndaDynPasswordObj = doc.getElementById("check_sndaDynPassword");
				var sndaDynPasswordSubmitObj = doc.getElementById("check_sndaDynPassword_submit");
				var sndaDynPasswordCloseObj = doc.getElementById("check_sndaDynPassword_close");

				var submitSndaDynPassword = function() {
					if (sndaDynPasswordObj.value == "") {
						alert("请输入密宝");
						sndaDynPasswordObj.focus();
						return;
					}

					thisObj.HideBox.apply(thisObj);
					thisObj.SubmitInfo.apply(thisObj, [{SndaDynPassword:sndaDynPasswordObj.value}]);
				}

				sndaDynPasswordSubmitObj.onclick = function() {
					submitSndaDynPassword();
				}

				sndaDynPasswordCloseObj.onclick = function() {
					thisObj.HideBox();
					thisObj.sessionId = "";
				}

				sndaDynPasswordObj.onkeypress = function(e) {
					e = e || thisObj.BoxWindow.event;
					if (e.keyCode == 13) {
						submitSndaDynPassword();
					}
				}

				setTimeout(function() {
					try
					{
						sndaDynPasswordObj.focus();
					}
					catch(e){}
				}, 300);

				break;
			// 验证成功       
			case "ValidateSuccess":
				break;
			// 其他
			default:
				alert(data.title);
				break;
		}

		if (data.isSuccess) {
			this.ValidateSuccess();
		}
	}

	this.ValidateSuccess = function() {
		if (this.accountObj.value != "" && !this.isSuccess) {
			this.accountObj.disabled = true;
			//this.accountObj.style.visibility = "hidden";
			this.accountObj.style.display = "none";
			this.passwordObj.disabled = true;
			//this.passwordObj.style.visibility = "hidden";
			this.accountShowObj.style.display = "block";
			this.accountShowObj.getElementsByTagName("span")[0].innerHTML = this.accountObj.value;

			this.sessionIdObj.value = this.sessionId;
			this.isSuccess = true;
			this.onvalidateOk();
		}
	}
}

// 账号类型
SNDA_CheckAccount.prototype.BaseUrl;

// 账号类型
SNDA_CheckAccount.prototype.AccountType;

// 应用编号
SNDA_CheckAccount.prototype.ApplicationId;

// 内容模板
SNDA_CheckAccount.prototype.HeadTemplate = "";
SNDA_CheckAccount.prototype.ItemTemplate = "<div class='checkpt_uiitem'><div class='check_title'>{title}</div><div class='check_input'>{input}</div></div>";
SNDA_CheckAccount.prototype.FootTemplate = "";

// 提示框窗口
SNDA_CheckAccount.prototype.BoxWindow = (function () {
	var curwin = window;	
	for (var i=0; i<5 && curwin && curwin != top; i++) {
		try
		{
			if (curwin.parent && curwin.parent.document &&
				((	curwin.parent.document.frames && curwin.parent.document.frames.length) ||
					curwin.parent.document.getElementsByTagName("iframe").length))
			{
			
				var frm =	(curwin.parent.document.frames && curwin.parent.document.frames[0] && curwin.parent.document.frames[0].frameElement.tagName.toLowerCase() == "iframe") ||
							(curwin.parent.document.getElementsByTagName && curwin.parent.document.getElementsByTagName("iframe")[0])
				
				if (frm) {
					curwin = curwin.parent;
				}
				else {
					break;
				}			
			}
		}
		catch(e)
		{
			break;
		}
	}
	if (!curwin)
		curwin = window;
	
	return curwin;
})();

// 自定义样式文件
SNDA_CheckAccount.prototype.Style = null;

// 显示验证控件
SNDA_CheckAccount.prototype.Rander = function(randerObj) {
	if (!this.BaseUrl || !this.AccountType || !this.ApplicationId) {
		alert("没有提供 BaseUrl , AccountType 或 ApplicationId 内容");
		return;
	}

	if (!/\/$/.test(this.BaseUrl))
		this.BaseUrl = this.BaseUrl + "/";

	var addInjs = ["Js/Barrett.js", "Js/BigInt.js", "Js/RSA.js"];

	for (var i = 0; i < addInjs.length; i++) {
		this.LoadUrl(this.BaseUrl + addInjs[i]);
	}
	
	// 样式列表
	var stylefile = "style.css";
	var stylehtmlfile = "style_html.css";
	var styleList = {
		"default":this.BaseUrl + "Skin/default/",
		"aion":this.BaseUrl + "Skin/aion/",
		"bnb":this.BaseUrl + "Skin/bnb/"
	}

	var stylePath = this.BaseUrl + "style/";
	this.SetStyle(document, stylePath + stylefile);
	this.SetStyle(document, (styleList[this.Style] || styleList["default"]) + stylefile);
	if (!this.isXhtml) this.SetStyle(document, (styleList[this.Style] || styleList["default"]) + stylehtmlfile);
	if (window != this.BoxWindow) {
		this.SetStyle(this.BoxWindow.document, stylePath + stylefile);
		this.SetStyle(this.BoxWindow.document, (styleList[this.Style] || styleList["default"]) + stylefile);
		if (!this.isXhtml) this.SetStyle(this.BoxWindow.document, (styleList[this.Style] || styleList["default"]) + stylehtmlfile);
	}

	var html = this.HeadTemplate;
	var template = this.ItemTemplate;

	html += template.replace(/\{title(:([a-z0-9\-\_\s]+))?\}/gi, "<span class='$2'>账号</span>")
					.replace(/\{input(:([a-z0-9\-\_\s]+))?\}/gi, "<!--<div style='position:relative'>--><input type='text' id='check_account' name='check_account' maxlength='30' class='$2' /><span id='check_account_show'><span></span></span><!--</div>-->");

	html += template.replace(/\{title(:([a-z0-9\-\_\s]+))?\}/gi, "<span class='$2'>密码</span>")
					.replace(/\{input(:([a-z0-9\-\_\s]+))?\}/gi, "<input type='password' id='check_password' name='check_password' maxlength='30' class='$2' />");

	html += "<input type='hidden' id='check_sessionId' name='check_sessionId' />"

	html += this.FootTemplate;

	if (randerObj) {
		randerObj.innerHTML = html;
	}
	else {
		document.write(html);
	}

	this.sessionIdObj = document.getElementById("check_sessionId");
	this.accountObj = document.getElementById("check_account");
	this.accountShowObj = document.getElementById("check_account_show");
	this.passwordObj = document.getElementById("check_password");

	var thisObj = this;

	this.accountObj.onkeypress = this.passwordObj.onkeypress = function(e) {
		e = e || event;
		if (e.keyCode == 13) {
			thisObj.CheckAccount();
		}
	}

	this.accountShowObj.className = "check_account_text";
	this.accountShowObj.style.display = "none";

	var changeAccountObj = document.createElement("span");
	changeAccountObj.innerHTML = "更换";
	changeAccountObj.className = "check_changeAccount_default";
	changeAccountObj.onmouseover = function() {
		this.className = "check_changeAccount_hover";
	}
	changeAccountObj.onmouseout = function() {
		this.className = "check_changeAccount_default";
	}
	changeAccountObj.onclick = function() {
		thisObj.ResetAccount.apply(thisObj);
	}

	this.accountShowObj.appendChild(changeAccountObj);

	this.BoxWindow.onresize = function() {
		thisObj.ResizeBox.apply(thisObj);
	}

	window.setInterval(function() {
		if (thisObj.passwordObj && thisObj.passwordObj.value == "" && thisObj.passwordObj.disabled) {
			thisObj.ResetAccount.apply(thisObj);
		}
	}, 100);
}

// 验证账号
SNDA_CheckAccount.prototype.CheckAccount = function() {
	if (this.isSuccess) {
		this.onvalidateOk();
		return;
	}

	if (this.accountObj.value == "") {
		alert("请输入您的账号");
		this.accountObj.focus();
		return;
	}

	if (this.passwordObj.value == "") {
		alert("请输入您的密码");
		this.passwordObj.focus();
		return;
	}

	this.SubmitInfo();
}

// 调用Url接口
SNDA_CheckAccount.prototype.LoadUrl = function(url, func, errorFunc, params) {
	var jsonp = "jsonp" + this.jsc++;
	var checkObj = this;
	var head = document.getElementsByTagName("head")[0];
	var script = document.createElement("script");
	var oldCharset = document.charset;
	var url = url;

	if (func || window.ActiveXObject) {
		window[jsonp] = function(tmp) {
			window[jsonp] = undefined;
			try { delete window[jsonp]; } catch (e) { }
			if (head && script) {
				head.removeChild(script);
			}
			if (func) {
				if (params) params.unshift(tmp);
				else params = [tmp];

				setTimeout(function() {
					func.apply(checkObj, params)
				}, 1);
			}
		};
	}

	script.charset = "utf-8";
	script.onreadystatechange = function() {
		if (this.readyState == "loaded") {
			if (window[jsonp] && errorFunc) {
				setTimeout(function () {
					if (window[jsonp] && !checkObj.isSuccess) errorFunc();
				}, 500);
			}
			if (!func) {
				window[jsonp]();
			}
		}
	}
	if (window.ActiveXObject) {
		window.setTimeout(function() {
			head.appendChild(script);
			script.src = url.replace("{jsonp}", jsonp);
		}, 100);
	}
	else {
		head.appendChild(script);
		script.src = url.replace("{jsonp}", jsonp);		
	}
	//head.appendChild(script)
}

// 显示弹出页面
SNDA_CheckAccount.prototype.ShowBox = function(title, message, content) {

	var doc = this.BoxWindow.document;

	if (this.alertBoxBg == null) {
		var boxbg = doc.createElement("div");
		boxbg.className = "check_boxbg";
		this.alertBoxBg = boxbg;
		if (window.ActiveXObject) {
			var boxbgframe = doc.createElement("iframe");
			this.SetAttr(boxbgframe.style, { width: "100%", height: "100%", filter: "alpha(opacity:1)", zIndex:9999 });
			boxbg.appendChild(boxbgframe);
		}
		boxbg.onselectstart = function() {
			return false;
		}
		doc.body.appendChild(boxbg);
	}

	if (this.alertBox == null) {
		var box = doc.createElement("div");
		box.className = "check_box";
		this.alertBox = box;
		doc.body.appendChild(box);
	}

	if (this.alertBoxTitle == null) {
		var boxTitle = doc.createElement("div");
		boxTitle.className = "check_box_title";
		this.alertBoxTitle = boxTitle;
		this.alertBox.appendChild(boxTitle);
	}

	if (this.alertBoxBody == null) {
		var boxBody = doc.createElement("div");
		boxBody.className = "check_box_body";
		this.alertBoxBody = boxBody;		
		this.alertBox.appendChild(boxBody);
	}
	
	if (this.alertBoxBodyBg == null) {
		var boxBodyBg = doc.createElement("div");
		boxBodyBg.className = "check_box_body_bg";
		this.alertBoxBodyBg = boxBodyBg;
		this.alertBoxBody.appendChild(boxBodyBg);	
	}

	if (this.alertBoxMessage == null) {
		var msgTitle = doc.createElement("div");
		msgTitle.className = "check_box_message";
		this.alertBoxMessage = msgTitle;
		this.alertBoxBodyBg.appendChild(msgTitle);
	}

	if (this.alertBoxContent == null) {
		var boxContent = doc.createElement("div");
		boxContent.className = "check_box_content";
		this.alertBoxContent = boxContent;
		this.alertBoxBodyBg.appendChild(boxContent);
	}

	if (this.alertBoxFoot == null) {
		var boxFoot = doc.createElement("div");
		boxFoot.className = "check_box_foot";
		this.alertBoxFoot = boxFoot;
		this.alertBox.appendChild(boxFoot);
	}

	this.alertBoxTitle.innerHTML = title;
	this.alertBoxMessage.innerHTML = message;
	this.alertBoxContent.innerHTML = content;
	this.alertBoxMessage.style.display = message == "" ? "none" : "block";
	this.alertBox.style.display = "block";
	this.alertBoxBg.style.display = "block";

	this.ResizeBox();
}

// 显示弹出页面
SNDA_CheckAccount.prototype.HideBox = function() {
	this.alertBox.style.display = "none";
	this.alertBoxBg.style.display = "none";
}

// 加密
SNDA_CheckAccount.prototype.Encrypt = function(value) {
	return encodeURIComponent(value);
}

SNDA_CheckAccount.prototype.SetAttr = function(obj, AttrList) {
	for (var i in AttrList) {
		obj[i] = AttrList[i];
	}
}

SNDA_CheckAccount.prototype.SetStyle = function(doc, stylePath) {
	var styleobj = doc.createElement("link");
	styleobj.rel = "stylesheet";
	styleobj.type = "text/css";
	styleobj.href = stylePath;

	var head = doc.getElementsByTagName("head")[0];
	head.appendChild(styleobj);
}

SNDA_CheckAccount.prototype.ResizeBox = function() {
	if (!this.alertBox || this.alertBox.style.display == "none") return;

	var doc = this.BoxWindow.document;

	var boxTop = Math.max(1, parseInt(doc.documentElement.scrollTop || doc.body.scrollTop) + parseInt((Math.min(doc.documentElement.clientHeight || doc.body.clientHeight, doc.body.clientHeight || doc.documentElement.clientHeight) - this.alertBox.offsetHeight - 100) / 2)) + "px";
	var boxLeft = Math.max(1, parseInt(doc.documentElement.scrollLeft || doc.body.scrollLeft) + parseInt((Math.min(doc.documentElement.clientWidth || doc.body.clientWidth, doc.body.clientWidth || doc.documentElement.clientWidth) - this.alertBox.offsetWidth) / 2)) + "px";
	var bgWidth = parseInt(Math.max(doc.documentElement.clientWidth || doc.body.clientWidth, doc.body.clientWidth || doc.documentElement.clientWidth)) + "px";
	var bgHeight = parseInt(Math.max(doc.documentElement.clientHeight || doc.body.clientHeight, doc.body.clientHeight || doc.documentElement.clientHeight)) + "px";

	this.alertBox.style.top = boxTop;
	this.alertBox.style.left = boxLeft;
	this.alertBoxBg.style.width = bgWidth;
	this.alertBoxBg.style.height = bgHeight;
}

SNDA_CheckAccount.prototype.ResetAccount = function() {
	this.accountObj.disabled = false;
	//this.accountObj.style.visibility = "visible";
	this.accountObj.style.display = "block";
	this.passwordObj.disabled = false;
	//this.passwordObj.style.visibility = "visible";
	this.accountShowObj.style.display = "none";
	this.accountObj.value = "";
	this.passwordObj.value = "";
	this.sessionIdObj.value = "";
	this.sessionId = "";
	this.isSuccess = false;
	this.accountObj.focus();
}

SNDA_CheckAccount.prototype.SubmitInfo = function(param) {
	var interfaceUrl = this.interfaceUrl();

	setMaxDigits(131);
	var key = new RSAKeyPair("010001", "", "95FAADBBAE75A2590615CEADA737E5D8CA3624D003455901FF0F35475EF9A7726A190C0160D8B378DC040F29CDF5C33D1D1FDF122445EE8D88F6CB4ADFC486AB4C15D7B33015D62719A94BDCB8CF8F86B27FF7A94C3DE6B353EF2E35477720371B00C7E51DFBD8EBFC2B406CD4B1FE392109E4680C4FB5861C59798C73695117");
	var encstring =	"sessionId=" + this.Encrypt(this.sessionId)			+
					"&appId=" + this.Encrypt(this.ApplicationId)		+
					"&accountType=" + this.Encrypt(this.AccountType)	+
					"&subType=" + this.Encrypt(this.SubType || "")		+
					"&username=" + this.Encrypt(this.accountObj.value)	+
					"&password=" + this.Encrypt(this.passwordObj.value);
	
	if (param) {
		for (var iName in param) {
			encstring += ("&" + iName + "=" + this.Encrypt(param[iName]));
		}
	}
	
	if (this.ExpendInfo) {
		for (var iName in this.ExpendInfo) {
			encstring += ("&ep_" + iName + "=" + this.Encrypt(this.ExpendInfo[iName]));
		}
	}
	
	var querystring = "&encstring=" + encryptedString(key, encstring) + "&t=" + (this.jsc++);
	
	this.LoadUrl(interfaceUrl + querystring, this.LoginSuccessFunc, this.LoginFailedFunc);
}
