// JavaScript Document
function getxmlhttp(){
var xmlhttp=false;
try{
	xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	//alert("IE");
}catch(e){
	try{
		xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		//alert("IE");
	}catch(e){
		xmlhttp=false;
	}
}
if (!xmlhttp && typeof XMLHttpRequest != 'undefined'){
	xmlhttp = new XMLHttpRequest();
	//alert("NO IE");
}
return xmlhttp;
}


function processajax(serverPage,objID,getorpost,str){
	xmlhttp=getxmlhttp();
	var obj = document.getElementById(objID);
	obj.innerHTML ='正在读取数据...';
	// 加随机数防止缓存
	if (serverPage.indexOf("?") > 0){
		serverPage += "&randnum=" + Math.random();
	}
	else{
		serverPage += "?randnum=" + Math.random();
	}
	if (getorpost){
	xmlhttp.open("GET",serverPage);
	xmlhttp.onreadystatechange = function(){
		if (xmlhttp.readyState == 4 && xmlhttp.status == 200){
			obj.innerHTML = xmlhttp.responseText;
		}
	}
	xmlhttp.send(null);
}else{
	xmlhttp.open("POST",serverPage,true);
	xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
	xmlhttp.onreadystatechange = function(){
		if (xmlhttp.readyState == 4 && xmlhttp.status == 200){
			obj.innerHTML = xmlhttp.responseText;
		}
	}
	xmlhttp.send(str);
}
}
//AJAX打开页面
function ceshi(){
 var   oDiv1=document.getElementById('add_top');
 oDiv1.style.display=(oDiv1.style.display=="none")?"block":"none";
 var url;
 url='adc.asp';
 processajax(url,'add_top',true);
}
//关闭遮罩层
function closediv(){
 var   oDiv1=document.getElementById('add_top');
 oDiv1.style.display=(oDiv1.style.display=="none")?"block":"none";
 oDiv1.innerHTML='';
}
