function nuevoAjax(){
	var xmlhttp=false;
 	try {
 		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
 	} catch (e) {
 		try {
 			xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
 		} catch (E) {
 			xmlhttp = false;
 		}
  	}

	if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
 		xmlhttp = new XMLHttpRequest();
	}
	return xmlhttp;
}
// -->


function cambiarVideo(IDVideo,URLVideo){
	var contenedor;
	contenedor = document.getElementById('contenedor');

	ajax=nuevoAjax();
	ajax.open("GET", "video_frente.phtml?IDVideo="+IDVideo+"&URLVideo="+URLVideo,true);
	ajax.onreadystatechange=function() {
	
	 if(ajax.readyState==1){
                        contenedor.innerHTML = "<br><br><br>Cargando video...";
                        //modificamos el estilo de la div, mostrando una imagen de fondo
                        contenedor.style.background = "url('images/loader.gif') no-repeat center 10%";
						 
                } else if (ajax.readyState==4) {
							if(ajax.status==200){
                                //mostramos los datos dentro de la div
                                contenedor.innerHTML = ajax.responseText; 
								contenedor.style.background = "url('') no-repeat"; 
                                //preloader.innerHTML = "Cargado.";
                                //preloader.style.background = "url('') no-repeat";
                        }else if(ajax.status==404){
                                contenedor.innerHTML = "La p&aacute;gina no existe"+IDVideo;
                        }else{
                                //mostramos el posible error
                                contenedor.innerHTML = "Error:".ajax.status; 
                        }	}
	}
	
			
	ajax.send(null)
	}



