| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130 |
- <public:component lightweight="true">
- <public:attach event="onmouseover" onevent="on()"/>
- <public:attach event="onmouseout" onevent="off()"/>
- <public:attach event="onresize" onevent="resetTabBar()"/>
- <public:attach event="onclick" onevent="down()"/>
- <public:attach event="ondocumentready" onevent="load()"/>
- <public:attach event="onkeyup" onevent="Key()"/>
- <public:event id="eventChange" name="onchange"/>
- <public:event id="eventAfterChange" name="onafterchange"/>
- <public:method name="down"/>
- <public:property name="CurrentTab" get="GetCurrentTab"/>
- <public:property name="CurrentTabContent" get="GetCurrentTabContent"/>
- <script language="JavaScript">
- var _oTab;
- function load()
- {
- var tab;
- for (var i = 0; i < this.cells[0].children.length; i++)
- {
- tab = this.cells[0].children[i];
- if (tab.className == "tab tabOn")
- {
- down(tab, true);
- return;
- }
- }
- down(this.cells[0].firstChild, true);
- }
- function Key()
- {
- if (event.keyCode == 13)
- {
- event.srcElement.click();
- }
- }
- function down(oTab, bForce)
- {
- var o = (oTab) ? oTab : event.srcElement;
- if (this.parentElement.document.readyState != "complete" && !bForce)
- {
- return;
- }
- if (o.className == "tab" || !_oTab)
- {
- hrGlowTab.style.display = "none";
- var oEvent = createEventObject();
- oEvent.tab = o;
- oEvent.tabContent = window.document.all(o.tabid);
- eventChange.fire(oEvent);
- if (oEvent.allowSwitch == false)
- {
- return;
- }
- o.className = "tab tabOn";
- show(hrSelectedTab,o);
- window.document.all(o.tabid).style.display = "inline";
-
- if (_oTab)
- {
- _oTab.className = "tab";
- window.document.all(_oTab.tabid).style.display = "none";
- }
- _oTab = o;
- eventAfterChange.fire(oEvent);
- }
- }
- function on()
- {
- if(event.srcElement.id != "hrSelectedTab" && event.srcElement.tagName == "SPAN")
- {
- show(hrGlowTab,event.srcElement);
- }
- }
- function off()
- {
- hrGlowTab.style.display = "none";
- }
- function resetTabBar()
- {
- hrSelectedTab.style.display="none";
- var o = GetCurrentTab();
- o.className = "tab tabOn";
- show(hrSelectedTab,o);
- }
- function show(oShow, o)
- {
- try
- {
- with (oShow.style)
- {
- left = o.offsetLeft + 1;
- width = o.offsetWidth - 2;
- display = "inline";
- }
- var expression = "document.all[\"" + o.id + "\"].offsetTop - 4";
- oShow.style.setExpression("top", expression);
- }
- catch(e)
- {}
- }
- function GetCurrentTab()
- {
- return _oTab;
- }
- function GetCurrentTabContent()
- {
- return window.document.all(_oTab._imgs);
- }
- </script>
- </public:component>
|