
function showArticleTab(no) {
	var tabs = jQuery('#tabs div.tab_content');
	var triggers = jQuery('#tabs img.article_menu_trigger');
	
	var src = jQuery(triggers[no]).attr('src');

	if (src.match(/_hover.gif$/)) return;
	
	triggers.each(function(index, obj){
		var s = jQuery(this).attr('src');
		jQuery(this).attr('src', s.replace(/_hover\.gif$/, '.gif'));
	});
	
	tabs.hide(0);
	
	jQuery(tabs[no]).show(0);													
	jQuery(triggers[no]).attr('src', src.replace(/\.gif$/, '_hover.gif'));
}



jQuery(document).ready(function(){
	jQuery('#menu_left img.left_menu_trigger').click(function(ev) {
		var menu = jQuery(ev.currentTarget).parent().find('ul');							
		if (menu.is(':visible')) return;
		jQuery('#menu_left ul').hide(0);
		jQuery('#menu_left img.left_menu_trigger').each(function(index, obj){
			var src = jQuery(obj).attr('src');								
			jQuery(obj).attr('src', src.replace(/_hover\.gif$/, '.gif'));
		});
		
		var srcCurr = jQuery(this).attr('src');
		jQuery(this).attr('src', srcCurr.replace(/\.gif$/, '_hover.gif'));
		menu.show(0);
		
		
	});
	
	
	jQuery('#tabs img.article_menu_trigger').each(function(index, obj) {
		jQuery(this).click(function(ev){
			showArticleTab(index);
		});
	});
	
	showArticleTab(0);
});
/*
 * JQuery Random Plugin
 * 
 * Adds two random number functions to jQuery -
 * one to find a random number and one to find a random number between a max and min limit.
 * 
 * Version 1.0
 * 
 * by Christian Bruun - 23. jan 2009
 * 
 * Like it/use it? Send me an e-mail: rockechris@rockechris.com
 * 
 * License: None. Use and abuse. Comes with no warranty, of course!
 * 
 * 
 * Usage:
 * $.random(int);
 * $.randomBetween(min, max);
 * 
 * Code found at:
 * http://www.merlyn.demon.co.uk/js-randm.htm
 * 
 */
jQuery.extend({
	random: function(X) {
	    return Math.floor(X * (Math.random() % 1));
	},
	randomBetween: function(MinV, MaxV) {
	  return MinV + jQuery.random(MaxV - MinV + 1);
	}
});
