
/// 点击获取壁纸下载地址
function getWallpaperUrl(sId)
{
	if (sId == ""||sId == null)
	{
		sId = $("gs_pid").value;
		if (sId == ""||sId == null) return;
	}
	//if (!CheckEmailAdd(sEmail)) return;
	callAjax("ServerProcess.asp", "POST", "<root cmd='60DBA4DF82EA0A5E' id='"+sId+"'/>", function (x){
		if (x == null) return;
		if (x.documentElement == null) return;
		switch (x.documentElement.firstChild.getAttribute("status"))
		{
			case -1:
			case "-1":
				alert(x.documentElement.firstChild.getAttribute("reason"));
				break;
			case 1:
			case "1":
				document.location.href = "wallpaper.asp";
				//window.location.reload(x.documentElement.firstChild.getAttribute("url"));
				//$("tWin1").removeChild(oEmailCollectWin);
				//oEmailCollectWin=null;
				break;
		}
	});
}

/// 显示邮件收集窗口
var oEmailCollectWin = null;
function EmailCollectWin(sId)
{
	if (sId == ""||sId == null)
	{
		sId = $("gs_pid").value;
		if (sId == ""||sId == null) return;
	}
	getWallpaperUrl(sId);
	return;



	if (oEmailCollectWin!=null) return;
	try
	{
		oEmailCollectWin = document.createElement("<div style='font-size:13px;width:552px;height:40px;border:1px solid #959595;border-bottom:0px;background-color:#F6DF00;padding:7px;'></div>");
		var h = "";
		h += "<input type=\"hidden\" name=\"h_pid\" id=\"h_pid\" value=\""+sId+"\"/>";
		h += "Email:<input type=\"text\" name=\"CollectEmail\" id=\"CollectEmail\" style=\"width:137px;height:20px;border:1px solid #0053ff;\"/>";
		h += "&nbsp;<input type=\"button\" value=\"提交邮件\" onclick=\"getWallpaperUrl($('h_pid').value, $('CollectEmail').value);\" style=\"font-size:13px;width:70px;height:20px;border:1px solid #0053ff;padding-top:2px;background-color:#FFFFFF;color:#0053ff;\"/>";
		h += "&nbsp;请提交一个有效邮件地址来获取壁纸下载地址。";
		oEmailCollectWin.innerHTML = h;
		$("tWin1").insertBefore(oEmailCollectWin, $("tWin2"));
	}
	catch (e)
	{
		alert(e.description);
	}
}

