var xmlhttp = false;
try {
	xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");//Mozilla浏览器
} catch (e) {
	try {
		xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");//IE浏览器
	} catch (e2) {
		xmlhttp = false;
	}
}
//开始初始化XMLHttpRequest对象
if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
	xmlhttp = new XMLHttpRequest();
}

function collection(collectionTitle,collectionURL,collectionFrom){
	//alert('9999');
	xmlhttp.open("GET","inc/collection.php?collectionTitle="+encodeURIComponent(collectionTitle)+"&collectionURL="+encodeURIComponent(collectionURL)+"&collectionFrom="+encodeURIComponent(collectionFrom),true);
	xmlhttp.setRequestHeader("If-Modified-Since","0");
	xmlhttp.send(null);
	xmlhttp.onreadystatechange=function(){
		if (4==xmlhttp.readyState){
			if (200==xmlhttp.status){
			var result = xmlhttp.responseText;
			if(result=='0')
			{
				alert("尚未登录！请先登录，再收藏！");
				var url='';
				url = window.location.href;
				url = encodeURIComponent(url);
				//alert(url);
				location.href='login.php?redirectURL='+url;
			}
			if(result=='1')
			{
				alert("产生错误！收藏未成功！");
			}
			if(result=='2')
			{
				alert("您已经收藏此信息了，不能重复收藏！")
			}
			if(result=='3')
			{
				alert("恭喜！本信息已成功收藏到您的收藏夹中！^_^")
			}
			}else{
				alert("发生错误!");
			}
		}
	}
}


function job(jobID){
	//alert('9999');
	xmlhttp.open("GET","inc/job_person.php?jobID="+encodeURIComponent(jobID),true);
	xmlhttp.setRequestHeader("If-Modified-Since","0");
	xmlhttp.send(null);
	xmlhttp.onreadystatechange=function(){
		if (4==xmlhttp.readyState){
			if (200==xmlhttp.status){
			var result = xmlhttp.responseText;
			if(result=='0')
			{
				alert("尚未登录！请先登录，再投简历！");
				var url='';
				url = window.location.href;
				url = encodeURIComponent(url);
				//alert(url);
				location.href='login.php?redirectURL='+url;
			}
			if(result=='1')
			{
				alert("你不是个人会员，不能投简历！");
			}
			if(result=='2')
			{
				alert("您已经投了此职位的简历了，不能重复投简历！")
			}
			if(result=='3')
			{
				alert("恭喜！您的简历已经发送到成功！^_^")
			}
			}else{
				alert("发生错误!");
			}
		}
	}
}
