﻿
function changeView(_obj) {
    if(_obj.style.display == "none")
		_obj.style.display = "block";
	else
		_obj.style.display = "none";
}
// we dont use it any more we close only the firs element
function changeImage(_obj)
{

	var Child = _obj.firstChild
	var str="";
    while ( Child!=null)
    {
        changeImage(Child);
	    if ( Child.nodeType == 1 ){
	        if(Child.tagName=="IMG"){
	            if(Child.src.indexOf("icon_tree_expand.gif",0)>0){
	                str = Child.src.replace("icon_tree_expand.gif","icon_tree_collapse.gif");
	                Child.src=str;
	                
	                break;
	            }
	            else if (Child.src.indexOf("icon_tree_collapse.gif",0)>0){
	               // Child.src = "/images/icon_tree_expand.gif";
	                str = Child.src.replace("icon_tree_collapse.gif","icon_tree_expand.gif");
	                Child.src=str;
	                break;
	            }
	         }
	         Child = Child.nextSibling;
	    }
	    
	}
	
}

function changeV2(_obj,_tr)
{
	var Child = _obj.children(1);
	if(Child!=null){
	    changeView(Child);
	}
}


function changeVisibility(_obj,_tr)
{
     changeV2(_obj,_tr);
     changeImage(_tr);
}



