function createXMLHttpRequest(){
       	if (window.XMLHttpRequest) {//wwww.hxcms.net
		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();
        }
    }
	//alert('123');
    return objType;
}
function comm_body(id,a,page){
	 createXMLHttpRequest();		  
	 XMLHttpReq.open("GET","../inc/comm_ajax.asp?c_id="+id+"&a="+a+"&page="+page,true);
         XMLHttpReq.onreadystatechange=function(){
         if(XMLHttpReq.readyState==4){
         if(XMLHttpReq.status==200){
             var msg=unescape(XMLHttpReq.responseText);
             document.getElementById("commBody").innerHTML=msg;
         }else{
             window.alert("您请求的页面出现异常错误！！");	
              }
         }
   }
         XMLHttpReq.send(null); 
}
function checkForms(){
       	if(getObjValues("uname")==""||getObjValues("txtcomment")==""){
		alert("昵称和评论内容不能为空！");
		return false;
	}
	if(getObjValues("uname").length>20){
		alert("昵称不能大于20字！");
		return false;
	}
	if(getObjValues("txtcomment").length>100){
		alert("评论内容不能大于100字！");
		return false;
	}
       	if(getObjValues("sCode")==""){
		alert("请输入验证码！");
		return false;
	}
	return true;
}
function comm_put(id,a){
         if(checkForms()){
         createXMLHttpRequest();
       	 XMLHttpReq.open("POST","../inc/comm_ajax.asp?c_id="+id+"&a="+a,true);
         XMLHttpReq.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
         XMLHttpReq.onreadystatechange=function(){
         if(XMLHttpReq.readyState==4){
         if(XMLHttpReq.status==200){
              var msg=unescape(XMLHttpReq.responseText);
			  //window.alert(msg)
              if(msg == "Err_100"){
		  window.alert("非法操作是真的吗！");
	      }else if(msg == "Err_101"){
		  window.alert("你发表的内容中包含系统禁止字符！");
	      }else if(msg == "Err_102"){
		  window.alert("请输入正确的验证码！");
	      }else{
                  document.getElementById("commBody").innerHTML=msg;
              }
         }else{
             window.alert("您请求的页面出现异常错误！！");	
              }
         }
   }
         var uname = escape(getObjValues("uname"));
         var txtcomment = escape(getObjValues("txtcomment"));
         var scode = escape(getObjValues("sCode"));
         XMLHttpReq.send("uname="+uname+"&txtcomment="+txtcomment+"&scode="+scode+"&do=add");
   }
}





//现在开始旅游订单
function order_body(id){
	 createXMLHttpRequest();		  
	 XMLHttpReq.open("GET","../inc/order_ajax.asp?tour_id="+id,true);
         XMLHttpReq.onreadystatechange=function(){
         if(XMLHttpReq.readyState==4){
         if(XMLHttpReq.status==200){
             var msg=unescape(XMLHttpReq.responseText);
             document.getElementById("orderBody").innerHTML=msg;
         }else{
             window.alert("您请求的页面出现异常错误！！");	
              }
         }
   }
         XMLHttpReq.send(null); 
}
function checkFormorder(){
       	if(getObjValues("o_username")==""||getObjValues("o_tel")==""){
		alert("用户和联系电话不能为空！");
		return false;
	}
	if(getObjValues("o_username").length>20){
		alert("名称不能大于20字！");
		return false;
	}
	return true;
}

function order_put(id){
         if(checkFormorder()){
         createXMLHttpRequest();
       	 XMLHttpReq.open("POST","../inc/order_ajax.asp?tour_id="+id,true);
         XMLHttpReq.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
         XMLHttpReq.onreadystatechange=function(){
         if(XMLHttpReq.readyState==4){
         if(XMLHttpReq.status==200){
              var msg=unescape(XMLHttpReq.responseText);
			  //window.alert(msg)
              if(msg == "ok_order"){
		  window.alert("您的旅游订单已提交！\n\n 我们的客服人员会在24小时内与您联系！");
	      }else if(msg == "Err_101"){
		  window.alert("你发表的内容中包含系统禁止字符！");
	      }else if(msg == "Err_101"){
		  window.alert("你发表的内容中包含系统禁止字符！");
	      }else{
                  document.getElementById("orderBody").innerHTML=msg;
              }
         }else{
             window.alert("您请求的页面出现异常错误！！");	
              }
         }
   }
         var o_username = escape(getObjValues("o_username"));
         var o_tourname = escape(getObjValues("o_tourname"));
         var o_outdate = escape(getObjValues("o_outdate"));
         var o_outperson = escape(getObjValues("o_outperson"));
         var o_tel = escape(getObjValues("o_tel"));
         var o_qq = escape(getObjValues("o_qq"));
         var o_content = escape(getObjValues("o_content"));
         XMLHttpReq.send("o_username="+o_username+"&o_tourname="+o_tourname+"&o_outdate="+o_outdate+"&o_outperson="+o_outperson+"&o_tel="+o_tel+"&o_qq="+o_qq+"&o_content="+o_content+"&doo=add");
   }
}




