var $j = jQuery.noConflict();

$j(function() {

	// show/hide navigation menu
    $j("#navigate").hide();
    $j("#menu-button").click(function(){
        $j("#navigate").stop().slideToggle(500);
        return false;
    });
    
	// show/hide comments
	$j("#commentlist").hide();
	$j("h3.comments").click(function(){
		$j("#commentlist").slideToggle(500);
		return false;
	});
	// show/hide latest comments - front page
	$j(".infopanel.recentcomments ul").hide();
	$j(".infopanel.recentcomments h3").click(function(){
		$j(".infopanel.recentcomments ul").slideToggle(500);
		return false;
	});
	// show/hide tagcloud
	$j(".infopanel .tagcloudpanel").hide();
	$j(".infopanel.tagcloud h3").click(function(){
		$j(".infopanel .tagcloudpanel").slideToggle(500);
		return false;
	});


    
    $j('ul.listing ul.wp-tag-cloud li').each(function() {
    
    	var filmcount = $j('a', this).attr('title').replace(' topic', '').replace('s', '');
    	$j(this).append(' ('+filmcount+')');

  	});
  	
 	// http://keith-wood.name/countdown.html
  	var studioLaunch = new Date(); 
	studioLaunch = new Date(studioLaunch.getFullYear(), 9 - 1, 15);
	
	$j('#countdown').countdown({until: studioLaunch, timezone: -17});
//	$j('#defaultCountdown').expiryText("We're Going Live! Stand by &hellip;");
	
/*	
	var newYear = new Date(); 
newYear = new Date(newYear.getFullYear() + 1, 1 - 1, 1); 
$('#defaultCountdown').countdown({until: newYear}); 
 
$('#removeCountdown').toggle(function() { 
        $(this).text('Re-attach'); 
        $('#defaultCountdown').countdown('destroy'); 
    }, 
    function() { 
        $(this).text('Remove'); 
        $('#defaultCountdown').countdown({until: newYear}); 
    } 
);
  	
 */ 	

});
