// JavaScript Document


jQuery(function(){
  jQuery(".menu-name-main-menu li").hover(function(){
    jQuery(this).addClass("hover"); 
  }, function(){
    jQuery(this).removeClass("hover");  
  });
  
  // Removing default value of search box when it's in focus.
  jQuery('#search-block-form .form-text').focus(function() {
    if (this.value == this.defaultValue) {
      this.value = '';
    }
  }).blur(function() {
    if (!this.value.length) {
      this.value = this.defaultValue;
    }
  });
  
  
  
  jQuery(".view-publications #edit-keys-wrapper").each(function(){
	  	$wrapper = jQuery(this);
	  	
		jQuery(".form-item", this).each(function(){
			if(jQuery(".form-text", this).val() != ""){
				jQuery("label", $wrapper).fadeOut("normal");
			} else {
				jQuery("label", $wrapper).show();
			}
		});
		
		jQuery(".form-text", this).focus(function(){
			jQuery("label", $wrapper).fadeOut("normal");
		}).blur(function(){
			if(jQuery(".form-text", $wrapper).val() == ""){
				jQuery("label", $wrapper).fadeIn("normal");
			}
		});
	});
  
    jQuery(".week-view #single-day-container").each(function(){
    	
    	var day = jQuery("td.first .calendar-agenda-hour:eq(6)").position();
    	if(day.top){
    		jQuery(this).scrollTop(day.top);
    	}
    		
    });
});


;