function Close(id){
        //document.getElementById(id).style.display = "none";
        document.getElementById(id).innerHTML="";
     }
function checkForml(){
       	if(getObjValues("fl_name")==""||getObjValues("fl_url")==""){
		alert("名称和地址不能为空！");
		return false;
	}
	return true;
}


//获取热门景点信息
function get_tourhot(num){
  var theHttpRequest = getHttpObject();
  theHttpRequest.onreadystatechange = function() {processAJAX();};
  theHttpRequest.open("GET","../tour/tour_hot.asp?act=tour_hot&numcode=num", true);
  theHttpRequest.send(null);
    function processAJAX(){
       if (theHttpRequest.readyState == 4) {
         if (theHttpRequest.status == 200) {
           document.getElementById("tour_hot").innerHTML = unescape(theHttpRequest.responseText);
           } else {
           document.getElementById("tour_hot").innerHTML = "您请求的页面出现异常错误";
                  }
           }
     }
}



//获取全部问题
function get_allque(page){
  var theHttpRequest = getHttpObject();
  theHttpRequest.onreadystatechange = function() {processAJAX();};
  theHttpRequest.open("GET","Return_que.aspx?type=1&page="+page, true);
  theHttpRequest.send(null);
    function processAJAX(){
       if (theHttpRequest.readyState == 4) {
		  
         if (theHttpRequest.status == 200) {
			 //alert('200');
           document.getElementById("tbc_01").innerHTML = theHttpRequest.responseText;
           } else {
           document.getElementById("tbc_01").innerHTML = "您请求的页面出现异常错误";
                  }
           }
     }
}

//获取已解决问题
function get_okque(page){
  var theHttpRequest = getHttpObject();
  theHttpRequest.onreadystatechange = function() {processAJAX();};
  theHttpRequest.open("GET","Return_que.aspx?type=2&page="+page, true);
  theHttpRequest.send(null);
    function processAJAX(){
       if (theHttpRequest.readyState == 4) {
		   //alert('tets');
         if (theHttpRequest.status == 200) {
			 //alert('200');
           document.getElementById("tbc_02").innerHTML = theHttpRequest.responseText;
           } else {
           document.getElementById("tbc_02").innerHTML = "您请求的页面出现异常错误";
                  }
           }
     }
}

//获取未解决问题
function get_noque(page){
  var theHttpRequest = getHttpObject();
  theHttpRequest.onreadystatechange = function() {processAJAX();};
  theHttpRequest.open("GET","Return_que.aspx?type=3&page="+page, true);
  theHttpRequest.send(null);
    function processAJAX(){
       if (theHttpRequest.readyState == 4) {
		   //alert('tets');
         if (theHttpRequest.status == 200) {
			 //alert('200');
           document.getElementById("tbc_03").innerHTML = theHttpRequest.responseText;
           } else {
           document.getElementById("tbc_03").innerHTML = "您请求的页面出现异常错误";
                  }
           }
     }
}

//获取
function get_tourtype(){
  var theHttpRequest = getHttpObject();
  theHttpRequest.onreadystatechange = function() {processAJAX();};
  theHttpRequest.open("GET","../tour/tour_hot.asp?act=tour_type", true);
  theHttpRequest.send(null);
    function processAJAX(){
       if (theHttpRequest.readyState == 4) {
         if (theHttpRequest.status == 200) {
           document.getElementById("tour_type").innerHTML = unescape(theHttpRequest.responseText);
           } else {
           document.getElementById("tour_type").innerHTML = "您请求的页面出现异常错误";
                  }
           }
     }
}


function killErr(){return true;} 
window.onerror=killErr;
// -->
