
RightNow.Widget.AdvancedSearchDialog=function(data,instanceID){this.data=data;this.instanceID=instanceID;YAHOO.util.Event.addListener("rn_"+this.instanceID+"_TriggerLink","click",this._openDialog,null,this);};RightNow.Widget.AdvancedSearchDialog.prototype={_openDialog:function()
{if(!this._dialog)
{var dialogDiv=document.getElementById("rn_"+this.instanceID+"_DialogContent");if(dialogDiv)
{var buttons=[{text:this.data.attrs.label_search_button,handler:{fn:this._performSearch,scope:this}},{text:this.data.attrs.label_cancel_button,handler:{fn:this._cancelFilters,scope:this}}];this._dialog=RightNow.UI.Dialog.actionDialog(this.data.attrs.label_dialog_title,dialogDiv,{"buttons":buttons,"width":"500px"});YAHOO.util.Dom.addClass(this._dialog.id,"rn_AdvancedSearchDialog");YAHOO.util.Dom.removeClass(dialogDiv,"rn_Hidden");this._dialog.hideEvent.subscribe(function(){var trigger=document.getElementById("rn_"+this.instanceID+"_TriggerLink");if(trigger&&trigger.focus)
trigger.focus();},null,this);}}
this._dialogClosed=false;this._dialog.show();this._dialog.hideEvent.subscribe(this._cancelFilters,null,this);},_performSearch:function()
{this._closeDialog();var eo=new RightNow.Event.EventObject();eo.w_id=this.instanceID;eo.filters={"report_id":this.data.attrs.report_id,"reportPage":this.data.attrs.report_page_url};RightNow.Event.fire("evt_searchRequest",eo);},_cancelFilters:function()
{if(this._dialogClosed)return;this._closeDialog();var eo=new RightNow.Event.EventObject();eo.data={"name":"all"};eo.filters={"report_id":this.data.attrs.report_id};eo.w_id=this.instanceID;RightNow.Event.fire("evt_resetFilterRequest",eo);},_closeDialog:function()
{this._dialogClosed=true;if(this._dialog)
this._dialog.hide();}};
RightNow.Widget.KeywordText2=function(data,instanceID)
{this.data=data;this.instanceID=instanceID;this._eo=new RightNow.Event.EventObject();this._textElement=document.getElementById("rn_"+this.instanceID+"_Text");if(this.data.js.initialValue)
this.data.js.initialValue=this.data.js.initialValue.replace(/&gt;/g,'>').replace(/&lt;/g,'<').replace(/&#039;/g,"'").replace(/&quot;/g,'"');if(this._textElement)
{this._searchedOn=this._textElement.value;if(this._textElement.value!==this.data.js.initialValue)
this._textElement.value=this.data.js.initialValue;this._setFilter();var changeEvent=(YAHOO.env.ua.ie)?"focusout":"change";YAHOO.util.Event.addListener(this._textElement,changeEvent,this._onChange,null,this);RightNow.Event.subscribe("evt_keywordChangedResponse",this._onChangedResponse,this);RightNow.Event.subscribe("evt_reportResponse",this._onChangedResponse,this);RightNow.Event.subscribe("evt_getFiltersRequest",this._onGetFiltersRequest,this);RightNow.Event.subscribe("evt_resetFilterRequest",this._onResetRequest,this);if(this.data.attrs.initial_focus)
this._textElement.focus();}};RightNow.Widget.KeywordText2.prototype={_onChange:function(evt)
{this._eo.data=this._textElement.value;this._eo.filters.data=this._textElement.value;RightNow.Event.fire("evt_keywordChangedRequest",this._eo);},_onGetFiltersRequest:function(type,args)
{this._eo.filters.data=YAHOO.lang.trim(this._textElement.value);this._searchedOn=this._eo.filters.data;RightNow.Event.fire("evt_searchFiltersResponse",this._eo);},_setFilter:function()
{this._eo.w_id=this.instanceID;this._eo.filters={"searchName":this.data.js.searchName,"data":this.data.js.initialValue,"rnSearchType":this.data.js.rnSearchType,"report_id":this.data.attrs.report_id};},_onChangedResponse:function(type,args)
{if(RightNow.Event.isSameReportID(args,this.data.attrs.report_id))
{var data=RightNow.Event.getDataFromFiltersEventResponse(args,this.data.js.searchName,this.data.attrs.report_id),newValue=(data===null)?this.data.js.initialValue:data;if(this._textElement.value!==newValue)
this._textElement.value=newValue;}},_onResetRequest:function(type,args)
{if(RightNow.Event.isSameReportID(args,this.data.attrs.report_id)&&(args[0].data.name===this.data.js.searchName||args[0].data.name==="all"))
{this._textElement.value=this._searchedOn;}}};
RightNow.Widget.SearchTypeList2=function(data,instanceID)
{this.data=data;this.instanceID=instanceID;this._eo=new RightNow.Event.EventObject();this._selectBox=document.getElementById("rn_"+this.instanceID+"_Options");var RightNowEvent=RightNow.Event;RightNowEvent.subscribe("evt_searchTypeResponse",this._onChangedResponse,this);RightNowEvent.subscribe("evt_getFiltersRequest",this._onGetFiltersRequest,this);RightNowEvent.subscribe("evt_reportResponse",this._onChangedResponse,this);RightNowEvent.subscribe("evt_resetFilterRequest",this._onResetRequest,this);YAHOO.util.Event.addListener(this._selectBox,"change",this._onSelectChange,null,this);this._setFilter();this._setSelectedDropdownItem(this.data.js.defaultFilter);};RightNow.Widget.SearchTypeList2.prototype={_onSelectChange:function(evt)
{this._setSelected();RightNow.Event.fire("evt_searchTypeRequest",this._eo);if(this.data.attrs.search_on_select)
{this._eo.filters.reportPage=this.data.attrs.report_page_url;RightNow.Event.fire("evt_searchRequest",this._eo);}},_setSelectedDropdownItem:function(valueToSelect)
{if(this._selectBox)
{for(var i=0,length=this._selectBox.length;i<length;i++)
{if(this._selectBox.options[i].value==valueToSelect)
{this._selectBox.selectedIndex=i;return true;}}}
return false;},_setSelected:function()
{if(this._selectBox)
{var index=this._selectBox.selectedIndex;index=(index>0)?index:0;if(this._selectBox.options[index])
{var selectedOption=this._selectBox.options[index],value=selectedOption.value,label=selectedOption.text,node;for(node in this.data.js.filters)
{if(this.data.js.filters[node].fltr_id==value)
{return this._setSelectedFilter(this.data.js.filters[node],label);}}}}},_setSelectedFilter:function(selected,label)
{this._eo.filters.fltr_id=selected.fltr_id;this._eo.filters.data={"val":selected.fltr_id};if(label)
this._eo.filters.data.label=label;this._eo.filters.oper_id=selected.oper_id;},_setFilter:function()
{this._eo.w_id=this.instanceID;this._eo.filters={"rnSearchType":this.data.js.rnSearchType,"searchName":this.data.js.searchName,"report_id":this.data.attrs.report_id};for(var node in this.data.js.filters)
{if(this.data.js.filters[node].fltr_id===this.data.js.defaultFilter)
{this._setSelectedFilter(this.data.js.filters[node]);break;}}},_onResetRequest:function(type,args)
{if(RightNow.Event.isSameReportID(args,this.data.attrs.report_id)&&(args[0].data.name===this.data.js.searchName||args[0].data.name==="all"))
{this._setSelectedDropdownItem(this.data.js.defaultFilter);this._setFilter();}},_onGetFiltersRequest:function(type,args)
{RightNow.Event.fire("evt_searchFiltersResponse",this._eo);},_onChangedResponse:function(type,args)
{if(RightNow.Event.isSameReportID(args,this.data.attrs.report_id))
{var data=RightNow.Event.getDataFromFiltersEventResponse(args,this.data.js.searchName,this.data.attrs.report_id);this._setSelectedDropdownItem(((data&&data.val)?data.val:this.data.js.defaultFilter));this._setSelected();}}};
RightNow.Widget.WebSearchSort=function(data,instanceID)
{this.data=data;this.instanceID=instanceID;this._eo=new RightNow.Event.EventObject();var optionsName="rn_"+this.instanceID+"_Options";this._searchName="webSearchSort";this._optionsSelect=document.getElementById(optionsName);RightNow.Event.subscribe("evt_sortTypeResponse",this._onChangedResponse,this);RightNow.Event.subscribe("evt_reportResponse",this._onChangedResponse,this);RightNow.Event.subscribe("evt_getFiltersRequest",this._onGetFiltersRequest,this);RightNow.Event.subscribe("evt_resetFilterRequest",this._onResetRequest,this);YAHOO.util.Event.addListener(optionsName,"change",this._onSortChange,null,this);this._setFilter();};RightNow.Widget.WebSearchSort.prototype={_setFilter:function()
{this._eo.w_id=this.instanceID;this._eo.filters.searchName=this._searchName;this._eo.filters.report_id=this.data.js.report_id;this._setDataObject();},_setDataObject:function()
{this._eo.filters.data={"col_id":(this.data.js.sortDefault!=this.data.js.configDefault)?this.data.js.sortDefault:null,"sort_direction":1,"sort_order":1};},_setSelected:function()
{if(this._optionsSelect)
{var num=this._optionsSelect.selectedIndex;num=(num<0)?0:num;if(this._optionsSelect.options[num])
{this._eo.filters.data.col_id=this._optionsSelect.options[num].value;}}},_setSelectedDropdownItem:function(valueToSelect)
{if(this._optionsSelect)
{for(var i=0;i<this._optionsSelect.length;i++)
{if(this._optionsSelect.options[i].value==valueToSelect)
{this._optionsSelect.selectedIndex=i;return true;}}}
return false;},_onSortChange:function(evt)
{this._setSelected();RightNow.Event.fire("evt_sortTypeRequest",this._eo);},_onChangedResponse:function(type,args)
{if(RightNow.Event.isSameReportID(args,this.data.attrs.report_id))
{var data=RightNow.Event.getDataFromFiltersEventResponse(args,this._searchName,this.data.attrs.report_id);var newValue=(!data||data.col_id==null)?this.data.js.sortDefault:data.col_id;if(this._eo.filters.data==null)
this._setDataObject();this._setSelectedDropdownItem(newValue);this._setSelected();}},_onResetRequest:function(type,args)
{if(RightNow.Event.isSameReportID(args,this.data.attrs.report_id)&&(args[0].data.name===this._searchName||args[0].data.name==="all"))
{this._setSelectedDropdownItem(this.data.js.sortDefault);this._setDataObject();}},_onGetFiltersRequest:function(type,args)
{RightNow.Event.fire("evt_searchFiltersResponse",this._eo);}};
RightNow.Widget.WebSearchType=function(data,instanceID)
{this.data=data;this.instanceID=instanceID;this._eo=new RightNow.Event.EventObject();var optionsName="rn_"+this.instanceID+"_Options";this._optionsSelect=document.getElementById(optionsName);this._searchName="webSearchType";RightNow.Event.subscribe("evt_searchTypeResponse",this._onChangedResponse,this);RightNow.Event.subscribe("evt_reportResponse",this._onChangedResponse,this);RightNow.Event.subscribe("evt_getFiltersRequest",this._onGetFiltersRequest,this);RightNow.Event.subscribe("evt_resetFilterRequest",this._onResetRequest,this);YAHOO.util.Event.addListener(optionsName,"change",this._onSearchChange,null,this);this._setFilter();};RightNow.Widget.WebSearchType.prototype={_setFilter:function()
{this._eo.w_id=this.instanceID;this._eo.filters={"searchName":this._searchName,"report_id":this.data.js.report_id,"data":this.data.js.searchDefault};},_setSelected:function()
{if(this._optionsSelect)
{var i=this._optionsSelect.selectedIndex;i=Math.max(0,i);if(this._optionsSelect.options[i])
{this._eo.filters.data=this._optionsSelect.options[i].value;}}},_setSelectedDropdownItem:function(valueToSelect)
{if(this._optionsSelect)
{for(var i=0;i<this._optionsSelect.length;i++)
{if(this._optionsSelect.options[i].value==valueToSelect)
{this._optionsSelect.selectedIndex=i;return true;}}}
return false;},_onSearchChange:function(evt)
{this._setSelected();RightNow.Event.fire("evt_searchTypeRequest",this._eo);},_onChangedResponse:function(type,args)
{if(RightNow.Event.isSameReportID(args,this.data.attrs.report_id))
{var data=RightNow.Event.getDataFromFiltersEventResponse(args,this._searchName,this.data.attrs.report_id);var newValue=(!data)?this.data.js.searchDefault:data;this._setSelectedDropdownItem(newValue);this._setSelected();}},_onResetRequest:function(type,args)
{if(RightNow.Event.isSameReportID(args,this.data.attrs.report_id)&&(args[0].data.name===this._searchName||args[0].data.name==="all"))
{this._setSelectedDropdownItem(this.data.js.searchDefault);this._setFilter();}},_onGetFiltersRequest:function(type,args)
{RightNow.Event.fire("evt_searchFiltersResponse",this._eo);}};
RightNow.Widget.ProductCategorySearchFilter=function(data,instanceID)
{this.data=data;this.instanceID=instanceID;this._eo=new RightNow.Event.EventObject();this._currentIndex=0;this._noValueNodeIndex=0;this._displayField=document.getElementById("rn_"+this.instanceID+"_"+this.data.attrs.filter_type+"_Button");this._displayFieldVisibleText=document.getElementById("rn_"+this.instanceID+"_ButtonVisibleText");this._accessibleView=document.getElementById("rn_"+this.instanceID+"_Links");this._outerTreeContainer="rn_"+this.instanceID+((this.data.attrs.show_confirm_button_in_dialog)?"_TreeContainer":"_Tree");if(!this._displayField)return;var Event=YAHOO.util.Event,RightNowEvent=RightNow.Event;RightNowEvent.subscribe("evt_getFiltersRequest",this._getFiltersRequest,this);RightNowEvent.subscribe("evt_menuFilterGetResponse",this._getSubLevelResponse,this);RightNowEvent.subscribe("evt_accessibleTreeViewGetResponse",this._getAccessibleTreeViewResponse,this);RightNowEvent.subscribe("evt_reportResponse",this._onReportResponse,this);RightNowEvent.subscribe("evt_resetFilterRequest",this._onResetRequest,this);Event.addListener(this._displayField,"click",this._toggleProductCategoryPicker,null,this);Event.addListener("rn_"+this.instanceID+"_LinksTrigger","click",this._toggleAccessibleView,null,this);this._initializeFilter();this._panel=new YAHOO.widget.Panel(this._outerTreeContainer,{close:false,width:"300px",visible:false,constraintoviewport:true});this._panel.setHeader("");this._panel.render();YAHOO.util.Dom.setStyle("rn_"+this.instanceID+"_Tree","overflow-y","auto");if(this.data.js.defaultData)
this._buildTree();};RightNow.Widget.ProductCategorySearchFilter.prototype={_buildTree:function()
{var treeDiv=document.getElementById("rn_"+this.instanceID+"_Tree");if(treeDiv&&YAHOO.widget.TreeView)
{this._tree=new YAHOO.widget.TreeView(treeDiv);this._tree.setDynamicLoad(RightNow.Event.createDelegate(this,this._getSubLevelRequest));var root=this._tree.getRoot(),defaultValues=false,hierData=this.data.js.hierData||this.data.js.hierDataNone;if(this.data.js.hierData&&this.data.js.hierDataNone)
delete this.data.js.hierData;if(!this.data.attrs.show_confirm_button_in_dialog){YAHOO.util.Event.addListener(this._tree.getEl(),"keydown",function(ev){if(YAHOO.util.Event.getCharCode(ev)===YAHOO.util.KeyListener.KEY.TAB)
{var currentNode=this._tree.currentFocus;if(currentNode.href){if(currentNode.target){window.open(currentNode.href,node.target);}
else{window.location(currentNode.href);}}
else{currentNode.toggle();}
this._tree.fireEvent('enterKeyPressed',currentNode);YAHOO.util.Event.preventDefault(ev);}},null,this);}
for(var i=0,node,length=hierData.length;i<length;i++)
{for(var j=0,nodeData;j<hierData[i].length;j++)
{nodeData=hierData[i][j];if(i!==0&&nodeData.parentID)
root=this._tree.getNodeByProperty("hierValue",nodeData.parentID);node=new YAHOO.widget.MenuNode(nodeData.label,root);node.hierValue=nodeData.value;node.href='javascript:void(0);';if(nodeData.selected)
{defaultValues=true;this._currentIndex=node.index;}
if(!nodeData.hasChildren)
{node.dynamicLoadComplete=true;node.iconMode=1;}}
root.loadComplete();}
var noValueNode=this._tree.getRoot().children[0];noValueNode.isLeaf=true;this._noValueNodeIndex=noValueNode.index;this._tree.subscribe("enterKeyPressed",this._enterPressed,null,this);if(this.data.attrs.show_confirm_button_in_dialog)
{YAHOO.util.Event.addListener('rn_'+this.instanceID+'_'+this.data.attrs.filter_type+'_ConfirmButton','click',function(){this._selectNode({node:this._tree.currentFocus});},null,this);YAHOO.util.Event.addListener('rn_'+this.instanceID+'_'+this.data.attrs.filter_type+'_CancelButton','click',this._toggleProductCategoryPicker,null,this);YAHOO.util.Event.addListener('rn_'+this.instanceID+'_'+this.data.attrs.filter_type+'_CancelButton','keydown',function(ev){if(YAHOO.util.Event.getCharCode(ev)===YAHOO.util.KeyListener.KEY.TAB&&!ev.shiftKey)
this._toggleProductCategoryPicker();},null,this);}
else
{this._tree.subscribe('clickEvent',this._selectNode,null,this);}
this._tree.subscribe('expandComplete',function(node){document.getElementById('rn_'+this.instanceID+"_Tree").scrollTop=node.getEl().offsetTop-20;},null,this);this._tree.collapseAll();YAHOO.util.Dom.setStyle("rn_"+this.instanceID+"_Tree","display","block");if(this.data.attrs.show_confirm_button_in_dialog)
YAHOO.util.Dom.setStyle("rn_"+this.instanceID+"_TreeContainer","display","block");if(defaultValues)
this._displaySelectedNodesAndClose(false);}},_displayAccessibleDialog:function()
{if(!this._tree)
this._buildTree();if(!(this._dialog))
{var handleDismiss=function()
{this.hide();};this._buttons=[{text:RightNow.Interface.getMessage("CANCEL_CMD"),handler:handleDismiss,isDefault:false}];YAHOO.util.Dom.removeClass(this._accessibleView,"rn_Hidden");this._dialog=RightNow.UI.Dialog.actionDialog(this.data.attrs.label_nothing_selected,this._accessibleView,{"buttons":this._buttons,"width":"400px"});}
else
{var currentlySelectedSpan=document.getElementById("rn_"+this.instanceID+"_IntroCurrentSelection");var introLink=document.getElementById("rn_"+this.instanceID+"_Intro");if(currentlySelectedSpan&&introLink)
{var currentNode=this._tree.getNodeByIndex(this._currentIndex);if(!currentNode)
{currentNode={};currentNode.hierValue=0;}
var localInstanceID=this.instanceID;introLink.onclick=function(){document.getElementById("rn_"+localInstanceID+"_AccessibleLink_"+currentNode.hierValue).focus();};var selectedNodes=this._getSelectedNodesMessage();selectedNodes=selectedNodes[0]?selectedNodes.join(", "):RightNow.Interface.getMessage("NO_VAL_LBL");currentlySelectedSpan.innerHTML=RightNow.Text.sprintf(RightNow.Interface.getMessage("SELECTION_PCT_S_ACTIVATE_LINK_JUMP_MSG"),selectedNodes);}}
YAHOO.lang.later(1000,this._dialog,'show');return false;},_toggleAccessibleView:function(e)
{if(this._dataType==="categories"&&this.data.js.linkingOn)
this._eo.data.linkingProduct=RightNow.UI.Form.currentProduct;if(this._flatTreeViewData)
this._displayAccessibleDialog();else
RightNow.Event.fire("evt_accessibleTreeViewRequest",this._eo);},_getAccessibleTreeViewResponse:function(e,args)
{if(args[0].data.hm_type!=this._eo.data.hm_type)
return;var evtObj=args[0];if(evtObj.data.data_type==this._dataType)
{this._flatTreeViewData=evtObj.data.accessibleLinks;var noValue={0:RightNow.Interface.getMessage("NO_VAL_LBL"),1:0,hier_list:0,level:0};if(!YAHOO.lang.isArray(this._flatTreeViewData))
{var tempArray=[];for(var i in this._flatTreeViewData)
{if(!isNaN(parseInt(i,10)))
tempArray[i]=this._flatTreeViewData[i];}
this._flatTreeViewData=tempArray;}
this._flatTreeViewData.unshift(noValue);var htmlList="<p><a href='javascript:void(0)' id='rn_"+this.instanceID+"_Intro'"+"onclick='document.getElementById(\"rn_"+this.instanceID+"_AccessibleLink_"+noValue[1]+"\").focus();'>"+RightNow.Text.sprintf(RightNow.Interface.getMessage("PCT_S_LNKS_DEPTH_ANNOUNCED_MSG"),this.data.attrs.label_input)+" <span id='rn_"+this.instanceID+"_IntroCurrentSelection'>"+RightNow.Text.sprintf(RightNow.Interface.getMessage("SELECTION_PCT_S_ACTIVATE_LINK_JUMP_MSG"),noValue[0])+"</span></a></p>",previousLevel=-1;for(i in this._flatTreeViewData)
{if(this._flatTreeViewData.hasOwnProperty(i))
{var item=this._flatTreeViewData[i];if(item.level>previousLevel)
htmlList+="<ol>";while(item.level<previousLevel)
{htmlList+="</li></ol>";previousLevel--;}
if(item.level===previousLevel)
htmlList+="</li>";htmlList+="<li>"+'<a href="javascript:void(0)" id="rn_'+this.instanceID+'_AccessibleLink_'+item[1]+'" class="rn_AccessibleHierLink" hierList="'+item['hier_list']+'">'+item[0]+'</a>';previousLevel=item.level;}}
for(i=previousLevel;i>=0;--i)
htmlList+="</li></ol>";htmlList+="<div id='rn_"+this.instanceID+"_AccessibleErrorLocation'></div>";this._accessibleView.innerHTML=htmlList;YAHOO.util.Event.addListener(YAHOO.util.Dom.getElementsByClassName("rn_AccessibleHierLink","a",this._accessibleView),"click",this._accessibleLinkClick,null,this);this._displayAccessibleDialog();}},_accessibleLinkClick:function(e)
{var element=YAHOO.util.Event.getTarget(e);var hierArray=element.getAttribute("hierList").split(",");this._expandAndCreateNodes(hierArray);return false;},_toggleProductCategoryPicker:function(event)
{if(!this._tree)
this._buildTree();if(this._panel.cfg.getProperty("visible")===false)
{if(!this._toggleProductCategoryPicker._buttonPos||this._toggleProductCategoryPicker._buttonPos!==this._panel.cfg.getProperty("x"))
{this._toggleProductCategoryPicker._buttonPos=YAHOO.util.Dom.getX(this._displayField);this._panel.cfg.setProperty("x",this._toggleProductCategoryPicker._buttonPos);}
this._panel.syncPosition();this._panel.show();var currentNode=this._tree.getNodeByIndex(this._currentIndex);if(currentNode&&currentNode.focus)
{currentNode.focus();}
else if(this._tree.getRoot().children[0]&&this._tree.getRoot().children[0].focus)
{this._tree.getRoot().children[0].focus();}
this._toggleProductCategoryPicker._closeListener=this._toggleProductCategoryPicker._closeListener||function(event)
{if(this._panel.cfg.getProperty("visible"))
{var coordinates=YAHOO.util.Event.getXY(event);if((event.type==="click"&&YAHOO.util.Event.getTarget(event).id===this._displayField.id)||coordinates[0]===0&&coordinates[1]===0)
return;coordinates=new YAHOO.util.Point(coordinates[0],coordinates[1]);var panelRegion=YAHOO.util.Dom.getRegion(this._outerTreeContainer),buttonRegion=YAHOO.util.Dom.getRegion(this._displayField);if(panelRegion&&buttonRegion&&(!panelRegion.contains(coordinates)&&!buttonRegion.contains(coordinates)))
{if(this.data.attrs.show_confirm_button_in_dialog)
this._toggleProductCategoryPicker();else
this._selectNode({node:this._tree.currentFocus},false);YAHOO.util.Event.removeListener(document,this._toggleProductCategoryPicker._closeListener);}}};YAHOO.util.Event.addListener(document,"click",this._toggleProductCategoryPicker._closeListener,null,this);}
else
{this._panel.hide();YAHOO.util.Event.removeListener(document,this._toggleProductCategoryPicker._closeListener);}},_getSelectedNodesMessage:function()
{return this._getPropertyChain("label");},_getPropertyChain:function(property)
{property=property||"label";this._currentIndex=this._currentIndex||1;var hierValues=[],currentNode=this._tree.getNodeByIndex(this._currentIndex);while(currentNode&&!currentNode.isRoot())
{hierValues.push(currentNode[property]);currentNode=currentNode.parent;}
return hierValues.reverse();},_displaySelectedNodesAndClose:function(focus)
{this._eo.data.hierChain=this._getPropertyChain('hierValue');RightNow.Event.fire("evt_productCategoryFilterSelected",this._eo);delete this._eo.data.hierChain;this._panel.hide();if(this._dialog&&this._dialog.cfg.getProperty("visible"))
this._dialog.hide();if(this._currentIndex<=this._noValueNodeIndex)
{this._displayFieldVisibleText.innerHTML=this.data.attrs.label_nothing_selected;var description=document.getElementById("rn_"+this.instanceID+"_TreeDescription");if(description)
description.innerHTML=this.data.attrs.label_nothing_selected;}
else
{var hierValues=this._getSelectedNodesMessage().join("<br/>"),field=this._displayFieldVisibleText;if(YAHOO.env.ua.webkit){setTimeout(function(){field.innerHTML=hierValues;},1);}
else{field.innerHTML=hierValues;}
description=document.getElementById("rn_"+this.instanceID+"_TreeDescription");if(description)
description.innerHTML=this.data.attrs.label_screen_reader_selected+hierValues;}
if(focus&&!this._dialog)
try{this._displayField.focus();}catch(e){}},_enterPressed:function(keyEvent)
{this._selectNode({node:keyEvent});},_selectNode:function(clickEvent)
{this._currentIndex=clickEvent.node.index;this._selected=true;this._selectNode._selectedWidget=this.data.info.w_id;if((clickEvent.node.expanded||this._noValueNodeIndex===clickEvent.node.index)&&!this.data.js.linkingOn)
{this._eo.data.level=clickEvent.node.depth+1;if(this._eo.data.level!==this._eo.filters.data[0].length)
{this._eo.filters.data[0]=[];var currentNode=clickEvent.node;while(currentNode&&!currentNode.isRoot())
{this._eo.filters.data[0][currentNode.depth]=currentNode.hierValue;currentNode=currentNode.parent;}}
else
{this._eo.filters.data[0][this._eo.data.level-1]=clickEvent.node.hierValue||this._eo.data.value;for(var i=this._eo.data.level;i<this._eo.filters.data[0].length;i++)
delete this._eo.filters.data[0][i];}}
else
{this._getSubLevelRequest(clickEvent.node);this._tree.collapseAll();}
this._displaySelectedNodesAndClose(true);if(clickEvent.event)
YAHOO.util.Event.preventDefault(clickEvent.event);if(this.data.attrs.search_on_select)
{this._eo.filters.reportPage=this.data.attrs.report_page_url;RightNow.Event.fire("evt_searchRequest",this._eo);}
return false;},_getSubLevelRequest:function(expandingNode)
{if(this._nodeBeingExpanded||(expandingNode.expanded&&!this.data.js.linkingOn))return;this._nodeBeingExpanded=true;this._eo.data.level=expandingNode.depth+1;this._eo.data.label=expandingNode.label;this._eo.data.value=expandingNode.hierValue;if(this.data.attrs.show_confirm_button_in_dialog)
this._requestedIndex=expandingNode.index;else
this._currentIndex=expandingNode.index;this._getSubLevelRequest._origRequest=this._getSubLevelRequest._origRequest||[];this._getSubLevelRequest._origRequest[this._dataType]=expandingNode.hierValue;if(this._dataType==="products")
{RightNow.UI.Form.currentProduct=this._eo.data.value;}
if(this._eo.data.value<1&&this._eo.data.linking_on)
{this._eo.data.reset=true;if(this._eo.data.value===0&&this._dataType==="products")
{this._eo.data.reset=false;var eo=new RightNow.Event.EventObject();eo.data={"name":"c","reset":true};eo.filters.report_id=this.data.attrs.report_id;RightNow.Event.fire("evt_resetFilterRequest",eo);this._nodeBeingExpanded=false;return;}
else
{this._eo.data.value=0;}}
else
{this._eo.data.reset=false;}
if(this.data.js.link_map)
{this._eo.data.link_map=this.data.js.link_map;this.data.js.link_map=null;}
if(this._eo.data.level!==this._eo.filters.data[0].length)
{this._eo.filters.data[0]=[];var currentNode=expandingNode;while(currentNode&&!currentNode.isRoot())
{this._eo.filters.data[0][currentNode.depth]=currentNode.hierValue;currentNode=currentNode.parent;}}
else
{this._eo.filters.data[0][this._eo.data.level-1]=this._eo.data.value;for(var i=this._eo.data.level;i<this._eo.filters.data[0].length;i++)
delete this._eo.filters.data[0][i];}
RightNow.Event.fire("evt_menuFilterRequest",this._eo);if(this._eo.data.link_map)
delete this._eo.data.link_map;this._nodeBeingExpanded=false;},_onReportResponse:function(type,args)
{if(RightNow.Event.isSameReportID(args,this.data.attrs.report_id)){var data=RightNow.Event.getDataFromFiltersEventResponse(args,this.data.js.searchName,this.data.attrs.report_id);if(data[0]&&data[0].length){if(!this._tree)
this._buildTree();if(typeof data[0]==="string")
data[0]=data[0].split(",");var finalData=RightNow.Lang.arrayFilter(data[0]);this._expandAndCreateNodes(finalData);this._eo.filters.data[0]=finalData;this._lastSearchValue=finalData.slice(0);if(this._eo.filters.data.reconstructData){this._eo.filters.data.level=this._eo.filters.data.reconstructData.level;this._eo.filters.data.label=this._eo.filters.data.reconstructData.label;}}
else{this._eo.filters.data[0]=[];if(this._tree){this._currentIndex=this._noValueNodeIndex;this._displaySelectedNodesAndClose();}}}},_expandAndCreateNodes:function(hierArray)
{var i=hierArray.length-1,currentNode=null;while(!currentNode&&i>=0){currentNode=this._tree.getNodeByProperty("hierValue",parseInt(hierArray[i],10));i--;}
if(this._currentIndex===currentNode.index)
{if(this._dialog&&this._dialog.cfg.getProperty("visible"))
this._dialog.hide();return;}
i++;if(this._noValueNodeIndex===currentNode.index||currentNode.hierValue==hierArray[hierArray.length-1]){this._selectNode({node:currentNode});}
else{var onExpandComplete=function(expandingNode){if(expandingNode.nextToExpand){var nextNode=this._tree.getNodeByProperty("hierValue",parseInt(expandingNode.nextToExpand,10));if(nextNode){nextNode.nextToExpand=hierArray[++i];nextNode.expand();}}
else if(i===hierArray.length){this._tree.unsubscribe("expandComplete",onExpandComplete,null);expandingNode.expanded=false;this._selectNode({node:expandingNode});}
return true;};this._tree.subscribe("expandComplete",onExpandComplete,null,this);currentNode.nextToExpand=hierArray[++i];currentNode.expand();}},_getSubLevelResponse:function(type,args)
{var evtObj=args[0];if((evtObj.data.data_type!==this._dataType)||(evtObj.filters.report_id!==this.data.attrs.report_id))
return;if(this.data.js.link_map)
delete this.data.js.link_map;var hierLevel=evtObj.data.level,hierData=evtObj.data.hier_data,redisplaySelectedNode=false,currentRoot=null;if(!this._tree)
this._buildTree();if(!evtObj.data.reset_linked_category&&this._getSubLevelRequest._origRequest&&this._getSubLevelRequest._origRequest[this._dataType])
{currentRoot=this._tree.getNodeByProperty("hierValue",this._getSubLevelRequest._origRequest[this._dataType]);if(currentRoot.index!==(this.data.attrs.show_confirm_button_in_dialog?this._requestedIndex:this._currentIndex))
{this._currentIndex=currentRoot.index;redisplaySelectedNode=true;}}
else if(evtObj.data.reset_linked_category)
{currentRoot=this._tree.getRoot();currentRoot.dynamicLoadComplete=false;this._tree.removeChildren(currentRoot);this._flatTreeViewData=null;var tempNode=new YAHOO.widget.MenuNode(RightNow.Interface.getMessage("NO_VAL_LBL"),currentRoot,false);tempNode.hierValue=0;tempNode.href='javascript:void(0);';tempNode.isLeaf=true;this._noValueNodeIndex=this._currentIndex=this._requestedIndex=tempNode.index;this._displayFieldVisibleText.innerHTML=this.data.attrs.label_nothing_selected;var description=document.getElementById("rn_"+this.instanceID+"_TreeDescription");if(description)
description.innerHTML=this.data.attrs.label_nothing_selected;}
if(hierLevel<7&&currentRoot&&!currentRoot.dynamicLoadComplete)
{for(var i=0,hasChildrenIndex;i<hierData.length;i++)
{hasChildrenIndex=hierData[i].length-1;tempNode=new YAHOO.widget.MenuNode(hierData[i][1],currentRoot,false);tempNode.hierValue=hierData[i][0];tempNode.href='javascript:void(0);';if(!hierData[i][hasChildrenIndex]||hierLevel===6)
{tempNode.dynamicLoadComplete=true;tempNode.iconMode=1;}}
currentRoot.loadComplete();}
if(hierData.length===0&&!this._selected)
{this._displaySelectedNodesAndClose();}
else if(this._selected)
{this._selected=false;}
else if(redisplaySelectedNode&&this._selectNode._selectedWidget)
{this._selectNode._selectedWidget=null;this._displaySelectedNodesAndClose();}},_getFiltersRequest:function(type,args)
{if(this._tree)
{this._eo.filters.data.reconstructData=[];if(this._currentIndex!==this._noValueNodeIndex)
{var currentNode=this._tree.getNodeByIndex(this._currentIndex||this._noValueNodeIndex),filterType,hierValues,level;this._eo.data.level=currentNode.depth+1;this._eo.data.label=currentNode.label;this._eo.data.value=currentNode.hierValue;filterType=this._eo.filters.searchName||"";if(!this._getFiltersRequest.filterValues)
this._getFiltersRequest.filterValues=[];if(this._eo.filters.data[0].length)
{if(this._getFiltersRequest.filterValues[filterType])
{var hasFilter=false,eoFilters=this._eo.filters.data[0].toString(),filters=this._getFiltersRequest.filterValues[filterType];for(var i=0;i<filters.length;i++)
{if(filters[i].toString()===eoFilters)
{hasFilter=true;break;}}
if(!hasFilter)
this._getFiltersRequest.filterValues[filterType].push(this._eo.filters.data[0]);}
else
{this._getFiltersRequest.filterValues[filterType]=[this._eo.filters.data[0]];}}
if(this._getFiltersRequest.filterValues[filterType])
this._eo.filters.data[0]=this._getFiltersRequest.filterValues[filterType][this._getFiltersRequest.filterValues[filterType].length-1];while(currentNode&&!currentNode.isRoot())
{level=currentNode.depth+1;hierValues=this._eo.filters.data[0].slice(0,level).join(",");this._eo.filters.data.reconstructData.push({"level":level,"label":currentNode.label,"hierList":hierValues});currentNode=currentNode.parent;}
this._eo.filters.data.reconstructData.reverse();}
else
{this._eo.filters.data[0]=[];this._getFiltersRequest.filterValues=[];this._eo.data.value=0;}}
this._lastSearchValue=this._eo.filters.data[0].slice(0);RightNow.Event.fire("evt_searchFiltersResponse",this._eo);},_onResetRequest:function(type,args)
{if(this._tree&&RightNow.Event.isSameReportID(args,this.data.attrs.report_id)&&(args[0].data.name===this.data.js.searchName||args[0].data.name==="all"))
{if(args[0].data.name==="all"&&this._lastSearchValue)
{this._eo.filters.data[0]=this._lastSearchValue;this._currentIndex=this._tree.getNodeByProperty("hierValue",this._lastSearchValue[this._lastSearchValue.length-1]).index;}
else
{if(args[0].data.reset&&this.data.js.linkingOn&&this._dataType==="categories")
{if(this.data.js.link_map)
delete this.data.js.link_map;this._buildTree();}
this._eo.filters.data[0]=[];this._currentIndex=this._noValueNodeIndex;}
this._displaySelectedNodesAndClose();}},_initializeFilter:function()
{this._eo.w_id=this.instanceID;this._eo.data.data_type=this._dataType=this.data.attrs.filter_type;this._eo.data.linking_on=this.data.js.linkingOn;this._eo.data.cache=[];this._eo.data.hm_type=this.data.js.hm_type;this._eo.data.linkingProduct=0;this._eo.filters={rnSearchType:"menufilter",searchName:this.data.js.searchName,report_id:this.data.attrs.report_id,fltr_id:this.data.js.fltr_id,oper_id:this.data.js.oper_id,data:[]};this._eo.filters.data[0]=(this.data.js.initial)?this.data.js.initial:[];this._lastSearchValue=this._eo.filters.data[0].slice(0);if(this._dataType==="products")
{RightNow.UI.currentProduct=this._eo.filters.data[0][this._eo.filters.data[0].length-1];RightNow.UI.linkingOn=this.data.js.linkingOn;RightNow.UI.linkingFilter=this.data.attrs.filter_name;}}};
RightNow.Widget.FilterDropdown2=function(data,instanceID)
{this.data=data;this.instanceID=instanceID;this._eo=new RightNow.Event.EventObject();this._optionsSelect=document.getElementById("rn_"+this.instanceID+"_Options");var RightNowEvent=RightNow.Event;RightNowEvent.subscribe("evt_customMenuResponse",this._onChangedResponse,this);RightNowEvent.subscribe("evt_reportResponse",this._onChangedResponse,this);RightNowEvent.subscribe("evt_resetFilterRequest",this._onResetRequest,this);RightNowEvent.subscribe("evt_getFiltersRequest",this._onGetFiltersRequest,this);YAHOO.util.Event.addListener(this._optionsSelect,"change",this._onSelectChange,null,this);this._setFilter();this._setSelectedDropdownItem(this.data.js.defaultValue);};RightNow.Widget.FilterDropdown2.prototype={_onSelectChange:function(evt)
{this._eo.filters.data.val=this._getSelected();RightNow.Event.fire("evt_customMenuRequest",this._eo);if(this.data.attrs.search_on_select)
{this._eo.filters.reportPage=this.data.attrs.report_page_url;RightNow.Event.fire("evt_searchRequest",this._eo);}},_getSelected:function()
{if(this._optionsSelect)
{var index=Math.max(0,this._optionsSelect.selectedIndex);if(this._optionsSelect.options[index])
{return this._optionsSelect.options[index].value;}}
return null;},_setSelectedDropdownItem:function(valueToSelect)
{if(this._optionsSelect)
{for(var i=0;i<this._optionsSelect.length;i++)
{if(this._optionsSelect.options[i].value==valueToSelect)
{this._optionsSelect.selectedIndex=i;return true;}}}
return false;},_setFilter:function()
{this._eo.w_id=this.instanceID;this._eo.filters={"searchName":this.data.js.searchName,"rnSearchType":this.data.js.rnSearchType,"report_id":this.data.attrs.report_id,"data":{"fltr_id":this.data.js.filters.fltr_id,"oper_id":this.data.js.filters.oper_id,"val":this._getSelected()}};},_onChangedResponse:function(type,args)
{var data=RightNow.Event.getDataFromFiltersEventResponse(args,this.data.js.searchName,this.data.attrs.report_id),newValue=this._eo.filters.data.val;if(!data||data.fltr_id!==this.data.js.filters.fltr_id)
return;newValue=data.val||this.data.js.defaultValue;if(newValue!==this._eo.filters.data.val)
{this._setSelectedDropdownItem(newValue);this._eo.filters.data.val=newValue;}},_onResetRequest:function(type,args)
{if(RightNow.Event.isSameReportID(args,this.data.attrs.report_id)&&(args[0].data.name===this.data.js.searchName||args[0].data.name==="all"))
{this._setSelectedDropdownItem(this.data.js.defaultValue);this._eo.filters.data.val=this.data.js.defaultValue;}},_onGetFiltersRequest:function(type,args)
{RightNow.Event.fire("evt_searchFiltersResponse",this._eo);}};
RightNow.Widget.SortList2=function(data,instanceID)
{this.data=data;this.instanceID=instanceID;this._eo=new RightNow.Event.EventObject();this._headingsSelect=document.getElementById("rn_"+this.instanceID+"_Headings");this._directionSelect=document.getElementById("rn_"+this.instanceID+"_Direction");var RightNowEvent=RightNow.Event;RightNowEvent.subscribe("evt_sortTypeResponse",this._onChangedResponse,this);RightNowEvent.subscribe("evt_reportResponse",this._onChangedResponse,this);RightNowEvent.subscribe("evt_getFiltersRequest",this._onGetFiltersRequest,this);RightNowEvent.subscribe("evt_resetFilterRequest",this._onResetRequest,this);this._setFilter();this._setSelectedDropdownItem(this._headingsSelect,this.data.js.col_id);this._setSelectedDropdownItem(this._directionSelect,this.data.js.sort_direction);YAHOO.util.Event.addListener(this._headingsSelect,"change",this._onDropdownChange,"column",this);YAHOO.util.Event.addListener(this._directionSelect,"change",this._onDropdownChange,"direction",this);};RightNow.Widget.SortList2.prototype={_onDropdownChange:function(evt,dropdownThatChanged)
{this._setEventObjectFromUI(dropdownThatChanged);RightNow.Event.fire("evt_sortTypeRequest",this._eo);if(this.data.attrs.search_on_select)
{this._eo.filters.reportPage=this.data.attrs.report_page_url;RightNow.Event.fire("evt_searchRequest",this._eo);}},_setEventObjectFromUI:function(dropdownThatChanged)
{var selectBox,memberToSet,index;if(dropdownThatChanged==="direction")
{selectBox=this._directionSelect;memberToSet="sort_direction";}
else
{selectBox=this._headingsSelect;memberToSet="col_id";}
if(selectBox)
{index=selectBox.selectedIndex;index=(index>0)?index:0;if(selectBox.options[index])
this._eo.filters.data[memberToSet]=selectBox.options[index].value;}},_setSelectedDropdownItem:function(selectBox,valueToSelect)
{if(selectBox)
{for(var i=0;i<selectBox.length;i++)
{if(selectBox.options[i].value==valueToSelect)
{selectBox.selectedIndex=i;return true;}}}
return false;},_setFilter:function()
{this._eo.w_id=this.instanceID;this._eo.filters.searchName=this.data.js.searchName;this._eo.filters.report_id=this.data.attrs.report_id;this._setDataObject();},_setDataObject:function()
{this._eo.filters.data={col_id:this.data.js.col_id,sort_direction:this.data.js.sort_direction};},_onChangedResponse:function(type,args)
{if(RightNow.Event.isSameReportID(args,this.data.attrs.report_id))
{var data=RightNow.Event.getDataFromFiltersEventResponse(args,this.data.js.searchName,this.data.attrs.report_id);if(this._eo.filters.data===null)
this._setDataObject();var newValue=(!data||data.col_id==null)?this.data.js.col_id:data.col_id;this._setSelectedDropdownItem(this._headingsSelect,newValue);this._setEventObjectFromUI("column");newValue=(!data||data.sort_direction==null)?this.data.js.sort_direction:data.sort_direction;this._setSelectedDropdownItem(this._directionSelect,newValue);this._setEventObjectFromUI("direction");}},_onResetRequest:function(type,args)
{if(RightNow.Event.isSameReportID(args,this.data.attrs.report_id)&&(args[0].data.name===this.data.js.searchName||args[0].data.name==="all"))
{this._setSelectedDropdownItem(this._headingsSelect,this.data.js.col_id);this._setSelectedDropdownItem(this._directionSelect,this.data.js.sort_direction);this._setFilter();}},_onGetFiltersRequest:function(type,args)
{RightNow.Event.fire("evt_searchFiltersResponse",this._eo);}};
RightNow.Widget.SearchButton2=function(data,instanceID)
{this.data=data;this.instanceID=instanceID;this._requestInProgress=false;this._searchButton=document.getElementById("rn_"+this.instanceID+"_SubmitButton");this._enableClickListener();RightNow.Event.subscribe("evt_reportResponse",this._onSearchResponse,this);};RightNow.Widget.SearchButton2.prototype={_startSearch:function(evt)
{if(this._requestInProgress)
return false;if(!this.data.attrs.popup_window&&(!this.data.attrs.report_page_url&&(this.data.attrs.target==='_self')))
this._disableClickListener();if(YAHOO.env.ua.ie!==0)
{if(!this._parentForm)
this._parentForm=YAHOO.util.Dom.getAncestorByTagName("rn_"+this.instanceID,"FORM");if(this._parentForm&&window.external&&"AutoCompleteSaveForm"in window.external)
{window.external.AutoCompleteSaveForm(this._parentForm);}}
var eo=new RightNow.Event.EventObject();eo.w_id=this.instanceID;eo.filters={report_id:this.data.attrs.report_id,reportPage:this.data.attrs.report_page_url,target:this.data.attrs.target,popupWindow:this.data.attrs.popup_window,width:this.data.attrs.popup_window_width_percent,height:this.data.attrs.popup_window_height_percent};RightNow.Event.fire("evt_searchRequest",eo);},_onSearchResponse:function(type,args)
{if(args[0].filters.report_id==this.data.attrs.report_id)
this._enableClickListener();},_enableClickListener:function()
{this._requestInProgress=false;YAHOO.util.Event.addListener(this._searchButton,"click",this._startSearch,null,this);},_disableClickListener:function()
{this._requestInProgress=true;YAHOO.util.Event.removeListener(this._searchButton,"click",this._startSearch);}};
RightNow.Widget.DisplaySearchFilters=function(data,instanceID){this.data=data;this.instanceID=instanceID;this._originalFilters={};for(var i=0,eaFilter,j;i<this.data.js.filters.length;i++){eaFilter=this.data.js.filters[i];this._originalFilters[eaFilter.name]=[];for(j in eaFilter.data){if(eaFilter.data.hasOwnProperty(j)){this._originalFilters[eaFilter.name].push(eaFilter.data[j]);}}
YAHOO.util.Event.addListener("rn_"+this.instanceID+"_Remove_"+i,"click",this._onFilterRemove,i,this);}
this._filters=this.data.js.filters;delete this.data.js.filters;this._defaultFilters=this.data.js.defaultFilters;delete this.data.js.defaultFilters;RightNow.Event.subscribe("evt_searchFiltersResponse",this._updateFilters,this);RightNow.Event.subscribe("evt_reportResponse",this._onReportResponse,this);};RightNow.Widget.DisplaySearchFilters.prototype={_updateHierFilter:function(existingFilter,updatedFilter){if(!existingFilter){existingFilter=this._createFilter(updatedFilter,((updatedFilter.filters.searchName==="p")?RightNow.Interface.getMessage("PRODUCT_LBL"):RightNow.Interface.getMessage("CATEGORY_LBL")));}
var reconstructData=updatedFilter.filters.data.reconstructData;if(reconstructData!==existingFilter.data){existingFilter.data=reconstructData;existingFilter.touched=true;}
return existingFilter;},_updateFilter:function(existingFilter,updatedFilter){if(!existingFilter)
existingFilter=this._createFilter(updatedFilter);if(existingFilter.data!==updatedFilter.filters.data.label){existingFilter.data=updatedFilter.filters.data.label;existingFilter.filterID=(existingFilter.type!=="org")?updatedFilter.filters.fltr_id:updatedFilter.filters.data.selected;existingFilter.touched=true;}
this._checkDefaultFilterValues(existingFilter);return existingFilter;},_createFilter:function(newFilter,label){this._createFilter._createLabel=this._createFilter._createLabel||function(newFilter,label){var finalLabel=label||newFilter.filters.label;if(!finalLabel){if(newFilter.filters.rnSearchType==="searchType")
return RightNow.Interface.getMessage("SEARCH_TYPE_LBL");else if(newFilter.filters.rnSearchType==="org")
return RightNow.Interface.getMessage("ORGANIZATION_LBL");else return RightNow.Interface.getMessage("CUSTOM_LBL");}
return finalLabel;};return{"filterID":newFilter.filters.fltr_id||newFilter.filters.data.selected,"name":newFilter.filters.searchName,"type":newFilter.filters.rnSearchType,"label":this._createFilter._createLabel(newFilter,label),"data":[],"touched":true};},_checkDefaultFilterValues:function(filterToCheckFor){for(var i=0;i<this._defaultFilters.length;i++){if(this._defaultFilters[i].name===filterToCheckFor.name&&this._defaultFilters[i].filterID==filterToCheckFor.filterID){filterToCheckFor.removeDefault=true;filterToCheckFor.touched=false;}}},_getDefaultFilterID:function(name){var numberOfDefaultFilters=this._defaultFilters.length,defaultFilter;if(numberOfDefaultFilters){for(var i=0;i<numberOfDefaultFilters;i++){defaultFilter=this._defaultFilters[i];if(defaultFilter.name===name){return defaultFilter.filterID;}}}
return null;},_getFilterID:function(filter){if(typeof filter!=="undefined"){return(typeof filter.fltr_id!=="undefined")?filter.fltr_id:((filter.data)?filter.data.fltr_id:null);}
return null;},_updateFilters:function(evt,eventObj){eventObj=eventObj[0];var eventObjectFilter=(typeof eventObj==="object"&&eventObj!==null)?eventObj.filters:null;if(eventObjectFilter&&eventObjectFilter.report_id===this.data.attrs.report_id&&this._getFilterID(eventObjectFilter)!==null){var filterUpdated=false;for(var i=0,index;i<this._filters.length;i++){if(this._filters[i]&&this._filters[i].name===eventObjectFilter.searchName){if(eventObjectFilter.rnSearchType==="menufilter")
this._filters[i]=this._updateHierFilter(this._filters[i],eventObj);else
this._filters[i]=this._updateFilter(this._filters[i],eventObj);filterUpdated=true;break;}}
if(!filterUpdated&&eventObjectFilter.searchName){if(eventObjectFilter.rnSearchType==="menufilter"&&eventObjectFilter.data.reconstructData)
this._filters[this._filters.length]=this._updateHierFilter(null,eventObj);else if(eventObjectFilter.rnSearchType!=="menufilter")
this._filters[this._filters.length]=this._updateFilter(null,eventObj);}}},_onReportResponse:function(evt,args){var reportFilters=args[0].filters.allFilters.filters,reportID=args[0].filters.report_id,filterIndex,clonedFilterObject,filter,filterID,defaultFilterID;for(filterIndex in reportFilters){filter=reportFilters[filterIndex].filters;filterID=this._getFilterID(filter);if(filter&&(filterID!==null||(defaultFilterID=this._getDefaultFilterID(filter.searchName))!==null)){clonedFilterObject=RightNow.Lang.cloneObject(reportFilters[filterIndex]);filter=clonedFilterObject.filters;if(filter.rnSearchType==="menufilter"){if(filter.data.reconstructData){filter.searchName=filterIndex;}
else if(!filter.data[0]||!filter.data[0].length){filter.data.reconstructData=[];}
else if(filter.data[0]&&filter.data[0].length&&parseInt(filter.data[0][filter.data[0].length-1],10)===this._originalFilters[filterIndex][this._originalFilters[filterIndex].length-1].value){filter.data.reconstructData=this._originalFilters[filterIndex];}
else{continue;}}
else{filter.fltr_id=filter.fltr_id||filterID||defaultFilterID;filter.data=filter.data||"";filter.searchName=filterIndex;filter.report_id=reportID;}
this._updateFilters(null,[clonedFilterObject]);}}
this._displayFilters();},_displayFilters:function(){var outputChanged=false,widgetElement=document.getElementById("rn_"+this.instanceID),i,j,index,newElement,filterData;for(i=0;i<this._filters.length;i++){if(this._filters[i]&&this._filters[i].touched){newElement=this._buildFilterElement(i,this._filters[i].label);filterData=this._filters[i].data;if(filterData&&this._filters[i].type==="menufilter"){if(filterData.length){for(j=0;j<filterData.length;j++){newElement.innerHTML+=this._buildFilterItemMarkup(filterData[j],null,(j===filterData.length-1),this._filters[i].name);}}
else{newElement.innerHTML="";}}
else if(filterData){newElement.innerHTML+=this._buildFilterItemMarkup(this._filters[i],filterData,true);}
else{newElement.innerHTML="";}
if(widgetElement&&newElement){var outdatedFilter=document.getElementById(newElement.id),addedAFilter;if(outdatedFilter){if(newElement.innerHTML===""){outdatedFilter.parentNode.removeChild(outdatedFilter);}
else{outdatedFilter.innerHTML=newElement.innerHTML;addedAFilter=true;}}
else if(newElement.innerHTML!==""){widgetElement.appendChild(newElement);addedAFilter=true;}
if(addedAFilter){YAHOO.util.Event.addListener("rn_"+this.instanceID+"_Remove_"+i,"click",this._onFilterRemove,i,this);}}
this._filters[i].touched=false;outputChanged=true;}
else if(this._filters[i]&&this._filters[i].removeDefault){var existingElement=document.getElementById("rn_"+this.instanceID+"_Filter_"+i);if(existingElement)
existingElement.parentNode.removeChild(existingElement);this._filters[i].removeDefault=false;}}
if(widgetElement.children.length===1)
YAHOO.util.Dom.addClass("rn_"+this.instanceID,"rn_Hidden");else if(outputChanged)
YAHOO.util.Dom.removeClass("rn_"+this.instanceID,"rn_Hidden");},_buildFilterItemMarkup:function(item,label,shouldBeSelected,filterName){var cssClass=(shouldBeSelected)?"rn_Selected":"",link=(!shouldBeSelected&&item.hierList)?RightNow.Url.addParameter(this.data.js.searchPage,filterName,item.hierList):"javascript:void(0);";return"<a href='"+link+"' class='"+cssClass+" rn_FilterItem'>"+(label||item.label)+"</a><span class='rn_Separator "+cssClass+"'/>";},_buildFilterElement:function(index,label){var filterElement=document.createElement("div");filterElement.id="rn_"+this.instanceID+"_Filter_"+index;YAHOO.util.Dom.addClass(filterElement,"rn_Filter");filterElement.innerHTML="<div class='rn_Label'>"+label+"<a id='rn_"+this.instanceID+"_Remove_"+index+"' href='javascript:void(0);' title='"+this.data.attrs.label_filter_remove+"'> "+
((this.data.attrs.remove_icon_path)?"<img alt='"+this.data.attrs.label_filter_remove+"' src='"+this.data.attrs.remove_icon_path+"'/>":this.data.attrs.label_filter_remove)+"</a></div>";return filterElement;},_onFilterRemove:function(evt,index){this._onFilterRemove._removedFilters=this._onFilterRemove._removedFilters||0;YAHOO.util.Event.stopEvent(evt);var eo=new RightNow.Event.EventObject(),filterElement;eo.data.name=this._filters[index].name;eo.filters.report_id=this.data.attrs.report_id;eo.w_id=this.instanceID;RightNow.Event.fire("evt_resetFilterRequest",eo);eo.filters.reportPage="";RightNow.Event.fire("evt_searchRequest",eo);this._filters[index].data=[];YAHOO.util.Event.purgeElement("rn_"+this.instanceID+"_Remove_"+index);filterElement=document.getElementById("rn_"+this.instanceID+"_Filter_"+index);if(filterElement){filterElement.innerHTML="";filterElement.parentNode.removeChild(filterElement);}
this._onFilterRemove._removedFilters++;if(this._onFilterRemove._removedFilters===this._filters.length)
YAHOO.util.Dom.addClass("rn_"+this.instanceID,"rn_Hidden");}};
RightNow.Widget.ResultInfo2=function(data,instanceID){this.data=data;this.instanceID=instanceID;this._searchSources=0;if(this.data.attrs.display_knowledgebase_results){RightNow.Event.subscribe("evt_reportResponse",this._onReportChanged,this);}
if(this.data.attrs.combined_results){this._searchTerm=this.data.js.searchTerm;if(this.data.js.social){RightNow.Event.subscribe("evt_communitySearchResponse",this._reportCombinedResults,this);this._searchSources++;}
if(this.data.js.intent){RightNow.Event.subscribe("evt_intentGuideSearchResponse",this._reportCombinedResults,this);this._searchSources++;}
RightNow.Event.subscribe("evt_pageRequest",function(evt,args){this._page=args[0].data.page;},this);RightNow.Event.subscribe("evt_searchFilterChangeResponse",this._watchSearchFilterChange,this);}};RightNow.Widget.ResultInfo2.prototype={_onReportChanged:function(type,args)
{if(args[0].data&&args[0].data.report_id==this.data.attrs.report_id)
{var newData=args[0].data,resultQuery="",parameterList="",Dom=YAHOO.util.Dom;this._determineNewResults(args[0]);if(this.data.attrs.add_params_to_url!==""&&args[0].filters&&args[0].filters.allFilters&&args[0].filters.allFilters.format)
{var allFilters=RightNow.Lang.cloneObject(args[0].filters.allFilters);allFilters.format.parmList=this.data.attrs.add_params_to_url;parameterList=RightNow.Url.buildUrlLinkString(allFilters);}
if(!this.data.attrs.combined_results&&this.data.attrs.display_results&&newData.search_term)
{var stopWords=newData.stopword,noDictWords=newData.not_dict,searchTerms=newData.search_term.split(" "),displayedNoResultsMsg=false;for(var i=0,word,strippedWord;i<searchTerms.length;i++)
{word=searchTerms[i];strippedWord=word.replace(/\W/,"");if(stopWords&&strippedWord&&stopWords.indexOf(strippedWord)!==-1)
word="<strike title='"+this.data.attrs.label_common+"'>"+word+"</strike>";else if(noDictWords&&strippedWord&&noDictWords.indexOf(strippedWord)!==-1)
word="<strike title='"+this.data.attrs.label_dictionary+"'>"+word+"</strike>";else
word="<a href='"+RightNow.Url.addParameter(this.data.js.linkUrl+encodeURIComponent(word.replace(/\&amp;/g,"&"))+parameterList+"/search/1","session",RightNow.Url.getSession())+"'>"+word+"</a>";resultQuery+=word+" ";}
resultQuery=YAHOO.lang.trim(resultQuery);}
var suggestedDiv=document.getElementById("rn_"+this.instanceID+"_Suggestion");if(suggestedDiv)
{if(newData.ss_data)
{var links=this.data.attrs.label_suggestion+" ";for(var i=0;i<newData.ss_data.length;i++)
links+='<a href="'+this.data.js.linkUrl+newData.ss_data[i]+parameterList+'">'+newData.ss_data[i]+'</a>&nbsp;';suggestedDiv.innerHTML=links;Dom.removeClass(suggestedDiv,"rn_Hidden");}
else
{Dom.addClass(suggestedDiv,"rn_Hidden");}}
var spellingDiv=document.getElementById("rn_"+this.instanceID+"_Spell");if(spellingDiv)
{if(newData.spelling)
{spellingDiv.innerHTML=this.data.attrs.label_spell+' <a href="'+this.data.js.linkUrl+newData.spelling+parameterList+'">'+newData.spelling+' </a>';Dom.removeClass(spellingDiv,"rn_Hidden");}
else
{Dom.addClass(spellingDiv,"rn_Hidden");}}
this._updateSearchResults({searchTermToDisplay:resultQuery,userSearchedOn:newData.search_term,topics:newData.topics,truncated:newData.truncated});if(!this.data.attrs.combined_results)
{this.data.js.totalResults=0;this.data.js.firstResult=0;this.data.js.lastResult=0;}}},_updateSearchResults:function(options)
{options=options||{};var noResultsDiv=document.getElementById("rn_"+this.instanceID+"_NoResults"),resultsDiv=document.getElementById("rn_"+this.instanceID+"_Results"),searchTermToDisplay=options.searchTermToDisplay,Dom=YAHOO.util.Dom,displayedNoResultsMsg=false;if(noResultsDiv)
{if(this.data.js.totalResults===0&&options.userSearchedOn&&!options.topics)
{noResultsDiv.innerHTML=this.data.attrs.label_no_results+"<br/><br/>"+this.data.attrs.label_no_results_suggestions;Dom.removeClass(noResultsDiv,"rn_Hidden");displayedNoResultsMsg=true;}
else
{Dom.addClass(noResultsDiv,"rn_Hidden");}}
if(resultsDiv)
{if(!displayedNoResultsMsg&&!options.truncated)
{resultsDiv.innerHTML=(searchTermToDisplay&&searchTermToDisplay.length>0)?RightNow.Text.sprintf(this.data.attrs.label_results_search_query,this.data.js.firstResult,this.data.js.lastResult,this.data.js.totalResults,searchTermToDisplay):RightNow.Text.sprintf(this.data.attrs.label_results,this.data.js.firstResult,this.data.js.lastResult,this.data.js.totalResults);Dom.removeClass(resultsDiv,"rn_Hidden");}
else
{Dom.addClass(resultsDiv,"rn_Hidden");}}},_determineNewResults:function(eventObject){var reportData=eventObject.data;if(this.data.attrs.combined_results){if(this.data.js.totalResults===0||this.data.js.totalResults===this.data.js.combinedResults){this.data.js.totalResults+=reportData.total_num;}
if(typeof reportData.pruned==="number"){this.data.js.totalResults-=reportData.pruned;}
if(typeof this.data.js.prunedAnswers==="number"&&!reportData.pruned){reportData.start_num-=this.data.js.prunedAnswers;reportData.end_num-=this.data.js.prunedAnswers;reportData.pruned=true;}}
else{this.data.js.totalResults=reportData.total_num;}
this.data.js.firstResult=reportData.start_num;if(reportData.page!==1){this.data.js.firstResult+=this.data.js.combinedResults;}
if(this.data.js.firstResult===0&&this.data.js.combinedResults!==0){this.data.js.firstResult=1;}
this.data.js.lastResult=reportData.end_num+this.data.js.combinedResults;this._page=reportData.page;if(reportData.pruned&&eventObject.w_id&&eventObject.w_id.indexOf("CombinedSearchResults")>-1){this.data.js.prunedAnswers=(this.data.js.prunedAnswers===reportData.pruned)?false:reportData.pruned;}},_reportCombinedResults:function(evt,args){args=args[0];var newTotal=(typeof args.numberOfResults!=="undefined")?args.numberOfResults:((args.data&&args.data.totalCount)?args.data.totalCount:0);if(!this._page||this._page<2){this._searchesReturned++;newTotal=Math.min(newTotal,20);this.data.js.combinedResults+=newTotal;this.data.js.lastResult+=newTotal;this.data.js.totalResults+=newTotal;this.data.js.firstResult=((this.data.js.combinedResults)?1:0);if(this._searchesReturned===this._searchSources&&(this.data.js.totalResults===0||this.data.js.combinedResults>0)){this._updateSearchResults({userSearchedOn:true});}}},_watchSearchFilterChange:function(evt,args){args=args[0];var report=args.data[this.data.attrs.report_id];if(report&&((report.filters.keyword&&report.filters.keyword.filters.data!==this._searchTerm)||(report.filters.page===1))){this._page=1;this._searchesReturned=0;this._searchTerm=report.filters.keyword.filters.data;this.data.js.totalResults=0;this.data.js.combinedResults=0;this.data.js.lastResult=0;this.data.js.firstResult=0;this.data.js.prunedAnswers=false;}}};
RightNow.Widget.TopicWords2=function(data,instanceID){this.data=data;this.instanceID=instanceID;RightNow.Event.subscribe("evt_reportResponse",this._onTopicWordsUpdate,this);};RightNow.Widget.TopicWords2.prototype={_onTopicWordsUpdate:function(type,args)
{var eventObject=args[0];var topicWordsHtml="";var topicWordsDomList=document.getElementById("rn_"+this.instanceID+"_List");if(!topicWordsDomList)
{var root=document.getElementById("rn_"+this.instanceID);if(root)
{topicWordsDomList=document.createElement("DL");topicWordsDomList.id="rn_"+this.instanceID+"_List";root.appendChild(topicWordsDomList);}}
if(topicWordsDomList)
{var Url=RightNow.Url;if(eventObject&&eventObject.data&&eventObject.data.topic_words&&eventObject.data.topic_words.length)
{var topicWordItems=eventObject.data.topic_words;var linkString=Url.buildUrlLinkString(eventObject.filters.allFilters,this.data.attrs.add_params_to_url);for(var i=0;i<topicWordItems.length;i++)
{if(!Url.isExternalUrl(topicWordItems[i].url))
topicWordItems[i].url+=linkString;var displayIcon=(this.data.attrs.display_icon)?topicWordItems[i].icon:"";topicWordsHtml+="<dt>"+displayIcon+"<a href='"+topicWordItems[i].url+"' target='"+this.data.attrs.target+"' />"+topicWordItems[i].title+"</a></dt><dd>"+topicWordItems[i].text+"</dd>";}
topicWordsDomList.innerHTML=topicWordsHtml;YAHOO.util.Dom.removeClass("rn_"+this.instanceID,"rn_Hidden");}
else
{topicWordsDomList.innerHTML="";YAHOO.util.Dom.addClass("rn_"+this.instanceID,"rn_Hidden");}}}};
RightNow.Widget.Multiline2=function(data,instanceID){this.data=data;this.instanceID=instanceID;this._eo=new RightNow.Event.EventObject();this._contentName="rn_"+this.instanceID+"_Content";this._loadingName="rn_"+this.instanceID+"_Loading";if(RightNow.Event.isHistoryManagerFragment())
this._setLoading(true);RightNow.Event.subscribe("evt_reportResponse",this._onReportChanged,this);RightNow.Event.subscribe("evt_searchInProgressRequest",this._searchInProgress,this);this._setFilter();RightNow.Event.fire("evt_setInitialFiltersRequest",this._eo);};RightNow.Widget.Multiline2.prototype={_setFilter:function()
{this._eo.w_id=this.instanceID;this._eo.filters={"report_id":this.data.attrs.report_id,"token":this.data.js.r_tok,"allFilters":this.data.js.filters,"format":this.data.js.format};this._eo.filters.format.parmList=this.data.attrs.add_params_to_url;},_searchInProgress:function(type,args)
{if(args[0].filters.report_id==this.data.attrs.report_id)
{document.body.setAttribute("aria-busy","true");this._setLoading(true);}},_setLoading:function(loading)
{if(loading)
{var element=document.getElementById(this._contentName);if(element)
{YAHOO.util.Dom.setStyle(element,"height",element.offsetHeight+"px");if(YAHOO.env.ua.ie)
YAHOO.util.Dom.addClass(element,"rn_Hidden");else
(new YAHOO.util.Anim(element,{opacity:{to:0}},0.4,YAHOO.util.Easing.easeIn)).animate();YAHOO.util.Dom.addClass(this._loadingName,"rn_Loading");}}
else
{YAHOO.util.Dom.removeClass(this._loadingName,"rn_Loading");if(YAHOO.env.ua.ie)
YAHOO.util.Dom.removeClass(this._contentName,"rn_Hidden");else
(new YAHOO.util.Anim(this._contentName,{opacity:{to:1}},0.4,YAHOO.util.Easing.easeIn)).animate();}},_onReportChanged:function(type,args)
{var newdata=args[0].data;this._setLoading(false);var alertDiv=document.getElementById("rn_"+this.instanceID+"_Alert");if(newdata.report_id==this.data.attrs.report_id)
{var currentPageSize=newdata.per_page;var cols=newdata.headers.length;var str="";var report=document.getElementById(this._contentName);if(!report)
return;if(newdata.total_num>0)
{if(alertDiv)
alertDiv.innerHTML=this.data.attrs.label_screen_reader_search_success_alert;if(newdata.row_num)
str+='<ol start="'+newdata.start_num+'">';else
str+='<ul>';for(var i=0;i<currentPageSize;i++)
{str+='<li>';str+='<span class="rn_Element1">'+newdata.data[i][0]+'&nbsp;</span>';str+=(newdata.data[i][1])?'<span class="rn_Element2">'+newdata.data[i][1]+'</span>':'';str+='<br/>';str+=(newdata.data[i][2])?'<span class="rn_Element3">'+newdata.data[i][2]+'</span><br/>':'';for(var j=3;j<cols;j++)
{str+='<span class="rn_ElementsHeader">'+newdata.headers[j]['heading'];if(newdata.headers[j]['heading']!="")
str+=':&nbsp;';str+='</span>';str+='<span class="rn_ElementsData">'+newdata.data[i][j]+'</span><br/>';}
str+='</li>';}
if(newdata.row_num)
str+='</ol>';else
str+='</ul>';report.innerHTML=str;if(this.data.attrs.hide_when_no_results)
YAHOO.util.Dom.removeClass('rn_'+this.instanceID,'rn_Hidden');}
else
{report.innerHTML="";if(alertDiv)
alertDiv.innerHTML=this.data.attrs.label_screen_reader_search_no_results_alert;if(this.data.attrs.hide_when_no_results)
YAHOO.util.Dom.addClass('rn_'+this.instanceID,'rn_Hidden');}
YAHOO.util.Dom.setStyle(report,"height","auto");RightNow.Url.transformLinks(report);document.body.setAttribute("aria-busy","false");var anchors=report.getElementsByTagName('a');if(anchors&&anchors[0])
anchors[0].focus();}}};
RightNow.Widget.Paginator=function(data,instanceID)
{this.data=data;this.instanceID=instanceID;this._eo=new RightNow.Event.EventObject();this._currentPage=this.data.js.currentPage;RightNow.Event.subscribe("evt_reportResponse",this._onReportChanged,this);for(var i=this.data.js.startPage;i<=this.data.js.endPage;i++)
{YAHOO.util.Event.addListener("rn_"+this.instanceID+"_PageLink_"+i,"click",this._onPageChange,i,this);}
YAHOO.util.Event.addListener("rn_"+this.instanceID+"_Forward","click",this._onForward,null,this);YAHOO.util.Event.addListener("rn_"+this.instanceID+"_Back","click",this._onBack,null,this);this._setFilters();};RightNow.Widget.Paginator.prototype={_setFilters:function()
{this._eo.w_id=this.data.info.w_id;this._eo.data.per_page=this.data.attrs.per_page;this._eo.data.page=this._currentPage;this._eo.filters.report_id=this.data.attrs.report_id;},_onPageChange:function(evt,pageNumber)
{YAHOO.util.Event.preventDefault(evt);if(this._currentlyChangingPage||!pageNumber||pageNumber===this._currentPage)
return;this._currentlyChangingPage=true;RightNow.Event.fire("evt_searchInProgressRequest",this._eo);pageNumber=(pageNumber<1)?1:pageNumber;this._eo.data.page=this._currentPage=pageNumber;RightNow.Event.fire("evt_pageRequest",this._eo);},_onForward:function(evt)
{YAHOO.util.Event.preventDefault(evt);if(this._currentlyChangingPage)return;this._currentlyChangingPage=true;RightNow.Event.fire("evt_searchInProgressRequest",this._eo);this._currentPage++;this._eo.data.page=this._currentPage;RightNow.Event.fire("evt_pageRequest",this._eo);},_onBack:function(evt)
{YAHOO.util.Event.preventDefault(evt);if(this._currentlyChangingPage)return;this._currentlyChangingPage=true;RightNow.Event.fire("evt_searchInProgressRequest",this._eo);this._currentPage--;this._eo.data.page=this._currentPage;RightNow.Event.fire("evt_pageRequest",this._eo);},_onReportChanged:function(type,args)
{var newData=args[0];newData=newData.data;if(args[0].filters.report_id==this.data.attrs.report_id)
{this._currentPage=newData.page;var totalPages=newData.total_pages;if(totalPages<2||newData.truncated)
YAHOO.util.Dom.addClass("rn_"+this.instanceID,"rn_Hidden");else
{var pagesContainer=document.getElementById("rn_"+this.instanceID+"_Pages");if(pagesContainer)
{pagesContainer.innerHTML="";var startPage,endPage;if(this.data.attrs.maximum_page_links===0)
startPage=endPage=this._currentPage;else if(totalPages>this.data.attrs.maximum_page_links)
{var split=Math.round(this.data.attrs.maximum_page_links/2);if(this._currentPage<=split)
{startPage=1;endPage=this.data.attrs.maximum_page_links;}
else
{var offsetFromMiddle=this._currentPage-split;var maxOffset=offsetFromMiddle+this.data.attrs.maximum_page_links;if(maxOffset<=newData.total_pages)
{startPage=1+offsetFromMiddle;endPage=maxOffset;}
else
{startPage=newData.total_pages-(this.data.attrs.maximum_page_links-1);endPage=newData.total_pages;}}}
else
{startPage=1;endPage=totalPages;}
for(var i=startPage,link,titleString;i<=endPage;i++)
{if(i===this._currentPage)
{link=document.createElement("span");YAHOO.util.Dom.addClass(link,"rn_CurrentPage");link.innerHTML=i;}
else
{link=document.createElement("a");link.id="rn_"+this.instanceID+"_PageLink_"+i;link.href=this.data.js.pageUrl+i;link.innerHTML=i;titleString=this.data.attrs.label_page;if(titleString)
{titleString=titleString.replace(/%s/,i);titleString=titleString.replace(/%s/,newData.total_pages);link.title=titleString;}}
pagesContainer.appendChild(link);YAHOO.util.Event.addListener(link,"click",this._onPageChange,i,this);}
YAHOO.util.Dom.removeClass("rn_"+this.instanceID,"rn_Hidden");}}
var forwardButton=document.getElementById("rn_"+this.instanceID+"_Forward");if(forwardButton)
{if(newData.total_pages>newData.page)
{YAHOO.util.Dom.removeClass(forwardButton,"rn_Hidden");forwardButton.href=this.data.js.pageUrl+(this._currentPage+1);}
else
YAHOO.util.Dom.addClass(forwardButton,"rn_Hidden","rn_Hidden");}
var backButton=document.getElementById("rn_"+this.instanceID+"_Back");if(backButton)
{if(newData.page>1)
{YAHOO.util.Dom.removeClass(backButton,"rn_Hidden");backButton.href=this.data.js.pageUrl+(this._currentPage-1);}
else
YAHOO.util.Dom.addClass(backButton,"rn_Hidden");}}
this._currentlyChangingPage=false;}};
