function setActive(menu_id) {/*
    $('#main-nav').children('li').each(function() {
        $(this).removeClass('active');
    });
    $('#nav-'+menu_id).addClass('active');*/
}

$(document).ready(function() {
    // Fixtures page
    $('#group-list').hide();
    $('#view-groups').click(function(e) {
        $('#group-list').slideToggle();
		if ($('#view-groups').hasClass('close') != ""){
			$('#view-groups').removeClass('close').html('view groups');
		}else{
			$('#view-groups').addClass('close').html('hide groups');
		}
    });

    // Home page stuff for collapsing news and opening it ...
    $('#home .post').each(function() {
        if($(this).height() > 1700) {
            $(this).append('<span class="hidden">'+$(this).height()+'</span>');
            $(this).css('height', '170px').css('overflow', 'hidden');
        } else {
            $(this).next('.links').children().children('.expand-news').hide();
        }
    });
    $('#home .expand-news').click(function(e) {
        e.preventDefault();
        var expand_elem = $(this);
        var post_id = '#'+$(this).attr('id').replace('expand-', 'newspost-');
        var target_height = $(post_id).children('.hidden').text();
        $(post_id).animate({
            height:"100%"
        }, 1000, function() {
            expand_elem.remove();
            //expand_elem.removeClass('expand-news').addClass('collapse-news');
        });
    });
    // hmm, might need to bind this
    $('.collapse-news').click(function(e) {
        e.preventDefault();
        var expand_elem = $(this);
        var post_id = '#'+$(this).attr('id').replace('expand-', 'newspost-');
        $(post_id).animate({
            height:150
        }, 1000, function() {
        });
    });

	$(".scrollable").scrollable();

	Shadowbox.init();
	
	$('#product_scroller a').click(function(e){
		e.preventDefault();	
		img_href = $(this).find('img').attr('src');
		first_split = img_href.split(".")
		file_type = first_split[1];
		remaining_url = first_split[0];
		second_split_pos = remaining_url.lastIndexOf("_");
		url = remaining_url.substr(0,second_split_pos)
		img_url = url+"."+file_type;
		$('div.main-image img').attr('src',img_url);
		$('#photoatt').html($(this).attr('alt'));
	});

	$('#photoatt').html($('#team-slider a.slideimg:first').attr('alt'));
	
	$("a.cal_prevmonth").click(function(e){
		e.preventDefault();
		$('#cal-slider').animate({
			left: '0px'
		  }, 750, function() {
			// Animation complete.
		  });

	});	
	
	$("a.cal_nextmonth").click(function(e){
		e.preventDefault();
		$('#cal-slider').animate({
			left: '-266px'
		  }, 750, function() {
			// Animation complete.
		  });

	});
	
	
	
});

