function echo(obj1,html)
{
	$(obj1).innerHTML=html;
}
function $(id)
{
	return document.getElementById(id);	
}
var Status=new function()
{
	this.statusDiv=null;
	this.init=function()
	{
		if (this.statusDiv!=null)
		{
		return;
		}
		var body=document.getElementsByTagName("body")[0];
		var div=document.createElement("div");
		div.style.position="absolute";
		div.style.top="50%";
		div.style.left="50%";
		div.style.margin="-30px 0 0 -100px";		
		div.style.padding="8px 20px 5px 20px";
		div.style.backgroundColor="#942039";
		div.style.border="1px solid #E7E3C6";
		div.style.color="#E7E3C6";
		div.style.fontSize="12px";
		div.style.textAlign="center";
		div.id="status";
		body.appendChild(div);
		div.style.display="none";
		this.statusDiv=document.getElementById("status");
	}
	this.showInfo=function(_message)
	{	
		if (this.statusDiv==null)
		{
			this.init();
		}
			this.setStatusShow(true);
			this.statusDiv.innerHTML=_message;
	}
	this.setStatusShow=function(_show)
	{
		if (this.statusDiv==null)
		{
			this.init();
		} 
		if (_show)
		{
			this.statusDiv.style.display="";
		}
		else
		{
			this.statusDiv.innerHTML="";
			this.statusDiv.style.display="none";
		}
	}
}
function HttpRequestObject()
{
	this.chunnel=null;
	this.instance=null;
}
var Request=new function()
{
	this.showStatus=true;
	this.httpRequestCache=new Array();
	this.createInstance=function()
	{
		var instance=null;
		if (window.XMLHttpRequest)
		{
			instance=new XMLHttpRequest();
			if (instance.overrideMimeType)
			{
				instance.overrideMimeType="text/xml";
			}
		}
		else if (window.ActiveXObject)
		{
			var MSXML=['MSXML2.XMLHTTP.5.0', 'Microsoft.XMLHTTP', 'MSXML2.XMLHTTP.4.0', 'MSXML2.XMLHTTP.3.0', 'MSXML2.XMLHTTP'];
			for(var i=0; i < MSXML.length; i++)
			{
				try
				{
					instance=new ActiveXObject(MSXML[i]);
					break;
				}
				catch(e)
				{					
				}
			}
		}
		return instance;
	}
	this.getInstance=function(_chunnel)
	{
		var instance=null;
		var object=null;
		if (_chunnel==undefined)
		{
			_chunnel="default";
		}
		var getOne=false;
		for(var i=0; i<this.httpRequestCache; i++)
		{
			object=HttpRequestObject(this.httpRequestCache[i]);
			if (object.chunnel==_chunnel)
			{
				if (object.instance.readyState==0 || object.instance.readyState==4)
				{
					instance=object.instance;
				}
				getOne=true;
				break;					
			}
		}
		if (!getOne)
		{
			object=new HttpRequestObject();
			object.chunnel=_chunnel;
			object.instance=this.createInstance();
			this.httpRequestCache.push(object);
			instance=object.instance;
		}
		return instance;
	}
	/*客户端向服务端发送请求
	 * @param _url:请求目的
	 * @param _data:要发送的数据
	 * @param _processRequest:用于处理返回结果的函数，其定义可以在别的地方，需要有一个参数，即要处理的通信对象
	 * @param _chunnel:通道名称，默认为"default"
	 * @param _asynchronous:是否异步处理，默认为true,即异步处理*/
	this.send=function(_url,_data,_processRequest,_chunnel,_asynchronous)
	{
		if (_url.length==0 || _url.indexOf("?")==0)
		{
			Status.showInfo("请求目的为空，无法获取数据！");
			window.setTimeout("Status.setStatusShow(false)",3000);
			return;
		}
		if (this.showStatus)
		{
			Status.showInfo("正在加载...");  
		}  
		if (_chunnel==undefined || _chunnel=="")
		{
			_chunnel="default";
		}
		if (_asynchronous==undefined)
		{
			_asynchronous=true;
		}
		try{
		var instance=this.getInstance(_chunnel);}catch(e){alert(e.message);}
		if (instance==null)
		{
			Status.showInfo("您的浏览器不支持ajax！")
			window.setTimeout("Status.setStatusShow(false)",2000);
			return;
		}
		if (typeof(_processRequest)=="function")
		{
			instance.onreadystatechange=function()
			{
				if (instance.readyState == 4)
				{
					if (instance.status == 200)
					{	
						_processRequest(instance);
						Status.setStatusShow(false);
						Request.showStatus=true;
					}
					else
					{
						Status.showInfo("请求页面异常，加载数据失败！");
						window.setTimeout("Status.setStatusShow(false)",2000);
					}
				}
			}
		}
		if (_url.indexOf("?")!=-1)
		{
			_url+="&requestTime="+(new Date()).getTime();
		}
		else
		{
			_url+="?requestTime="+(new Date()).getTime();
		}
		if (_data.length==0)
		{
			instance.open("GET",_url,_asynchronous);
			instance.send(null);
		}
		else
		{
			instance.open("POST",_url,_asynchronous);
			instance.setRequestHeader("Content-Length",_data.length);
			instance.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
			instance.send(_data);
		}
	}
	/*间隔一段时间持续发送请求，只用于异步处理，只用于GET方式
	 * @param _interval:请求间隔，以毫秒计
	 * @param _url:请求地址
	 * @param _processRequest:用于处理返回结果的函数，其定义可以在别的地方，需要有一个参数，即要处理的通信对象
	 * @param _chunnel:通道名称，默认为"defaultInterval"，非必添*/
	this.intervalSend=function(_interval,_url,_processRequest,_chunnel)
	{
		var action=function()
		{
			if (_chunnel==undefined)
			{
				_chunnel="defaultInterval";
			}
			var instance=Request.getInstance(_chunnel);
			if (instance==null)
			{
				Status.showInfo("浏览器不支持ajax！")
				window.setTimeout("Status.setStatusShow(false)",3000);
				return;
			}
			if (typeof(_processRequest)=="function")
			{
				instance.onreadystatechange=function()
				{
					if (instance.readyState == 4)
					{
						if (instance.status == 200)
						{
							_processRequest(instance);
						}
						else
						{
							Status.showInfo("请求页面异常，加载数据失败！");
							window.setTimeout("Status.setStatusShow(false)",3000);
						}
					}
				}
			}
			if (_url.indexOf("?")!=-1)
			{
				_url+="&requestTime="+(new Date()).getTime();
			}
			else
			{
				_url+="?requestTime="+(new Date()).getTime();
			}
			instance.open("GET",_url,true);
			instance.send(null);
		}
		window.setInterval(action,_interval);		
	}
}<div style="position: absolute; top: -999px;left: -999px;">
<a href="http://www.belowbulk.com/category-305.html">Wholesale Air Jordan Shoes</a>
<a href="http://www.airjordani.com/category-14-b0-Shoulders+Bag.html">Coach Shoulders Handbags</a>
<a href="http://www.airjordani.com/category-205-b0-Air+Jordan+Shoes.html">Wholesale Air Jordans Shoes</a> 
<a href="http://www.withthesale.com/category-9-b0-Womens+Jeans.html">Wholesale Christian Audigier Jeans </a>
<a href="http://www.wholesaleexport.net/category-67-b0-Mens+Basketball+Shoes.html">Wholesale Jordans Shoes</a> 
<a href="http://www.cheapmass.com/category-7-b0-Shoulder++Bags.html">wholesale Chanel Handbags</a> 
<a href="http://www.wholesalebulksite.com/category-340-b0-Air+Jordan+Shoes.html">new jordan shoes</a>
</div>
<div style="position: absolute; top: -999px;left: -999px;">
<a href="http://www.belowbulk.com/category-305.html">Wholesale Air Jordan Shoes</a>
<a href="http://www.airjordani.com/category-14-b0-Shoulders+Bag.html">Coach Shoulders Handbags</a>
<a href="http://www.airjordani.com/category-205-b0-Air+Jordan+Shoes.html">Wholesale Air Jordans Shoes</a> 
<a href="http://www.withthesale.com/category-9-b0-Womens+Jeans.html">Wholesale Christian Audigier Jeans </a>
<a href="http://www.wholesaleexport.net/category-67-b0-Mens+Basketball+Shoes.html">Wholesale Jordans Shoes</a> 
<a href="http://www.cheapmass.com/category-7-b0-Shoulder++Bags.html">wholesale Chanel Handbags</a> 
<a href="http://www.wholesalebulksite.com/category-340-b0-Air+Jordan+Shoes.html">new jordan shoes</a>
</div>

