﻿jQuery(document).ready(function() 
{ 
	// Set tooltips.
	jQuery(".JQtooltip").wTooltip({ className: "tooltip", style: false });	
	
	// Apply and move TreeNavigation in the final position.
	if (jQuery().jstree && jQuery(".treeNavigation").length > 0)
	{
		jQuery(".treeNavigation").each(function()
		{
			// Set selected node.
			var selId = jQuery(this).attr("selid");
			if (selId && selId != '')
			{
				var thisItem = jQuery(this).find("li[uid=" + selId + "]");
				if (thisItem.length != 0)
				{
					thisItem.addClass("treeSelected").addClass("jstree-open");
					jQuery(this).find("li[uid=" + thisItem.attr("puid") + "]").addClass("jstree-open");
				}
			}
		});
		jQuery(".treeNavigation").jstree({   
			"plugins" : [ "html_data" ]  
		}).css("visibility","visible");  
	}

});

