	YL_MenuBar={
		menuid:"",
		menus:null,
		menusLength:0,
		menuSmalls:null,
		defaultIndex:0,
		defaultIndexSmall:0,
		curcss:"cur",
		nobr:"nobr",
		$:function(menuid)
		{
			return document.getElementById(menuid);
		},
		setMenu:function(menuid,curindex,bigrq,smallrq,curcss,nobrcss)
		{
			var tempObj,tcurb,tcurs;
			tcurb=0;
			tcurs=0;
			//拆分处理当前链接索引
			if (curindex.toString().indexOf(".")>-1) //当存在“.”时表示有子分类选定
			{
				var curAry=	curindex.split(".");
				tcurb=parseInt(curAry[0]);
				if (curAry.length>1 && curAry[1]!="")
				{
					tcurs=parseInt(curAry[1]);
				}
				
			}else
			{
				tcurb=parseInt(curindex);
			}
			
			this.defaultIndex=tcurb;
			this.defaultIndexSmall=tcurs;
			this.curcss=curcss?curcss:this.curcss;
			this.nobr=nobrcss?nobrcss:this.nobr;
			this.menus=this.$(menuid).getElementsByTagName(bigrq);
			this.menusLength=this.menus.length;
			this.menuSmalls=new Array();
			for(i=0;i<this.menusLength;i++)
			{
				tempObj=this.menus[i].getElementsByTagName("ul")[0];
				if (tempObj)
				{
					tempObj.style.display="none";
				}
				//if (tempObj!="undefined")
				//{
				//	tempObj.thisIndex=i;
				//	tempObj.onmouseover=function(){YL_MenuBar.overMenu(this.thisIndex)};
				//	tempObj.onmouseout=function(){YL_MenuBar.outMenu()};
				//}
				this.menuSmalls[i]=!tempObj?null:tempObj;
				//加入事件，和索引属性
				this.menus[i].thisIndex=i+1;
				this.menus[i].onmouseover=function(){YL_MenuBar.overMenu(this.thisIndex)};
				this.menus[i].onmouseout=function(){YL_MenuBar.outMenu()};
			}
			this.overMenuAll(this.defaultIndex,true);
			if (this.defaultIndex>0 && this.menus[this.defaultIndex-1])
			{
				var curliObjs = this.menus[this.defaultIndex-1].getElementsByTagName("li");
				
				if (curliObjs && curliObjs.length>=this.defaultIndexSmall && this.defaultIndexSmall>0)
				{
					curliObjs[this.defaultIndexSmall-1].className="cur";
				}
			}
		},
		overMenuAll:function(index,isload)
		{
			for(i=0;i<this.menusLength;i++)
			{
				if (this.menuSmalls[i])
				{
					this.menuSmalls[i].style.display="none";
				}
			this.menus[i].className="";
			}
			index--;
			if (index>-1)
			{
				this.menus[index].className=this.curcss;
				if (this.menuSmalls[index])
				{
					if(!isload)
					{
					this.menuSmalls[index].style.display="block";}
				}
				if (index<this.menusLength-1)
				{
					this.menus[index+1].className=this.nobr;
				}
				if (index!=0)
				{
					this.menus[0].className=this.nobr;
				}
			}
		}
		,
		overMenu:function(index)
		{
			this.overMenuAll(index,false)
		},
		outMenu:function()
		{
			this.overMenuAll(this.defaultIndex,true);
		}
	}
