// JavaScript Document

function xmlHttp()
{
	var kaolahttp=null;
	try
	{
		kaolahttp=new ActiveXObject("Msxml2.XMLHTTP");
	}
	catch(e)
	{
		try
		{
			kaolahttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch(oc)
		{
			if (typeof XMLHttpRequest != "undefined" );
			{
				kaolahttp=new XMLHttpRequest();
			}
		}
	}			
	return kaolahttp;
}

/**
发送请求的js
**/
function sendHttpStr(httpUrl,postStr,next,str)
{	
	var kaolaHttp = new xmlHttp();
	var httpStr='';
 	try 
	{   
		kaolaHttp.open("POST", httpUrl, true);
		kaolaHttp.setRequestHeader("content-type", "application/x-www-form-urlencoded");
		kaolaHttp.onreadystatechange = function() 
		{
			//alert(kaolaHttp.status);
			if (kaolaHttp.readyState == 4 && kaolaHttp.status == 200) 
			{   
				 httpStr=kaolaHttp.responseText;
				 //alert('ffffffff');
				 //加一个注入函数
				 managerHttpStr(next,httpStr,str);
				 var i=90;
			}
		}
		kaolaHttp.send(postStr);	
	} catch (e) {
		alert(e.message);
	}
}

/**
	读取内容的js
**/
function getHttpStr(httpUrl,postStr,id)
{	
	var kaolaHttp = new xmlHttp();
	var httpStr='';
	if(postStr==''){
		postStr='kaola=v20';	
	}
 	try 
	{   
		kaolaHttp.open("POST", httpUrl, true);
		kaolaHttp.setRequestHeader("content-type", "application/x-www-form-urlencoded");
		kaolaHttp.onreadystatechange = function() 
		{	//alert(httpUrl+'----'+kaolaHttp.status);
			if (kaolaHttp.readyState == 4 && kaolaHttp.status == 200) 
			{   
				 httpStr=kaolaHttp.responseText;
				 document.getElementById(id).innerHTML=httpStr;	
				 var isTest=0;
			}
		}
		kaolaHttp.send(postStr);	
	} catch (e) {
		alert(e.message);
	}
}



