
$(document).ready(function()
{$("#processTree").tree({types:{"default":{renameable:false,draggable:false},"home":{icon:{image:_reposRoot+"/files/icons/home.png"}},"process":{icon:{image:_reposRoot+"/files/icons/task.png"}},"process1":{icon:{image:_reposRoot+"/files/icons/task1.png"}},"process2":{icon:{image:_reposRoot+"/files/icons/task2.png"}},"process3":{icon:{image:_reposRoot+"/files/icons/task3.png"}},"process4":{icon:{image:_reposRoot+"/files/icons/task4.png"}},"section":{icon:{image:_reposRoot+"/files/icons/folder.png"}},"link":{icon:{image:_reposRoot+"/files/icons/help.png"}}},callback:{onselect:function(NODE,TREE_OBJ)
{selectNode(NODE);},beforeopen:function(NODE,TREE_OBJ)
{if($(NODE).hasClass('lazy'))
{$(NODE).removeClass('lazy');var dParams={processUrl:$('a',NODE).attr('href')};$.ajax({type:'POST',contentType:"application/json; charset=utf-8",dataType:"json",data:JSON.stringify(dParams),url:_reposRoot+'/ProcessDefinition.asmx/GetTreeNodeHtml',success:function(data)
{$('ul',NODE).replaceWith(data.d);$('ul > li[rel="section"] > ul > li:last-child',NODE).addClass('last');}});}
return true;}}});$("li[rel='home'] > a ins").addClass("home");$("li[rel='process'] > a ins").addClass("process");$("li[rel='process1'] > a ins").addClass("process1");$("li[rel='process2'] > a ins").addClass("process2");$("li[rel='process3'] > a ins").addClass("process3");$("li[rel='process4'] > a ins").addClass("process4");$("li[rel='section'] > a ins").addClass("section");$("li[rel='link'] > a ins").addClass("link");$('#hideTree').click(hideTree);$('#showTree').click(showTree);$('#treeClose').click(closeTree);$('#treeRefresh').click(refreshTree);$(window.top.document.getElementById('procFrame')).load(loadedContent);loadedContent();});function selectNode(NODE){var loadedWin=window.parent.frames['procFrame'].location.href;if(loadedWin!=null){loadedWin=loadedWin.toLowerCase();var treeWin=$('a',NODE).attr('href');treeWin=treeWin.toLowerCase();if(loadedWin!=treeWin){window.parent.frames['procFrame'].location.href=$('a',NODE).attr('href');}}}
function hideTree()
{if($('body').hasClass('iPad')){window.top.document.getElementById('pdFrameset').cols='20px,*';$('body').addClass('collapsed');}
else{window.top.document.getElementById('pdFrameset').cols='40px,*';}
$('#hideTree').css('display','none');$('#showTree').css('display','');$('#navTitle').css('display','none');}
function showTree()
{if($('body').hasClass('iPad')){window.top.document.getElementById('pdFrameset').cols='100px,*';$('body').removeClass('collapsed');}
else{window.top.document.getElementById('pdFrameset').cols='300px,*';}
$('#hideTree').css('display','');$('#showTree').css('display','none');$('#navTitle').css('display','');}
function closeTree(){try
{if(navOnClose==null)
{if(top.location!=window.parent.frames['procFrame'].location)
{top.location.href=window.parent.frames['procFrame'].location.href;}}
else
{top.location.href=navOnClose;}}
catch(e){$('#treeClose').css('visibility','hidden');}}
function refreshTree(){try{var root=$('#processTree li:first');if(root!=undefined&&root!=null){window.parent.frames['treeFrame'].location.href=window.parent.frames['treeFrame'].location.href;}}
catch(e){$('#treeRefresh').css('visibility','hidden');}}
function loadedContent(){try{var loadedWin=window.parent.frames['procFrame'].location.href;if(loadedWin!=null){$('#treeClose').css('visibility','visible');loadedWin=loadedWin.toLowerCase();if(window.parent.frames['procFrame'].document!=undefined&&window.parent.frames['procFrame'].document!=null)
window.parent.document.title=window.parent.frames['procFrame'].document.title;var sel=$.tree.reference('#processTree').selected;var foundItem=false;if(sel!=undefined&&sel!=null)
{if($(sel).children('a').attr('href')!=loadedWin)
{var foundChild=$("a[href='"+loadedWin+"']",sel).parent();if(foundChild.length>0)
{$.tree.reference('#processTree').select_branch(foundChild.eq(0));foundItem=true;}}
else
{foundItem=true;}}
if(!foundItem)
{var foundChild=$("a[href='"+loadedWin+"']").parent();if(foundChild.length>0)
{$.tree.reference('#processTree').select_branch(foundChild.eq(0));}}}}
catch(err)
{$('#treeClose').css('visibility','hidden');}}