var xmlHttp
//FUNCION QUE PROCESA LA INFORMACION INTRODUCIDA EN LOS CUADROS DE TEXTO
function procesar(){
	if(document.getElementById("idFam").selectIndex != 0){
		var idFamilia = document.getElementById("idFam").value;
		showDropSub(idFamilia);
	}
	
}
//-->
function showDropSub(str)
{ 
	//alert(str);
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	  {
		  alert ("Your browser does not support AJAX!");
		  return;
	  } 
	var url="includes/getSubFamiliasSearch.asp";
	url=url+"?idFamilia="+str;
	url=url+"&sid="+Math.random();
	xmlHttp.onreadystatechange=stateChanged;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}
//-->
function stateChanged(){ 
	if (xmlHttp.readyState==4){ 
	
	var posValue = xmlHttp.responseText.indexOf("value=");
	var currStatus = (xmlHttp.responseText.substr(posValue+7,1));
		if(currStatus == "S"){
			document.getElementById("rowSub").style.display = "block";
			document.getElementById("addCheckSub").innerHTML=xmlHttp.responseText;
			document.getElementById("checSubValid").value = "1";
		}else{
			document.getElementById("rowSub").style.display = "none";
			document.getElementById("rowLinea").style.display = "none";
			document.getElementById("addCheckSub").innerHTML= "";
			document.getElementById("addCheckLinea").innerHTML = "";
			document.getElementById("checSubValid").value = "0";
			document.getElementById("checLineaValid").value = "0";
		}	 		
	}
}
	
function GetXmlHttpObject(){
var xmlHttp=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return xmlHttp;
}