
			$(function() {
			
			goo='';
			
			$(".bc_toggle").click( function() {
			
						ident = $(this).attr('ident');
						if(ident==undefined) ident='res';
						res = $(this).attr(ident);
						
						$("a[class='bc_toggle bt_on']["+ident+"]").each( function() {
							$(this).removeClass("bt_on");
							$(this).addClass("bt_off");
						});
			
						$("a[class='bc_toggle bt_on_short']["+ident+"]").each( function() {
							$(this).removeClass("bt_on_short");
							$(this).addClass("bt_off_short");
						});
						
						$("a[class='bc_toggle bt_on_mid']["+ident+"]").each( function() {
							$(this).removeClass("bt_on_mid");
							$(this).addClass("bt_off_mid");
						});
						
						$('a['+ident+'='+res+'][class="bc_toggle bt_off"]').each( function() {
							$(this).removeClass("bt_off");
							$(this).addClass("bt_on");
							
						});
							
						$('a['+ident+'='+res+'][class="bc_toggle bt_off_mid"]').each( function() {
							$(this).removeClass("bt_off_mid");
							$(this).addClass("bt_on_mid");
						});	
							
						$('a['+ident+'='+res+'][class="bc_toggle bt_off_short"]').each( function() { 
							$(this).removeClass("bt_off_short");
							$(this).addClass("bt_on_short"); 
						});		
						
						$("div[id^=bc_]").hide();
						$("div[class^=bc_").hide();
												 
						var sstring = res;
						sstring = '#bc_'+sstring;
						sstring2 = '.bc_'+res;
						
						$(sstring).show(); // might want to change this back to show() if IE causes trouble
			
						if($(sstring).html()==''&&$(this).attr('aload')!='') { 
						aload = $(this).attr('aload');
				
						clearTimeout(goo);
						goo = setTimeout(function () {$(sstring).load('/library/apps/'+aload+'.inc'); }, 500);
						 
						$(sstring).html('<div class="ajax_loading" style="margin-top:50px"></div>');
			} 
				
				
			if($(this).attr('static')!='true') { // static load the href if attribute static=true is set on the tab
				$(sstring+" input:first").focus();
				$(sstring2).show();
				return false;
			}
			
			});
		});
