/*Ajax
<script language="javascript" src="JsInc/Ajax.js"></script>
*/
<!--
/*创建对象函数*/
function CreateXMLHttp(){
    var xmlHttp = false;
	if (window.ActiveXObject && !window.XMLHttpRequest){//IE浏览器
		try{
			xmlHttp = new ActiveXObject("Msxml2.XMLHTTP.6.0");
		}
		catch(e){
			try{
				xmlHttp = new ActiveXObject("Msxml2.XMLHTTP.4.0");
			}
			catch (e1){
				try{
					xmlHttp = new ActiveXObject("Msxml2.XMLHTTP.3.0");
				}
				catch (e2){
					try{
						xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
					}
					catch (e3){
						xmlHttp = false;
					}
				}
			}
		}
	}
	else if (window.XMLHttpRequest){//非IE浏览器
		xmlHttp = new XMLHttpRequest();
	}
	else{
		xmlHttp = false;
	}
	//创建xmlhttp对象
	return xmlHttp;
}
/*执行响应*/
function SendRequest(url,id){
	var xmlhttp = new CreateXMLHttp();
	if (xmlhttp){
		var o = document.getElementById(id);	
		xmlhttp.open("get",url+"&n="+Math.random(),true);
		xmlhttp.onreadystatechange = function(){
			if (xmlhttp.readyState == 4 && xmlhttp.status == 200){	
				o.innerHTML = unescape(xmlhttp.responseText);
			}
			else{
				o.innerHTML = "<span color='#000000' style='filter:alpha(opacity=50);'>加载中,请稍后...</span>";
			}
		}
		xmlhttp.send(null);	
	}
}

function createAjax(){
	var _xmlhttp;
	try {	
		_xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	}
	catch (e) {
		try {
			_xmlhttp = new XMLHttpRequest();
		}
		catch (e) {
			_xmlhttp = false;
		}
	}
	return _xmlhttp;
}

function RequestAjax(url,id){
	var xmlhttp = new createAjax();
	if (xmlhttp){
		var o = document.getElementById(id);	
		xmlhttp.open("get",url+"&n="+Math.random(),true);
		xmlhttp.onreadystatechange = function(){
			if (xmlhttp.readyState == 4 && xmlhttp.status == 200){	
				o.innerHTML = unescape(xmlhttp.responseText);
			}
			else{
				o.innerHTML = "<span color='#000000' style='filter:alpha(opacity=50);'>加载中,请稍后...</span>";
			}
		}
		xmlhttp.send(null);	
	}
}

function newnews(){
	var xmlhttp = createAjax();
	if (xmlhttp){
		var NewNews = document.getElementById("NewNews");	
		xmlhttp.open("get","Service.asp?act=NewNews&n="+Math.random(),true);
		xmlhttp.onreadystatechange = function(){
			if (xmlhttp.readyState == 4 && xmlhttp.status == 200){	
				NewNews.innerHTML = unescape(xmlhttp.responseText);
			}
			else{
				NewNews.innerHTML = "<span color='#000000' style='filter:alpha(opacity=50);'>加载中,请稍后...</span>";
			}
		}
		xmlhttp.send(null);	
	}
}

function hotnews(){
	var xmlhttp = createAjax();
	if (xmlhttp){
		var HotNews = document.getElementById("HotNews");	
		xmlhttp.open("get","Service.asp?act=HotNews&n="+Math.random(),true);
		xmlhttp.onreadystatechange = function(){
			if (xmlhttp.readyState == 4 && xmlhttp.status == 200){	
				HotNews.innerHTML = unescape(xmlhttp.responseText);
			}
			else{
				HotNews.innerHTML = "<span color='#000000' style='filter:alpha(opacity=50);'>加载中,请稍后...</span>";
			}
		}
		xmlhttp.send(null);	
	}
}
function newnews2(){
	var xmlhttp = createAjax();
	if (xmlhttp){
		var NewNews = document.getElementById("NewNews");	
		xmlhttp.open("get","../Service.asp?act=NewNews2&n="+Math.random(),true);
		xmlhttp.onreadystatechange = function(){
			if (xmlhttp.readyState == 4 && xmlhttp.status == 200){	
				NewNews.innerHTML = unescape(xmlhttp.responseText);
			}
			else{
				NewNews.innerHTML = "<span color='#000000' style='filter:alpha(opacity=50);'>加载中,请稍后...</span>";
			}
		}
		xmlhttp.send(null);	
	}
}

function hotnews2(){
	var xmlhttp = createAjax();
	if (xmlhttp){
		var HotNews = document.getElementById("HotNews");	
		xmlhttp.open("get","../Service.asp?act=HotNews2&n="+Math.random(),true);
		xmlhttp.onreadystatechange = function(){
			if (xmlhttp.readyState == 4 && xmlhttp.status == 200){	
				HotNews.innerHTML = unescape(xmlhttp.responseText);
			}
			else{
				HotNews.innerHTML = "<span color='#000000' style='filter:alpha(opacity=50);'>加载中,请稍后...</span>";
			}
		}
		xmlhttp.send(null);	
	}
}

function Hits(mcd){
	var xmlhttp = createAjax();
	if (xmlhttp){
		var Hits = document.getElementById("Hits");	
		xmlhttp.open("get","../Service.asp?act=Hits&mcd="+mcd+"&n="+Math.random(),true);
		xmlhttp.onreadystatechange = function(){
			if (xmlhttp.readyState == 4 && xmlhttp.status == 200){	
				Hits.innerHTML = unescape(xmlhttp.responseText);
			}
			else{
				Hits.innerHTML = "<span color='#000000' style='filter:alpha(opacity=80);'>-</span>";
			}
		}
		xmlhttp.send(null);	
	}
}

/*载入效果*/
window.onload=function(){
    var o = document.getElementById("loading");
    o.parentNode.removeChild(o);
	window.status="";
}
function loadBox(str){
document.write('<div id="loading" style="position:absolute;width:120px;margin-top:5px;margin-left:5px;padding-left:5px;padding-top:2px;padding-bottom:2px;border:1px #FFFFFF double;background:#CC4444;color:#FFFFFF;font-size:12px;line-height:2.0em;"><img src="/Note/Images/loading.gif" width="15" height="15" vspace="2" hspace="2" align="absbottom" />'+str+'</div>')
window.status=str;
}
loadBox("加载中,请稍后...");
//-->
