// ! -- jQuery Common Functions --
// --------------------------------------------
	
	$(document).ready(function(){
		
		// ! hide & expand the sections in #right_col
		$('#right_col ul.cal').each(function(){
			$(this).find('li:first').remove();
		});
		
		$('#right_col h4').each(function(event) {
			$(this).next().hide();
			$(this).click(function(){
				$(this).next().slideToggle('slow');
			});
		});
		
		
		// ! show the available tags upon request
		$('.available_tags code').hide();
		$('.available_tags a').click(function(){
			$('.available_tags code').slideToggle();
			return false;
		});
		
		
		// ! find the tallest col and make main_col that height
		var left_col = $('#left_col').height();
		var right_col = $('#right_col').height();
		var main_col = $('#main_content').height();
		
		var array = new Array(left_col, right_col, main_col);
		var tallest = Math.max.apply(Math, array);
		
		$('#main_content').css('height', tallest+'px');
		
		
		// ! textareas and text inputs
		$("input[type=text], textarea").focus(function(){
		    this.select();
		});
		
		
		// popup window
		$('a.popup').click(function(){
			window.open(this.href);
			return false;
    	});
	
	});