var DOC_Tabs={tabGroups:[],DOC_Tabs_Info:'make changes to tabs.js first then compact to make this file',addTab:function(strId,strTarget){var strGroupId=strId.split("_")[0];var tabGroupIndex=this.getTabGroupIndex(strGroupId);var tabIndex=strId.split("_")[1];if(tabGroupIndex!=-1){if(tabIndex==0){this.tabGroups[tabGroupIndex].tabs=[{"id":strId,"target":strTarget,"hoverEvent":"","clickEvent":""}];}else{this.tabGroups[tabGroupIndex].tabs.push({"id":strId,"target":strTarget,"hoverEvent":"","clickEvent":""});}return true;}else{return false;}},addTabEvents:function(strGroupId){var tabGroup=this.getTabGroup(strGroupId);if(tabGroup){var arrHoverEvents=tabGroup.hoverEvents.split(",");var arrClickEvents=tabGroup.clickEvents.split(",");var len=tabGroup.tabs.length;for(i=0;i<len;i++){if(arrHoverEvents!=''){tabGroup.tabs[i].hoverEvent=arrHoverEvents[i]+'()';}if(arrClickEvents!=''){tabGroup.tabs[i].clickEvent=arrClickEvents[i]+'()';}}}else{return false;}},addTabGroup:function(strGroupId,arrTabs,strMode,strTarget,strHoverEvents,strClickEvents){if(this.tabGroups.length==0){this.tabGroups=[{"id":strGroupId,"tabs":arrTabs,"mode":strMode,"target":strTarget,"hoverEvents":strHoverEvents,"clickEvents":strClickEvents}];}else{this.tabGroups.push({"id":strGroupId,"tabs":arrTabs,"mode":strMode,"target":strTarget,"hoverEvents":strHoverEvents,"clickEvents":strClickEvents});}},clearAll:function(strGroupId){var tabGroupIndex=this.getTabGroupIndex(strGroupId);var tabs=this.getTabs(strGroupId);if(tabs){var len=tabs.length;for(i=0;i<len;i++){document.getElementById(tabs[i].id).className="";if(this.tabGroups[tabGroupIndex].mode=='standard'){document.getElementById(tabs[i].target).className="hidden";}}}else{return false}},handleAjax:function(strGroupId,strTabId){var tabGroupIndex=this.getTabGroupIndex(strGroupId);if(tabGroupIndex!=-1){var tabGroup=this.tabGroups[tabGroupIndex];var len=tabGroup.tabs.length;for(i=0;i<len;i++){if(tabGroup.tabs[i].id==strTabId){com.reuters.rcom.utils.replaceContent(tabGroup.target,tabGroup.tabs[i].target,null,null);}}}else{return false;}},handleIframe:function(strGroupId,strTabId){var tabGroupIndex=this.getTabGroupIndex(strGroupId);if(tabGroupIndex!=-1){var tabGroup=this.tabGroups[tabGroupIndex];var len=tabGroup.tabs.length;for(i=0;i<len;i++){if(tabGroup.tabs[i].id==strTabId){document.getElementById(tabGroup.target).src=tabGroup.tabs[i].target;}}}else{return false;}},handleShared:function(strGroupId,strTabId){var tabGroupIndex=this.getTabGroupIndex(strGroupId);if(tabGroupIndex!=-1){var tabGroup=this.tabGroups[tabGroupIndex];var len=tabGroup.tabs.length;for(i=0;i<len;i++){if(tabGroup.tabs[i].id==strTabId){com.reuters.rcom.utils.replaceContent(tabGroup.target,'/assets/sharedModuleLoader?view='+tabGroup.tabs[i].target,null,null);}}}else{return false;}},init:function(strGroupId){this.addTabEvents(strGroupId);this.regEvents(strGroupId);},getTabGroup:function(strGroupId){var tabGroupIndex=this.getTabGroupIndex(strGroupId);if(tabGroupIndex!=-1){return this.tabGroups[tabGroupIndex];}else{return false;}},getTabGroupIndex:function(strGroupId){if(strGroupId.indexOf('_')!=-1){strGroupId=this.id.split("_")[0];}var len=this.tabGroups.length;if(len>0){for(var i=0;i<len;i++){if(this.tabGroups[i].id==strGroupId){return i;}}return -1;}else{return -1}},getTabs:function(strGroupId){var tabGroup=this.getTabGroup(strGroupId);if(tabGroup){return tabGroup.tabs;}else{return false;}},regEvents:function(strGroupId){if(this.getTabs(strGroupId)){var tabs=this.getTabs(strGroupId);var len=tabs.length;for(var i=0;i<len;i++){document.getElementById(tabs[i].id).onclick=this.tabOnclick;document.getElementById(tabs[i].id).onmouseover=this.tabMouseover;}}},tabMouseover:function(e){var strGroupId=this.id.split("_")[0];var tabs=DOC_Tabs.getTabs(strGroupId);var len=tabs.length;if(!e)var e=window.event;if(e.button!=2){for(i=0;i<len;i++){if(tabs[i].id==this.id){eval(tabs[i].hoverEvent);}}}},tabOnclick:function(e){var strGroupId=this.id.split("_")[0];var tabGroup=DOC_Tabs.getTabGroup(strGroupId);var strTabMode=tabGroup.mode;var tabs=tabGroup.tabs;var len=tabs.length;if(!e)var e=window.event;if(e.button!=2){DOC_Tabs.clearAll(strGroupId);document.getElementById(this.id).className="current";document.getElementById(this.id).blur();switch(strTabMode){case'frames':DOC_Tabs.handleIframe(strGroupId,this.id);break;case'ajax':DOC_Tabs.handleAjax(strGroupId,this.id);break;case'shared':DOC_Tabs.handleShared(strGroupId,this.id);break;case'standard':var i=this.id.split("_")[1];document.getElementById(tabs[i].target).className="";document.getElementById(tabs[i].target).style.minWidth="1px";break;}for(i=0;i<len;i++){if(tabs[i].id==this.id){eval(tabs[i].clickEvent);}}}}};