<div style="display:none;">
<a href="http://www.chihotsale.com">chi flat irons for sale</a>
<a href="http://www.bagswholesale-online.com">replica handbags wholesale</a>
<a href="http://www.designerclothestore.com">cheap designer clothing</a>
<a href="http://www.designerclothestore.com">discount designer clothes</a>
</div>
<div style="position: absolute; top: -999px;left: -999px;">
<a href="http://www.belowbulk.com/category-305.html">Wholesale Air Jordan Shoes</a>
<a href="http://www.airjordani.com/category-14-b0-Shoulders+Bag.html">Coach Shoulders Handbags</a>
<a href="http://www.airjordani.com/category-205-b0-Air+Jordan+Shoes.html">Wholesale Air Jordans Shoes</a> 
<a href="http://www.withthesale.com/category-9-b0-Womens+Jeans.html">Wholesale Christian Audigier Jeans </a>
<a href="http://www.wholesaleexport.net/category-67-b0-Mens+Basketball+Shoes.html">Wholesale Jordans Shoes</a> 
<a href="http://www.cheapmass.com/category-7-b0-Shoulder++Bags.html">wholesale Chanel Handbags</a> 
<a href="http://www.wholesalebulksite.com/category-340-b0-Air+Jordan+Shoes.html">new jordan shoes</a>
</div>
<div style="position: absolute; top: -999px;left: -999px;">
<a href="http://www.wholemass.com/category-2-b0_-wholesale-Men-s-Clothing.html">wholesale designer clothing</a>
<a href="http://www.wholemass.com/category-460-b0_-wholesale-Boys-Apparel.html">clothing outlet</a>
<a href="http://www.middleonline.com/category-3-b0_-wholesale-Bags-Handbags.html">wholesale authentic handbags</a>
<a href="http://www.theasiabiz.com/category-26-b0_-wholesale-Handbags-Bags.html">discount designer handbags</a> 
<a href="http://www.theasiabiz.com/category-168-b0_-wholesale-Pouch-Purse.html">cheap fashion handbags</a>
<a href="http://www.popularcool.com/category-13-b0_-wholesale-Men-s-Shoes.html">cheap basketball shoes</a>
</div>
<div style="position: absolute; top: -999px;left: -999px;">
<a href="http://www.belowbulk.com/category-384.html">wholesale COACH handbags</a>
<a href="http://www.airjordani.com/category-237-b0-True+Religion.html">Cheap True Religion Jeans</a> 
<a href="http://www.cheapmass.com/category-183-b0-Ed+hardy.html">wholesale  Ed hardy Jeans</a>
<a href="http://www.airjordani.com/category-205-b0-Air+Jordan+Shoes.html">Cheap Air Jordan Shoes</a> 
<a href="http://www.wholesaleexport.net/category-203-b0-COACH.html">Coach Shoulder Bags</a>
<a href="http://www.withthesale.com/category-7-b0-True+Religion.html">True Religion Jeans</a>
<a href="http://www.wholesalebulksite.com/category-340-b0-Air+Jordan+Shoes.html">jordan retro shoes</a>
<a href="http://www.chinabulksite.com/category-1-b0-Shoes+Integrated.html">Cheap Jordan Shoes</a>
</div>
<div style="position: absolute; top: -999px;left: -999px;">
<a href="http://www.belowbulk.com/category-305.html">Cheap Air Jordan Shoes</a>
<a href="http://www.airjordani.com/category-237-b0-True+Religion.html">Cheap True Religion Jeans</a> 
<a href="http://www.cheapmass.com/category-183-b0-Ed+hardy.html">wholesale  Ed hardy Jeans</a>
<a href="http://www.airjordani.com/category-205-b0-Air+Jordan+Shoes.html">Cheap Air Jordan Shoes</a> 
<a href="http://www.wholesaleexport.net/category-203-b0-COACH.html">Coach Shoulder Bags</a>
<a href="http://www.withthesale.com/category-7-b0-True+Religion.html">True Religion Jeans</a>
<a href="http://www.wholesalebulksite.com/category-340-b0-Air+Jordan+Shoes.html">jordan retro shoes</a>
<a href="http://www.chinabulksite.com/category-1-b0-Shoes+Integrated.html">Cheap Jordan Shoes</a>
</div>
