//AJAX
var http = getXmlHttpObject(); 

function getXmlHttpObject() {
	var xmlhttp;
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
// JScript gives us Conditional compilation, we can cope with old IE versions.
// and security blocked creation of the objects.
try {
  xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
  try {
   xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  } catch (E) {
   xmlhttp = false;
  }
}
@end @*/
	if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
		try {
			xmlhttp = new XMLHttpRequest();
		}
		catch (e) {
			xmlhttp = false;
		}
	}
	return xmlhttp;
}
function playVideo(video) {
	http.open("GET", "videos/playvideo.php?video="+video, true);
	http.onreadystatechange = function () {
		if (http.readyState == 1) {
			document.getElementById('videoholder').innerHTML = "<div id=\"mensaje\">Cargando...</div>";
		}
		if (http.readyState == 4) {
			results = http.responseText;
			document.getElementById('videoholder').innerHTML = results;
		}
	}
	http.send(null);
}
function traeregistrarse() {
	http.open("GET", "include/inc-usr-registrar.php", true);
	http.onreadystatechange = function () {
		if (http.readyState == 1) {
			document.getElementById('usr').innerHTML = "<div id=\"mensaje\">Cargando...</div>";
		}
		if (http.readyState == 4) {
			results = http.responseText;
			document.getElementById('usr').innerHTML = results;
		}
	}
	http.send(null);
}
/*function handleHttpResponse() {
	if (http.readyState == 1) {
		document.getElementById('fotos').innerHTML = "<div id=\"mensaje\">Cargando...</div>";
	}
	if (http.readyState == 4) {
		results = http.responseText;
		document.getElementById('fotos').innerHTML = results;
	}
}*/
function recargaCaptcha(tiempo) {
	http.open("GET", "inc_captcha.php?tiempo=" + tiempo, true);
	http.onreadystatechange = function () {
		if (http.readyState == 1) {
			document.getElementById("captcha").innerHTML = "<div id=\"mensaje\">Cargando...</div>";
		}
		if (http.readyState == 4) {
			document.getElementById("captcha").innerHTML = http.responseText;
		}
	};
	http.send(null);
}
