
	/**
	 * Realiza GET assíncrono
	 * page - página solicitada
	 * func - função javascript chamada no retorno
	 */ 
	function doGet(page, func) {
		var xmlHttp;
		try {    
			// Firefox, Opera 8.0+, Safari
			xmlHttp = new XMLHttpRequest();
		} catch (e) {
		    // Internet Explorer
			try {
				xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
	      	} catch (e) {
	      		try {
					xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
				} catch (e) {
					alert("Your browser does not support AJAX!");
					return false;
				}
			}
		}
		xmlHttp.onreadystatechange = function()
      		{
      			if (xmlHttp != null) {
	      			if (xmlHttp.readyState == 4) {
						if (xmlHttp.status == 200) {
							eval(func + '(xmlHttp.responseText);');
							xmlHttp = null;
						}
	        		}
        		}
      		}
    	
    	xmlHttp.open('GET', page, true);
    	xmlHttp.send(null);
	}
	
	/**
	 * Realiza POST assíncrono
	 * page - página solicitada
	 * params - parâmetros postados
	 * func - função javascript chamada no retorno
	 */ 
	function doPost(page, params, func) {
		var xmlHttp;
		try {    
			// Firefox, Opera 8.0+, Safari
			xmlHttp = new XMLHttpRequest();
		} catch (e) {
		    // Internet Explorer
			try {
				xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
	      	} catch (e) {
	      		try {
					xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
				} catch (e) {
					alert("Your browser does not support AJAX!");
					return false;
				}
			}
		}
		xmlHttp.onreadystatechange = function()
      		{
      			if (xmlHttp.readyState == 4) {
					if (xmlHttp.status == 200) {
						eval(func + '(xmlHttp.responseText);');
					}
        		}
      		}
    	
    	xmlHttp.open('POST', page, true);
    	xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
		xmlHttp.setRequestHeader('Content-length', params.length); 
    	xmlHttp.send(params);
	}

