$(document).ready(createTree);
function addLinksPropertise(){
	$('#links').find('a').each(function(e){
		$(this).attr('data-ajax','false');
		$(this).attr('rel','external');
	});
};
function createTree(){
	var parentId = 0;
	var tree = new dgTree("tree");
	initNavContent(tree);
	var ul = document.createElement('ul');
	$.each(tree.nodes,function(index,node){
		if(node.pidx == parentId){
			var li = document.createElement('li');
			var a = document.createElement('a');
			a.setAttribute('data-ajax','false');
			a.setAttribute('rel','external');
			a.setAttribute('href',node.url);
			a.innerHTML=node.name;
			li.appendChild(a);
			$('#ulLinks').append(li);				
		}
	});
	addLinksPropertise();
}	
