function createXMLHttpRequest() {
	if (window.XMLHttpRequest) { //x5mp3.com
		XMLHttpReq = new XMLHttpRequest();
	} else if (window.ActiveXObject) { //IE 浏览器
		try {
			XMLHttpReq = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				XMLHttpReq = new ActiveXObject("Micrsost.XMLHTTP");
			} catch (e) {}
		}
	}
}
var cache = new Array();
function getHttpObject() {
	var objType = false;
	try {
		objType = new ActiveXObject('Msxml2.XMLHTTP');
	} catch (e) {
		try {
			objType = new ActiveXObject('Microsoft.XMLHTTP');
		} catch (e) {
			objType = new XMLHttpRequest();
		}
	}
	return objType;
}
function friendAdd(_id) {
	createXMLHttpRequest();
	XMLHttpReq.open("GET", "ajax.php?action=friendAdd&id=" + _id + "", true);
	XMLHttpReq.onreadystatechange = function () {
		if (XMLHttpReq.readyState == 4) {
			if (XMLHttpReq.status == 200) {
				if (XMLHttpReq.responseText == "10001") {
					alert("您未登录无法执行此操作！");
				}
				if (XMLHttpReq.responseText == "10002") {
					alert("您只能关注别人，不能关注自己哦！");
				}
				if (XMLHttpReq.responseText == "10003") {
					alert("您已经关注过该会员了！");
				}
				if (XMLHttpReq.responseText == "10004") {
					alert("该用户不存在！");
				}
				if (XMLHttpReq.responseText == "10005") {
					alert("关注成功!");
					location.href = location.href;
				}
			} else
				alert("网络异常，请稍后再试。");
		}
	}
	XMLHttpReq.send(null);
}
function friendDel(_id) {
	createXMLHttpRequest();
	XMLHttpReq.open("GET", "ajax.php?action=friendDel&id=" + _id + "", true);
	XMLHttpReq.onreadystatechange = function () {
		if (XMLHttpReq.readyState == 4) {
			if (XMLHttpReq.status == 200) {
				if (XMLHttpReq.responseText == "10001") {
					alert("您未登录无法执行此操作！");
				}
				if (XMLHttpReq.responseText == "10002") {
					alert("您只能关注别人，不能关注自己哦！");
				}
				if (XMLHttpReq.responseText == "10003") {
					alert("您不是粉丝，无需取消！");
				}
				if (XMLHttpReq.responseText == "10004") {
					alert("该用户不存在！");
				}
				if (XMLHttpReq.responseText == "10005") {
					alert("取消成功!");
					location.href = location.href;
				}
			} else
				alert("网络异常，请稍后再试。");
		}
	}
	XMLHttpReq.send(null);
}