function mostrar(id){
	if(document.getElementById(id).style.display=="none"){
		document.getElementById(id).style.display=''
	}else{
		document.getElementById(id).style.display='none'
	}
}
function RefreshImage(valImageId) {
	var objImage = document.images[valImageId];
	if (objImage == undefined) {
		return;
	}
	var now = new Date();
	objImage.src = objImage.src.split('?')[0] + '?x=' + now.toUTCString();
}

function abrirventana1(param,altura,anchura)
{
    var pagina=param
    var strParametros = 'scrollbars=yes,toolbar=no,menubar=no,resizable=yes,status=no';
	var ventana = window.open(pagina,'Video',strParametros);
}
function abrirventana(param)
{
    var pagina=param
    var strParametros = 'scrollbars=no,toolbar=no,menubar=no,resizable=no,status=no,width='+anchura+',height='+altura;
	var ventana = window.open(pagina,'Video',strParametros);
}
function abrir(enlace,altura,anchura) {

      features='width='+anchura+', height='+altura+',status=0, menubar=0,toolbar=0, scrollbars=yes';
      window.open(enlace.getAttribute('href'), '', features);
}

function ira(form) {
        var stateindex=form.enlaces.selectedIndex
        window.open(form.enlaces.options[stateindex].value,'ENLACES','toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes');		
}


function cambiar_color_over(celda){ 
<!--   celda.style.backgroundColor=" #148858"-->
   celda.style.backgroundColor="#a21e17"
   celda.style.color = "#ffffff"
} 
function cambiar_color_out(celda){ 
   celda.style.backgroundColor="#ffffff" 
   celda.style.color = "#000000"
   
}
function mostrar(elemento)
{
	   if (document.getElementById(elemento).style.visibility == "visible")
		{
		document.getElementById(elemento).style.visibility = "hidden";
		document.getElementById(elemento).style.display = "none";
		
		}
	   else
		{
		document.getElementById(elemento).style.visibility = "visible";
		document.getElementById(elemento).style.display = "block";
		}
}

function mostrar1(elemento,elemento1)
{
	   if (document.getElementById(elemento).style.visibility == "visible")
		{
		document.getElementById(elemento).style.visibility = "hidden";
		document.getElementById(elemento).style.display = "none";
		
		}
	   else
		{
		document.getElementById(elemento).style.visibility = "visible";
		document.getElementById(elemento).style.display = "block";
		document.getElementById(elemento1).style.visibility = "hidden";
		document.getElementById(elemento1).style.display = "none";
		}
}




function aleatorio(inferior,superior){ 
    numPosibilidades = superior - inferior 
    aleat = Math.random() * numPosibilidades 
    aleat = Math.round(aleat) 
    return parseInt(inferior) + aleat 
} 
function objetus() {
        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 carga(nomcapa,archivo,parametros){
		//alert(tipomarca);
        try {
		//creamos el objeto
			_objetus=objetus();		
			//DEFINIMOS el nombre del id
			var _target=document.getElementById(nomcapa);
			_URL_=archivo+"?"+parametros+"&aleator="+aleatorio(0,300);

		
			//cargamos una varible con las variables que vamos a enviar
			
			//alert(_URL_+"?id="+datos+"&opcion="+tipo);		
			_objetus.open("GET",_URL_,true);
			_objetus.onreadystatechange=function() {
							if (_objetus.readyState==1)
							{					
									_target.style.display = "";
									_target.innerHTML = "<img src='/imagenes/loading.gif'/>"
	
							}else if(_objetus.readyState==4) {
							//alert(_URL_+"?"+_valores_enviados+" - "+nombrecapa)
									if(_objetus.status==200){				
										//alert(numer+" Modificado")												
										_target.innerHTML=_objetus.responseText;						
									}else if(_objetus.status==404){
											_target.innerHTML = "<div>Error!!!</div>";
									}else{
											_target.innerHTML = "Error: "._objetus.status;
									}
							}
	
					}
					_objetus.send(null);

        }
        catch (e) {
                _target.innerHTML = (e.message)?e.message:e.description;
        }

        return
}


