/********************************************************************
*	Tree begin
********************************************************************/

function WTTreeSwitchVisibility( elm , css_type ) {
	//alert(elm.parentNode.tagName);
	var ULelm;

	for (i = 0; i < elm.parentNode.childNodes.length; i++) {
		ULelm = elm.parentNode.childNodes[i];
		if (ULelm.tagName == 'UL') break;
	}
	
 	if(ULelm && (ULelm.tagName == 'UL')) {
 		//alert(ULelm.className);
 		if( ULelm.style.display == '' ){
 			if( ULelm.className == 'Expanded' )
 				ULelm.style.display = "block";
 			else
 				ULelm.style.display = "none";	
 		}
 		
		ULelm.style.display = (ULelm.style.display == "none") ? "block" : "none";
		
		switch ( css_type ){
			case 'path':
				elm.className = (elm.className == "linkCollapsedWithPath") ? "linkExpandedWithPath" : "linkCollapsedWithPath";
				break;
			default:
				elm.className = (elm.className == "linkCollapsed") ? "linkExpanded" : "linkCollapsed";
		}
		
	}
	
}

function WTTreeSwitchVisibilityWithouthCss( elm  ) {
	//alert(elm.parentNode.tagName);
	var ULelm;

	for (i = 0; i < elm.parentNode.childNodes.length; i++) {
		ULelm = elm.parentNode.childNodes[i];
		if (ULelm.tagName == 'UL') break;
	}
	
 	if(ULelm && (ULelm.tagName == 'UL')) {
 		//alert(ULelm.className);
 		if( ULelm.style.display == '' ){
 			if( ULelm.className == 'Expanded' )
 				ULelm.style.display = "block";
 			else
 				ULelm.style.display = "none";	
 		}
 		
		ULelm.style.display = (ULelm.style.display == "none") ? "block" : "none";
		
	}
	
}

/*function switchVisibilityWithPath(elm) {
	//alert(elm.parentNode.tagName);
	var ULelm;

	for (i = 0; i < elm.parentNode.childNodes.length; i++) {
		ULelm = elm.parentNode.childNodes[i];
		if (ULelm.tagName == 'UL') break;
	}

 	if(ULelm && (ULelm.tagName == 'UL')) {
		ULelm.style.display = (ULelm.style.display == "none") ? "block" : "none";
		elm.className = (elm.className == "linkCollapsedWithPath") ? "linkExpandedWithPath" : "linkCollapsedWithPath";
	}
	
}*/

/********************************************************************
*	Tree end
********************************************************************/

