function cambioPoblacion(obj,aux){ 
	var valor = obj[obj.selectedIndex].value; 
	if (valor == '-1') return false; 
	if (valor == '2'){ 
		aux.length = 1
		aux.options[0].text = "No tiene zonas";
		aux.options[0].value = "0"; 
	}
}

function ChangeOptions(lstPrimary, lstSecondary, strArray){
	var listLen = 1;
	var strKey  = lstPrimary.options[lstPrimary.selectedIndex].value;
	
	lstSecondary.options.length = 0;
	for (var i = 0; i < strArray.length; i++) {
		if (strArray[i][0] == strKey){
			lstSecondary.options[listLen] = new Option(strArray[i][2],strArray[i][1]);
			listLen = listLen + 1;
   		}
	}
	
	if (listLen==1) {
		lstSecondary.options.length = 0;
		lstSecondary.options[0] = new Option('No tiene zonas', '0');
	}else{
		lstSecondary.options[0] = new Option('Todas las zonas', '-1');
	}

	lstSecondary.options[0].selected = true;
	lstSecondary.selectedIndex=0;

	if (listLen > 0) lstSecondary.options[0].defaultSelected = true;
}

