var val = document.testform.cat.options[document.testform.cat.options.selectedIndex].value;
var cat_id = val;



function seleccfunc(val)
{
cat_id = val;
	if (val == 0) {
	AjaxFunction3(cat_id)
	}
	else{
	 AjaxFunction(cat_id)
	}
}


////para bio
function AjaxFunction3(cat_id)
{
var httpxml;
try
  {
  // Firefox, Opera 8.0+, Safari
  httpxml=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
		  try
   			 		{
   				 httpxml=new ActiveXObject("Msxml2.XMLHTTP");
    				}
  			catch (e)
    				{
    			try
      		{
      		httpxml=new ActiveXObject("Microsoft.XMLHTTP");
     		 }
    			catch (e)
      		{
      		alert("Your browser does not support AJAX!");
      		return false;
      		}
    		}
  }
function stateck() 
    {
    if(httpxml.readyState==4)
      {
document.getElementById("descid").innerHTML="";
document.getElementById("subcatid").innerHTML="";
document.getElementById("bio").style.visibility="visible";
document.getElementById("bio").innerHTML=httpxml.responseText;

      }
    }
	var url="bio.php";
//url=url+"?d="+Math.random();
httpxml.onreadystatechange=stateck;
httpxml.open("GET",url,true);
httpxml.send(null);
  }
 

function AjaxFunction(cat_id)
{
var httpxml;
try
  {
  // Firefox, Opera 8.0+, Safari
  httpxml=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
		  try
   			 		{
   				 httpxml=new ActiveXObject("Msxml2.XMLHTTP");
    				}
  			catch (e)
    				{
    			try
      		{
      		httpxml=new ActiveXObject("Microsoft.XMLHTTP");
     		 }
    			catch (e)
      		{
      		alert("Your browser does not support AJAX!");
      		return false;
      		}
    		}
  }
function stateck() 
    {
    if(httpxml.readyState==4)
      {

document.getElementById("bio").innerHTML="";
document.getElementById("descid").innerHTML="";

document.getElementById("subcatid").style.visibility="visible";
document.getElementById("subcatid").innerHTML=httpxml.responseText;
      }
    }
	var url="dd.php";
url=url+"?cat_id="+cat_id;
url=url+"&sid="+Math.random();
httpxml.onreadystatechange=stateck;
httpxml.open("GET",url,true);
httpxml.send(null);
  }
  
  //////////////////////////////////////////////////////////////////




  ///////// listado de obras
function AjaxFunction2(obra_id)
{
var httpxml;
try
  {
  // Firefox, Opera 8.0+, Safari
  httpxml=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
		  try
   			 		{
   				 httpxml=new ActiveXObject("Msxml2.XMLHTTP");
    				}
  			catch (e)
    				{
    			try
      		{
      		httpxml=new ActiveXObject("Microsoft.XMLHTTP");
     		 }
    			catch (e)
      		{
      		alert("Your browser does not support AJAX!");
      		return false;
      		}
    		}
  }
function stateck() 
    {
    if(httpxml.readyState==4)
      {
document.getElementById("descid").innerHTML=httpxml.responseText;
document.getElementById("descid").style.visibility="visible";
      }
    }
var url="descr.php";
url=url+"?obra_id="+obra_id;
url=url+"&sid="+Math.random();
httpxml.onreadystatechange=stateck;
httpxml.open("GET",url,true);
httpxml.send(null);
  }