$(function() {
    $('#sidebar ul.nav .main').click(function() {
	    var next = $(this).next();
		if (next.is(':visible')) {
		    $(this).removeClass('main-active');
		    next.slideUp();
		} else {
			$('#sidebar ul.nav .main').removeClass('main-active').next(':visible').slideUp();
			next.slideDown();
		}
		return false;
	});

	$('#sidebar ul.nav .main-active').next().show();
	$('#sidebar ul.nav a').each(function() {
	    if (location.pathname.indexOf($(this).attr('href')) == 0) {
		    $(this).css('font-weight', 'bold');
		}
	});

    $(".viewflv").click(function() {
       $.fancybox({
         'autoscale' : false,
         'transitionIn' : 'none',
         'transitionOut': 'none',
         'padding' : 0,
         'title'  : this.title,
         'width'  : 500,
         'height' : 399,
         'type'    : 'swf',
         'href'    : this.href,
         'swf'   : { 'wmode':'transparent', 'allowfullscreen':'true' }
       });
       return false;
     });
     
    $(".playmp3").click(function() {
       $.fancybox({
         'autoscale' : false,
         'transitionIn' : 'none',
         'transitionOut': 'none',
         'padding' : 0,
         'title'  : this.title,
         'width'  : 400,
         'height' : 150,
         'type'    : 'swf',
         'href'    : this.href,
         'swf'   : { 'wmode':'transparent', 'allowfullscreen':'true' }
       });
       return false;
     });

});
