function extendTable (obj_id)
{
	var i = 0;
	$('#' + obj_id + ' tbody').each(function(el){
		i = 0;
		$(this).children('tr').each(function() {
			$(this).removeClass("even");
			$(this).removeClass("odd");
			if (++i%2==0) {
				$(this).addClass("even");
			} else {
				$(this).addClass("odd");
			}
			if ($(this).find('td a').attr('href') && $(this).find('td a').attr('target') != '_blank')
			{
				if (!$(this).hasClass('no-hover'))
				{
					$(this).mouseover(function() {
						$(this).addClass('hover');
					});
					$(this).mouseout(function() {
						$(this).removeClass('hover');
					});
					$(this).click(function(){
						location.href = $(this).find('td a').attr('href');
					});
				}
			}
		});
		if ($(this).hasClass('toggle-content'))
		{
			if ($(this).hasClass('toggle-closed'))
			{
				$(this).hide();
				$('#' + $(this).attr('id') + '_toggler').addClass('toggler-closed');
			} else {
				$(this).show();
				$('#' + $(this).attr('id') + '_toggler').addClass('toggler-opened');
			}
			$('#' + $(this).attr('id') + '_toggler').attr('rel', $(this).attr('id'));
			$('#' + $(this).attr('id') + '_toggler').click(function(){
				if ($(this).hasClass('toggler-closed'))
				{
					$('#' + $(this).attr('rel')).show();
					$(this).removeClass('toggler-closed');
					$(this).addClass('toggler-opened');
				} else {
					$('#' + $(this).attr('rel')).hide();
					$(this).removeClass('toggler-opened');
					$(this).addClass('toggler-closed');
				}
			});
			$('#' + $(this).attr('id') + '_toggler').mouseover(function(){
				$(this).addClass('toggler-hover');
			});
			$('#' + $(this).attr('id') + '_toggler').mouseout(function(){
				$(this).removeClass('toggler-hover');
			});
		}
	});
}

jQuery(document).ready(function(){

	jQuery('.fx-extendTable').each(function(){
		extendTable ($(this).attr('id'));
	});

});

