// JavaScript Document
  
var xmlObjmsg = false;
var xmlResultmsg;
try {
xmlObjmsg=new XMLHttpRequest;
}
catch(e) {
try {
xmlObjmsg=new ActiveXObject("MSXML2.XMLHTTP");
}
catch(e2) {
try {
xmlObjmsg=new ActiveXObject("Microsoft.XMLHTTP");
}
catch(e3) {
xmlObjmsg=false;
}
}
}
if (!xmlObjmsg) {
alert("XMLHttpRequest init Failed!");
} 
 
function AjaxSearchmsg() {
//var usergradeid;
var installurlmsg;
// 获取搜索关键字，并且进行URLEncode
// usergradeid=escape(document.getElementById("usergradeid").value);
 installurlmsg=escape(document.getElementById("installurlmsg").value);
 //searchword="zhuyongjian";
 //if(searchword=="") {
// 如果关键字为空，则提示用户输入关键字
 //document.getElementById("search_result").innerHTML="<ul><li>请输入关键字!</li></ul>";
  //document.getElementById("search_result1").innerHTML="";

 //return;
 //}
// 给出提示，正在搜索
// document.getElementById("search_result").innerHTML="&nbsp;&nbsp;正在更新....";
// 打开一个连接，采用POST
//urlgo=installurl+"ajaxsearch.asp";
xmlObjmsg.open("POST",installurlmsg+"showrolemsg.asp",true);
 // 设置请求头，表单内容格式为URLEncoded
 xmlObjmsg.setRequestHeader("Content-Type","application/x-www-form-urlencoded");

 //设置完成请求后响应函数
xmlObjmsg.onreadystatechange=function() {
// 完成响应
if(xmlObjmsg.readyState==4) {
// 状态正常
if(xmlObjmsg.status==200) {
//// 设置xmlResult为搜索结果XML文档
 xmlResultmsg=xmlObjmsg.responseXML;
//// 调用AjaxShowResult()显示搜索结果
  AjaxShowResultmsg();
}
}
}
xmlObjmsg.send();

// 发送请求，内容为搜索的关键字
//xmlObj.send("searchword="+searchword);
}
 
function AjaxShowResultmsg() {
 var results;
 // 获取搜索结果集合
results=xmlResultmsg.getElementsByTagName("resultmsg");
 
var isok=2;


isok=results[0].getElementsByTagName("logid")[0].firstChild.data;
  if(isok==0)
{
 //document.getElementById("search_resultmsg").style.display ="none";
  document.getElementById("search_resultmsg").style.display ="";
  document.getElementById("search_resultmsg").innerHTML ="<div class='Juris'><ul><li class='telie'>对不起,您未登录或无权查看此信息！</li><li class='tel'>   咨询热线：0351-5697662  0351-5697663</li><li class='Duzer'><a href='../../login/login1.asp' target='_blank'><img src='../../images/login_xina.gif' width='56' height='20' border='0' /></a></li><li class='Duzerl'>还不是会员？ <a href='../../login/register.asp' target='_blank'>立刻免费注册</a></li></ul></div>";
 document.getElementById('search_resultmsg10').style.display ="none";


  document.getElementById("search_resultmsg1").style.display ="none";
  document.getElementById("search_resultmsg2").style.display ="";
  document.getElementById("search_resultmsg2").innerHTML ="<center>对不起！您尚未登录或您无权查看此信息！</center>";
  document.getElementById("search_resultmsg3").style.display ="none";
  document.getElementById("search_resultmsg4").style.display ="";
  document.getElementById("search_resultmsg4").innerHTML ="<center>对不起！您尚未登录或您无权查看此信息！</center>";
  document.getElementById("search_resultmsg5").style.display ="none";
  document.getElementById("search_resultmsg6").style.display ="none";

}
else if(isok==1)
{
	 document.getElementById("search_resultmsg").style.display =""; 
	   document.getElementById('search_resultmsg10').style.display ="";
  	 document.getElementById("search_resultmsg1").style.display ="";
 	 document.getElementById("search_resultmsg2").style.display ="";
	 document.getElementById("search_resultmsg3").style.display ="";
	 document.getElementById("search_resultmsg4").style.display ="";
	 document.getElementById("search_resultmsg5").style.display ="";
	 document.getElementById("search_resultmsg6").style.display ="";

}
else
{
	 document.getElementById('search_resultmsg10').style.display ="";
 //document.getElementById("search_resultmsg").style.display ="none";
 document.getElementById("search_resultmsg").style.display ="";
 
     document.getElementById("search_resultmsg").innerHTML ="<center>对不起！您尚未登录或您无权查看此信息！</center>";
  document.getElementById("search_resultmsg1").style.display ="none";
   document.getElementById("search_resultmsg2").style.display =""; 
       document.getElementById("search_resultmsg2").innerHTML ="<center>对不起！您尚未登录或您无权查看此信息！</center>";
	   document.getElementById("search_resultmsg3").style.display ="none"; 
    document.getElementById("search_resultmsg4").style.display ="";
	  document.getElementById("search_resultmsg4").innerHTML ="<center>对不起！您尚未登录或您无权查看此信息！</center>";
	
	 document.getElementById("search_resultmsg5").style.display ="none";
	 document.getElementById("search_resultmsg6").style.display ="none";

 }
}

 function SendMsg(sUrl)
{
	try   //支持
	{
		var xmlhttp=new ActiveXObject("TimwpDll.TimwpCheck");
		this.location.href=sUrl;        
	}
	catch(e) //不支持
	{
alert("您没有安装QQ/TM，或者您的版本过旧，请到腾讯网站下载");
window.location="http://www.qq.com";
	}
	return false;
}

 