//ajax¶ÁÈ¡ÎÄ¼þ
var Browser = new Object();
Browser.isMozilla = (typeof document.implementation != 'undefined') && (typeof document.implementation.createDocument != 'undefined') && (typeof HTMLDocument!='undefined');
Browser.isIE = window.ActiveXObject ? true : false;
Browser.isFirefox = (navigator.userAgent.toLowerCase().indexOf("firefox")!=-1);
Browser.isOpera = (navigator.userAgent.toLowerCase().indexOf("opera")!=-1);
function getElement(aID)
{
  return (document.getElementById) ? document.getElementById(aID): document.all[aID];
}
var http_request=false;
function makeRequest(url){
 http_request=false;
 if(window.XMLHttpRequest){//Mozilla,Safari,...
 	http_request=new XMLHttpRequest();
 	if(http_request.overrideMimeType){
 		http_request.overrideMimeType('text/xml');
 	}
 }else if(window.ActiveXObject){//IE
 	try{
	 http_request=new ActiveXObject("Msxml2.XMLHTTP");
 	}catch(e){
 		try{
 			http_request=new ActiveXObject("Microsoft.XMLHTTP");
 		}catch(e){}
 	}
 }
 if(!http_request){
 	//alert('Giving up:(Cannot create an XMLHTTP instance)');
 	return false;
 }
	return http_request;
 }
 
 var cflag = 0;
 var ajccache=new Object();
 
function getContents(url,cid){ 
 var contentele = getElement(cid);
 if(ajccache[url]==null) {
 var xhttp=makeRequest();
			xhttp.onreadystatechange=function(){
				if(xhttp.readyState == 4 && (xhttp.status==200 || window.location.href.indexOf("http")==-1))
				{				
                //  if (Browser.isMozilla) { 
					   contentele.innerHTML=xhttp.responseText;
				  // }else{		
						//contentele.innerHTML=bytes2BSTR(xhttp.responseBody);
					//}
					ajccache[url]=contentele.innerHTML;					
					}
					
			}
		xhttp.open("GET",url,true);
		xhttp.send(null);		
 }else
 {
     contentele.innerHTML=ajccache[url];
 }
}
