//<span>
window.jsHtml = new Object();
window.jsHtml.vars = new Object();
window.jsHtml.runs = new Array();
window.js = window.jsHtml;
window.html = window.jsHtml;
window.jsHtml.js = window.jsHtml;
window.jsHtml.html = window.jsHtml;
window.htmlJs = window.jsHtml;
window.htmlJS = window.jsHtml;
//</span><span>
window.jsHtml["$$"] = function (id)
{
	var e = document.getElementById(id);
	if (e == null)
		e = $("#" + id);
	return e;
};
//</span><span>
window.jsHtml["getGameName"] = function (code)
{
	switch (code)
	{
		case "004":
			return "Anarchy Online Credits, AO Credits";
		case "008":
			return "City of Villains";
		case "015":
			return "Dungeons Dragons Online Platinum";
		case "003":
			return "Eve Isk, Eve Online Isk";
		case "009":
			return "Everquest Platinum, Everquest Plat, EQ Plat, EQ Platinum";
		case "002":
			return "EQ2 Plat, EQ2 Gold, Everquest 2 Gold, Everquest 2 Platinum, Everquest 2 Plat, EQ2 Platinum";
		case "001":
			return "Final Fantasy XI Gil, FFXI Gil, Final Fantasy Gil";
		case "027":
			return "Gaia Gold, Gaia online Gold, Gaiaonline Gold";
		case "007":
			return "Guild Wars Gold";
		case "012":
			return "Adena, Lineage 2 Adena";
		case "014":
			return "Maple Story Mesos, MapleStory Mesos, Maple Story Meso";
		case "005":
			return "Ragnarok Online";
		case "016":
			return "RF Online";
		case "006":
			return "Rose Online";
		case "029":
			return "Scions of Fate";
		case "020":
			return "SilkRoad Gold, Silk Road Gold";
		case "011":
			return "SWG Credits, Star Wars Galaxies Credits";
		case "028":
			return "Vanguard-saga of heroes Gold, Vanguard Saga";
		case "019":
			return "World of Warcraft Gold, Warcraft Gold";
		case "013":
			return "World of Warcraft Gold, Warcraft Gold";
		case "030":
			return "Lord of the Rings Online";
	}
	return "";
};
//</span><span>
window.jsHtml["btn-register.click"] = function ()
{
	window.location.href='http://www.myfastgame.net/register.aspx';
};
//</span><span>
window.jsHtml["btn-edit.click"] = function ()
{
	window.location.href='http://www.myfastgame.net/editdetail.aspx';
};
//</span><span>
window.jsHtml["btn-login.click"] = function ()
{
	var suffix = this.id.replace("btn-login", "");
	$("#lbl-code" + suffix).css("display", "none");
	$("#lbl-user" + suffix).css("display", "none");
	$("#lbl-password" + suffix).css("display", "none");
	if ($("#code" + suffix).val() == "")
	{
		$("#lbl-code" + suffix).css("display", "");
		return;
	}
	
	if ($("#user" + suffix).val() == "")
	{
		$("#lbl-user" + suffix).css("display", "");
		return;
	}
	
	if ($("#password" + suffix).val() == "")
	{
		$("#lbl-password" + suffix).css("display", "");
		return;
	}
	
	var data = "delegate=static";
	data = data + "&JsLogin:logon=" + $.cookie("__LoginCheckCode__");
	data = data + "&code=" + $("#code" + suffix).val();
	data = data + "&user=" + $("#user" + suffix).val();
	data = data + "&password=" + $("#password" + suffix).val();
	data = data + "&ticks=" + new Date().getTime();
	$("#btn-login" + suffix).attr("disabled", true);
	$.ajax(
	{
		error: function ()
		{
			$("#a-code" + suffix).click();
			$("#btn-login" + suffix).attr("disabled", false);
			alert("Login Failed !");
		},
		success: function(result)
		{
			window.status = result;
			$("#a-code" + suffix).click();
			$("#btn-login" + suffix).attr("disabled", false);
			result = eval("(" + result + ")");
			if (result.error == null)
			{
				$("#ul-login-0" + suffix).css("display", "none");
				$("#ul-login-1" + suffix).css("display", "");
				$("#lbl-msg" + suffix).html("Welcome Back " + result.success + " !");
				return;
			}
			
			$("#div-top-right").html("Login Failed !");
			$("#div-top-right").css("color", "black");
		},
		data: data,
		url: 'handler_html.axd'
	});
	$("#code" + suffix).val("");
	$("#user" + suffix).val("");
	$("#password" + suffix).val("");
	$("#div-top-right").html("Login");
	$("#div-top-right").css("color", "white");
};
//</span><span>
window.jsHtml["btn-logoff.click"] = function ()
{
	var suffix = this.id.replace("btn-logoff", "");
	var data = "delegate=static";
	data = data + "&JsLogin:logoff=" + $.cookie("__LoginCheckCode__");
	data = data + "&date=" + new Date().getTime();
	$.ajax({
		error: function ()
		{
			$("#a-code" + suffix).click();
			alert("Logout Failed !");
		},
		success: function(result)
		{
			window.status = result;
			$("#a-code" + suffix).click();
			result = eval("(" + result + ")");
			if (result.error == null)
			{
				$("#ul-login-0" + suffix).css("display", "");
				$("#ul-login-1" + suffix).css("display", "none");
				$("#lbl-msg" + suffix).html("Welcome Back " + result.success + " !");
				return;
			}
			
			$("#div-top-right").html("Logout Failed !");
			$("#div-top-right").css("color", "black");
		},
		data: data,
		url: 'handler_html.axd'
	});
	$("#code" + suffix).val("");
	$("#user" + suffix).val("");
	$("#password-r").val("");
	$("#div-top-right").html("Login");
	$("#div-top-right").css("color", "white");
};
//</span><span>
window.jsHtml["a-code.click"] = function ()
{
	var suffix = this.id.replace("a-code", "");
	var src = $("#img-code" + suffix).attr("src");
	var i = src.indexOf('?');
	if (i >= 0)
	src = src.substring(0, i);
	$("#img-code" + suffix).attr("src", src + "?date=" + new Date().getTime());
};
//</span><span>
window.jsHtml["login.htm"] = function (suffix)
{
	$.ajax(
	{
		error: function (x)
		{
			window.status = x;
		},
		success: function(result)
		{
			window.status = result;
			try
			{
				result = eval("({" + result + "})");
				if(result.__UserLogin__ == null)
					return;
			}
			catch (x)
			{
				window.status = x.message;
				return;
			}

			window.jsHtml.vars["userLogin"] = result.__UserLogin__;
			$("#ul-login-0" + suffix).css("display", "none");
			$("#ul-login-1" + suffix).css("display", "");
			$("#lbl-msg" + suffix).html("Welcome Back " + result.__UserLogin__.Fullname + " !");
		},
		data: "get=session&__UserLogin__=%0d%0a&ticks=" + new Date().getTime(),
		url: 'login_state_html.axd'
	});
	var e = document.getElementById("div-top-right");
	if (e != null && e.innerHTML == "")
		e.innerHTML = "Login";
	$("#btn-register" + suffix).click(window.jsHtml["btn-register.click"])
	$("#btn-edit" + suffix).click(window.jsHtml["btn-edit.click"]);
	$("#btn-login" + suffix).click(window.jsHtml["btn-login.click"]);
	$("#btn-logoff" + suffix).click(window.jsHtml["btn-logoff.click"]);
	$("#a-code" + suffix).click(window.jsHtml["a-code.click"]);
};
//</span><span>
window.jsHtml["fillMoney"] = function ()
{
	$.ajax(
	{
		error: function ()
		{
			setTimeout("window.jsHtml[\"fillMoney\"]()", 1000);
		},
		success: function(result)
		{
			window.status = result;
			try
			{
				result = eval("(" + result + ")");
				if (result.ShoppingCartGold != null)
				{
					$("#money").val(result.ShoppingCartGold.MoneyType);
					$("#" + result.ShoppingCartGold.MoneyType).css("color","Blue");
				}
			}
			catch (e)
			{
				//$("#money").val(result);
			}
		},
		data: "delegate=static&JsSession:GetShoppingCartGold=" + new Date().getTime(),
		url: 'handler.html.axd'
	});

	$.ajax(
	{
		error: function ()
		{
			setTimeout("window.jsHtml[\"fillMoney\"]()", 1000);
		},
		success: function(result)
		{
			window.status = result;
			try
			{
				result = eval("(" + result + ")");
				if (result.SaleProductPrice != null)
					document.getElementById("money").SaleProductPrice = result.SaleProductPrice;
			}
			catch (e)
			{
				//$("#money").val(result);
			}
		},
		data: "delegate=static&JsSession:GetUserPriceConfig=" + new Date().getTime(),
		url: "handler.html.axd"
	});
};
//</span><span>
window.jsHtml["getMoney"] = function (price, type)
{
	var money = document.getElementById("money");
	if (money == null || money.UserPriceConfig == null)
		money = price;
	else
		money = price * money.UserPriceConfig.PriceRate;
	if (type == null)
		type = $("#money").val();
	if (type == null || type == "")
		money = "" + money;
	else if (type == "USD")
		money = "$" + money;
	else if (type == "EUR")
		money = "&#x20ac;" + money;////€
	else if (type == "GBP")
		money = "&#xffe1;" + money;////¡ê
	else if (type == "RMB")
		money = "&#xffe5;" + money;////£¤
	else
		money = "" + money;
	money = money.replace(/([^\.]*\.[0-9][0-9])[0-9]*/img, "$1");
	return money;
};
//</span><span>
window.jsHtml["changeMoney"] = function (type)
{
	if(type == null || type=="")
		return;

	$("#money").val(type);
	$("#USD").css("color", "Red");
	$("#EUR").css("color", "Red");
	$("#GBP").css("color", "Red");
	$("#" + type).css("color", "Blue");
	$.ajax({
		error: function (x)
		{
			//
		},
		success: function (result)
		{
			document.getElementById("product").old = $("#product").val();
			$("#game-server").change();
		},
		data: "delegate=static&JsSession:SetMoneyType=" + type + "&time=" + new Date().getTime(),
		url: "handler.html.axd"
	});
};
//</span><span>
window.jsHtml["gold.product.change"] = function ()
{
	$("#lbl-price").html("0.00");
	if (this.value == "")
		return;

	var json = document.getElementById("product").json;
	if (json == null)
		return;

	for (var i = 0; i < json.length; i++)
	{
		if (json[i].GuidProduct == $("#product").val())
		{
			json = json[i];
			break;
		}
	}
	$("#lbl-price").html(window.jsHtml["getMoney"](json.SaleProductPrice));
};
//</span><span>
window.jsHtml["gold.server.change"] = function ()
{
	$("#lbl-price").html(window.jsHtml["getMoney"]("0.00"));
	$("#product").empty();
	var url = document.getElementById("game-server").json;
	for (var i = 0; i < url.length; i++)
	{
		if (url[i].Code == this.value)
		{
			url = url[i];
			break;
		}
	}

	$("<option value=\"\">Loading...</option>").appendTo($("#product"));
	$("#product").attr("disabled", true);
	$("#gold-product").toggle();
	$("#img-product").css("display", "");
	var t = $("#money").val();
	if (t != null && t != "" && t != "null" && t != "undefined")
	{
		$("#" + t).css("color", "Blue");
		t = url["ProductUrl" + t];
	}
	else
	{
		t = url.ProductUrl;
	}

	$.ajax({
		error: function (x)
		{
			$("#product").empty();
			$("<option value=\"\">--error--</option>").appendTo($("#product"));
			$("#img-product").css("display", "none");
		},
		success: function (result)
		{
			window.status = result;
			$("#img-product").css("display", "none");
			try
			{
				result = eval("(" + result + ")");
				document.getElementById("product").json = result;
				$("#product").empty();
				$("<option value=\"\">--Select your product--</option>").appendTo($("#product"));
				for (var i = 0; i < result.length; i++)
					$("<option value=\"" + result[i].GuidProduct + "\">" + result[i].ProductName + "</option>").appendTo($("#product"));
				$("#product").attr("disabled", false);
				var t = "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"tab_gold\">";
				for (var i = 0; i < result.length; i++)
				{
					t = t + "<tr" + (i % 2 == 0 ? " style=\"background-color: #f3f3f3;\"" : "") + " onmouseover=\"javascript:this.style.backgroundColor='#E9F0FF';\" onmouseout=\"javascript:this.style.backgroundColor='';\" onclick=\"javascript:$('#product').val('" + result[i].GuidProduct + "');$('#product').change();\" >"
					t = t + "<td>" + result[i].ProductName + "</td><td>" + window.jsHtml["getMoney"](result[i].SaleProductPrice) + "</td></tr>"; 
				}
				t += "</table>";
				$("#gold-product").html(t);
				$("#gold-product").toggle();
				if($("#productguid").val() != "")
					$("#product").val($("#productguid").val());

				if (document.getElementById("product").old != null)
					$("#product").val(document.getElementById("product").old);
				document.getElementById("product").old = null;
				$('#product').change();
			}
			catch (e)
			{
				//setTimeout("fillGameServer()", 1000);
			}
		},
		data: "time=" + new Date().getTime(),
		url: t//url: "GoldDataDispose.aspx?GameServerCode=" + $("#game-server").val()////productUrlList[]
	});
};
//</span><span>
window.jsHtml["fillGameServer"] = function (json)
{
    //$("#trStatus").hide(); $("#trServerName").hide();
    $("#lbl-price").html("0.00");
	if (json == null)
		json = window.jsHtml.vars["gameServerList"];
	if (json == null)
		return;

	document.getElementById("game-server").json = json;
	$("#game-server").empty();
	$("<option value=\"\">--Select your game server--</option>").appendTo($("#game-server"));
	for (var i = 0; i < json.length; i++)
		$("<option value=\"" + json[i].Code + "\">" + json[i].ServerNameOther + "</option>").appendTo($("#game-server"));
	$("#game-server").attr("disabled", false);
};
//</span><span>
window.jsHtml["fillUser"] = function ()
{
	$.ajax({
		error: function ()
		{
			setTimeout("fillUser()", 1000);
		},
		success: function (result)
		{
			window.status = result;
			try
			{
				result = eval("(" + result + ")");
				if (result.UserInfo != null)
				{
					$("#phone").val(result.UserInfo.PhoneTwo);
					$("#mail").val(result.UserInfo.Email);
				}
				if (result.UserLogin != null)
					$("#full-name").val(result.UserLogin.fullname);
			}
			catch (e)
			{
				//$("#money").val(result);
			}
		},
		data: "delegate=static&JsSession:GetUserAllInfo=" + new Date().getTime(),
		url: "handler.html.axd"
	});
};
//</span><span>
window.jsHtml["gold.submit.click"] = function ()
{
	//if (!document.getElementById("accept").checked)
	//{
	//	alert("Please check the box about terms and conditions !");
	//	return;
	//}

	var t = window.jsHtml.vars["gameCode"];
	var data = "&game=" + t;
	t = $("#coupon").val();
	if (t != "")
		data = data + "&coupon=" + t;
	t = $("#trade").val();
	if (t != "")
		data = data + "&trade=" + t;
	t = $("#payment").val();
	data = data + "&payment=" + t;
	if(t == "")
	{
		alert("Please select payment method!");
		return;
	}

	t = $("#game-server").val();
	data = data + "&server=" + t;
	if(t == "")
	{
		alert("Please select your game server!");
		return;
	}

	t = $("#product").val();
	data = data + "&product=" + t;
	if(t == "" || t == "1") 
	{
		alert("Please select your product!");
		return;
	}

	t = $("#character").val();
	data = data + "&character=" + t;
	if(t == "")
	{
		alert("Please input your character name!");
		return; 
	}

	t = $("#full-name").val();
	data = data + "&full-name=" + t;
	if(t == "")
	{
		alert("Please input your Full name!");
		return;
	}

	t = $("#mail").val();
	data = data + "&mail=" + t;
	if(t == "")
	{
		alert("Please input your E-mail!");
		return;
	}

	var t = t.match(/^(\S)+[@](\S)+[.](\w)+$/)
	if(t == null)
	{
		alert("Please input correct E-mail!");
		return;
	}

	t = $("#country").val();
	data = data + "&country=" + t;
	if(t == "" || t=="1") 
	{ 
		alert("Please select your Country!");
		return;
	}

	t = $("#phone").val();
	data = data + "&phone=" + t;
	if(t == "")
	{
		alert("Please input your phone!");
		return; 
	}

	t = $("#remark").val();
	if (t != "")
		data = data + "&remark=" + t;
	$.ajax(
	{
		error: function (x)
		{
			//alert ("error!");
			window.status = x;
			alert("Create order has error,please try again later!");
		},
		success: function (result)
		{
			window.status = result;
			try
			{
				result = eval("(" + result + ")");
				if (result.alert != null)
					alert (result.alert);
				if (result.error != null)
					return;

				location.href = "http://www.myfastgame.net/golddetail.aspx";
			}
			catch (e)
			{
				alert (e.message);
			}
		},
		data: "delegate=static&JsBusiness:AppendIntoGoldCart=" + new Date().getTime() + data,
		url: "handler.html.axd"
	});
};
//</span><span>
window.jsHtml["gold.html"] = function ()
{
	$("#btn-submit").click(window.jsHtml["gold.submit.click"]);
	$.ajax(
	{
		error: function (x)
		{
			//loadJsonSuccess(null);
		},
		success: function (result)
		{
			if (result == null)
				return;

			window.status = result;
			try
			{
				result = eval("({" + result + ")");
				if (result._OrderInfo_ == null)
					return;

				$("#character").val(result._OrderInfo_.CharName);
				$("#full-name").val(result._OrderInfo_.FullName);
				$("#mail").val(result._OrderInfo_.Email);
				if (result._OrderInfo_.Comments && result._OrderInfo_.Comments.split)
				{
					$("#country").val(result._OrderInfo_.Comments.split(":")[1]);
					$("#remark").val(result._OrderInfo_.Comments.substring(0, result._OrderInfo_.Comments.indexOf("Customer")));
				}
				$("#phone").val(result._OrderInfo_.Phone2);
				//$("#payment").val(result._OrderInfo_.PaymentType);
			}
			catch (x)
			{
				//alert(x.message);
				//loadJsonSuccess(null);
			}
		},
		data: "get=session&_OrderInfo_=%0d%0a}&time=" + new Date().getTime(),
		url: "session.html.axd"
	});

	var queryServer = window.location.href.indexOf('?');
	if (queryServer >= 0)
		queryServer = window.location.href.indexOf('server=');
	if (queryServer >= 0)
	{
		queryServer += 7;
		queryServer = window.location.href.substring(queryServer, window.location.href.length);
		$("#game-server").val(queryServer);
		$("#game-server").change();
	}
};
//</span><span>
window.jsHtml["fullListFromLeftNav"] = function (src, tar)
{
	var e = document.getElementById(src);
	var es = e.childNodes;
	for (var i = 0; i < es.length; i++)
	{
		e = es[i];
		if (!e.tagName)
			continue;

		if (e.tagName != "A")
		{
			for (var ii = 0; ii < e.childNodes.length; ii++)
			{
				if (e.childNodes[ii].tagName == "A")
					e = e.childNodes[ii];
			}
		}
		document.getElementById(tar).options.add(new Option(e.innerHTML, e.href));
	}
};
//</span><span>
window.jsHtml["getLevelProduct"] = function ()
{
	var t = window.jsHtml.vars["gameCode"];
	var s = document.getElementById("select-start");
	var e = document.getElementById("select-end");
	var p = document.getElementById("select-profession");
	if(s.value == "" || e.value == "" || parseInt(s.value,32) >=parseInt(e.value,32))
	{
		document.getElementById("price").value = 0;
		document.getElementById("time").value = 0;
		return;
	}

	if (p == null)
		window.jsHtml["getLevelProductInfo"](null, s.value, e.value, t); 
	else
		window.jsHtml["getLevelProductInfo"](p.value, s.value, e.value, t);
};
//</span><span>
window.jsHtml["getLevelProductInfo"] = function (guid, start, end, gameCode)
{
	var data="&startlevel=" + start + "&endlevel=" + end + "&gamecode=" + gameCode; 
	if(guid != null && guid != "")
		data = data + "&pguid=" + guid;
	 $.ajax(
	 {
		error: function (x)
		{
			//alert ("error!");
			window.status = x;
			alert("Get product list has error,please try again later!");
		},
		success: function (result)
		{
			window.status = result;
			try
			{
				result = eval("(" + result + ")");
				if (result.alert != null)
					alert (result.alert);
				if (result.error != null)
					return;

				$("#price").val(result.price);
				$("#time").val(result.time);
			}
			catch (e)
			{
				alert (e.message);
			}
		},
		data: "delegate=static&JsBusiness:GetLevelProductInfo=,&tick=" + new Date().getTime() + data,
		url: "handler.html.axd"
	});
};
//</span><span>
window.jsHtml["plBuyLevel"] = function ()
{
	var s = document.getElementById("select-start");
	var e = document.getElementById("select-end");
	var p = document.getElementById("select-profession");
	if(s.value == "" || e.value == "" || parseInt(s.value,32) >=parseInt(e.value,32))
	{
		alert("Sorry,your selected level has error !");
		return false;
	}

	var data = "&Game=" + window.jsHtml.vars["gameCode"];
	data = data + "&type=level&start=" + s.value + "&end=" + e.value;
	if(p != null && p.value != "")
		data = data + "&Profession=" + p.value; 

	$.ajax(
	{
		error: function (x)
		{
			//alert ("error!");
			window.status = x;
			alert("Create order has error,please try again later!");
		},
		success: function (result)
		{
			window.status = result;
			try
			{
				result = eval("(" + result + ")");
				if (result.alert != null)
					alert (result.alert);
				if (result.error != null)
					return;

				location.href = "http://www.myfastgame.net/plorder.aspx";
			}
			catch (e)
			{
				alert (e.message);
			}
		},
		data: "delegate=static&JsBusiness:AppendIntoPLCart=" + new Date().getTime() + data,
		url: "handler.html.axd"
	});
};
//</span><span>
window.jsHtml["init-pl-level"] = function ()
{
	var level = window.jsHtml.vars["plLevel"];
	if (!level)
		return;

	if (level.RepartitionCharClass)
	{
		$("#th-profession").show();
		$("#td-profession").show();
		var profession = null;
		for (var i = 0; i < profession.length; i++)
			$("<option value=\"" + profession[i].Guid + "\">" + profession[i].ProfessionName + "</option>").appendTo($("#select-profession"));
	}
	
	$("<option value=\"\">---</option>").appendTo($("#select-start"));
	for (var i = level.PLStartLevel; i < level.EndLevel; i++)
		$("<option value=\"" + i + "\">" + i + "</option>").appendTo($("#select-start"));
	$("<option value=\"\">---</option>").appendTo($("#select-end"));
	for (var i = level.EndLevel; i >= level.PLStartLevel; i--)
		$("<option value=\"" + i + "\">" + i + "</option>").appendTo($("#select-end"));
	//$("#select-start").val(parseInt(level.PLStartLevel + (level.EndLevel - level.PLStartLevel) / 2));
	$("#select-start").val(55);
	//$("#select-end").val(level.EndLevel);
};
//</span><span>
window.jsHtml["plBuyPackage"] = function (index, prefix)
{
	if (!prefix)
		prefix = "pl-package-";
	var data="&type=pkt&Game=" + window.jsHtml.vars["gameCode"];
	data = data + "&pid=" + $("#" + prefix + index).val() + "&items=";
	for(var i = 0;i < 65536; i++)
	{
		if (document.getElementById(prefix + index + "-" + i) == null)
			break;

		data = data + document.getElementById(prefix + index + "-" + i).value + ",";
	}

	$.ajax(
	{
		error: function (x)
		{
			//alert ("error!");
			window.status = x;
			alert("Create order has error,please try again later!");
		},
		success: function (result)
		{
			window.status = result;
			try
			{
				result = eval("(" + result + ")");
				if (result.alert != null)
					alert (result.alert);
				if (result.error != null)
					return;

				location.href = "http://www.myfastgame.net/plorder.aspx";
			}
			catch (e)
			{
				alert(e.message);
			}
		},
		data: "delegate=static&JsBusiness:AppendIntoPLCart=" + new Date().getTime() + data,
		url: "handler.html.axd"
	});
};
//</span><span>
window.jsHtml["calculateProject"] = function (parent, current, prefix)
{
	if (!prefix)
		prefix = "profession";
	var p0 = $("#pl-" + prefix + "-" + parent).val();
	var p1 = $("#pl-" + prefix + "-" + parent + "-" + current).val();
	var p2 = $("#pl-" + prefix + "-item-" + parent + "-" + current).val();
	var p3 = $("#pl-" + prefix + "-start-" + parent + "-" + current).val();
	var p4 = $("#pl-" + prefix + "-end-" + parent + "-" + current).val();
	$("#pl-" + prefix + "-price-" + parent + "-" + current).val(0);
	$("#pl-" + prefix + "-time-" + parent + "-" + current).val(0);
	if (p2 == "")
	{
		$("#pl-" + prefix + "-item-" + parent + "-" + current).focus();
		return;
	}

	p3 = parseInt(p3);
	if (p3 < 0)
	{
		$("#pl-" + prefix + "-start-" + parent + "-" + current).focus();
		return;
	}

	p4 = parseInt(p4);
	if (p4 >= 0 && p3 >= p4)
	{
		$("#pl-" + prefix + "-start-" + parent + "-" + current).focus();
		return;
	}

	var data="&pguid=" + p1 + "&nguid=" + p2 + "&start=" + p3 + "&end=" + p4 + "&index=" + parent;

	$.ajax(
	{
		error: function (x)
		{
			//alert ("error!");
			window.status = x;
			alert("Get level product has error,please try again later!");
		},
		success: function (result)
		{
			window.status = result;
			try
			{
				result = eval("(" + result + ")");
				if (result.alert != null)
					alert (result.alert);
				if (result.error != null)
					return;

				$("#pl-" + prefix + "-price-" + parent + "-" + current).val(result.price);
				$("#pl-" + prefix + "-time-" + parent + "-" + current).val(result.time);
			}
			catch (e)
			{
				alert (e.message);
			}
		},
		data: "delegate=static&JsBusiness:GetLevelProductInfo=,&tick=" + new Date().getTime()+data,
		url: "handler.html.axd"
	});
};
//</span><span>
window.jsHtml["plBuyProfession"] = function (parent, current, prefix)
{
	if (!prefix)
		prefix = "profession";
	var p0 = $("#pl-" + prefix + "-" + parent).val();
	var p1 = $("#pl-" + prefix + "-" + parent + "-" + current).val();
	var p2 = $("#pl-" + prefix + "-item-" + parent + "-" + current).val();
	var p3 = $("#pl-" + prefix + "-start-" + parent + "-" + current).val();
	var p4 = $("#pl-" + prefix + "-end-" + parent + "-" + current).val();
	var p5 = $("#pl-" + prefix + "-price-" + parent + "-" + current).val();
	var p6 = $("#pl-" + prefix + "-time-" + parent + "-" + current).val(0);
	if(p5 == "0" || p5 == "" || p6 == "0" || p6 == "")
	{
		alert("Please Select Level!");
		return;
	}

	if (p2 == "")
	{
		$("#pl-" + prefix + "-item-" + parent + "-" + current).focus();
		return;
	}

	p3 = parseInt(p3);
	if (p3 < 0)
	{
		$("#pl-" + prefix + "-start-" + parent + "-" + current).focus();
		return;
	}

	p4 = parseInt(p4);
	if (p4 >= 0 && p3 >= p4)
	{
		$("#pl-" + prefix + "-start-" + parent + "-" + current).focus();
		return;
	}

	var data="&type=jn&Game=" + window.jsHtml.vars["gameCode"];
	data = data + "&pid=" + p1 + "&pjname=" + p2 + "&start=" + p3 + "&end=" + p4 + "&index=" + parent;
	$.ajax(
	{
		error: function (x)
		{
			//alert ("error!");
			window.status = x;
			alert("Create order has error,please try again later!");
		},
		success: function (result)
		{
			window.status = result;
			try
			{
				result = eval("(" + result + ")");
				if (result.alert != null)
					alert (result.alert);
				if (result.error != null)
					return;
				location.href = "http://www.myfastgame.net/plorder.aspx";
			}
			catch (e)
			{
				alert (e.message);
			}
		},
		data: "delegate=static&JsBusiness:AppendIntoPLCart=" + new Date().getTime() + data,
		url: "handler.html.axd"
	});
};
//</span><span>
window.jsHtml["plBuyHonor0"] = function  (guid)
{
	var data="&type=zb&Game=" + window.jsHtml.vars["gameCode"];
	data = data + "&pid=" + guid;
	$.ajax(
	{
		error: function (x)
		{
			//alert ("error!");
			window.status = x;
			alert("Create order has error,please try again later!");
		},
		success: function (result)
		{
			window.status = result;
			try
			{
				location.href = "http://www.myfastgame.net/plorder.aspx";
			}
			catch (e)
			{
				alert (e.message);
			}
		},
		data: "delegate=static&JsBusiness:AppendIntoPLCart=" + new Date().getTime() + data,
		url: "handler.html.axd"
	});
};
//</span><span>
window.jsHtml["contactUs"] = function ()
{
	$("#p-success").css("display","none");
	//if (document.getElementById("ulLogin-1-r").style.display == "none")
	if (window.jsHtml.vars["userLogin"] == null)
	{
		alert("Please Login First!");
		return;
	}
	var data = "";
	var t = $("#full-name").val();
	if (t == "")
	{
		$("#lbl-full-name").css("display","");
		return;
	}

	$("#lbl-full-name").css("display", "none");
	data = data + "&fullname=" + t;

	t = $("#mail").val();
	if (t == "")
	{
		$("#lbl-mail").css("display", "");
		return;
	}

	var r = t.match(/^(\S)+[@](\S)+[.](\w)+$/);
	if(r == null)
	{
		$("#lbl-mail").css("display","");
		return;
	}

	$("#lbl-mail").css("display","none");
	data = data + "&email=" + t;

	t = $("#title").val();
	if (t == "")
	{
		$("#lbl-title").css("display", "");
		return;
	}

	$("#lbl-title").css("display","none");
	data = data + "&title=" + t;

	t = $("#content").val();
	if (t == "")
	{
		$("#lbl-content").css("display","");
		return;
	}

	$("#lbl-content").css("display","none");
	data = data + "&content=" + t;

	$.ajax(
	{
		error: function (x)
		{
			alert ("send error!");
			this.disabled = false;
		},
		success: function(result)
		{
			window.status = result;
			try
			{
				result = eval("(" + result + ")");
				if (result.alert != null)
					alert (result.alert);
				if (result.error != null)
					return;

				$("#p-success").css("display","");
				alert("Sent success!");
				location.href = "http://www.myfastgame.net/home.aspx"
			}
			catch (e)
			{
				alert (e.message);
				this.disabled = false;
			}
		},
		data: "delegate=static&JsBusiness:ContactUsSend=" + new Date().getTime() + data,
		url: "handler.html.axd"
	});
	this.disabled = true;
};
//</span><span>
window.jsHtml["loadGoldDetailJson"] = function (result)
{
	if (result == null)
	{
		location.href = "http://www.myfastgame.net/home.aspx"
		return;
	}

	window.status = result;
	try
	{
		result = eval("({" + result + ")");
		window.jsHtml.vars["session"] = result;
		if (result.__ShoppingCartGold__ == null || result.__ShoppingCartGold__.Products == null || result.__ShoppingCartGold__.Products.length == 0 || result._OrderInfo_ == null)
		{
			window.jsHtml["loadGoldDetailJson"](null);
			return;
		}

		if (result._OrderInfo_.IsSubmited)
		{
			if (result._OrderInfo_.PaymentType == "CyberSource")
				location.href = "http://www.myfastgame.net/cybersourcepayment.aspx";
			else
				location.href = "http://www.myfastgame.net/payment.aspx";
			return;
		}

		$("#game-name").html(result.__ShoppingCartGold__.GameName);
		$("#character").html(result._OrderInfo_.CharName);
		for (var i = 1; i < 100; i++)
		{
			if (document.getElementById("tr-product-" + i) == null)
				break;

			$("#tr-product-" + i).css("display", "none");
		}
		for (var i = 0; i < result.__ShoppingCartGold__.Products.length; i++)
		{
			$("#tr-product-" + i).css("display", "");
			$("#server-name-" + i).html(result.__ShoppingCartGold__.GameServerName);
			$("#name-" + i).html(result.__ShoppingCartGold__.Products[i].Name);
			$("#price-" + i).html(window.jsHtml["getMoney"](result.__ShoppingCartGold__.Products[i].Price, result.__ShoppingCartGold__.MoneyType));
			$("#count-" + i).html(result.__ShoppingCartGold__.Products[i].Count);
			document.getElementById("tr-product-" + i).guid = result.__ShoppingCartGold__.Products[i].Guid;
		}
		$.ajax(
		{
			error: function (x)
			{
				window.jsHtml["loadGoldDetailJson"](null);
			},
			success: function(result)
			{
				try{
					result = eval("(" + result + ")");
					if(result.ManageInfo!=null)
					{
						$("#trcrm").css("display","");
						$("#lblaim").html(result.ManageInfo.Aim);
						$("#lblmanagername").html(result.ManageInfo.ManageName);
						$("#lblcoupon").html(result.ManageInfo.Coupon);
						$("#lblcontact").html(result.contact);
					} 
				}
				catch(x)
				{
					alert(x.message);
				}
			},
			data: "delegate=static&JsBusiness:CrmGoldOrder=,&time=" + new Date().getTime() + "&email=" + result._OrderInfo_.Email,
			url: "handler.html.axd"
		});
		$("#total-price").html($("#total-price").html().substring(0, $("#total-price").html().indexOf(':') + 1) + window.jsHtml["getMoney"](result.__ShoppingCartGold__.TotalPrice, result.__ShoppingCartGold__.MoneyType));
		$("#total-value").html($("#total-value").html().substring(0, $("#total-value").html().indexOf(':') + 1) + result.__ShoppingCartGold__.TotalValue);
		$("#discount-price").html($("#discount-price").html().substring(0, $("#discount-price").html().indexOf(':') + 1) + window.jsHtml["getMoney"](result.__ShoppingCartGold__.TotalPrice, result.__ShoppingCartGold__.MoneyType));
		$("#discount-value").html($("#discount-value").html().substring(0, $("#discount-value").html().indexOf(':') + 1) + result.__ShoppingCartGold__.TotalValue);
		if (result._Coupon_ != null)
		{
			if (result._Coupon_.DiscountType == 1)
				$("#discount-price").css("display", "");
			else
				$("#discount-value").css("display", "");
		}
		$("#full-name").html(result._OrderInfo_.FullName);
		$("#mail").html(result._OrderInfo_.Email);
		if (result._OrderInfo_.Comments && result._OrderInfo_.Comments.split)
		{
			$("#country").html(result._OrderInfo_.Comments.split(":")[1]);
			$("#remark").html(result._OrderInfo_.Comments.substring(0, result._OrderInfo_.Comments.indexOf("Customer")));
		}
		$("#phone").html(result._OrderInfo_.Phone2);
		$("#payment").html(result._OrderInfo_.PaymentType);
	}
	catch (x)
	{
		//alert(x.message);
		window.jsHtml["loadGoldDetailJson"](null);
	}
};
//</span><span>
window.jsHtml["removeGoldProduct"] = function  (index)
{
	if($("#tr-product-" + index).css("display") == "none")
		return;

	var guid = document.getElementById("tr-product-" + index).guid;
	if (guid == null)
		return;

	$.ajax(
	{
		error: function (x)
		{
			window.jsHtml["loadGoldDetailJson"](null);
		},
		success: window.jsHtml["loadGoldDetailJson"],
		data: "delegate=static&JsBusiness:RemoveFromGoldCart=" + guid + "&__ShoppingCartGold__=,%0d%0a&_OrderInfo_=,%0d%0a&_Coupon_=%0d%0a}&time=" + new Date().getTime(),
		url: "handler.html.axd"
	});
};
//</span><span>
window.jsHtml["goldDetailSubmit"] = function ()
{
	$.ajax(
	{
		error: function (x)
		{
			window.jsHtml["loadGoldDetailJson"](null);
		},
		success: function (result)
		{
			window.status = result;
			try
			{
				result = eval("(" + result + ")");
				if (result.redirect != null)
				{
					window.jsHtml["loadGoldDetailJson"](null);
					return;
				}

				if (result.error != null)
				{
					$("#btn-submit").attr("disabled", false);
					$("#lbl-msg").html(result.error);
					return;
				}

				if (result.success == "CyberSource")
					location.href = "http://www.myfastgame.net/cybersourcepayment.aspx";
				else
					location.href = "http://www.myfastgame.net/payment.aspx";
			}
			catch (x)
			{
				window.jsHtml["loadGoldDetailJson"](null);
			}
		},
		data: "delegate=static&JsBusiness:SubmitGoldOrder=&ticks=" + new Date().getTime(),
		url: "handler.html.axd"
	});
	this.disabled = true;
};
//</span><span>
window.jsHtml["goldDetail.html"] = function ()
{
	window.jsHtml.vars["session"] = null;
	$.ajax(
	{
		error: function (x)
		{
			window.jsHtml["loadGoldDetailJson"](null);
		},
		success: window.jsHtml["loadGoldDetailJson"],
		data: "get=session&__ShoppingCartGold__=,%0d%0a&_OrderInfo_=,%0d%0a&_Coupon_=%0d%0a}&time=" + new Date().getTime(),
		url: "session.html.axd"
	});
	$("#btn-submit").click(window.jsHtml["goldDetailSubmit"]);
};
//</span><span>
window.jsHtml["manualSubmitPayment"] = function ()
{
	if (window.jsHtml.vars["payment"] == null)
		document.getElementById("paypal_payment_info").submit();
	else
		window.jsHtml.vars["payment"].contentWindow.document.forms["paypal_payment_info"].submit();
};
//</span><span>
window.jsHtml["loadPaymentHtml"] = function (e, html, noJs)
{
	if (e == null || html == null)
		return;

	e = document.getElementById(e);
	if (e == null)
		return;

	if (noJs)
	{
		e.innerHTML = html;
		return;
	}

	var o = document.createElement("iframe", true);
	o.style.display = "none";
	e.appendChild(o);
	o.contentWindow.document.write("<html><head><base target=\"_top\" /></head><body>" + html + "</body></html>");
	o.contentWindow.document.close();
	window.jsHtml.vars["payment"] = o;
};
//</span><span>
window.jsHtml["paymentSuccess"] = function (result)
{
	if (result == null)
	{
		//alert("http://www.myfastgame.net/home.aspx");
		location.href = "http://www.myfastgame.net/home.aspx"
		return;
	}

	var t = result;
	window.status = result;
	try
	{
		result = eval("(" + result + ")");
		if (result.code == null)
		{
			window.jsHtml["paymentSuccess"](null);
			return;
		}

		if (result.payment == "WesternUnion")
			$("#div-501").css("display", "");
		else
			$("#div-500").css("display", "");
		if (result.payment == "Paypal")
		{
			$("#div-pp").css("display", "");
			$("#lbl-pp-code").html(result.code);
			window.jsHtml["loadPaymentHtml"]("lbl-pp-html", result.html)
			return;
		}

		if (result.payment == "MoneyBooker")
		{
			$("#div-mb").css("display", "");
			$("#lbl-mb-code").html(result.code);
			window.jsHtml["loadPaymentHtml"]("lbl-mb-html", result.html)
			return;
		}

		if (result.payment == "EuroStandardBankTransfer")
		{
			$("#div-eb").css("display", "");
			$("#lbl-eb-code").html(result.code);
			$("#lbl-eb-total").html(result.total);
			$("#lbl-eb-price").html(result.price);
			$("#lbl-eb-product").html(result.product);
			window.jsHtml["loadPaymentHtml"]("lbl-eb-html", result.html)
			return;
		}

		if (result.payment == "CreditCardThroughPaypal")
		{
			$("#div-pc").css("display", "");
			$("#lbl-pc-code").html(result.code);
			window.jsHtml["loadPaymentHtml"]("lbl-pc-html", result.html)
			return;
		}

		if (result.payment == "WesternUnion")
		{
			$("#div-wu").css("display", "");
			$("#lbl-wu-code").html(result.code);
			window.jsHtml["loadPaymentHtml"]("lbl-wu-html", result.html)
			return;
		}

		window.jsHtml["paymentSuccess"](null);
	}
	catch (x)
	{
		window.status = x.message;
		//alert(x.message);
		window.jsHtml["paymentSuccess"](null);
	}
};
//</span><span>
window.jsHtml["payment.html"] = function ()
{
	$.ajax(
	{
		error: function (x)
		{
			//alert(x);
			window.jsHtml['paymentSuccess'](null);
		},
		success: window.jsHtml['paymentSuccess'],
		data: 'delegate=static&JsBusiness:Payment=http://www.myfastgame.net/paymentsuccess.aspx&time=' + new Date().getTime(),
		url: 'handler.html.axd'
	});
};
//</span><span>
window.jsHtml["loadOrderStartingTime"] = function ()
{
	for (var i = 0; i < 24; i++)
		document.getElementById("hs_hour").options.add(new Option(i + ":00", i + ":00"));
	for (var i = 1; i <= 12; i++)
		document.getElementById("hs_month").options.add(new Option(i, i));
	for (var i = 1; i <= 31; i++)
		document.getElementById("hs_day").options.add(new Option(i, i));
	var dd = new Date();
	dd = new Date(dd - -3600000);
	if(dd.getMinutes() > 30)
		dd = new Date(dd - -1800000);
	var h = dd.getHours();
	var m = dd.getMonth() + 1;
	var d = dd.getDate();
	$("#hs_month").val(m);
	$("#hs_day").val(d);
	$("#hs_hour").val(h + ":00");
};
//</span><span>
window.jsHtml["loadServerAndClass"] = function ()
{
	$.ajax(
	{
		error: function (x)
		{
			window.status = x;
			alert("Load game server error!");
		},
		success: function(result)
		{
			window.status = result;
			try
			{
				result = eval("(" + result + ")");
				if (result.GameServerList != null)
				{
					$("#game-server").empty();
					for (var i = 0; i < result.GameServerList.length; i++)
						$("<option value=\"" + result.GameServerList[i].Code + "\">" + result.GameServerList[i].ServerNameOther + "</option>").appendTo($("#game-server"));
					$("#game-server").attr("disabled", false);
				}

				if (result.ProfessionList != null)
				{
					 $("#profession-list").empty();
					for (var i = 0; i < result.ProfessionList.length; i++)
						$("<option value=\"" + result.ProfessionList[i].Guid + "\">" + result.ProfessionList[i].ProfessionName + "</option>").appendTo($("#profession-list"));
					$("#profession-list").attr("disabled", false);
				} 
			}
			catch (x)
			{
				window.status = x.message;
				alert(x.message);
			}
		},
		data: "delegate=static&JsSession:GetGameServerAndProfessionList=" + new Date().getTime(),
		url: 'handler.html.axd'
	});
};
//</span><span>
window.jsHtml["plSubmitOrder"] = function ()
{
	var t = "";
	var data = "";
	t = $("#first-name").val();
	if(t == "")
	{
		alert("Please input your First Name!");
		return;
	}

	var fullname = t;
	t = $("#last-name").val();
	if(t != "")
		fullname = fullname + " " + t;
	data = data +"&fullname=" + fullname;

	t = $("#mail-address").val();
	if(t == "")
	{
		alert("Please input your E-mail!");
		return;
	}

	data = data + "&email=" + t;
	t = t.match(/^(\S)+[@](\S)+[.](\w)+$/);
	if(t == null)
	{
		alert("Please input correct E-mail!");
		return;
	}

	t = $("#tel-no").val();
	if(t != "")
		data = data + "&phone=" + t;
	var month = $("#hs_month").val();
	var day = $("#hs_day").val();
	var hour = $("#hs_hour").val();
	t = month + "-" + day + " " + hour;
	if(t != "")
		data = data + "&PlayerBegintime=" + t;
	t = $("#profession-list option:selected").text();
	if(t != "")
		data = data + "&profession=" + t;
	t=$("#account-name").val();
	if(t != "")
		data = data + "&accountname=" + t;
	var p1 = $("#password").val();
	if(p1 == "")
	{
		alert("Please input your password!");
		return;
	}

	t = $("#re-pwd").val();
	if(p1 != t)
	{
		alert("Please input correct confirm password!");
		return;
	}

	data = data + "&password=" + t;
	t = $("#character-name").val();
	if(t == "")
	{
		alert("Please input your character name!");
		return;
	}

	data = data + "&charname=" + t;
	t = $("#current-level").val();
	if(t == "")
	{
		alert("Please input your level!");
		return;
	}

	t = t.match( /^-?\d+$/);
	if(t == null)
	{
		alert("Please input correct level!");
		return;
	}

	data = data + "&level=" + t;
	t = $("#payment").val();
	if(t == "")
	{
		alert("Please select payment method!");
		return;
	}

	data = data + "&payment=" + t;
	t = $("#game-server").val();
	if(t == "")
	{
		alert("Please select your game server!");
		return;
	}

	data = data + "&servercode=" + t;
	t = $("#game-server option:selected").text();
	data = data + "&servername=" + t;
	t = $("#order-note").val();
	if(t != "")
		data = data + "&remark=" + t;
	$.ajax(
	{
		error: function (x)
		{
			//alert ("error!");
			window.status = x;
			alert("Create order has error,please try again later!");
		},
		success: function (result)
		{
			window.status = result;
			try
			{
			  
				result = eval("(" + result + ")");
				if (result.alert != null)
					alert (result.alert);
				if (result.error != null)
					return;

				location.href = "http://www.myfastgame.net/plorderdetail.aspx";
			}
			catch (e)
			{
				window.status = e.message;
				alert("Create order has error,please try again later!");
			}
		},
		data: "delegate=static&JsBusiness:CreatePLOrderInfo=" + new Date().getTime() + data,
		url: "handler.html.axd"
	});
};
//</span><span>
window.jsHtml["plOrder.html"] = function ()
{
	$.ajax(
	{
		error: function (x)
		{
			//alert("error");
			location.href = "http://www.myfastgame.net/home.aspx"
		},
		success: function (result)
		{
			window.status = result;
			try
			{
				result = eval("(" + result + ")");
				if (result.error != null ||
					result.__ShoppingCartPL__ == null ||
					result.__ShoppingCartPL__.Products == null ||
					result.__ShoppingCartPL__.Products.length == 0 ||
					result._PLOrderInfo_ == null)
					return;

				if (result._PLOrderInfo_.Fullname.split(' ').length > 1)
				{
					$("#first-name").val(result._PLOrderInfo_.Fullname.split(' ')[0]);
					$("#last-name").val(result._PLOrderInfo_.Fullname.split(' ')[1]);
				}
				else
				{
					$("#first-name").val(result._PLOrderInfo_.Fullname);
					$("#last-name").val(result._PLOrderInfo_.Fullname);
				}
				$("#tel-no").val(result._PLOrderInfo_.PhoneNumber);
				$("#mail-address").val(result._PLOrderInfo_.Email);
				//$("#starting-time").val(result._PLOrderInfo_.PlayerBegintime);
				$("#account-name").val(result._PLOrderInfo_.GameAccount);
				$("#character-name").val(result._PLOrderInfo_.CharacterName);
				$("#current-level").val(result._PLOrderInfo_.CharacterLevel);
				$("#game-server").val(result._PLOrderInfo_.ServerName);
				//$("#payment").val(result._PLOrderInfo_.Paymethod);
				$("#order-note").val(result._PLOrderInfo_.Comments);
				//$("#profession-list").val(result._PLOrderInfo_.CharacterProfession);
			}
			catch (x)
			{
				//alert(x.message);
				//loadJsonSuccess(null);
				location.href = "http://www.myfastgame.net/home.aspx"
			}
		},
		data: "delegate=static&JsSession:GetPLCartInfo=" + new Date().getTime(),
		url: "session.html.axd"
	});
	$("#btn-submit").click(window.jsHtml["plSubmitOrder"]);
};
//</span><span>
window.jsHtml["loadPlDetailJson"] = function (result)
{
	if (result == null)
	{
		location.href = "http://www.myfastgame.net/home.aspx"
		return;
	}

	window.status = result;
	try
	{
		result = eval("(" + result + ")");
		if (result.error != null)
		{
			window.jsHtml["loadPlDetailJson"](null);
			return;
		}

		if (result.__ShoppingCartPL__ == null || result.__ShoppingCartPL__.Products == null || result.__ShoppingCartPL__.Products.length == 0 || result._PLOrderInfo_ == null)
		{
			window.jsHtml["loadPlDetailJson"](null);
			return;
		}

		for (var i = 1; i < 100; i++)
		{
			if (document.getElementById("tr-product-" + i) == null)
				break;

			$("#tr-product-" + i).css("display", "none");
		}
		for (var i = 0; i < result.__ShoppingCartPL__.Products.length; i++)
		{
			$("#tr-product-" + i).css("display", "");
			$("#Product-Name-" + i).html(result.__ShoppingCartPL__.Products[i].ProductName);
			$("#Product-Describe-" + i).html(result.__ShoppingCartPL__.Products[i].ProductDescribe);
			$("#Product-Price-" + i).html( result.__ShoppingCartPL__.Products[i].Price);
			//$("#Product-TimeLimit-" + i).html( result.__ShoppingCartPL__.Products[i].TimeLimit);
			document.getElementById("tr-product-" + i).guid = result.__ShoppingCartPL__.Products[i].Guid;
		}
		$("#total-price").html(result.__ShoppingCartPL__.TotalPrice);
		$("#full-name").html(result._PLOrderInfo_.Fullname);
		$("#starting-time").html(result._PLOrderInfo_.PlayerBegintime);
		$("#mail-address").html(result._PLOrderInfo_.Email);
		$("#account-name").html(result._PLOrderInfo_.GameAccount);
		$("#character-name").html(result._PLOrderInfo_.CharacterName);
		$("#current-level").html(result._PLOrderInfo_.CharacterLevel);
		$("#game-server").html(result._PLOrderInfo_.ServerName);
		$("#tel-no").html(result._PLOrderInfo_.PhoneNumber);
		$("#payment").html(result._PLOrderInfo_.Paymethod);
		$("#order-note").html(result._PLOrderInfo_.Comments);
		$("#profession-list").html(result._PLOrderInfo_.CharacterProfession);
	}
	catch (x)
	{
		alert(x.message);
		//window.jsHtml["loadPlDetailJson"](null);
		location.href = "http://www.myfastgame.net/home.aspx"
	}
};
//</span><span>
window.jsHtml["removePlProduct"] = function (index)
{
	if($("#tr-product-" + index).css("display") == "none")
		return;

	var guid = document.getElementById("tr-product-" + index).guid;
	if (guid == null)
		return;

	$.ajax(
	{
		error: function (x)
		{
			window.jsHtml["loadPlDetailJson"](null);
		},
		success: window.jsHtml["loadPlDetailJson"],
		data: "delegate=static&JsSession:RemoveFromPLCart=,&guid=" + guid + "&ticks=" + new Date().getTime(),
		url: "handler.html.axd"
	});
};
//</span><span>
window.jsHtml["plSubmitOrderDetail"] = function ()
{
	$.ajax(
	{
		error: function (x)
		{
			window.jsHtml["loadPlDetailJson"](null);
		},
		success: function (result)
		{
			window.status = result;
			try
			{
				result = eval("(" + result + ")");
				if (result.redirect != null)
				{
					window.jsHtml["loadPlDetailJson"](null);
					return;
				}

				if (result.error != null)
				{
					$("#btn-submit").attr("disabled", false);
					$("#lbl-msg").html(result.error);
					return;
				}

				location.href = "http://www.myfastgame.net/plpayment.aspx";
			}
			catch (x)
			{
				window.jsHtml["loadPlDetailJson"](null);
			}
		},
		data: "delegate=static&JsBusiness:SubmitPLOrder=,&ticks=" + new Date().getTime(),
		url: "handler.html.axd"
	});
	this.disabled = true;
};
//</span><span>
//$("#btn-submit").click(function ()
window.jsHtml["plOrderDetail.html"] = function ()
{
	$.ajax(
	{
		error: function (x)
		{
			//alert("error");
			window.jsHtml["loadPlDetailJson"](null);
		},
		success: window.jsHtml["loadPlDetailJson"],
		data: "delegate=static&JsSession:GetPLCartInfo=" + new Date().getTime(),
		url: "session.html.axd"
	});
	$("#btn-submit").click(window.jsHtml["plSubmitOrderDetail"]);
};
//</span><span>
window.jsHtml["plPayment.html"] = function ()
{
	$.ajax(
	{
		error: function (x)
		{
			//alert(x);
			window.jsHtml['paymentSuccess'](null);
		},
		success: window.jsHtml['paymentSuccess'],
		data: 'delegate=static&JsBusiness:PLPayment=http://www.myfastgame.net/paymentsuccess.aspx&ticks=' + new Date().getTime(),
		url: 'handler.html.axd'
	});
};
//</span><span>
window.jsHtml["registerSubmit"] = function ()
{
	var t = "static";
	var data = "delegate=" + t;
	t = new Date().getTime();
	data = data + "&JsLogin:UserRegister=" + t;
	t = $("#user-name").val();//user
	if (t == "")
	{
		$("#user-name").css("background-color", "red");
		$("#user-name").focus();
		return;
	}

	data = data + "&user=" + t;
	$("#user-name").css("background-color", "");
	t = $("#mail-address").val();//mail
	if (t == "")
	{
		$("#mail-address").css("background-color", "red");
		$("#mail-address").focus();
		return;
	}
	var rs = t.match(/^(\S)+[@](\S)+[.](\w)+$/);
	if(rs == null)
	{
		$("#mail-address").css("background-color", "red");
		$("#mail-address").focus();
		return;
	}

	data = data + "&mail=" + t;
	$("#mail-address").css("background-color", "");
	t = $("#password").val();//password
	if (t == "")
	{
		$("#password").css("background-color", "red");
		$("#password").focus();
		return;
	}

	if ($("#re-pwd").val() != t)
	{
		$("#re-pwd").css("background-color", "red");
		$("#re-pwd").focus();
		return;
	}

	data = data + "&password=" + t;
	$("#password").css("background-color", "");
	$("#re-pwd").css("background-color", "");
	t = $("#non-phone").val();//phone-other
	if (t != "")
	{
		data = data + "&phone-other=" + t;
	}
	else if ($("#phone-0").val() == "")
	{
		$("#phone-0").css("background-color", "red");
		$("#phone-1").css("background-color", "red");
		$("#phone-2").css("background-color", "red");
		$("#non-phone").css("background-color", "red");
		$("#phone-0").focus();
		return;
	}
	else if ($("#phone-1").val() == "")
	{
		$("#phone-0").css("background-color", "red");
		$("#phone-1").css("background-color", "red");
		$("#phone-2").css("background-color", "red");
		$("#non-phone").css("background-color", "red");
		$("#phone-1").focus();
		return;
	}
	else if ($("#phone-2").val() == "")
	{
		$("#phone-0").css("background-color", "red");
		$("#phone-1").css("background-color", "red");
		$("#phone-2").css("background-color", "red");
		$("#non-phone").css("background-color", "red");
		$("#phone-2").focus();
		return;
	}

	$("#phone-0").css("background-color", "");
	$("#phone-1").css("background-color", "");
	$("#phone-2").css("background-color", "");
	$("#non-phone").css("background-color", "");
	t = $("#phone-0").val() +"-"+ $("#phone-1").val() +"-"+ $("#phone-2").val();//phone
	if (t != "--")
		data = data + "&phone=" + t;
	t = $("#full-name").val();//full-name
	if (t == "")
	{
		$("#full-name").css("background-color", "red");
		$("#full-name").focus();
		return;
	}
	
	data = data + "&full-name=" + t;
	$("#full-name").css("background-color", "");
	t = $("#birthday").val();//birthday
	if (t != "")
		data = data + "&birthday=" + t;
	t = $("#special-festivals").val();//FeastDay
	if (t != "")
		data = data + "&feastday=" + t; 
	t = $("#address").val();//address
	if (t != "")
		data = data + "&address=" + t;
	t = $("#city").val();//city
	if (t != "")
		data = data + "&city=" + t;
	t = $("#province").val();//birthday
	if (t != "")
		data = data + "&province=" + t;
	t = $("#country").val();//country
	if (t != "")
		data = data + "&country=" + t;
	t = $("#zip-code").val();//zip-code
	if (t != "")
		data = data + "&zip-code=" + t;
	$.ajax(
	{
		error: function (x)
		{
			//alert(x);
			//window.location.href = 'http://www.myfastgame.net/home.aspx';
			alert('Register Failed !');
		},
		success: function (result)
		{
			window.status = result;
			try
			{
				result = eval("(" + result + ")");
				if(result.error!=null){
					alert(result.error); 
					return;
				} 
				if (result.UserLogin == null)
				{
					window.location.href = 'http://www.myfastgame.net/home.aspx';
					return;
				}

				alert('Register  success !');
				window.location.href = 'http://www.myfastgame.net/home.aspx';
			}
			catch(x)
			{
				//alert(x.message);
				window.status = x.message;
				//window.location.href = 'http://www.myfastgame.net/home.aspx';
				alert('Register Failed !');
			}
		},
		data: data + "&receive-news=true",
		url: "handler.html.axd"
	});
};
//</span><span>
window.jsHtml["forgotPassword"] = function ()
{
	var t = "static";
	var data = "delegate=" + t;
	t = $.cookie("__LoginCheckCode__");
	data = data + "&JsLogin:FindPassword=" + t;
	t = $("#user").val();//user
	if (t == "")
	{
		$("#lbl-user").css("display", "");
		$("#user").focus();
		return;
	}

	$("#lbl-user").css("display", "none");
	data = data + "&user=" + t;
	t = $("#mail").val();//mail
	if (t == "")
	{
		$("#lbl-mail").css("display", "");
		$("#mail").focus();
		return;
	}

	$("#lbl-mail").css("display", "none");
	data = data + "&mail=" + t;
	t = $("#code").val();//code
	if (t == "")
	{
		$("#lbl-code").css("display", "");
		$("#code").focus();
		return;
	}

	$("#lbl-code").css("display", "none");
	data = data + "&code=" + t;
	$.ajax({
		error: function (x)
		{
			$("#a-code").click();
			//alert(x);
			alert("Has error!");
		},
		success: function (result)
		{
			window.status = result;
			$("#a-code").click();
			try
			{
				result = eval("(" + result + ")");
				if (result.error != null)
					alert(result.error);
				else if (result.success != null)
					alert(result.success);
				else
					alert("Has error!");
			}
			catch(x)
			{
				//alert(x.message);
				window.status = x.message;
				alert("Has error!");
			}
		},
		data: data + "&ticks=" + new Date().getTime(),
		url: "handler.html.axd"
	});
};
//</span><span>
window.jsHtml["showAccountList"] = function (list)
{
	var o, oo, className;
	var t, tt;
	var i, ii;
	if (list == null || list.length == 0)
	{
		o = document.getElementById("table-list");
		if (o != null)
			o.style.display = "none";
		return null;
	}

	i = 0;
	while (o = document.getElementById("tr-" + i++))
	{
		ii = 0;
		o.style.display = "none";
		while (o = document.getElementById("tr-" + i + "-" + ii++))
			o.style.display = "none";
	}
	for (i = 0; i < list.length; i++)
	{
		t = null;
		o = document.getElementById("roleLevel-" + i);
		if (o != null)
			o.innerHTML = list[i].RoleLevel;

		o = document.getElementById("conversionTime-" + i);
		if (o != null)
		{
			if (list[i].ConversionTimeZh > "1900-01-01 00:00:00")
				o.innerHTML = "Transferable on " + list[i].ConversionTime;
			else
				o.innerHTML = "Transferable Character";
		}
		//ApvalueList
		for (ii = 0; list[i].ApvalueList != null && ii < list[i].ApvalueList.length; ii++)
		{
			if (list[i].ApvalueList[ii].ConfigTypeName == "Gender")
			{
				if (list[i].ApvalueList[ii].Value == "Male")
					t = "male";
				else
					t = "female";
			}
			if (list[i].ApvalueList[ii].ConfigTypeName == "Race")
				tt = list[i].ApvalueList[ii].Value.replace(" ", "");
		}
		for (ii = 0; list[i].ApvalueList != null && ii < list[i].ApvalueList.length; ii++)
		{
			o = document.getElementById(list[i].ApvalueList[ii].ConfigTypeName + "-" + i)
			if (o != null)
				o.innerHTML = list[i].ApvalueList[ii].Value
			o = document.getElementById("img-" + list[i].ApvalueList[ii].ConfigTypeName + "-" + i)
			if (o == null)
				continue;

			if (!o.tag)
				o.tag = o.src;
			if (list[i].ApvalueList[ii].ConfigTypeName != "Race")
				o.src = o.tag.replace("$" + list[i].ApvalueList[ii].ConfigTypeName, list[i].ApvalueList[ii].Value);
			else if (t != null)
				o.src = o.tag.replace("$" + list[i].ApvalueList[ii].ConfigTypeName, tt + "_" + t);
			else
				o.src = o.tag.replace("$" + list[i].ApvalueList[ii].ConfigTypeName, tt);
		}
		//É¾³ý·þÎñÆ÷ºóÃæµÄÕóÓªÃû³Æ
		if (list[i].GameServerTreeName.length <= 2)
		{
			t = list[i].GameServerTreeName[0];
		}
		else
		{
			t = "";
			for (ii = 0; ii < list[i].GameServerTreeName.length - 1; ii++)
				t = t + list[i].GameServerTreeName[ii] + " ";
		}
		//ÓÎÏ··þÎñÆ÷
		o = document.getElementById("img-server-" + i);
		if (list[i].GameServerCode.length > 7 && (list[i].GameServerCode.substring(0, 3) == "013" || list[i].GameServerCode.substring(0, 3) == "019"))
		{
			if (o != null)
			{
				if (!o.tag)
					o.tag = o.src;
				o.style.display = "";
				if (list[i].GameServerCode.substring(4, 7) == "001")
					o.src = o.tag.replace("$server", "alliance");
				else if (list[i].GameServerCode.substring(4, 7) == "002")
					o.src = o.tag.replace("$server", "horde");
				else
					o.style.display = "none";
			}
		}
		else
		{
			if (o != null)
				o.style.display = "none";
		}
		o = document.getElementById("serverTreeName-" + i);
		if (o != null)
			o.innerHTML = t;
		//guid/GEAR
		o = document.getElementById("a-detail-" + i);
		if (o != null)
			o.href = list[i].Deatails
		o = document.getElementById("img-integral-" + i);
		if (o != null)
		{
			if (!o.tag)
				o.tag = o.src;
			o.src = o.tag.replace("$Integral", list[i].Integral);
		}
		o = document.getElementById("id-" + i);
		if (o != null)
			o.innerHTML = list[i].ID;
		//price
		ii = window.jsHtml["getConfigPrice"](list[i].ID, list[i].SalePrice);
		o = document.getElementById("salePrice-" + i)
		if (o != null)
		{
			if (list[i].Discount <= 0 || list[i].Discount > 1)
				o.innerHTML = "<div class=\"Pricebox\"><h6  style=\"font-size:12px\">$" + window.jsHtml["getMoney"](ii) + "</h6></div>";
			else
				o.innerHTML = "<p style=\"font-size:12px\"><s>Was$" + window.jsHtml["getMoney"](ii) + "</s></p> " + window.jsHtml["getMoney"](ii * (1 - list[i].Discount)) + "<br />" + (list[i].Discount * 100) + "% OFF";
		}
		//buy
		o = document.getElementById("serverCode-" + i)
		if (o != null)
			o.value = list[i].GameServerCode;
		o = document.getElementById("guid-" + i)
		if (o != null)
			o.value = list[i].Guid;
		o = document.getElementById("buy-" + i)
		if (o != null)
		{
			if (o.tagName == "IMG")
				o.src = list[i].Buy;
			o.tag = list[i].Buy;
		}
		//AccountDescription
		o = document.getElementById("accountDescription-" + i);
		if (o != null)
			o.innerHTML = list[i].AccountDescription;
		o = document.getElementById("tr-" + i);
		if (o != null)
			o.style.display = "";
		ii = 0;
		while (o = document.getElementById("tr-" + i + "-" + ii++))
			o.style.display = "";
	}
	o = document.getElementById("table-list");
	if (o != null)
		o.style.display = "";
};
//</span><span>
window.jsHtml["accountPageChange"] = function ()
{
	var o = document.getElementById("table-list");
	var search = o;
	if (search != null)
		search = search.search;
	if (!search)
	{
		if (o.current != null && o.current.accounts != null && o.current.accounts.length > 0 && o.shtml != null && o.shtml.length > 1)
		{
			window.location.href = o.shtml[parseInt(this.value)];
			return;
		}
	}

	o = parseInt(this.value);
	if (isNaN(o) || o <= 0)
		o = 0;
	else
		o = o - 1;
	o = "delegate=static&JsCache:GetAccountList=" + window.jsHtml.vars["gameCode"] + "&" + window.jsHtml.vars["gameCode"] + "=search&size=" + window.jsHtml.vars["pageSize"] + "&page=" + o;
	if (search.Server != null && search.Server != "")
		o = o + "&server=" + search.Server;
	if (search.Class != null && search.Class != "")
		o = o + "&class=" + search.Class;
	if (search.Faction != null && search.Faction != "")
		o = o + "&faction=" + search.Faction;
	if (search.Race != null && search.Race != "")
		o = o + "&race=" + search.Race;
	if (search.Level != null && search.Level != "")
		o = o + "&level=" + search.Level;
	if (search.Price != null && search.Price != "")
		o = o + "&price=" + search.Price;
	$("#table-search").css("visibility", "hidden");
	$.ajax(
	{
		error: function (x)
		{
			//alert(x);
			$("#table-search").css("visibility", "visible");
		},
		success: function (result)
		{
			window.status = result;
			$("#table-search").css("visibility", "visible");
			try
			{
				result = eval("(" + result + ")");
				$("#select-page").empty();
				for (var i = 1; i <= result.pages; i++)
					$("<option value=\"" + i + "\">" + i + "</option>").appendTo($("#select-page"));
				if (result.pages == 0)
					$("<option value=\"1\">1</option>").appendTo($("#select-page"));
				$("#select-page").val(result.page + 1);
				if (result.page <= 0)
				{
					$("#a-first").attr("disabled", true);
					$("#a-last").attr("disabled", true);
				}
				else
				{
					$("#a-first").attr("disabled", false);
					$("#a-last").attr("disabled", false);
				}
				if (result.page >= result.pages - 1)
				{
					$("#a-next").attr("disabled", true);
					$("#a-end").attr("disabled", true);
				}
				else
				{
					$("#a-next").attr("disabled", false);
					$("#a-end").attr("disabled", false);
				}
				window.jsHtml["showAccountList"] (result.accounts);
			}
			catch (x)
			{
				//alert(x.message);
				window.status = x.message;
			}
		},
		data: o + "&ticks=" + new Date().getTime(),
		url: "handler.html.axd"
	});
};
//</span><span>
window.jsHtml["accountSearch"] = function ()
{
	var e = document.getElementById("table-list");
	var json = e.search;
	e.search = {
		Server: $("#select-Server").val(),
		Class: $("#select-Class").val(),
		Faction: $("#select-Faction").val(),
		Race: $("#select-Race").val(),
		Level: $("#select-Level").val(),
		Price: $("#select-Price").val()
	}
	if ((e.search.Server == null || e.search.Server == "") &&
		(e.search.Class == null || e.search.Class == "") &&
		(e.search.Faction == null || e.search.Faction == "") &&
		(e.search.Race == null || e.search.Race == "") &&
		(e.search.Level == null || e.search.Level == "") &&
		(e.search.Price == null || e.search.Price == ""))
		e.search = null;
	if (e.search == null && !json)
		return;

	if (e.search && json &&
		e.search.Server == json.Server &&
		e.search.Class == json.Class &&
		e.search.Faction == json.Faction &&
		e.search.Race == json.Race &&
		e.search.Level == json.Level &&
		e.search.Price == json.Price)
		return;

	$("#select-page").change();
};
//</span><span>
window.jsHtml["goFirst"] = function ()
{
	var i = $("#select-page").val();
	i = parseInt(i);
	if (i != 1)
	{
		$("#select-page").val(1);
		$("#select-page").change();
	}
};
//</span><span>
window.jsHtml["goLast"] = function ()
{
	var i = $("#select-page").val();
	i = parseInt(i);
	if (i > 1)
	{
		$("#select-page").val(i - 1);
		$("#select-page").change();
	}
};
//</span><span>
window.jsHtml["goNext"] = function ()
{
	var l = document.getElementById("select-page").options.length;
	var i = $("#select-page").val();
	i = parseInt(i);
	if (i < l)
	{
		$("#select-page").val(i + 1);
		$("#select-page").change();
	}
};
//</span><span>
window.jsHtml["goEnd"] = function ()
{
	var l = document.getElementById("select-page").options.length;
	var i = $("#select-page").val();
	i = parseInt(i);
	if (i != l)
	{
		$("#select-page").val(l);
		$("#select-page").change();
	}
};
//</span><span>
window.jsHtml["goPage"] = function ()
{
	$("#select-page").change();
};
//</span><span>
window.jsHtml["buyAccountWow.html"] = function ()
{
	var e = document.getElementById("table-list");
	e.shtml = window.jsHtml.vars["pagedUrlList"];
	e.current = window.jsHtml.vars["dataJson"];
	$("#select-page").empty();
	for (var i = 1; i <= e.current.pages; i++)
		$("<option value=\"" + i + "\">" + i + "</option>").appendTo($("#select-page"));
	$("#select-page").val(e.current.page + 1);
	if (e.current.page <= 0)
	{
		$("#a-first").attr("disabled", true);
		$("#a-last").attr("disabled", true);
	}
	if (e.current.page >= e.current.pages - 1)
	{
		$("#a-next").attr("disabled", true);
		$("#a-end").attr("disabled", true);
	}
	window.jsHtml["showAccountList"](e.current.accounts);//e.style.display = "";
	var data = "delegate=static&JsCache:GetAccountList=" + window.jsHtml.vars["gameCode"] + "&" + window.jsHtml.vars["gameCode"] + "=compare&compare="
	for (var i = 0; i < e.current.accounts.length; i++)
		data = data + e.current.accounts[i].Guid + "/";
	$.ajax(//load all json
	{
		error: function (x)
		{
			//alert(x);
		},
		success: function (result)
		{
			window.status = result;
			try
			{
				result = eval("(" + result + ")");
				var e = document.getElementById("table-list");
				for (var i = 0; i < e.current.accounts.length; i++)
				{
					var o = document.getElementById("buy-" + i);
					if (o == null)
						break;

					if (o.tagName == "INPUT")
					{
						o.disabled = true;
						continue;
					}

					o.style.display = "none";
					o = document.getElementById("img-buy-" + i);
					if (o != null)
						o.style.display = "";
				}
				for (var i = 0; i < result.accounts.length; i++)
				{
					for (var ii = 0; ii < e.current.accounts.length; ii++)
					{
						if (result.accounts[i].ID != e.current.accounts[ii].ID)
							continue;

						var o = document.getElementById("buy-" + ii);
						if (o == null)
							break;

						if (o.tagName == "INPUT")
						{
							o.disabled = false;
							continue;
						}

						o.style.display = "";
						o = document.getElementById("img-buy-" + ii);
						if (o != null)
							o.style.display = "none";
					}
				}
			}
			catch (x)
			{
				alert(x.message);
			}
		},
		data: data,
		url: "handler.html.axd"
	});
	$("#a-go").click(window.jsHtml["goPage"]);
	$("#a-end").click(window.jsHtml["goEnd"]);
	$("#a-next").click(window.jsHtml["goNext"]);
	$("#a-last").click(window.jsHtml["goLast"]);
	$("#a-first").click(window.jsHtml["goFirst"]);
	$("#select-page").change(window.jsHtml["accountPageChange"]);
};
//</span><span>
window.jsHtml["getConfigPrice"] = function (id, price)
{
	var o = price;
	id = id.toUpperCase();
	if (id == null)
		o = price * parseFloat(window.jsHtml.vars["priceConfig"]["AccountPrice"]);
	else if (id.indexOf("AC") == 0)
		o = price * parseFloat(window.jsHtml.vars["priceConfig"]["AccountPriceAC"]);
	else if (id.indexOf("AS") == 0)
		o = price * parseFloat(window.jsHtml.vars["priceConfig"]["AccountPriceAS"]);
	else if (id.indexOf("AB") == 0)
		o = price * parseFloat(window.jsHtml.vars["priceConfig"]["AccountPriceAB"]);
	else if (id.indexOf("AE") == 0)
		o = price * parseFloat(window.jsHtml.vars["priceConfig"]["AccountPriceAE"]);
	else if (id.indexOf("AJ") == 0)
		o = price * parseFloat(window.jsHtml.vars["priceConfig"]["AccountPriceAJ"]);
	else
		o = price * parseFloat(window.jsHtml.vars["priceConfig"]["AccountPrice"]);
	if (isNaN(o))
		o = price;
	return o;
};
//</span><span>
window.jsHtml["applyAccountDiscount"] = function (result, hideError)
{
	var pp = window.jsHtml["getMoney"](window.jsHtml["getConfigPrice"](window.jsHtml.vars["dataJson"].ID, window.jsHtml.vars["dataJson"].SalePrice));
	if(window.jsHtml.vars["dataJson"].Discount <= 10 && window.jsHtml.vars["dataJson"].Discount > 0)
		pp = window.jsHtml["getMoney"](pp * (1 - window.jsHtml.vars["dataJson"].Discount));
	if (result._Coupon_ == null)
	{
		if(result.GoldSaleConfigInfo != null && (result.GoldSaleConfigInfo.SaleStatus & 1) == 1)
			$("#tr-coupon").css("display", "");
		else
			$("#tr-coupon").css("display", "none");
		$("#lbl-price").html(pp);
		if (hideError)
			return;

		$("#lbl-error").html("error!");
		$("#lbl-error").css("display", "");
		return;
	}

	$("#lbl-error").css("display", "none");
	$("#tr-coupon").css("display", "none");
	$("#lbl-price").html("Discount Price:" + window.jsHtml["getMoney"](pp * (1 - result._Coupon_.CouponPercent / 100)));
};
//</span><span>
window.jsHtml["accountDiscount.click"] = function ()
{
	var discount = $("#discount").val();
	if (discount == "")
	{
		$("#lbl-discount").css("display", "");
		return;
	}

	$("#lbl-discount").css("display", "none");
	$.ajax(
	{
		error: function (x)
		{
			window.status = x;
			//alert(x);
			alert("Create order has error,please try again later!");
		},
		success: function (result)
		{
			window.status = result;
			try
			{
				result = eval("(" + result + ")");
				window.jsHtml["applyAccountDiscount"](result, false);
			}
			catch (x)
			{
				//alert (x.message);
				//$("#lbl-msg").html(x.message);
				//$("#lbl-msg").css("display", "");
				window.status = x.message;
			}
		},
		data: "delegate=static&JsBusiness:AccountApplyDiscount=" + discount + "&server=" + window.jsHtml.vars["dataJson"].GameServerCode + "&ticks=" + new Date().getTime(),
		url: "handler.html.axd"
	});
};
//</span><span>
window.jsHtml["accountSubmitBuy"] = function ()
{
	var first = $("#first-name").val();
	if (first == "")
	{
		$("#lbl-first-name").css("display", "");
		return;
	}

	$("#lbl-first-name").css("display", "none");
	var last = $("#last-name").val();
	if (last == "")
	{
		$("#lbl-last-name").css("display", "");
		return;
	}

	$("#lbl-last-name").css("display", "none");
	var mail = $("#mail").val();
	if (mail == "" || mail.match(/^\S+@\S+\.\w+$/)==null)
	{
		$("#lbl-mail").css("display", "");
		return;
	}

	$("#lbl-mail").css("display", "none");
	var phone = $("#phone").val();
	if (phone == "")
	{
		$("#lbl-phone").css("display", "");
		return;
	}

	$("#lbl-phone").css("display", "none");
	var payment = $("#payment").val();
	if (payment == "")
	{
		$("#lbl-payment").css("display", "");
		return;
	}

	$("#lbl-payment").css("display", "none");
	var data = "delegate=static&JsBusiness:AppendAccountOrder=" + window.jsHtml.vars["dataJson"].Guid;
	data = data + "&guid=" + window.jsHtml.vars["dataJson"].Guid;
	data = data + "&address=" + $("#address").val();
	data = data + "&city=" + $("#city").val();
	data = data + "&state=" + $("#state").val();
	data = data + "&zip-code=" + $("#zip-code").val();
	data = data + "&payment=" + $("#payment").val();
	data = data + "&mail=" + $("#mail").val();
	data = data + "&phone=" + $("#phone").val();
	data = data + "&first=" + $("#first-name").val();
	data = data + "&last=" + $("#last-name").val();
	data = data + "&time=" + $("#time").val();
	data = data + "&remark=" + $("#remark").val();
	$.ajax(
	{
		error: function (x)
		{
			window.status = x;
			//alert(x);
			alert("Create order has error,please try again later!");
		},
		success: function (result)
		{
			window.status = result;
			try
			{
				result = eval("(" + result + ")");
				if (result.error != null)
				{
					$("#lbl-error").html(result.error);
					$("#lbl-error").css("display", "");
				}

				$("#lbl-error").css("display", "none");
				location.href = "http://www.myfastgame.net/buyaccountwoworderdetail.aspx";
			}
			catch (x)
			{
				//alert (x.message);
				//$("#lbl-msg").html(x.message);
				//$("#lbl-msg").css("display", "");
				window.status = x.message;
				alert("Create order has error,please try again later!");
			}
		},
		data: data + "&ticks=" + new Date().getTime(),
		url: "handler.html.axd"
	});
};
//</span><span>
window.jsHtml["BuyAccountWowOrder.html"] = function ()
{
	var data = "delegate=static&JsBusiness:AccountApplyDiscount=&server=" + window.jsHtml.vars["dataJson"].GameServerCode;
	$.ajax(
	{
		error: function (x)
		{
			//alert(x);
			window.status = x;
		},
		success: function (result)
		{
			window.status = result;
			try
			{
				result = eval("(" + result + ")");
				window.jsHtml["applyAccountDiscount"](result, true);
			}
			catch (x)
			{
				//alert (x.message);
				//$("#lbl-msg").html(x.message);
				//$("#lbl-msg").css("display", "");
				window.status = x.message;
			}
		},
		data: data + "&ticks=" + new Date().getTime(),
		url: "handler.html.axd"
	});

	data = window.jsHtml.vars["dataJson"].GameServerCode.substring(0, 3);
	data = "delegate=static&JsCache:GetAccountList=" + data + "&" + data + "=search&size=1&page=0&guid=" + window.jsHtml.vars["dataJson"].Guid;
	$.ajax(
	{
		error: function (x)
		{
			//alert(x);
		},
		success: function (result)
		{
			window.status = result;
			try
			{
				result = eval("(" + result + ")");
				if (result != null && result.accounts != null && result.accounts.length != 0)
				{
					window.jsHtml.vars["dataJson"] = result.accounts[0];
					return;
				}

				$("#btn-submit").attr("disabled", "disabled");
				$("#btn-submit").val("Has been sold!");
			}
			catch (x)
			{
				//alert(x.message);
				window.status = x.message;
			}
		},
		data: data + "&ticks=" + new Date().getTime(),
		url: "handler.html.axd"
	});
};
//</span><span>
window.jsHtml["accountSubmitOrder"] = function ()
{
	if (!window.jsHtml.vars["dataJson"])
	{
		location.href="http://www.myfastgame.net/home.aspx";
		return;
	}

	if (window.jsHtml.vars["dataJson"].PayMethod != "Paypal" &&
		window.jsHtml.vars["dataJson"].PayMethod != "CreditCardThroughPaypal" &&
		window.jsHtml.vars["dataJson"].PayMethod != "MoneyBooker")
	{
		location.href="http://www.myfastgame.net/cybersourcepayment.aspx";
		return;
	}

	$.ajax(
	{
		error: function (x)
		{
			//alert(x);
			alert("Create order has error,please try again later!");
			this.style.display = "";
		},
		success: function (result)
		{
			window.status = result;
			try
			{
				result = eval("(" + result + ")");
				if (result.SaleOrder == null)
				{
					alert("Create order has error,please try again later!");
					return;
				}

				location.href='http://www.myfastgame.net/accountpayment.aspx';
			}
			catch (x)
			{
				//alert(x.message);
				window.status = x.message;
				this.style.display = "";
				alert("Create order has error,please try again later!");
			}
		},
		data: "delegate=static&JsBusiness:SubmitAccountOrder=" + new Date().getTime(),
		url: "handler.html.axd"
	});
	this.style.display = "none";
};
//</span><span>
window.jsHtml["buyAccountWowOrderDetail.html"] = function ()
{
	$.ajax(
	{
		error: function (x)
		{
			//alert(x);
			location.href="http://www.myfastgame.net/home.aspx";
		},
		success: function (result)
		{
			window.status = result;
			try
			{
				result = eval("({" + result + "})");
				result = result.SaleOrder;
				if (!result)
				{
					location.href="http://www.myfastgame.net/home.aspx";
					return;
				}

				window.jsHtml.vars["dataJson"] = result;
				$("#td-code").html(result.Code);
				var i = result.FullName.indexOf(" ");
				if (i > 0)
				{
					$("#td-first").html(result.FullName.substring(0, i));
					$("#td-last").html(result.FullName.substring(i + 1, result.FullName.length));
				}
				else
				{
					$("#td-first").html(result.FullName);
					$("#td-last").html(result.FullName);
				}
				$("#td-address").html(result.Address);
				$("#td-phone").html(result.Phone);
				$("#td-mail").html(result.PaypalEmail);
				$("#td-remark").html(result.Remark);
				$("#td-price").html("$ " + result.SaleTotalPrice);
				$("#td-payment").html(result.PayMethod);
			}
			catch (x)
			{
				//alert(x.message);
				window.status = x.message;
			}
		},
		data: "get=session&SaleOrder=%0d%0a&ticks=" + new Date().getTime(),
		url: "session.html.axd"
	});
};
//</span><span>
window.jsHtml["accountPayment.html"] = function ()
{
	$.ajax({
		error: function (x)
		{
			//alert(x);
			window.jsHtml["paymentSuccess"](null);
		},
		success: window.jsHtml["paymentSuccess"],
		data: "delegate=static&JsBusiness:AccountPayment=http://www.myfastgame.net/paymentsuccess.aspx&time=" + new Date().getTime(),
		url: "handler.html.axd"
	});
};
//</span><span>
window.jsHtml["accountSubmitSale"] = function ()
{
	var t = "static"
	var data = "delegate=" + t;
	t = $("#game").val();//window.jsHtml.vars["gameCode"]
	data = data + "&JsBusiness:SellAccountPostInfo=" + t;
	t = $("#first-name").val();//first-name
	if (t == "")
	{
		$("#lbl-first-name").css("display", "");
		return;
	}

	$("#lbl-first-name").css("display", "none");
	data = data + "&first-name=" + t;
	t = $("#last-name").val();//last-name
	if (t == "")
	{
		$("#lbl-last-name").css("display", "");
		return;
	}

	$("#lbl-last-name").css("display", "none");
	data = data + "&last-name=" + t;
	t = $("#mail").val();//mail
	if (t == "" || t.match(/^(\S)+[@](\S)+[.](\w)+$/)==null)
	{
		$("#lbl-mail").css("display", "");
		return;
	}

	$("#lbl-mail").css("display", "none");
	data = data + "&mail=" + t;
	t = $("#phone").val();//phone
	if (t == "")
	{
		$("#lbl-phone").css("display", "");
		return;
	}

	$("#lbl-phone").css("display", "none");
	data = data + "&phone=" + t;
	t = $("#server").val();//server
	if (t == "")
	{
		$("#lbl-server").css("display", "");
		return;
	}

	$("#lbl-server").css("display", "none");
	data = data + "&server=" + t;
	t = $("#level").val();//level
	if (t == "" || t.match( /^-?\d+$/)==null)
	{
		$("#lbl-level").css("display", "");
		return;
	}

	$("#lbl-level").css("display", "none");
	data = data + "&level=" + t;
	t = $("#is-active").val();//is-active
	if (t == "")
	{
		$("#lbl-is-active").css("display", "");
		return;
	}

	$("#lbl-is-active").css("display", "none");
	data = data + "&is-active=" + t;
	t = $("#armory-link").val();//armory-link
	if (t == "")
	{
		$("#lbl-armory-link").css("display", "");
		return;
	}

	$("#lbl-armory-link").css("display", "none");
	data = data + "&armory-link=" + t;
	t = window.jsHtml.vars["dataString"];//config-list
	if (t != null && t != "")
	{
		t = t.split(',');
		for (var i = 0; i < t.length; i++)
		{
			if (t[i] == "")
				continue;

			data = data + "&" + t[i] + "=" + $("#" + t[i]).val();
		}
	}
	$.ajax({
		error: function (x)
		{
			//alert("Error!");
			window.status = x;
			alert("Create order has error,please try again later!");
			this.style.display = "";
		},
		success: function (result)
		{
			window.status = result;
			try
			{
				result = eval("(" + result + ")");
				if (result.error != null)
				{
					$("#btn-submit").attr("disabled",false);
					alert(result.error);
					return;
				}

				window.location.href = "http://www.myfastgame.net/sellaccountwoworderdetail.aspx";
			}
			catch(x)
			{
				this.style.display = "";
				//alert(x.message);
				window.status = x.message;
				alert("Create order has error,please try again later!");
			}
		},
		data: encodeURI(data + "&ticks=" + new Date().getTime()),
		url: "handler.html.axd"
	});
	this.style.display = "none";
};
//</span><span>
window.jsHtml["sellAccountWowOrderDetail.html"] = function ()
{
	$.ajax(
	{
		error: function (x)
		{
			//alert(x);
			window.location.href = 'http://www.myfastgame.net/home.aspx';
		},
		success: function (result)
		{
			window.status = result;
			try
			{
				result = eval("(" + result + ")");
				if (result.StockOrder == null)
					window.location.href = 'http://www.myfastgame.net/home.aspx';
				else
					$("#lbl-code").html(result.StockOrder.Code);
			}
			catch(x)
			{
				//alert(x.message);
				window.status = x.message;
				window.location.href = 'http://www.myfastgame.net/home.aspx';
			}
		},
		data: "delegate=static&JsBusiness:SellAccountComplete=" + new Date().getTime(),
		url: "handler.html.axd"
	});
};
//</span><span>
window.jsHtml["cyberSourcePaymentContinue"] = function ()
{
	if ($("#card").val() == "")
	{
		$("#lbl-card").css("display", "");
		return;
	}

	$("#lbl-card").css("display", "none");
	if ($("#amount").val() == "")
	{
		$("#lbl-amount").css("display", "");
		return;
	}

	$("#lbl-amount").css("display", "none");
	if ($("#card-code-0").val() == "" || $("#card-code-1").val() == "" || $("#card-code-2").val() == "" || $("#card-code-3").val() == "")
	{
		$("#lbl-card-code").css("display", "");
		return;
	}

	$("#lbl-card-code").css("display", "none");
	if ($("#cvv").val() == "")
	{
		$("#lbl-cvv").css("display", "");
		return;
	}

	$("#lbl-cvv").css("display", "none");
	if ($("#month").val() == "")
	{
		$("#lbl-month").css("display", "");
		return;
	}

	$("#lbl-month").css("display", "none");
	if ($("#year").val() == "")
	{
		$("#lbl-year").css("display", "");
		return;
	}

	$("#lbl-year").css("display", "none");
	if ($("#country").val() == "")
	{
		$("#lbl-country").css("display", "");
		return;
	}

	$("#lbl-country").css("display", "none");
	if ($("#state").val() == "")
	{
		$("#lbl-state").css("display", "");
		return;
	}

	$("#lbl-state").css("display", "none");
	if ($("#city").val() == "")
	{
		$("#lbl-city").css("display", "");
		return;
	}

	$("#lbl-city").css("display", "none");
	if ($("#street").val() == "")
	{
		$("#lbl-street").css("display", "");
		return;
	}

	$("#lbl-street").css("display", "none");
	if ($("#zip-code").val() == "")
	{
		$("#lbl-zip-code").css("display", "");
		return;
	}

	$("#lbl-zip-code").css("display", "none");
	var data = "delegate=static&JsBusiness:CyberSourcePayment=http://www.myfastgame.net/paymentsuccess.aspx";
	data = data + "&card=" + $("#card").val();
	data = data + "&amount=" + $("#amount").val();
	data = data + "&card-code=" + $("#card-code-0").val() + $("#card-code-1").val() + $("#card-code-2").val() + $("#card-code-3").val();
	data = data + "&cvv=" + $("#cvv").val();
	data = data + "&month=" + $("#month").val();
	data = data + "&year=" + $("#year").val();
	data = data + "&country=" + $("#country").val();
	data = data + "&state=" + $("#state").val();
	data = data + "&city=" + $("#city").val();
	data = data + "&street=" + $("#street").val();
	data = data + "&zip-code=" + $("#zip-code").val();
	$.ajax({
		error: function (x)
		{
			//alert(x);
			//alert("error !");
			window.status = x;
			alert("Create order has error,please try again later!");
		},
		success: function (result)
		{
			window.status = result;
			try
			{
				result = eval("(" + result + ")");
				if (result.error != null)
				{
					alert(result.error);
					return;
				}

				location.href = "http://www.myfastgame.net/paymentsuccess.aspx?" + result.success.Code;
			}
			catch(x)
			{
				//alert(x.message);
				window.status = x.message;
			}
		},
		data: data + "&ticks=" + new Date().getTime(),
		url: "handler.html.axd"
	});
};
//</span><span>
window.jsHtml["cyberSourcePayment.html"] = function ()
{
	$.ajax(
	{
		error: function (x)
		{
			//alert(x);
			//location.href = "http://www.myfastgame.net/home.aspx";
		},
		success: function (result)
		{
			window.status = result;
			try
			{
				result = eval ("({" + result + ")");

				if (result._OrderInfo_ != null)
				{
					$("#lbl-code").html(result._OrderInfo_.Code);
					return;
				}

				if (result.SaleOrder != null)
				{
					$("#lbl-code").html(result.SaleOrder.Code);
					$("#amount").val("$" + getMoney(null, result.SaleOrder.SaleTotalPrice));
					return;
				}

				//alert ('null');
				//location.href = "http://www.myfastgame.net/home.aspx";
			}
			catch(x)
			{
				//alert(x.message);
				window.status = x.message;
			}
		},
		data: "get=session&_OrderInfo_=,&SaleOrder=}&ticks=" + new Date().getTime(),
		url: "session.html.axd"
	});
	$("#country").click(function ()
	{
		$("#state").empty();
		$("<option value=\"\">select state</option>").appendTo($("#state"));
		if (this.value == "")
			return;

		var i = 0;
		for (i = 0; i < window.country.DocumentElement.ChildNodes.length; i++)
		{
			if (window.country.DocumentElement.ChildNodes[i]["@:name"] == this.value)
				break;
		}
		for (var ii = 0; ii < window.country.DocumentElement.ChildNodes[i].ChildNodes.length; ii++)
			$("<option value=\"" + window.country.DocumentElement.ChildNodes[i].ChildNodes[ii]["@:name"] + "\">" + window.country.DocumentElement.ChildNodes[i].ChildNodes[ii]["@:name"] + "</option>").appendTo($("#state"));
	});
	for (var i = 0; i < window.country.DocumentElement.ChildNodes.length; i++)
		$("<option value=\"" + window.country.DocumentElement.ChildNodes[i]["@:name"] + "\">" + window.country.DocumentElement.ChildNodes[i]["@:name"] + "</option>").appendTo($("#country"));
};
//</span><span>
window.jsHtml["itemOrder.html"] = function (query)
{
	var o = document.getElementById("game");
	for (var i = 0; i < o.options.length; i++)
	{
		if (o.options[i].value == "")
			continue;

		var oo = document.getElementById("server");
		var oo0 = new Array();
		var oo1 = new Array();
		for (var ii = 0; ii < oo.options.length; ii++)
		{
			if (oo.options[ii].value == "" || oo.options[ii].value.indexOf(o.options[i].value) != 0)
				oo1.push({ value: oo.options[ii].value, text: oo.options[ii].text });
			else
				oo0.push({ value: oo.options[ii].value, text: oo.options[ii].text });
		}
		$("#server").empty();
		for (var ii = 0; ii < oo1.length; ii++)
			$("<option value=\"" + oo1[ii].value + "\">" + oo1[ii].text + "</option>").appendTo($("#server"));
		o.options[i].tag = oo0;
	}
	$("#game").change(function ()
	{
		var o = document.getElementById("server");
		var oo = new Array();
		for (var i = 0; i < o.options.length; i++)
		{
			if (o.options[i].value == "")
				oo.push(o.options[i]);
		}
		$("#server").empty();
		for (var i = 0; i < oo.length; i++)
			$("<option value=\"" + oo[i].value + "\">" + oo[i].text + "</option>").appendTo($("#server"));
		if (!this.options[this.selectedIndex].tag)
			return;

		for (var i = 0; i < this.options[this.selectedIndex].tag.length; i++)
			$("<option value=\"" + this.options[this.selectedIndex].tag[i].value + "\">" + this.options[this.selectedIndex].tag[i].text + "</option>").appendTo($("#server"));
		o.selectedIndex = 0;
	});
	$.ajax(
	{
		error: function (x)
		{
			//alert("error" + x);
			window.jsHtml["loadItemCartJson"](null);
		},
		success: window.jsHtml["loadItemCartJson"],
		data: "delegate=static&JsBusiness:AppendIntoItemCart=" + new Date().getTime() + query,
		url: "handler.html.axd"
	});
};
//</span><span>
window.jsHtml["loadItemCartJson"] = function  (result)
{
	if (result == null)
	{
		location.href = 'http://www.myfastgame.net/item.aspx';
		return;
	}

	window.status = result;
	try
	{
		result = eval("(" + result + ")");
		if (result.error)
			alert(result.error);

		if (result.$)
			result.$(result);
		if(result.success == null || result.success.length == 0)
		{
			location.href = 'http://www.myfastgame.net/item.aspx';
			return;
		}

		for (var i = 1; i < 100; i++)
		{
			if (document.getElementById("tr-" + i) == null)
				break;

			$("#tr-" + i).css("display", "none");
		}
		var price = 0;
		for (var i = 0; i < result.success.length; i++)
		{
			$("#tr-" + i).css("display", "");
			$("#name-" + i).html(result.success[i].Name);
			$("#price-" + i).html(result.success[i].Price);
			$("#guid-" + i).html(result.success[i].Guid);
			price += parseFloat(result.success[i].Price);
		}
		$("#total-price").html(price);
		
		if (result.$)
		{
			if(result.profession)
				$("#profession").html(result.profession + "&nbsp;");
			if (result.order == null)
			{
				location.href = 'http://www.myfastgame.net/itemorder.aspx';
				return;
			}

			$("#full-name").html(result.order.FullName + "&nbsp;");
			$("#tel-no").html(result.order.Tel + "&nbsp;");
			$("#mail-address").html(result.order.Email + "&nbsp;");
			$("#pay-mail").html(result.order.PayEmail + "&nbsp;");
			$("#starting-time").html(result.order.StartTime + "&nbsp;");
			if (result.game)
				$("#game").html(result.game + "&nbsp;");
			else
				$("#game").html(result.order.Game + "&nbsp;");
			if (result.server)
				$("#server").html(result.server + "&nbsp;");
			else
				$("#server").html(result.order.GameServer + "&nbsp;");
			$("#account-name").html(result.order.AccountName + "&nbsp;");
			$("#character-name").html(result.order.CharName + "&nbsp;");
			$("#current-level").html(result.order.CurrentLevel + "&nbsp;");
			$("#service-representative").html(result.order.Service + "&nbsp;");
			$("#payment").html(result.order.PaymentMethod + "&nbsp;");
			$("#order-note").html(result.order.Note + "&nbsp;");
			return;
		}

		if ($("#full-name").val() != "")
			return;

		if ($("#tel-no").val() != "")
			return;

		if ($("#mail-address").val() != "")
			return;

		if ($("#pay-mail").val() != "")
			return;

		if ($("#game").val() != "")
			return;

		if ($("#server").val() != "")
			return;

		if ($("#profession").val() != "")
			return;

		if ($("#account-name").val() != "")
			return;

		if ($("#password").val() != "")
			return;

		if ($("#re-pwd").val() != "")
			return;

		if ($("#character-name").val() != "")
			return;

		if ($("#current-level").val() != "")
			return;

		if ($("#service-representative").val() != "")
			return;

		if ($("#payment").val() != "")
			return;

		if ($("#order-note").val() != "")
			return;

		if(result.profession)
			$("#profession").val(result.profession);
		if (result.order == null)
			return;

		$("#full-name").val(result.order.FullName);
		$("#tel-no").val(result.order.Tel);
		$("#mail-address").val(result.order.Email);
		$("#pay-mail").val(result.order.PayEmail);
		//$("#starting-time").val(result.order.StartTime);
		$("#game").val(result.order.Game);
		$("#game").change();
		$("#server").val(result.order.GameServer);
		$("#account-name").val(result.order.AccountName);
		//$("#password").val(result.order.AccountPassword);
		//$("#re-pwd").val(result.order.AccountPassword);
		$("#character-name").val(result.order.CharName);
		$("#current-level").val(result.order.CurrentLevel);
		$("#service-representative").val(result.order.Service);
		//$("#payment").val(result.order.PaymentMethod);
		$("#order-note").val(result.order.Note);
	}
	catch (x)
	{
		//alert(x.message);
		location.href = 'http://www.myfastgame.net/item.aspx';
	}
};
//</span><span>
window.jsHtml["removeItemProduct"] = function (index)
{
	if($("#tr-" + index).css("display") == "none")
		return;

	var name = $("#name-" + index).html();
	if (name == null || name == "")
		return;

	$.ajax(
	{
		error: function (x)
		{
		alert(x);
			window.jsHtml["loadItemCartJson"](null);
		},
		success: window.jsHtml["loadItemCartJson"],
		data: "delegate=static&JsBusiness:RemoveFromItemCart=" + name + "&time=" + new Date().getTime(),
		url: "handler.html.axd"
	});
};
//</span><span>
window.jsHtml["itemSubmitCart"] = function ()
{
	var t = "";
	var data = "";
	
	t = $("#full-name").val();//full-name
	if(t == "")
	{
		alert("Please input your First Name!");
		return;
	}

	data = data + "&fullname=" + t;
	t = $("#tel-no").val();//tel-no
	if(t == ""){
		alert("Please input your Tel No!");
		return;
	}
	
	data=data+"&phone="+t; 
	t = $("#mail-address").val();//mail-address
	if(t == "")
	{
		alert("Please input your E-mail!");
		return;
	}

	data = data + "&email=" + t;
	t = t.match(/^(\S)+[@](\S)+[.](\w)+$/);
	if(t == null)
	{
		alert("Please input correct E-mail!");
		return;
	}

	t = $("#pay-mail").val();//pay-mail
	if(t == "")
	{
		alert("Please input your PayEmail!");
		return;
	}

	data = data + "&pmail=" + t;
	t = t.match(/^(\S)+[@](\S)+[.](\w)+$/);
	if(t == null)
	{
		alert("Please input correct PayEmail!");
		return;
	}

	t = $("#hs_month").val() + "-" + $("#hs_day").val() + " " + $("#hs_hour").val();
	if(t != "")
		data = data + "&starttime=" + t;
	t = $("#game").val();
	if(t != "")
		data = data + "&game=" + t + "&game-name=" + document.getElementById("game").options[document.getElementById("game").selectedIndex].text;
	t = $("#server").val();
	if(t == "")
	{
		alert("Please select game server!");
		return;
	}

	data = data + "&server=" + t + "&server-name=" + document.getElementById("server").options[document.getElementById("server").selectedIndex].text;
	t = $("#profession").val();
	if(t == "")
	{
		alert("Please select Profession!");
		return;
	}
	data = data + "&profession=" + t + "&profession-name=" + document.getElementById("profession").options[document.getElementById("profession").selectedIndex].text;

	t = $("#account-name").val();
	if(t == "")
	{
		alert("Please input your Account Name!");
		return;
	}

	data = data + "&accountname=" + t;
	
	t = $("#password").val();
	if(t == "" || t != $("#re-pwd").val())
	{
		alert("Please input your password or confirm password!");
		return;
	}

	data = data + "&password=" + t;
	t = $("#character-name").val();
	if(t == "")
	{
		alert("Please input your Character Name!");
		return;
	}

	data = data + "&charname=" + t; 
	t=$("#current-level").val();
	if(t == "")
	{
		alert("Please input your level!");
		return;
	}

	t = t.match(/^-?\d+$/);
	if(t == null)
	{
		alert("Please input correct level!");
		return;
	}

	data = data + "&level=" + t;

	t = $("#service-representative").val();
	if(t!="")
		data=data+"&csr="+t; 
	t = $("#payment").val();
	if(t == "")
	{
		alert("Please select payment method!");
		return;
	}

	data = data + "&payment=" + t;
	t = $("#order-note").val();
	if(t != "")
		data = data + "&remark=" + t;

	$.ajax(
	{
		error: function (x)
		{
			//alert ("error!");
			alert("Create order has error,please try again later!");
		},
		success: function (result)
		{
			window.status = result;
			try
			{
				result = eval("(" + result + ")");
				if (result.alert != null)
					alert (result.alert);
				if (result.error != null)
					return;

				location.href = "http://www.myfastgame.net/itemorderdetail.aspx";
			}
			catch (e)
			{
				alert(e.message);
				window.status = e.message;
				alert("Create order has error,please try again later!");
			}
		},
		data: "delegate=static&JsBusiness:CreateItemOrderInfo=" + new Date().getTime() + data,
		url: "handler.html.axd"
	});
	this.style.display = "none";
};
//</span><span>
window.jsHtml["itemOrderDetail.html"] = function ()
{
	$.ajax(
	{
		error: function (x)
		{
			//alert("error" + x);
			window.jsHtml["loadItemCartJson"](null);
		},
		success: window.jsHtml["loadItemCartJson"],
		data: "delegate=static&JsSession:GetItemsCartAndOrder=" + new Date().getTime(),
		url: "handler.html.axd"
	});
};
//</span><span>
window.jsHtml["itemSubmitOrder"] = function ()
{
	$.ajax(
	{
		error: function (x)
		{
			//alert ("error!");
			alert("Create order has error,please try again later!");
		},
		success: function (result)
		{
			window.status = result;
			try
			{
				result = eval("(" + result + ")");
				if (result.alert != null)
					alert (result.alert);
				if (result.error)
				{
					alert(result.error);
					return;
				}

				location.href = "http://www.myfastgame.net/itempayment.aspx";
			}
			catch (e)
			{
				//alert(e.message);
				window.status = e.message;
				alert("Create order has error,please try again later!");
			}
		},
		data: "delegate=static&JsBusiness:SubmitItemOrderInfo=" + new Date().getTime(),
		url: "handler.html.axd"
	});
	this.style.display = "none";
};
//</span><span>
window.jsHtml["itemPayment.html"] = function ()
{
	$.ajax(
	{
		error: function (x)
		{
			//alert(x);
			window.jsHtml['paymentSuccess'](null);
		},
		success: window.jsHtml['paymentSuccess'],
		data: 'delegate=static&JsBusiness:ItemPayment=http://www.myfastgame.net/paymentsuccess.aspx&time=' + new Date().getTime(),
		url: 'handler.html.axd'
	});
};
//</span><span>
//alert('end');
//</span>