// 2007-9-7
// Aguy
// www.678678.com
//<![CDATA[
var zhishucache=new Object();
var zhishuInterval;

function getElement(aID){return (document.getElementById) ? document.getElementById(aID): document.all[aID];}

function loadAJAXzhishu(url,contentid){
	var ocontent=getElement(contentid);
	var xhttp=getXmlhttp();	
	xhttp.onreadystatechange=function(){
		if(xhttp.readyState == 4 && (xhttp.status==200 || window.location.href.indexOf("http")==-1))
		{
			var result = xhttp.responseText;
			if(result != "")
			{
				ocontent.innerHTML=xhttp.responseText;
				zhishucache[url]=ocontent.innerHTML;
			}
			else
			{
				if(zhishucache[url]!=null){ocontent.innerHTML=zhishucache[url];}
			}
		}
	}
	xhttp.open("GET",url,true);
	xhttp.send(null);
}

function getXmlhttp()
{
	var http_request;
	if(window.XMLHttpRequest) { 
		http_request = new XMLHttpRequest();
		if (http_request.overrideMimeType) {http_request.overrideMimeType("text/xml");}
	}
	else if (window.ActiveXObject) { 
		try {http_request = new ActiveXObject("Msxml2.XMLHTTP");}
		catch (e) {	try {http_request = new ActiveXObject("Microsoft.XMLHTTP");	} catch (e) {}}
	}
	if (!http_request) { window.alert("can't create XMLHttpRequest object.");return null;	}	
	return http_request;
}

function keyscode(Tdate,Tkey)
{
	var result = (Tdate * (Tkey % 76) + Tdate * ( Tdate % 9)) * (Tdate % 89) + Tdate * (Tdate % 27) + (Tkey % Tdate) * (Tdate % 13);
	return result;
}

function load_zhishu(sId)
{
 	clearInterval(zhishuInterval);
 	var today=new Date();
    var date = today.getFullYear()+(today.getMonth() + 1)+today.getDate();
    var keys = 234678709;
    var value = keyscode(date,keys);
    var sURL="/www/request/zhishu.aspx?key="+value;
   
	loadAJAXzhishu(sURL,sId);
	zhishuInterval = window.setInterval("show_zhishu('"+sURL+"','"+sId+"')",20000);
}

function show_zhishu(url,id)
{
	loadAJAXzhishu(url,id);
}

//]]>

