
var JsTab=function(_count,_onClass,_offClass,_titlePre)
{
    this.count=_count;
    this.onClass=_onClass;
    this.offClass=_offClass;
    this.titlePre=_titlePre;
    //this.contentPre=_contentPre;
    
    this.init=function()
    {
        for(var i=0;i<this.count;i++)
        {   
            var _this=this;
            document.getElementById(_titlePre+i).index=i;
            document.getElementById(_titlePre+i).onmouseover=function()
            {
                if(this.className==_this.offClass)
                {
                    this.className=_this.onClass;
                    for(var j=0;j<_this.count;j++)
                    {
                        if(j!=this.index)
                        {
                            document.getElementById(_this.titlePre+j).className=_this.offClass;
                        }
                    }
                    
                }
            }
			document.getElementById(_titlePre+i).onmouseout=function()
			{
				//alert('sdfsafsadfsadff');

                    for(var j=0;j<_this.count;j++)
                    {
                        document.getElementById(_this.titlePre+j).className=_this.offClass;
                    }
					document.getElementById(_this.titlePre+0).className=_this.onClass;
				
			}
        }
    }
}


