

function load_categorias(valor){
	document.forms['fcateg'].lstcats.length = ppal.length;
	document.forms['fcateg'].lstcats.options[0].text = "" ;
	document.forms['fcateg'].lstcats.options[0].value = "";
	for(i=1; i < ppal.length; i++){
		document.forms['fcateg'].lstcats.options[i].text = ppal[i] ;
		document.forms['fcateg'].lstcats.options[i].value = ppal_id[i] ;
		if(valor == ppal_id[i]){
			document.forms['fcateg'].lstcats.options[i].selected = true ;
		}
	}
	
}

function load_tipos(valor){
	el = document.forms['fcateg'].lstcats.selectedIndex;
	if(el){
		document.forms['fcateg'].lsttipos.length = 1;
		document.forms['fcateg'].lsttipos.options[0].text = "" ;
		document.forms['fcateg'].lsttipos.options[0].value = "";
		document.forms['fcateg'].lsttipos.length = eval("arr_"+el+"a.length");
		document.forms['fcateg'].lsttipos.options[0].text = "" ;
		document.forms['fcateg'].lsttipos.options[0].value = "";
			for(i=1;i<eval("arr_"+el+"b.length");i++){
			   document.forms['fcateg'].lsttipos.options[i].text = eval("arr_"+el+"a["+i+"]") ; 
			   document.forms['fcateg'].lsttipos.options[i].value =eval("arr_"+el+"b["+i+"]") ; 
			   if (valor == eval("arr_"+el+"b["+i+"]")){
					 document.forms['fcateg'].lsttipos.options[i].selected=true;
			 
			   }
			}
			if(i==1){
				 document.fcateg.submit();
			}
	}else{
			document.forms['fcateg'].lsttipos.length = 1;
			document.forms['fcateg'].lsttipos.options[0].text = "" ;
			document.forms['fcateg'].lsttipos.options[0].value = "";
	}
}







