/*
 * Global JavaScript functions
 * 
 */

/*
 * Simpele tab functie middels jQuery 
 * @author: Boye Oomens <boye@e-sites.nl>
 * @required: jQuery (1.3.2)
 * @usage: call initTabs() on DOM ready
 */
var initTabs = function(){
	$('.tabs div.tabContent').hide();
	$('.tabs div.tabContent:first').show();
	$('.tabs ul li:first').addClass('active');
	$('.tabs ul li a').click(function(){
		$('.tabs ul li.active').attr('class','');
		$(this).parent('li').addClass('active');
		var currentTab = $(this).attr('href');
		$('.tabs div.tabContent').hide();
		$(currentTab).show();
		return false;
	});
};

/*
 * Vertical align jQuery plugin
 * @usage: $('div.test img').vAlign;
 */
$.fn.vAlign = function() {
	return this.each(function(i){
		var ah = $(this).height();
		var ph = $(this).parent().height();
		var mh = (ph - ah) / 2;
		$(this).css('margin-top', mh);
	});
};
