function getQueryVariable(v) {
	var u = window.location.search.substring(1);
	var q = u.split('&');
	for(var i=0; i < q.length; i++) {
		var p=q[i].split('=');
		if(p[0] == v) return p[1];
	}
	return false;
}


$(document).ready(function(){
	$('.group_body').hide();

	if(v = getQueryVariable('id')) {
		$('#' + v + ' .group_body').show();
	}

	$('.title_toggle').hover(
		function (){
			$(this).removeClass('off down');
			$(this).addClass('over');
		},function (){
			$(this).removeClass('over down');
			$(this).addClass('off');
		}
	).mousedown(function() {
		$(this).removeClass('off over');
		$(this).addClass('down');
	}).mouseup(function() {
		$(this).removeClass('off down');
		$(this).addClass('over');
	}).click(function() {
		if($(this).hasClass('closed')) {
			$(this).removeClass('closed');
			$(this).addClass('open');
			$(this).siblings('.group_body').show(120);
		}else{
			$(this).removeClass('open');
			$(this).addClass('closed');
			$(this).siblings('.group_body').hide(120);
		}
	});
});
