$(document).ready(function() {
	$("#services").tabs("#services td.pane", {
		tabs: 'td.bt', 
		effect: 'horizontal'
	});
	
	var api = $("#services").data("tabs");
	
	var activeTab = Math.max(0,$("#services").attr("rel"));
	if(activeTab > 0)
		api.click(activeTab);
	
	api.onBeforeClick(function(index) {
		$("img", api.getCurrentTab()).attr("src", "/images/upload/services/" + api.getCurrentTab().attr("id") + ".gif");
	});
	
	api.onClick(function(index) {
		$("img", api.getCurrentTab()).attr("src", "/images/upload/services/" + api.getCurrentTab().attr("id") + "_a.gif");
	});
});
