
function PonSeleccion(descripcion,tipoformacion)
{
    if (descripcion!='')
    {
        document.aspnetForm.F_Descripcion.value=descripcion;
    }
    if (tipoformacion!='')
    {
        document.aspnetForm.Tipo_Formacion.value=tipoformacion;
    }
}
 function position(event, idCApa, idInput, direccion)
 {

     var x = event.clientX;
     var y = event.clientY;
     var mousePositions = document.getElementById(idCApa);
     
     InputInformacion =new String( document.getElementById(idInput).value);
     Informacion =InputInformacion.split("&");
     mousePositions.innerHTML= "<div class='popuptop'></div><div class='popupmed'><h2 class='titular2'><span> "+ Informacion[0] +"</span></h2>"
      + " <a onclick=\"javascript:CerrarCapaFormacion('CapaFormacion')\" style=\"cursor:hand\" id='popup_btnCerrar' class='bt_cerrarpopupCentros'>Cerrar</a>   "
      + "<ul class='resultados-popup'><li>"
     +"<div class='fotocarnet'><img src='"+Informacion[1]+"' width='50' height='50' alt=''/></a></div>"
     +"<div class='contenido'>"+Informacion[2] +"</div>"
     +"</li><li><div class='fotocarnet'><img src='"+Informacion[3]+"' id='ImagenCentro' width='50' height='50' alt=''/></a></div>"
     +"<div class='contenido'><h4><span> Contacto<span></h4><p>Telefono: "+Informacion[4]+"</p><p> Fax: "+Informacion[5]
     +"</p><p> Url:<a id='UrlCentro' href='http://"+ Informacion[6]+"' target='_blank'>"+ Informacion[6]+"</a></p><p>Direccion: "+Informacion[7]
     +"</p><div class='der'><a id='UrlCentro' class='bt_masinfo_popup'  href='/formacion/centro/universidad/"+ Informacion[8]+"/' target='_top' >Mas informacion</a></div></div></li></ul>"
     +"</div><div class='popupbot'></div>" ;
 
   
     mousePositions.style.display= 'block';

      
if ( direccion == 'abajo')
{
     if ( event.screenY  > (  window.screen.availHeight/2))
        mousePositions.style.top  = y -window.screen.availHeight /3-30;
     else
      mousePositions.style.top  = y;
        
     mousePositions.style.left = event.screenX-30;
        
 }
 else if ( direccion == 'arriba' )
 {
     mousePositions.style.left = event.screenX-30;
     mousePositions.style.top= y-400 ;
 }
 else if ( direccion == 'medio' )
 {
     mousePositions.style.left = event.screenX-30;
     mousePositions.style.top= y-350 ;
 }
   

}
/*function AbrirAmigo(Id, TipoEnvio) 
{
	var pregunta,str,length_Ventana;
	str = rutaAbsoluta + 'formacion/EnviarAmigo.aspx?';
	if ( TipoEnvio == 'Centro')
	{ 
	    str =str+'ID_Centro='+Id;
	}
	else if  ( TipoEnvio == 'Curso')
	{  
	    str =str+'ID_Curso=' +Id; 
	}
	length_Ventana='width=500,height=500,,scrollbars=0';
	pregunta=window.open(str,'Amigo',length_Ventana);
}
function imprimirCurso(Id, TipoEnvio)
{
var pregunta,str, length_Ventana;
	str = rutaAbsoluta + 'formacion/ImprimirFormacion.aspx?';
	if ( TipoEnvio == 'Centro') 
	{
	    str =str+'ID_Centro='+Id;
	    length_Ventana='menubar=no,status=no,resizable=yes,width=650,height=800,scrollbars=yes'
	}
	else if  ( TipoEnvio == 'Curso')
    {
	    length_Ventana='menubar=no,status=no,resizable=yes,width=650,height=600,scrollbars=yes'
	    str =str+'ID_Curso=' +Id; 
	}
	pregunta=window.open(str,"Imprimir",length_Ventana);
}
function AbrirCupon(Id)
{
    var pregunta,str, length_Ventana;
	    str = rutaAbsoluta+ 'formacion/EnviarCupon.aspx?';
	        length_Ventana='menubar=no,status=no,resizable=yes,width=465,height=485,scrollbars=yes'
	        str =str+'id_curso=' +Id; 
	    pregunta=window.open(str,"AbrirCupon",length_Ventana);
}*/


function CerrarCapaFormacion ( idCApa)
{
    var mousePositions = document.getElementById(idCApa);
    mousePositions.style.display= 'none';
}

function toggleID(objID)
{
    // This function will toggle obj visibility of an Element
    // based on Element's ID
    // Works with IE and Mozilla based browsers
    var element = (ie) ? document.all(objID) : document.getElementById(objID);
     if (element.style.display=="none"){
         showID(objID)
    }else{
        hideID(objID)
     }
}


function hideID(objID)
{
    // This function will hide Elements by object ID
    // Works with IE and Mozilla based browsers
    var element = (ie) ? document.all(objID) : document.getElementById(objID);
    element.style.display="none"
}

function showID(objID){
    // This function will show Elements by object ID
    // Works with IE and Mozilla based browsers
    var element = (ie) ? document.all(objID) : document.getElementById(objID);
    element.style.display="block"
}
function Mostrar_Capa(Id_Capa,  Ruta_Imagen, event)
{
  
  
    var x = event.clientX;
   var y = event.clientY;
   var popupblanco =  document.getElementById(Id_Capa);
   document.getElementById("Foto_Centro").src= Ruta_Imagen;
   popupblanco.style.display="block";

     popupblanco.style.left = x+80+'px';
     popupblanco.style.top= y-210+'px' ;
  }
  function Cerrar_Capa (Id_Capa) 
 {
 document.getElementById(Id_Capa).style.display="none";
 }
function diseable_button(id)
{
   Cerrar_Capa(id);

}
function conmutar(capa)
{
    if (document.getElementById(capa).style.display == 'none' | document.getElementById(capa).style.display == 'hidden' )
    {
        document.getElementById(capa).style.display = 'block';
    }
    else
    {
        document.getElementById(capa).style.display = 'none';
    }
} 
function Ver_Filtro( event,tabla, boton)
{
    var tablas = document.getElementById('capaInformacion').getElementsByTagName('table');
    var capaInformacion= document.getElementById('capaInformacion')
    var link_Boton = document.getElementById(boton);
    // Iteramos para cada tablas
    for ( var i = 0; i < tablas.length; i++ ) {
         // Ocultamos el tablas
        tablas[i].style.display = 'none';
    }
    conmutar(tabla);
    yLef = link_Boton.offsetLeft + link_Boton.offsetParent.offsetLeft;
    xTop = link_Boton.offsetTop
    
    capaInformacion.style.display = 'block';
    capaInformacion.style.position= 'absolute';    
    capaInformacion.style.top = xTop +'px';
    capaInformacion.style.left = yLef +'px'; 

}



