
var xmlHttp = getHttpObject();

// alert("Not able to retrieve description");
// 处理请求的页面
var pageUrl = "";
function getHttpObject() {
	var xmlHttp = false;
	if (window.xmlHttpRequest) {
		xmlHttp = new xmlHttpRequest();
		if (xmlHttp.overrideMimeType) {
			xmlHttp.overrideMimeType("text/xml");
		}
	} else {
		try {
			xmlHttp = new ActiveXObject("Msxml2.xmlHttp");
		}
		catch (e) {
			try {
				xmlHttp = new ActiveXObject("Microsoft.xmlHttp");
			}
			catch (e) {
				xmlHttp = false;
			}
		}
	}
	return xmlHttp;
}
function Change_SelectTT(obj) {
	xmlHttp = getHttpObject();
	var zhi = obj;
	url = pageUrl + "/cms/dataret.dhtml?p=add&" + zhi + "&fresh=" + Math.random();
	if (xmlHttp) {
		xmlHttp.open("GET", url, true);
		xmlHttp.onreadystatechange = function () {
			if (xmlHttp.readyState == 4) {
				if (xmlHttp.status == 200 || xmlHttp.status == 0) {
				
				
					var result = xmlHttp.responseText;
					
					if (result == "0") {
						alert("已增加");
					}
					if (result == "1" || result == "2") {
					  alert("失败");
						
					}
				} else {
					alert("Not able to retrieve description" + xmlHttp.status);
				}
			}
		};
		xmlHttp.send(null);
	}
}



function do_link(tdid,str,url) {

	xmlHttp = getHttpObject();
	var tds=tdid.split("#");
	var strs=str.split("#");
	url =  url+"&fresh=" + Math.random();
	if (xmlHttp) {
		xmlHttp.open("GET", url, true);
		xmlHttp.onreadystatechange = function () {
			if (xmlHttp.readyState == 4) {
				if (xmlHttp.status == 200 || xmlHttp.status == 0) {
				
				
					var result = xmlHttp.responseText;
					
					if (result == 0) {
						
						if(tdid=="")
						   alert(str);
						 else {
						 for(i=0;i<tds.length;i++){
						   var tdobj = document.getElementById(tds[i]);
						   tdobj.innerHTML = strs[i];
						 }
						 
						 }
						
					}
					if(result == 4) {
						alert("对不起，您未登录，请先登录再推荐体验（办理）新业务！");
					}

					if (result == 1 || result == 2) {
					    alert("操作失败");
	
					}
					
					if (result == 3) {
					    alert("对不起，您当天体验业务下发的验证码次数已经超过10次，谢谢您的关注，明天您还可以继续体验业务。");
						
					}
				} else {
					alert("Not able to retrieve description" + xmlHttp.status);
				}
			}
		};
		xmlHttp.send(null);
	}
	return false;
}
function do_link1(url) {

	xmlHttp = getHttpObject();
	url =  url+"&fresh=" + Math.random();
	if (xmlHttp) {
		xmlHttp.open("GET", url, true);
		xmlHttp.onreadystatechange = function () {
			if (xmlHttp.readyState == 4) {
				if (xmlHttp.status == 200 || xmlHttp.status == 0) {		
					var result = xmlHttp.responseText;
					if(result!='')
						alert(originalRequest.responseText);
					else
						alert("您输入的信息有效.");
					
				} else {
					alert("Not able to retrieve description" + xmlHttp.status);
				}
			}
		};
		xmlHttp.send(null);
	}
	return false;
}


function do_link2(url,str) {
    var strs=str.split("#");
	xmlHttp = getHttpObject();
	url =  url+"&fresh=" + Math.random();
	if (xmlHttp) {
		xmlHttp.open("GET", url, true);
		xmlHttp.onreadystatechange = function () {
			if (xmlHttp.readyState == 4) {
				if (xmlHttp.status == 200 || xmlHttp.status == 0) {		
					var result = xmlHttp.responseText;
					result =result/1;
					alert( strs[result]);
						
					
					
				} else {
					alert("Not able to retrieve description" + xmlHttp.status);
				}
			}
		};
		xmlHttp.send(null);
	}
	return false;
}

