function check(type, strURL, strType, strHeight, strWidth)
{
var option = document.getElementById("l_doc_search").value;
if(option=='--- Please Select A Category---' || option=='')
{
	alert("Please select a value first!");
}
else
{
popUp(type, strURL, strType, strHeight, strWidth);
}


var newWin = null;
function popUp(type, strURL, strType, strHeight, strWidth) {
	
 if (newWin != null && !newWin.closed)
   newWin.close();	
 var strOptions="";
 if (strType=="console")
   strOptions="scrollbars=1,resizable,height="+strHeight+",width="+strWidth; 
 if (strType=="fixed")
   strOptions="status,height="+strHeight+",width="+strWidth;
 if (strType=="elastic")
   strOptions="toolbar,menubar,scrollbars=1,"+"resizable=no,location,height="+strHeight+",width="+strWidth;
 newWin = window.open(strURL+'?type='+type+'&val='+option, 'newWin', strOptions);
 newWin.focus();
}
}

var typeVal;
function radio_change(val,path)
{
	//alert(val);
	typeVal=val;
	
	if(!val=='')
	{
	//	alert("ok");
		load_list(val,path);
	}
	
}


function load_list(val,path)
{	
	var url
	if(path=='home')
	{
		url = 'php_functions/combo_list.php'
	}
	else if(path=='find_doc')
	{
		url = 'combo_list.php'
	}
	

	var params = "type="+val+"&key="+Math.random();	
    makeobj();
    http_request.onreadystatechange = load_list_;
    http_request.open('POST', url, true);
    http_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    http_request.setRequestHeader("Content-length", params.length);
    http_request.setRequestHeader("Connection", "close");
    http_request.send(params);
}

function load_list_(){
	
//	 if (http_request.readyState != 4) { 
// 	       document.getElementById("check").style.visibility = "visible";
//         document.getElementById('check').innerHTML = '<b>Working...</b>';
//    }
//    if (http_request.readyState == 4) {
//  	      document.getElementById("check").style.visibility = "hidden";   
//    }

    if (http_request.readyState == 4) {		
				
        if (http_request.status == 200) 
		{	
		
		var result = http_request.responseText;
  
		//document.getElementById("check").style.visibility = "hidden";
		//alert(result);
		document.getElementById("combo_button").innerHTML=result;
		//alert(window.typeVal);
		document.getElementById(window.typeVal).checked = true;  

        }
        
		else 
		{
            alert('Error Occured while processing the Request');
        }
    }
}
