$(function(){

	
	$('.tabholder').each(function(){
	
		if(jQuery(".tab", this).length){
			jQuery(".tab:not(:first)", this).hide();
			jQuery(".tab:first", this).show();
			jQuery(".htabs li:first", this).addClass('active');
			jQuery(".htabs a", this).click(function(){
				obj = this;
				selecttab(obj);
				return false;
			});	
		}
	 
	});
	
 
	
	zebra();

});

function zebra(){
 	$('tr.hilite').removeClass('hilite');
	
	$('table.timetable, table.trainer_list').each(function(){
		$('tr:even', this).addClass('hilite');
  
	});
	 
}


function selecttab(obj){
	pobj = $(obj).parent().parent().parent();

	jQuery(".htabs li.active", pobj).removeClass('active');
	jQuery(obj).parent().addClass('active');
	stringref = jQuery(obj).attr("href").split('#')[1];
	
	id = stringref.substring(4);
	
	
	
	if ($('#top_menu #top_'+id).length == 1){
		$('#top_menu .current').html($('#top_menu .current b').text()).removeClass('current');;
		hl(id);
	}
	
	
	jQuery('.tab:not(#'+stringref+')', pobj).hide();		
	if (jQuery.browser.msie && jQuery.browser.version.substr(0,3) == "6.0") {
		jQuery('.tab#' + stringref, pobj).show();
	} else {
		jQuery('.tab#' + stringref, pobj).fadeIn();		
	}
}

// =fixing png for IE. now you should only add class "png" to show the transparent *.png image in IE6
function PNG(element){
	if (/MSIE (5\.5|6).+Win/.test(navigator.userAgent)){
	var src;
	if (element.tagName=='IMG'){
			if (/\.png$/.test(element.src)){
				src = element.src;
				element.src = "images/t.gif"; // = 1*1px  transparent image and path for it
			}
		}
		else {
			src = element.currentStyle.backgroundImage.match(/url\("(.+\.png)"\)/i)
			if(src){
				src = src[1];
				element.runtimeStyle.backgroundImage="none";
			}
		}
	if (src) element.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "',sizingMethod='scale')";
	}
}