﻿function load(id)
{
	var doc=document.getElementById(id);
	doc.innerHTML='<img class=""os"" src="/styles/images/loading.gif"/>';
}
function posthtm(url,id,verbs,is){//is null or 1
	var doc = document.getElementById(id);
	load(id);
//	doc.innerHTML='<span><img src="image/load.gif"/>Loading...</span>';
	var xmlhttp = false;
	if(doc!=null){
		
		doc.style.visibility="visible";

		if(doc.style.visibility=="visible"){

			xmlhttp=ajax_driv();
			xmlhttp.open("POST", url,true);
			xmlhttp.setRequestHeader("If-Modified-Since","0");
			xmlhttp.onreadystatechange=function(){
				if (xmlhttp.readyState==4){
					if (is||is==null){doc.innerHTML=xmlhttp.responseText;}
					else{var data={};data=eval('('+xmlhttp.responseText+')');doc.innerHTML=data.main;eval(data.js);};
				}
			}
			xmlhttp.setRequestHeader("Content-Length",verbs.length);
			xmlhttp.setRequestHeader("CONTENT-TYPE","application/x-www-form-urlencoded");

			xmlhttp.send(verbs);
		}
	}
}
function gethtm(url,id,is){
	var doc = document.getElementById(id);
	load(id);
	var xmlhttp = false;
	if(doc!=null){
		doc.style.visibility="visible";
		if(doc.style.visibility=="visible"){
			xmlhttp=ajax_driv();
			xmlhttp.open("GET", url,true);
			xmlhttp.setRequestHeader("If-Modified-Since","0");
			xmlhttp.onreadystatechange=function() {
				if (xmlhttp.readyState==4) {
					if (is||is==null){doc.innerHTML=xmlhttp.responseText;}else{eval(xmlhttp.responseText);};
				}
			}
			xmlhttp.send(null);
		}
	}
}
function display(id){
	var doc = document.getElementById(id);
	if(doc!=null){
		doc.style.visibility="hidden";
	}
}
function ajax_driv(){
	var xmlhttp;
	if (window.ActiveXObject){
		/* 不要删除以下注释，这部分不是注释 */
		/*@cc_on @*/
		/*@if (@_jscript_version >= 5)
		try {
		  xmlhttp = new ActiveXObject("Msxml2.xmlhttp");
		} catch (e) {
		  try {
			xmlhttp = new ActiveXObject("Microsoft.xmlhttp");
		  } catch (e) {
			xmlhttp = false;
		  }
		}
		@end @*/
	}else{
		xmlhttp=new XMLHttpRequest();
	}
	if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
	  xmlhttp = new XMLHttpRequest();
	}
	return xmlhttp;
}