jQuery(document).ready(function() {	
	
	/*
	jQuery('.megamenu-slots-columnar').width('910');
	jQuery('.megamenu-slots-columnar').css('width', '910px');*/

	/* Hides the default term listing on taxonomy pages */
	jQuery('.term-listing-heading').siblings().hide();

    /* slideshow on home page */
    jQuery("#slider").tabs({ fx: [{opacity:'toggle', duration:'slow'},                           
                                {opacity:'toggle', duration:'slow'}] }).tabs("rotate", 7000, true).show();
                                
    jQuery("#slider").hover(  
      function() {  
        jQuery("#slider").tabs("rotate",0,true);  
      },  
      function() {  
        jQuery("#slider").tabs("rotate",7000,true);  
      }  
    );   
                             
    /* Tabs slider for home and community pages */
    jQuery("#activity-tabs").tabs({ fx: [{opacity:'toggle', duration:'normal'},                           
                                {opacity:'toggle', duration:'fast'}] }).show(); 
                                
    jQuery("#community-left-tabs").tabs({ fx: [{opacity:'toggle', duration:'normal'},                           
                                {opacity:'toggle', duration:'fast'}] }).show();      
    jQuery("#community-right-tabs").tabs({ fx: [{opacity:'toggle', duration:'normal'},                           
                                {opacity:'toggle', duration:'fast'}] }).show(); 
                                
                                
    //Searchbox in top right: show/hide default text if needed  
	var searchBoxDefault = "Search »";  
	jQuery("#search-block-form #edit-search-block-form--2").attr("value", searchBoxDefault);
	jQuery("#search-block-form #edit-search-block-form--2").blur();  
	  
	jQuery("#search-block-form #edit-search-block-form--2").focus(function(){  
		
       if(jQuery(this).attr("value") == searchBoxDefault) 
		
		 jQuery(this).attr("value", ""); 
		
		 // This removes the invisible class when you start typing
		 jQuery("#edit-name-autocomplete-aria-live").removeClass("element-invisible").addClass("visible"); 
		
	});  
	
	jQuery("#search-block-form #edit-search-block-form--2").blur(function(){  
		if(jQuery(this).attr("value") == "") {
			jQuery(this).attr("value", searchBoxDefault);
		}  	
		jQuery("#edit-name-autocomplete-aria-live").removeClass("visible").addClass("element-invisible"); 
		
	});  	

	jQuery('#search-block-form #edit-search-block-form--2').bind('keypress', function(e) {		
		if(e.keyCode==13){
		   jQuery('#search-block-form').submit();			
		}
	}); 

     // Put in some loading text into the colorbox
     // TODO: this isnt exactly working as we want
     jQuery("#cboxLoadingOverlay").append("<div class='cbox-loading-text'>We are loading the content from its original site, which might take a few seconds. Please bear with us...</div>")

     // Open the feed description
     jQuery(".feed-desc-open-link").click(function() {  
        jQuery(this).parent().parent().siblings(".feed-description").show('slow');  
     }); 
     
     // Open the audio player
     jQuery(".audio-show").click(function() {  
        jQuery(this).parent().parent().siblings(".audio-wrapper").show('slow');  
     }); 
     
     jQuery("#block-views-users-display-videoblock .audio-show").click(function() {  
        jQuery(this).siblings(".audio-wrapper").show('slow');  
     });
     
     
     // For taxonomy page, lets rewrite some text
     jQuery("body.page-taxonomy h1:contains('Meditation classes')").html("Free meditation classes");
     jQuery("#taxonomy-page h2:contains('Members interested in Meditation classes')").html("Meet some of our class givers:");
                
    

});




;

