function getXmlHttpRequest() 
{ 
    var A=null; 
	try 
	{ 
		A=new ActiveXObject("Msxml2.XMLHTTP") 
	} catch(e) { 
		try 
		{ 
			A=new ActiveXObject("Microsoft.XMLHTTP") 
		} catch(oc) { 
			A=null 
		} 
	} 
	if ( !A && typeof XMLHttpRequest != "undefined" ) 
	{ 
		A=new XMLHttpRequest() 
	} 
	return A 
} 

function HiddenAllChild(obj) {
	var allObj = obj.getElementsByTagName('dl');
	for(i=0; i < allObj.length; i++) {
		Element.hide(allObj[i]);
	}
}

function ShowAllChild(obj) {
	var allObj = obj.getElementsByTagName('dl');
	for(i=0; i < allObj.length; i++) {
		Element.show(allObj[i]);
	}
}

function myDiv(id, parentObj) {
	if($(id) != null && $(id).parentNode == parentObj) {
		$(id).style.display = 'block';
		return $(id);
	} else {
		var aTmp = document.createElement('dl');
		aTmp.id = id;
		aTmp.name = id;
		parentObj.appendChild(aTmp);
		return aTmp;
	}
}

function findCheckObj(id,name,areaName) {
	var AllDl = $(areaName).getElementsByTagName("dl");
	for(i=0; i < AllDl.length; i++) {
		var theCheckBoxInDl = AllDl[i].getElementsByTagName("input");
		for(j=0; j < theCheckBoxInDl.length; j ++) {
			if(theCheckBoxInDl[j].type == "checkbox" && theCheckBoxInDl[j].checked &&theCheckBoxInDl[j].id==id&&theCheckBoxInDl[j].name == name) {
				return theCheckBoxInDl[j];
			}
		}
	}
}

function closeSearchDIV_A(){
	var obj = document.getElementById('diseaseQuickSearchDIV');
	if(obj.style.display == ''){
		obj.style.display = 'none';
	}
}

function $import(classname,methodname)
{
	var xmlhttp = getXmlHttpRequest();
    xmlhttp.open("post","/jsp/object.jsp?class="+classname+"&method="+methodname, false);

    if(window.execScript) {
		xmlhttp.send();
	}
	else {
		xmlhttp.send(null);
	}

    var code = xmlhttp.responseText;
    if (window.execScript) {
		window.execScript(code);
	}
    else {
		window.eval(code); 
	}
        
}