function ajaxInit(){
    var xmlhttp =false;
    /*@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' ) {
        xmlhttp = new XMLHttpRequest();
    }
    return xmlhttp;
}
//el mismo onreadystate para todos
function readyState(ajax, _divName, _show)
{
	ajax.onreadystatechange=function(){
		if (ajax.readyState==1){
			if(_show){
				if (document.getElementById(_divName).style.display==""){
					document.getElementById(_divName).style.display="none";
				}else{
					document.getElementById(_divName).style.display="";
				}
			}else{
				document.getElementById(_divName).style.display="";
			}
	        //document.getElementById(_divName).innerHTML = "<p style='padding-left: 25px; margin:0 5px; display:block; background:  url(../images/cargando.gif) no-repeat 0 0;'>Cargando</p>";
	    }else if (ajax.readyState==4){
		    if(ajax.status==200){
				document.getElementById(_divName).innerHTML = ajax.responseText;
				//alert(ajax.responseText);
		    }
		}
    }
    ajax.setRequestHeader( "If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT" );
    ajax.send(null);
}

function maximize(nombre_archivo){
	document.getElementById("otro").style.display="block";
	ocultarDiv('video')
	var ajax = ajaxInit();
	ajax.open("GET","loadImagen.php?imagen="+nombre_archivo,true);	
	//(document.getElementById("index")).background("");//.style = " background-image: none";
	if (document.body)
		document.body.background = "";
    readyState(ajax, 'otro', false);
    return;
}

function maxVideo(nombre_archivo){
	//alert(nombre_archivo);
	var ajax = ajaxInit();
	ajax.open("GET","loadFlash.php?video="+nombre_archivo,true);	
	//(document.getElementById("index")).background("");//.style = " background-image: none";
    readyState(ajax, 'otro', false);
    return;
}

function ocultarDiv(_div){
	document.getElementById(_div).style.display="none";
}
