jQuery(document).ready(function() {

  //jQuery('input[name="search_block_form"]').attr( "value", "Search");
  jQuery('input[name="search_block_form"]')[0].defaultValue = ("Search");

	jQuery('input[type="text"], textarea').addClass("idleField").addClass("greyed");
	
  jQuery('input[type="text"], textarea').focus(function() {

    jQuery(this).removeClass("idleField").removeClass("greyed").addClass("focusField");
    
		if (this.value == this.defaultValue){ 
		  this.value = '';
		}
		
		if(this.value != this.defaultValue){
      this.select();
    }
    
  });
  
		
		
  jQuery('input[type="text"], textarea').blur(function() {

    jQuery(this).removeClass("focusField").addClass("idleField");
    
    if (jQuery.trim(this.value) == ''){
      this.value = (this.defaultValue ? this.defaultValue : '');
    }

		if (this.value == this.defaultValue){
		  jQuery(this).addClass("greyed");
		}
		
  });
  
  
  
});
;
(function ($) {
  Drupal.behaviors.re_slideshow = {
    attach: function(context){
    
    
       $('.view-re-slideshow .re_video').each(function(){
        var video_row = $(this);
        
        //Deactivate slide title links for videos  
        //add a click event to the title link that starts the video  
        video_row.siblings('.re_slideshow-title').children('a').attr('href', '#').click(function(){
          $f().play();
        });
      });   
        
    
      $('#bubble-callouts #bubbles div.bubble .bubble-text').css('text-indent', '-900px');
     	$('#bubble-callouts #bubbles div.bubble').hover(
     	  //on hover
        function(){ 
          $(this).children('h3').addClass('bubble-hover');
          for (i=1; i<=3; i++){
            if ($(this).hasClass('bubble'+i)) {
              $(this).parents('div.callout-row .panels-flexible-row-inside').css('background', 'url(\'' + Drupal.settings.theme.theme_path + '/images/callouts_bubble'+i+'.gif\') no-repeat'); 
              $(this).children('.bubble-text').css('text-indent', '0');
            }
          }
        },
        //On mouse leave
        function(){ 
         $(this).parents('div.callout-row .panels-flexible-row-inside').css('background', ''); 
         $(this).children('.bubble-text').css('text-indent', '-900px');
         $(this).children('h3').removeClass('bubble-hover');
        }
      );

    
    

    }
  };
})(jQuery);



(function ($) {
  Drupal.behaviors.re_accordion = {
    attach: function(context){

      var selector = Drupal.settings.re_accordion.selector ? Drupal.settings.re_accordion.selector : '.region-accordion-blocks',
          //defaults = {},
          settings = $.extend({}, Drupal.settings.re_accordion);

      $(selector).accordion(settings);
    }
  };
})(jQuery);;

