/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */


Event.observe( window, 'load', 	function( ) {

    if($('fotosGaleria') != null){
        $('fotosGaleria').appear();

    }
  
    var galeriaContext = $$('.galeriaContext');
    galeriaContext.each(function(item) {
        item.appear();

    });
    
    if($('antesGaleria')!=null){
        $('antesGaleria').hide();
    }
    

    
   /*/ function cargar(url,idACargar){
        new Ajax.Request(url,
        {
            method:'get',
            onComplete: function(transport){
                var response = transport.responseText || "no response text";
                var div = new Element('div', { 'id': 'yrch'});
                div.innerHTML = response;
                var nose = div.down('#galeria');
                $('galeria').innerHTML = nose.innerHTML;
                
                if($('fotosGaleria') != null){
                    $('fotosGaleria').appear();

                }
  
                var galeriaContext = $$('.galeriaContext');
                galeriaContext.each(function(item) {
                    item.appear();

                });
                
            },
            onFailure: function(){ alert('Something went wrong...') }
        });
    }
    
    var galeriaEnlaces = $$('.galeriaContext a');
    galeriaEnlaces.each(function(item) {
        item.observe('click',function(event){
            
            Event.stop(event);
            alert('si')
            JQ("#galeria").load(item.href  + " #galeria",function(){
                
                $('fotosGaleria').appear();
                var galeriaContext = $$('.galeriaContext');
                galeriaContext.each(function(item) {
                    item.appear();

                });
            })});                    
        });  */

    
});


/*/
Event.observe(window,'dom:loaded', function() { // once the DOM is loaded
    
    function respondToClick(event){
        Event.stop(event);
        $('fotoGaleriaPrincipalEnlace').src = this.down(0).src;
       
    }
    
    var links = $$('a');
    for ( var i = 0; i < links.size(); i++ )
    {
        links[i].observe('click', respondToClick); //Observa el evento click del link y llama a responToClick
    }
  
});*/
 