/* 
﻿Copyright © 1998, 2012, Oracle and/or its affiliates.  All rights reserved.*/ 
var _workerFunction="",_errorFunction="",_extraInfo="",_req,_url;
function AbsUrl(b){for(var d=0;d<b.length;d++){c=b.substr(d,1);if(c==":")return b}base=window.location.href;d=base.indexOf("?");var e=base.indexOf("#");if(d>=0||e>=0)base=d>=0&&e>=0?base.substr(0,d<e?d:e):d>=0?base.substr(0,d):base.substr(0,e);if(b.substr(0,3)=="../"){d=base.lastIndexOf("/");for(base=base.substr(0,d);b.substr(0,3)=="../";){d=base.lastIndexOf("/");base=base.substr(0,d);b=b.substr(3)}}else{if(b.substr(0,1)=="/")b=b.substr(1);d=base.lastIndexOf("/");base=base.substr(0,d)}return base=
base+"/"+b}
function LoadXMLDoc(b,d,e,h){_workerFunction=d;_errorFunction=e;_extraInfo=h;_url=AbsUrl(b);_req=null;try{if(window.location.href.substr(0,7).toLowerCase()=="http://"||window.location.href.substr(0,8).toLowerCase()=="https://")_req=new XMLHttpRequest;if(window.location.href.substr(0,7).toLowerCase()=="file://"&&IsTouchDevice())_req=new XMLHttpRequest}catch(g){}finally{if(_req==null)_req=new ActiveXObject("Microsoft.XMLHTTP")}_req.onreadystatechange=state_Change;_req.open("GET",_url,true);_req.send(null)}
function state_Change(){if(_req.readyState==4)if(_req.status==200)eval(_workerFunction+"(_req,_extraInfo)");else if(_req.status==0){if(_req.responseXML.documentElement==null){var b=new ActiveXObject("Microsoft.XMLDOM");b.async=false;b.loadXML(_req.responseText);_req={};_req.responseXML=b}eval(_workerFunction+"(_req,_extraInfo)")}else if(_url.substr(0,3)=="../")LoadXMLDoc(_url.substr(3),_workerFunction,_errorFunction,_extraInfo);else if(_errorFunction.length>0){alert(_url+" not found. Logged...");
eval(_errorFunction+"(_extraInfo)")}else alert("Problem retrieving data: "+_req.statusText)}var _returnFunction="",_nodes,_nodesArray=[];function LoadXMLDocArray(b,d,e,h,g){_returnFunction=d;_nodeName=h;g?LoadXMLDoc(b,"XMLDocArrayWorker2",e,h):LoadXMLDoc(b,"XMLDocArrayWorker",e,h)}
function XMLDocArrayWorker(b,d){_nodesArray=[];_nodes=b.responseXML.getElementsByTagName(d);for(var e=0;e<_nodes.length;e++){n=_nodes[e];(s=n.textContent?n.textContent:n.text)||(s="");k=s.length;if(k>=2)if(s.substr(0,1)=='"'&&s.substr(k-1,1)=='"')s=ss=s.substr(1,k-2);_nodesArray[_nodesArray.length]=s}sfn=_returnFunction+"(_nodesArray)";setTimeout(sfn,1)}
function XMLDocArrayWorker2(b,d){_nodesArray=[];_nodes=b.responseXML.getElementsByTagName(d);for(var e=0;e<_nodes.length;e++){n=_nodes[e];xmlname=n.attributes[0].nodeValue;xmltext="";for(var h=0;h<n.childNodes.length;h++)if(n.childNodes[h].xml)xmltext+=n.childNodes[h].xml;else{var g=new XMLSerializer;xmltext+=g.serializeToString(n.childNodes[h])}_nodesArray[_nodesArray.length]=xmlname+"="+xmltext}sfn=_returnFunction+"(_nodesArray)";setTimeout(sfn,1)};datasourceroot="querydb/";ConvertDbSelector={t:"text",u:"ctxod",e:"ctxex",r:"role",g:"genctx"};var q_search_and=" and ",q_search_or=" or ";
function ToHalfWidth(b){for(var d="",e=0;e<b.length;e++){var h="\u30f2\u30a1\u30a3\u30a5\u30a7\u30a9\u30e3\u30e5\u30e7\u30c3\u30fc\u30a2\u30a4\u30a6\u30a8\u30aa\u30ab\u30ad\u30af\u30b1\u30b3\u30b5\u30b7\u30b9\u30bb\u30bd\u30bf\u30c1\u30c4\u30c6\u30c8\u30ca\u30cb\u30cc\u30cd\u30ce\u30cf\u30d2\u30d5\u30d8\u30db\u30de\u30df\u30e0\u30e1\u30e2\u30e4\u30e6\u30e8\u30e9\u30ea\u30eb\u30ec\u30ed\u30ef\u30f3".indexOf(b.charAt(e));d+=h!=-1?"\uff66\uff67\uff68\uff69\uff6a\uff6b\uff6c\uff6d\uff6e\uff6f\uff70\uff71\uff72\uff73\uff74\uff75\uff76\uff77\uff78\uff79\uff7a\uff7b\uff7c\uff7d\uff7e\uff7f\uff80\uff81\uff82\uff83\uff84\uff85\uff86\uff87\uff88\uff89\uff8a\uff8b\uff8c\uff8d\uff8e\uff8f\uff90\uff91\uff92\uff93\uff94\uff95\uff96\uff97\uff98\uff99\uff9a\uff9b\uff9c\uff9d".charAt(h):
b.charCodeAt(e)>=65281&&b.charCodeAt(e)<=65375?String.fromCharCode(b.charCodeAt(e)-65248):b.charAt(e)}return d}
var QueryParser={PS:null,PT:[0,[2,3,0,0,0,0,4],[-1,-1,-1,-1,5,-1,0],[2,3,0,0,0,0,6],[0,0,0,7,0,10,0],[-2,-2,-2,-2,-2,-2,0],[0,0,8,7,0,0,0],[2,3,0,0,0,0,9],[-4,-4,-4,-4,-4,-4,0],[-3,-3,-3,-3,-3,-3,0]],Parse:function(b,d){if(window.R_search_AND)q_search_and=" "+R_search_AND.toLowerCase()+" ";if(window.R_search_OR)q_search_or=" "+R_search_OR.toLowerCase()+" ";var e,h;if("URI"==b){e=/\(|\)|\+|-|[u,e,k,r,g]|!|\d|'[^']+'/g;h=["(",")","+","-","u","e","t","r","g","!","0","1","2","3","4","5","6","7","8","9"]}else{e=
RegExp("\\(|\\)|"+q_search_and+"|"+q_search_or+'|"[^"]+"|[^ \\(\\)]+(?=\\(|\\)|\\s|$)',"gi");h=["(",")",q_search_and,q_search_or]}var g=[1,2,3,3,5,5,5,5,5,4,4,4,4,4,4,4,4,4,4,4],i=[0,0,"&","|",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];if(b!="URI"){d=ToHalfWidth(d);d=d.toLowerCase()}this.pr=this.ev=null;this.PS=[];this.PS.push({st:1,se:0});for(var m,o,p=0,u="t";(m=e.exec(d))!=null;){m=m[0];var q=0;for(o in h)if(m==h[o]){q=g[o];if(i[o])m=i[o];break}if(q==5)u=m;else{if(q==3)p=0;if((q==0||q==1)&&p){if(this.SM(3,
"&"))return;p=0}if(q==0){if(m.charAt(0)=='"'||m.charAt(0)=="'")m=m.slice(1,m.length-1);if("URI"!=b){if(m.length>1){p=m[m.length-1];if(p=="%"||p=="*")m=m.slice(0,-1)}m=Escape.MyEscape(m.toLowerCase())}m=u+m;p=1}if(this.SM(q,m))return}}if(!this.SM(5,"$")){this.ev=this.PS[1].se.ev;this.pr=this.PS[1].se.pr}},SM:function(b,d){for(;;){var e=this.PT[this.PS[this.PS.length-1].st][b];if(e==10)return false;if(e==0)return true;if(e>0){this.PS.push({st:e,se:d});return false}if(e<0){var h,g=this.PS.length,i=this.PS[g-
1],m=this.PS[g-2];g=this.PS[g-3];switch(-e){case 1:h={ev:"{a:'s', d:'"+i.se.charAt(0)+"', p:'"+i.se.slice(1)+"'}",pr:i.se.slice(1)};break;case 2:if(i.se=="!")h={ev:"{a:'s', d:'"+m.se.charAt(0)+"', p:'"+m.se.slice(1)+"', m:'"+i.se+"'}"};else{h=m.se.slice(1,parseInt(i.se)+1)+"$002A";h={ev:"{a:'s', d:'"+m.se.charAt(0)+"', p:'"+m.se.slice(1)+"'}, {a:'s', d:'"+m.se.charAt(0)+"', p:'"+h+"'}, {a:'o', p:'|'}"}}h.pr=m.se.slice(1);break;case 3:h={ev:g.se.ev+", "+i.se.ev+", {a:'o', p:'"+m.se+"'}",pr:g.se.pr+
(m.se=="|"?" or ":" ")+i.se.pr};break;case 4:h={ev:m.se.ev,pr:"("+m.se.pr+")"};e=-3}if(e==-1||e==-2){h.pr=decodeURIComponent(h.pr);if(h.pr.search(/\s/)!=-1)h.pr='"'+h.pr+'"'}this.PS.length+=e;this.PS.push({st:this.PT[this.PS[this.PS.length-1].st][6],se:h})}}},o:function(b,d,e){debug.insertAdjacentHTML("beforeEnd","<div>"+b+", "+d+", "+e+"</div>");return d+b+e},e:function(b,d,e){e||(e="");d=decodeURIComponent(d);debug.insertAdjacentHTML("beforeEnd","<div>"+b+", "+d+", "+e+"</div>");return b+"="+d+
e}},QueryProcessor={rr:null,Start:function(b,d){this.rr=d;eval("this.qa = ["+b+"]");this.qp=0;this.Eval()},Eval:function(){var b=this.qa[this.qp];if(b.a=="s"){var d=b.d=="t"?false:true;if(b.m=="!")d=!d;SearchDBs[b.d].Search(decodeURIComponent(b.p),d)}else if(b.a=="o"){b.p=="&"?this.qa[this.qp-2].And(this.qa[this.qp-1]):this.qa[this.qp-2].Or(this.qa[this.qp-1]);this.qp-=2;this.qa.splice(this.qp+1,2);this.Next()}},Next:function(){if(this.qa.length==1)this.rr(this.qa[0].rs);else{this.qp++;this.Eval()}},
ReportResult:function(b){this.qa[this.qp]=b;this.Next()}};function ReadBase64_6(b){if(b==43)return 62;if(b==45)return 63;if(b<58)return b-48;return b<91?b-55:b-61}function ReadBase64_32(b){var d,e;e=0;for(d=32;d&32;){d=ReadBase64_6(b.s.charCodeAt(b.p));e<<=5;e|=d&31;b.p++}return e}function ReadBase64_ITP(b,d){for(var e=[],h,g,i=0;b.p<b.s.length;){g=ReadBase64_32(b);for(h=1==g?ReadBase64_32(b):1;h;){i+=g;e.push(new d(i));h--}}return e}
function SearchDB(b){this.db_id=b;this.ResetIndex();this.request_count=this.request_total=0}SearchDB.prototype.ResetIndex=function(){this.index=[];this.index.push({key:null,node:"1"})};
SearchDB.prototype.k=function(b){for(var d="",e=0;e<b.length;e++){var h={s:b[e],p:0},g,i="";g=ReadBase64_32(h);var m;m=e==b.length-1?this.index[this.index_insert_position]:{};m.node=g>0?h.s.slice(h.p,h.p+g):0;h.p+=g;g=ReadBase64_32(h);i+=d.slice(0,g);g=ReadBase64_32(h);i+=h.s.slice(h.p,h.p+g);h.p+=g;if(i.length>0)m.key=i;for(d=i;h.p<h.s.length;){m.values=[];g=ReadBase64_32(h);m.values.push(h.s.slice(h.p,h.p+g));h.p+=g}if(e<b.length-1){this.index.splice(this.index_insert_position,0,m);this.index_insert_position++}}this.d()};
SearchDB.prototype.LoadScript=function(b){CDB=this;LoadXMLDocArray(datasourceroot+ConvertDbSelector[this.db_id]+"/"+b+".xml","SearchDBs."+this.db_id+".LoadScript_Callback","","N");this.request_total++;this.request_count++};SearchDB.prototype.LoadScript_Callback=function(b){CDB=this;CDB.k(b)};SearchDB.prototype.Search=function(b,d){this.RequestCount=0;this.search=b;this.exact_match=d;this.results=new SearchResultSet;if(this.search.length!=0){this.index_match=0;this.d=this.d1;this.d()}};
SearchDB.prototype.IndexSearch=function(){var b;for(b=this.index_match;b<this.index.length;b++)if(null==this.index[b].key||this.search<=this.index[b].key)break;this.index_match=b};
SearchDB.prototype.d1=function(){this.IndexSearch();if(null!=this.index[this.index_match].key&&this.search==this.index[this.index_match].key)if(!this.exact_match&&this.index[this.index_match].values.length<2){this.d=this.d2;this.d()}else{var b=this.index[this.index_match].values,d;for(d in b){this.results.Or(new SearchResultSet(b[d]));if(this.exact_match)break}QueryProcessor.ReportResult(this.results)}else if(this.index[this.index_match].node!=0){this.index_insert_position=this.index_match;this.LoadScript(this.index[this.index_match].node)}else if(this.exact_match)QueryProcessor.ReportResult(this.results);
else{this.d=this.d2;this.d()}};SearchDB.prototype.d2=function(){if(null==this.index[this.index_match].key||this.index[this.index_match].key.substring(0,this.search.length)!=this.search&&this.index[this.index_match].node==0)QueryProcessor.ReportResult(this.results);else if(this.index[this.index_match].node==0){this.results.Or(new SearchResultSet(this.index[this.index_match].values[0]));this.index_match++;this.d2()}else{this.index_insert_position=this.index_match;this.LoadScript(this.index[this.index_match].node)}};
SearchDBs={t:new SearchDB("t"),u:new SearchDB("u"),e:new SearchDB("e"),r:new SearchDB("r"),g:new SearchDB("g")};CDB=null;function SearchResult(b){this.index=b;this.weight=1}function SearchResultSet(b){this.rs=b?ReadBase64_ITP({s:b,p:0},SearchResult):[]}SearchResultSet.prototype.Or=function(b){this.AOR(b,true)};
SearchResultSet.prototype.AOR=function(b,d,e){var h,g;for(g=h=0;h<b.rs.length;h++){for(;g<this.rs.length&&this.rs[g].index<b.rs[h].index;)g++;if(g==this.rs.length||this.rs[g].index!=b.rs[h].index)this.rs.splice(g,0,b.rs[h]);else{var i=this.rs[g].weight,m=b.rs[h].weight;this.rs[g].weight=d?Math.max(i,m):i+m*e}}};
SearchResultSet.prototype.And=function(b){var d,e;for(e=d=0;d<b.rs.length&&e<this.rs.length;d++){for(;e<this.rs.length&&this.rs[e].index<b.rs[d].index;)this.rs.splice(e,1);if(e<this.rs.length&&b.rs[d].index==this.rs[e].index){this.rs[e].weight=Math.min(this.rs[e].weight,b.rs[d].weight);e++}}this.rs.splice(e,this.rs.length-e)};var treeControlDB=false,bigsco=false;function ModeDesc(b){this.treeCreated=false;this.lastSelected=null;this.filteredGuids=[];this.filteredGuidList=[];this.filteredTopicCount=0;this.guidsForFlat=[];this.lastSelectedFlat=null;this.flatMode=false;this.modeLetter=b;this.flatControl=this.treeControl=null}var modeDescA=new ModeDesc("A"),modeDescF=new ModeDesc("F"),modeDescH=new ModeDesc("H"),modeDescFH=new ModeDesc("X"),treeViewMode="ALL",treeIsEmpty,_rootData="";
function GetJunctionId(b){k=b.indexOf("_");kk=b.indexOf("_",k+1);return ss=b.substr(0,kk)}var filteredGuidsR=[],filteredTopicCountR=0,rolefilter_enabled=false,selection_need=0,stl_mode="ALL",stl_callback="",stl_myTopicArray=[],stl_myscoresArray=[],stl_i=0,stl_topicMapId=-1,stl_newtMap=false,stl_topicMapPageLen=-1,global_topicMap=[],seeAlsoSelection=0,_lastChangeIsFilterOnly=false;
function SetTopicList(b,d,e){stl_mode=b;stl_callback=e;_lastChangeIsFilterOnly=false;if(b=="FILTERED"){modeDescF.filteredGuids=[];modeDescF.filteredGuidList=[];modeDescF.filteredTopicCount=d.length;modeDescF.guidsForFlat=[];modeDescF.flatMode=true}else if(b=="HEMI"){modeDescH.filteredGuids=[];modeDescH.filteredGuidList=[];modeDescH.filteredTopicCount=d.length;modeDescH.guidsForFlat=[];modeDescH.flatMode=true}else if(b=="ROLES"){filteredGuidsR=[];filteredTopicCountR=d.length;_lastChangeIsFilterOnly=
rolefilter_enabled=true}else{rolefilter_enabled=false;_lastChangeIsFilterOnly=true;eval(stl_callback+"()");return}stl_myTopicArray=[];stl_myTopicArray=d;stl_myscoresArray=[];if(d.length>0)try{if(d[0].index){stl_myTopicArray=[];for(b=0;b<d.length;b++){stl_myTopicArray[stl_myTopicArray.length]=d[b].index;stl_myscoresArray[d[b].index]=d[b].score}}}catch(h){}stl_i=0;stl_topicMapPageLen==-1?SetTopicList_LoadPageLen():SetTopicList_Next()}
function SetTopicList_LoadPageLen(){LoadXMLDocArray("../querydb/topicmap/0.xml","SetTopicList_LoadPageLen_Return","","T")}function SetTopicList_LoadPageLen_Return(b){stl_topicMapPageLen=parseInt(b[0]);SetTopicList_Next()}
function SetTopicList_Next(){fTC=modeDescF.filteredTopicCount;if(stl_mode=="HEMI")fTC=modeDescH.filteredTopicCount;if(stl_mode=="ROLES")fTC=filteredTopicCountR;if(stl_i<fTC){j=stl_myTopicArray[stl_i];a=Math.floor((j-1)/stl_topicMapPageLen);if(global_topicMap[""+a]){stl_topicMapId=a;stl_newtMap=false;setTimeout("SetTopicList_Next2()",1)}else{stl_topicMapId=a;stl_newtMap=true;LoadXMLDocArray("../querydb/topicmap/"+a+".xml","SetTopicList_Next2","","T")}}else eval(stl_callback+"()")}
function DecodeTMapArray(b){for(var d=[],e="",h=0;h<b.length;h++)if(h==0)d[d.length]=b[h];else{var g={s:b[h],p:0};l=ReadBase64_32(g);e=str=e.substr(0,l)+g.s.substr(g.p,g.s.length);d[d.length]=str}return d}function ItemDesc(b,d,e){this.type=b;this.title=d;this.empty=e;this.found=false;this.parentguid=null;this.openable=[];this.treeitemdiv=null}
function AddItemdesc(b,d,e,h,g,i,m,o,p){l=false;try{l=d[e].title.length>0}catch(u){}if(!l){d[e]=new ItemDesc(h,g,i);if(b)b.filteredGuidList[b.filteredGuidList.length]=e;AddToIndexMap(e)}d[e].parentguid=p;if(m==true)d[e].found=true;if(o.length>0)d[e].openable[d[e].openable.length]=o}
function AddTreeItemToItemDesc(b,d){md=getModeDesc();try{if(treeViewMode=="FILTEREDHEMI"){if(!md.filteredGuids)md.filteredGuids=[];if(!md.filteredGuids[b]){md.filteredGuids[b]=new ItemDesc("","",false);md.filteredGuidList[md.filteredGuidList.length]=b}AddToIndexMap(b)}md.filteredGuids[b].treeitemdiv=d}catch(e){}saveModeDesc(md)}function GetTreeItemOfItemDesc(b){md=getModeDesc();var d=null;try{d=md.filteredGuids[b].treeitemdiv}catch(e){}return d}
function FlatItemDesc(b,d,e,h,g,i){this.type=b;this.title=d;this.empty=e;this.guid=h;this.isroot=g;i||(i=0);this.score=i}function AddFlatItemdesc(b,d,e,h,g,i,m){for(var o=0;o<b.length;o++){if(b[o].guid==d)return;if(b[o].guid.substr(0,36)==d.substr(0,36))return}b[b.length]=new FlatItemDesc(e,h,g,d,i,m)}var foundApplicableList=[],foundApplicableTable=[];
function SetTopicList_Next2(b){if(stl_newtMap)global_topicMap[""+stl_topicMapId]=DecodeTMapArray(b);j=stl_myTopicArray[stl_i];a=Math.floor((j-1)/stl_topicMapPageLen);s=global_topicMap[""+stl_topicMapId][j-a*stl_topicMapPageLen];k=s.indexOf("#");_tguid=s1=s.substr(0,k);kk=s1.lastIndexOf("/");if(kk>0)_tguid=s1.substr(kk+1);b=kk<0;var d=s.substr(k+1,1)=="C",e=s.substr(k+2,1)=="E",h={s:s.substr(k+3),p:0};l=ReadBase64_32(h);s2=h.s.substr(h.p+l);title=h.s.substr(h.p,l);type=s2;k=s2.indexOf("#");if(k>=0){type=
s2.substr(0,k);s2=s4=s2.substr(k)}else s2="";s=s1+s2;k=s.indexOf("/");h=null;if(type=="Topic"||d==true){for(;k>=0;){ss=""+s.substr(0,k);if(parent.TocFirstCall){d=_tguid.substr(0,36);if(foundApplicableTable[d]!=true){foundApplicableTable[d]=true;foundApplicableList.push(d)}}if(stl_mode=="FILTERED"){AddItemdesc(modeDescF,modeDescF.filteredGuids,ss,type,title,e,false,_tguid,h);AddItemdesc(modeDescF,modeDescF.filteredGuids,ss.substr(0,36),type,title,e,false,_tguid,h)}else if(stl_mode=="HEMI"){AddItemdesc(modeDescH,
modeDescH.filteredGuids,ss,type,title,e,false,_tguid,h);AddItemdesc(modeDescH,modeDescH.filteredGuids,ss.substr(0,36),type,title,e,false,_tguid,h)}else{AddItemdesc(null,filteredGuidsR,ss,type,title,e,false,_tguid,null);AddItemdesc(null,filteredGuidsR,ss.substr(0,36),type,title,e,false,_tguid,null)}h=ss;s=ss=s.substr(k+1);k=s.indexOf("/")}if(s.length>0){ss=s;k=s.indexOf("#");if(k>0)ss=s.substr(0,k);if(stl_mode=="FILTERED"){AddItemdesc(modeDescF,modeDescF.filteredGuids,ss,type,title,e,true,"",h);AddFlatItemdesc(modeDescF.guidsForFlat,
ss,type,title,e,b)}else if(stl_mode=="HEMI"){AddItemdesc(modeDescH,modeDescH.filteredGuids,ss,type,title,e,true,"",h);_score=stl_myscoresArray[stl_myTopicArray[stl_i]];AddFlatItemdesc(modeDescH.guidsForFlat,ss,type,title,e,b,_score)}else{AddItemdesc(null,filteredGuidsR,ss,type,title,e,true,"",null);AddItemdesc(null,filteredGuidsR,ss.substr(0,36),type,title,e,true,"",null)}}}stl_i++;SetTopicList_Next()}
function TreeViewModeLetter(){if(treeViewMode=="FILTEREDHEMI")return"X";return treeViewMode.substr(0,1)}
function IsFiltered(b,d){l=0;try{l=filteredGuidsR[b].title.length}catch(e){}roles=0;if(rolefilter_enabled)roles=l>0?1:2;if(d=="ALL")if(roles==0){treeIsEmpty=false;return true}else if(roles==1){l=false;try{l=filteredGuidsR[b].openable.length>0||filteredGuidsR[b].found}catch(h){}if(l==true)treeIsEmpty=false;return l}else return false;else if(d=="FILTERED"){l=0;try{l=modeDescF.filteredGuids[b].title.length}catch(g){}if(l==0)return false;if(roles==0){treeIsEmpty=false;return true}else if(roles==1){l=
false;try{l=Cut(modeDescF.filteredGuids[b].openable,filteredGuidsR[b].openable)||modeDescF.filteredGuids[b].found&&filteredGuidsR[b].found}catch(i){}if(l==true)treeIsEmpty=false;return l}else return false}else if(d=="HEMI"){l=0;try{l=modeDescH.filteredGuids[b].title.length}catch(m){}if(l==0)return false;if(roles==0){treeIsEmpty=false;return true}else if(roles==1){l=false;try{l=Cut(modeDescH.filteredGuids[b].openable,filteredGuidsR[b].openable)||modeDescH.filteredGuids[b].found&&filteredGuidsR[b].found}catch(o){}if(l==
true)treeIsEmpty=false;return l}else return false}else if(roles==0){l=false;try{l=Cut(modeDescF.filteredGuids[b].openable,modeDescH.filteredGuids[b].openable)||modeDescF.filteredGuids[b].found&&modeDescH.filteredGuids[b].found}catch(p){}if(l)treeIsEmpty=false;return l}else if(roles==1){l=false;try{l=Cut3(modeDescF.filteredGuids[b].openable,modeDescH.filteredGuids[b].openable,filteredGuidsR[b].openable)||modeDescF.filteredGuids[b].found&&modeDescH.filteredGuids[b].found&&filteredGuidsR[b].found}catch(u){}if(l)treeIsEmpty=
false;return l}else return false}function Cut(b,d){if(d==null)return b.length>0;for(var e=0;e<b.length;e++)for(var h=0;h<d.length;h++)if(b[e]==d[h])return true;return false}function Cut3(b,d,e){if(e==null)return Cut(b,d);for(var h=0;h<b.length;h++)for(var g=0;g<d.length;g++)for(var i=0;i<e.length;i++)if(b[h]==d[g]&&d[g]==e[i])return true;return false}
function IsOpenable(b){var d=null;if(rolefilter_enabled==true)d=filteredGuidsR[b].openable;if(treeViewMode=="ALL"){if(rolefilter_enabled){l=false;try{l=d.length>0}catch(e){}return l}return true}else{if(treeViewMode=="FILTERED"){l=true;try{l=Cut(modeDescF.filteredGuids[b].openable,d)}catch(h){}}else if(treeViewMode=="HEMI"){l=true;try{l=Cut(modeDescH.filteredGuids[b].openable,d)}catch(g){}}else l=Cut3(modeDescF.filteredGuids[b].openable,modeDescH.filteredGuids[b].openable,d);return l}}
function IsAutoExpand(){return treeViewMode=="ALL"?false:treeViewMode=="FILTERED"?modeDescF.filteredTopicCount<TreeConfig.AutoExpandLimit:treeViewMode=="FILTEREDHEMI"?modeDescF.filteredTopicCount<TreeConfig.AutoExpandLimit:modeDescH.filteredTopicCount<TreeConfig.AutoExpandLimit}var treeLoadQueue=[],treeLoadQueueDivs=[],treeLoadQueuePtr=0;function Queue_Init(){treeLoadQueue=[];treeLoadQueueDivs=[];treeLoadQueuePtr=0}
function Queue_Add(b,d){treeLoadQueue[treeLoadQueue.length]=b;treeLoadQueueDivs[treeLoadQueueDivs.length]=d}
function Queue_Next(b){if(treeLoadQueuePtr<treeLoadQueue.length){b.LoadScript(treeLoadQueue[treeLoadQueuePtr],treeLoadQueueDivs[treeLoadQueuePtr]);treeLoadQueuePtr++}else if(_childItem_found){_childItem_found=false;createTreeControl(null,false,null)}else{if(selection_need>0){var d=false;if(_lastSelectedGlobal.length>0)if(rolefilter_enabled==true){l=0;try{l=filteredGuidsR[_lastSelectedGlobal].title.length}catch(e){}if(l>0)d=true}else d=true;if(d==true){selection_need=0;if(ChangeTreeView_CallBack()==
true)return}b.SelectFirstItem()}parent.TreeFinished&&parent.TreeFinished(treeViewMode,treeIsEmpty)}}
function SelectionCallBack(b){md=getModeDesc();switch(treeViewMode){case "ALL":if(_lastSelectedItem!=null)if(_lastSelectedItem.startAction==true)_lastSelectedItem.startAction=false;else{_lastSelectedItem.startAction=true;ChangeTreeView_CallBack();return}b=b==null?md.lastSelected:b;break;default:if(md.flatMode==true){SetFlatSelection();return}b=md.flatMode==true?md.lastSelectedFlat:b==null?md.lastSelected:b}if(b==null)parent.TreeItemSelected&&parent.TreeItemSelected(null,null);else{var d=b.getAttribute("tpc");
if(d==null)d=b.parentNode.getAttribute("tpc");if(d==null)d=b.parentNode.parentNode.getAttribute("tpc");if(md.flatMode==false){ChangeSelection(b);window.scrollTo(0,b.parentNode.offsetTop/2+10)}d!=null&&SetLastSelected(d,treeViewMode);parent.TreeItemSelected&&parent.TreeItemSelected(d,treeViewMode)}}
function ClearDescriptor(b,d){b.treeCreated=true;b.lastSelected=null;b.lastSelectedFlat=null;b.flatMode=d;for(var e=0;e<b.filteredGuidList.length;e++){s=b.filteredGuidList[e];b.filteredGuids[s].treeitem=null;b.filteredGuids[s].treeitemdiv=null}}function LastSelectedItem(b,d){this.guid=b;this.mode=d;this.firsdBuild=this.startAction=false}var _lastSelectedItem=null,_lastSelectedGlobal="",_lastSelectedGlobalMode="";
function SetLastSelected(b,d,e){_lastSelectedGlobal=b;_lastSelectedGlobalMode=d;if(!e)if(treeViewMode=="ALL")return;_lastSelectedItem=new LastSelectedItem(b,d)}function GetTpcAttribute(b){for(var d=null;d==null;){try{d=b.getAttribute("tpc")}catch(e){return null}if(d==null)b=b.parentNode}return d}var _childItem=null,_childItem_found=false;
function createTreeControl(b,d,e,h,g){if(b)_rootData=b;try{bigsco=parent.SCO_Supported()}catch(i){}InitTocStates();if(h)seeAlsoSelection=h;if(g)_childItem=g;fm=d==true?true:false;selection_need=1;if(treeViewMode=="ALL"){if(modeDescA.treeCreated==true){SelectionCallBack(e);return}ClearDescriptor(modeDescA,false);if(_lastSelectedItem!=null){_lastSelectedItem.startAction=true;_lastSelectedItem.firstBuild=true}else selection_need=2}else if(treeViewMode=="FILTERED"){if(modeDescF.treeCreated==true){modeDescF.flatMode=
fm;SelectionCallBack(e);return}ClearDescriptor(modeDescF,fm)}else if(treeViewMode=="FILTEREDHEMI"){if(modeDescFH.treeCreated==true){modeDescFH.flatMode=fm;SelectionCallBack(e);return}ClearDescriptor(modeDescFH,fm)}else{if(modeDescH.treeCreated==true){modeDescH.flatMode=fm;SelectionCallBack(e);return}ClearDescriptor(modeDescH,fm)}treeIsEmpty=true;if(treeViewMode=="ALL")treeControl=new TreeControl(document.getElementById("treeControlHostForAll"),b);else if(treeViewMode=="FILTERED"){treeControl=new TreeControl(document.getElementById("treeControlHostForFiltered"),
b);modeDescF.flatControl=new FlatControl("flatControlHostForFiltered");modeDescF.flatControl.Load();selection_need=modeDescF.flatMode==true?0:1}else if(treeViewMode=="FILTEREDHEMI"){treeControl=new TreeControl(document.getElementById("treeControlHostForFilteredHemi"),b);modeDescFH.flatControl=new FlatControl("flatControlHostForFilteredHemi");modeDescFH.flatControl.Load();selection_need=modeDescFH.flatMode==true?0:1}else{treeControl=new TreeControl(document.getElementById("treeControlHostForHemi"),
b);modeDescH.flatControl=new FlatControl("flatControlHostForHemi");modeDescH.flatControl.Load();selection_need=modeDescH.flatMode==true?0:1}Queue_Init();treeControl.LoadScript(treeControl.rootData+".html",treeControl.treeHost.id)}
function TreeControl(b,d){this.host=b;this.rootData=d;b.innerHTML="";this.treeHost=document.createElement("div");this.treeHost.id=d+"_"+TreeViewModeLetter();this.treeHost.className="treeControlNode";this.treeHost.onclick=this.OnClick;this.treeHost.onmouseup=this.OnMouseUp;this.treeHost.ondblclick=this.OnDoubleClick;this.host.appendChild(this.treeHost);this.loader=treeViewMode=="ALL"?document.getElementById("treeControlDataForAll"):treeViewMode=="FILTERED"?document.getElementById("treeControlDataForFiltered"):
treeViewMode=="FILTEREDHEMI"?document.getElementById("treeControlDataForFilteredHemi"):document.getElementById("treeControlDataForHemi");this.loader.className="treeControlData"}var _indexedSrc="";TreeControl.prototype.LoadScript=function(b,d){_indexedSrc=d;setTimeout("treeControl.LoadScriptInternal('"+b+"')",1)};TreeControl.prototype.LoadScriptInternal=function(b){var d=this.loader;if(d=d.contentDocument?d.contentDocument:d.contentWindow?d.contentWindow.document:null){treeControlDB=true;d.location.replace(b)}};
TreeControl.prototype.Bind=function(b){if(treeControlDB){treeControlDB=false;this.TraverseChildren(b.c,document.getElementById(_indexedSrc));_childNode_Loaded()}directMode==true?ChangeTreeView_CallBack():Queue_Next(this)};
function UnescapeQuotes(b){ss=b;for(k=ss.indexOf("&amp;");k>=0;){ss=sss=ss.substr(0,k)+"&"+ss.substr(k+5);k=ss.indexOf("&amp;")}for(k=ss.indexOf("&gt;");k>=0;){ss=sss=ss.substr(0,k)+">"+ss.substr(k+4);k=ss.indexOf("&gt;")}for(k=ss.indexOf("&lt;");k>=0;){ss=sss=ss.substr(0,k)+"<"+ss.substr(k+4);k=ss.indexOf("&lt;")}return ss}function GetClassNameFromFile(b){b=b.split("/");cname=b[b.length-1];return cname.replace(".gif","")}
TreeControl.prototype.TraverseNode=function(b,d,e,h){var g,i,m,o;g=b.e?true:false;if(treeViewMode=="ALL"){i=d.getAttribute("id");k=i.lastIndexOf("_");i=i.substr(0,k);m=b.d?b.d:b.i;AddItemdesc(modeDescA,modeDescA.filteredGuids,m,"","-",g,false,"",i);AddTreeItemToItemDesc(m,true)}b.element=document.createElement("div");i=b.element;i.className="treeControlNode";o=b.c||b.d;emptylesson=false;if(b.e)emptylesson=true;_openable=b.d?IsOpenable(b.d):false;m=i.appendChild(document.createElement("div"));guid=
b.i?b.i:b.d;m.setAttribute("tpc",guid);g=m.appendChild(document.createElement("img"));g.setAttribute("srcroot","../../img/outl_"+e);if(emptylesson||b.d&&!_openable){esrc=g.getAttribute("srcroot")+".gif";g.className=GetClassNameFromFile(esrc);g.openable=false;g.src="../../img/empty.gif"}else{esrc=g.getAttribute("srcroot")+(o?IsAutoExpand()?"o.gif":"c.gif":".gif");g.className=GetClassNameFromFile(esrc);g.src="../../img/empty.gif";g.openable=o?IsAutoExpand()?true:true:false}g=m.appendChild(document.createElement("img"));
if(bigsco){e=GetItemStatus(guid,true);g.className=_GetItemStatusFile(e);g.src="../../img/empty.gif";g.title=_GetItemStatusTitle(e);g.alt=_GetItemStatusTitle(e)}else g.src="../../img/sco_empty.gif";g=m.appendChild(document.createElement("img"));if(emptylesson){esrc="../../img/emptysection.gif";g.className=GetClassNameFromFile(esrc);g.src="../../img/empty.gif"}else{esrc=o?IsAutoExpand()&&_openable?"../../img/module_o.gif":"../../img/module_c.gif":"../../img/topic.gif";g.src="../../img/empty.gif";g.className=
GetClassNameFromFile(esrc);if(b.q)g.className=GetClassNameFromFile("../../img/question.gif");if(b.a)g.className=GetClassNameFromFile("../../img/assessment.gif")}g=m.appendChild(document.createElement("span"));ee=g.appendChild(document.createElement("a"));ee.className="";ee.style.cursor="pointer";ee.onmouseover=this.OnOverItem;ee.onmouseout=this.OnOutItem;ee.appendChild(document.createTextNode(UnescapeQuotes(b.t)));AddTreeItemToItemDesc(guid,ee);d.appendChild(i);if(o&&_openable){g=b.element.appendChild(document.createElement("table"));
g.className="treeControlChildren"+(!IsAutoExpand()?"H":"V");g.cellSpacing=0;g=g.appendChild(document.createElement("tbody"));g=g.appendChild(document.createElement("tr"));i=g.appendChild(document.createElement("td"));i.className="treeControlLine"+(h?"H":"V")+(bigsco?"W":"");i=i.appendChild(document.createElement("img"));i.src="../../img/s.gif";i=g.appendChild(document.createElement("td"));b.c&&this.TraverseChildren(b.c,i);if(b.d){i.id=b.d+"_"+TreeViewModeLetter();return i.id}}return null};
TreeControl.prototype.TraverseChildren=function(b,d){if(b){for(var e=[],h=[],g=0;g<b.length;g++)if(IsFiltered(b[g].d?b[g].d:b[g].i,treeViewMode))e[e.length]=b[g];if(e.length>0)if(d.className=="treeControlNode")if(e.length==1)h[0]=this.TraverseNode(e[0],d,"r",true);else{h[0]=this.TraverseNode(e[0],d,"f",false);g=e.length-1;for(var i=1;i<g;i++)h[i]=this.TraverseNode(e[i],d,"m",false);h[g]=this.TraverseNode(e[g],d,"l",true)}else{g=e.length-1;for(i=0;i<g;i++)h[i]=this.TraverseNode(e[i],d,"m",false);h[g]=
this.TraverseNode(e[g],d,"l",true)}if(IsAutoExpand())for(g=0;g<e.length;g++)e[g].d&&Queue_Add(e[g].d+".html",h[g]);if(_childItem!=null){i=e.length-1;for(g=0;g<e.length;g++){var m=e[g].d?e[g].d.substr(37):e[g].i.substr(37);try{m=parseInt(m,10)}catch(o){}if(m>_childItem&&g==0){_childItem=null;break}else if(m<_childItem&&g==i){if(e[g].d)Queue_Add(e[g].d+".html",h[g]);else _childItem=null;break}else if(m==_childItem){_childItem=null;_childItem_found=true;SetLastSelected(e[g].d?e[g].d:e[g].i,"ALL",true);
break}else if(m>_childItem){if(e[g-1].d)Queue_Add(e[g-1].d+".html",h[g-1]);else _childItem=null;break}}}}};TreeControl.prototype.OnOverItem=function(b){if(!b)b=window.event;target=b.target;if(!target)target=b.srcElement;if(target.className!="tselected")target.className="thover"};TreeControl.prototype.OnOutItem=function(b){if(!b)b=window.event;target=b.target;if(!target)target=b.srcElement;if(target.className!="tselected")target.className=""};
TreeControl.prototype.OnMouseUp=function(b){try{b.target.nodeName=="A"&&b.target.focus()}catch(d){}};TreeControl.prototype.OnClick=function(b){if(!b)b=window.event;target=b.target;if(!target)target=b.srcElement;treeControl.OnClickHandler(b,target)};
TreeControl.prototype.OnDoubleClick=function(b){if(!b)b=window.event;target=b.target;if(!target)target=b.srcElement;if(!target.tagName)target=target.parentNode;if(target.tagName=="A"||target.tagName=="IMG"){if(target.tagName=="IMG"){s=target.outerHTML;if(s.substr(s.length-11,9)!="topic.gif"||s.substr(s.length-14,12)!="question.gif"||s.substr(s.length-16,14)!="assessment.gif")return}target=target.parentNode.parentNode.firstChild;treeControl.OnClickHandler(b,target);parent.TreeItemDoubleSelected&&parent.TreeItemDoubleSelected()}clearTextSelection()};
function ChangeSelection(b){ee=b.tagName=="A"?b:b.childNodes[0];SetLastSelected(GetTpcAttribute(ee),treeViewMode);if(treeViewMode=="ALL"){if(modeDescA.lastSelected)modeDescA.lastSelected.className="";modeDescA.lastSelected=ee;modeDescA.lastSelected.className="tselected"}else if(treeViewMode=="FILTERED"){if(modeDescF.lastSelected)modeDescF.lastSelected.className="";modeDescF.lastSelected=ee;modeDescF.lastSelected.className="tselected"}else if(treeViewMode=="FILTEREDHEMI"){if(modeDescFH.lastSelected)modeDescFH.lastSelected.className=
"";modeDescFH.lastSelected=ee;modeDescFH.lastSelected.className="tselected"}else{if(modeDescH.lastSelected)modeDescH.lastSelected.className="";modeDescH.lastSelected=ee;modeDescH.lastSelected.className="tselected"}}
TreeControl.prototype.SelectFirstItem=function(){var b="";b=treeViewMode=="ALL"?"treeControlHostForAll":treeViewMode=="FILTERED"?"treeControlHostForFiltered":treeViewMode=="FILTEREDHEMI"?"treeControlHostForFilteredHemi":"treeControlHostForHemi";var d="",e;b=document.getElementById(b);b=b.firstChild;for(b=seeAlsoSelection>=b.childNodes.length?b.firstChild:b.childNodes[seeAlsoSelection];d=="";){try{t=b.getAttribute("tpc")}catch(h){return}if(t){d=t;e=b.lastChild}b=b.firstChild}ChangeSelection(e,true);
mode=treeViewMode;if(selection_need==1)mode="HIDE";selection_need=0;parent.TreeItemSelected&&parent.TreeItemSelected(d,treeViewMode)};
TreeControl.prototype.OnClickHandler=function(b,d){var e=false,h=true;if(!d.tagName)d=d.parentNode;if(d.tagName=="IMG"){var g=d.parentNode.parentNode.lastChild;if(g.tagName=="TABLE"){var i=d.parentNode.firstChild;if(d.openable||i.openable||g.openable)if(g.className=="treeControlChildrenV"){fsrc=i.getAttribute("srcroot")+"c.gif";i.src="../../img/empty.gif";i.className=GetClassNameFromFile(fsrc);i=i.nextSibling;i=i.nextSibling;i.src="../../img/empty.gif";i.className=GetClassNameFromFile("../../img/module_c.gif");
g.className="treeControlChildrenH";_go_closed=true}else{fsrc=i.getAttribute("srcroot")+"o.gif";i.src="../../img/empty.gif";i.className=GetClassNameFromFile(fsrc);i=i.nextSibling;i=i.nextSibling;i.src="../../img/empty.gif";i.className=GetClassNameFromFile("../../img/module_o.gif");g.className="treeControlChildrenV";g=g.firstChild.firstChild.lastChild;if(!g.firstChild){goriginal=g.id.length>36?GetJunctionId(g.id):g.id;h=false;treeControl.LoadScript(goriginal+".html",g.id)}}}else{g=d.parentNode.lastChild;
if(g.tagName=="IMG")return;ChangeSelection(g);e=true}}if(d.tagName=="A"){ChangeSelection(d);e=true}g=d.parentNode.getAttribute("tpc");if(g==null)g=d.parentNode.parentNode.getAttribute("tpc");e&&parent.TreeItemSelected&&parent.TreeItemSelected(g,treeViewMode);if(h){e=null;try{e=i.parentNode.childNodes[i.parentNode.childNodes.length-1].childNodes[0]}catch(m){}_childNode_Loaded(e)}};
function GetTableItemForThis(b){_tItem=b.parentNode;if(_tItem==null)return null;for(;_tItem.tagName!="TABLE";){_tItem=_tItem.parentNode;if(_tItem==null)return null}return _tItem}
function ShowTreeItem(b){mdActual=getModeDesc();mdSource=getModeDesc(true);_item=GetTreeItemOfItemDesc(b);if(_item==null){for(;_item==null;){var d=null;d=mdSource.filteredGuids[b];if(d==null)d=modeDescF.filteredGuids[b];if(d==null)d=modeDescH.filteredGuids[b];if(d==null)return false;b=d.parentguid;if(b==null)return false;_item=GetTreeItemOfItemDesc(b)}treeControl.LoadScript(b+".html",b+"_"+mdActual.modeLetter)}return true}
function OpenItem(b){if(b.className=="treeControlChildrenH"){f=b.parentNode.firstChild.firstChild;f.src="../../img/empty.gif";fscr=f.getAttribute("srcroot")+"o.gif";f.className=GetClassNameFromFile(fscr);f=f.nextSibling;f=f.nextSibling;f.src="../../img/empty.gif";f.className=GetClassNameFromFile("../../img/module_o.gif");b.className="treeControlChildrenV"}}
function ChangeTreeView(){retvalue=false;dA=document.getElementById("treeControlHostForAll");dS=document.getElementById("treeControlHostForFiltered");dSf=document.getElementById("flatControlHostForFiltered");dH=document.getElementById("treeControlHostForHemi");dHf=document.getElementById("flatControlHostForHemi");dFH=document.getElementById("treeControlHostForFilteredHemi");dFHf=document.getElementById("flatControlHostForFilteredHemi");if(treeViewMode=="FILTERED"){modeDescF.flatMode=!modeDescF.flatMode;
retvalue=modeDescF.flatMode;dS.style.display=modeDescF.flatMode?"none":"block";dSf.style.display=modeDescF.flatMode?"block":"none"}else if(treeViewMode=="HEMI"){modeDescH.flatMode=!modeDescH.flatMode;retvalue=modeDescH.flatMode;dH.style.display=modeDescH.flatMode?"none":"block";dHf.style.display=modeDescH.flatMode?"block":"none"}else{modeDescFH.flatMode=!modeDescFH.flatMode;retvalue=modeDescFH.flatMode;dFH.style.display=modeDescFH.flatMode?"none":"block";dFHf.style.display=modeDescFH.flatMode?"block":
"none"}ChangeTreeView_CallBack();return retvalue}var directMode=false;function _rec_SearchAInFlat(b,d){if(b.nodeName=="IMG"){attr=b.getAttribute("tpc");if(attr==d)return b}for(var e=0;e<b.childNodes.length;e++){r=_rec_SearchAInFlat(b.childNodes[e],d);if(r!=null)return r}return null}function _rec_GetFirstObjInFlat(b){if(b.nodeName=="IMG")return b;for(var d=0;d<b.childNodes.length;d++){r=_rec_GetFirstObjInFlat(b.childNodes[d]);if(r!=null)return r}return null}
function SetFlatSelection(){mdActual=getModeDesc();obj=_rec_SearchAInFlat(mdActual.flatControl.host,_lastSelectedGlobal);if(obj==null)obj=_rec_GetFirstObjInFlat(mdActual.flatControl.host);if(obj!=null)mdActual.flatControl.OnClickHandler(null,obj);else parent.TreeItemSelected&&parent.TreeItemSelected(null,null)}
function ChangeTreeView_CallBack(){mdActual=getModeDesc();mdSource=getModeDesc(true);var b=null;if(mdActual.flatMode==true){SetFlatSelection();return true}if(mdActual.flatMode==false||treeViewMode=="ALL"){var d=null;d=_lastSelectedGlobal;b=GetTreeItemOfItemDesc(d);if(b==null){if(!IsFiltered(d,treeViewMode))return false;directMode=true;return k=ShowTreeItem(d)}if(b!=null)for(_tItem=GetTableItemForThis(b);_tItem!=null;){OpenItem(_tItem);_tItem=GetTableItemForThis(_tItem)}}directMode=false;createTreeControl(null,
mdActual.flatMode,b);return true}function FlatControl(b){this.host=document.getElementById(b);this.document=this.host.document?this.host.document:this.host.ownerDocument}function showOnFlat(b){k=parseInt(b.guid.split("_")[1]);if(b.isroot==true&&k==1)return false;if(rolefilter_enabled==false)return true;ret=false;try{ret=filteredGuidsR[b.guid].found}catch(d){}return ret}
function isInOutline(b,d){if(b.filteredGuids.length==0)return true;var e=b.filteredGuids[d].parentguid;if(e==null)return false;return e.split("_")[1]=="1"?true:isInOutline(b,e)}
function getModeDesc(b){if(b==null)b=false;b=b==true?_lastSelectedGlobalMode:treeViewMode;if(b=="ALL")return modeDescA;else if(b=="FILTERED")return modeDescF;else if(b=="HEMI")return modeDescH;else if(b=="FILTEREDHEMI"){modeDescFH.guidsForFlat=[];for(b=0;b<modeDescF.guidsForFlat.length;b++){guidF=modeDescF.guidsForFlat[b];for(var d=0;d<modeDescH.guidsForFlat.length;d++){guidH=modeDescH.guidsForFlat[d];if(guidF.guid==guidH.guid)modeDescFH.guidsForFlat[modeDescFH.guidsForFlat.length]=guidF}}return modeDescFH}return null}
function saveModeDesc(b){if(treeViewMode=="ALL")modeDescA=b;else if(treeViewMode=="FILTERED")modeDescF=b;else if(treeViewMode=="HEMI")modeDescH=b;else if(treeViewMode=="FILTEREDHEMI")modeDescFH=b}
FlatControl.prototype.Load=function(){myDesc=getModeDesc();this.host.innerHTML="";div=this.host.appendChild(this.document.createElement("div"));div.className="treeControlNode";div.onclick=this.OnClick;div.ondblclick=this.OnDoubleClick;div.onmouseup=this.OnMouseUp;table=div.appendChild(this.document.createElement("table"));table.cellSpacing=0;first=true;for(var b=0,d=0;d<myDesc.guidsForFlat.length;d++){itemdesc=myDesc.guidsForFlat[d];if(showOnFlat(itemdesc)&&isInOutline(myDesc,itemdesc.guid)){b++;
if(!(b>TreeConfig.SearchResultLimit)){myDesc.actualFlatCounter=b;tr=table.appendChild(this.document.createElement("tbody"));tr=tr.appendChild(this.document.createElement("tr"));td=tr.appendChild(this.document.createElement("td"));img=td.appendChild(this.document.createElement("img"));img.className=GetClassNameFromFile(itemdesc.type=="Topic"?"../../img/topic.gif":itemdesc.empty?"../../img/emptysection.gif":"../../img/module_c.gif");img.src="../../img/empty.gif";img.setAttribute("tpc",itemdesc.guid);
td=tr.appendChild(this.document.createElement("td"));td.className="treeControlNode";a=td.appendChild(this.document.createElement("a"));if(first==true){myDesc.lastSelectedFlat=a;saveModeDesc(myDesc)}a.className=first==true?"tselected":"";first==true&&_lastChangeIsFilterOnly==false&&SetLastSelected(itemdesc.guid,treeViewMode);first=false;a.style.cursor="pointer";a.setAttribute("tpc",itemdesc.guid);a.onmouseover=this.OnOverItem;a.onmouseout=this.OnOutItem;var e=itemdesc.title;if(treeViewMode=="HEMI"&&
parent.showscore>0)e=""+Math.round(itemdesc.score*100)+" "+itemdesc.title;a.appendChild(this.document.createTextNode(e))}}}myDesc.flatMode==true&&SetFlatSelection();b=null;try{b=myDesc.lastSelectedFlat.getAttribute("tpc")}catch(h){}parent.TreeItemSelected&&parent.TreeItemSelected(b,treeViewMode)};FlatControl.prototype.OnOverItem=function(b){if(!b)b=window.event;target=b.target;if(!target)target=b.srcElement;if(target.className!="tselected")target.className="thover"};
FlatControl.prototype.OnOutItem=function(b){if(!b)b=window.event;target=b.target;if(!target)target=b.srcElement;if(target.className!="tselected")target.className=""};FlatControl.prototype.OnMouseUp=function(b){try{b.target.nodeName=="A"&&b.target.focus()}catch(d){}};FlatControl.prototype.OnClick=function(b){if(!b)b=window.event;target=b.target;if(!target)target=b.srcElement;mdActual=getModeDesc();mdActual.flatControl.OnClickHandler(b,target)};
FlatControl.prototype.OnDoubleClick=function(b){if(!b)b=window.event;target=b.target;if(!target)target=b.srcElement;mdActual=getModeDesc();mdActual.flatControl.OnClickHandler(b,target);parent.TreeItemDoubleSelected&&parent.TreeItemDoubleSelected()};
FlatControl.prototype.OnClickHandler=function(b,d){a=d;t=GetTpcAttribute(a);t!=null&&SetLastSelected(t,treeViewMode);if(!(d.tagName!="A"&&d.tagName!="IMG")){if(d.tagName!="A"){tr=d.parentNode.parentNode;for(var e=0;e<tr.childNodes.length;e++){k=tr.childNodes[e].childNodes[0];if(k.tagName=="A")a=k}}if(treeViewMode=="FILTERED")modeDescF.lastSelectedFlat.className="";else if(treeViewMode=="HEMI")modeDescH.lastSelectedFlat.className="";else modeDescFH.lastSelectedFlat.className="";a.className="tselected";
if(treeViewMode=="FILTERED")modeDescF.lastSelectedFlat=a;else if(treeViewMode=="HEMI")modeDescH.lastSelectedFlat=a;else modeDescFH.lastSelectedFlat=a;e=a.getAttribute("tpc");parent.TreeItemSelected&&parent.TreeItemSelected(e,treeViewMode)}};function GetActualFlatView(){md=getModeDesc();return md.flatMode}function GetActualFlatItemCounter(){md=getModeDesc();return md.actualFlatCounter}function IsActualViewEmpty(){md=getModeDesc();return md.filteredGuidList==0}
function getActualIndex_Flat(){md=getModeDesc();if(md.flatMode==true)for(var b=0;b<md.flatControl.host.firstChild.firstChild.childNodes.length;b++)if(md.flatControl.host.firstChild.firstChild.childNodes[b].firstChild.childNodes[1].firstChild.className=="tselected")return b;return""}
function getActualIndex_Tree(b,d){for(var e=0;e<b.length;e++)if(b[e].firstChild.childNodes[3].firstChild.className=="tselected")return e;if(d.lastSelected!=null){_tpc=d.lastSelected.parentNode.parentNode.getAttribute("tpc");for(e=0;e<b.length;e++)if(b[e].firstChild.getAttribute("tpc")==_tpc)return e}return""}function getTargetForIndex_Flat(b,d){return b.flatControl.host.firstChild.firstChild.childNodes[d].firstChild.firstChild.firstChild}
function getTargetForIndex_Tree(b){return ls[b].firstChild.childNodes[3].firstChild}function getActualImageObj_Tree(b){return b.lastSelected.parentNode.parentNode.firstChild}function getSpecifiedImageObj_Tree(b,d){return b[d].firstChild.firstChild}function getOwnerOfSelection(){var b=md.lastSelected.parentNode.parentNode.parentNode.childNodes[0].getAttribute("tpc");return md.filteredGuids[b].parentguid}function getOpenedStatus(b){s=b.className;c=s.substr(s.length-1,1);return c=="o"}
function getFilteredStatus(b){return!IsFiltered(b,"ALL")}function _getLinearStructure_Recursive(b,d){d[d.length]=b;_imgObj=b.firstChild.firstChild;if(getOpenedStatus(_imgObj)==true)for(var e=0;e<b.childNodes[1].firstChild.firstChild.childNodes[1].childNodes.length;e++)_getLinearStructure_Recursive(b.childNodes[1].firstChild.firstChild.childNodes[1].childNodes[e],d)}function getRoot(b){if(b.tagName=="DIV"&&b.id.substr(0,15)=="treeControlHost")return b.firstChild;return getRoot(b.parentNode)}
function getLinearStructure_Tree(b){var d=[];root=getRoot(b.lastSelected);for(b=0;b<root.childNodes.length;b++)_getLinearStructure_Recursive(root.childNodes[b],d);return d}
function EventKeyDown(b){if(b==null)b=window.event;b=b.which?b.which:b.keyCode;if(b==13)parent.TreeItemDoubleSelected&&parent.TreeItemDoubleSelected();else{md=getModeDesc();if(md.flatMode==true){index=getActualIndex_Flat();if(b==38){if(index>0){t=getTargetForIndex_Flat(md,index-1);md.flatControl.OnClickHandler(null,t)}}else if(b==40)if(index<md.actualFlatCounter-1){t=getTargetForIndex_Flat(md,index+1);md.flatControl.OnClickHandler(null,t)}}else{imgObj=getActualImageObj_Tree(md);_isOpenable=imgObj.openable?
imgObj.openable:imgObj.getAttribute("openable");_isOpened=getOpenedStatus(imgObj);ls=getLinearStructure_Tree(md);index=getActualIndex_Tree(ls,md);if(b==37){if(_isOpenable==true)if(_isOpened==true){treeControl.OnClickHandler(null,imgObj);return false}}else if(b==38){if(index>0){t=getTargetForIndex_Tree(index-1);treeControl.OnClickHandler(null,t)}}else if(b==39){if(_isOpenable==true)if(_isOpened==false){treeControl.OnClickHandler(null,imgObj);return false}}else if(b==40)if(index<ls.length-1){t=getTargetForIndex_Tree(index+
1);treeControl.OnClickHandler(null,t)}}}}function tree_SetFocus(){document.frames[0].document.childNodes[1].childNodes[1].focus()}function tree_Init(){document.onkeydown=EventKeyDown;parent.Init_treeloaded&&parent.Init_treeloaded()}function clearTextSelection(){document.selection&&document.selection.empty();window.getSelection&&window.getSelection().removeAllRanges()}
function GoToNext(){md=getModeDesc();if(md.flatMode==true){index=getActualIndex_Flat();if(index<md.actualFlatCounter-1){t=getTargetForIndex_Flat(md,index+1);md.flatControl.OnClickHandler(null,t)}}else{imgObj=getActualImageObj_Tree(md);_isOpenable=imgObj.openable?imgObj.openable:imgObj.getAttribute("openable");_isOpened=getOpenedStatus(imgObj);ls=getLinearStructure_Tree(md);index=getActualIndex_Tree(ls,md);if(index<ls.length-1){t=getTargetForIndex_Tree(index+1);treeControl.OnClickHandler(null,t)}}}
var _go_next=false,_go_prev=false,_go_closed=false;
function Navigation_Up(){md=getModeDesc();if(md.flatMode==false){ls=getLinearStructure_Tree(md);index=getActualIndex_Tree(ls,md);prevImgObj=getSpecifiedImageObj_Tree(ls,index-1);_isOpenable=Bool(prevImgObj.openable!=undefined?prevImgObj.openable:prevImgObj.getAttribute("openable"));_isOpened=getOpenedStatus(prevImgObj);if(_isOpenable&&!_isOpened){_go_prev=true;treeControl.OnClickHandler(null,prevImgObj);return}}var b={};b.keyCode=38;EventKeyDown(b)}
function Navigation_Down(){md=getModeDesc();if(md.flatMode==false){imgObj=getActualImageObj_Tree(md);_isOpenable=Bool(imgObj.openable!=undefined?imgObj.openable:imgObj.getAttribute("openable"));_isOpened=getOpenedStatus(imgObj);if(_isOpenable&&!_isOpened){_go_next=true;var b={};b.keyCode=39;EventKeyDown(b);return}}b={};b.keyCode=40;EventKeyDown(b)}
function isFirstItem(){md=getModeDesc();if(md.flatMode==true)index=getActualIndex_Flat();else{if(md.lastSelected==null)return true;ls=getLinearStructure_Tree(md);index=getActualIndex_Tree(ls,md)}return index==0}
function isLastItem(){md=getModeDesc();if(md.flatMode==true)return index==md.filteredTopicCount-1;else{if(md.lastSelected==null)return false;ls=getLinearStructure_Tree(md);index=getActualIndex_Tree(ls,md);if(index==ls.length-1){imgObj=getActualImageObj_Tree(md);_isOpenable=imgObj.openable;return _isOpenable==false}return false}}
function _childNode_Loaded(b){if(_go_next==true){_go_next=false;Navigation_Down()}if(_go_prev==true){md=getModeDesc();if(md.flatMode==false){ls=getLinearStructure_Tree(md);index=getActualIndex_Tree(ls,md);prevImgObj=getSpecifiedImageObj_Tree(ls,index-1);_isOpenable=Bool(prevImgObj.openable!=undefined?prevImgObj.openable:prevImgObj.getAttribute("openable"));_isOpened=getOpenedStatus(prevImgObj);if(_isOpenable&&!_isOpened){_go_prev=true;treeControl.OnClickHandler(null,prevImgObj);return}else{_go_prev=
false;Navigation_Up()}}}if(_go_closed==true){_go_closed=false;md=getModeDesc();if(md.flatMode==false){ls=getLinearStructure_Tree(md);index=getActualIndex_Tree(ls,md);index==""&&treeControl.OnClickHandler(null,b)}}}function Bool(b){if(typeof b=="boolean")return b;if(typeof b=="string"){if(b.toLowerCase()=="false")return false;if(b.toLowerCase()=="true")return true}return null}var indexMap=[],treeIndex=[];
function AddToIndexMap(b){if(bigsco!=false)if(!(b.length<=36)){var d=b.substr(0,36);b=b.substr(37);indexMap[b]=d}}var _tocStates2=null,_tocStates_initialized=false;
function InitTocStates(){if(!_tocStates_initialized){_tocStates_initialized=true;if(bigsco!=false){for(var b=0;b<parentIndex.length;b++){treeIndex[b]=[];treeIndex[b][0]=parentIndex[b]}for(b=0;b<parentIndex.length;b++){var d=parentIndex[b];treeIndex[d][treeIndex[d].length]=b}_tocStates2=[];for(b=0;b<parent.lms_TOCState.NodeCounter;b++)_tocStates2[b]=parent.lms_GetItemStatus(b);InitOneItemState(childIndexLocal2Global(0));b=parent.lms_GetItemStatus(0);d=_tocStates2[0];b!=d&&parent.lms_SetItemStatus(0,
d);updateTreeTrace()}}}function InitOneItemState(b){for(var d=index_getChildList(b),e=0;e<d.length;e++)InitOneItemState(d[e]);childIndexGlobal2Local(b);if(b!=0)_tocStates2[b]=BuildItemStatus(b,true)}function GetItemStatus(b,d){var e=b.substr(37),h=childIndexGlobal2Local(e);e=BuildItemStatus(e,d);return _tocStates2[h]=e}
function _GetItemStatusFile(b){switch(b){case "N":return"sco_notstarted";case "I":return"sco_incomplete";case "C":return"sco_completed";case "P":return"sco_passed";case "F":return"sco_failed"}return""}function _GetItemStatusTitle(b){switch(b){case "N":return R_status_tree_notstarted;case "I":return R_status_tree_inprogress;case "C":return R_status_tree_complete;case "P":return R_status_tree_passed;case "F":return R_status_tree_failed}return""}
function UpdateItemStatus(b){_tocStates2[b]=parent.lms_GetItemStatus(b);b=childIndexLocal2Global(b);RefreshItemStatus(indexMap[b]+"_"+b);BuildRootItemStatus();updateTreeTrace()}
function RefreshItemStatus(b){if(bigsco!=false){var d=getModeDesc(b).filteredGuids[b];if(d!=null){b=GetItemStatus(b);d.treeitemdiv.parentNode.parentNode.childNodes[1].setAttribute("src","../../img/empty.gif");_itemState=_GetItemStatusFile(b);d.treeitemdiv.parentNode.parentNode.childNodes[1].setAttribute("class",_itemState);d.treeitemdiv.parentNode.parentNode.childNodes[1].setAttribute("className",_itemState);d.treeitemdiv.parentNode.parentNode.childNodes[1].setAttribute("title",_GetItemStatusTitle(b));
d.treeitemdiv.parentNode.parentNode.childNodes[1].setAttribute("alt",_GetItemStatusTitle(b));d.parentguid!=null&&RefreshParentItemStatus(d.parentguid)}}}
function RefreshParentItemStatus(b){var d=b.substr(37),e=childIndexGlobal2Local(d),h=_tocStates2[e];d=BuildItemStatus(d);if(e==0)if(d=="N")return;if(d!=h){_tocStates2[e]=d;e==0&&parent.lms_SetItemStatus(0,d);updateTreeTrace();b=getModeDesc(b).filteredGuids[b];if(b!=null){b.treeitemdiv.parentNode.parentNode.childNodes[1].setAttribute("src","../../img/empty.gif");_itemState=_GetItemStatusFile(d);b.treeitemdiv.parentNode.parentNode.childNodes[1].setAttribute("class",_itemState);b.treeitemdiv.parentNode.parentNode.childNodes[1].setAttribute("className",
_itemState);b.treeitemdiv.parentNode.parentNode.childNodes[1].setAttribute("title",_GetItemStatusTitle(d));b.treeitemdiv.parentNode.parentNode.childNodes[1].setAttribute("alt",_GetItemStatusTitle(d));b.parentguid!=null&&RefreshParentItemStatus(b.parentguid)}}}function getBaseIndex(){return parseInt(_rootData.substr(37))}function childIndexLocal2Global(b){return parseInt(b)+getBaseIndex()}function childIndexGlobal2Local(b){return b-getBaseIndex()}
function index_getParent(b){if(!index_checkIndex(b))return-1;return treeIndex[b][0]}function index_getChildList(b,d){if(!index_checkIndex(b))return-1;for(var e=treeIndex[b],h=[],g=1;g<e.length;g++)if(d){if(d!=e[g])h[g-1]=e[g]}else h[g-1]=e[g];return h}function index_hasChildren(b){if(!index_checkIndex(b))return-1;return treeIndex[b].length>1}function index_checkIndex(b){if(b>treeIndex.length-1)return false;return treeIndex[b].length>0}
function BuildItemStatus(b){var d=childIndexGlobal2Local(b);return BuildItemStatus2(b,d)}function BuidStatus(b,d){if(b.indexOf("I")>=0)return"I";if(b.indexOf("N")>=0)return b.indexOf("C")>=0||b.indexOf("F")>=0||b.indexOf("P")>=0?"I":"N";if(b.indexOf("F")>=0)return d==false?"F":"C";if(b.indexOf("P")>=0)if(d==false)return"P";return"C"}
function BuildItemStatus2(b,d){var e=index_getChildList(b),h="";if(d!=0)if(conceptIndex[b]>0)h+=parent.lms_GetItemStatus(d);for(var g=0;g<e.length;g++)h+=_tocStates2[childIndexGlobal2Local(e[g])];return BuidStatus(h,e.length>0)}function BuildRootItemStatus(){var b=childIndexLocal2Global(0);b=index_getChildList(b);for(var d="",e=0;e<b.length;e++)d+=_tocStates2[childIndexGlobal2Local(b[e])];b=BuidStatus(d,b.length>0);_tocStates2[0]=b}var treeTraceOn=false,treeTraceWnd=null;
function updateTreeTrace(){try{if(treeTraceOn){if(treeTraceWnd==null)treeTraceWnd=window.open();treeTraceWnd.document.body.innerHTML="";for(var b=0;b<_tocStates2.length;b++)treeTraceWnd.document.write(" "+b+": "+_tocStates2[b]+" - "+parent.lms_GetItemStatus(b)+"<br/>")}}catch(d){}};
