//伪AJAX
//==============================================显示所有信息=========================================
var xmlHttp;
function createXMLHttpRequest()
{
if(window.ActiveXObject)
{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
else if(window.XMLHttpRequest)
{
xmlHttp=new XMLHttpRequest();
}
}
function createXMLHttpRequest1()
{
if(window.ActiveXObject)
{
xmlHttp1=new ActiveXObject("Microsoft.XMLHTTP");
}
else if(window.XMLHttpRequest)
{
xmlHttp1=new XMLHttpRequest();
}
}
/*function test1()
{
alert('test')
}
var test=function(){alert('test')}
*/
function clearInput()
{
argsLen=arguments.length
for(var i=0;i<argsLen;i++)
{
$(arguments[i]).value="";
}
}
function getData(page)
{
//alert("1")
createXMLHttpRequest();
url="ajax/showall.asp?page="+page
//alert("2")
xmlHttp.open("GET",url,true);
//alert("3")
xmlHttp.onreadystatechange=callback;
//alert("4")
xmlHttp.send(null);
//alert("5")
}
//==============================================搜索================================================
function getSearchResult(queryurl,page)
{
//alert(queryurl)
createXMLHttpRequest();
url="ajax/search.asp?"+queryurl+"&page="+page
xmlHttp.open("GET",url,true);
xmlHttp.onreadystatechange=callback;
xmlHttp.send(null);
}
//=================================================日历=================================================
function showCalender(year,month,type)
{
createXMLHttpRequest1();
if (type=='b')
theurl="ajax/lunarcal.asp?y="+year+"&m="+month;
else
theurl="ajax/calendar.asp?y="+year+"&m="+month;
//alert(theurl)
xmlHttp1.open("GET",theurl,true);
xmlHttp1.onreadystatechange=callcalender;
xmlHttp1.send(null);
}
function callcalender()
{
//alert('callcalender is ok')
if(xmlHttp1.readyState==4)
{//alert('callcalender1 is ok')
if(xmlHttp1.status==200)
{//alert('callcalender2 is ok')
$('showcal').innerHTML=xmlHttp1.responseText
}
}
}
//====================================================================================================
function callback()
{
//alert('callback is ok')
if(xmlHttp.readyState==4)
{//alert('callback1 is ok')
if(xmlHttp.status==200)
{
$('showdata').innerHTML=xmlHttp.responseText
}
}
}
function showInfo(id,areaid)
{
createXMLHttpRequest();
url="ajax/showinfo.asp?id="+id
//alert("2")
xmlHttp.open("GET",url,true);
//alert("3")
this.areaid=areaid
xmlHttp.onreadystatechange=callinfo;
//alert("4")
xmlHttp.send(null);
}
function callinfo(areaid)
{
areaid=this.areaid
//alert('callback is ok')
if(xmlHttp.readyState==4)
{//alert('callback1 is ok')
if(xmlHttp.status==200)
{
$(areaid).innerHTML=xmlHttp.responseText
}
}
}
function showDetailInfo(id,areaid){
var ShowBtn=$("showBtn"+id)
var str1=ShowBtn.src.substring(ShowBtn.src.lastIndexOf("/")+1)
if (str1=="sign_sub.gif")
{
//Realinfo.style.display="none";
ShowBtn.src="img/sign_plus.gif";
$(areaid).innerHTML=""
$(areaid).style.display="none"
}
else{
//Realinfo.style.display="";
ShowBtn.src="img/sign_sub.gif";
showInfo(id,areaid)
$(areaid).style.display=""
}
}