//<!--
//		Copyright obout inc      http://www.obout.com
//	
//		obout_ASP_TreeView_2      version 2.0.7 

var ob_tb2,ob_last,ob_url2,ob_sids=null,ob_ivl="",ob_iar=0,ob_op2,tree_selected_id,tree_parent_id,tree_selected_path,ob_xmlhttp2,ob_alert2; /*@cc_on @*//*@if (@_jscript_version >= 5);try{ob_xmlhttp2=new ActiveXObject("Msxml2.XMLHTTP")}catch(e){try {ob_xmlhttp2=new ActiveXObject("Microsoft.XMLHTTP")}catch(E){}};@else;ob_xmlhttp2=false;ob_alert2=true;@end @*/if (!ob_xmlhttp2 && !ob_alert2){try {ob_xmlhttp2=new XMLHttpRequest();}catch(e){}}function ob_rsc() {if (ob_xmlhttp2.readyState==4){ob_tb2.className="none";ob_tb2.innerHTML=ob_xmlhttp2.responseText;ob_t29(ob_tb2);}}function ob_t24(){if(ob_xmlhttp2){ob_xmlhttp2.open("GET",ob_url2,true);ob_xmlhttp2.onreadystatechange=ob_rsc;ob_xmlhttp2.send(null);}}function ob_t26(){ob_ivl=window.setInterval("ob_t28()",200);}function ob_t28(){if(ob_sids==null){window.clearInterval(ob_ivl);ob_t25(document.getElementById(ob_last));return;}if(ob_xmlhttp2.readyState==4 || ob_xmlhttp2.readyState==0){if(ob_iar==ob_sids.length){window.clearInterval(ob_ivl);ob_t25(document.getElementById(ob_last));return;}ob_t25(document.getElementById(ob_sids[ob_iar]));ob_iar=ob_iar+1;}}


function ob_t21(os, url) {
	// Switch plus-minus images when clicked.
	// If dynamic loading URL is supplied, call loading function.

    var ot = os.parentNode.parentNode.parentNode.parentNode.nextSibling;
    var lensrc = (os.src.length - 8);
    var s = os.src.substr(lensrc, 8);
    if (s == "inus.gif") {
        ot.style.display = "none";
        os.src = ob_style + "/plusik.gif";
    }
    if (s == "usik.gif") {
        ot.style.display = "block";
        os.src = ob_style + "/minus.gif";
    }
    if (s == "ik_l.gif") {
        ot.style.display = "block";
        os.src = ob_style + "/minus_l.gif";
        if (url != "") {
		var s = os.parentNode.parentNode.parentNode.parentNode.nextSibling.firstChild.firstChild.firstChild.nextSibling.innerHTML;
            if (s != "Loading ...") {
                return;
            }
            ob_url2 = url;
            ob_tb2 = os.parentNode.parentNode.parentNode.parentNode.nextSibling.firstChild.firstChild.firstChild.nextSibling;
            window.setTimeout("ob_t24()", 100);
        }
    }
    if (s == "us_l.gif") {
        ot.style.display = "none";
        os.src = ob_style + "/plusik_l.gif";
    }
}


function ob_t22(ob_od) {
	// Highlight selected node
	// Change class name and assign id to variable tree_selected_id
    if (document.getElementById(tree_selected_id) != null) {
		document.getElementById(tree_selected_id).className = "ob_t2";
    }
    ob_od.className = "ob_t3";
    tree_selected_id = ob_od.id;
    
    // Find path to selected and extend the path
    var sel_id;
	if(ob_od.parentNode.parentNode.parentNode.parentNode.parentNode.className=="ob_di2"){return};
	ob_od = ob_od.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.firstChild.firstChild.firstChild.firstChild.nextSibling.nextSibling;
	tree_parent_id = ob_od.id;
	tree_selected_path = tree_parent_id+","+tree_selected_id;
	ob_t20(ob_od);
}

