document.charset = "GB2312";
var ajax_installdir = "/";
var ajax_request_type = "GET";
var ajax_debug_mode = false;
function ajax(send_url,typer) {
	var xmlhttp = initAjaxObject_news_show();
	var post_data = null;
	try{
		xmlhttp.open("GET", send_url.replace("&&","&"), true);
		xmlhttp.onreadystatechange = function() {
			if (xmlhttp.readyState != 4 || xmlhttp.status != 200) 
				return;
			var response = xmlhttp.responseText;
			if (!response) return;
				var arrData = response.split("||");
				//Array() 总数，好评数，差评数，好评百分比，差评百分比，好评进度宽，差评进度宽
				
			if (typer=='ding'){
				getById('dings').innerHTML=arrData[0];
				getById('cais').innerHTML=arrData[1];
			}
			if (typer=='hits'){
				getById('hits').innerHTML=arrData[0];
			}
			if (typer=='top_login'){
				getById('no_toplog').style.display=arrData[0];//          未登录
				getById('toplog').style.display=arrData[1];//隐藏登陆框   已登录
				getById('top_username').innerHTML=arrData[2]; //          登录用户名
			}
			if (typer=='scenic_history'){
			   getById('scenic_history').innerHTML=arrData[0];
			}
			if (typer=='hotel_history'){
			   getById('hotel_history').innerHTML=arrData[0];
			}
			if (typer=='login_typer'){
				getById('login_com').style.display=arrData[0];
				getById('user_online').innerHTML=arrData[1];
				getById('user_online').style.display=arrData[2];
			}
			if (typer=='exit'){
				getById('login_com').style.display=arrData[0];
				getById('user_online').style.display=arrData[1];
				
			}
			if (typer=='show_commen'){
				getById('showcommen').innerHTML=arrData[0];
				getById('plnums1').innerHTML=arrData[1];
			}
			
			
			//用到的
			if (typer=='reg_check_name'){
				getById('reg_check_name').innerHTML=arrData[0];
			}
			if (typer=='login_form'){
				getById('login_form').innerHTML=arrData[0];
				
			}
			if (typer=='Recruit_collect'){
				alert(arrData[0])
			}
			
			
		}
		xmlhttp.send(post_data);
	}catch(e){}
	delete xmlhttp;
}
function initAjaxObject_news_show() {
	ajaxDebugPrint_news_show("initAjaxObject_news_show() called..");	
	var RetValue;
	try {RetValue = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
		try {
		RetValue = new ActiveXObject("Microsoft.XMLHTTP");
		} catch (oc) {
		RetValue = null;}
	}
	if(!RetValue && typeof XMLHttpRequest != "undefined")
		RetValue = new XMLHttpRequest();
		if (!RetValue)
			ajaxDebugPrint_news_show("Could not create connection object.");
		return RetValue;
}
function ajaxDebugPrint_news_show(text) {
	if (ajax_debug_mode)
	alert("RSD: " + text);
}
function getById(id) {
	//alert('执行了吗！！！！！！！！！！！！');
	itm = null;
	if (document.getElementById) {
		itm = document.getElementById(id);
	} else if (document.all)	{
		itm = document.all[id];
	} else if (document.layers) {
		itm = document.layers[id];
	}
	return itm;
}
