// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults

var fileFieldCount = 1;

Ajax.Responders.register({
        onCreate: function() {
                if($('notification') && Ajax.activeRequestCount> 0)
                        Effect.Appear('notification',{duration: 0.25, queue: 'end'});
        },
        onComplete: function() {
                if($('notification') && Ajax.activeRequestCount == 0)
                        Effect.Fade('notification',{duration: 0.25, queue: 'end'});
        }
});

function updateUrlField(name, url){
  $(url).value = $(name).value.toLowerCase().replace(/\s/g, "-");
}

function createSelfClearInput(element_class, start_value){
  $$(element_class).each(function(element){
        element.observe('focus', function(event){
            if(element.value==start_value){
              element.value="";
            };
        });
  });
  $$(element_class).each(function(element){
        element.observe('blur', function(event){
            if(element.value==""){
              element.value=start_value;
            };
        });
  });
};

jQuery(document).ready(function(){
    jQuery('.blocks_inside a').hover(function(element){
        jQuery(this).find('span').stop().animate({
          "opacity": "0"
        }, 
        {"duration": "normal"});
        
        jQuery(this).find('b').stop().animate({
          "marginTop": "18px",
          "marginBottom": "19px"
        }, 
        {"duration": "normal"});
        
    }, function(){
      jQuery(this).find('span').stop().animate({
        "opacity": "1"
      }, 
      {"duration": "normal"});
      
      jQuery(this).find('b').stop().animate({
        "marginTop": "0px",
        "marginBottom": "0px"
      }, 
      {"duration": "normal"});
    });
});
