
if(typeof Ext=='undefined'){throw('com.dbt.DBT requires Ext library to be included');}
Ext.namespace('com.dbt','com.dbt.view','com.dbt.data','com.dbt.panel','com.dbt.render','com.dbt.control','com.dbt.element');com.dbt.DBT=function(){var urlAry=document.URL.split('/');return{REQEUST_TIMEOUT:60000,EMPTY_LOCATION_INFO:{id:null,name:''},EMPTY_NEWSSOURCE_INFO:{id:null,name:''},EMPTY_URL:'#',_logReader:null,_baseUrl:urlAry[0]+'//'+urlAry[2],_lastNewsDate:new Date(0),removeExtToolbarStyle:function(toolbar){var toolbarEl=toolbar.getEl().child('div.x-toolbar');toolbarEl.setStyle({'background-image':'none','background':'none','border':'0px'});},fly:function(el){return Ext.fly(el,'_dbt');},clearFly:function(){if(Ext.Element._flyweights['_dbt'])
Ext.Element._flyweights['_dbt'].dom=null;},createLogReader:function(){this._logReader=new YAHOO.widget.LogReader(null,{draggable:true});this._logReader.setTitle('DBT Logger');var categories=this._logReader.getCategories().slice(0);var sources=this._logReader.getSources().slice(0);for(var i=0;i<sources.length;i++){this._logReader.hideSource(sources[i]);}},objectToString:function(obj){var str='';for(var v in obj){if(obj.hasOwnProperty(v)){str+=(v+':'+obj[v]+', ');}}
return str;},isChildElement:function(el,ancestorEl){if(!el||!ancestorEl){return false;}
var p=el;while(p){if(p===ancestorEl){return true;}
p=p.parentNode;}
return false;},getPageBaseURL:function(){return this._baseUrl;},getLastNewsDate:function(){return this._lastNewsDate;},hideElement:function(el){if(el){el.setTop('-10000px');el.setLeft('-10000px');}},emptyString:function(str){return(str==null||str.length==0);},smartTruncate:function(str,el,padding,multiline){var maxWidth=el.getWidth()-padding;if(Ext.util.TextMetrics.measure(el,str).width>maxWidth){var truncStringArray=str.split(' ');for(var i=truncStringArray.length;i>0;i--){if(Ext.util.TextMetrics.measure(el,truncStringArray.join(' ')+'...').width<maxWidth){break;}
else truncStringArray=truncStringArray.slice(0,i);}
return truncStringArray.join(' ')+' ...';}else{return str;}}};}();DBT=com.dbt.DBT;Ext.TabPanelItem.prototype.hideAction=function(){this.bodyEl.setStyle('position','absolute');this.bodyEl.setLeft('-20000px');this.bodyEl.setTop('-20000px');}
Ext.TabPanelItem.prototype.showAction=function(){this.bodyEl.setStyle('position','absolute');this.bodyEl.setLeft('');this.bodyEl.setTop('');}
if(typeof Ext=='undefined')
throw('com.dbt.ServiceManager requires Ext library to be included');if(typeof DWRUtil=='undefined'||typeof DBTService=='undefined')
throw('com.dbt.ServiceManager requires DWR files DBTService.js, engine.js and util.js to be included');com.dbt.ServiceManager=function(){var ServiceManagerImpl=function(){this._lastSearches={};this.addEvents({'gottopcandidates':true,'errortopcandidates':true,'gottoptopics':true,'errortoptopics':true,'gotcandidateclips':true,'errorcandidateclips':true,'gottopicclips':true,'errortopicclips':true,'gotexchangesclips':true,'errorexchangeclips':true,'gotdebates':true,'errordebates':true});ServiceManagerImpl.superclass.constructor.call(this);};Ext.extend(ServiceManagerImpl,Ext.util.Observable,{_CANDIDATES_SEARCH:1,_TOPICS_SEARCH:2,_CANDIDATE_CLIPS_SEARCH:3,_TOPIC_CLIPS_SEARCH:4,_EXCHAGE_CLIPS_SEARCH:5,_DEBATES_SEARCH:6,_MAX_CLIPS_NUM:50,getTopCandidates:function(debateId,stateAbbr){var that=this;var searchInfo={debateId:debateId,stateAbbr:stateAbbr,searchGroup:this._CANDIDATES_SEARCH,id:(new Date()).getTime()};this._lastSearches[searchInfo.searchGroup]=searchInfo;DBTService.getTopCandidates(debateId,stateAbbr,this._buildEventHandlersObject(searchInfo,'gottopcandidates','errortopcandidates',that));return searchInfo;},getTopTopics:function(debateId,stateAbbr){var that=this;var searchInfo={debateId:debateId,stateAbbr:stateAbbr,searchGroup:this._TOPICS_SEARCH,id:(new Date()).getTime()};this._lastSearches[searchInfo.searchGroup]=searchInfo;DBTService.getTopTopics(debateId,stateAbbr,this._buildEventHandlersObject(searchInfo,'gottoptopics','errortoptopics',that));return searchInfo;},getDebates:function(){var that=this;var searchInfo={searchGroup:this._DEBATES_SEARCH,id:(new Date()).getTime()};this._lastSearches[searchInfo.searchGroup]=searchInfo;DBTService.getDebates(this._buildEventHandlersObject(searchInfo,'gotdebates','errordebates',that));return searchInfo;},getClipsForCandidate:function(candidateId,debateId,stateAbbr){return this._getClips(candidateId,null,null,debateId,stateAbbr,this._CANDIDATE_CLIPS_SEARCH,{success:'gotcandidateclips',error:'errorcandidateclips'});},getClipsForTopic:function(topicId,debateId,stateAbbr){return this._getClips(null,topicId,null,debateId,stateAbbr,this._TOPIC_CLIPS_SEARCH,{success:'gottopicclips',error:'errortopicclips'});},getExchangeClips:function(){return this._getClips(null,null,true,null,null,this._EXCHAGE_CLIPS_SEARCH,{success:'gotexchangeclips',error:'errorexchageclips'});},cancelSearch:function(searchInfo){if(this._lastSearches[searchInfo.searchGroup].id===searchInfo.id){this._lastSearches[searchInfo.searchGroup]={id:null};}},getClassName:function(){return'com.dbt.ServiceManager';},_getClips:function(candidateId,topicId,onlyExchange,debateId,stateAbbr,searchGroup,events){var that=this;var searchInfo;searchInfo={searchGroup:searchGroup,candidateId:candidateId,topicId:topicId,onlyExchange:onlyExchange,stateAbbr:stateAbbr,debateId:debateId,id:(new Date()).getTime()};this._lastSearches[searchInfo.searchGroup]=searchInfo;DBTService.getClips(candidateId,topicId,onlyExchange,debateId,stateAbbr,this._MAX_CLIPS_NUM,this._buildEventHandlersObject(searchInfo,events.success,events.error,that));return searchInfo;},_resultsHandler:function(results,callbackObj){if(callbackObj.scope._isLastSearch(callbackObj.searchInfo.searchGroup,callbackObj.searchInfo.id)){callbackObj.scope._deleteSearchGroup(callbackObj.searchInfo.searchGroup);if(callbackObj.event!=null){callbackObj.scope.fireEvent(callbackObj.event,results,callbackObj.searchInfo);}}},_errorHandler:function(errorString,exception,callbackObj){if(callbackObj.scope._isLastSearch(callbackObj.searchInfo.searchGroup,callbackObj.searchInfo.id)){callbackObj.scope._deleteSearchGroup(callbackObj.searchInfo.searchGroup);if(callbackObj.event!=null){callbackObj.scope.fireEvent(callbackObj.event,errorString,callbackObj.searchInfo);}}},_isLastSearch:function(searchGroup,searchId){return this._lastSearches[searchGroup].id===searchId;},_deleteSearchGroup:function(searchGroup){delete this._lastSearches[searchGroup];},_buildEventHandlersObject:function(searchInfo,event,errorEvent,scope){return{callback:function(results){scope._resultsHandler(results,{searchInfo:searchInfo,event:event,scope:scope});},exceptionHandler:function(errorString,exception){scope._errorHandler(errorString,exception,{searchInfo:searchInfo,event:errorEvent,scope:scope});},errorHandler:function(errorString,exception){scope._errorHandler(errorString,exception,{searchInfo:searchInfo,event:errorEvent,scope:scope});}}}});return new ServiceManagerImpl();}();ServiceManager=com.dbt.ServiceManager;if(typeof Ext=='undefined')
throw('com.dbt.render.AbstractRenderer requires Ext library to be included');com.dbt.render.AbstractRenderer=function(){};com.dbt.render.AbstractRenderer.prototype={_nodeIdPrefix:'',getNodeIdPrefix:function(){return this._nodeIdPrefix;},render:function(data){return'';},renderSelected:function(node){var nodeEl=DBT.fly(node);nodeEl.addClass(this._selectedClass);DBT.clearFly();},renderDeselected:function(node){var nodeEl=DBT.fly(node);nodeEl.removeClass(this._selectedClass);DBT.clearFly();},renderExpand:function(node,expandElement){return node;},renderCollapse:function(node,collapseElement){return node;}};if(typeof Ext=='undefined')
throw('com.dbt.render.CandidateRenderer requires Ext library to be included');com.dbt.render.CandidateRenderer=function(){com.dbt.render.CandidateRenderer.superclass.constructor.call(this);this._containerClass='candidate-bar-container'
this._selectedClass='candidate-bar-container-selected';this._scoreBarClass='candidate-bar-score';this._scoreBarTextClass='candidate-bar-name';this._nodeIdPrefix='CAND';var tpl='<div id="{id}" class="'+this._containerClass+'">'+'<div class="'+this._scoreBarClass+' {partyClass}" style="width:{width}%">'+'<div class="'+this._scoreBarTextClass+'">{name}</div>'+'</div>'+'</div>';this._tpl=new Ext.DomHelper.Template(tpl);this._tpl.compile();};Ext.extend(com.dbt.render.CandidateRenderer,com.dbt.render.AbstractRenderer,{_partyClasses:{R:'candidate-bar-score-republican',D:'candidate-bar-score-democrat',O:'candidate-bar-score-other'},render:function(candidate){var nodeEl=this._tpl.apply({id:this.getNodeIdPrefix()+candidate.id,partyClass:this._partyClasses[candidate.politicalParty],width:candidate.score*100,name:candidate.name});return nodeEl;}});if(typeof Ext=='undefined')
throw('com.dbt.render.DebateRenderer requires Ext library to be included');com.dbt.render.DebateRenderer=function(){com.dbt.render.DebateRenderer.superclass.constructor.call(this);this._containerClass='debate-container'
this._selectedClass='debate-container-selected';this._debateNameClass='debate-name';this._fieldTitleClass='debate-field-title';this._fieldContentClass='debate-field-content';this._nodeIdPrefix='DEBATE';var tpl='<div id="{id}" class="'+this._containerClass+'">'+'<div><span class ="'+this._debateNameClass+'">{name}</span></div>'+'<div>'+'<span class ="'+this._fieldTitleClass+'">Aired: </span>'+'<span class ="'+this._fieldContentClass+'">{date:date("M d, Y")} - {station}</span>'+'</div>'+'<div>'+'<span class ="'+this._fieldTitleClass+'">Location: </span>'+'<span class ="'+this._fieldContentClass+'">{city}, {state}</span>'+'</div>'+'<div>'+'<span class ="'+this._fieldTitleClass+'">Party: </span>'+'<span class ="'+this._fieldContentClass+'">{party}</span>'+'</div>'+'</div>';this._tpl=new Ext.DomHelper.Template(tpl);this._tpl.compile();};Ext.extend(com.dbt.render.DebateRenderer,com.dbt.render.AbstractRenderer,{_POLITICAL_PARTIES_LOOKUP:{D:'Democratic',R:'Republican'},render:function(debate){var nodeEl=this._tpl.apply({id:this.getNodeIdPrefix()+debate.id,name:debate.name,date:debate.date,station:debate.station.name,city:debate.city,state:debate.state,party:this._POLITICAL_PARTIES_LOOKUP[debate.politicalParty]});return nodeEl;}});if(typeof Ext=='undefined')
throw('com.dbt.render.SubTopicRenderer requires Ext library to be included');com.dbt.render.SubTopicRenderer=function(){com.dbt.render.SubTopicRenderer.superclass.constructor.call(this);this._containerClass='sub-topic-bar-container'
this._selectedClass='sub-topic-bar-container-selected';this._scoreBarClass='sub-topic-bar-score';this._scoreBarTextClass='sub-topic-bar-name';this._nodeIdPrefix='SUBT';var tpl='<div id="{id}" class="'+this._containerClass+'">'+'<div class="'+this._scoreBarClass+'" style="width:{width}%">'+'<div class="'+this._scoreBarTextClass+'">{title}</div>'+'</div>'+'</div>';this._tpl=new Ext.DomHelper.Template(tpl);this._tpl.compile();};Ext.extend(com.dbt.render.SubTopicRenderer,com.dbt.render.AbstractRenderer,{render:function(subtopic){var nodeEl=this._tpl.apply({id:this.getNodeIdPrefix()+subtopic.id,width:subtopic.score*100,title:subtopic.title});return nodeEl;}});if(typeof Ext=='undefined')
throw('com.dbt.render.TopicRenderer requires Ext library to be included');com.dbt.render.TopicRenderer=function(){com.dbt.render.TopicRenderer.superclass.constructor.call(this);this._containerClass='topic-bar-container'
this._selectedClass='topic-bar-container-selected';this._scoreBarClass='topic-bar-score';this._scoreBarTextClass='topic-bar-name';this._expandClass='topic-expand-topic';this._subTopicsContainerClass='topic-subtopics-container'
this._nodeIdPrefix='TOPC';var tpl='<div id="{id}" class="'+this._containerClass+'">'+'<div class="'+this._expandClass+' view-expand view-cursor">{expand}</div>'+'<div class="'+this._scoreBarClass+'" style="width:{width}%">'+'<div class="'+this._scoreBarTextClass+'">{title}</div>'+'</div>'+'</div>'+'<div class="'+this._subTopicsContainerClass+' view-mask-click"></div>';this._tpl=new Ext.DomHelper.Template(tpl);this._tpl.compile();};Ext.extend(com.dbt.render.TopicRenderer,com.dbt.render.AbstractRenderer,{render:function(topic){var expandTopic='';if(topic.subTopics&&topic.subTopics.length>0){expandTopic='[+]';}
var nodeEl=this._tpl.apply({id:this.getNodeIdPrefix()+topic.id,expand:expandTopic,width:topic.score*100,title:topic.title});return nodeEl;},getRelatedContainer:function(node){return DBT.fly(node).getNextSibling();},renderExpand:function(node,expandElement){this._renderExpandCollapse(expandElement,/\+/g,' - ');},renderCollapse:function(node,collapseElement){this._renderExpandCollapse(collapseElement,/ \- /g,'+');},_renderExpandCollapse:function(element,regExp,replaceStr){var text=element.innerHTML.replace(regExp,replaceStr);DBT.fly(element).update(text);DBT.clearFly();}});if(typeof Ext=='undefined')
throw('com.dbt.render.RelatedClipRenderer requires Ext library to be included');com.dbt.render.RelatedClipRenderer=function(){com.dbt.render.RelatedClipRenderer.superclass.constructor.call(this);this._containerClass='related-clip-container'
this._selectedClass='related-clip-container-selected';this._clipNameClass='related-clip-name';this._fieldTitleClass='related-clip-field-title';this._fieldContentClass='related-clip-field-content';com.dbt.render.RelatedClipRenderer.count++;this._nodeIdPrefix='CLIP'+com.dbt.render.RelatedClipRenderer.count;var tpl='<div id="{id}" class="'+this._containerClass+'">'+'<div><span class ="'+this._clipNameClass+'">{name}</span></div>'+'<div>'+'<span class ="'+this._fieldTitleClass+'">Aired: </span>'+'<span class ="'+this._fieldContentClass+'">{clipDate:date("M d, Y")} - {station}</span>'+'</div>'+'<div>'+'<span class ="'+this._fieldTitleClass+'">Debate: </span>'+'<span class ="'+this._fieldContentClass+'">{debateName} - {debateCity}, {debateState}</span>'+'</div>'+'</div>';this._tpl=new Ext.DomHelper.Template(tpl);this._tpl.compile();};Ext.extend(com.dbt.render.RelatedClipRenderer,com.dbt.render.AbstractRenderer,{render:function(clip){var nodeEl=this._tpl.apply({id:this.getNodeIdPrefix()+clip.id,name:clip.name,clipDate:clip.date,station:clip.station.name,debateName:clip.debate.name,debateCity:clip.debate.city,debateState:clip.debate.state});return nodeEl;}});com.dbt.render.RelatedClipRenderer.count=0;if(typeof Ext=='undefined')
throw('com.dbt.element.RadioButton requires Ext library to be included');com.dbt.element.RadioButton=function(config,container){com.dbt.element.RadioButton.superclass.constructor.call(this);Ext.apply(this,config);this.addEvents({'selected':true});if(!container){container=DBT.fly(document.createElement('span'));}
this.render(container);}
Ext.extend(com.dbt.element.RadioButton,Ext.util.Observable,{baseClass:'radio-button-base',hoveredClass:'radio-button-hovered',selectedClass:'radio-button-selected',deselectedClass:'radio-button-deselected',selected:false,buttonText:'',value:'',radioGroup:null,btnTpl:'<div class="{initClass}">{buttonText}</div>',el:null,render:function(containerEl){var btnTemplate=new Ext.DomHelper.Template(this.btnTpl);btnTemplate.compile();var initClass=this.baseClass;if(this.selected){initClass+=' '+this.selectedClass;}
else{initClass+=' '+this.deselectedClass;}
this.el=btnTemplate.append(containerEl,{buttonText:this.buttonText,initClass:initClass},true);com.dbt.element.RadioButtonMgr.register(this);this.el.addListener('click',this._onSelect,this);if(this.hoveredClass){this.el.addClassOnOver(this.hoveredClass);}
return this.el;},select:function(preventEvent){if(this.selected){return;}
this.el.replaceClass(this.deselectedClass,this.selectedClass);if(!preventEvent){this.fireEvent('selected',this,this.value);}
this.selected=true;},deselect:function(){if(!this.selected){return;}
this.el.replaceClass(this.selectedClass,this.deselectedClass);this.selected=false;},destroy:function(){com.dbt.element.RadioButtonMgr.unregister(this);this.el.removeAllListeners();this.purgeListeners();this.el.remove();},_onSelect:function(){this.select();}});com.dbt.element.RadioButtonMgr=function(){var groups={};function _manageGroup(radioBtn){var grp=groups[radioBtn.radioGroup];for(var i=0,l=grp.length;i<l;i++){if(grp[i]!==radioBtn){grp[i].deselect();}}}
return{register:function(radioBtn){if(!radioBtn.radioGroup){return;}
var grp=groups[radioBtn.radioGroup];if(!grp){grp=groups[radioBtn.radioGroup]=[];}
grp.push(radioBtn);radioBtn.on('selected',_manageGroup);},unregister:function(radioBtn){if(!radioBtn.radioGroup){return;}
var grp=groups[radioBtn.radioGroup];if(grp){grp.remove(radioBtn);radioBtn.un('selected',_manageGroup);}},setSelectedButton:function(radioBtn){radioBtn.select(true);_manageGroup(radioBtn);}};}();if(typeof Ext=='undefined')
throw('com.dbt.view.View requires Ext library to be included');com.dbt.view.View=function(container,renderer,config){this._el=Ext.get(container);this._renderer=renderer;Ext.apply(this,config);if(!(this.expandEnabled&&this.expandClass&&this.collapseClass)){this.expandEnabled=false;}
this._selected=null;this._expanded=null;this._nodes=[];var bodyClasses='view-body';if(this.nodesContainerClass){bodyClasses+=' ';bodyClasses+=this.nodesContainerClass;}
var layout='<div class="view-topbar"></div>'+'<div class="'+bodyClasses+'"></div>'+'<div class="view-bottombar"></div>';this._el.update(layout);this._headerPanel=this._el.child('div.view-topbar');this._footerPanel=this._el.child('div.view-bottombar');this._bodyPanel=this._el.child('div.view-body');this._bodyPanel.on('click',this._onClick,this);if(this.ds){this.setDataStore(this.ds,true);}
this.addEvents({'nodeclick':true,'select':true,'nodeexpand':true,'nodecollapse':true,'nodedelete':true});com.dbt.view.View.superclass.constructor.call(this);};Ext.extend(com.dbt.view.View,Ext.util.Observable,{hoveredClass:'view-hovered',nodesContainerClass:null,maskClickClass:'view-mask-click',expandClass:'view-expand',collapseClass:'view-collapse',expandEnabled:true,maskSelectClass:'view-mask-select',enableDefaultEventClass:'view-enable-default-event',enableReselection:false,ds:null,cursorClass:'view-cursor',_NO_CONTENT:'',destroy:function(){this.clearState();this._removeNodesListeners();if(this.ds){this.ds.un('datachanged',this.refresh);this.ds.un('clear',this.refresh);}
this._headerPanel.removeAllListeners();this._headerPanel.update(this._NO_CONTENT);this._headerPanel.remove();this._headerPanel=null;this._nodes=[];this._bodyPanel.removeAllListeners();this._bodyPanel.update(this._NO_CONTENT);this._bodyPanel.remove();this._bodyPanel=null;this._footerPanel.removeAllListeners();this._footerPanel.update(this._NO_CONTENT);this._footerPanel.remove();this._footerPanel=null;this._el.update('');this._el=null;this.purgeListeners();},getEl:function(){return this._el;},getHeaderPanel:function(doShow){if(doShow){this._headerPanel.show();}
return this._headerPanel;},getFooterPanel:function(doShow){if(doShow){this._footerPanel.show();}
return this._footerPanel;},autoSize:function(){var height=this._el.getHeight(true);var width=this._el.getWidth(true);var headerHeight=0;var footerHeight=0;if(this._headerPanel.isVisible()){this._headerPanel.setWidth(width);headerHeight=this._headerPanel.getHeight();}
if(this._footerPanel.isVisible()){this._footerPanel.setWidth(width);footerHeight=this._footerPanel.getHeight();}
this._bodyPanel.setHeight(height-headerHeight-footerHeight);this._bodyPanel.setWidth(width);this._bodyPanel.setStyle('overflow-y','auto');},refresh:function(){this.clearSelection(true);this._removeNodesListeners();this._nodes=[];this._bodyPanel.update('');var html=[];var records=this.ds.getRange();if(records.length<1){this._bodyPanel.update(this._NO_CONTENT);this._nodes=[];return;}
for(var i=0,len=records.length;i<len;i++){html[html.length]=this._renderer.render(records[i].data);}
this._bodyPanel.update(html.join(''));this._nodes=this._bodyPanel.dom.childNodes;this._scrollToTop();this._restoreNodesState();this._addHoverEventAndCursorToNodes();DBT.clearFly();},refreshAllNodes:function(){for(var i=0,len=this._nodes.length;i<len;i++){DBT.fly(this._nodes[i]).removeClass('view-dummy').addClass('view-dummy');}},setDataStore:function(ds,initial){if(!initial&&this.ds){this.ds.un('add',this.refresh);this.ds.un('datachanged',this.refresh);this.ds.un('clear',this.refresh);}
if(ds){ds.on('add',this.refresh,this);ds.on('datachanged',this.refresh,this);ds.on('clear',this.refresh,this);}
this.ds=ds;this.refresh();},clearSelection:function(keepSelected){if(this._nodes&&this._selected!==null){this._renderer.renderDeselected(this._selected);DBT.fly(this._selected).addClass(this.cursorClass);DBT.clearFly();if(!keepSelected){this._selected=null;}}},clearState:function(){this._expanded=null;this._selected=null;},isSelected:function(nodeInfo){return(this._selected!==null&&this.getNode(nodeInfo).id==this._selected.id);},selectNode:function(nodeInfo,adjustPosition){var node=this.getNode(nodeInfo);if(node&&(this.enableReselection||!this.isSelected(node))){var nodeTop=node.offsetTop;var bodyDOM=this._bodyPanel.dom;var nodeVirtualTop=nodeTop-bodyDOM.scrollTop;this.clearSelection();this._selectNode(node);DBT.fly(node).removeClass(this.cursorClass);DBT.clearFly();if(adjustPosition&&nodeTop>node.offsetTop){var newScrollTop=node.offsetTop-nodeVirtualTop;this._bodyPanel.scroll('up',bodyDOM.scrollTop-newScrollTop);}
this.refreshAllNodes();this.fireEvent('select',this._selected);}},getExpanded:function(){return this._expanded;},getNode:function(nodeInfo){if(typeof nodeInfo=='string'){return document.getElementById(nodeInfo);}
return nodeInfo;},scrollToNode:function(nodeInfo){var node=this.getNode(nodeInfo);if(node){var bodyDOM=this._bodyPanel.dom;var nodeVirtualTop=node.offsetTop-bodyDOM.scrollTop;if(nodeVirtualTop>0){this._bodyPanel.scroll('down',nodeVirtualTop,true);}else{this._bodyPanel.scroll('up',-nodeVirtualTop,true);}}},_addHoverEventAndCursorToNodes:function(){var ns=this._nodes;for(var i=0,len=ns.length;i<len;i++){var nodeEl=DBT.fly(ns[i])
nodeEl.addClassOnOver(this.hoveredClass,true);nodeEl.addClass(this.cursorClass);}},_removeNodesListeners:function(){var ns=this._nodes;for(var i=0,len=ns.length;i<len;i++){DBT.fly(ns[i]).removeAllListeners();}},_onClick:function(e){var node=this._findNodeFromChild(e.getTarget());if(node){this._onNodeClick(node,e);this.fireEvent('nodeclick',node,e.getTarget());}
DBT.clearFly();},_findNodeFromChild:function(el){var bodyEl=this._bodyPanel.dom;if(!el){return el;}
var p=el;while(p&&p!=bodyEl){if(DBT.fly(p).hasClass(this.maskClickClass)){return null;}
if(p.parentNode==bodyEl){return p;}
p=p.parentNode;}
return null;},_onNodeClick:function(node,e){var t=e.getTarget();if(this._clickedOnExpand(t)){if(this._expanded){var nodeTop=node.offsetTop;var bodyDOM=this._bodyPanel.dom;var nodeVirtualTop=nodeTop-bodyDOM.scrollTop;this._onNodeCollapsed(this._expanded,this._findExpandElement(this._expanded,this.collapseClass));if(nodeTop>node.offsetTop){var newScrollTop=node.offsetTop-nodeVirtualTop;this._bodyPanel.scroll('up',bodyDOM.scrollTop-newScrollTop);}}
this._onNodeExpand(node,t);}else if(this._clickedOnCollapse(t)){this._onNodeCollapsed(node,t);}else if(!this._maskedSelectElement(t)){this.selectNode(node,true);}
if(this.enableDefaultEventClass&&!DBT.fly(t).hasClass(this.enableDefaultEventClass)){e.preventDefault();}
return true;},_clickedOnExpand:function(target){return(this.expandEnabled&&DBT.fly(target).hasClass(this.expandClass));},_clickedOnCollapse:function(target){return(this.expandEnabled&&DBT.fly(target).hasClass(this.collapseClass));},_maskedSelectElement:function(target){return(this.maskSelectClass&&DBT.fly(target).hasClass(this.maskSelectClass));},_onNodeExpand:function(node,target){this._renderer.renderExpand(node,target);DBT.fly(target).replaceClass(this.expandClass,this.collapseClass);this._expanded=node;this.fireEvent('nodeexpand',node);},_onNodeCollapsed:function(node,target){this._renderer.renderCollapse(node,target);DBT.fly(target).replaceClass(this.collapseClass,this.expandClass);this._expanded=null;this.fireEvent('nodecollapse',node);},_scrollToTop:function(){this._bodyPanel.scroll('up',this._bodyPanel.dom.scrollTop);},_restoreNodesState:function(){if(this._hasStateInfo()){for(var i=0,len=this._nodes.length;i<len;i++){var node=this._nodes[i];var updated=false;if(this._expanded!=null&&this._expanded.id===node.id){this._onNodeExpand(node,this._findExpandElement(node,this.expandClass));updated=true;}
if(this.isSelected(node)){this._selectNode(node);updated=true;}
if(!updated){DBT.fly(node).removeClass('view-dummy').addClass('view-dummy');}}}},_hasStateInfo:function(){return(this._selected!=null||this._expanded!=null);},_selectNode:function(node){this._renderer.renderSelected(node);this._selected=node;},_findExpandElement:function(node,elClass){var target=DBT.fly(node).query('.'+elClass);return target[0];}});if(typeof Ext=='undefined')
throw('com.dbt.panel.AbstractPanel requires Ext library to be included');com.dbt.panel.AbstractPanel=function(container,preventAutoSize){this._el=Ext.get(container);var viewConfig={nodesContainerClass:this._nodesContainerClass,ds:this._getDataStore()};if(this._viewAdditionalConfig){Ext.apply(viewConfig,this._viewAdditionalConfig);}
this._view=new com.dbt.view.View(this._el,this._renderer,viewConfig);this._view.on('select',function(node){var itemId=node.id.substr(this._renderer.getNodeIdPrefix().length);var itemRecord=this._ds.getById(itemId);if(!itemRecord){throw('Could not find clicked item data. id:'+itemId);}else{this.fireEvent('itemselected',itemId,itemRecord);}},this);this.addEvents({'itemselected':true});this._addTopToolbar();if(!preventAutoSize){this._view.autoSize();}
com.dbt.panel.AbstractPanel.superclass.constructor.call(this);};Ext.extend(com.dbt.panel.AbstractPanel,Ext.util.Observable,{_hoveredClass:'',_nodesContainerClass:'',_renderer:new com.dbt.render.AbstractRenderer(),_viewAdditionalConfig:{},_autoSelectFirst:false,_recordDef:Ext.data.Record.create([]),_el:null,_ds:null,_view:null,_RESULTS_ROOT:'results',_RESULTS_TOTAL_FIELD:'count',_ITEM_ID_FIELD:'id',getEl:function(){return this._el;},clearSelection:function(){this._view.clearSelection();},setResults:function(results,searchInfo){if(results&&results.length>0){this._adjustResults(results);this._updateDataStore(results);}else{this._updateDataStore([]);}},hide:function(){},show:function(){},_getDataStore:function(){if(!this._ds){this._initDataStore();}
return this._ds;},_updateDataStore:function(results){this._view.clearState();var data={};data[this._RESULTS_ROOT]=results;data[this._RESULTS_TOTAL_FIELD]=results.length;this._ds.loadData(data);if(this._autoSelectFirst&&this._ds.getTotalCount()>0){var firstItemId=this._ds.getAt(0).get(this._ITEM_ID_FIELD);this._view.selectNode(this._renderer.getNodeIdPrefix()+firstItemId);}},_initDataStore:function(){var reader=new Ext.data.JsonReader({root:this._RESULTS_ROOT,id:this._ITEM_ID_FIELD,totalProperty:this._RESULTS_TOTAL_FIELD},this._recordDef);this._ds=new Ext.data.Store({reader:reader});},_addTopToolbar:function(){},_adjustResults:function(results){}});if(typeof Ext=='undefined')
throw('com.dbt.panel.CandidatesPanel requires Ext library to be included');com.dbt.panel.CandidatesPanel=function(container){this._renderer=new com.dbt.render.CandidateRenderer();this._recordDef=Ext.data.Record.create([{name:'id'},{name:'name'},{name:'politicalParty'},{name:'score'}]);com.dbt.panel.CandidatesPanel.superclass.constructor.call(this,container);};Ext.extend(com.dbt.panel.CandidatesPanel,com.dbt.panel.AbstractPanel,{_renderer:null,_autoSelectFirst:true,_recordDef:null,_adjustResults:function(results){var maxClipsLength=results[0].clipsLength;var minClipsLength=results[results.length-1].clipsLength;var range=maxClipsLength-minClipsLength;for(var i=0;i<results.length;i++){var result=results[i];result.score=((result.clipsLength-minClipsLength)/range)*0.9+0.1;}}});if(typeof Ext=='undefined'){throw('com.dbt.panel.DebatesPanel requires Ext library to be included');}
com.dbt.panel.DebatesPanel=function(container){this._renderer=new com.dbt.render.DebateRenderer();this._recordDef=Ext.data.Record.create([{name:'id'},{name:'name'},{name:'date'},{name:'politicalParty'},{name:this._STATE_FIELD},{name:'city'},{name:'station'}]);com.dbt.panel.DebatesPanel.superclass.constructor.call(this,container);};Ext.extend(com.dbt.panel.DebatesPanel,com.dbt.panel.AbstractPanel,{_STATE_FIELD:'state',_showAllBtn:null,_renderer:null,_recordDef:null,filterByState:function(state){this._view.clearSelection();this._ds.clearFilter(true);this._ds.filter(this._STATE_FIELD,state);},clearStateFilter:function(){this._view.clearSelection();this._ds.clearFilter();}});if(typeof Ext=='undefined'){throw('com.dbt.panel.DebateLocatorPanel requires Ext library to be included');}
if(typeof SWFObject=='undefined'){throw('com.dbt.panel.DebateLocatorPanel requires swfobject.js to be included');}
com.dbt.panel.DebateLocatorPanel=function(container){this._el=Ext.get(container);var tabsContainerId=this._el.id+'tabs';var firstTabId=tabsContainerId+'A';var secondTabId=tabsContainerId+'B';var layout='<div id="debate-locator-title" class="filters-title">'+'<span class="title-text filters-title-text">Debate Locator:</span>'+'</div>'+'<div id ="'+tabsContainerId+'" class="debate-locator-content-tabs">'+'<div id ="'+firstTabId+'" class="debate-locator-tab-panel"></div>'+'<div id ="'+secondTabId+'" class="debate-locator-tab-panel">'+'<div class="debate-locator-debates-map"></div>'+'</div>'+'</div>'+'<div class="debate-locator-elections-info">'+'<div>Election Countdown:</div>'+'<div class="debate-locator-days-left"></div>'+'</div>';this._el.update(layout);this._tabPanel=new Ext.TabPanel(tabsContainerId,true);this._tabPanel.addTab(firstTabId,this._DEBATES_LIST_TAB_TEXT);this._tabPanel.addTab(secondTabId,this._MAP_TAB_TEXT).activate();this._titleEl=this._el.child('div.filters-title');var tabsEl=this._el.child('div.x-tabs-body');var debateMapTabEl=Ext.get(secondTabId);this._debatesMapEl=debateMapTabEl.child('div.debate-locator-debates-map');var electionsInfoEl=this._el.child('div.debate-locator-elections-info');var infoTop=this._titleEl.getHeight()+tabsEl.getHeight()+3;electionsInfoEl.setTop(infoTop+'px');this._setDaysUntillElections(electionsInfoEl.child('div.debate-locator-days-left'));this._initDebateLocatorMap();this._debatesPanel=new com.dbt.panel.DebatesPanel(firstTabId);this._debatesPanel.on('itemselected',this._onDebateSelected,this);this.addEvents({'stateselected':true,'debateselected':true,'getdebates':true,'resettoalldebates':true});com.dbt.panel.DebateLocatorPanel.superclass.constructor.call(this);};Ext.extend(com.dbt.panel.DebateLocatorPanel,Ext.util.Observable,{_el:null,_DEBATES_LIST_TAB_TEXT:'list',_MAP_TAB_TEXT:'map',_MAP_SWF_ID:'map',_MAP_SWF_OBJECT:'/dbt/swf/map.swf',_SET_STATES_METHOD:'loadMapArray',_ELECTIONS_DATE:'11/04/2008',_DAYS_LEFT_FOR_ELECTIONS_STR:' days until election day.',getEl:function(){return this._el;},setDebates:function(debates){var statesLookup={};var statesArray=[];for(var i=0;i<debates.length;i++){var debate=debates[i];if(debate.state&&!statesLookup[debate.state]){statesArray.push(debate.state);statesLookup[debate.state]=true;}}
document[this._MAP_SWF_ID].loadMapArray(statesArray);this._debatesPanel.setResults(debates);},_stateSelected:function(stateAbbr){this.fireEvent('stateselected',stateAbbr);this._debatesPanel.filterByState(stateAbbr);},_requestMapArray:function(){this.fireEvent('getdebates');},_resetToAllDebates:function(){this._debatesPanel.clearStateFilter();this.fireEvent('resettoalldebates');},_onDebateSelected:function(debateId,debateRecord){this.fireEvent('debateselected',debateId);},_initDebateLocatorMap:function(){var mapSWFUrl=DBT.getPageBaseURL()+this._MAP_SWF_OBJECT;var randAppID=new Date().getTime()%1000000;var mapSWF=new SWFObject(mapSWFUrl,this._MAP_SWF_ID,'100%','100%','8','#000000');mapSWF.addVariable('randAppID',randAppID);mapSWF.write(this._debatesMapEl.id);stateSelected=stateSelected.createInterceptor(this._stateSelected,this);requestMapArray=requestMapArray.createInterceptor(this._requestMapArray,this);getAllStates=getAllStates.createInterceptor(this._resetToAllDebates,this);},_setDaysUntillElections:function(el){var electionDay=new Date(this._ELECTIONS_DATE);var elapsed=electionDay.getElapsed(new Date());var elapsedDays=Math.floor(elapsed/(24*60*60*1000));el.update(elapsedDays+this._DAYS_LEFT_FOR_ELECTIONS_STR);}});function stateSelected(stateAbbr){};function requestMapArray(){};function getAllStates(){};if(typeof Ext=='undefined')
throw('com.dbt.panel.SubTopicPanel requires Ext library to be included');com.dbt.panel.SubTopicPanel=function(container){this._renderer=new com.dbt.render.SubTopicRenderer();this._recordDef=Ext.data.Record.create([{name:'id'},{name:'title'},{name:'score'}]);com.dbt.panel.SubTopicPanel.superclass.constructor.call(this,container,true);};Ext.extend(com.dbt.panel.SubTopicPanel,com.dbt.panel.AbstractPanel,{_renderer:null,_recordDef:null,_viewAdditionalConfig:{hoveredClass:'sub-topic-hovered'},reset:function(){this.setResults([]);}});if(typeof Ext=='undefined')
throw('com.dbt.panel.TopicsPanel requires Ext library to be included');com.dbt.panel.TopicsPanel=function(container){this._renderer=new com.dbt.render.TopicRenderer();this._recordDef=Ext.data.Record.create([{name:'id'},{name:'title'},{name:'subTopics'},{name:'score'}]);com.dbt.panel.TopicsPanel.superclass.constructor.call(this,container);var footer=this._view.getFooterPanel();this._subTopicsPanel=new com.dbt.panel.SubTopicPanel(footer.createChild({tag:'div',id:'subtopicspanel'}));this._subTopicsPanel.reset();this._subTopicsPanel.on('itemselected',function(subtopicId,subtopicRecord){this.clearSelection();this.fireEvent('itemselected',subtopicId,subtopicRecord);},this);this._view.on('nodeexpand',this._onTopicExpand,this);this._view.on('nodecollapse',this._onTopicCollapse,this);this._view.on('select',function(){this._subTopicsPanel.clearSelection();},this);};Ext.extend(com.dbt.panel.TopicsPanel,com.dbt.panel.AbstractPanel,{_renderer:null,_autoSelectFirst:true,_recordDef:null,_adjustResults:function(results){var maxClipsLength=results[0].clipsLength;var minClipsLength=results[results.length-1].clipsLength;var range=maxClipsLength-minClipsLength;for(var i=0;i<results.length;i++){var topic=results[i];topic.score=((topic.clipsLength-minClipsLength)/range)*0.9+0.1;if(topic.subTopics){for(var j=0;j<topic.subTopics.length;j++){var subTopic=topic.subTopics[j];subTopic.score=(subTopic.clipsLength/topic.clipsLength)*topic.score-0.05;}}}},_onTopicExpand:function(node){var topicId=node.id.substr(this._renderer.getNodeIdPrefix().length);var topic=this._ds.getById(topicId);var subTopicsEl=DBT.fly(this._renderer.getRelatedContainer(node));subTopicsEl.appendChild(this._subTopicsPanel.getEl());subTopicsEl.applyStyles('display:block');DBT.clearFly();this._subTopicsPanel.setResults(topic.get('subTopics'));this._view.refreshAllNodes();this._view.autoSize();},_onTopicCollapse:function(node){DBT.fly(this._renderer.getRelatedContainer(node)).applyStyles('display:none');DBT.clearFly();this._view.getFooterPanel().appendChild(this._subTopicsPanel.getEl());this._subTopicsPanel.reset();}});if(typeof Ext=='undefined')
throw('com.dbt.panel.RelatedClipsPanel requires Ext library to be included');com.dbt.panel.RelatedClipsPanel=function(container){this._renderer=new com.dbt.render.RelatedClipRenderer();this._recordDef=Ext.data.Record.create([{name:'id'},{name:'name'},{name:'debate'},{name:'date'},{name:this._TYPE_FIELD},{name:'station'}]);com.dbt.panel.RelatedClipsPanel.superclass.constructor.call(this,container);};Ext.extend(com.dbt.panel.RelatedClipsPanel,com.dbt.panel.AbstractPanel,{_TYPE_FIELD:'type',_defaultFilterBtn:null,_renderer:null,_recordDef:null,_autoSelectFirst:true});com.dbt.panel.RelatedClipsPanel.filterGroupCounter=0;if(typeof Ext=='undefined')
throw('com.dbt.panel.ClipsPanel requires Ext library to be included');if(typeof SWFObject=='undefined'){throw('com.dbt.panel.ClipsPanel requires swfobject.js to be included');}
com.dbt.panel.ClipsPanel=function(container){this._el=Ext.get(container);var tabsContainerId=this._el.id+'tabs';var firstTabId=tabsContainerId+'A';var secondTabId=tabsContainerId+'B';var layout='<div class="clip-name"></div>'+'<div id ="'+tabsContainerId+'" class="clip-content-tabs">'+'<div id ="'+firstTabId+'" class="clip-tab-panel"></div>'+'<div id ="'+secondTabId+'" class="clip-tab-panel">'+'<div class="clip-player"></div>'+'</div>'+'</div>'+'<div class="clip-info"></div>';this._el.update(layout);this._clipNameEl=this._el.child('div.clip-name');this._clipInfoEl=this._el.child('div.clip-info');this._clipPlayerTabEl=Ext.get(secondTabId);this._clipPlayerEl=this._clipPlayerTabEl.child('div.clip-player');var infoTpl='<div>Location: {city}, {state}</div>'+'<div>Aired: {clipDate:date("M d, Y")} - {station}</div>'
this._infoTpl=new Ext.DomHelper.Template(infoTpl);this._infoTpl.compile();this._tabsPanel=new Ext.TabPanel(tabsContainerId,true);this._tabsPanel.addTab(firstTabId,this._OTHER_CLIPS_TAB_TEXT);this._tabsPanel.addTab(secondTabId,this._SELECTED_CLIP_TAB_TEXT).activate();this._relatedClipsPanel=new com.dbt.panel.RelatedClipsPanel(firstTabId);this._relatedClipsPanel.on('itemselected',this._showClip,this);var clipContentTabsEl=this._el.child('div.x-tabs-body');var infoTop=this._clipNameEl.getHeight()+clipContentTabsEl.getHeight()+5;this._clipInfoEl.setTop(infoTop+'px');com.dbt.panel.ClipsPanel.superclass.constructor.call(this);};Ext.extend(com.dbt.panel.ClipsPanel,Ext.util.Observable,{_el:null,_settingClipsFlag:false,_currentClipId:null,_CLIP_PLAYER_SWF_OBJECT:"http://media.redlasso.com/xdrive/WEB/vidplayer_1b/redlasso_player_b1b_deploy.swf?swfv=01210801",_OTHER_CLIPS_TAB_TEXT:'all clips',_SELECTED_CLIP_TAB_TEXT:'selected clip',getEl:function(){return this._el;},setClips:function(clips){this._settingClipsFlag=true;if(clips&&clips.length>0){this._relatedClipsPanel.setResults(clips);}else{this._clipNameEl.update('');this._infoTpl.overwrite(this._clipInfoEl,{city:'',state:'',clipDate:'',station:''});this._relatedClipsPanel.setResults([]);}
this._settingClipsFlag=false;},pauseCurrentClip:function(){document[this._currentClipId].pauseVid();},_showClip:function(clipId,clipRecord){this._clipNameEl.update(clipRecord.get('name'));this._currentClipId=clipId;this._writeClipPlayer();if(!this._settingClipsFlag){this._tabsPanel.activate(this._clipPlayerTabEl.id);}
var debate=clipRecord.get('debate');this._infoTpl.overwrite(this._clipInfoEl,{city:debate.city,state:debate.state,clipDate:clipRecord.get('date'),station:clipRecord.get('station').name});},_writeClipPlayer:function(){var clipSWFUrl=this._CLIP_PLAYER_SWF_OBJECT+'&embedId='+this._currentClipId;var randAppID=new Date().getTime()%1000000;var playerSWF=new SWFObject(clipSWFUrl,this._currentClipId,'320','270','8','#000000');playerSWF.addParam('allowScriptAccess','always');playerSWF.addParam('allowFullScreen','false');playerSWF.addParam('wmode','opaque');playerSWF.addVariable('autoPlayBack','true');playerSWF.addVariable('startTime',10);playerSWF.addVariable('endTime',-1);playerSWF.write(this._clipPlayerEl.id);}});com.dbt.control.DBTController={_SELECTED_CLIP_TAB_TEXT:'selected clip',_OTHER_CLIPS_TAB_TEXT:'other clips',_CANDIDATE_TITLE_STR:'Hot Candidate:  ',_TOPIC_TITLE_STR:'Hot Topic:  ',_candidateClipsPanel:null,_candidatesPanel:null,_exchangeClipsPanel:null,_debateLocatorPanel:null,_topicClipsPanel:null,_topicsPanel:null,_candidateTitleEl:null,_topicTitleEl:null,_stateSelected:null,_debateSelected:null,init:function(){this._initLayout();ServiceManager.on('gottopcandidates',this._onGotCandidates,this);ServiceManager.on('gottoptopics',this._onGotTopics,this);ServiceManager.on('gotcandidateclips',this._onGotCandidateClips,this);ServiceManager.on('gottopicclips',this._onGotTopicClips,this);ServiceManager.on('gotexchangeclips',this._onGotExchangeClips,this);ServiceManager.on('gotdebates',this._onGotDebates,this);ServiceManager.getTopCandidates();ServiceManager.getTopTopics();ServiceManager.getExchangeClips();},_onGotCandidates:function(results,searchInfo){this._candidatesPanel.setResults(results,searchInfo);},_onGotCandidateClips:function(results){this._candidateClipsPanel.setClips(results);},_onCandidateSelected:function(id,record){this._candidateTitleEl.update(this._CANDIDATE_TITLE_STR+record.get('name'));ServiceManager.getClipsForCandidate(id,this._debateSelected,this._stateSelected);},_onGotTopics:function(results,searchInfo){this._topicsPanel.setResults(results,searchInfo);},_onGotTopicClips:function(results){this._topicClipsPanel.setClips(results);},_onTopicSelected:function(id,record){this._topicTitleEl.update(this._TOPIC_TITLE_STR+record.get('title'));ServiceManager.getClipsForTopic(id,this._debateSelected,this._stateSelected);},_onGotExchangeClips:function(results){this._exchangeClipsPanel.setClips(results);},_onStateSelected:function(stateAbbr){this._selectDebateOrState(stateAbbr,null);},_onDebateSelected:function(debateId){this._selectDebateOrState(null,debateId);},_onGotDebates:function(debates){this._debateLocatorPanel.setDebates(debates);},_selectDebateOrState:function(stateAbbr,debateId){this._stateSelected=stateAbbr;this._debateSelected=debateId;ServiceManager.getTopCandidates(this._debateSelected,this._stateSelected);ServiceManager.getTopTopics(this._debateSelected,this._stateSelected);},_initLayout:function(){this._candidateTitleEl=Ext.get('candidate-clips-title').child('span.title-text');this._candidateClipsPanel=new com.dbt.panel.ClipsPanel('candidate-clips-container',['7bd12da0-9343-4f67-8a2f-ff665912d306','0de5f3c1-4322-4414-a561-53a6dca92b06','104ffe35-3844-4684-a8b0-d4a077c77413','5ffbe5a5-5fbf-4c05-9c53-b00625f2c999']);this._candidatesPanel=new com.dbt.panel.CandidatesPanel('candidates-container');this._candidatesPanel=new com.dbt.panel.CandidatesPanel('candidates-container2');this._candidatesPanel.on('itemselected',this._onCandidateSelected,this);this._exchangeClipsPanel=new com.dbt.panel.ClipsPanel('exchange-clips-container',['8f8e103c-c756-499e-869f-6dc3dab706d9']);this._debateLocatorPanel=new com.dbt.panel.DebateLocatorPanel('debate-locator-panel');this._debateLocatorPanel.on('getdebates',function(){ServiceManager.getDebates();},this);this._debateLocatorPanel.on('stateselected',this._onStateSelected,this);this._debateLocatorPanel.on('debateSelected',this._onDebateSelected,this);this._debateLocatorPanel.on('resettoalldebates',this._onStateSelected,this);this._topicTitleEl=Ext.get('topic-clips-title').child('span.title-text');this._topicClipsPanel=new com.dbt.panel.ClipsPanel('topic-clips-container',['984cf95f-69c7-4b04-8027-9cd6351f34d1','8f2153e1-3600-4ce9-af3e-e49206bfc1f1','5cadfb0b-14d5-47cc-85a4-5fb87ed1e57a']);this._topicsPanel=new com.dbt.panel.TopicsPanel('topics-container');this._topicsPanel.on('itemselected',this._onTopicSelected,this);}};
