function abrir(id,ancho,alto){
	
	ancho = ancho + 40;
	alto = alto +40;
	window.open("ventana_emergente.php?id="+id,"foto","toolbar=no,status=no,scrollbar=no,resizable=yes,width="+ancho+",height="+alto+",left=200,top=150");

}


function cargaMarcaCategoria(){ 
	var d1,contenedor; 
	// nos devuelve la referéncia al objeto que tiene como id el valor pasado
	//div donde esta el combo 'id_padre' que queremos cargar, a partir del combo 'comercios'
	contenedor = document.getElementById('marca'); 
	//comercios 
	d1 = document.formcatalogo.categoria_id.options[document.formcatalogo.categoria_id.selectedIndex].value; 
	ajax=nuevoAjax(); 
	ajax.open("GET", "procesos.php?categoria_id="+d1,true); 
	ajax.onreadystatechange=function() { 
		if (ajax.readyState==4) { 
		   contenedor.innerHTML = ajax.responseText 
		} 
	} 
	ajax.send(null) 
} 


//funcion AJAX
function nuevoAjax(){
  var xmlhttp=false;
  try {
   // Creación del objeto ajax para navegadores diferentes a Explorer
   xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
  } catch (e) {
   // o bien 
   try {
     // Creación del objet ajax para Explorer
     xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch (E) {
     xmlhttp = false;
   }
  }

  if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
   xmlhttp = new XMLHttpRequest();
  }
  return xmlhttp;
}
