// JavaScript Document

/********************************************************************
	created:	2007/11/09
	created:	9:11:2007   17:42
	filename: 	D:\work\AjaxForAsp\createxmlhttp.js
	file path:	D:\work\AjaxForAsp
	file ext:	JS
	author:		Silent(范锦翔)
*********************************************************************/

function createxmlhttp()
{
	//create xmlhttp object	
	xmlhttpobj = false;
	try{
		xmlhttpobj = new XMLHttpRequest;
	}catch(e){
		try{
			xmlhttpobj=new ActiveXObject("MSXML2.XMLHTTP");
		}catch(e2){
			try{
				xmlhttpobj=new ActiveXObject("Microsoft.XMLHTTP");
			}catch(e3){
				xmlhttpobj = false;
			}
		}
	}
	return xmlhttpobj;
}
/********************************************************************
	created:	2007/11/09
	created:	9:11:2007   17:42
	filename: 	D:\work\AjaxForAsp\code.ks
	file path:	D:\work\AjaxForAsp
	file ext:	JS
	author:		Silent(范锦翔)
*********************************************************************/

/********************显示首页新闻列表********************/

function GetIndexNews(pnum)
{
	var xmlobj;
	xmlobj=createxmlhttp();
	xmlobj.open("get","inc/sql_process.asp",true);
	xmlobj.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
	xmlobj.onreadystatechange=function(){
	//xmlobj.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
			if (xmlobj.readyState==4){
				if (xmlobj.status==200){				
					document.getElementById("NewsList").innerHTML=xmlobj.responseText;
					//alert(xmlobj.responseText);
				}
				else
				{
					alert(xmlobj.responseText);
					}
			}
			else
			{
				alert(xmlobj.responseText);
				}
	};
	xmlobj.send(null);
}
