$(document).ready(function(){$.datepicker.setDefaults($.datepicker.regional.pl);$("input[id$='dtpPublOd'],input[id$='dtpPublDo'],input[id$='dtpSetOd'],input[id$='dtpSetDo']").datepicker({showButtonPanel:true,dateFormat:"yy-mm-dd",showAnim:"slideDown"});$("#related-tree").dialog({modal:true,title:"Wybór kategorii",autoOpen:false,height:600,width:800,resizable:false,draggable:false,buttons:{"Zatwierdź wybór":function(){writeCategorySelection();$(this).dialog("close")}}});$(".ui-dialog-titlebar").removeClass("ui-corner-all ui-widget-header").addClass("blockTitle");$("input[id$='dtpPublOd'],input[id$='dtpPublDo'],input[id$='dtpSetOd'],input[id$='dtpSetDo']").hint("blur");$(".roundedCorners").corner("5px");$(".listHeader").corner("top 5px")});function checkDate(c,e,f){if(e<1||e>12){return(false)}if(c<1||c>31){return(false)}if(e==4||e==6||e==9||e==11){if(c==31){return(false)}}if(e==2){var a=parseInt(f/4);if(isNaN(a)){return(false)}if(c>29){return(false)}if(c==29&&((f/4)!=parseInt(f/4))){return(false)}}return(true)}function validateDate(a){if($(a).hasClass("blur")){$(a).removeClass("blur")}if(a.value!=""&&a.value!=undefined){var b=true;var c=a.value.split("-");if(c.length!=3){b=false}else{b=checkDate(parseInt(c[2],10),parseInt(c[1],10),parseInt(c[0],10))}if(b){Page_ClientValidate("SearchValidationGroup")}else{a.value=""}}}function ValidateContainsAnyWords(b,a){ValidateWords($("input[id$='tbxContainsAny']").val(),a)}function ValidateContainsAllWords(b,a){ValidateWords($("input[id$='tbxContainsAll']").val(),a)}function ValidateContainsNoneWords(b,a){ValidateWords($("input[id$='tbxNotCointains']").val(),a)}function ValidateWords(b,a){separators=" ,.;:~|";b=b.replace(/^\s+|\s+$/g,"");tempText="";for(i=0;i<b.length;i=i+1){if(separators.indexOf(b[i])>0){tempText=tempText+" "}else{tempText=tempText+b[i]}}wordsCount=0;words=tempText.split(" ");for(i=0;i<words.length;i=i+1){if(words[i].length>0){wordsCount=wordsCount+1}}a.IsValid=(wordsCount<=5)}function ValidatePublDate(b,d){var c=$("input[id$='dtpPublOd']").val();var a=$("input[id$='dtpPublDo']").val();d.IsValid=(c=="RRRR-MM-DD")||(a=="RRRR-MM-DD")||(c<=a)}function ValidateSetDate(b,d){var c=$("input[id$='dtpSetOd']").val();var a=$("input[id$='dtpSetDo']").val();d.IsValid=(c=="RRRR-MM-DD")||(a=="RRRR-MM-DD")||(c<=a)}function ResetSearchForm(){$("input[id$='tbxCPV']").val("");$("select[id$='cbxWojewodztwo']").val(0);$("input[id$='tbxMiejscowosc']").val("");$("input[id$='dtpPublOd']").val("").blur();$("input[id$='dtpPublDo']").val("").blur();$("input[id$='dtpSetOd']").val("").blur();$("input[id$='dtpSetDo']").val("").blur();$("input[id$='cbxAktualne']").attr("checked",true);$("input[id$='cbxArchiwalne']").attr("checked",false);$("input[id$='tbxContainsAny']").val("");$("input[id$='tbxContainsAll']").val("");$("input[id$='tbxNotCointains']").val("");$("input[id$='tbxCPV']").focus()}function UpdateScrollPosition(){if($("#hfScrollY")!=null){window.scrollTo(0,$("#hfScrollY").val())}}window.onload=UpdateScrollPosition;function SelectRow(a){a.className="itemRowSelected";var d=a.getElementsByTagName("td");for(var b=0;b<d.length;b++){var e=d[b].getElementsByTagName("a");if(e.length>0){var g=e[0].href.indexOf("&y=");var f=e[0].href;if(g>0){f=f.substring(0,g)}var c=window.pageYOffset;if(document.all){c=document.body.scrollTop}if($("#criteriaBox").css("display")!="none"){c=c-528}}}}function GoTo(c){var a=c.getElementsByTagName("td");for(var b=0;b<a.length;b++){var d=a[b].getElementsByTagName("a");if(d.length>0){document.location.href=d[0].href}}}$(document).ready(function(){});function writeCategorySelection(){var a=getSelectedNodes($("#related-category-tree").dynatree("getSelectedNodes"));var b=getSelectedNodes($("#related-filter-tree").dynatree("getSelectedNodes"));$.each(b,function(e,d){if($.inArray(d,a)==-1){a[a.length]=d}});var c=a.join(", ");$("input[id$='tbxCPV']").val(c)}function getSelectedNodes(b){var a=$.map(b,function(c){return c.data.key});return a}$(document).ready(function(){$("#loading-dialog").hide();$("#related-category-tree").dynatree({checkbox:true,selectMode:3,minExpandLevel:1,initAjax:{url:"/Code/CategoryStructure.ashx",data:{key:"root",CpvId:0},mode:"all"},onLazyRead:function(a){a.appendAjax({url:"/Code/CategoryStructure.ashx",data:{key:"child",CpvId:a.data.cpvId},mode:"all"})},onDblClick:function(a,b){if(!a.isSelected()){a.toggleSelect()}writeCategorySelection();$("#related-tree").dialog("close")}})});$(document).ready(function(){$("#related-filter-tree").dynatree({checkbox:true,selectMode:2,children:[],onDblClick:function(a,b){if(!a.isSelected()){a.toggleSelect()}writeCategorySelection();$("#related-tree").dialog("close")}})});function btnShowCategories_onclick(){$("#related-tree").dialog("open")}function btnFilterCategories_onclick(){var b=$("input[id$='tbxFilter']").val();if(b.length>2){var a="{'filter': '"+b+"'}";$.ajax({type:"POST",url:"Szukaj.aspx/FilterCategories",data:a,contentType:"application/json; charset=utf-8",dataType:"json",success:function(f){var h=f.d;var g=$("#related-filter-tree").dynatree("getRoot");g.removeChildren();g.addChild(h);var d=getSelectedNodes($("#related-category-tree").dynatree("getSelectedNodes"));var e=$("#related-filter-tree").dynatree("getTree");for(var c=0;c<d.length;c++){var j=e.getNodeByKey(d[c]);if(j!=null){j.select(true)}}showFullTree(false,true,"")}});showFullTree(false,false,"Wyszukiwanie...")}else{showFullTree(true,false,"")}}function showFullTree(c,a,d){if(c){$("#related-category-tree").show();$("input[id$='hdnTreeSelection']").val("1")}else{$("#related-category-tree").hide()}if(a){$("#related-filter-tree").show();$("input[id$='hdnTreeSelection']").val("2")}else{$("#related-filter-tree").hide()}var b=$("#loading-dialog");if(a||c){b.hide()}else{$("#lblTreeLoading").text(d);b.show()}}function searchKeyPress(a){if(window.event){a=window.event}if(a.keyCode==13){btnFilterCategories_onclick()}}function cbxSelectAll_onclick(){var a=$("input[id$='cbxSelectAll']").attr("checked");var b=null;if($("input[id$='hdnTreeSelection']").val()=="1"){b=$("#related-category-tree").dynatree("getRoot")}else{b=$("#related-filter-tree").dynatree("getRoot")}b.visit(function(c){c.select(a)})}function btnCollapseAll_onclick(){var a=null;if($("input[id$='hdnTreeSelection']").val()=="1"){a=$("#related-category-tree").dynatree("getRoot")}if(a!=null){a.visit(function(b){b.expand(false)})}}function btnShowFullTree_onclick(){var b=getSelectedNodes($("#related-filter-tree").dynatree("getSelectedNodes"));var a=$("#related-category-tree").dynatree("getTree");showFullTree(false,false,"Zaznaczanie wynik�w...");selectOrExpand(a,b,0,2,null)}function selectOrExpand(d,b,a,c,e){if(e!=null&&e.isLoading){setTimeout(function(){selectOrExpand(d,b,a,c,e)},100)}if(a<b.length){if(c<=b[a].length){var f=b[a].substring(0,c);var g=d.getNodeByKey(f);if(g!=null){if(f==b[a]){g.select(true);selectOrExpand(d,b,a+1,2,null)}else{g.expand(true);selectOrExpand(d,b,a,c+1,g)}}}}else{showFullTree(true,false,"")}};
(function(a){a.widget("ui.dropdownchecklist",{version:function(){alert("DropDownCheckList v1.1")},_appendDropContainer:function(b){var d=a("<div/>");d.addClass("ui-dropdownchecklist ui-dropdownchecklist-dropcontainer-wrapper");d.addClass("ui-widget");d.attr("id",b.attr("id")+"-ddw");d.css({position:"absolute",left:"-33000px",top:"-33000px"});var c=a("<div/>");c.addClass("ui-dropdownchecklist-dropcontainer ui-widget-content");c.css("overflow-y","auto");d.append(c);d.insertAfter(b);d.isOpen=false;return d},_isDropDownKeyShortcut:function(b,c){return b.altKey&&(a.ui.keyCode.DOWN==c)},_isDropDownCloseKey:function(b,c){return(a.ui.keyCode.ESCAPE==c)||(a.ui.keyCode.ENTER==c)},_keyFocusChange:function(h,f,e){var g=a(":focusable");var i=g.index(h);if(i>=0){i+=f;if(e){var b=this.dropWrapper.find("input:not([disabled])");var c=g.index(b.get(0));var d=g.index(b.get(b.length-1));if(i<c){i=d}else{if(i>d){i=c}}}g.get(i).focus()}},_handleKeyboard:function(d){var c=this;var b=(d.keyCode||d.which);if(!c.dropWrapper.isOpen&&c._isDropDownKeyShortcut(d,b)){d.stopImmediatePropagation();c._toggleDropContainer(true)}else{if(c.dropWrapper.isOpen&&c._isDropDownCloseKey(d,b)){d.stopImmediatePropagation();c._toggleDropContainer(false);c.controlSelector.focus()}else{if(c.dropWrapper.isOpen&&(d.target.type=="checkbox")&&((b==a.ui.keyCode.DOWN)||(b==a.ui.keyCode.UP))){d.stopImmediatePropagation();c._keyFocusChange(d.target,(b==a.ui.keyCode.DOWN)?1:-1,true)}else{if(c.dropWrapper.isOpen&&(b==a.ui.keyCode.TAB)){}}}}},_handleFocus:function(f,d,b){var c=this;if(b&&!c.dropWrapper.isOpen){f.stopImmediatePropagation();if(d){c.controlSelector.addClass("ui-state-hover");if(a.ui.dropdownchecklist.gLastOpened!=null){a.ui.dropdownchecklist.gLastOpened._toggleDropContainer(false)}}else{c.controlSelector.removeClass("ui-state-hover")}}else{if(!b&&!d){if(f!=null){f.stopImmediatePropagation()}c.controlSelector.removeClass("ui-state-hover");c._toggleDropContainer(false)}}},_cancelBlur:function(c){var b=this;if(b.blurringItem!=null){clearTimeout(b.blurringItem);b.blurringItem=null}},_appendControl:function(){var d=this,h=this.sourceSelect,c=this.options;var k=a("<span/>");k.addClass("ui-dropdownchecklist ui-dropdownchecklist-selector-wrapper ui-widget");k.css({cursor:"default",overflow:"hidden"});var e=h.attr("id");if((e==null)||(e=="")){e="ddcl-"+a.ui.dropdownchecklist.gIDCounter++}else{e="ddcl-"+e}k.attr("id",e);var b=a("<span/>");b.addClass("ui-dropdownchecklist-selector ui-state-default");b.css({display:"inline-block",overflow:"hidden","white-space":"nowrap"});var g=h.attr("tabIndex");if(g==null){g=0}else{g=parseInt(g);if(g<0){g=0}}b.attr("tabIndex",g);b.keyup(function(l){d._handleKeyboard(l)});b.focus(function(l){d._handleFocus(l,true,true)});b.blur(function(l){d._handleFocus(l,false,true)});k.append(b);if(c.icon!=null){var j=(c.icon.placement==null)?"left":c.icon.placement;var f=a("<div/>");f.addClass("ui-icon");f.addClass((c.icon.toOpen!=null)?c.icon.toOpen:"ui-icon-triangle-1-e");f.css({"float":j});b.append(f)}var i=a("<span/>");i.addClass("ui-dropdownchecklist-text");i.css({display:"inline-block","white-space":"nowrap",overflow:"hidden"});b.append(i);k.hover(function(){if(!d.disabled){b.addClass("ui-state-hover")}},function(){if(!d.disabled){b.removeClass("ui-state-hover")}});k.click(function(l){if(!d.disabled){l.stopImmediatePropagation();d._toggleDropContainer(!d.dropWrapper.isOpen)}});k.insertAfter(h);a(window).resize(function(){if(!d.disabled&&d.dropWrapper.isOpen){d._toggleDropContainer(true)}});return k},_createDropItem:function(k,c,j,e,p,h,q){var g=this,n=this.options,d=this.sourceSelect,l=this.controlWrapper;var s=a("<div/>");s.addClass("ui-dropdownchecklist-item");s.css({"white-space":"nowrap"});var o=p?' checked="checked"':"";var i=h?' class="inactive"':' class="active"';var f=l.attr("id");var m=f+"-i"+k;var r;if(g.isMultiple){r=a('<input disabled type="checkbox" id="'+m+'"'+o+i+' tabindex="'+c+'" />')}else{r=a('<input disabled type="radio" id="'+m+'" name="'+f+'"'+o+i+' tabindex="'+c+'" />')}r=r.attr("index",k).val(j);s.append(r);var b=a("<label for="+m+"/>");b.addClass("ui-dropdownchecklist-text");b.css({cursor:"default"});b.text(e);if(q){s.addClass("ui-dropdownchecklist-indent")}s.addClass("ui-state-default");if(h){s.addClass("ui-state-disabled")}b.click(function(t){t.stopImmediatePropagation()});s.append(b);s.hover(function(u){var t=a(this);if(!t.hasClass("ui-state-disabled")){t.addClass("ui-state-hover")}},function(u){var t=a(this);t.removeClass("ui-state-hover")});r.click(function(u){var t=a(this);u.stopImmediatePropagation();if(t.hasClass("active")){g._syncSelected(t);g.sourceSelect.trigger("change","ddcl_internal");if(!g.isMultiple&&n.closeRadioOnClick){g._toggleDropContainer(false)}}});s.click(function(w){var t=a(this);w.stopImmediatePropagation();if(!t.hasClass("ui-state-disabled")){var v=t.find("input");var u=v.attr("checked");v.attr("checked",!u);g._syncSelected(v);g.sourceSelect.trigger("change","ddcl_internal");if(!u&&!g.isMultiple&&n.closeRadioOnClick){g._toggleDropContainer(false)}}else{t.focus();g._cancelBlur()}});s.focus(function(u){var t=a(this);u.stopImmediatePropagation()});s.keyup(function(t){g._handleKeyboard(t)});return s},_createGroupItem:function(f,b){var e=this;var c=a("<div />");c.addClass("ui-dropdownchecklist-group ui-widget-header");if(b){c.addClass("ui-state-disabled")}c.css({"white-space":"nowrap"});var d=a("<span/>");d.addClass("ui-dropdownchecklist-text");d.css({cursor:"default"});d.text(f);c.append(d);c.click(function(g){var h=a(this);g.stopImmediatePropagation();h.focus();e._cancelBlur()});c.focus(function(g){var h=a(this);g.stopImmediatePropagation()});return c},_appendItems:function(){var c=this,b=this.sourceSelect,e=this.dropWrapper;var f=e.find(".ui-dropdownchecklist-dropcontainer");b.children().each(function(j){var i=a(this);if(i.is("option")){c._appendOption(i,f,j,false,false)}else{if(i.is("optgroup")){var h=i.attr("disabled");var l=i.attr("label");if(l!=""){var k=c._createGroupItem(l,h);f.append(k)}c._appendOptions(i,f,j,true,h)}}});var g=f.outerWidth();var d=f.outerHeight();return{width:g,height:d}},_appendOptions:function(d,f,e,b,g){var c=this;d.children("option").each(function(i){var h=a(this);var j=(e+"."+i);c._appendOption(h,f,j,b,g)})},_appendOption:function(h,k,f,c,j){var e=this;var l=h.text();var b=h.val();var g=h.attr("selected");var i=(j||h.attr("disabled"));var d=e.controlSelector.attr("tabindex");var m=e._createDropItem(f,d,b,l,g,i,c);k.append(m)},_syncSelected:function(f){var d=this,c=this.options,i=this.sourceSelect,e=this.dropWrapper;var b=e.find("input.active");if(c.firstItemChecksAll){if((f!=null)&&(f.attr("index")==0)){b.attr("checked",f.attr("checked"))}else{var g=true;var j=null;b.each(function(l){if(l>0){var k=a(this).attr("checked");if(!k){g=false}}else{j=a(this)}});if(j!=null){j.attr("checked",g)}}}b=e.find("input");var h=i.get(0).options;b.each(function(k){a(h[k]).attr("selected",a(this).attr("checked"))});d._updateControlText();if(f!=null){f.focus()}},_sourceSelectChangeHandler:function(c){var d=this,b=this.dropWrapper;b.find("input").val(d.sourceSelect.val());d._updateControlText()},_updateControlText:function(){var c=this,h=this.sourceSelect,b=this.options,f=this.controlWrapper;var e=h.find("option:first");var d=h.find("option");var i=c._formatText(d,b.firstItemChecksAll,e);var g=f.find(".ui-dropdownchecklist-text");g.html(i);g.attr("title",i)},_formatText:function(e,f,d){var b;if(a.isFunction(this.options.textFormatFunction)){try{b=this.options.textFormatFunction(e)}catch(c){alert("textFormatFunction failed: "+c)}}else{if(f&&(d!=null)&&d.attr("selected")){b=d.text()}else{b="";e.each(function(){if(a(this).attr("selected")){if(b!=""){b+=", "}b+=a(this).text()}});if(b==""){b=(this.options.emptyText!=null)?this.options.emptyText:"&nbsp;"}}}return b},_toggleDropContainer:function(c){var d=this;var b=function(i){if((i!=null)&&i.dropWrapper.isOpen){i.dropWrapper.isOpen=false;a.ui.dropdownchecklist.gLastOpened=null;var h=i.options;i.dropWrapper.css({top:"-33000px",left:"-33000px"});var f=i.controlSelector;f.removeClass("ui-state-active");f.removeClass("ui-state-hover");var j=i.controlWrapper.find(".ui-icon");if(j.length>0){j.removeClass((h.icon.toClose!=null)?h.icon.toClose:"ui-icon-triangle-1-s");j.addClass((h.icon.toOpen!=null)?h.icon.toOpen:"ui-icon-triangle-1-e")}a(document).unbind("click",b);i.dropWrapper.find("input.active").attr("disabled","disabled");if(a.isFunction(h.onComplete)){try{h.onComplete.call(i,i.sourceSelect.get(0))}catch(g){alert("callback failed: "+g)}}}};var e=function(j){if(!j.dropWrapper.isOpen){j.dropWrapper.isOpen=true;a.ui.dropdownchecklist.gLastOpened=j;var g=j.options;j.dropWrapper.css({top:j.controlWrapper.offset().top+j.controlWrapper.outerHeight()+"px",left:j.controlWrapper.offset().left+"px"});var f=j.controlWrapper.parents().map(function(){var n=a(this).css("z-index");return isNaN(n)?0:n}).get();var h=Math.max.apply(Math,f);if(h>0){j.dropWrapper.css({zIndex:(h+1)})}var i=j.controlSelector;i.addClass("ui-state-active");i.removeClass("ui-state-hover");var m=j.controlWrapper.find(".ui-icon");if(m.length>0){m.removeClass((g.icon.toOpen!=null)?g.icon.toOpen:"ui-icon-triangle-1-e");m.addClass((g.icon.toClose!=null)?g.icon.toClose:"ui-icon-triangle-1-s")}a(document).bind("click",function(n){b(j)});var l=j.dropWrapper.find("input.active");l.removeAttr("disabled");var k=l.get(0);if(k!=null){k.focus()}}};if(c){b(a.ui.dropdownchecklist.gLastOpened);e(d)}else{b(d)}},_setSize:function(c){var l=this.options,e=this.dropWrapper,i=this.controlWrapper;var j=c.width;if(l.width!=null){j=parseInt(l.width)}else{if(l.minWidth!=null){var d=parseInt(l.minWidth);if(j<d){j=d}}}var b=this.controlSelector;b.css({width:j+"px"});var f=b.find(".ui-dropdownchecklist-text");var g=b.find(".ui-icon");if(g!=null){j-=(g.outerWidth()+6);f.css({width:j+"px"})}j=i.outerWidth();var k=(l.maxDropHeight!=null)?parseInt(l.maxDropHeight):-1;var m=((k>0)&&(c.height>k))?k:c.height;var h=c.width<j?j:c.width;a(e).css({height:m+"px",width:h+"px"});e.find(".ui-dropdownchecklist-dropcontainer").css({height:m+"px"})},_init:function(){var c=this,b=this.options;if(a.ui.dropdownchecklist.gIDCounter==null){a.ui.dropdownchecklist.gIDCounter=1}c.blurringItem=null;var g=c.element;c.initialDisplay=g.css("display");g.css("display","none");c.initialMultiple=g.attr("multiple");c.isMultiple=c.initialMultiple;if(b.forceMultiple!=null){c.isMultiple=b.forceMultiple}g.attr("multiple",true);c.sourceSelect=g;var f=c._appendControl();c.controlWrapper=f;c.controlSelector=f.find(".ui-dropdownchecklist-selector");var e=c._appendDropContainer(f);c.dropWrapper=e;var d=c._appendItems();c._updateControlText(f,e,g);c._setSize(d);if(b.firstItemChecksAll){c._syncSelected(null)}if(b.bgiframe&&typeof c.dropWrapper.bgiframe=="function"){c.dropWrapper.bgiframe()}c.sourceSelect.change(function(h,i){if(i!="ddcl_internal"){c._sourceSelectChangeHandler(h)}})},_refreshOption:function(e,b,c){var d=e.parent();if(b){e.attr("disabled","disabled");e.removeClass("active");e.addClass("inactive");d.addClass("ui-state-disabled")}else{e.removeAttr("disabled");e.removeClass("inactive");e.addClass("active");d.removeClass("ui-state-disabled")}e.attr("checked",c)},_refreshGroup:function(c,b){if(b){c.addClass("ui-state-disabled")}else{c.removeClass("ui-state-disabled")}},refresh:function(){var b=this,f=this.sourceSelect,g=this.dropWrapper;var e=g.find("input");var c=g.find(".ui-dropdownchecklist-group");var h=0;var d=0;f.children().each(function(m){var o=a(this);var i=o.attr("disabled");if(o.is("option")){var l=o.attr("selected");var k=a(e[d]);b._refreshOption(k,i,l);d+=1}else{if(o.is("optgroup")){var n=o.attr("label");if(n!=""){var j=a(c[h]);b._refreshGroup(j,i);h+=1}o.children("option").each(function(q){var r=a(this);var t=(i||r.attr("disabled"));var s=r.attr("selected");var p=a(e[d+q]);b._refreshOption(p,t,s)})}}});b._updateControlText()},enable:function(){this.controlSelector.removeClass("ui-state-disabled");this.disabled=false},disable:function(){this.controlSelector.addClass("ui-state-disabled");this.disabled=true},destroy:function(){a.Widget.prototype.destroy.apply(this,arguments);this.sourceSelect.css("display",this.initialDisplay);this.sourceSelect.attr("multiple",this.initialMultiple);this.controlWrapper.unbind().remove();this.dropWrapper.remove()}});a.extend(a.ui.dropdownchecklist,{defaults:{width:null,maxDropHeight:null,firstItemChecksAll:false,closeRadioOnClick:false,minWidth:50,bgiframe:false}})})(jQuery);
jQuery.cookie=function(k,a,c){if(typeof a!="undefined"){c=c||{};if(a===null){a="";c=$.extend({},c);c.expires=-1}var b="";if(c.expires&&(typeof c.expires=="number"||c.expires.toUTCString)){var f;if(typeof c.expires=="number"){f=new Date();f.setTime(f.getTime()+(c.expires*24*60*60*1000))}else{f=c.expires}b="; expires="+f.toUTCString()}var g=c.path?"; path="+(c.path):"";var j=c.domain?"; domain="+(c.domain):"";var m=c.secure?"; secure":"";document.cookie=[k,"=",encodeURIComponent(a),b,g,j,m].join("")}else{var l=null;if(document.cookie&&document.cookie!=""){var h=document.cookie.split(";");for(var d=0;d<h.length;d++){var e=jQuery.trim(h[d]);if(e.substring(0,k.length+1)==(k+"=")){l=decodeURIComponent(e.substring(k.length+1));break}}}return l}};
/*
 * jQuery corner plugin: simple corner rounding
 * Examples and documentation at: http://jquery.malsup.com/corner/
 * version 2.11 (15-JUN-2010)
 * Requires jQuery v1.3.2 or later
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 * Authors: Dave Methvin and Mike Alsup
 */
