
pde={pdeClass:'pde',hideClass:'hide',showClass:'show',parentClass:'parent',currentClass:'current',openImage:'/admin/badivision/images/minus.gif',closedImage:'/admin/badivision/images/plus.gif',openMessage:'Close section',closedMessage:'Open section',keepCurrentOpen:true,linkParent:true,init:function(){pde.createClone();if(!document.getElementById||!document.createTextNode){return;}
var uls=document.getElementsByTagName('ul');for(var i=0;i<uls.length;i++){var inneruls,parentLI;if(!pde.cssjs('check',uls[i],pde.pdeClass)){continue;}
var inneruls=uls[i].getElementsByTagName('ul');for(var j=0;j<inneruls.length;j++){parentLI=inneruls[j].parentNode;if(parentLI.getElementsByTagName('strong')[0]){pde.cssjs('add',parentLI,pde.currentClass);if(pde.keepCurrentOpen===true){continue;}}
pde.cssjs('add',parentLI,pde.parentClass);parentLI.insertBefore(pde.clone.cloneNode(true),parentLI.firstChild);pde.cssjs('add',inneruls[j],pde.hideClass);pde.addEvent(parentLI.getElementsByTagName('a')[0],'click',pde.showhide,false);parentLI.getElementsByTagName('a')[0].onclick=function(){return false;}
if(pde.linkParent){pde.addEvent(parentLI.getElementsByTagName('a')[1],'click',pde.showhide,false);parentLI.getElementsByTagName('a')[1].onclick=function(){return false;}}}}},showhide:function(e){var image,message;var elm=pde.getTarget(e);var ul=elm.parentNode.getElementsByTagName('ul')[0];var img=elm.parentNode.getElementsByTagName('img')[0];if(pde.cssjs('check',ul,pde.hideClass)){message=pde.openMessage;image=pde.openImage;pde.cssjs('remove',elm.parentNode.getElementsByTagName('ul')[0],pde.hideClass);pde.cssjs('add',elm.parentNode.getElementsByTagName('ul')[0],pde.showClass);}else{message=pde.closedMessage;image=pde.closedImage;pde.cssjs('remove',elm.parentNode.getElementsByTagName('ul')[0],pde.showClass);pde.cssjs('add',elm.parentNode.getElementsByTagName('ul')[0],pde.hideClass);}
img.setAttribute('src',image);img.setAttribute('alt',message);img.setAttribute('title',message);pde.cancelClick(e);},createClone:function(){pde.clone=document.createElement('a');pde.clone.setAttribute('href','#');pde.clone.appendChild(document.createElement('img'));pde.clone.getElementsByTagName('img')[0].src=pde.closedImage;pde.clone.getElementsByTagName('img')[0].alt=pde.closedMessage;pde.clone.getElementsByTagName('img')[0].title=pde.closedMessage;},getTarget:function(e){var target=window.event?window.event.srcElement:e?e.target:null;if(!target){return false;}
if(target.nodeName.toLowerCase()!='a'){target=target.parentNode;}
return target;},cancelClick:function(e){if(window.event){window.event.cancelBubble=true;window.event.returnValue=false;return;}
if(e){e.stopPropagation();e.preventDefault();}},addEvent:function(elm,evType,fn,useCapture){if(elm.addEventListener)
{elm.addEventListener(evType,fn,useCapture);return true;}else if(elm.attachEvent){var r=elm.attachEvent('on'+evType,fn);return r;}else{elm['on'+evType]=fn;}},cssjs:function(a,o,c1,c2){switch(a){case'swap':o.className=!pde.cssjs('check',o,c1)?o.className.replace(c2,c1):o.className.replace(c1,c2);break;case'add':if(!pde.cssjs('check',o,c1)){o.className+=o.className?' '+c1:c1;}
break;case'remove':var rep=o.className.match(' '+c1)?' '+c1:c1;o.className=o.className.replace(rep,'');break;case'check':return new RegExp("(^|\s)"+c1+"(\s|$)").test(o.className)
break;}}}
pde.addEvent(window,'load',pde.init,false);function Node(id,pid,name,url,title,target,icon,iconOpen,onMouseOver,onMouseOut,open){this.id=id;this.pid=pid;this.name=name;this.url=url;this.title=title;this.target=target;this.icon=icon;this.iconOpen=iconOpen;this.onMouseOver=onMouseOver;this.onMouseOut=onMouseOut;this._isOpen=open||false;this._isSelected=false;this._isLastSibling=false;this._hasChildren=false;this._ai=0;this._parent=false;};function dTree(objName){this.config={target:null,folderLinks:true,useSelection:true,useCookies:true,useLines:true,useIcons:true,useStatusText:false,closeSameLevel:false,inOrder:false}
this.icon={root:'/admin/badivision/images/empty.gif',folder:'/admin/badivision/images/slim.gif',folderOpen:'/admin/badivision/images/slim.gif',node:'/admin/badivision/images/slim.gif',empty:'/admin/badivision/images/empty.gif',line:'/admin/badivision/images/line.gif',join:'/admin/badivision/images/join.gif',joinBottom:'/admin/badivision/images/joinbottom.gif',plus:'/admin/badivision/images/plus.gif',plusBottom:'/admin/badivision/images/plus.gif',minus:'/admin/badivision/images/minus.gif',minusBottom:'/admin/badivision/images/minus.gif',nlPlus:'/admin/badivision/images/slim.gif',nlMinus:'/admin/badivision/images/slim.gif'};this.obj=objName;this.aNodes=[];this.aIndent=[];this.root=new Node(-1);this.selectedNode=null;this.selectedFound=false;this.completed=false;};dTree.prototype.add=function(id,pid,name,url,title,target,icon,iconOpen,onMouseOver,onMouseOut,open){this.aNodes[this.aNodes.length]=new Node(id,pid,name,url,title,target,icon,iconOpen,onMouseOver,onMouseOut,open);};dTree.prototype.openAll=function(){this.oAll(true);};dTree.prototype.closeAll=function(){this.oAll(false);};dTree.prototype.toString=function(){var str='<table width="100%" border="0" cellspacing="0" cellpadding="0">\n';if(document.getElementById){if(this.config.useCookies)this.selectedNode=this.getSelected();str+=this.addNode(this.root);}else str+='Browser not supported.';str+='</td></tr><tr><tr>&nbsp;</td></tr>';if(!this.selectedFound)this.selectedNode=null;this.completed=true;return str;};dTree.prototype.addNode=function(pNode){var str='';var n=0;if(this.config.inOrder)n=pNode._ai;for(n;n<this.aNodes.length;n++){if(this.aNodes[n].pid==pNode.id){var cn=this.aNodes[n];cn._parent=pNode;cn._ai=n;this.setCS(cn);if(!cn.target&&this.config.target)cn.target=this.config.target;if(cn._hasChildren&&!cn._isOpen&&this.config.useCookies)cn._isOpen=this.isOpen(cn.id);if(!this.config.folderLinks&&cn._hasChildren)cn.url=null;if(this.config.useSelection&&cn.id==this.selectedNode&&!this.selectedFound){cn._isSelected=true;this.selectedNode=n;this.selectedFound=true;}
str+=this.node(cn,n);if(cn._isLastSibling)break;}}
return str;};dTree.prototype.node=function(node,nodeId){if(this.root.id==node.pid){var str='<tr><td class="leftboxtitle">'+node.name+'</td></tr><tr><td style="padding-left:10px;">\n';}
else{var str='<div class="dTreeNode">'+this.indent(node,nodeId);if(this.config.useIcons){if(!node.icon)node.icon=(this.root.id==node.pid)?this.icon.root:((node._hasChildren)?this.icon.folder:this.icon.node);if(!node.iconOpen)node.iconOpen=(node._hasChildren)?this.icon.folderOpen:this.icon.node;str+='<img  border="0" id="i'+this.obj+nodeId+'" src="'+((node._isOpen)?node.iconOpen:node.icon)+'" alt="" />';}
if(node.url){str+='<a id="s'+this.obj+nodeId+'" class="'+((this.config.useSelection)?((node._isSelected?'nodeSel':'node')):'node')+'" href="'+node.url+'"';if(node.title)str+=' title="'+node.title+'"';if(node.target)str+=' target="'+node.target+'"';if(node.onMouseOver&&node.onMouseOut)str+=' onmouseover="'+node.onMouseOver+'" onmouseout="'+node.onMouseOut+'" ';else if(this.config.useStatusText)str+=' onmouseover="window.status=\''+node.name+'\';return true;" onmouseout="window.status=\'\';return true;" ';if(this.config.useSelection&&((node._hasChildren&&this.config.folderLinks)||!node._hasChildren))
str+=' onclick="javascript:'+this.obj+'.s('+nodeId+');"';str+='>';}
else if((!this.config.folderLinks||!node.url)&&node._hasChildren&&node.pid!=this.root.id)
str+='<a href="#" onclick="'+this.obj+'.o('+nodeId+'); return false;" class="node">';str+=node.name;if(node.url||((!this.config.folderLinks||!node.url)&&node._hasChildren))str+='</a>';str+='</div>';}
if(node._hasChildren){str+='<div id="d'+this.obj+nodeId+'" class="clip" style="display:'+((this.root.id==node.pid||node._isOpen)?'block':'none')+';">';str+=this.addNode(node);str+='</div>';}
this.aIndent.pop();return str;};dTree.prototype.indent=function(node,nodeId){var str='';if(this.root.id!=node.pid){for(var n=0;n<this.aIndent.length;n++)
str+='<img  border="0" src="'+((this.aIndent[n]==1&&this.config.useLines)?this.icon.line:this.icon.empty)+'" alt="" />';(node._isLastSibling)?this.aIndent.push(0):this.aIndent.push(1);if(node._hasChildren){str+='<a href="#" onclick="'+this.obj+'.o('+nodeId+'); return false;"><img  border="0" id="j'+this.obj+nodeId+'" src="';if(!this.config.useLines)str+=(node._isOpen)?this.icon.nlMinus:this.icon.nlPlus;else str+=((node._isOpen)?((node._isLastSibling&&this.config.useLines)?this.icon.minusBottom:this.icon.minus):((node._isLastSibling&&this.config.useLines)?this.icon.plusBottom:this.icon.plus));str+='" alt="" /></a>';}else str+='<img  border="0" src="'+((this.config.useLines)?((node._isLastSibling)?this.icon.joinBottom:this.icon.join):this.icon.empty)+'" alt="" />';}
return str;};dTree.prototype.setCS=function(node){var lastId;for(var n=0;n<this.aNodes.length;n++){if(this.aNodes[n].pid==node.id)node._hasChildren=true;if(this.aNodes[n].pid==node.pid)lastId=this.aNodes[n].id;}
if(lastId==node.id)node._isLastSibling=true;};dTree.prototype.getSelected=function(){var sn=this.getCookie('cs'+this.obj);return(sn)?sn:null;};dTree.prototype.s=function(id){if(!this.config.useSelection)return;var cn=this.aNodes[id];if(cn._hasChildren&&!this.config.folderLinks)return;if(this.selectedNode!=id){if(this.selectedNode||this.selectedNode==0){eOld=document.getElementById("s"+this.obj+this.selectedNode);eOld.className="node";}
eNew=document.getElementById("s"+this.obj+id);eNew.className="nodeSel";this.selectedNode=id;if(this.config.useCookies)this.setCookie('cs'+this.obj,cn.id);}};dTree.prototype.o=function(id){var cn=this.aNodes[id];this.nodeStatus(!cn._isOpen,id,cn._isLastSibling);cn._isOpen=!cn._isOpen;if(this.config.closeSameLevel)this.closeLevel(cn);if(this.config.useCookies)this.updateCookie();};dTree.prototype.oAll=function(status){for(var n=0;n<this.aNodes.length;n++){if(this.aNodes[n]._hasChildren&&this.aNodes[n].pid!=this.root.id){this.nodeStatus(status,n,this.aNodes[n]._isLastSibling)
this.aNodes[n]._isOpen=status;}}
if(this.config.useCookies)this.updateCookie();};dTree.prototype.openTo=function(nId,bSelect,bFirst){if(!bFirst){for(var n=0;n<this.aNodes.length;n++){if(this.aNodes[n].id==nId){nId=n;break;}}}
var cn=this.aNodes[nId];if(cn.pid==this.root.id||!cn._parent)return;cn._isOpen=true;cn._isSelected=bSelect;if(this.completed&&cn._hasChildren)this.nodeStatus(true,cn._ai,cn._isLastSibling);if(this.completed&&bSelect)this.s(cn._ai);else if(bSelect)this._sn=cn._ai;this.openTo(cn._parent._ai,false,true);};dTree.prototype.closeLevel=function(node){for(var n=0;n<this.aNodes.length;n++){if(this.aNodes[n].pid==node.pid&&this.aNodes[n].id!=node.id&&this.aNodes[n]._hasChildren){this.nodeStatus(false,n,this.aNodes[n]._isLastSibling);this.aNodes[n]._isOpen=false;this.closeAllChildren(this.aNodes[n]);}}}
dTree.prototype.closeAllChildren=function(node){for(var n=0;n<this.aNodes.length;n++){if(this.aNodes[n].pid==node.id&&this.aNodes[n]._hasChildren){if(this.aNodes[n]._isOpen)this.nodeStatus(false,n,this.aNodes[n]._isLastSibling);this.aNodes[n]._isOpen=false;this.closeAllChildren(this.aNodes[n]);}}}
dTree.prototype.nodeStatus=function(status,id,bottom){eDiv=document.getElementById('d'+this.obj+id);eJoin=document.getElementById('j'+this.obj+id);if(this.config.useIcons){eIcon=document.getElementById('i'+this.obj+id);eIcon.src=(status)?this.aNodes[id].iconOpen:this.aNodes[id].icon;}
eJoin.src=(this.config.useLines)?((status)?((bottom)?this.icon.minusBottom:this.icon.minus):((bottom)?this.icon.plusBottom:this.icon.plus)):((status)?this.icon.nlMinus:this.icon.nlPlus);eDiv.style.display=(status)?'block':'none';};dTree.prototype.clearCookie=function(){var now=new Date();var yesterday=new Date(now.getTime()-1000*60*60*24);this.setCookie('co'+this.obj,'cookieValue',yesterday);this.setCookie('cs'+this.obj,'cookieValue',yesterday);};dTree.prototype.setCookie=function(cookieName,cookieValue,expires,path,domain,secure){document.cookie=escape(cookieName)+'='+escape(cookieValue)
+(expires?'; expires='+expires.toGMTString():'')
+(path?'; path='+path:'')
+(domain?'; domain='+domain:'')
+(secure?'; secure':'');};dTree.prototype.getCookie=function(cookieName){var cookieValue='';var posName=document.cookie.indexOf(escape(cookieName)+'=');if(posName!=-1){var posValue=posName+(escape(cookieName)+'=').length;var endPos=document.cookie.indexOf(';',posValue);if(endPos!=-1)cookieValue=unescape(document.cookie.substring(posValue,endPos));else cookieValue=unescape(document.cookie.substring(posValue));}
return(cookieValue);};dTree.prototype.updateCookie=function(){var str='';for(var n=0;n<this.aNodes.length;n++){if(this.aNodes[n]._isOpen&&this.aNodes[n].pid!=this.root.id){if(str)str+='.';str+=this.aNodes[n].id;}}
this.setCookie('co'+this.obj,str);};dTree.prototype.isOpen=function(id){var aOpen=this.getCookie('co'+this.obj).split('.');for(var n=0;n<aOpen.length;n++)
if(aOpen[n]==id)return true;return false;};if(!Array.prototype.push){Array.prototype.push=function array_push(){for(var i=0;i<arguments.length;i++)
this[this.length]=arguments[i];return this.length;}};if(!Array.prototype.pop){Array.prototype.pop=function array_pop(){lastElement=this[this.length-1];this.length=Math.max(this.length-1,0);return lastElement;}};function stripChars(str)
{regx=/[\$\:\^\<\>\[\]\!\#\%\&\*\(\)\=\|\;\?\.\,]/g;return str.replace(regx," ");}
function stripSingleOperators(str)
{regx=/\s*\-\s/g
return str.replace(regx,"");}
function fixupLonelyQuotes(str)
{var quotes=str.match(/"/g);if(quotes!=null&&quotes.length%2==1)
{return str+"\"";}
else
{return str;}}
function sendSearch()
{var query=document.getElementById("search").value
var newQuery=stripChars(query)
newQuery=stripSingleOperators(newQuery)
newQuery=fixupLonelyQuotes(newQuery)
document.getElementById("search").value=newQuery
var searchform=document.getElementById("searchForm")
searchform.submit()}
function keyDown(event)
{var keycode=0;if(window.event)
{keycode=window.event.keyCode;}
else if(event)
{keycode=event.which;}
if(keycode==13)
{sendSearch();}}
