var datos = new Array(); datos[0] = new Array("4749","33","Menorca","4"); datos[1] = new Array("33","0713","Sol Falcó","0"); datos[2] = new Array("33","0720","Sol Gavilanes","0"); datos[3] = new Array("33","0715","Sol Menorca","0"); datos[4] = new Array("33","0734","Sol Milanos Pingüinos","0"); datos[5] = new Array("4749","34","Ibiza","3"); datos[6] = new Array("34","0727","Sol Ibiza","0"); datos[7] = new Array("34","0739","Sol Pinet Playa","0"); datos[8] = new Array("34","0744","Sol S'Argamassa","0"); datos[9] = new Array("4749","35","Tenerife","6"); datos[10] = new Array("35","3810","Sol Parque San Antonio","0"); datos[11] = new Array("35","3831","Sol Princesa Dácil","0"); datos[12] = new Array("35","3817","Sol Puerto de la Cruz","0"); datos[13] = new Array("35","3830","Sol Puerto Playa","0"); datos[14] = new Array("35","3818","Sol Sun Beach Apartamentos","0"); datos[15] = new Array("35","3814","Sol Tenerife","0"); datos[16] = new Array("4749","36","Gran Canaria","1"); datos[17] = new Array("36","3501","Sol Barbacán","0"); datos[18] = new Array("4749","37","La Palma","2"); datos[19] = new Array("37","3820","Sol La Palma","0"); datos[20] = new Array("37","3822","Sol La Palma Apartamentos","0"); datos[21] = new Array("4749","38","Lanzarote","2"); datos[22] = new Array("38","3517","Sol Lanzarote","0"); datos[23] = new Array("38","3516","Sol Morromar Apartamentos","0"); datos[24] = new Array("4749","39","Fuerteventura","1"); datos[25] = new Array("39","3510","Sol Jandía Mar Apartamentos","0"); datos[26] = new Array("4749","41","Cádiz","1"); datos[27] = new Array("41","1112","Sol Sancti Petri Apartamentos","0"); datos[28] = new Array("4749","42","Costa del Sol","6"); datos[29] = new Array("42","2902","Sol Aloha Puerto","0"); datos[30] = new Array("42","2932","Sol Don Marco","0"); datos[31] = new Array("42","2918","Sol Don Pablo","0"); datos[32] = new Array("42","2921","Sol Don Pedro","0"); datos[33] = new Array("42","2908","Sol Príncipe","0"); datos[34] = new Array("42","2911","Sol Timor Apartamentos","0"); datos[35] = new Array("4749","43","Benidorm","2"); datos[36] = new Array("43","0301","Sol Costablanca","0"); datos[37] = new Array("43","0305","Sol Pelícanos Ocas","0"); datos[38] = new Array("4749","44","La Manga del Mar Menor","1"); datos[39] = new Array("44","3001","Sol Galúa","0"); datos[40] = new Array("4749","45","Costa Dorada","2"); datos[41] = new Array("45","4308","Sol Costa Daurada","0"); datos[42] = new Array("45","4309","Sol Pirámide Salou","0"); datos[43] = new Array("4749","46","Pirineos","1"); datos[44] = new Array("46","2504","Sol Vielha","0"); datos[45] = new Array("4749","47","Almuñecar","1"); datos[46] = new Array("47","1809","Sol Los Fenicios","0"); datos[47] = new Array("4749","32","Mallorca","10"); datos[48] = new Array("32","0757","Sol Alcudia Center Hotel Apartamentos","0"); datos[49] = new Array("32","0702","Sol Antillas Barbados","0"); datos[50] = new Array("32","0707","Sol Cala Blanca","0"); datos[51] = new Array("32","0708","Sol Cala d Or Apartamentos","0"); datos[52] = new Array("32","0733","Sol Calas de Mallorca Resort","0"); datos[53] = new Array("32","0722","Sol Guadalupe","0"); datos[54] = new Array("32","0776","Sol Lunamar Apartamentos","0"); datos[55] = new Array("32","0729","Sol Magalluf Park","0"); datos[56] = new Array("32","0737","Sol Mirlos Tordos","0"); datos[57] = new Array("32","0750","Sol Trinidad","0"); datos[58] = new Array("4749","48","Bulgaria","4"); datos[59] = new Array("48","6606","Sol Luna Bay All Inclusive","0"); datos[60] = new Array("48","6604","Sol Nessebar Bay All Inclusive","0"); datos[61] = new Array("48","6605","Sol Nessebar Mare All Inclusive","0"); datos[62] = new Array("48","6603","Sol Nessebar Palace All Inclusive","0"); datos[63] = new Array("4749","49","Croacia","17"); datos[64] = new Array("49","7003","Adriatic Guest House","0"); datos[65] = new Array("49","6326","Camping Finida","0"); datos[66] = new Array("49","7037","Camping Kanegra","0"); datos[67] = new Array("49","6327","Camping Park Umag","0"); datos[68] = new Array("49","7036","Camping Pineta","0"); datos[69] = new Array("49","7035","Camping Stella Maris","0"); datos[70] = new Array("49","7005","Depandance Park","0"); datos[71] = new Array("49","7004","Kanegra Apartamentos","0"); datos[72] = new Array("49","7034","Moj Mir & Bungalows","0"); datos[73] = new Array("49","7009","Savudrija Apartamentos","0"); datos[74] = new Array("49","7010","Sipar","0"); datos[75] = new Array("49","7001","Sol Aurora All Inclusive","0"); datos[76] = new Array("49","7002","Sol Garden Istra","0"); datos[77] = new Array("49","7008","Sol Polynesia Apartamentos","0"); datos[78] = new Array("49","7011","Sol Stella Maris Apartamentos","0"); datos[79] = new Array("49","7013","Sol Umag","0"); datos[80] = new Array("49","7007","Village Sol Garden Istra","0"); datos[81] = new Array("4749","50","Sharm El Sheik (Egipto)","2"); datos[82] = new Array("50","6440","Sol Cyrene","0"); datos[83] = new Array("50","6334","Sol Sharm","0"); datos[84] = new Array("4749","52","Islas Griegas","1"); datos[85] = new Array("52","6905","Sol Kipriotis Village","0"); datos[86] = new Array("4749","31","Cuba","7"); datos[87] = new Array("31","5878","Sol Cayo Coco","0"); datos[88] = new Array("31","5871","Sol Cayo Guillermo","0"); datos[89] = new Array("31","5869","Sol Cayo Largo","0"); datos[90] = new Array("31","5885","Sol Palmeras","0"); datos[91] = new Array("31","5980","Sol Pelícano","0"); datos[92] = new Array("31","5887","Sol Río De Luna y Mares","0"); datos[93] = new Array("31","5880","Sol Sirenas Coral","0"); function updateCombo1(combo1) { var aux = 0; var listaAux = new Array(); var cont = combo1.options.length; while (cont-- > 0 ) combo1.options[0] = null; cont = 0; while (aux < datos.length) { if (datos[aux] != null){ if(datos[aux][0] == '4749'){ listaAux[cont++]= new Array(normalizaName(datos[aux][2]),datos[aux]); } } aux++; } listaAux.sort(); combo1.options[0] = new Option('Selecciona zona', ''); combo1.options[1] = new Option('', ''); for(cont=0; cont < listaAux.length;cont++){ combo1.options[cont+2] = new Option(listaAux[cont][1][2]+" ("+listaAux[cont][1][3]+")", listaAux[cont][1][1]); } combo1.selectedIndex = 0; } function updateCombo2(combo1,combo2){ updateComboNiveles(combo1,combo2); } function updateComboNiveles(combo1, combo2) { var sTercerNivel = '4317;4368;4750;4838'; var arrayTercer = sTercerNivel.split(';'); var tercerNivel = false; for(i=0; i < arrayTercer.length && !tercerNivel; i++){ if(combo1.options[combo1.selectedIndex].value == arrayTercer[i]) tercerNivel = true; } var cont = combo2.options.length; while (cont-- > 0 ){ combo2.options[0] = null; } var contGroups = combo2.getElementsByTagName('OPTGROUP').length; while (contGroups-- > 0 ){ combo2.removeChild(combo2.getElementsByTagName('OPTGROUP')[0]); } if ( combo1.selectedIndex > 1 ) { var Arr = getColection(datos,combo1.options[combo1.selectedIndex].value); if (Arr.length == 1){ objOption = document.createElement('option'); objOption.innerHTML = Arr[0][2]; objOption.value = Arr[0][1]; combo2.appendChild(objOption); } else { combo2.options[0] = new Option('Selecciona Hotel',''); combo2.options[1] = new Option('', ''); for(i=0;i < Arr.length;i++){ var Arr2 = getColection(datos,Arr[i][1]); if(Arr2.length>0){ var objOption = document.createElement('option'); objOption.innerHTML = Arr[i][2]+" ("+Arr[i][3]+")"; objOption.value = Arr[i][1]; combo2.appendChild(objOption); for(i2=0;i2 < Arr2.length;i2++){ var separador = " "; // ch255 var objOption = document.createElement('option'); objOption.innerHTML = separador+Arr2[i2][2]+" ("+Arr2[i2][3]+")"; objOption.value = Arr2[i2][1]; combo2.appendChild(objOption); } } else{ objOption = document.createElement('option'); objOption.innerHTML = Arr[i][2]; objOption.value = Arr[i][1]; combo2.appendChild(objOption); } } } } // Si esta vacio, le pone la opcion por defecto if (combo2.options.length == 0){ combo2.options[0] = new Option('Selecciona Hotel',''); } // Si se tiene mas de una opcion en combo2 y no hay tercer nivel, entonces la primera opcion es seleccionar todos if (combo2.options.length != 1){ // Le añadimos una opcion al final para seleccionar todas las provincias (si no es España) if (!tercerNivel){ combo2.options[0] = new Option('Selecciona Hotel',''); combo2.selectedIndex = 0; } } } function existsInArray(sArray,obj) { var i; for(i=0;i < sArray.length;i++){ if(sArray[i]==obj) return true; } return false; return true; } function getColection(Arr,Criteria){ var sortResult = new Array(); var result = new Array(); var arrId = new Array(); var i; for(i=0; i < Arr.length;i++){ if(Arr[i]!=null){ if(Arr[i][0]==Criteria) { if(!existsInArray(arrId, Arr[i][1])){ arrId[arrId.length]= Arr[i][1]; sortResult[sortResult.length] = new Array(normalizaName(Arr[i][2]),Arr[i]); } } } } sortResult.sort(); for(i=0;i < sortResult.length;i++){ result[result.length]= sortResult[i][1]; } return result }