<!--  HASTA AQUI LAS LISTAS DINAMICAS//-->

<!--
/************************************************************************************************************
(C) www.dhtmlgoodies.com, October 2005

This is a script from www.dhtmlgoodies.com. You will find this and a lot of other scripts at our website.	

Terms of use:
You are free to use this script as long as the copyright message is kept intact. However, you may not
redistribute, sell or repost it without our permission.

Thank you!

www.dhtmlgoodies.com
Alf Magne Kalleland

***********************************ciudades-departamentos*************************************************/	
var ajax = new sack();



function getCityList(sel)
{
var preloader;
var inputselect=document.getElementById("ciudad");
var accion ="Cargando...";
	var countryCode = sel.options[sel.selectedIndex].value;
	

	document.getElementById('ciudad').options.length = 0;	// Empty city select box
	
	document.getElementById('ciudad').disabled =true;
	
	document.getElementById('ciudad').style.backgroundColor = '#E0FFC1';//verde 
	 
	if(countryCode.length>0){
		
		
		ajax.requestFile = '/includes/functions/getCities.php?countryCode='+countryCode;	//dhtmlgoodies_country Specifying which file to get
		ajax.onCompletion = createCities;	// Specify function that will be executed after file has been found
		inputselect.value = accion;
		ajax.runAJAX();		// Execute AJAX function
	
	}
//	
}


function createCities()
{
	var obj = document.getElementById('ciudad');
	//obj.value = "Cargando...";
	eval(ajax.response);	// Executing the response from Ajax as Javascript code
		
 document.getElementById('ciudad').disabled =false;
document.getElementById('ciudad').style.backgroundColor = '';//verde 
}

//******************************categorias-secciones*************************************************
var ajax = new sack();
function getCategory(sel)
{
	var countryCode = sel.options[sel.selectedIndex].value;
	document.getElementById('CLASES').options.length = 0;	// Empty city select box
	document.getElementById('CLASES').disabled =true;
	document.getElementById('CLASES').style.backgroundColor = '';//verde
		
	if(countryCode.length>0){
		
		ajax.requestFile = '/includes/functions/getCategorias.php?countryCode='+countryCode;	//dhtmlgoodies_country Specifying which file to get
		ajax.onCompletion = createCategorias;	// Specify function that will be executed after file has been found
		ajax.runAJAX();		// Execute AJAX function
	}
}

function createCategorias()
{
	var obj = document.getElementById('CLASES');
	eval(ajax.response);	// Executing the response from Ajax as Javascript code	
document.getElementById('CLASES').disabled =false;
document.getElementById('CLASES').style.backgroundColor = '';//verde 
}
	
//******************************GUARDA LAS CATEGORIAS EN LA BASE DE DATOS******************
var ajax = new sack();
function getCategoryMysql(sel,idr)
{
	var countryCode = sel.options[sel.selectedIndex].value;
	document.getElementById('CLASES').options.length = 0;	// Empty city select box
	document.getElementById('CLASES').disabled =true;
	document.getElementById('CLASES').style.backgroundColor = '';//verde
		
	if(countryCode.length>0){
		//alert('paso por aqui '+idr);
		ajax.requestFile = '/includes/functions/getCategorias.php?countryCode='+countryCode+'&'+idr+'&';	//dhtmlgoodies_country Specifying which file to get
		ajax.onCompletion = createCategorias;	// Specify function that will be executed after file has been found
		ajax.runAJAX();		// Execute AJAX function
		
	/*	 
  http.open("GET", ajax.requestFile + escape(countryCode + "|" + idr), true);
  http.onreadystatechange = eval(handleHttpResponse);
  http.send(null);
  */
	}
}

function createCategorias()
{
	var obj = document.getElementById('CLASES');
	eval(ajax.response);	// Executing the response from Ajax as Javascript code	
document.getElementById('CLASES').disabled =false;
document.getElementById('CLASES').style.backgroundColor = '';//verde 
}
			
//******************************correo-secciones*************************************************
var ajax = new sack();
function getCorreo(sel)
{
	var countryCode = sel.options[sel.selectedIndex].value;
	document.getElementById('ip2').options.length = 0;	// Empty city select box
	document.getElementById('ip2').disabled =true;
	document.getElementById('ip2').style.backgroundColor = '#E0FFC1';//verde 
	if(countryCode.length>0){
		
		document.getElementById('button').disabled =false;
		ajax.requestFile = '/includes/functions/getCorreo.php?countryCode='+countryCode;	//dhtmlgoodies_country Specifying which file to get
		ajax.onCompletion = createCorreo;	// Specify function that will be executed after file has been found
		ajax.runAJAX();		// Execute AJAX function
	}
}

function createCorreo()
{
	var obj = document.getElementById('ip2');
	eval(ajax.response);	// Executing the response from Ajax as Javascript code	
document.getElementById('ip2').disabled =false;
document.getElementById('ip2').style.backgroundColor = '';//verde 
}

function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}
//-->
