$(window).load(function () {
	//Done doing stuff, show the content

	$('#home_whole_wrapper').removeClass('home_cycle_hide');
	$('#front_cycle').removeClass('hide');
	//$('#container').removeClass('home_loading');
});



jQuery(document).ready(function(){




	jQuery('#front_cycle').cycle({ 
		fx:     'fade', 
		speed:  'slow', 
		fit: 1,
		timeout: 10000,
		containerResize: 1,
		next:   '#next', 
		prev:   '#prev' 
	});

	$("ul#about_tabs").idTabs(); 
	
	jQuery('#about_page_gallery').cycle({ 
		fx:     'fade', 
		speed:  'slow', 
		fit: 1,
		timeout: 6000,
		containerResize: 1,
		next:   '#next', 
		prev:   '#prev',
		after:   onAfterAbout 
	});
	
	function onAfterAbout() {
		var str = jQuery('span.image_caption', this).text();		
			jQuery('#dynoCaption').html(str)		 
	};


		
	
	jQuery('#newsScroll').localScroll();


    jQuery("A[rel='external']").click( function() {
        window.open( $(this).attr('href') );
        return false;
    });
      
    
    jQuery("a.external").click( function() {
        window.open( $(this).attr('href') );
        return false;
    });    
    
    
    
	 $("a[rel='imagebox']").fancybox();
	
	
/*
	function onAfter() {
		var str = jQuery('span.ourmusic_featured_cap', this).text();		
			jQuery('#dynoCaption').html(str)		 
	};
*/




	$('#studiogallery').cycle({ 
    fx:     'fade', 
    speed:  'slow', 
    timeout: 0, 
    next:   '#next', 
    prev:   '#prev',
    startingSlide: 0,
    after:   onAfter,
	 pager:  '#image_pager', 
	 pagerAnchorBuilder: function(idx, slide) { 
     return '<a href="#">&#8226;</a>';		
	 }      
      
	});


	$('#studioA').click(function() { 
	    $('#studiogallery').cycle(0); 
	    return false; 
	}); 
	 
	$('#studioB').click(function() {  
	    $('#studiogallery').cycle(6);  
	    return false;  
	});
	
	$('#liveRoom').click(function() {  
	    $('#studiogallery').cycle(4);  
	    return false;  
	});	
	

	function onAfter() { 
			if ($("img", this).attr("title")=="Studio B") {
				$("li.spacesNav a").removeClass('spacesNavActive');
				$("a#studioB").addClass('spacesNavActive');	
				}
			if ($("img", this).attr("title")=="Studio A") {
				$("li.spacesNav a").removeClass('spacesNavActive');
				$("a#studioA").addClass('spacesNavActive');	
				}
			if ($("img", this).attr("title")=="Live Room") {
				$("li.spacesNav a").removeClass('spacesNavActive');
				$("a#liveRoom").addClass('spacesNavActive');	
				}
			if ($("img", this).attr("title")=="Downtown Music Studios") {
				$("li.spacesNav a").removeClass('spacesNavActive');
				}			
			else {
				
			} 
	}

  	 
 
});
	
	



