Ext.ns('DJIndexes');DJIndexes.Utils=function(){function _init(){sidebar();fileListHelper();}function sidebar(){var main=Ext.get('main-content');var s=Ext.select('.sidebar');if(main&&s.getCount()==1){var maxHeight=0;sidebar=Ext.get(s.elements[0]);maxHeight=Math.max(maxHeight,main.getComputedHeight());maxHeight=Math.max(maxHeight,sidebar.getComputedHeight());main.setHeight(maxHeight);sidebar.setHeight(maxHeight,true);}}function fileListHelper(){Ext.each(Ext.select('.file-list').elements,function(dropdown){Ext.get(dropdown).addListener('change',function(e,el){e.preventDefault();var url=el.value||'';if(url!==''){el.selectedIndex=0;top.location=url;}},this);});}function numberFormatter(format){var _format=(format)?format:'0.00';return{decimal:function(val){return Ext.util.Format.number(val,_format);},change:function(val){var v=Ext.util.Format.undef(val);var f=Ext.util.Format.number(v,_format);if(v>0){return'<span style="color:#009900;">'+f+'</span>';}else if(v<0){return'<span style="color:#bb0000;">'+f+'</span>';}else{return f;}return val;}}}function stringFormatter(removeList){var _removeList=(removeList)?removeList:['TM','SM'];return{indexname:function(val){try{Ext.each(_removeList,function(i){if(val.match(i)){var r=new RegExp(i,'g');val=val.replace(r,'');}});}catch(e){}return Ext.util.Format.trim(val);}}}function popup(url,id,width,height){var _width=width||1010;var _height=height||585;var _props='height='+_height+',width='+_width+',status=0,toolbar=0,location=0,menubar=0,directories=0,resizable=0,scrollbars=0';var _id=id||'popup';window.open(url,_id,_props);}function getQueryParams(paramName){var qp={};var params=location.search.substring(1).split('&');for(var i=0;i<params.length;i++){var nv=params[i].split('=');qp[nv[0]]=nv[1];}if(paramName){return qp[paramName];}return qp;}return{init:_init,popup:popup,numberFormatter:numberFormatter,stringFormatter:stringFormatter,getQueryParams:getQueryParams}}();Ext.onReady(DJIndexes.Utils.init,DJIndexes.Utils);