	var http_request = false;
	function makeRequest(url) {
		http_request = false;
		if (window.XMLHttpRequest) {
			http_request = new XMLHttpRequest();
			if (http_request.overrideMimeType) {
				http_request.overrideMimeType('text/xml');
			}
		} else if (window.ActiveXObject) {
			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;
		}
		http_request.onreadystatechange = alertContents;
		http_request.open('GET', url, true);
		http_request.send(null);

	}

	function alertContents() {

		if (http_request.readyState == 4) {
			if (http_request.status == 200) {
			   teste(http_request);
            } else {
                alert('There was a problem with the request.');
            }
        }

    }
    
	function teste(texto) {
		if(texto.responseXML) {
			processXML(texto.responseXML);
		}
	}

	function processXML(obj){
		var root = obj.getElementsByTagName("root")[0];
		
		var draft = root.getElementsByTagName("draft")[0];
		if (draft != null) {
			var status = draft.getElementsByTagName("status")[0].firstChild.nodeValue;
			if (status == "false") {
				hideDraft();
			} else if (status == "true") {
				showDraft();
			}
		}
		
		var espera = root.getElementsByTagName("espera")[0];
		if (espera != null) {
			var status = espera.getElementsByTagName("status")[0].firstChild.nodeValue;
			if (status == "false") {
				populaEspera(espera.getElementsByTagName("lista")[0].firstChild.nodeValue);
			} else if (status == "true") {
				populaEspera(espera.getElementsByTagName("lista")[0].firstChild.nodeValue);
			}
		}
		
		var pick = root.getElementsByTagName("pick")[0];
		if (pick != null) {
			var reset = pick.getElementsByTagName("reset")[0].firstChild.nodeValue;
			if (reset == "true") {
				resetPick();
			}
			var tempo = pick.getElementsByTagName("tempo")[0].firstChild.nodeValue;
			if (tempo != null) {
				cronoParams(tempo);
			}
			var booster = pick.getElementsByTagName("booster")[0].firstChild.nodeValue;
			if (booster != null) {
				textReplace(booster,'boosterNumber');
			}
			var pickBooster = pick.getElementsByTagName("pickBooster")[0].firstChild.nodeValue;
			if (pickBooster != null) {
				textReplace(pickBooster,'pickNumber');
			}
		}
		
		var jogadores = root.getElementsByTagName("jogadores")[0];
		if (jogadores != null) {
			populaJogadores(jogadores.getElementsByTagName("lista")[0].firstChild.nodeValue);
		}
		
		var selado = root.getElementsByTagName("selado")[0];
		if (selado != null) {
			var status = selado.getElementsByTagName("status")[0].firstChild.nodeValue;
			if (status == "true") {
				window.location.href='../?view=selado/selado';
			}
		}
		
		var cartasPool = root.getElementsByTagName("cartasPool")[0];
		if (cartasPool != null) {
			populaCartasPool(cartasPool.getElementsByTagName("artefato")[0].firstChild.nodeValue,'A');
			populaCartasPool(cartasPool.getElementsByTagName("azul")[0].firstChild.nodeValue,'U');
			populaCartasPool(cartasPool.getElementsByTagName("branco")[0].firstChild.nodeValue,'W');
			populaCartasPool(cartasPool.getElementsByTagName("preto")[0].firstChild.nodeValue,'B');
			populaCartasPool(cartasPool.getElementsByTagName("verde")[0].firstChild.nodeValue,'G');
			populaCartasPool(cartasPool.getElementsByTagName("vermelho")[0].firstChild.nodeValue,'R');
		}

		var cartasBooster = root.getElementsByTagName("cartasBooster")[0];
		if (cartasBooster != null) {
			populaCartasBooster(cartasBooster.getElementsByTagName("artefato")[0].firstChild.nodeValue,'A');
			populaCartasBooster(cartasBooster.getElementsByTagName("azul")[0].firstChild.nodeValue,'U');
			populaCartasBooster(cartasBooster.getElementsByTagName("branco")[0].firstChild.nodeValue,'W');
			populaCartasBooster(cartasBooster.getElementsByTagName("preto")[0].firstChild.nodeValue,'B');
			populaCartasBooster(cartasBooster.getElementsByTagName("verde")[0].firstChild.nodeValue,'G');
			populaCartasBooster(cartasBooster.getElementsByTagName("vermelho")[0].firstChild.nodeValue,'R');
		}
		
		var dragAndDrop = root.getElementsByTagName("dragAndDrop")[0];
		if (dragAndDrop != null) {
			var cartasBooster = dragAndDrop.getElementsByTagName("cartasBooster")[0].firstChild.nodeValue;
			var cartasPool = dragAndDrop.getElementsByTagName("cartasPool")[0].firstChild.nodeValue;
			var booster = dragAndDrop.getElementsByTagName("booster")[0].firstChild.nodeValue;
			criaDragDrop(cartasBooster, cartasPool, booster);
		}
		
		var preLoad = root.getElementsByTagName("preLoad")[0];
		if (preLoad != null) {
			MM_preloadImages(preLoad.getElementsByTagName("lista")[0].firstChild.nodeValue);
		}
		
		var lastSize = root.getElementsByTagName("lastSize")[0];
		if (lastSize != null) {
			var status = lastSize.getElementsByTagName("status")[0].firstChild.nodeValue;
			if (status == "true") {
				aumentaUltima('185');
			}
		}
		
		var boosterTable = root.getElementsByTagName("boosterTable")[0];
		if (boosterTable != null) {
			var status = boosterTable.getElementsByTagName("status")[0].firstChild.nodeValue;
			if (status == "show") {
				showBooster();
			} else if (status == "hide") {
				hideBooster();
			} 
		}
		
		var preferencia = root.getElementsByTagName("preferencia")[0];
		if (preferencia != null) {
			var imagem = preferencia.getElementsByTagName("imagem")[0].firstChild.nodeValue;
			if (imagem == "true") {
				document.getElementById('imagemCarta').style.display = 'block';
				updateImagemCarta(1);
				moveTable(1);
			} else if (imagem == "false") {
				if (document.getElementById('imagemCarta').style.display == 'block') {
					moveTable(0);
				}
				document.getElementById('imagemCarta').style.display = 'none';
				updateImagemCarta(0);	
			}
		}
		
	}