// JavaScript Document
function AjaxNzk()
{
	this.assincr = true;
	this.method = "GET";
	this.val = "";
	this.xmlhttp = null;
	
	try
	{
		this.xmlhttp =  new ActiveXObject("Microsoft.XMLHTTP");
	}
	catch(e)
	{
		try{
			this.xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch(ex)
		{
			try{
				this.xmlhttp = new XMLHttpRequest();
			}
			catch(exc)
			{
				alert("Esse browser não tem recursos para uso do Ajax");
				this.xmlhttp = null;
			}
		}
	}
	
	//carrega o conteudo de uma ajax em uma var
	this.loadResult = function(url, target)
	{
		if(this.xmlhttp) 
		{
			var ajax = this.xmlhttp;
			//
			this.xmlhttp.open(this.method, url , this.assincr);
			//
			if(this.method == 'GET')
			{
				this.xmlhttp.send(null);
			}
			else if(this.method == 'POST')
			{
				this.xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;");
			}
			//
			try{
				this.xmlhttp.send(url.split("?")[1]);
			}
			catch(e)
			{
			
			}
			//
			if(this.assincr)
			{
				this.xmlhttp.onreadystatechange = function()
				{
					if(ajax.readyState == 4)
					{
						if(ajax.status == 200)
						{
							target.innerHTML = ajax.responseText;
						}
						else
						{
							//alert(ajax.xmlhttp.statusText);
						}
					}
				}
				
			}
			else
			{
				target.innerHTML = ajax.responseText;
			}
			
		}

	}
}