function ob_t20(e) {
	// Extend all parents up and populate tree_selected_path
	
    var os = e.parentNode.firstChild.firstChild;
	//e
    if (os != null) {
		if ((typeof os != "undefined") && (os.tagName == "IMG")) {
			var lensrc = (os.src.length - 8);
			var s = os.src.substr(lensrc, 8);
			if ((s == "usik.gif") || (s == "ik_l.gif")) {
				os.onclick();
			}
			if(e.parentNode.parentNode.parentNode.parentNode.parentNode.className=="ob_di2"){return};
			e=e.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.firstChild.firstChild.firstChild.firstChild.nextSibling.nextSibling
			tree_selected_path=e.id+","+tree_selected_path;
			ob_t20(e);
		}
	}
}

function ob_t23(e){
	// To expand-collapse node by clicking on node text.
	// Find first image with plus-minus and call onclick()

    var os = e.parentNode.parentNode.firstChild.firstChild;

    if (os != null) {
		if ((typeof os != "undefined") && (os.tagName == "IMG")) {
			var lensrc = (os.src.length - 8);
			var s = os.src.substr(lensrc, 8);
			if ((s == "inus.gif") || (s == "usik.gif") || (s == "us_l.gif") || (s == "ik_l.gif")) {
				os.onclick();
			}
		}
		else {
			ob_t23(e.parentNode);
		}
	}
}

function ob_t25(ob_od) {
	// When tree is first loaded - Highlight and Extend selected node.

	if(ob_od==null) {
		//alert("Selected node does not exists or its id is not unique.");
		return
	};
	// Extend.
	var e, lensrc, s;
    e = ob_od.parentNode.firstChild.firstChild;
	lensrc = (e.src.length - 8);
	s = e.src.substr(lensrc, 8);
	if ((s == "usik.gif") || (s == "ik_l.gif")) {
		e.onclick();
	}
	// Highlight and populate path.
	ob_t22(ob_od);
}

function ob_tall(exp) {
	// To expand all nodes ob_tall(1)
	// To collapse all nodes ob_tall(0)
	
	var i, e, lensrc, s
	for (i=0; i<document.images.length; i++) {
		e = document.images[i];
		lensrc = (e.src.length - 8);
		s = e.src.substr(lensrc, 8);
		if (exp == 1) {
			if ((s == "usik.gif") || (s == "ik_l.gif")) {
				e.onclick();
			}
		}
		else
			if ((s == "inus.gif") || (s == "us_l.gif")) {
				e.onclick();
			}
	}
}

function ob_t2c(e) {
	// To check/uncheck checkboxes in children.
	
	var ob_t2in=e.parentNode.parentNode.parentNode.parentNode.nextSibling.getElementsByTagName("input");
	for (var i=0; i<ob_t2in.length; i++) {
		if (e.checked==true) {
			ob_t2in[i].checked=true;
		}
		else {
			ob_t2in[i].checked=false;
		}
	}
}


function ob_t2send() {
	// Make string with checked checkboxes IDs.
	
	var ob_t2in,ob_t2s,ob_t2send="";
	ob_t2in=document.getElementsByTagName("input");
	for (var i=0; i<ob_t2in.length; i++) {
		ob_t2s=ob_t2in[i].id;
		if ((ob_t2s.substr(0,4)=="chk_") && (ob_t2in[i].checked)) {
			ob_t2send=ob_t2send+ob_t2s+",";
		}
	}
	document.getElementById('txtSend').value=ob_t2send;
}

function ob_t29(el){
	var items = el.getElementsByTagName("TABLE");
	//var items = document.getElementById(id).getElementsByTagName("TABLE");
	for (var i=0; i<items.length; i++) {
		e=items[i];
		if (document.all) {
			e.border= "0";
			e.cellPadding = "0";
			e.cellSpacing = "0";
		}
		else {
			e.setAttribute("border", "0");
			e.setAttribute("cellpadding", "0");
			e.setAttribute("cellspacing", "0");
		}
	}
	items = el.getElementsByTagName("TD");
//	items = document.getElementById(id).getElementsByTagName("TD");
	for (var i=0; i<items.length; i++) {
		e=items[i];
		if (e.className=="ob_t2") {
			if (SelectedEnable==true) {
				if(document.all) {
					e.onclick = new Function("ob_t22(this, window.event);");
				}
				else {
					e.setAttribute("onclick", "ob_t22(this, event);");
				}
			}
		}
		if ((e.className=="ob_t6v") || (e.className=="ob_d5v")) {
			e.style.backgroundImage = "url("+ob_style+"/vertical.gif)";
		}
	}
}

//-->
