function
tabPanel(param){
var
defaultIndex=param[
"default"
]||,
panelobj=param[
"panel"
],
defalutClass=param[
"defalutStyle"
]||
""
,
hoverClass=param[
"hoverStyle"
]||
"hover"
,
currentIndex=defaultIndex,
menus=_$(panelobj).getElementsByTagName(
"ul"
)[].getElementsByTagName(
"li"
),
contents=_$(panelobj).getElementsByTagName(
"ul"
)[].getElementsByTagName(
"li"
),
menuNumber=menus.length,
hidden=
"hidden"
;
for
(
var
i=;i<menuNumber;i++){
_setClass(contents[],hoverClass);
_setClass(contents[i],hidden);
_setClass(menus[i],defalutClass);
(
function
(i){
menus[i].onmouseover=
function
(){
var
old=menus[currentIndex];
_setClass(old,defalutClass);
_setClass(contents[currentIndex],hidden);
var
cur=menus[i];
_setClass(cur,hoverClass);
currentIndex=i;
_setClass(contents[i],
""
);
};
})(i);
}
_setClass(menus[currentIndex],hoverClass);
_setClass(contents[currentIndex],
""
);
function
_setClass(obj,className){obj.className=className}
function
_$(oid){
return
typeof
(oid) ==
"string"
&
#63;document.getElementById(oid):oid}
}