// Make sure the behaviors still work even after navigating to another page using the ajax navigation.
Event.addBehavior.reassignAfterAjax = true;
/////////////////////////////////////////////////////////////////

// Global behaviours : index (display_variations, destroy_var) //
Event.addBehavior({
  'body' : function() {
    // Update and animate the notice notifier if there is a notice to display
    //Notice.view();
  },

  'span.restful-destroy form' : Remote.Form({
       method: 'post'
    })
});



/////////////////////////////////////////////////////////////////

// Article page behaviours : 

Event.addBehavior({
'#tit_news1 a:click' : function(){
    if($('news2').visible()) Effect.toggle('news2', 'blind', {duration:.5});
	if($('news3').visible()) Effect.toggle('news3', 'blind', {duration:.5});
    Effect.toggle('news1', 'blind', {duration:.5}); 
    return false;

  },
 '#tit_news2 a:click' : function(){
	if($('news3').visible()) Effect.toggle('news3', 'blind', {duration:.5});
	if($('news1').visible()) Effect.toggle('news1', 'blind', {duration:.5});
    Effect.toggle('news2', 'blind', {duration:.5}); 
    return false;
  },
  
'#tit_news3 a:click' : function(){
    if($('news2').visible()) Effect.toggle('news2', 'blind', {duration:.5});
	if($('news1').visible()) Effect.toggle('news1', 'blind', {duration:.5});
    Effect.toggle('news3', 'blind', {duration:.5}); 
    return false;
  }


 
});

Event.onReady(function() {
  setupZoom()
});