$(document).ready(function(){
	// left menu functions
	$('#left_menu div').hide();
	$.fn.tagName=function(){return this.get(0).tagName.toLowerCase();}
	function get_val(s){var a=window.location.search.substring(1).split('&');for(i=0;i<a.length;++i){b = a[i].split('=');if(b[0]==s){return b[1];}}return false;}
	$('#left_menu a').click(function(){var next = $(this).next().tagName();if(next=='div'){$(this).next().slideToggle(500);return false;}else{return true;}});
	$('#left_menu a[id='+ get_val('page_id') +'a'+ get_val('record_id') +']').addClass('active').parents().each(function(){
		var tag = $(this).tagName();
		var id = $(this).attr('id');
		if(id == 'left_menu'){ return false;}
		if(tag == 'div'){$(this).show();}
	});
	$('#left_menu a.active').next().show();

	$('a.colorbox').colorbox({maxWidth: '96%',maxHeight: '96%'});
});