(function(e){var b=document.createElement("div").style,i=b.MozBorderRadius!==undefined,g=b.WebkitBorderRadius!==undefined,c=b.borderRadius!==undefined||b.BorderRadius!==undefined,l=document.documentMode||0,d=e.browser.msie&&((e.browser.version<8&&!l)||l<8),h=e.browser.msie&&(function(){var n=document.createElement("div");try{n.style.setExpression("width","0+0");n.style.removeExpression("width")}catch(m){return false}return true})();e.support=e.support||{};e.support.borderRadius=i||g||c;function f(m,n){return parseInt(e.css(m,n))||0}function k(m){var m=parseInt(m).toString(16);return(m.length<2)?"0"+m:m}function j(m){while(m){var n=e.css(m,"backgroundColor"),o;if(n&&n!="transparent"&&n!="rgba(0, 0, 0, 0)"){if(n.indexOf("rgb")>=0){o=n.match(/\d+/g);return"#"+k(o[0])+k(o[1])+k(o[2])}return n}if(m.nodeName.toLowerCase()=="html"){break}m=m.parentNode}return"#ffffff"}function a(m,n,o){switch(m){case"round":return Math.round(o*(1-Math.cos(Math.asin(n/o))));case"cool":return Math.round(o*(1+Math.cos(Math.asin(n/o))));case"sharp":return Math.round(o*(1-Math.cos(Math.acos(n/o))));case"bite":return Math.round(o*(Math.cos(Math.asin((o-n-1)/o))));case"slide":return Math.round(o*(Math.atan2(n,o/n)));case"jut":return Math.round(o*(Math.atan2(o,(o-n-1))));case"curl":return Math.round(o*(Math.atan(n)));case"tear":return Math.round(o*(Math.cos(n)));case"wicked":return Math.round(o*(Math.tan(n)));case"long":return Math.round(o*(Math.sqrt(n)));case"sculpt":return Math.round(o*(Math.log((o-n-1),o)));case"dogfold":case"dog":return(n&1)?(n+1):o;case"dog2":return(n&2)?(n+1):o;case"dog3":return(n&3)?(n+1):o;case"fray":return(n%2)*o;case"notch":return o;case"bevelfold":case"bevel":return n+1}}e.fn.corner=function(o){if(this.length==0){if(!e.isReady&&this.selector){var m=this.selector,n=this.context;e(function(){e(m,n).corner(o)})}return this}return this.each(function(p){var r=e(this),B=[r.attr(e.fn.corner.defaults.metaAttr)||"",o||""].join(" ").toLowerCase(),J=/keep/.test(B),Q=((B.match(/cc:(#[0-9a-f]+)/)||[])[1]),O=((B.match(/sc:(#[0-9a-f]+)/)||[])[1]),I=parseInt((B.match(/(\d+)px/)||[])[1])||10,G=/round|bevelfold|bevel|notch|bite|cool|sharp|slide|jut|curl|tear|fray|wicked|sculpt|long|dog3|dog2|dogfold|dog/,v=((B.match(G)||["round"])[0]),M=/dogfold|bevelfold/.test(B),q={T:0,B:1},C={TL:/top|tl|left/.test(B),TR:/top|tr|right/.test(B),BL:/bottom|bl|left/.test(B),BR:/bottom|br|right/.test(B)},H,s,L,A,u,E,x,K,z,y,F,D,N,t;if(!C.TL&&!C.TR&&!C.BL&&!C.BR){C={TL:1,TR:1,BL:1,BR:1}}if(e.fn.corner.defaults.useNative&&v=="round"&&(c||i||g)&&!Q&&!O){if(C.TL){r.css(c?"border-top-left-radius":i?"-moz-border-radius-topleft":"-webkit-border-top-left-radius",I+"px")}if(C.TR){r.css(c?"border-top-right-radius":i?"-moz-border-radius-topright":"-webkit-border-top-right-radius",I+"px")}if(C.BL){r.css(c?"border-bottom-left-radius":i?"-moz-border-radius-bottomleft":"-webkit-border-bottom-left-radius",I+"px")}if(C.BR){r.css(c?"border-bottom-right-radius":i?"-moz-border-radius-bottomright":"-webkit-border-bottom-right-radius",I+"px")}return}H=document.createElement("div");e(H).css({overflow:"hidden",height:"1px",minHeight:"1px",fontSize:"1px",backgroundColor:O||"transparent",borderStyle:"solid"});s={T:parseInt(e.css(this,"paddingTop"))||0,R:parseInt(e.css(this,"paddingRight"))||0,B:parseInt(e.css(this,"paddingBottom"))||0,L:parseInt(e.css(this,"paddingLeft"))||0};if(typeof this.style.zoom!=undefined){this.style.zoom=1}if(!J){this.style.border="none"}H.style.borderColor=Q||j(this.parentNode);L=e(this).outerHeight();for(A in q){u=q[A];if((u&&(C.BL||C.BR))||(!u&&(C.TL||C.TR))){H.style.borderStyle="none "+(C[A+"R"]?"solid":"none")+" none "+(C[A+"L"]?"solid":"none");E=document.createElement("div");e(E).addClass("jquery-corner");x=E.style;u?this.appendChild(E):this.insertBefore(E,this.firstChild);if(u&&L!="auto"){if(e.css(this,"position")=="static"){this.style.position="relative"}x.position="absolute";x.bottom=x.left=x.padding=x.margin="0";if(h){x.setExpression("width","this.parentNode.offsetWidth")}else{x.width="100%"}}else{if(!u&&e.browser.msie){if(e.css(this,"position")=="static"){this.style.position="relative"}x.position="absolute";x.top=x.left=x.right=x.padding=x.margin="0";if(h){K=f(this,"borderLeftWidth")+f(this,"borderRightWidth");x.setExpression("width","this.parentNode.offsetWidth - "+K+'+ "px"')}else{x.width="100%"}}else{x.position="relative";x.margin=!u?"-"+s.T+"px -"+s.R+"px "+(s.T-I)+"px -"+s.L+"px":(s.B-I)+"px -"+s.R+"px -"+s.B+"px -"+s.L+"px"}}for(z=0;z<I;z++){y=Math.max(0,a(v,z,I));F=H.cloneNode(false);F.style.borderWidth="0 "+(C[A+"R"]?y:0)+"px 0 "+(C[A+"L"]?y:0)+"px";u?E.appendChild(F):E.insertBefore(F,E.firstChild)}if(M&&e.support.boxModel){if(u&&d){continue}for(D in C){if(!C[D]){continue}if(u&&(D=="TL"||D=="TR")){continue}if(!u&&(D=="BL"||D=="BR")){continue}N={position:"absolute",border:"none",margin:0,padding:0,overflow:"hidden",backgroundColor:H.style.borderColor};t=e("<div/>").css(N).css({width:I+"px",height:"1px"});switch(D){case"TL":t.css({bottom:0,left:0});break;case"TR":t.css({bottom:0,right:0});break;case"BL":t.css({top:0,left:0});break;case"BR":t.css({top:0,right:0});break}E.appendChild(t[0]);var P=e("<div/>").css(N).css({top:0,bottom:0,width:"1px",height:I+"px"});switch(D){case"TL":P.css({left:I});break;case"TR":P.css({right:I});break;case"BL":P.css({left:I});break;case"BR":P.css({right:I});break}E.appendChild(P[0])}}}}})};e.fn.uncorner=function(){if(c||i||g){this.css(c?"border-radius":i?"-moz-border-radius":"-webkit-border-radius",0)}e("div.jquery-corner",this).remove();return this};e.fn.corner.defaults={useNative:true,metaAttr:"data-corner"}})(jQuery);
var _canLog=true;function _log(d,c){if(!_canLog){return}var g=Array.prototype.slice.apply(arguments,[1]);var b=new Date();var a=b.getHours()+":"+b.getMinutes()+":"+b.getSeconds()+"."+b.getMilliseconds();g[0]=a+" - "+g[0];try{switch(d){case"info":window.console.info.apply(window.console,g);break;case"warn":window.console.warn.apply(window.console,g);break;default:window.console.log.apply(window.console,g);break}}catch(f){if(!window.console){_canLog=false}}}function logMsg(a){Array.prototype.unshift.apply(arguments,["debug"]);_log.apply(this,arguments)}var getDynaTreePersistData=undefined;var DTNodeStatus_Error=-1;var DTNodeStatus_Loading=1;var DTNodeStatus_Ok=0;(function($){var Class={create:function(){return function(){this.initialize.apply(this,arguments)}}};function getDtNodeFromElement(el){var iMax=5;while(el&&iMax--){if(el.dtnode){return el.dtnode}el=el.parentNode}return null}var DynaTreeNode=Class.create();DynaTreeNode.prototype={initialize:function(parent,tree,data){this.parent=parent;this.tree=tree;if(typeof data==="string"){data={title:data}}if(data.key===undefined){data.key="_"+tree._nodeCount++}this.data=$.extend({},$.ui.dynatree.nodedatadefaults,data);this.li=null;this.span=null;this.ul=null;this.childList=null;this.isLoading=false;this.hasSubSel=false},toString:function(){return"dtnode<"+this.data.key+">: '"+this.data.title+"'"},toDict:function(recursive,callback){var dict=$.extend({},this.data);dict.activate=(this.tree.activeNode===this);dict.focus=(this.tree.focusNode===this);dict.expand=this.bExpanded;dict.select=this.bSelected;if(callback){callback(dict)}if(recursive&&this.childList){dict.children=[];for(var i=0;i<this.childList.length;i++){dict.children.push(this.childList[i].toDict(true,callback))}}else{delete dict.children}return dict},_getInnerHtml:function(){var opts=this.tree.options;var cache=this.tree.cache;var level=this.getLevel();var res="";if(level<opts.minExpandLevel){if(level>1){res+=cache.tagConnector}}else{if(this.hasChildren()!==false){res+=cache.tagExpander}else{res+=cache.tagConnector}}if(opts.checkbox&&this.data.hideCheckbox!==true&&!this.data.isStatusNode){res+=cache.tagCheckbox}if(this.data.icon){res+="<img src='"+opts.imagePath+this.data.icon+"' alt='' />"}else{if(this.data.icon===false){}else{res+=cache.tagNodeIcon}}var tooltip=this.data.tooltip?" title='"+this.data.tooltip+"'":"";if(opts.noLink||this.data.noLink){res+="<span style='display: inline-block;' class='"+opts.classNames.title+"'"+tooltip+">"+this.data.title+"</span>"}else{res+="<a href='#' class='"+opts.classNames.title+"'"+tooltip+">"+this.data.title+"</a>"}return res},_fixOrder:function(){var cl=this.childList;if(!cl){return}var childLI=this.ul.firstChild;for(var i=0;i<cl.length-1;i++){var childNode1=cl[i];var childNode2=childLI.dtnode;if(childNode1!==childNode2){this.tree.logDebug("_fixOrder: mismatch at index "+i+": "+childNode1+" != "+childNode2);this.ul.insertBefore(childNode1.li,childNode2.li)}else{childLI=childLI.nextSibling}}},render:function(useEffects){var opts=this.tree.options;var cn=opts.classNames;var isLastSib=this.isLastSibling();if(!this.parent&&!this.ul){this.li=this.span=null;this.ul=document.createElement("ul");if(opts.minExpandLevel>1){this.ul.className=cn.container+" "+cn.noConnector}else{this.ul.className=cn.container}}else{if(this.parent){if(!this.li){this.li=document.createElement("li");this.li.dtnode=this;if(this.data.key&&opts.generateIds){this.li.id=opts.idPrefix+this.data.key}this.span=document.createElement("span");this.span.className=cn.title;this.li.appendChild(this.span);if(!this.parent.ul){this.parent.ul=document.createElement("ul");this.parent.ul.style.display="none";this.parent.li.appendChild(this.parent.ul)}this.parent.ul.appendChild(this.li)}this.span.innerHTML=this._getInnerHtml();var cnList=[];cnList.push(cn.node);if(this.data.isFolder){cnList.push(cn.folder)}if(this.bExpanded){cnList.push(cn.expanded)}if(this.hasChildren()!==false){cnList.push(cn.hasChildren)}if(this.data.isLazy&&this.childList===null){cnList.push(cn.lazy)}if(isLastSib){cnList.push(cn.lastsib)}if(this.bSelected){cnList.push(cn.selected)}if(this.hasSubSel){cnList.push(cn.partsel)}if(this.tree.activeNode===this){cnList.push(cn.active)}if(this.data.addClass){cnList.push(this.data.addClass)}cnList.push(cn.combinedExpanderPrefix+(this.bExpanded?"e":"c")+(this.data.isLazy&&this.childList===null?"d":"")+(isLastSib?"l":""));cnList.push(cn.combinedIconPrefix+(this.bExpanded?"e":"c")+(this.data.isFolder?"f":""));this.span.className=cnList.join(" ");this.li.className=isLastSib?cn.lastsib:""}}if(this.bExpanded&&this.childList){for(var i=0;i<this.childList.length;i++){this.childList[i].render()}this._fixOrder()}if(this.ul){var isHidden=(this.ul.style.display==="none");if(useEffects&&opts.fx&&!!isHidden===!!this.bExpanded){var duration=opts.fx.duration||200;$(this.ul).animate(opts.fx,duration)}else{this.ul.style.display=(this.bExpanded||!this.parent)?"":"none"}}},getParent:function(){return this.parent},getChildren:function(){return this.childList},hasChildren:function(){if(this.data.isLazy){if(this.childList===null||this.childList===undefined){return undefined}else{if(this.childList.length===0){return false}else{if(this.childList.length===1&&this.childList[0].isStatusNode()){return undefined}}}return true}return !!this.childList},isLastSibling:function(){var p=this.parent;if(!p){return true}return p.childList[p.childList.length-1]===this},getPrevSibling:function(){if(!this.parent){return null}var ac=this.parent.childList;for(var i=1;i<ac.length;i++){if(ac[i]===this){return ac[i-1]}}return null},getNextSibling:function(){if(!this.parent){return null}var ac=this.parent.childList;for(var i=0;i<ac.length-1;i++){if(ac[i]===this){return ac[i+1]}}return null},isStatusNode:function(){return(this.data.isStatusNode===true)},isChildOf:function(otherNode){return(this.parent&&this.parent===otherNode)},isDescendantOf:function(otherNode){if(!otherNode){return false}var p=this.parent;while(p){if(p===otherNode){return true}p=p.parent}return false},sortChildren:function(cmp,deep){var cl=this.childList;if(!cl){return}cmp=cmp||function(a,b){return a.data.title===b.data.title?0:a.data.title>b.data.title};cl.sort(cmp);if(deep){for(var i=0;i<cl.length;i++){if(cl[i].childList){cl[i].sortChildren(cmp,"$norender$")}}}if(deep!=="$norender$"){this.render()}},_setStatusNode:function(data){var firstChild=(this.childList?this.childList[0]:null);if(!data){if(firstChild){this.ul.removeChild(firstChild.li);if(this.childList.length==1){this.childList=null}else{this.childList.shift()}}}else{if(firstChild){data.isStatusNode=true;firstChild.data=data;firstChild.render()}else{data.isStatusNode=true;firstChild=this.addChild(data)}}},setLazyNodeStatus:function(lts,opts){var tooltip=(opts&&opts.tooltip)?opts.tooltip:null;var info=(opts&&opts.info)?" ("+opts.info+")":"";switch(lts){case DTNodeStatus_Ok:this._setStatusNode(null);this.isLoading=false;this.render();if(this.tree.options.autoFocus){if(this===this.tree.tnRoot&&this.childList){this.childList[0].focus()}else{this.focus()}}break;case DTNodeStatus_Loading:this.isLoading=true;this._setStatusNode({title:this.tree.options.strings.loading+info,tooltip:tooltip,addClass:this.tree.options.classNames.nodeWait});break;case DTNodeStatus_Error:this.isLoading=false;this._setStatusNode({title:this.tree.options.strings.loadError+info,tooltip:tooltip,addClass:this.tree.options.classNames.nodeError});break;default:throw"Bad LazyNodeStatus: '"+lts+"'."}},_parentList:function(includeRoot,includeSelf){var l=[];var dtn=includeSelf?this:this.parent;while(dtn){if(includeRoot||dtn.parent){l.unshift(dtn)}dtn=dtn.parent}return l},getLevel:function(){var level=0;var dtn=this.parent;while(dtn){level++;dtn=dtn.parent}return level},_getTypeForOuterNodeEvent:function(event){var cns=this.tree.options.classNames;var target=event.target;if(target.className.indexOf(cns.node)<0){return null}var eventX=event.pageX-target.offsetLeft;var eventY=event.pageY-target.offsetTop;for(var i=0;i<target.childNodes.length;i++){var cn=target.childNodes[i];var x=cn.offsetLeft-target.offsetLeft;var y=cn.offsetTop-target.offsetTop;var nx=cn.clientWidth,ny=cn.clientHeight;if(eventX>=x&&eventX<=(x+nx)&&eventY>=y&&eventY<=(y+ny)){if(cn.className==cns.title){return"title"}else{if(cn.className==cns.expander){return"expander"}else{if(cn.className==cns.checkbox){return"checkbox"}else{if(cn.className==cns.nodeIcon){return"icon"}}}}}}return"prefix"},getEventTargetType:function(event){var tcn=event&&event.target?event.target.className:"";var cns=this.tree.options.classNames;if(tcn===cns.title){return"title"}else{if(tcn===cns.expander){return"expander"}else{if(tcn===cns.checkbox){return"checkbox"}else{if(tcn===cns.nodeIcon){return"icon"}else{if(tcn===cns.empty||tcn===cns.vline||tcn===cns.connector){return"prefix"}else{if(tcn.indexOf(cns.node)>=0){return this._getTypeForOuterNodeEvent(event)}}}}}}return null},isVisible:function(){var parents=this._parentList(true,false);for(var i=0;i<parents.length;i++){if(!parents[i].bExpanded){return false}}return true},makeVisible:function(){var parents=this._parentList(true,false);for(var i=0;i<parents.length;i++){parents[i]._expand(true)}},focus:function(){this.makeVisible();try{$(this.span).find(">a").focus()}catch(e){}},_activate:function(flag,fireEvents){this.tree.logDebug("dtnode._activate(%o, fireEvents=%o) - %o",flag,fireEvents,this);var opts=this.tree.options;if(this.data.isStatusNode){return}if(fireEvents&&opts.onQueryActivate&&opts.onQueryActivate.call(this.tree,flag,this)===false){return}if(flag){if(this.tree.activeNode){if(this.tree.activeNode===this){return}this.tree.activeNode.deactivate()}if(opts.activeVisible){this.makeVisible()}this.tree.activeNode=this;if(opts.persist){$.cookie(opts.cookieId+"-active",this.data.key,opts.cookie)}this.tree.persistence.activeKey=this.data.key;$(this.span).addClass(opts.classNames.active);if(fireEvents&&opts.onActivate){opts.onActivate.call(this.tree,this)}}else{if(this.tree.activeNode===this){var opts=this.tree.options;if(opts.onQueryActivate&&opts.onQueryActivate.call(this.tree,false,this)===false){return}$(this.span).removeClass(opts.classNames.active);if(opts.persist){$.cookie(opts.cookieId+"-active","",opts.cookie)}this.tree.persistence.activeKey=null;this.tree.activeNode=null;if(fireEvents&&opts.onDeactivate){opts.onDeactivate.call(this.tree,this)}}}},activate:function(){this._activate(true,true)},deactivate:function(){this._activate(false,true)},isActive:function(){return(this.tree.activeNode===this)},_userActivate:function(){var activate=true;var expand=false;if(this.data.isFolder){switch(this.tree.options.clickFolderMode){case 2:activate=false;expand=true;break;case 3:activate=expand=true;break}}if(this.parent===null){expand=false}if(expand){this.toggleExpand();this.focus()}if(activate){this.activate()}},_setSubSel:function(hasSubSel){if(hasSubSel){this.hasSubSel=true;$(this.span).addClass(this.tree.options.classNames.partsel)}else{this.hasSubSel=false;$(this.span).removeClass(this.tree.options.classNames.partsel)}},_fixSelectionState:function(){if(this.bSelected){this.visit(function(node){node.parent._setSubSel(true);node._select(true,false,false)});var p=this.parent;while(p){p._setSubSel(true);var allChildsSelected=true;for(var i=0;i<p.childList.length;i++){var n=p.childList[i];if(!n.bSelected&&!n.data.isStatusNode){allChildsSelected=false;break}}if(allChildsSelected){p._select(true,false,false)}p=p.parent}}else{this._setSubSel(false);this.visit(function(node){node._setSubSel(false);node._select(false,false,false)});var p=this.parent;while(p){p._select(false,false,false);var isPartSel=false;for(var i=0;i<p.childList.length;i++){if(p.childList[i].bSelected||p.childList[i].hasSubSel){isPartSel=true;break}}p._setSubSel(isPartSel);p=p.parent}}},_select:function(sel,fireEvents,deep){var opts=this.tree.options;if(this.data.isStatusNode){return}if(this.bSelected===sel){return}if(fireEvents&&opts.onQuerySelect&&opts.onQuerySelect.call(this.tree,sel,this)===false){return}if(opts.selectMode==1&&sel){this.tree.visit(function(node){if(node.bSelected){node._select(false,false,false);return false}})}this.bSelected=sel;if(sel){if(opts.persist){this.tree.persistence.addSelect(this.data.key)}$(this.span).addClass(opts.classNames.selected);if(deep&&opts.selectMode===3){this._fixSelectionState()}if(fireEvents&&opts.onSelect){opts.onSelect.call(this.tree,true,this)}}else{if(opts.persist){this.tree.persistence.clearSelect(this.data.key)}$(this.span).removeClass(opts.classNames.selected);if(deep&&opts.selectMode===3){this._fixSelectionState()}if(fireEvents&&opts.onSelect){opts.onSelect.call(this.tree,false,this)}}},select:function(sel){if(this.data.unselectable){return this.bSelected}return this._select(sel!==false,true,true)},toggleSelect:function(){return this.select(!this.bSelected)},isSelected:function(){return this.bSelected},_loadContent:function(){try{var opts=this.tree.options;this.tree.logDebug("_loadContent: start - %o",this);this.setLazyNodeStatus(DTNodeStatus_Loading);if(true===opts.onLazyRead.call(this.tree,this)){this.setLazyNodeStatus(DTNodeStatus_Ok);this.tree.logDebug("_loadContent: succeeded - %o",this)}}catch(e){this.tree.logWarning("_loadContent: failed - %o",e);this.setLazyNodeStatus(DTNodeStatus_Error,{tooltip:""+e})}},_expand:function(bExpand){if(this.bExpanded===bExpand){return}var opts=this.tree.options;if(!bExpand&&this.getLevel()<opts.minExpandLevel){this.tree.logDebug("dtnode._expand(%o) prevented collapse - %o",bExpand,this);return}if(opts.onQueryExpand&&opts.onQueryExpand.call(this.tree,bExpand,this)===false){return}this.bExpanded=bExpand;if(opts.persist){if(bExpand){this.tree.persistence.addExpand(this.data.key)}else{this.tree.persistence.clearExpand(this.data.key)}}var allowEffects=!(this.data.isLazy&&this.childList===null)&&!this.isLoading;this.render(allowEffects);if(this.bExpanded&&this.parent&&opts.autoCollapse){var parents=this._parentList(false,true);for(var i=0;i<parents.length;i++){parents[i].collapseSiblings()}}if(opts.activeVisible&&this.tree.activeNode&&!this.tree.activeNode.isVisible()){this.tree.activeNode.deactivate()}if(bExpand&&this.data.isLazy&&this.childList===null&&!this.isLoading){this._loadContent();return}if(opts.onExpand){opts.onExpand.call(this.tree,bExpand,this)}},expand:function(flag){if(!this.childList&&!this.data.isLazy&&flag){return}if(this.parent===null&&!flag){return}this._expand(flag)},scheduleAction:function(mode,ms){if(this.tree.timer){clearTimeout(this.tree.timer);logMsg("clearTimeout(%o)",this.tree.timer)}var self=this;switch(mode){case"cancel":break;case"expand":this.tree.timer=setTimeout(function(){logMsg("setTimeout: trigger");self.expand(true)},ms);break;case"activate":this.tree.timer=setTimeout(function(){self.activate()},ms);break;default:throw"Invalid mode "+mode}logMsg("setTimeout(%s, %s): %s",mode,ms,this.tree.timer)},toggleExpand:function(){this.expand(!this.bExpanded)},collapseSiblings:function(){if(this.parent===null){return}var ac=this.parent.childList;for(var i=0;i<ac.length;i++){if(ac[i]!==this&&ac[i].bExpanded){ac[i]._expand(false)}}},onClick:function(event){var targetType=this.getEventTargetType(event);if(targetType==="expander"){this.toggleExpand();this.focus()}else{if(targetType==="checkbox"){this.toggleSelect();this.focus()}else{this._userActivate();var aTag=this.span.getElementsByTagName("a");if(aTag[0]){}else{return true}}}return false},onDblClick:function(event){},onKeydown:function(event){var handled=true;switch(event.which){case 107:case 187:if(!this.bExpanded){this.toggleExpand()}break;case 109:case 189:if(this.bExpanded){this.toggleExpand()}break;case 32:this._userActivate();break;case 8:if(this.parent){this.parent.focus()}break;case 37:if(this.bExpanded){this.toggleExpand();this.focus()}else{if(this.parent&&this.parent.parent){this.parent.focus()}}break;case 39:if(!this.bExpanded&&(this.childList||this.data.isLazy)){this.toggleExpand();this.focus()}else{if(this.childList){this.childList[0].focus()}}break;case 38:var sib=this.getPrevSibling();while(sib&&sib.bExpanded&&sib.childList){sib=sib.childList[sib.childList.length-1]}if(!sib&&this.parent&&this.parent.parent){sib=this.parent}if(sib){sib.focus()}break;case 40:var sib;if(this.bExpanded&&this.childList){sib=this.childList[0]}else{var parents=this._parentList(false,true);for(var i=parents.length-1;i>=0;i--){sib=parents[i].getNextSibling();if(sib){break}}}if(sib){sib.focus()}break;default:handled=false}return !handled},onKeypress:function(event){},onFocus:function(event){var opts=this.tree.options;if(event.type=="blur"||event.type=="focusout"){if(opts.onBlur){opts.onBlur.call(this.tree,this)}if(this.tree.tnFocused){$(this.tree.tnFocused.span).removeClass(opts.classNames.focused)}this.tree.tnFocused=null;if(opts.persist){$.cookie(opts.cookieId+"-focus","",opts.cookie)}}else{if(event.type=="focus"||event.type=="focusin"){if(this.tree.tnFocused&&this.tree.tnFocused!==this){this.tree.logDebug("dtnode.onFocus: out of sync: curFocus: %o",this.tree.tnFocused);$(this.tree.tnFocused.span).removeClass(opts.classNames.focused)}this.tree.tnFocused=this;if(opts.onFocus){opts.onFocus.call(this.tree,this)}$(this.tree.tnFocused.span).addClass(opts.classNames.focused);if(opts.persist){$.cookie(opts.cookieId+"-focus",this.data.key,opts.cookie)}}}},visit:function(fn,includeSelf){var res=true;if(includeSelf===true){res=fn(this);if(res===false||res=="skip"){return res}}if(this.childList){for(var i=0;i<this.childList.length;i++){res=this.childList[i].visit(fn,true);if(res===false){break}}}return res},visitParents:function(fn,includeSelf){if(includeSelf&&fn(this)===false){return false}var p=this.parent;while(p){if(fn(p)===false){return false}p=p.parent}return true},remove:function(){if(this===this.tree.root){throw"Cannot remove system root"}return this.parent.removeChild(this)},removeChild:function(tn){var ac=this.childList;if(ac.length==1){if(tn!==ac[0]){throw"removeChild: invalid child"}return this.removeChildren()}if(tn===this.tree.activeNode){tn.deactivate()}if(this.tree.options.persist){if(tn.bSelected){this.tree.persistence.clearSelect(tn.data.key)}if(tn.bExpanded){this.tree.persistence.clearExpand(tn.data.key)}}tn.removeChildren(true);this.ul.removeChild(tn.li);for(var i=0;i<ac.length;i++){if(ac[i]===tn){this.childList.splice(i,1);delete tn;break}}},removeChildren:function(isRecursiveCall,retainPersistence){var tree=this.tree;var ac=this.childList;if(ac){for(var i=0;i<ac.length;i++){var tn=ac[i];if(tn===tree.activeNode&&!retainPersistence){tn.deactivate()}if(this.tree.options.persist&&!retainPersistence){if(tn.bSelected){this.tree.persistence.clearSelect(tn.data.key)}if(tn.bExpanded){this.tree.persistence.clearExpand(tn.data.key)}}tn.removeChildren(true,retainPersistence);if(this.ul){this.ul.removeChild(tn.li)}delete tn}this.childList=null}if(!isRecursiveCall){this.isLoading=false;this.render()}},reload:function(force){throw"Use reloadChildren() instead"},reloadChildren:function(force){if(this.parent===null){return this.tree.reload()}if(!this.data.isLazy){throw"node.reloadChildren() requires lazy nodes."}if(this.bExpanded){this.expand(false);this.removeChildren();this.expand(true)}else{this.removeChildren();if(force){this._loadContent()}}},_addChildNode:function(dtnode,beforeNode){var tree=this.tree;var opts=tree.options;var pers=tree.persistence;dtnode.parent=this;if(this.childList===null){this.childList=[]}else{if(!beforeNode){$(this.childList[this.childList.length-1].span).removeClass(opts.classNames.lastsib)}}if(beforeNode){var iBefore=$.inArray(beforeNode,this.childList);if(iBefore<0){throw"<beforeNode> must be a child of <this>"}this.childList.splice(iBefore,0,dtnode)}else{this.childList.push(dtnode)}var isInitializing=tree.isInitializing();if(opts.persist&&pers.cookiesFound&&isInitializing){if(pers.activeKey==dtnode.data.key){tree.activeNode=dtnode}if(pers.focusedKey==dtnode.data.key){tree.focusNode=dtnode}dtnode.bExpanded=($.inArray(dtnode.data.key,pers.expandedKeyList)>=0);dtnode.bSelected=($.inArray(dtnode.data.key,pers.selectedKeyList)>=0)}else{if(dtnode.data.activate){tree.activeNode=dtnode;if(opts.persist){pers.activeKey=dtnode.data.key}}if(dtnode.data.focus){tree.focusNode=dtnode;if(opts.persist){pers.focusedKey=dtnode.data.key}}dtnode.bExpanded=(dtnode.data.expand===true);if(dtnode.bExpanded&&opts.persist){pers.addExpand(dtnode.data.key)}dtnode.bSelected=(dtnode.data.select===true);if(dtnode.bSelected&&opts.persist){pers.addSelect(dtnode.data.key)}}if(opts.minExpandLevel>=dtnode.getLevel()){this.bExpanded=true}if(dtnode.bSelected&&opts.selectMode==3){var p=this;while(p){if(!p.hasSubSel){p._setSubSel(true)}p=p.parent}}if(tree.bEnableUpdate){this.render()}return dtnode},addChild:function(obj,beforeNode){if(!obj||obj.length===0){return}if(obj instanceof DynaTreeNode){return this._addChildNode(obj,beforeNode)}if(!obj.length){obj=[obj]}var prevFlag=this.tree.enableUpdate(false);var tnFirst=null;for(var i=0;i<obj.length;i++){var data=obj[i];var dtnode=this._addChildNode(new DynaTreeNode(this,this.tree,data),beforeNode);if(!tnFirst){tnFirst=dtnode}if(data.children){dtnode.addChild(data.children,null)}}this.tree.enableUpdate(prevFlag);return tnFirst},append:function(obj){this.tree.logWarning("node.append() is deprecated (use node.addChild() instead).");return this.addChild(obj,null)},appendAjax:function(ajaxOptions){this.removeChildren(false,true);this.setLazyNodeStatus(DTNodeStatus_Loading);var self=this;var orgSuccess=ajaxOptions.success;var orgError=ajaxOptions.error;var options=$.extend({},this.tree.options.ajaxDefaults,ajaxOptions,{success:function(data,textStatus){var prevPhase=self.tree.phase;self.tree.phase="init";self.addChild(data,null);self.tree.phase="postInit";self.setLazyNodeStatus(DTNodeStatus_Ok);if(orgSuccess){orgSuccess.call(options,self)}self.tree.phase=prevPhase},error:function(XMLHttpRequest,textStatus,errorThrown){self.tree.logWarning("appendAjax failed:",textStatus,":\n",XMLHttpRequest,"\n",errorThrown);self.setLazyNodeStatus(DTNodeStatus_Error,{info:textStatus,tooltip:""+errorThrown});if(orgError){orgError.call(options,self,XMLHttpRequest,textStatus,errorThrown)}}});$.ajax(options)},move:function(targetNode,mode){if(this===targetNode){return}if(!this.parent){throw"Cannot move system root"}if(mode===undefined||mode=="over"){mode="child"}var prevParent=this.parent;var targetParent=(mode==="child")?targetNode:targetNode.parent;if(targetParent.isDescendantOf(this)){throw"Cannot move a node to it's own descendant"}if(this.parent.childList.length==1){this.parent.childList=null;this.parent.bExpanded=false}else{var pos=$.inArray(this,this.parent.childList);if(pos<0){throw"Internal error"}this.parent.childList.splice(pos,1)}this.parent.ul.removeChild(this.li);this.parent=targetParent;if(targetParent.hasChildren()){switch(mode){case"child":targetParent.childList.push(this);break;case"before":var pos=$.inArray(targetNode,targetParent.childList);if(pos<0){throw"Internal error"}targetParent.childList.splice(pos,0,this);break;case"after":var pos=$.inArray(targetNode,targetParent.childList);if(pos<0){throw"Internal error"}targetParent.childList.splice(pos+1,0,this);break;default:throw"Invalid mode "+mode}}else{targetParent.childList=[this];if(!targetParent.ul){targetParent.ul=document.createElement("ul");targetParent.ul.style.display="none";targetParent.li.appendChild(targetParent.ul)}}targetParent.ul.appendChild(this.li);if(this.tree!==targetNode.tree){this.visit(function(node){node.tree=targetNode.tree},null,true);throw"Not yet implemented."}if(!prevParent.isDescendantOf(targetParent)){prevParent.render()}if(!targetParent.isDescendantOf(prevParent)){targetParent.render()}},lastentry:undefined};var DynaTreeStatus=Class.create();DynaTreeStatus._getTreePersistData=function(cookieId,cookieOpts){var ts=new DynaTreeStatus(cookieId,cookieOpts);ts.read();return ts.toDict()};getDynaTreePersistData=DynaTreeStatus._getTreePersistData;DynaTreeStatus.prototype={initialize:function(cookieId,cookieOpts){this._log("DynaTreeStatus: initialize");if(cookieId===undefined){cookieId=$.ui.dynatree.prototype.options.cookieId}cookieOpts=$.extend({},$.ui.dynatree.prototype.options.cookie,cookieOpts);this.cookieId=cookieId;this.cookieOpts=cookieOpts;this.cookiesFound=undefined;this.activeKey=null;this.focusedKey=null;this.expandedKeyList=null;this.selectedKeyList=null},_log:function(msg){Array.prototype.unshift.apply(arguments,["debug"]);_log.apply(this,arguments)},read:function(){this._log("DynaTreeStatus: read");this.cookiesFound=false;var cookie=$.cookie(this.cookieId+"-active");this.activeKey=(cookie===null)?"":cookie;if(cookie!==null){this.cookiesFound=true}cookie=$.cookie(this.cookieId+"-focus");this.focusedKey=(cookie===null)?"":cookie;if(cookie!==null){this.cookiesFound=true}cookie=$.cookie(this.cookieId+"-expand");this.expandedKeyList=(cookie===null)?[]:cookie.split(",");if(cookie!==null){this.cookiesFound=true}cookie=$.cookie(this.cookieId+"-select");this.selectedKeyList=(cookie===null)?[]:cookie.split(",");if(cookie!==null){this.cookiesFound=true}},write:function(){this._log("DynaTreeStatus: write");$.cookie(this.cookieId+"-active",(this.activeKey===null)?"":this.activeKey,this.cookieOpts);$.cookie(this.cookieId+"-focus",(this.focusedKey===null)?"":this.focusedKey,this.cookieOpts);$.cookie(this.cookieId+"-expand",(this.expandedKeyList===null)?"":this.expandedKeyList.join(","),this.cookieOpts);$.cookie(this.cookieId+"-select",(this.selectedKeyList===null)?"":this.selectedKeyList.join(","),this.cookieOpts)},addExpand:function(key){this._log("addExpand(%o)",key);if($.inArray(key,this.expandedKeyList)<0){this.expandedKeyList.push(key);$.cookie(this.cookieId+"-expand",this.expandedKeyList.join(","),this.cookieOpts)}},clearExpand:function(key){this._log("clearExpand(%o)",key);var idx=$.inArray(key,this.expandedKeyList);if(idx>=0){this.expandedKeyList.splice(idx,1);$.cookie(this.cookieId+"-expand",this.expandedKeyList.join(","),this.cookieOpts)}},addSelect:function(key){this._log("addSelect(%o)",key);if($.inArray(key,this.selectedKeyList)<0){this.selectedKeyList.push(key);$.cookie(this.cookieId+"-select",this.selectedKeyList.join(","),this.cookieOpts)}},clearSelect:function(key){this._log("clearSelect(%o)",key);var idx=$.inArray(key,this.selectedKeyList);if(idx>=0){this.selectedKeyList.splice(idx,1);$.cookie(this.cookieId+"-select",this.selectedKeyList.join(","),this.cookieOpts)}},isReloading:function(){return this.cookiesFound===true},toDict:function(){return{cookiesFound:this.cookiesFound,activeKey:this.activeKey,focusedKey:this.activeKey,expandedKeyList:this.expandedKeyList,selectedKeyList:this.selectedKeyList}},lastentry:undefined};var DynaTree=Class.create();DynaTree.version="$Version: 1.0.0_alpha1$";DynaTree.prototype={initialize:function($widget){this.phase="init";this.$widget=$widget;this.options=$widget.options;this.$tree=$widget.element;this.timer=null;this.divTree=this.$tree.get(0);_initDragAndDrop(this)},_load:function(){var $widget=this.$widget;var opts=this.options;this.bEnableUpdate=true;this._nodeCount=1;this.activeNode=null;this.focusNode=null;if(opts.rootVisible!==undefined){_log("warn","Option 'rootVisible' is no longer supported.")}if(opts.title!==undefined){_log("warn","Option 'title' is no longer supported.")}if(opts.minExpandLevel<1){_log("warn","Option 'minExpandLevel' must be >= 1.");opts.minExpandLevel=1}if(opts.classNames!==$.ui.dynatree.prototype.options.classNames){opts.classNames=$.extend({},$.ui.dynatree.prototype.options.classNames,opts.classNames)}if(!opts.imagePath){$("script").each(function(){var _rexDtLibName=/.*dynatree[^\/]*\.js$/i;if(this.src.search(_rexDtLibName)>=0){if(this.src.indexOf("/")>=0){opts.imagePath=this.src.slice(0,this.src.lastIndexOf("/"))+"/skin/"}else{opts.imagePath="skin/"}logMsg("Guessing imagePath from '%s': '%s'",this.src,opts.imagePath);return false}})}this.persistence=new DynaTreeStatus(opts.cookieId,opts.cookie);if(opts.persist){if(!$.cookie){_log("warn","Please include jquery.cookie.js to use persistence.")}this.persistence.read()}this.logDebug("DynaTree.persistence: %o",this.persistence.toDict());this.cache={tagEmpty:"<span class='"+opts.classNames.empty+"'></span>",tagVline:"<span class='"+opts.classNames.vline+"'></span>",tagExpander:"<span class='"+opts.classNames.expander+"'></span>",tagConnector:"<span class='"+opts.classNames.connector+"'></span>",tagNodeIcon:"<span class='"+opts.classNames.nodeIcon+"'></span>",tagCheckbox:"<span class='"+opts.classNames.checkbox+"'></span>",lastentry:undefined};if(opts.children||(opts.initAjax&&opts.initAjax.url)||opts.initId){$(this.divTree).empty()}else{if(this.divRoot){$(this.divRoot).remove()}}this.tnRoot=new DynaTreeNode(null,this,{});this.tnRoot.render();this.divTree.appendChild(this.tnRoot.ul);var root=this.tnRoot;var isReloading=(opts.persist&&this.persistence.isReloading());var isLazy=false;var prevFlag=this.enableUpdate(false);this.logDebug("Dynatree._load(): read tree structure...");if(opts.children){root.addChild(opts.children)}else{if(opts.initAjax&&opts.initAjax.url){isLazy=true;root.data.isLazy=true;this._reloadAjax()}else{if(opts.initId){this._createFromTag(root,$("#"+opts.initId))}else{var $ul=this.$tree.find(">ul:first").hide();this._createFromTag(root,$ul);$ul.remove()}}}this._checkConsistency();this.logDebug("Dynatree._load(): render nodes...");this.enableUpdate(prevFlag);this.logDebug("Dynatree._load(): bind events...");this.$widget.bind();this.logDebug("Dynatree._load(): postInit...");this.phase="postInit";if(opts.persist){this.persistence.write()}if(this.focusNode&&this.focusNode.isVisible()){this.logDebug("Focus on init: %o",this.focusNode);this.focusNode.focus()}if(!isLazy&&opts.onPostInit){opts.onPostInit.call(this,isReloading,false)}this.phase="idle"},_reloadAjax:function(){var opts=this.options;if(!opts.initAjax||!opts.initAjax.url){throw"tree.reload() requires 'initAjax' mode."}var pers=this.persistence;var ajaxOpts=$.extend({},opts.initAjax);if(ajaxOpts.addActiveKey){ajaxOpts.data.activeKey=pers.activeKey}if(ajaxOpts.addFocusedKey){ajaxOpts.data.focusedKey=pers.focusedKey}if(ajaxOpts.addExpandedKeyList){ajaxOpts.data.expandedKeyList=pers.expandedKeyList.join(",")}if(ajaxOpts.addSelectedKeyList){ajaxOpts.data.selectedKeyList=pers.selectedKeyList.join(",")}if(opts.onPostInit){if(ajaxOpts.success){this.logWarning("initAjax: success callback is ignored when onPostInit was specified.")}if(ajaxOpts.error){this.logWarning("initAjax: error callback is ignored when onPostInit was specified.")}var isReloading=pers.isReloading();ajaxOpts.success=function(dtnode){opts.onPostInit.call(dtnode.tree,isReloading,false)};ajaxOpts.error=function(dtnode){opts.onPostInit.call(dtnode.tree,isReloading,true)}}this.logDebug("Dynatree._init(): send Ajax request...");this.tnRoot.appendAjax(ajaxOpts)},toString:function(){return"Dynatree '"+this.$tree.attr("id")+"'"},toDict:function(){return this.tnRoot.toDict(true)},getPersistData:function(){return this.persistence.toDict()},logDebug:function(msg){if(this.options.debugLevel>=2){Array.prototype.unshift.apply(arguments,["debug"]);_log.apply(this,arguments)}},logInfo:function(msg){if(this.options.debugLevel>=1){Array.prototype.unshift.apply(arguments,["info"]);_log.apply(this,arguments)}},logWarning:function(msg){Array.prototype.unshift.apply(arguments,["warn"]);_log.apply(this,arguments)},isInitializing:function(){return(this.phase=="init"||this.phase=="postInit")},isReloading:function(){return(this.phase=="init"||this.phase=="postInit")&&this.options.persist&&this.persistence.cookiesFound},isUserEvent:function(){return(this.phase=="userEvent")},redraw:function(){this.logDebug("dynatree.redraw()...");this.tnRoot.render();this.logDebug("dynatree.redraw() done.")},reload:function(){this._load()},getRoot:function(){return this.tnRoot},enable:function(){this.$widget.enable()},disable:function(){this.$widget.disable()},getNodeByKey:function(key){var el=document.getElementById(this.options.idPrefix+key);if(el){return el.dtnode?el.dtnode:null}var match=null;this.visit(function(node){if(node.data.key==key){match=node;return false}},true);return match},getActiveNode:function(){return this.activeNode},reactivate:function(setFocus){var node=this.activeNode;if(node){this.activeNode=null;node.activate();if(setFocus){node.focus()}}},getSelectedNodes:function(stopOnParents){var nodeList=[];this.tnRoot.visit(function(node){if(node.bSelected){nodeList.push(node);if(stopOnParents===true){return"skip"}}});return nodeList},activateKey:function(key){var dtnode=(key===null)?null:this.getNodeByKey(key);if(!dtnode){if(this.activeNode){this.activeNode.deactivate()}this.activeNode=null;return null}dtnode.focus();dtnode.activate();return dtnode},selectKey:function(key,select){var dtnode=this.getNodeByKey(key);if(!dtnode){return null}dtnode.select(select);return dtnode},enableUpdate:function(bEnable){if(this.bEnableUpdate==bEnable){return bEnable}this.bEnableUpdate=bEnable;if(bEnable){this.redraw()}return !bEnable},visit:function(fn,includeRoot){return this.tnRoot.visit(fn,includeRoot)},_createFromTag:function(parentTreeNode,$ulParent){var self=this;$ulParent.find(">li").each(function(){var $li=$(this);var $liSpan=$li.find(">span:first");var title;if($liSpan.length){title=$liSpan.html()}else{title=$li.html();var iPos=title.search(/<ul/i);if(iPos>=0){title=$.trim(title.substring(0,iPos))}else{title=$.trim(title)}}var data={title:title,isFolder:$li.hasClass("folder"),isLazy:$li.hasClass("lazy"),expand:$li.hasClass("expanded"),select:$li.hasClass("selected"),activate:$li.hasClass("active"),focus:$li.hasClass("focused"),noLink:$li.hasClass("noLink")};if($li.attr("title")){data.tooltip=$li.attr("title")}if($li.attr("id")){data.key=$li.attr("id")}if($li.attr("data")){var dataAttr=$.trim($li.attr("data"));if(dataAttr){if(dataAttr.charAt(0)!="{"){dataAttr="{"+dataAttr+"}"}try{$.extend(data,eval("("+dataAttr+")"))}catch(e){throw ("Error parsing node data: "+e+"\ndata:\n'"+dataAttr+"'")}}}var childNode=parentTreeNode.addChild(data);var $ul=$li.find(">ul:first");if($ul.length){self._createFromTag(childNode,$ul)}})},_checkConsistency:function(){},_setDndStatus:function(sourceNode,targetNode,helper,hitMode,accept){var $source=sourceNode?$(sourceNode.span):null;var $target=$(targetNode.span);if(!this.$dndMarker){this.$dndMarker=$("<div id='dynatree-drop-marker'></div>").hide().prependTo("body");logMsg("Creating marker: %o",this.$dndMarker)}if(hitMode==="start"){}if(hitMode==="stop"){}if(hitMode==="after"||hitMode==="before"||hitMode==="over"){var pos=$target.position();switch(hitMode){case"before":this.$dndMarker.removeClass("dynatree-drop-after dynatree-drop-over");this.$dndMarker.addClass("dynatree-drop-before");pos.top-=8;break;case"after":this.$dndMarker.removeClass("dynatree-drop-before dynatree-drop-over");this.$dndMarker.addClass("dynatree-drop-after");pos.top+=8;break;default:this.$dndMarker.removeClass("dynatree-drop-after dynatree-drop-before");this.$dndMarker.addClass("dynatree-drop-over");$target.addClass("dynatree-drop-target");pos.left+=8}this.$dndMarker.css({left:(pos.left)+"px",top:(pos.top)+"px"}).show()}else{$target.removeClass("dynatree-drop-target");this.$dndMarker.hide()}if(hitMode==="after"){$target.addClass("dynatree-drop-after")}else{$target.removeClass("dynatree-drop-after")}if(hitMode==="before"){$target.addClass("dynatree-drop-before")}else{$target.removeClass("dynatree-drop-before")}if(accept===true){$source&&$source.addClass("dynatree-drop-accept");$target.addClass("dynatree-drop-accept");helper.addClass("dynatree-drop-accept")}else{$source&&$source.removeClass("dynatree-drop-accept");$target.removeClass("dynatree-drop-accept");helper.removeClass("dynatree-drop-accept")}if(accept===false){$source&&$source.addClass("dynatree-drop-reject");$target.addClass("dynatree-drop-reject");helper.addClass("dynatree-drop-reject")}else{$source&&$source.removeClass("dynatree-drop-reject");$target.removeClass("dynatree-drop-reject");helper.removeClass("dynatree-drop-reject")}},_onDragEvent:function(eventName,node,otherNode,event,ui,draggable){if(eventName!=="over"){this.logDebug("tree._onDragEvent(%s, %o, %o) - %o",eventName,node,otherNode,this)}var opts=this.options;var dnd=this.options.dnd;var res=null;var nodeTag=$(node.span);switch(eventName){case"helper":var helper=$("<div class='dynatree-drag-helper'><span class='dynatree-drag-helper-img' /></div>").append($(event.target).closest("a").clone());helper.data("dtSourceNode",node);logMsg("helper.sourceNode=%o",helper.data("dtSourceNode"));res=helper;break;case"start":if(node.isStatusNode()){res=false}else{if(dnd.onDragStart){res=dnd.onDragStart(node)}}if(res===false){this.logDebug("tree.onDragStart() cancelled");ui.helper.trigger("mouseup");ui.helper.hide()}else{nodeTag.addClass("dynatree-drag-source")}break;case"enter":res=dnd.onDragEnter?dnd.onDragEnter(node,otherNode):null;res={over:(res!==false)&&((res===true)||(res==="over")||$.inArray("over",res)>=0),before:(res!==false)&&((res===true)||(res==="before")||$.inArray("before",res)>=0),after:(res!==false)&&((res===true)||(res==="after")||$.inArray("after",res)>=0)};ui.helper.data("enterResponse",res);this.logDebug("helper.enterResponse: %o",res);break;case"over":var enterResponse=ui.helper.data("enterResponse");var hitMode=null;if(enterResponse===false){break}else{if(typeof enterResponse==="string"){hitMode=enterResponse}else{var nodeOfs=nodeTag.position();var relPos={x:event.clientX-nodeOfs.left,y:event.clientY-nodeOfs.top};var relPos2={x:relPos.x/nodeTag.width(),y:relPos.y/nodeTag.height()};if(enterResponse.after&&relPos2.y>0,75){hitMode="after"}else{if(!enterResponse.over&&enterResponse.after&&relPos2.y>0,5){hitMode="after"}else{if(enterResponse.before&&relPos2.y<=0,25){hitMode="before"}else{if(!enterResponse.over&&enterResponse.before&&relPos2.y<=0,5){hitMode="before"}else{if(enterResponse.over){hitMode="over"}}}}}if(dnd.preventVoidMoves){if(node===otherNode){logMsg("    drop over source node prevented");hitMode=null}else{if(hitMode==="before"&&otherNode&&node===otherNode.getNextSibling()){logMsg("    drop after source node prevented");hitMode=null}else{if(hitMode==="after"&&otherNode&&node===otherNode.getPrevSibling()){logMsg("    drop before source node prevented");hitMode=null}else{if(hitMode==="over"&&otherNode&&otherNode.parent===node&&otherNode.isLastSibling()){logMsg("    drop last child over own parent prevented");hitMode=null}}}}}logMsg("hitMode: %s - %s - %s",hitMode,(node.parent===otherNode),node.isLastSibling());ui.helper.data("hitMode",hitMode)}}if(hitMode==="over"&&dnd.autoExpandMS&&node.hasChildren()&&!node.bExpanded){node.scheduleAction("expand",dnd.autoExpandMS)}if(hitMode&&dnd.onDragOver){res=dnd.onDragOver(node,otherNode,hitMode)}this._setDndStatus(otherNode,node,ui.helper,hitMode,res!==false);break;case"drop":var hitMode=ui.helper.data("hitMode");if(hitMode&&dnd.onDrop){dnd.onDrop(node,otherNode,hitMode,ui,draggable)}break;case"leave":node.scheduleAction("cancel");ui.helper.data("enterResponse",null);ui.helper.data("hitMode",null);this._setDndStatus(otherNode,node,ui.helper,"out",undefined);if(dnd.onDragLeave){dnd.onDragLeave(node,otherNode)}break;case"stop":nodeTag.removeClass("dynatree-drag-source");if(dnd.onDragStop){dnd.onDragStop(node)}break;default:throw"Unsupported drag event: "+eventName}return res},lastentry:undefined};$.widget("ui.dynatree",{_init:function(){if(parseFloat($.ui.version)<1,8){_log("warn","ui.dynatree._init() was called; you should upgrade to jquery.ui.core.js v1.8 or higher.");return this._create()}_log("debug","ui.dynatree._init() was called; no current default functionality.")},_create:function(){logMsg("Dynatree._create(): version='%s', debugLevel=%o.",DynaTree.version,this.options.debugLevel);var opts=this.options;this.options.event+=".dynatree";var divTree=this.element.get(0);this.tree=new DynaTree(this);this.tree._load();this.tree.logDebug("Dynatree._init(): done.")},bind:function(){var $this=this.element;var o=this.options;this.unbind();var eventNames="click.dynatree dblclick.dynatree";if(o.keyboard){eventNames+=" keypress.dynatree keydown.dynatree"}$this.bind(eventNames,function(event){var dtnode=getDtNodeFromElement(event.target);if(!dtnode){return true}var prevPhase=dtnode.tree.phase;dtnode.tree.phase="userEvent";try{dtnode.tree.logDebug("bind(%o): dtnode: %o",event,dtnode);switch(event.type){case"click":return(o.onClick&&o.onClick(dtnode,event)===false)?false:dtnode.onClick(event);case"dblclick":return(o.onDblClick&&o.onDblClick(dtnode,event)===false)?false:dtnode.onDblClick(event);case"keydown":return(o.onKeydown&&o.onKeydown(dtnode,event)===false)?false:dtnode.onKeydown(event);case"keypress":return(o.onKeypress&&o.onKeypress(dtnode,event)===false)?false:dtnode.onKeypress(event)}}catch(e){var _=null;dtnode.tree.logWarning("bind(%o): dtnode: %o, error: %o",event,dtnode,e)}finally{dtnode.tree.phase=prevPhase}});function __focusHandler(event){event=arguments[0]=$.event.fix(event||window.event);var dtnode=getDtNodeFromElement(event.target);return dtnode?dtnode.onFocus(event):false}var div=this.tree.divTree;if(div.addEventListener){div.addEventListener("focus",__focusHandler,true);div.addEventListener("blur",__focusHandler,true)}else{div.onfocusin=div.onfocusout=__focusHandler}},unbind:function(){this.element.unbind(".dynatree")},enable:function(){this.bind();$.Widget.prototype.enable.apply(this,arguments)},disable:function(){this.unbind();$.Widget.prototype.disable.apply(this,arguments)},getTree:function(){return this.tree},getRoot:function(){return this.tree.getRoot()},getActiveNode:function(){return this.tree.getActiveNode()},getSelectedNodes:function(){return this.tree.getSelectedNodes()},reload:function(){return this.tree.reload()},lastentry:undefined});$.ui.dynatree.prototype.options={title:"Dynatree",minExpandLevel:1,imagePath:null,children:null,initId:null,initAjax:null,autoFocus:true,keyboard:true,persist:false,autoCollapse:false,clickFolderMode:3,activeVisible:true,checkbox:false,selectMode:2,fx:null,noLink:false,onClick:null,onDblClick:null,onKeydown:null,onKeypress:null,onFocus:null,onBlur:null,onQueryActivate:null,onQuerySelect:null,onQueryExpand:null,onPostInit:null,onActivate:null,onDeactivate:null,onSelect:null,onExpand:null,onLazyRead:null,dnd:{onDragStart:null,onDragStop:null,autoExpandMS:1000,preventVoidMoves:true,onDragEnter:null,onDragOver:null,onDrop:null,onDragLeave:null},ajaxDefaults:{cache:false,dataType:"json"},strings:{loading:"Loading&#8230;",loadError:"Load error!"},generateIds:false,idPrefix:"dynatree-id-",cookieId:"dynatree",cookie:{expires:null},classNames:{container:"dynatree-container",node:"dynatree-node",folder:"dynatree-folder",empty:"dynatree-empty",vline:"dynatree-vline",expander:"dynatree-expander",connector:"dynatree-connector",checkbox:"dynatree-checkbox",nodeIcon:"dynatree-icon",title:"dynatree-title",noConnector:"dynatree-no-connector",nodeError:"dynatree-statusnode-error",nodeWait:"dynatree-statusnode-wait",hidden:"dynatree-hidden",combinedExpanderPrefix:"dynatree-exp-",combinedIconPrefix:"dynatree-ico-",hasChildren:"dynatree-has-children",active:"dynatree-active",selected:"dynatree-selected",expanded:"dynatree-expanded",lazy:"dynatree-lazy",focused:"dynatree-focused",partsel:"dynatree-partsel",lastsib:"dynatree-lastsib"},debugLevel:1,lastentry:undefined};$.ui.dynatree.nodedatadefaults={title:null,key:null,isFolder:false,isLazy:false,tooltip:null,icon:null,addClass:null,noLink:false,activate:false,focus:false,expand:false,select:false,hideCheckbox:false,unselectable:false,children:null,lastentry:undefined};function _initDragAndDrop(tree){var dnd=tree.options.dnd||null;if(dnd&&(dnd.onDragStart||dnd.onDrop)){_registerDnd()}if(dnd&&dnd.onDragStart){tree.$tree.draggable({addClasses:false,appendTo:"body",containment:false,delay:0,distance:4,revert:false,connectToDynatree:true,helper:function(event){var sourceNode=getDtNodeFromElement(event.target);return sourceNode.tree._onDragEvent("helper",sourceNode,null,event,null,null)},_last:null})}if(dnd&&dnd.onDrop){tree.$tree.droppable({addClasses:false,tolerance:"intersect",greedy:false,_last:null})}}var didRegisterDnd=false;var _registerDnd=function(){if(didRegisterDnd){return}$.ui.plugin.add("draggable","connectToDynatree",{start:function(event,ui){var draggable=$(this).data("draggable");var sourceNode=ui.helper.data("dtSourceNode")||null;logMsg("draggable-connectToDynatree.start, %s",sourceNode);logMsg("    this: %o",this);logMsg("    event: %o",event);logMsg("    draggable: %o",draggable);logMsg("    ui: %o",ui);if(sourceNode){draggable.offset.click.top=-2;draggable.offset.click.left=+16;logMsg("    draggable.offset.click FIXED: %s/%s",draggable.offset.click.left,draggable.offset.click.top);return sourceNode.tree._onDragEvent("start",sourceNode,null,event,ui,draggable)}},drag:function(event,ui){var draggable=$(this).data("draggable");var sourceNode=ui.helper.data("dtSourceNode")||null;var prevTargetNode=ui.helper.data("dtTargetNode")||null;var targetNode=getDtNodeFromElement(event.target);if(event.target&&!targetNode){var isHelper=$(event.target).closest("div.dynatree-drag-helper,#dynatree-drop-marker").length>0;if(isHelper){logMsg("Drag event over helper: ignored.");return}}ui.helper.data("dtTargetNode",targetNode);if(prevTargetNode&&prevTargetNode!==targetNode){prevTargetNode.tree._onDragEvent("leave",prevTargetNode,sourceNode,event,ui,draggable)}if(targetNode){if(!targetNode.tree.options.dnd.onDrop){}else{if(targetNode===prevTargetNode){targetNode.tree._onDragEvent("over",targetNode,sourceNode,event,ui,draggable)}else{targetNode.tree._onDragEvent("enter",targetNode,sourceNode,event,ui,draggable)}}}},stop:function(event,ui){var draggable=$(this).data("draggable");var sourceNode=ui.helper.data("dtSourceNode")||null;var targetNode=ui.helper.data("dtTargetNode")||null;logMsg("draggable-connectToDynatree.stop: targetNode(from event): %s, dtTargetNode: %s",targetNode,ui.helper.data("dtTargetNode"));logMsg("draggable-connectToDynatree.stop, %s",sourceNode);var mouseDownEvent=draggable._mouseDownEvent;var eventType=event.type;logMsg("    type: %o, downEvent: %o, upEvent: %o",eventType,mouseDownEvent,event);logMsg("    targetNode: %o",targetNode);var dropped=(eventType=="mouseup"&&event.which==1);if(!dropped){logMsg("Drag was cancelled")}if(targetNode){if(dropped){targetNode.tree._onDragEvent("drop",targetNode,sourceNode,event,ui,draggable)}targetNode.tree._onDragEvent("leave",targetNode,sourceNode,event,ui,draggable)}if(sourceNode){sourceNode.tree._onDragEvent("stop",sourceNode,null,event,ui,draggable)}}});didRegisterDnd=true}})(jQuery);
(function(a){a.fn.hint=function(b){if(!b){b="blur"}return this.each(function(){var g=a(this),c=g.attr("title"),f=a(this.form),d=a(window);function e(){if(g.val()===c&&g.hasClass(b)){g.val("").removeClass(b)}}if(c){g.blur(function(){if(this.value===""){g.val(c).addClass(b)}}).focus(e).blur();f.submit(e);d.unload(e)}})}})(jQuery);
jQuery(function(a){a.datepicker.regional.pl={closeText:"Zamknij",prevText:"&#x3c;Poprzedni",nextText:"Nastepny&#x3e;",currentText:"Dzis",monthNames:["Styczen","Luty","Marzec","Kwiecien","Maj","Czerwiec","Lipiec","Sierpien","Wrzesien","Pazdziernik","Listopad","Grudzien"],monthNamesShort:["Sty","Lu","Mar","Kw","Maj","Cze","Lip","Sie","Wrz","Pa","Lis","Gru"],dayNames:["Niedziela","Poniedzialek","Wtorek","Sroda","Czwartek","Piatek","Sobota"],dayNamesShort:["Nie","Pn","Wt","Sr","Czw","Pt","So"],dayNamesMin:["N","Pn","Wt","Sr","Cz","Pt","So"],weekHeader:"Tydz",dateFormat:"yy-mm-dd",firstDay:1,isRTL:false,showMonthAfterYear:false,yearSuffix:""};a.datepicker.setDefaults(a.datepicker.regional.pl)});
$(document).ready(function(){if(document.getElementById("hfPageMode")!=null){if(document.getElementById("hfPageMode").value=="True"){b()}else{a()}}$("#mainContainer").fadeIn();$("#btnSearchCriteria").click(function(d){if(document.getElementById("hfPageMode")!=null){switch(d.target.id){case"btnSearchCriteria":c();break;case"criteria":a();break;case"list":b();break}return false}return true});$("#printButton").click(function(d){frames.frmHTML.focus();frames.frmHTML.print();return true});function c(){if($("#criteriaBox").css("display")=="none"){$("#criteriaBox").addClass("searchCriteriaEditor");$("#criteriaBox").css("border-top")=="0";$("#criteriaBox").fadeIn();$("#btnSearchCriteria").val("Zamknij edytor")}else{$("#criteriaBox").removeClass("searchCriteriaEditor");$("#criteriaBox").fadeOut();$("#btnSearchCriteria").val("Edytuj kryteria")}}function a(){$("#criteriaPreviewBox").css("display","none");$("#criteriaBox").fadeIn();$("#listBox").css("display","none")}function b(){$("#criteriaPreviewBox").fadeIn();$("#listBox").fadeIn();$("#criteriaBox").css("display","none")}});

