var tabCss = "TabCSS"; //tabCss 样式
			var tabSelectedCss = "current"; //导航栏被选中后样式
			var tabContentCss = "WaitContentCss";		//相应导航栏内容框样式
			var tabShowContentCss = "";				//保留

			var defaultShowIndex = 1;				//设置默认选中索引
			var currentTab ;
			
			var autoSwitchTabID = 0;			//当前导航栏数组的索引
			var tabIDs = new Array(1,2,3,4);		//在这里设置不断轮循的Tab的索引
			var autoSwitchActive = false;			//设置是否启动自动轮循
			var autoSwitchInteral = 0;			//轮循间隔时间，1000为一秒
			var autoTimeOut = 0;				//单个显示的延时



		$(document).ready(function() {
		
                        AutoSwitchTab();
			$("#tab>ul>li").addClass(tabCss);	//为导航栏添加样式
			$("."+tabContentCss).css("display","none"); //将所有内容隐藏
			var timerID = null;
			
			$("#tab>ul>li[@id=tab_"+defaultShowIndex+"]").addClass(tabSelectedCss); //选中默认导航栏
			ShowContentByIndex(defaultShowIndex);
			
			if(autoSwitchActive == true)
			{
				var timer= window.setInterval(AutoSwitchTab,autoSwitchInteral); 
			}

			$("#tab>ul>li").click( function()   //导航栏单击事件
			{ 
				if(autoSwitchActive == true)
				{
					window.clearInterval(timer);
				}
				currentTab = this;
				setTimeout("TabSelected()", autoTimeOut);
			} );
			
			$("#tab>ul>li").mouseover(function() 
			{ 
				if(autoSwitchActive == true)
				{
					window.clearInterval(timer);
				}
				currentTab = this;
				timerID = setTimeout("TabSelected()", autoTimeOut);
			} );
			
			$("#tab>ul>li").mouseout(function()
			{
				if(autoSwitchActive == true)
				{
					window.clearInterval(timer);
				}
				if (timerID) {
					clearTimeout(timerID);
					timerID = null;
				}
			});
			
		});
		
		//设置选中导航栏样式，与未选中导航栏样式
		function TabSelected()
		{
			$("#tab>ul>li").removeClass();//清除样式
			$("#tab>ul>li").addClass(tabCss);//添加未选中样式
			//$(tab).hide();
			$(currentTab).addClass(tabSelectedCss);//设置选中样式
			//$(tab).show("slow");
			
		/*	var index = $(currentTab).attr("id").split('_')[1];//取选中索引
			ShowContentByIndex(index)
*/
		}
		
		function ShowContentByIndex(index)
		{
			//alert($("#tabContent_"+tabID).get());
			var content = $("#tabContent_"+index).html();//读取相应版块内容
			$("#tabContent").html(content);//显示内容
		}


		function AutoSwitchTab()
		{
			currentTab = $("#tab_"+tabIDs[autoSwitchTabID]);
			setTimeout("TabSelected()", autoTimeOut);
			if(autoSwitchTabID <tabIDs.length-1)
			{
				autoSwitchTabID ++;
			}
			else
			{
				autoSwitchTabID = 0;
			}
		}