var MONTHS_SHORT = ["январь", "февраль", "март", "апрель", "май", "июнь","июль", "август", "сентябрь", "октябрь", "ноябрь", "декабрь"]; var MONTHS_DAYS = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31]; var ARR_WEEKDAYS = ["воскресенье", "понедельник", "вторник", "среда", "четверг", "пятница", "суббота"]; function DayOfTheWeek(year, month, day) { var c = new Date(year, month-1, day); var dayOfWeek = c.getDay(); return ARR_WEEKDAYS[dayOfWeek]; } function setArrival(date, fullmonth) { today = '2017-11-19'; if (date < today) { date = today; } year = date.charAt(0) + date.charAt(1) + date.charAt(2) + date.charAt(3); month = date.charAt(5) + date.charAt(6); day = date.charAt(8) + '' + date.charAt(9); if (day > MONTHS_DAYS[month-1]) day = MONTHS_DAYS[month-1]; //nagy dátum beállítása myarr_date = document.booking.arr_date; myarr_date.value = day + '-' + month + '-' + year; //a hét napja beállítása myarr_dayname = document.getElementById("arr_dayname"); myarr_dayname.value = DayOfTheWeek(year, month, day); myarr_day = document.getElementById("arr_day"); for (i=0;i<31;i++) { myarr_day.options[i]=null; } for (i=0;i 12) { aktmonth = 1*i-12; aktyear = 1*globalyear+1; } if (i > 24) { aktmonth = 1*i-24; aktyear = 1*globalyear+2; } if ((aktmonth == month) && (aktyear == year)) selectedmonth = j; myarr_month.options[j]=null; myarr_month.options[j]=new Option(MONTHS_SHORT[1*aktmonth-1] + ' '+ aktyear,aktyear + ''+ aktmonth); j++; } myarr_month.options[selectedmonth].selected=true; } function setDeparture(date, fullmonth) { today = '2017-11-20'; if (date < today) { date = today; } //alert(date); year = date.charAt(0) + date.charAt(1) + date.charAt(2) + date.charAt(3); month = date.charAt(5) + date.charAt(6); day = date.charAt(8) + '' + date.charAt(9); if (day > MONTHS_DAYS[month-1]) day = MONTHS_DAYS[month-1]; //nagy dátum beállítása mydep_date = document.booking.dep_date; mydep_date.value = day + '-' + month + '-' + year; //a hét napja beállítása mydep_dayname = document.getElementById("dep_dayname"); mydep_dayname.value = DayOfTheWeek(year, month, day); mydep_day = document.getElementById("dep_day"); for (i=0;i<31;i++) { mydep_day.options[i]=null; } for (i=0;i<1*fullmonth;i++) { mydep_day.options[i]=new Option(1*i+1,1*i+1); } mydep_day.options[day-1].selected=true; mydep_month = document.getElementById("dep_month"); j = 0; globalmonth = 11; globalyear = 2017; for (i=globalmonth;i<1*globalmonth+12;i++) { aktmonth = i; aktyear = globalyear; if (i > 12) { aktmonth = 1*i-12; aktyear = 1*globalyear+1; } if (i > 24) { aktmonth = 1*i-24; aktyear = 1*globalyear+2; } //alert(aktyear); if ((aktmonth == month) && (aktyear == year)) selectedmonth = j; mydep_month.options[j]=null; mydep_month.options[j]=new Option(MONTHS_SHORT[aktmonth-1] + ' '+ aktyear,aktyear + ''+ aktmonth); j++; } mydep_month.options[selectedmonth].selected=true; } function setCities() { mycities = document.getElementById("cityID"); if (!mycities.value) { mycities.options[0]=null; mycities.options[0]=new Option('Abadszalok','623'); mycities.options[1]=null; mycities.options[1]=new Option('Abasar','725'); mycities.options[2]=null; mycities.options[2]=new Option('Agard','141'); mycities.options[3]=null; mycities.options[3]=new Option('Aggtelek','216'); mycities.options[4]=null; mycities.options[4]=new Option('Ajka','334'); mycities.options[5]=null; mycities.options[5]=new Option('Algyo','438'); mycities.options[6]=null; mycities.options[6]=new Option('Alsoors','70'); mycities.options[7]=null; mycities.options[7]=new Option('Alsopahok','214'); mycities.options[8]=null; mycities.options[8]=new Option('Badacsony','179'); mycities.options[9]=null; mycities.options[9]=new Option('Badacsonytordemic','152'); mycities.options[10]=null; mycities.options[10]=new Option('Baja','318'); mycities.options[11]=null; mycities.options[11]=new Option('Bakonybel','162'); mycities.options[12]=null; mycities.options[12]=new Option('Balassagyarmat','306'); mycities.options[13]=null; mycities.options[13]=new Option('Balatonalmadi','23'); mycities.options[14]=null; mycities.options[14]=new Option('Balatonbereny','282'); mycities.options[15]=null; mycities.options[15]=new Option('Balatonboglar','42'); mycities.options[16]=null; mycities.options[16]=new Option('Balatonederics','600'); mycities.options[17]=null; mycities.options[17]=new Option('Balatonfoldvar','131'); mycities.options[18]=null; mycities.options[18]=new Option('Balatonfured','36'); mycities.options[19]=null; mycities.options[19]=new Option('Balatongyorok','100'); mycities.options[20]=null; mycities.options[20]=new Option('Balatonkenese','92'); mycities.options[21]=null; mycities.options[21]=new Option('Balatonkeresztur','231'); mycities.options[22]=null; mycities.options[22]=new Option('Balatonlelle','121'); mycities.options[23]=null; mycities.options[23]=new Option('Balatonmariafurdo','41'); mycities.options[24]=null; mycities.options[24]=new Option('Balatonszarszo','96'); mycities.options[25]=null; mycities.options[25]=new Option('Balatonszemes','482'); mycities.options[26]=null; mycities.options[26]=new Option('Balatonvilagos','78'); mycities.options[27]=null; mycities.options[27]=new Option('Bank','178'); mycities.options[28]=null; mycities.options[28]=new Option('Bekescsaba','384'); mycities.options[29]=null; mycities.options[29]=new Option('Belapatfalva','603'); mycities.options[30]=null; mycities.options[30]=new Option('Belvardgyula','1101'); mycities.options[31]=null; mycities.options[31]=new Option('Berekfurdo','169'); mycities.options[32]=null; mycities.options[32]=new Option('Beremend','190'); mycities.options[33]=null; mycities.options[33]=new Option('Berente','1514'); mycities.options[34]=null; mycities.options[34]=new Option('Bikacs','76'); mycities.options[35]=null; mycities.options[35]=new Option('Bikal','522'); mycities.options[36]=null; mycities.options[36]=new Option('Bogacs','158'); mycities.options[37]=null; mycities.options[37]=new Option('Bonnya','590'); mycities.options[38]=null; mycities.options[38]=new Option('Budapest','1'); mycities.options[39]=null; mycities.options[39]=new Option('Bugyi','209'); mycities.options[40]=null; mycities.options[40]=new Option('Buk, Bukfurdo','4'); mycities.options[41]=null; mycities.options[41]=new Option('Bukkosd','851'); mycities.options[42]=null; mycities.options[42]=new Option('Cak','1007'); mycities.options[43]=null; mycities.options[43]=new Option('Cegled','50'); mycities.options[44]=null; mycities.options[44]=new Option('Celldomolk','579'); mycities.options[45]=null; mycities.options[45]=new Option('Csaszartoltes','901'); mycities.options[46]=null; mycities.options[46]=new Option('Cserepfalu','188'); mycities.options[47]=null; mycities.options[47]=new Option('Cserkeszolo','40'); mycities.options[48]=null; mycities.options[48]=new Option('Cserkut','613'); mycities.options[49]=null; mycities.options[49]=new Option('Cserszegtomaj','59'); mycities.options[50]=null; mycities.options[50]=new Option('Csopak','470'); mycities.options[51]=null; mycities.options[51]=new Option('Csurgo','284'); mycities.options[52]=null; mycities.options[52]=new Option('Davod','445'); mycities.options[53]=null; mycities.options[53]=new Option('Debrecen','16'); mycities.options[54]=null; mycities.options[54]=new Option('Demjen','225'); mycities.options[55]=null; mycities.options[55]=new Option('Dobronte','213'); mycities.options[56]=null; mycities.options[56]=new Option('Dombovar','325'); mycities.options[57]=null; mycities.options[57]=new Option('Dravatamasi','175'); mycities.options[58]=null; mycities.options[58]=new Option('Dunaharaszti','276'); mycities.options[59]=null; mycities.options[59]=new Option('Dunakiliti','139'); mycities.options[60]=null; mycities.options[60]=new Option('Dunapataj','662'); mycities.options[61]=null; mycities.options[61]=new Option('Dunaszentmiklos','657'); mycities.options[62]=null; mycities.options[62]=new Option('Eger','3'); mycities.options[63]=null; mycities.options[63]=new Option('Egerszalok','31'); mycities.options[64]=null; mycities.options[64]=new Option('Erdobenye','91'); mycities.options[65]=null; mycities.options[65]=new Option('Erdohorvati','967'); mycities.options[66]=null; mycities.options[66]=new Option('Esztergom','126'); mycities.options[67]=null; mycities.options[67]=new Option('Fadd-Dombori','811'); mycities.options[68]=null; mycities.options[68]=new Option('Fehervarcsurgo','194'); mycities.options[69]=null; mycities.options[69]=new Option('Feldebro','872'); mycities.options[70]=null; mycities.options[70]=new Option('Felsotarkany','548'); mycities.options[71]=null; mycities.options[71]=new Option('Felsotold','743'); mycities.options[72]=null; mycities.options[72]=new Option('Fuzesgyarmat','26'); mycities.options[73]=null; mycities.options[73]=new Option('Galyateto','34'); mycities.options[74]=null; mycities.options[74]=new Option('Garab','1091'); mycities.options[75]=null; mycities.options[75]=new Option('Garabonc','124'); mycities.options[76]=null; mycities.options[76]=new Option('Gardony','43'); mycities.options[77]=null; mycities.options[77]=new Option('Godollo','215'); mycities.options[78]=null; mycities.options[78]=new Option('Gosztola','195'); mycities.options[79]=null; mycities.options[79]=new Option('Gyekenyes','565'); mycities.options[80]=null; mycities.options[80]=new Option('Gyenesdias','71'); mycities.options[81]=null; mycities.options[81]=new Option('Gyomaendrod','69'); mycities.options[82]=null; mycities.options[82]=new Option('Gyomro','12'); mycities.options[83]=null; mycities.options[83]=new Option('Gyoparosfurdo','480'); mycities.options[84]=null; mycities.options[84]=new Option('Gyor','15'); mycities.options[85]=null; mycities.options[85]=new Option('Gyula','29'); mycities.options[86]=null; mycities.options[86]=new Option('Hajdunanas','354'); mycities.options[87]=null; mycities.options[87]=new Option('Hajduszoboszlo','6'); mycities.options[88]=null; mycities.options[88]=new Option('Hajmas','1060'); mycities.options[89]=null; mycities.options[89]=new Option('Halimba','449'); mycities.options[90]=null; mycities.options[90]=new Option('Harkany','22'); mycities.options[91]=null; mycities.options[91]=new Option('Hedervar','60'); mycities.options[92]=null; mycities.options[92]=new Option('Hegyko','166'); mycities.options[93]=null; mycities.options[93]=new Option('Herceghalom','119'); mycities.options[94]=null; mycities.options[94]=new Option('Heviz','5'); mycities.options[95]=null; mycities.options[95]=new Option('Hidegseg','147'); mycities.options[96]=null; mycities.options[96]=new Option('Hodmezovasarhely','185'); mycities.options[97]=null; mycities.options[97]=new Option('Holloko','525'); mycities.options[98]=null; mycities.options[98]=new Option('Horvatzsidany','515'); mycities.options[99]=null; mycities.options[99]=new Option('Hosszuheteny','429'); mycities.options[100]=null; mycities.options[100]=new Option('Hovej','971'); mycities.options[101]=null; mycities.options[101]=new Option('Igal','403'); mycities.options[102]=null; mycities.options[102]=new Option('Inarcs','120'); mycities.options[103]=null; mycities.options[103]=new Option('Istenmezeje','746'); mycities.options[104]=null; mycities.options[104]=new Option('Jasd','750'); mycities.options[105]=null; mycities.options[105]=new Option('Kacs','1050'); mycities.options[106]=null; mycities.options[106]=new Option('Kalocsa','122'); mycities.options[107]=null; mycities.options[107]=new Option('Kapuvar','404'); mycities.options[108]=null; mycities.options[108]=new Option('Karancsalja','1083'); mycities.options[109]=null; mycities.options[109]=new Option('Kazincbarcika','218'); mycities.options[110]=null; mycities.options[110]=new Option('Kecskemet','61'); mycities.options[111]=null; mycities.options[111]=new Option('Kehidakustany','65'); mycities.options[112]=null; mycities.options[112]=new Option('Kekkut','860'); mycities.options[113]=null; mycities.options[113]=new Option('Keszthely','33'); mycities.options[114]=null; mycities.options[114]=new Option('Ketvolgy','167'); mycities.options[115]=null; mycities.options[115]=new Option('Kisber','281'); mycities.options[116]=null; mycities.options[116]=new Option('Kiskunfelegyhaza','125'); mycities.options[117]=null; mycities.options[117]=new Option('Kismaros','549'); mycities.options[118]=null; mycities.options[118]=new Option('Kistelek','250'); mycities.options[119]=null; mycities.options[119]=new Option('Komarom','435'); mycities.options[120]=null; mycities.options[120]=new Option('Kormend','298'); mycities.options[121]=null; mycities.options[121]=new Option('Koroshegy','526'); mycities.options[122]=null; mycities.options[122]=new Option('Kospallag','599'); mycities.options[123]=null; mycities.options[123]=new Option('Koszeg','145'); mycities.options[124]=null; mycities.options[124]=new Option('Lajosmizse','370'); mycities.options[125]=null; mycities.options[125]=new Option('Lenti','151'); mycities.options[126]=null; mycities.options[126]=new Option('Lillafured','56'); mycities.options[127]=null; mycities.options[127]=new Option('Magyarhertelend','808'); mycities.options[128]=null; mycities.options[128]=new Option('Magyartes','1005'); mycities.options[129]=null; mycities.options[129]=new Option('Majs','1032'); mycities.options[130]=null; mycities.options[130]=new Option('Mako','457'); mycities.options[131]=null; mycities.options[131]=new Option('Marcalgergelyi','1006'); mycities.options[132]=null; mycities.options[132]=new Option('Matraballa','713'); mycities.options[133]=null; mycities.options[133]=new Option('Matrafured','543'); mycities.options[134]=null; mycities.options[134]=new Option('Matrahaza','533'); mycities.options[135]=null; mycities.options[135]=new Option('Matraszentimre','181'); mycities.options[136]=null; mycities.options[136]=new Option('Mecseknadasd','259'); mycities.options[137]=null; mycities.options[137]=new Option('Medina','1069'); mycities.options[138]=null; mycities.options[138]=new Option('Mezobereny','625'); mycities.options[139]=null; mycities.options[139]=new Option('Mezokovesd','18'); mycities.options[140]=null; mycities.options[140]=new Option('Mezotur','414'); mycities.options[141]=null; mycities.options[141]=new Option('Misefa','173'); mycities.options[142]=null; mycities.options[142]=new Option('Miskolctapolca','77'); mycities.options[143]=null; mycities.options[143]=new Option('Mogyorod','301'); mycities.options[144]=null; mycities.options[144]=new Option('Mohacs','481'); mycities.options[145]=null; mycities.options[145]=new Option('Monor','394'); mycities.options[146]=null; mycities.options[146]=new Option('Mor','211'); mycities.options[147]=null; mycities.options[147]=new Option('Morahalom','148'); mycities.options[148]=null; mycities.options[148]=new Option('Mosonmagyarovar','95'); mycities.options[149]=null; mycities.options[149]=new Option('Nagyatad','168'); mycities.options[150]=null; mycities.options[150]=new Option('Nagybaracska','221'); mycities.options[151]=null; mycities.options[151]=new Option('Nagyharsany','801'); mycities.options[152]=null; mycities.options[152]=new Option('Nagyhuta','424'); mycities.options[153]=null; mycities.options[153]=new Option('Nagykanizsa','58'); mycities.options[154]=null; mycities.options[154]=new Option('Nagyloc','1025'); mycities.options[155]=null; mycities.options[155]=new Option('Nagymanyok','180'); mycities.options[156]=null; mycities.options[156]=new Option('Nagymaros','433'); mycities.options[157]=null; mycities.options[157]=new Option('Nagytarcsa','907'); mycities.options[158]=null; mycities.options[158]=new Option('Nagyvazsony','511'); mycities.options[159]=null; mycities.options[159]=new Option('Nemesnadudvar','170'); mycities.options[160]=null; mycities.options[160]=new Option('Nemesnep','157'); mycities.options[161]=null; mycities.options[161]=new Option('Nogradgardony','149'); mycities.options[162]=null; mycities.options[162]=new Option('Noszvaj','191'); mycities.options[163]=null; mycities.options[163]=new Option('Nyirbator','177'); mycities.options[164]=null; mycities.options[164]=new Option('Nyiregyhaza','193'); mycities.options[165]=null; mycities.options[165]=new Option('Orfu','274'); mycities.options[166]=null; mycities.options[166]=new Option('Oriszentpeter','164'); mycities.options[167]=null; mycities.options[167]=new Option('Oroshaza','376'); mycities.options[168]=null; mycities.options[168]=new Option('Paks','411'); mycities.options[169]=null; mycities.options[169]=new Option('Papa','227'); mycities.options[170]=null; mycities.options[170]=new Option('Parad','505'); mycities.options[171]=null; mycities.options[171]=new Option('Paradfurdo','174'); mycities.options[172]=null; mycities.options[172]=new Option('Paradsasvar','93'); mycities.options[173]=null; mycities.options[173]=new Option('Paty','46'); mycities.options[174]=null; mycities.options[174]=new Option('Pecs','13'); mycities.options[175]=null; mycities.options[175]=new Option('Pellerd','566'); mycities.options[176]=null; mycities.options[176]=new Option('Pogany','838'); mycities.options[177]=null; mycities.options[177]=new Option('Poroszlo','19'); mycities.options[178]=null; mycities.options[178]=new Option('Porva-Szepalmapuszta','160'); mycities.options[179]=null; mycities.options[179]=new Option('Rabafuzes','83'); mycities.options[180]=null; mycities.options[180]=new Option('Rabapaty','140'); mycities.options[181]=null; mycities.options[181]=new Option('Rackeve','189'); mycities.options[182]=null; mycities.options[182]=new Option('Ratka','208'); mycities.options[183]=null; mycities.options[183]=new Option('Rojtokmuzsaj','79'); mycities.options[184]=null; mycities.options[184]=new Option('Sajogalgoc','1024'); mycities.options[185]=null; mycities.options[185]=new Option('Salgobanya','686'); mycities.options[186]=null; mycities.options[186]=new Option('Sarmellek','756'); mycities.options[187]=null; mycities.options[187]=new Option('Sarospatak','143'); mycities.options[188]=null; mycities.options[188]=new Option('Sarvar','7'); mycities.options[189]=null; mycities.options[189]=new Option('Satoraljaujhely','219'); mycities.options[190]=null; mycities.options[190]=new Option('Siklos','456'); mycities.options[191]=null; mycities.options[191]=new Option('Sikonda','136'); mycities.options[192]=null; mycities.options[192]=new Option('Simontornya','98'); mycities.options[193]=null; mycities.options[193]=new Option('Siofok','24'); mycities.options[194]=null; mycities.options[194]=new Option('Sirok','453'); mycities.options[195]=null; mycities.options[195]=new Option('Sopron','14'); mycities.options[196]=null; mycities.options[196]=new Option('Sumeg','35'); mycities.options[197]=null; mycities.options[197]=new Option('Szeged','20'); mycities.options[198]=null; mycities.options[198]=new Option('Szekesfehervar','48'); mycities.options[199]=null; mycities.options[199]=new Option('Szeleste','386'); mycities.options[200]=null; mycities.options[200]=new Option('Szendehely','845'); mycities.options[201]=null; mycities.options[201]=new Option('Szentendre','74'); mycities.options[202]=null; mycities.options[202]=new Option('Szentgotthard','130'); mycities.options[203]=null; mycities.options[203]=new Option('Szigetszentmiklos','86'); mycities.options[204]=null; mycities.options[204]=new Option('Szilvasvarad','104'); mycities.options[205]=null; mycities.options[205]=new Option('Szirak','448'); mycities.options[206]=null; mycities.options[206]=new Option('Szoce','1503'); mycities.options[207]=null; mycities.options[207]=new Option('Szolnok','66'); mycities.options[208]=null; mycities.options[208]=new Option('Szombathely','45'); mycities.options[209]=null; mycities.options[209]=new Option('Tallya','602'); mycities.options[210]=null; mycities.options[210]=new Option('Tapolca','10'); mycities.options[211]=null; mycities.options[211]=new Option('Tapolca-Gyulakeszi','163'); mycities.options[212]=null; mycities.options[212]=new Option('Tarcal','80'); mycities.options[213]=null; mycities.options[213]=new Option('Tat','535'); mycities.options[214]=null; mycities.options[214]=new Option('Tata','57'); mycities.options[215]=null; mycities.options[215]=new Option('Tatabanya','322'); mycities.options[216]=null; mycities.options[216]=new Option('Telki','228'); mycities.options[217]=null; mycities.options[217]=new Option('Tihany','72'); mycities.options[218]=null; mycities.options[218]=new Option('Tiszaalpar','624'); mycities.options[219]=null; mycities.options[219]=new Option('Tiszafured','62'); mycities.options[220]=null; mycities.options[220]=new Option('Tiszakecske','374'); mycities.options[221]=null; mycities.options[221]=new Option('Tiszaug','804'); mycities.options[222]=null; mycities.options[222]=new Option('Tiszaujvaros','28'); mycities.options[223]=null; mycities.options[223]=new Option('Tokaj','127'); mycities.options[224]=null; mycities.options[224]=new Option('Torokbalint','73'); mycities.options[225]=null; mycities.options[225]=new Option('Torokszentmiklos','159'); mycities.options[226]=null; mycities.options[226]=new Option('Vanyarc','1189'); mycities.options[227]=null; mycities.options[227]=new Option('Varalja','144'); mycities.options[228]=null; mycities.options[228]=new Option('Vargesztes','546'); mycities.options[229]=null; mycities.options[229]=new Option('Vasad','528'); mycities.options[230]=null; mycities.options[230]=new Option('Vecses','39'); mycities.options[231]=null; mycities.options[231]=new Option('Velem','685'); mycities.options[232]=null; mycities.options[232]=new Option('Velemer','156'); mycities.options[233]=null; mycities.options[233]=new Option('Velence','90'); mycities.options[234]=null; mycities.options[234]=new Option('Venek','1145'); mycities.options[235]=null; mycities.options[235]=new Option('Veresegyhaz','359'); mycities.options[236]=null; mycities.options[236]=new Option('Verpelet','821'); mycities.options[237]=null; mycities.options[237]=new Option('Veszprem','97'); mycities.options[238]=null; mycities.options[238]=new Option('Villany','132'); mycities.options[239]=null; mycities.options[239]=new Option('Villanykovesd','203'); mycities.options[240]=null; mycities.options[240]=new Option('Vindornyalak ','207'); mycities.options[241]=null; mycities.options[241]=new Option('Visegrad','81'); mycities.options[242]=null; mycities.options[242]=new Option('Vonyarcvashegy','44'); mycities.options[243]=null; mycities.options[243]=new Option('Zalacsany','67'); mycities.options[244]=null; mycities.options[244]=new Option('Zalakaros','17'); mycities.options[245]=null; mycities.options[245]=new Option('Zalaszentgrot','165'); mycities.options[246]=null; mycities.options[246]=new Option('Zamardi','133'); mycities.options[247]=null; mycities.options[247]=new Option('Zanka','622'); mycities.options[248]=null; mycities.options[248]=new Option('Zengovarkony','839'); mycities.options[249]=null; mycities.options[249]=new Option('Zirc','516'); mycities.options[250]=null; mycities.options[250]=new Option('Zsambek','103'); mycities.options[251]=null; mycities.options[251]=new Option('Zsira','223'); mycities.options[252]=null; mycities.options[252]=new Option('Balaton','virtual_2'); mycities.options[253]=null; mycities.options[253]=new Option('Hungarian vacation check','virtual_3'); mycities.options[254]=null; mycities.options[254]=new Option('Wellness-гостиницы','virtual_1'); mycities.options[38].selected=true; } } function changeArrDate() { myarr_day = document.getElementById("arr_day"); myarr_month = document.getElementById("arr_month"); myarr_month_text = myarr_month.options[myarr_month.selectedIndex].value; day = myarr_day.options[myarr_day.selectedIndex].value; year = myarr_month_text.charAt(0) + myarr_month_text.charAt(1) + myarr_month_text.charAt(2) + myarr_month_text.charAt(3); month = myarr_month_text.charAt(4) + myarr_month_text.charAt(5); //biztosan frissiteni kell az érkezést arrdate = year; if (month < 10) { arrdate = arrdate + '-0' + month; } else { arrdate = arrdate + '-' + month; } if (day < 10) { arrdate = arrdate + '-0' + day; } else { arrdate = arrdate + '-' + day; } //alert(arrdate); globaldate = '2018-10-31'; globaldate2 = '2018-10-30'; globalday2 = '30'; if (globaldate == arrdate) { arrdate = globaldate2; arrday = globalday2; } setArrival(arrdate, MONTHS_DAYS[month-1]); day = myarr_day.options[myarr_day.selectedIndex].value; year = myarr_month_text.charAt(0) + myarr_month_text.charAt(1) + myarr_month_text.charAt(2) + myarr_month_text.charAt(3); month = myarr_month_text.charAt(4) + myarr_month_text.charAt(5); //csak akkor módosítjuk a távozás dátumát, ha az megelőzi az érkezést mydep_day = document.getElementById("dep_day"); mydep_month = document.getElementById("dep_month"); mydep_month_text = mydep_month.options[mydep_month.selectedIndex].value; depnowday = mydep_day.options[mydep_day.selectedIndex].value; depnowyear = mydep_month_text.charAt(0) + mydep_month_text.charAt(1) + mydep_month_text.charAt(2) + mydep_month_text.charAt(3); depnowmonth = mydep_month_text.charAt(4) + mydep_month_text.charAt(5); // alert(day +'<'+ depnowday); if (1*year < 1*depnowyear) return; if ((1*year == 1*depnowyear) && (1*month < 1*depnowmonth)) return; if ( (1*year == 1*depnowyear) && (1*month==1*depnowmonth) && (1*day < 1*depnowday)) return; //alert(year + '-' + month + '-' + day); depday = 1*day + 1; depmonth = month; depyear = year; if ( (month<12) && (MONTHS_DAYS[month-1] == day)) { //nem december és hónap vége van depday = 1; depmonth = 1*month+1; depyear = 1*year; } if ((month == 12) && (MONTHS_DAYS[month-1] == day)) { //december és hónap vége van depday = 1; depmonth = 1; depyear = 1*year + 1; } depdate = depyear; if (depmonth < 10) { depdate = depdate + '-0' + depmonth; } else { depdate = depdate + '-' + depmonth; } if (depday < 10) { depdate = depdate + '-0' + depday; } else { depdate = depdate + '-' + depday; } //alert(depdate); setDeparture(depdate, MONTHS_DAYS[depmonth-1]); } function changeDepDate() { myarr_day = document.getElementById("arr_day"); myarr_month = document.getElementById("arr_month"); myarr_month_text = myarr_month.options[myarr_month.selectedIndex].value; arrday = myarr_day.options[myarr_day.selectedIndex].value; arryear = myarr_month_text.charAt(0) + myarr_month_text.charAt(1) + myarr_month_text.charAt(2) + myarr_month_text.charAt(3); arrmonth = myarr_month_text.charAt(4) + myarr_month_text.charAt(5); mydep_day = document.getElementById("dep_day"); mydep_month = document.getElementById("dep_month"); mydep_month_text = mydep_month.options[mydep_month.selectedIndex].value; depday = mydep_day.options[mydep_day.selectedIndex].value; depyear = mydep_month_text.charAt(0) + mydep_month_text.charAt(1) + mydep_month_text.charAt(2) + mydep_month_text.charAt(3); depmonth = mydep_month_text.charAt(4) + mydep_month_text.charAt(5); //biztosan frissiteni kell az távozást depdate = depyear; if (depmonth < 10) { depdate = depdate + '-0' + 1*depmonth; } else { depdate = depdate + '-' + 1*depmonth; } if (depday < 10) { depdate = depdate + '-0' + 1*depday; } else { depdate = depdate + '-' + 1*depday; } //alert(depdate); globaldate = '2017-11-01'; globaldate2 = '2017-11-02'; if (globaldate == depdate) { depdate = globaldate2; depday = 2; } arrdate = arryear; if (arrmonth < 10) { arrdate = arrdate + '-0' + 1*arrmonth; } else { arrdate = arrdate + '-' + 1*arrmonth; } if (arrday < 10) { arrdate = arrdate + '-0' + 1*arrday; } else { arrdate = arrdate + '-' + 1*arrday; } setDeparture(depdate, MONTHS_DAYS[1*depmonth-1]); return; if (arrdate < depdate) return; //minden ok //változtatni kell az érkezést is sajna arrday = 1*depday - 1; arrmonth = depmonth; arryear = depyear; if ( (depmonth>0) && (depday == 1)) { //nem január és hónap eleje arrday = 31; //a beállíátsnál úgyis a hónap végére módosítja a függvény arrmonth = 1*depmonth-1; arryear = 1*depyear; } if ((month == 0) && (depday == 1)) { //január és hónap eleje van arrday = 31; arrmonth = 12; arryear = 1*depyear - 1; } arrdate = arryear; if (arrmonth < 10) { arrdate = arrdate + '-0' + 1*arrmonth; } else { arrdate = arrdate + '-' + 1*arrmonth; } if (arrday < 10) { arrdate = arrdate + '-0' + 1*arrday; } else { arrdate = arrdate + '-' + 1*arrday; } //alert(arrdate); setArrival(arrdate, MONTHS_DAYS[arrmonth-1]); } function checkDateValidity() { myarr_day = document.getElementById("arr_day"); myarr_month = document.getElementById("arr_month"); myarr_month_text = myarr_month.options[myarr_month.selectedIndex].value; arrday = myarr_day.options[myarr_day.selectedIndex].value; arryear = myarr_month_text.charAt(0) + myarr_month_text.charAt(1) + myarr_month_text.charAt(2) + myarr_month_text.charAt(3); arrmonth = myarr_month_text.charAt(4) + myarr_month_text.charAt(5); mydep_day = document.getElementById("dep_day"); mydep_month = document.getElementById("dep_month"); mydep_month_text = mydep_month.options[mydep_month.selectedIndex].value; depday = mydep_day.options[mydep_day.selectedIndex].value; depyear = mydep_month_text.charAt(0) + mydep_month_text.charAt(1) + mydep_month_text.charAt(2) + mydep_month_text.charAt(3); depmonth = mydep_month_text.charAt(4) + mydep_month_text.charAt(5); //biztosan frissiteni kell az távozást depdate = depyear; if (depmonth < 10) { depdate = depdate + '-0' + 1*depmonth; } else { depdate = depdate + '-' + 1*depmonth; } if (depday < 10) { depdate = depdate + '-0' + 1*depday; } else { depdate = depdate + '-' + 1*depday; } //alert(depdate); globaldate = '2017-11-01'; globaldate2 = '2017-11-02'; if (globaldate == depdate) { depdate = globaldate2; depday = 2; } arrdate = arryear; if (arrmonth < 10) { arrdate = arrdate + '-0' + 1*arrmonth; } else { arrdate = arrdate + '-' + 1*arrmonth; } if (arrday < 10) { arrdate = arrdate + '-0' + 1*arrday; } else { arrdate = arrdate + '-' + 1*arrday; } if (arrdate < depdate) return true; //minden ok return false; } //******************************************* //INICIALIZÁLÁS setCities(); setArrival('2017-11-19', '30'); setDeparture('2017-11-20', '30');