// JavaScript Document
var xmlhttp
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
  try {
  xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
 } catch (e) {
  try {
    xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  } catch (E) {
   xmlhttp=false;
  }
 }
@else
 xmlhttp=false
 @end @*/
if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
	try {
		xmlhttp = new XMLHttpRequest();
	} catch (e) {
		xmlhttp=false;
	}
}
if (!xmlhttp && window.createRequest) {
	try {
		xmlhttp = window.createRequest();
	} catch (e) {
		xmlhttp=false;
	}
}
function get_data(obj_id,page,obj_sel)
{
	obj=document.getElementById(obj_id);
	xmlhttp.open("GET", page,true);
	//alert("pop_domeniu2.php?cc="+obj.value+"&cauta=Cauta&noecho=1");
	xmlhttp.onreadystatechange=function() 
	{
	
		if (xmlhttp.readyState==4) 
		{
			res_text=xmlhttp.responseText;
		//alert(cont);
		
			obj.innerHTML=res_text;
			
			//alert(obj_sel.selectedIndex);
			s_i=obj_sel.selectedIndex;
			
			//cat_id=	obj_sel.options[s_i].value;
			//alert(cat_id);
			for(i=4;i>=0;i--)
			{
				sname='cat_p'+i;
				news=document.getElementById(sname);
				if(news!=null)
				{
					the_val=news.options[news.selectedIndex].value;
					if(the_val>0)
					{
						formq=document.getElementById('form_q');
						formq.cat_p.value=the_val;
						//alert(i);
//						alert(news.options[news.selectedIndex].value+"="+news.options[news.selectedIndex].text);
						break;
					}
				}
			
			}
		}
	}
	xmlhttp.send(null)
}

function update_sel(obj)
{	
	cat_id=	obj.options[obj.selectedIndex].value;
	
	var page="/cauta_sel.php?cat_p="+cat_id;
	get_data('cauta_r',page,obj);

}

