function JMenuTab(pWidth,pHeight,pBody){var self=this;var width=pWidth||"100%";var height=pHeight;this.titleHeight=24;var oOutline=null;var oTitleOutline=null;var oPageOutline=null;var oTitleArea=null;var oPageArea=null;var tabArray=new Array();this.activedTab=null;this.onTabChange=new Function();var $=function(pObjId){return document.getElementById(pObjId);}
var body=$(pBody)||document.body;var htmlObject=function(pTagName){return document.createElement(pTagName);}
var isRate=function(pRateString){if(!isNaN(pRateString))return false;if(pRateString.substr(pRateString.length-1,1)!="%")
return false;if(isNaN(pRateString.substring(0,pRateString.length-1)))
return false;return true;}
var createOutline=function(){var width_=isRate(width)?width:(!isNaN(width)?width+"px":"100%");oOutline=htmlObject("DIV");body.appendChild(oOutline);oOutline.style.width=width_;}
this.setSkin=function(pSkin){oOutline.id=pSkin;}
var createTitleOutline=function(){oTitleOutline=htmlObject("DIV");oOutline.appendChild(oTitleOutline);oTitleOutline.className="oTitleOutline";var vTable=htmlObject("TABLE");oTitleOutline.appendChild(vTable);vTable.width="100%";vTable.border=0;vTable.cellSpacing=0;vTable.cellPadding=0;var vTBody=htmlObject("TBODY");vTable.appendChild(vTBody);var vTr1=htmlObject("TR");vTBody.appendChild(vTr1);var vTdTopLeft=htmlObject("TD");vTr1.appendChild(vTdTopLeft);vTdTopLeft.height=self.titleHeight;vTdTopLeft.className="oTopLeft";oTitleArea=htmlObject("TD");vTr1.appendChild(oTitleArea);oTitleArea.className="oTitleArea";var vTdTopRight=htmlObject("TD");vTr1.appendChild(vTdTopRight);vTdTopRight.className="oTopRight";}
this.setTitleHeight=function(pHeight){}
var tabBtn_click=function(){self.setActiveTab(this.index);}
var tabBtn_mouseover=function(){if(this.className=="oTabBtnActive")
return;this.className="oTabBtnHover";}
var tabBtn_mouseout=function(){if(this.className=="oTabBtnActive")
return;this.className="oTabBtn";}
var createTabBtn=function(pLabel,pTabPage){var vTabBtn=htmlObject("DIV");oTitleArea.appendChild(vTabBtn);vTabBtn.className="oTabBtn";vTabBtn.index=tabArray.length;vTabBtn.label=pLabel;vTabBtn.tabPage=pTabPage;vTabBtn.onclick=tabBtn_click;vTabBtn.onmouseover=tabBtn_mouseover;vTabBtn.onmouseout=tabBtn_mouseout;tabArray.push(vTabBtn);var vTabBtnL=htmlObject("DIV");vTabBtn.appendChild(vTabBtnL);vTabBtnL.className="oTabBtnLeft";vTabBtnC=htmlObject("DIV");vTabBtn.appendChild(vTabBtnC);vTabBtnC.className="oTabBtnCenter";vTabBtnC.innerHTML=pLabel;vTabBtnR=htmlObject("DIV");vTabBtn.appendChild(vTabBtnR);vTabBtnR.className="oTabBtnRight";}
var createPageOutline=function(){oPageOutline=htmlObject("DIV");oOutline.appendChild(oPageOutline);oPageOutline.className="oPageOutline";var vTable=htmlObject("TABLE");oPageOutline.appendChild(vTable);vTable.width="100%";vTable.border=0;vTable.cellSpacing=0;vTable.cellPadding=0;vTable.style.borderCollapse="collapse";vTable.style.tableLayout="fixed";var vTBody=htmlObject("TBODY");vTable.appendChild(vTBody);var vTr1=htmlObject("TR");vTBody.appendChild(vTr1);var vTdBottomLeft=htmlObject("TD");vTr1.appendChild(vTdBottomLeft);vTdBottomLeft.className="oBottomLeft";vTdBottomLeft.rowSpan=2;oPageArea=htmlObject("TD");vTr1.appendChild(oPageArea);oPageArea.className="oPageArea";if(oPageArea.filters)
oPageArea.style.cssText="FILTER: progid:DXImageTransform.Microsoft.Wipe(GradientSize=1.0,wipeStyle=0, motion='forward');";oPageArea.height=10;var vTdBottomRight=htmlObject("TD");vTr1.appendChild(vTdBottomRight);vTdBottomRight.className="oBottomRight";vTdBottomRight.rowSpan=2;var vTr2=htmlObject("TR");vTBody.appendChild(vTr2);var vTdBottomCenter=htmlObject("TD");vTr2.appendChild(vTdBottomCenter);vTdBottomCenter.className="oBottomCenter";}
this.addTab=function(pLabel,pPageBodyId){createTabBtn(pLabel,pPageBodyId);if($(pPageBodyId)){oPageArea.appendChild($(pPageBodyId));$(pPageBodyId).style.display="none";}}
this.setActiveTab=function(pIndex){if(oPageArea.filters)
oPageArea.filters[0].apply();if(self.activedTab!=null){self.activedTab.className="oTabBtn";if($(self.activedTab.tabPage))
$(self.activedTab.tabPage).style.display="none";}
var oldTab=self.activedTab;self.activedTab=tabArray[pIndex];self.onTabChange(oldTab,self.activedTab);self.activedTab.className="oTabBtnActive";if($(self.activedTab.tabPage))
$(self.activedTab.tabPage).style.display="";if(oPageArea.filters)
oPageArea.filters[0].play(duration=1);};this.create=function(){createOutline();createTitleOutline();createPageOutline();}}