 /*
  *
  *
  */
 
 var iberooturl='http://ibe01.merlinx.pl/easypax3/agent/7316/szablon1/';
 var basecgurl='http://ibe01.merlinx.pl/';
 var valurl='ep3[]=action%3Dvalidate';
	var ep3_stparam='ep3[]=%3Fst%3DASG';
 var depurl='ep3[]=action%3Ddeplist%26sp%3D4';
 var valprefixurl='/validate/';

 document.imgn=new Object();
 document.imgn['submit']=new Array(1,'/customgraphics/submit/type3.gif');
 document.imgn['back']=new Array(2,'/customgraphics/back/type3.gif');
 document.imgn['listarrow']=new Array(3,'/customgraphics/listarrow/type3.gif');
 document.imgn['calnavleft']=new Array(4,'/customgraphics/calnavleft/type3.gif');
 document.imgn['calnavright']=new Array(5,'/customgraphics/calnavright/type3.gif');
 document.imgn['hotelstar']=new Array(6,'/customgraphics/hotelstar/type5.gif');
 document.imgn['calendar']=new Array(11,'/customgraphics/calendar/type3.gif');
 document.imgn['close']=new Array(8,'/customgraphics/close/type3.gif');
 document.imgn['clear']=new Array(22,'/customgraphics/clear/type3.gif');
 document.imgn['accept']=new Array(21,'/customgraphics/accept/type3.gif');
 document.imgn['help']=new Array(12,'/customgraphics/help/type3.gif');
 document.imgn['book']=new Array(13,'/customgraphics/book/type3.gif');
 document.imgn['tobook']=new Array(14,'/customgraphics/tobook/type3.gif');
 document.imgn['sun']=new Array(15,'/customgraphics/sun/type5.gif');
 document.imgn['water']=new Array(16,'/customgraphics/water/type2.gif');
 document.imgn['listarrowr']=new Array(17,'/customgraphics/listarrowr/type3.gif');
 document.imgn['listarrowd']=new Array(18,'/customgraphics/listarrowd/type3.gif');
 document.imgn['bullet']=new Array(19,'/customgraphics/bullet/type3.gif');
 document.imgn['info']=new Array(20,'/customgraphics/info/type3.gif');
 document.imgn['map']=new Array(23,'/customgraphics/map/type1.gif');
 document.imgn['zoover']=new Array(24,'/customgraphics/zoover/type7.gif');
 document.imgn['list']=new Array(25,'/customgraphics/list/type1.gif');
 document.imgn['bookpay']=new Array(26,'/customgraphics/bookpay/');
 document.imgn['sendrequest']=new Array(27,'/customgraphics/sendrequest/');
 document.imgn['arrows']=new Array(28,'/customgraphics/arrows/');
 document.imgn['hotelstarp']=new Array(29,'/customgraphics/hotelstarp/type5.gif');

 function imgsrc(name)
 {
 return " in='"+name+"' src='http://ibe01.merlinx.pl"+document.imgn[name][1]+"' ";
 }

 function setimgonobj(o,name)
 {
 o.src='http://ibe01.merlinx.pl'+document.imgn[name][1];
 o.setAttribute('in',name);
 }
//setup for JS objects:
 //calender, in ibe.js
 var calHeader = 'Proszę wybrać datę';
 var months = new Array('styczeń','luty','marzec','kwiecień','maj','czerwiec','lipiec',
                          'sierpień','wrzesień','październik','listopad','grudzień');
 var week_days_text = Array('pn','wt','śr','cz','pt','so','nd');
 //dest.class
 var imagespath = '';
 //all steps
 var searchtypeSubmit = '';
 var searchtypeRadio  = '';
 //tooltips, in ibe.js
 var directory="http://ibe01.merlinx.pl/easypax3/agent/7316/szablon1/img/tooltip/green/";
 var tooltip_msg=new Array();

 tooltip_msg['calendar_tooltip1']  =new Array('<b>Okres podróży - najwcześniejszy termin wyjazdu.<br></b>Tutaj określa się najwcześniejszy termin wyjazdu, jaki<br>jest możliwy dla Państwa. Można podać każdą datę.',340,'lt',1);
 tooltip_msg['calendar_tooltip2']  =new Array('<B>Okres podróży - najpóźniejszy termin powrotu.</B><BR>Tutaj określa się najpóźniejszy termin powrotu, jaki<BR>jest możliwy dla Państwa. Można podać każdą datę.',340,'lt',1);
 tooltip_msg['destpanel_tooltip']  =new Array('<b>Miejsce podróży.<br></b> Określ preferowany cel podróży. Jeśli chcesz<br>poszukać we  wszystkich ofertach, wybierz \"dowolny\" albo pozostaw to pole puste.',340,'lt',1);
 tooltip_msg['departure_tooltip']  =new Array('Lista wyjazdu/wylotu po zmianie terminu i wyszukaniu może ulec zmianie.',340,'lt',1);
 tooltip_msg['flightpanel_tooltip']  =new Array('Port lotniczy<br><hr><b>Tutaj można wybrać do 3 portów lotniczych dla Waszej <br />podróży. Proponowane Wam oferty będą zawierały podróże <br />jedynie z tymi portami lotniczymi.</b>',350,'lt',1);
 tooltip_msg['kidsage_tooltip']  =new Array('Proszę podać wiek podróżujących dzieci <br /><b>Dokładny wiek dzieci w chwili wyjazdu <br />jest bardzo ważny dla określenia ceny podróży.</b>',320,'lt',1);
 tooltip_msg['trippacket_tooltip']  =new Array('<b>Wasz Pakiet Podróżny</b><br /><span>Tutaj znajdziecie Państwo zarówno wybrany dla Was Pakiet Podróżny<br />jak i dalsze propozycje mieszczące się w podanym terminie. <br />Poniżej, wybierając loty Tam i Powrót można utworzyć wiele <br />kombinacji lotów dla porónania. Po kliknięciu na wybraną <br />kombinację lotów, właśnie ona zostanie wybrana do zarezerwowania!',345,'lt',1);
 tooltip_msg['combineitself_tooltip']=new Array('Proszę wybrać alternatywny lot tam i z powrotem.<br />System obliczy nową cenę zgodnie z Waszym wyborem.',345,'lt',1);
 tooltip_msg['pricechart_tooltip']=new Array('xxx',345,'lt',1);
 tooltip_msg['attr_tooltip']=new Array('<b>Udogodnienia.</b><br /> Określ preferowane udogodnienia. <br />Jeśli chcesz poszukać we  wszystkich ofertach, pozostaw pola wyboru puste.',345,'lt',1);

 var AnyText='dowolny';
 var WaitText='Prosze czekać';

 function onChangeChildage(_el){
 var stChild = document.getElementById('child1AgeSel');
 var ndChild = document.getElementById('child2AgeSel');
 var rdChild = document.getElementById('child3AgeSel');
 if(_el.value =='')
 {
 if(_el.id=='child3AgeSel')
 return;
 if(_el.id=='child1AgeSel')
 stChild.value = ndChild.value;
 ndChild.value = rdChild.value;
 return rdChild.value = '';
 }
 if(_el.value =='' ||_el.id=='child1AgeSel')
 return;
 if(stChild.value == '')
 {
 stChild.value = _el.value;
 return _el.value='';
 }
 if(ndChild.value == '')
 {
 ndChild.value = _el.value;
 return _el.value='';
 }
 }

 function onClikMoreCriteria(_el){
 document.getElementById('moreCriteria').style.display = '';
 if (document.getElementById('moreAttributes') && document.searchtypeRadio != 'RR' && document.searchtypeRadio != 'NF')
 document.getElementById('moreAttributes').style.display = '';
 document.getElementById('lessCriteriaLink').style.display = '';
 _el.style.display = 'none';
 Cookies.set('ep3_fulsearchform',1,600);
 showHideCallPopups();
 }

 function onClikLessCriteria(_el){
 document.getElementById('moreCriteria').style.display = 'none';
 if (document.getElementById('moreAttributes'))
 document.getElementById('moreAttributes').style.display = 'none';
 document.getElementById('moreCriteriaLink').style.display = '';
 _el.style.display = 'none';
 Cookies.set('ep3_fulsearchform',0,600);
 showHideCallPopups();
 }

 function showHideCallPopups(){
 }

 function ep3_registerOver(tagName){
 tagName = tagName.toUpperCase();
 var els = document.getElementsByTagName(tagName);
 var atr = null;
 for(var i=0; i<els.length; i++)
 {
 atr = els[i].getAttribute('ep3_mouseover');
 if(atr){
 atr = atr.split('@');
 if(atr.length == 1){
 atr[1] = atr[0];
 atr[0] = els[i].className;
 }
 els[i].setAttribute('ep3_mouseout', els[i].className);
 els[i].setAttribute('ep3_mouseover', els[i].className.replace(atr[0], atr[1]) );
 els[i].onmouseover = function (){
 this.className=this.getAttribute('ep3_mouseover');
 };
 els[i].onmouseout  = function(){
 this.className=this.getAttribute('ep3_mouseout');
 };
 }
 }
 }

 var ep3_fakeElement = document.createElement('div');

 function byID(id){
 return document.getElementById(id)||ep3_fakeElement;
 }

 function showVByID(id){
 byID(id).style.visibility = '';
 }

 function hideVByID(id){
 byID(id).style.visibility = 'hidden';
 }

 function showByID(id){
 byID(id).style.display = '';
 }

 function hideByID(id){
 byID(id).style.display = 'none';
 }

 var __ifr;

function calendarShow(_curr_date, _target, _direction, _from_date, _till_date)
{
calendarHide();
 direction = _direction;
 if(direction=='go')
 calendar=document.getElementById('calendar_div');
 if(direction=='back')
 calendar=document.getElementById('calendar_div2');
 if(!calendar)
 return;
 calendar.parentNode.style.position = 'relative';
 calendar.style.display = '';
 var pos = findPos(calendar.parentNode);
 if(getpageWidth()< pos[0]+355)
 calendar.style.right="0px";
 else
calendar.style.right = null;
 if(_from_date == null)
 {
var offsetedDate = new Date();
 offsetedDate.setDate(offsetedDate.getDate());
 _from_date = '0'+offsetedDate.getDate()+'0'+(offsetedDate.getYear()-100)
 +'0'+(offsetedDate.getMonth()+1);
 }
 date_ctrl = document.getElementById(_target);
 from_date = _from_date;
 till_date = _till_date;
 curr_date = parseDate(_curr_date);
 if (!curr_date)
 curr_date = new Date();

if (curr_date<parseDate(document.getElementById('calInput1').value))
 curr_date=parseDate(document.getElementById('calInput1').value);
 from_date = parseDate(from_date);
 till_date = parseDate(till_date);
 setCalendar();
}

function setCalendar(year, month)
{
var mtable;
 if(!calendar)
 return;
 if (year == null)
 year = curr_date.getFullYear();
 if (month == null)
 month = curr_date.getMonth();
 days[1] = (isLeap(year) ? 29 : 28);
 draw_date = new Date(year, month, 1);
 mtable ='<div class="yui-calcontainer color11bg color1bo" id="ep3_autogencal">';
 mtable += '<div class="title">';
 if(isFromDeeplink)
 {
mtable += '<img '+imgsrc('close')+' onclick="if(calendar) class="close-icon" calendar.style.display=\'none\';" alt="[Close]" />';
 mtable += calHeader;
 }
 else
 {
mtable += calHeader;
 if(direction == 'go')
 {
mtable += '<a href="javascript:void(0)" onclick="return false;"><img '+imgsrc('help')+' class="help-icon" align="absmiddle" style="margin-right:3px;" onmouseover="ep_show(this,'+"'calendar_tooltip1'"+')" onmouseout="ep_hide(this)" /></a>';
 mtable += '<img '+imgsrc('close')+' class="close-icon" onClick="calendarHide();" alt="" align="absmiddle" style="cursor:pointer; margin-right:3px;"/>';
 }
 if(direction == 'back')
 {
mtable += '<img '+imgsrc('close')+' class="close-icon" onClick="calendarHide();" align="absmiddle" alt="" style="cursor:pointer; margin-right:3px;"/>';
 mtable += '<a href="javascript:void(0)" onclick="return false;"><img '+imgsrc('help')+' class="help-icon" style="margin-right:3px;" onmouseover="ep_show(this,'+"'calendar_tooltip2'"+')" onmouseout="ep_hide(this)" align="absmiddle" /></a>';
 }
 }
 mtable += '</div>';
 mtable += '<div style="width:325px; position:relative;"><div class="cal2up" style="margin-left:5px;" >'+getMonthHTML('first')+'</div>';
 mtable += '<div class="cal2up" style="right:5px;position:absolute;">'+getMonthHTML('second')+'</div></div>';
 mtable += '</div>';
 calendar.innerHTML = mtable;
 var myheight = document.getElementById('ep3_autogencal');
 if(myheight && myheight.style.pixelHeight != undefined){
 __ifr = document.getElementById(calendar.id + '_ie')
 if(__ifr){
 __ifr.style.height = Math.max(myheight.offsetHeight*1 - 2, 145)+'px';
 __ifr.style.display='';
 if(calendar.style.right)
 __ifr.style.right="0px";
 else
__ifr.style.right = null;
 }
 }//is IE
}

function calendarHide(){
 if(calendar)
 {
 calendar.parentNode.style.position = 'static';
 calendar.style.display = 'none';
 }
 if(__ifr){
 __ifr.style.display = 'none';
 }
}

function insertDate(year, month, day)
{
if(day<10)
 day = '0'+(day);
 if((month+1)<10)
 month = '0'+(month+1);
 else
 month = month+1;
 date_ctrl.value = day+'.'+month+'.'+(year-2000);
 {
 if(direction == 'go')
 document.getElementById('calInput2').value=incDate2(day+'.'+month+'.'+year,20);
 }
 calendarHide();
}

function getMonthHTML(number)
{ var year = draw_date.getFullYear();
 var month = draw_date.getMonth();
 var day = 1;
 var d = draw_date.getDay()-1;
 if (d == -1)
 d = 6;
 var active = 0;
 var tmp = '';
 var bgr = '';
 result  = '<table class="yui-calendar" cellpadding="0" cellspacing="0" border="0" width="100%" align="center" style="margin-top:3px;margin-bottom:3px;">';
 result += '<thead>';
 result += '<tr><th colspan="7" class="calhead"><div class="calheader">';
 if(number=='first')
 result += '<img '+imgsrc('calnavleft')+' class="calnavleft" style="margin:1px" align="absbottom" onclick="changeMonth(0)" alt="'+prev_mon_text+'"/>';
 result += months[month]+'&nbsp;'+year;
 if(number=='second')
 result += '<img '+imgsrc('calnavright')+' class="calnavright" style="margin:1px" align="absbottom" onclick="changeMonth(1)" alt="'+next_mon_text+'"/>';
 result += '</div></th>';
 result += '</tr>';
 result += '<tr>';
 for(var i =0; i<6; i++)
 result += '<th class="calweekdaycell">'+week_days_text[i]+'</th>';

result += '<th class="calweekdaycell">'+week_days_text[6]+'</th>';
 result += '</tr></thead><tbody>';
 for (var i = 0; i < 7 && day <= days[month]; i++)
 { for (var j = 0; j < 7; j++)
 { if ((i == 0 && j < d) || (day > days[month]))
 { tmp += getDayHTML(year, month, 0, 'oom calcell', 0);
 }
 else
 { active = 1;
 if (!week_days[(j == 6) ? 0 : j+1])
 { active = 0;
 }
 else
 { //if (from_date && draw_date.getTime() < from_date.getTime())
 //  active = 0;
 //if (till_date && draw_date.getTime() > till_date.getTime())
 //  active = 0;
 }
 if (active)
 bgr = (j == 6 ? 'calcell' : 'calcell');
 else
 bgr = 'oom calcell';
 tmp += getDayHTML(year, month, day, bgr, active);
 draw_date.setDate(++day);
 }
 }
 result += '<tr align="center">'+tmp+'</tr>';
 tmp = '';
 }
 result += '</tbody></table>';
 return result;
}

function ep3_getSearchType(){
 return  document.getElementById('searchtype')?document.getElementById('searchtype').value:'PA';
}

function fieldsPA()
 {
document.searchtypeRadio = "PA";
 if(typeof(ep3_current_step) == 'undefined')
 ep3_current_step = 1;
 loadDes("PA",document.getElementById('tripduration_search').value);
 if(ep3_current_step ==1){
 byID("category_search").disabled = false;
 byID("maint_search").disabled = false;
 byID("tourop_search").disabled = false;
 byID("hotelname_search").disabled = false;
 byID("hotelsite_search").disabled = false;
 byID("depCode").disabled = false;
 byID("transs").disabled = false;
 }else{
 byID("transs").disabled = false;
 showByID('trans');
 showByID('transLabel');
 showByID('depCodeRow');
 showByID('depCodeLabel');
 byID('destLabel').style.className = 'labelrow';
 }
 //enable attributes
 if (byID("optlist"))
 byID("optlist").style.display = '';
 if (byID("moreCriteria").style.display == '')
 byID("moreAttributes").style.display = '';
 ess_loadDur('PA');
 }
function fieldsRR()
 {
document.searchtypeRadio = "RR";
 if(typeof(ep3_current_step) == 'undefined')
 ep3_current_step = 1;
 loadDes("RR",document.getElementById('tripduration_search').value);
 if(ep3_current_step ==1){
 byID("category_search").disabled = false;
 byID("maint_search").disabled = false;
 byID("tourop_search").disabled = false;
 byID("hotelname_search").disabled = false;
 byID("hotelsite_search").disabled = false;
 byID("depCode").disabled = false;
 byID("transs").disabled = false;
 }else{
 byID("transs").disabled = false;
 showByID('trans');
 showByID('transLabel');
 showByID('depCodeRow');
 showByID('depCodeLabel');
 byID('destLabel').style.className = 'labelrow';
 }
 if (byID("optlist"))
 byID("optlist").style.display = 'none';
 if (document.optlistpopup)
 document.optlistpopup.hide();
 if (byID("moreAttributes"))
 byID("moreAttributes").style.display = 'none';
 clearOpt();

ess_loadDur('RR');
 }
 function fieldsNF()
 { document.searchtypeRadio = "NF";
 loadDes("NF",document.getElementById('tripduration_search').value);
 byID("transs").disabled = true;
 byID("maint_search").disabled = true;
 byID("tourop_search").disabled = false;
 byID("hotelname_search").disabled = true;
 byID("hotelsite_search").disabled = true;
 byID("depCode").disabled = false;
 //enable attributes
 byID("transs").value = 'F';
 byID("transs").disabled = true;
 byID("optlist").style.display = 'none';
 byID("moreAttributes").style.display = 'none';
 if (document.optlistpopup)
 document.optlistpopup.hide();
 clearOpt();
 //if (byID("moreCriteria").style.display == '')
 //  byID("moreAttributes").style.display = '';
 ess_loadDur('NF');
 document.getElementById("transs").onchange();
 }  function fieldsNH()
 { document.searchtypeRadio = "NH";
 loadDes("NH",document.getElementById('tripduration_search').value);
 if(typeof(ep3_current_step) == 'undefined')
 ep3_current_step = 1;
 if(ep3_current_step ==1){
 byID("transs").disabled = true;
 byID("maint_search").disabled = false;
 byID("tourop_search").disabled = false;
 byID("hotelname_search").disabled = false;
 byID("hotelsite_search").disabled = false;
 byID("depCode").disabled = true;
 }else{
 byID("transs").disabled = true;
 hideByID('trans');
 hideByID('transLabel');
 hideByID('depCodeRow');
 hideByID('depCodeLabel');
 byID('destLabel').style.className = byID('depCodeLabel').style.className || '';
 }
 //enable attributes
 if (byID("optlist"))
 byID("optlist").style.display = '';
 if (byID("moreCriteria").style.display == '')
 byID("moreAttributes").style.display = '';
 ess_loadDur('NH');
 }
 function fieldsCR()
 {
document.searchtypeRadio = "CR";
 if(typeof(ep3_current_step) == 'undefined')
 ep3_current_step = 1;
 loadDes("CR",document.getElementById('tripduration_search').value);
 if(ep3_current_step ==1){
 byID("category_search").disabled = false;
 byID("maint_search").disabled = false;
 byID("tourop_search").disabled = false;
 byID("hotelname_search").disabled = false;
 byID("hotelsite_search").disabled = false;
 byID("depCode").disabled = false;
 byID("transs").disabled = false;
 }else{
 byID("transs").disabled = false;
 showByID('trans');
 showByID('transLabel');
 showByID('depCodeRow');
 showByID('depCodeLabel');
 byID('destLabel').style.className = 'labelrow';
 }
 byID("optlist").style.display = '';
 ess_loadDur('CR');
 }

function showKidsAge(value)
 {
 }

function wizardsubmit()
	{
  document.searchtypeSubmit = document.searchtypeRadio;
  document.getElementById("searchtype").value = document.searchtypeSubmit;
  document.getElementById("step").value = '2';
 if (document.getElementById('desCode').value.length != '')
 {  if (document.getElementById('desCode').value.match(/\:/))
 {
 document.getElementById("DestinationReg").value = document.getElementById('desCode').value;
 document.getElementById("step").value = '2';
 }
 else
 {
 document.getElementById("DestinationReg").value = '';
 document.getElementById("step").value = '3';
 }
 }
 disableOpt(true);
 var url=ep3_getSearchURL();
 disableOpt(false);
 var gateparamname='ep3';
 if (gateparamname!=null)
 {
 ourl = document.URL.replace(/#.*/,'').replace(/\+/g, ' ').split('&');
 var nurl=Array();
 if(typeof(ourl[0]) != "undefined"){
 if(ourl[0].indexOf('?')>=0)
 nurl.push(document.URL.replace(/\?.*$/,''));
 ourl[0] = ourl[0].replace(/^[^\?]*\?/,'');
 }
 for (var i=0;i<ourl.length;i++)
 {
 if (ourl[i].split('=').shift()!=gateparamname+'[]')
 nurl.push(ourl[i]);
 }  nurl.push(gateparamname+'[]='+escape('?'+url.join('&')));  if ((nurl.length<3) && (nurl[0].substring(nurl[0].length-1)!='?'))  {
 window.location=nurl.join('?')+(typeof(ep3_gate_sf_param)!='undefined'?'&'+ep3_gate_sf_param:'');
 }else{
 if(nurl[0].substring(nurl[0].length-1)!='?')
 nurl[0] += '?';
 window.location=nurl.join('&')+(typeof(ep3_gate_sf_param)!='undefined'?'&'+ep3_gate_sf_param:'');
 }
 }
 else
 {
 try{
 window.location.href='?'+url.join('&')+(typeof(ep3_gate_sf_param)!='undefined'?+'&'+ep3_gate_sf_param:'');  }
 catch(e){
//  window.document.forms['form_params'].submit();
 }
 }
 }

//another settings
 //departure & destination lists
 //destination array
 var deplistArr = [];
 function ess_makedep()
 {
   }

 function isDefined(o){
     return typeof(o)!='undefined';
 }

 var ep3_alltransport_list = [];
 var ep3_airports_list = [["","dowolny"],["0x4265726c696e","Berlin"],["0x427964676f737a637a","Bydgoszcz"],["0x476461c584736b","Gda\u0144sk"],["0x4b61746f77696365","Katowice"],["0x4b72616bc3b377","Krak\u00f3w"],["0xc581c3b364c5ba","\u0141\u00f3d\u017a"],["0x506f7a6e61c584","Pozna\u0144"],["0x527a65737ac3b377","Rzesz\u00f3w"],["0x537a637a6563696e","Szczecin"],["0x576172737a617761","Warszawa"],["0x57726f63c5826177","Wroc\u0142aw"]];
 var ep3_bus_list = [["","dowolny"],["0x416e6472796368c3b377","Andrych\u00f3w"],["0x4269656c736b6f202d20426961c58261","Bielsko - Bia\u0142a"],["0x426f63686e6961","Bochnia"],["0x426f6c6573c5826177696563","Boles\u0142awiec"],["0x42727a6567","Brzeg"],["0x42727a65736b6f","Brzesko"],["0x427964676f737a637a","Bydgoszcz"],["0x4279746f6d","Bytom"],["0x43686f727ac3b377","Chorz\u00f3w"],["0x4368727a616ec3b377","Chrzan\u00f3w"],["0x436965737a796e","Cieszyn"],["0x437a6563686f77696365202d20447a6965647a696365","Czechowice - Dziedzice"],["0x437a6563686f77696365","Czechowice"],["0x437ac49973746f63686f7761","Cz\u0119stochowa"],["0x44c49962696361","D\u0119bica"],["0x476461c584736b","Gda\u0144sk"],["0x4764796e6961","Gdynia"],["0x476c6977696365","Gliwice"],["0x47726f647a69736b204d617a6f776965636b69","Grodzisk Mazowiecki"],["0x4a6162c5826f6e6b61","Jab\u0142onka"],["0x4a617374727ac499626965205a6472c3b36a","Jastrz\u0119bie Zdr\u00f3j"],["0x4a61776f726e696b","Jawornik"],["0x4ac49964727a7963686f77696365","J\u0119drzychowice"],["0x4b616c7761726961","Kalwaria"],["0x4b61746f77696365","Katowice"],["0x4bc4857479,0x4bc4997479","K\u0105ty"],["0x4bc499647a6965727a796e202d204b6fc5ba6c65","K\u0119dzierzyn - Ko\u017ale"],["0x4b69656c6365","Kielce"],["0x4b6f737a616c696e","Koszalin"],["0x4b72616bc3b377","Krak\u00f3w"],["0x4c65676e696361","Legnica"],["0x4c656c756368c3b377","Leluch\u00f3w"],["0x4c65737a6e6f","Leszno"],["0x4c75626c696e","Lublin"],["0xc581c3b364c5ba","\u0141\u00f3d\u017a"],["0x4e6f77792053c485637a","Nowy S\u0105cz"],["0x4f706f6c65","Opole"],["0x4fc59b7769c49963696d","O\u015bwi\u0119cim"],["0x50696f74726bc3b3772054727962756e616c736b69","Piotrk\u00f3w Trybunalski"],["0x506f7a6e61c584","Pozna\u0144"],["0x50737a637a796e61","Pszczyna"],["0x5075c582617779","Pu\u0142awy"],["0x5261636962c3b3727a","Racib\u00f3rz"],["0x5261646f6d","Radom"],["0x5279626e696b","Rybnik"],["0x527a65737ac3b377","Rzesz\u00f3w"],["0x536965776965727a","Siewierz"],["0x536b6172c5bc79736b6f202d204b616d69656e6e61","Skar\u017cysko - Kamienna"],["0x536b6f637ac3b377","Skocz\u00f3w"],["0x53c5827570736b","S\u0142upsk"],["0x5374727a656c6365204f706f6c736b6965","Strzelce Opolskie"],["0x537a637a6563696e","Szczecin"],["0x5461726e6f62727a6567","Tarnobrzeg"],["0x5461726ec3b377","Tarn\u00f3w"],["0x546f7275c584","Toru\u0144"],["0x5479636879","Tychy"],["0x5761646f77696365","Wadowice"],["0x576172737a617761","Warszawa"],["0x57c5826f63c5826177656b","W\u0142oc\u0142awek"],["0x576f647a6973c582617720c59a6cc485736b69","Wodzis\u0142aw \u015al\u0105ski"],["0x57726f63c5826177","Wroc\u0142aw"],["0x5a61626f726e6961","Zabornia"],["0x5a6162727a65","Zabrze"],["0xc5bb6f7279","\u017bory"],["0xc5bb7977696563","\u017bywiec"]];
 var ep3_trans_field = null;

 function onChangeTrans(el, SelectDepCode){
     if(typeof(ep3_searchform) == 'undefined')
     return;
      if(ep3_trans_field == null)
     {
     //first run - get list of all departures from select field
     ep3_trans_field = document.getElementById('depCode');
     if (ep3_trans_field)
     {
     for (var i=0; i < ep3_trans_field.options.length; i++)
     ep3_alltransport_list[ep3_alltransport_list.length] = [ep3_trans_field.options[i].value , ep3_trans_field.options[i].innerHTML];
     }
     }
     if (!ep3_trans_field)
     return false;
     //var ep3_trans_selected_text = ep3_trans_field.options[ep3_trans_field.selectedIndex].text;
     ep3_trans_field.options.length = 0;
     if (el.value =='F'){
        for (var i=0; i < ep3_airports_list.length; i++)
        ep3_trans_field.options[i] = new Option(ep3_airports_list[i][1],ep3_airports_list[i][0]);
     }
     else if(el.value =='B')
     {
     for (var i=0; i < ep3_bus_list.length; i++)
     ep3_trans_field.options[i] = new Option(ep3_bus_list[i][1],ep3_bus_list[i][0]);
     }
     else
     {
     for (var i=0; i < ep3_alltransport_list.length; i++)
     ep3_trans_field.options[i] = new Option(ep3_alltransport_list[i][1],ep3_alltransport_list[i][0]);
     }
     // set previous option
     for (var i=0; i < ep3_trans_field.options.length; i++)
     {
     if (SelectDepCode)
     {
     if (ep3_trans_field.options[i].value == SelectDepCode)
     ep3_trans_field.selectedIndex = i;
     }
     else
     {
     //if (ep3_trans_field.options[i].text == ep3_trans_selected_text)
     //  ep3_trans_field.selectedIndex = i;
     }
     }
      return true;
 }
 function onLoad()
{
}  var desArr = [['Albania',[['3269:','Albania'],['3269_4276','Wyc. Objazdowe',36]],36],
['Algieria',[['4599:','Algieria'],['4599_4276','Wyc. Objazdowe',36]],36],
['Andora',[['448:,1640','Andora'],['448_4187,1641','Vallnord',24610]],24610],
['Argentyna',[['2285:','Argentyna'],['2285_4276','Wyc. Objazdowe',32804]],32804],
['Armenia',[['3443:','Armenia'],['3443_4276','Wyc. Objazdowe',32804]],32804],
['Australia',[['411:','Australia'],['411_4276','Wyc. Objazdowe',37]],37],
['Austria',[['1:,479','Austria'],['1_2318','Dolna Austria',34],['1_2292,481','Górna Austria',16418],['1_950,482','Karyntia',24610],['1_2320,484','Styria',16418],['1_1208','Tyrol',8227],['1_187','Wieden',4134],['1_4026,483','Ziemia Salzburska',16419]],28711],
['Azerbejdżan',[['3912:','Azerbejdżan'],['3912_4276','Wyc. Objazdowe',36]],36],
['Bahamy',[['3018:','Bahamy'],['3018_4260','New Providence',8225]],8225],
['Belgia',[['285:','Belgia'],['285_4276','Wyc. Objazdowe',36]],36],
['Bhutan',[['3488:','Bhutan'],['3488_4276','Wyc. Objazdowe',32804]],32804],
['Biegun Połnocny',[['3489:','Biegun Połnocny'],['3489_4276','Wyc. Objazdowe',36]],36],
['Botswana',[['3025:','Botswana'],['3025_4276','Wyc. Objazdowe',32804]],32804],
['Bośnia I Hercegowina',[['2853:','Bośnia I Hercegowina'],['2853_122','Neum',8227]],8227],
['Brazylia',[['47:','Brazylia'],['47_3404','Bahia',40993],['47_2969','Rio De Janeiro',45089],['47_2519','Sao Paulo',45089],['47_4276','Wyc. Objazdowe',32804]],45093],
['Bułgaria',[['3:','Bułgaria'],['3_200','Słoneczny Brzeg',12331],['3_4276','Wyc. Objazdowe',36],['3_1809','Złote Piaski',8235]],12335],
['Chile',[['2499:','Chile'],['2499_4276','Wyc. Objazdowe',32804]],32804],
['Chiny',[['197:','Chiny'],['197_2554','Hong Kong',45089],['197_4276','Wyc. Objazdowe',32805]],45093],
['Chorwacja',[['5:','Chorwacja'],['5_1716','Chorwacja Środkowa',34],['5_1749','Dalmacja Południowa',12323],['5_1748','Dalmacja Północna',8227],['5_65','Istria',8226],['5_92','Kvarner',8227],['5_3411','Mala Kapela',36],['5_4276','Wyc. Objazdowe',36],['5_1538','Wyspa Brac',8227],['5_1210','Wyspa Hvar',8227],['5_1235','Wyspa Korcula',8227],['5_1212','Wyspa Krk',8226],['5_1539','Wyspa Murter',8227],['5_1213','Wyspa Pag',8227],['5_1247','Wyspa Rab',8226],['5_1682','Wyspa Ugljan',8226],['5_1861','Wyspa Vis',8226]],12327],
['Cypr',[['6:','Cypr'],['6_17','Ayia Napa',8225],['6_95','Larnaka',8233],['6_100','Limassol',8225],['6_127','Paphos',8225],['6_4276','Wyc. Objazdowe',36]],8237],
['Czarnogora',[['8:','Czarnogora'],['8_1499','Riwiera Czarnogorska',8227]],8227],
['Czechy',[['9:,409','Czechy'],['9_2741','Czechy Południowe',34],['9_1717','Czechy Środkowe',34],['9_3985','Czeska Szwajcaria',34],['9_3600,1097','Czeskie Karkonosze',16419],['1100','Góry Izerskie',16418],['9_3989,1099','Jeseniki',16418],['9_3973','Karlove Vary',34],['9_2972','Morawy',34],['9_2197','Praga',4135],['9_3000,1098','Szumawy',16418],['9_4276','Wyc. Objazdowe',36]],20519],
['Dania',[['56:','Dania'],['56_4450','Dania Południowa',34],['56_4452','Zelandia',34],['56_3653','Środkowa Jutlandia',34]],34],
['Dominikana',[['10:','Dominikana'],['10_4106','Altagracia',40993],['10_144','Puerto Plata',40993],['10_145','Punta Cana',40993],['10_2893','Samana',40993],['10_1424','Santo Domingo',40993],['10_4276','Wyc. Objazdowe',32804]],40997],
['Egipt',[['11:','Egipt'],['11_64','Hurghada',8237],['11_2323','Marsa Alam',8233],['11_154','Sharm El Sheikh',8237],['11_5692','Sharm El Sheikh ',8225],['11_203','Taba',8225],['11_4276','Wyc. Objazdowe',8229]],8237],
['Ekwador',[['3295:','Ekwador'],['3295_4276','Wyc. Objazdowe',32804]],32804],
['Emiraty Arabskie',[['372:','Emiraty Arabskie'],['372_1','Abu Dhabi',8225],['372_2279','Dubaj',12321],['372_2160','Fujairah',8225],['372_2170','Ras Al Khaimah',8225],['372_2528','Sharjah',8225],['372_4276','Wyc. Objazdowe',37]],12325],
['Etiopia',[['412:','Etiopia'],['412_4276','Wyc. Objazdowe',32804]],32804],
['Fiji',[['3292:','Fiji'],['3292_4593','Dystrykt Północny',40993],['3292_4592','Dystrykt Zachodni',40993]],40993],
['Filipiny',[['2603:','Filipiny'],['2603_4531','Luzon',40997],['2603_4132','Visayas',40993]],40997],
['Francja',[['13:,777','Francja'],['13_1447','Alpy Francuskie',8227],['781','Alpy Południowe',16418],['779','Górna Sabaudia',16419],['780','Isere',16419],['13_2066','Lazurowe Wybrzeże',12323],['13_3380','Nicea',36],['13_1799','Paryż',4135],['13_1718','Riwiera Śródziem. & Korsyka',8226],['778','Sabaudia',16419],['13_4276','Wyc. Objazdowe',36]],28711],
['Grecja',[['14:','Grecja'],['14_1448','Ateny',36],['14_3344','Attyka',12327],['14_1324','Chalkidiki',8227],['14_2302','Evia',8225],['14_4388','Grecja Środkowa',8226],['14_83','Korfu',8237],['14_84','Kos',8233],['14_89','Kreta',8233],['14_4382','Kreta - Heraklion',8225],['14_1493','Peloponez',8226],['14_149','Riwiera Olimpijska',8239],['14_150','Rodos',8233],['14_152','Saloniki',8235],['14_2627','Santorini',8225],['14_177','Thassos',8225],['14_4276','Wyc. Objazdowe',37],['14_1066','Zakynthos',8233]],12335],
['Grenlandia',[['4473:','Grenlandia'],['4473_4276','Wyc. Objazdowe',36]],36],
['Gruzja',[['4219:','Gruzja'],['4219_4276','Wyc. Objazdowe',36]],36],
['Gwatemala',[['3329:','Gwatemala'],['3329_4276','Wyc. Objazdowe',32804]],32804],
['Hiszpania',[['15:','Hiszpania'],['15_1474','Barcelona',12327],['15_4281','Costa Almeria',8225],['15_2436','Costa Azahar',8226],['15_2063','Costa Blanca',8226],['15_39','Costa Brava',8235],['15_2443','Costa Calida',8226],['15_1139','Costa De La Luz',8225],['15_40','Costa Del Sol',8233],['15_2438','Costa Dorado',8226],['15_50','Fuerteventura',8233],['15_2623','Gomera',8225],['15_55','Gran Canaria',8233],['15_2624','Ibiza',8233],['15_93','Lanzarote',8233],['15_1492','Madryt',4135],['15_105','Majorka',8233],['15_3700','Minorka',8225],['15_176','Teneryfa',8233],['15_4276','Wyc. Objazdowe',4133]],12335],
['Holandia',[['284:','Holandia'],['284_1451','Amsterdam',36]],36],
['Indie',[['243:','Indie'],['243_4108','Bombaj',40993],['243_4109','Delhi',32801],['243_2541','Goa',41001],['243_3655','Kovalam',40993],['243_4276','Wyc. Objazdowe',32805]],41005],
['Indochiny',[['3290:','Indochiny'],['3290_4276','Wyc. Objazdowe',32804]],32804],
['Indonezja',[['413:','Indonezja'],['413_20','Bali',40993],['413_4276','Wyc. Objazdowe',32805]],40997],
['Irlandia',[['291:','Irlandia'],['291_1496','Dublin',4132],['291_4276','Wyc. Objazdowe',36]],4132],
['Islandia',[['286:','Islandia'],['286_4276','Wyc. Objazdowe',36]],36],
['Izrael',[['54:','Izrael'],['54_2313','Morze Martwe',8225],['54_4276','Wyc. Objazdowe',36]],8229],
['Jamajka',[['18:','Jamajka'],['18_4126','Discovery Bay',40993],['18_119','Montego Bay',40993],['18_724','Negril',40993]],40993],
['Japonia',[['248:','Japonia'],['248_4276','Wyc. Objazdowe',32805]],32805],
['Jordania',[['55:','Jordania'],['55_2313','Morze Martwe',8225],['55_4276','Wyc. Objazdowe',36],['55_4180','Zatoka Akaba',8225]],8229],
['Kanada',[['414:','Kanada'],['414_4276','Wyc. Objazdowe',36]],36],
['Karaiby',[['3022:','Karaiby'],['3022_3129','Antigua',40993],['3022_2144','Aruba',40993],['3022_3114','Barbados',40993],['3022_3117','Curacao',40993],['3022_3121','St. Lucia',40993]],40993],
['Kazachstan',[['3248:','Kazachstan'],['3248_4276','Wyc. Objazdowe',32804]],32804],
['Kenia',[['19:','Kenia'],['19_116','Mombasa',40993],['19_4276','Wyc. Objazdowe',32804]],40997],
['Korea Południowa',[['3291:','Korea Południowa'],['3291_4122','Czedżu',40993],['3291_4123','Incheon',40993],['3291_4124','Kjongsangpuk-do',32801],['3291_4125','Pusan',40993],['3291_3328','Seul',32801],['3291_4276','Wyc. Objazdowe',32804]],40997],
['Kostaryka',[['416:','Kostaryka'],['416_2954','Guanacaste',40993],['416_4136','Puntarenas',40993],['416_2834','San Jose',32801],['416_4276','Wyc. Objazdowe',32804]],40997],
['Kuba',[['21:','Kuba'],['21_4117','Ciego De Avila',40993],['21_2065','Hawana',45089],['21_5694','Hawana ',40993],['21_3941','Holguin',40993],['21_4412','Jardines Del Rey',32801],['21_182','Varadero',40993],['21_4276','Wyc. Objazdowe',32805]],45093],
['Laos',[['52:','Laos'],['52_4276','Wyc. Objazdowe',36]],36],
['Liban',[['3911:','Liban'],['3911_4276','Wyc. Objazdowe',36]],36],
['Litwa',[['22:','Litwa'],['22_4276','Wyc. Objazdowe',37]],37],
['Madagaskar',[['2607:','Madagaskar'],['2607_4276','Wyc. Objazdowe',32804]],32804],
['Malawi',[['3225:','Malawi'],['3225_4276','Wyc. Objazdowe',32804]],32804],
['Malediwy',[['24:','Malediwy'],['24_4615','Addu Atol',40993],['24_5698','Ari Atol',40993],['24_5707','Baa Atol',40993],['24_5706','Lhaviyani Atol',40993],['24_5697','Male Atol',40993],['24_5711','Raa Atol',40993]],40993],
['Malezja',[['2599:','Malezja'],['2599_3297','Borneo',40993],['2599_4583','Półwysep Malajski',40993],['2599_4276','Wyc. Objazdowe',32805]],40997],
['Mali',[['3444:','Mali'],['3444_4276','Wyc. Objazdowe',36]],36],
['Malta',[['26:','Malta'],['26_4103','Wyspa Gozo',8225],['26_4100','Wyspa Malta',8233]],8233],
['Maroko',[['27:','Maroko'],['27_2','Agadir',8237],['27_4232','Marrakesz',12321],['27_4589','Saidia',33],['27_4276','Wyc. Objazdowe',37]],12333],
['Mauritius',[['28:','Mauritius'],['28_205','Wybrzeże Południowe',40993],['28_1304','Wybrzeże Północne',40993]],40993],
['Meksyk',[['29:','Meksyk'],['29_2507','Acapulco',40993],['29_31','Cancun',40993],['29_727','Playa Del Carmen',40993],['29_4276','Wyc. Objazdowe',32805]],40997],
['Mongolia',[['3441:','Mongolia'],['3441_4276','Wyc. Objazdowe',32804]],32804],
['Mozambik',[['3247:','Mozambik'],['3247_4276','Wyc. Objazdowe',32804]],32804],
['Namibia',[['2602:','Namibia'],['2602_4276','Wyc. Objazdowe',32804]],32804],
['Nepal',[['3028:','Nepal'],['3028_4276','Wyc. Objazdowe',36]],36],
['Niemcy',[['58:','Niemcy'],['58_3577','Baden',34],['58_3343','Bawaria',34],['58_1402','Berlin',4134],['58_3390','Brandenburgia',34],['58_4014','Meklemburgia',34],['58_3412','Saksonia',34],['58_3648','Tropical Islands',34]],4134],
['Norwegia',[['2391:','Norwegia'],['2391_3484','Oslo',36],['2391_4276','Wyc. Objazdowe',36]],36],
['Nowa Zelandia',[['417:','Nowa Zelandia'],['417_4276','Wyc. Objazdowe',32805]],32805],
['Oman',[['4534:','Oman'],['4534_4584','Maskat',8225],['4534_4585','Musandam',33]],8225],
['Panama',[['2500:','Panama'],['2500_4151','Panama Południowa',40993],['2500_4150','Panama Północna',40993]],40993],
['Peru',[['244:','Peru'],['244_4276','Wyc. Objazdowe',32804]],32804],
['Polinezja Francuska',[['2988:','Polinezja Francuska'],['2988_3377','Bora Bora',40993],['2988_4137','Moorea-maiao',40993],['2988_3332','Tahiti',40993]],40993],
['Polska',[['59:,1030','Polska'],['59_2442','Beskidy',34],['59_3785,1033','Bieszczady',16418],['59_4333','Jura Krk-cze',34],['59_2618','Kujawy',34],['59_4610','Lubelskie',34],['59_2626','Małopolska',34],['59_2855,1034','Pieniny',16418],['59_615','Pomorze',8226],['59_3808','Pomorze Zachodnie',8226],['59_3781,1035','Sudety',16418],['59_2695,1036','Tatry',16418],['59_3032','Warmia I Mazury',34]],24610],
['Portugalia',[['31:','Portugalia'],['31_1321','Algarve',8235],['31_3291','Azory',8225],['31_1491','Lizbona',12325],['31_1776','Madera',8233],['31_4473','Porto Santo',8225],['31_2653','Wybrzeże Lizbońskie',8225],['31_4276','Wyc. Objazdowe',37]],12335],
['Puerto Rico',[['776:','Puerto Rico'],['776_4317','San Juan',40993]],40993],
['Rejsy',[['3693:','Rejsy'],['3693_4520','Europa Zachodnia',36],['3693_4595','Europa Środkowa',36],['3693_49','Francja',36],['3693_4487','Holandia',36],['3693_2345','Karaiby',37],['3693_3066','Karaiby Zachodnie',33],['3693_3010','Morze Śródziemne',36],['3693_951','Rosja',36]],37],
['Republika Południowej Afryki',[['2598:','Republika Południowej Afryki'],['2598_2736','Park Narodowy Krugera',32804],['2598_4276','Wyc. Objazdowe',32804]],32804],
['Reunion',[['2501:','Reunion'],['2501_2506','Reunion',40993]],40993],
['Rosja',[['67:','Rosja'],['67_4110','Moskwa',4129],['67_3783','Sankt Petersburg',12325],['67_4276','Wyc. Objazdowe',36]],12325],
['Serbia',[['3414:','Serbia'],['3414_4276','Wyc. Objazdowe',36]],36],
['Seszele',[['2925:','Seszele'],['2925_4135','Wyspa La Digue',40993],['2925_4130','Wyspa Mahe',40993],['2925_4133','Wyspa Praslin',40993],['2925_4131','Wyspa Silhouette',40993]],40993],
['Singapur',[['34:','Singapur'],['34_3085','Singapur',45089]],45089],
['Sri Lanka',[['36:','Sri Lanka'],['36_4105','Południowa Prowincja',40997],['36_4276','Wyc. Objazdowe',32805],['36_4104','Zachodnia Prowincja',41005]],41005],
['Stany Zjednoczone',[['3629:','Stany Zjednoczone'],['3629_2731','Floryda',8225],['3629_2732','Hawaje',8225],['3629_2546','Nowy Jork',36],['3629_4276','Wyc. Objazdowe',37]],8229],
['Syria',[['3023:','Syria'],['3023_4276','Wyc. Objazdowe',32804]],32804],
['Szwajcaria',[['62:,327','Szwajcaria'],['62_4183,342','Berneński Oberland',16418],['62_1201,329','Gryzonia',16418],['62_4186,330','Ticino',16418],['62_1102,328','Wallis',16418],['62_4276','Wyc. Objazdowe',36]],16422],
['Szwecja',[['2991:','Szwecja'],['2991_3486','Sztokholm',36]],36],
['Słowacja',[['428:,990','Słowacja'],['428_4023','Beskidy Słowackie',34],['428_1857','Bratysława',4130],['428_4231','Centralna Słowacja',34],['428_4289,991','Jaworniky',16418],['428_3456','Kotlina Liptowska',34],['428_4028,996','Mała Fatra',16418],['428_4235','Naddunajska Dolina',34],['428_1084,993','Niskie Tatry',16418],['428_4228','Orawa',34],['428_3450,1022','Słowacki Raj',16418],['428_3339','Trnawa',34],['428_3334,995','Wielka Fatra',16418],['428_4276','Wyc. Objazdowe',36],['428_1104,994','Wysokie Tatry',16418]],20518],
['Słowenia',[['263:,1629','Słowenia'],['263_3492,1660','Alpy Słoweńskie',16418],['263_1859','Riwiera Słoweńska',8226],['263_2459','Słowenia Środkowa',34]],24610],
['Tajlandia',[['49:','Tajlandia'],['49_21','Bangkok',45089],['49_80','Khao Lak',40993],['49_2503','Koh Chang',40993],['49_3036','Koh Samui',40993],['49_3037','Krabi',40993],['49_1316','Pattaya',40993],['49_3385','Phi Phi Island',40993],['49_131','Phuket',40993],['49_4276','Wyc. Objazdowe',32805]],45093],
['Tanzania',[['2989:','Tanzania'],['2989_4276','Wyc. Objazdowe',32805],['2989_2910','Zanzibar',40993]],40997],
['Tunezja',[['38:','Tunezja'],['38_45','Djerba',8225],['38_57','Hammamet',8225],['38_104','Mahdia',8225],['38_117','Monastir',8233],['38_135','Port El Kantaoui',8225],['38_168','Sousse',8225],['38_969','Tunezja',40],['38_179','Tunis',8225],['38_4276','Wyc. Objazdowe',37]],8237],
['Turcja',[['39:','Turcja'],['39_5725','Aegean',8225],['39_3','Alanya',8229],['39_14','Antalya',8233],['39_23','Belek',8225],['39_25','Bodrum',8233],['39_3699','Cesme',8225],['39_5734','Dalaman - Fethiye',8225],['39_48','Fethiye',40],['39_1483','Icmeler',8225],['39_3326','Istambuł',12325],['39_73','Kemer',8225],['39_1458','Kusadasi',8225],['39_196','Marmaris',8225],['39_5724','Mediterranean',8225],['39_2314','Półwysep Datca',8225],['39_2639','Riwiera Egejska',8225],['39_156','Side',8225],['39_4276','Wyc. Objazdowe',45]],12333],
['Uganda',[['3029:','Uganda'],['3029_4276','Wyc. Objazdowe',32804]],32804],
['Ukraina',[['40:','Ukraina'],['40_4263','Kijów',4129],['40_4276','Wyc. Objazdowe',36]],4133],
['Uzbekistan',[['3647:','Uzbekistan'],['3647_4276','Wyc. Objazdowe',32804]],32804],
['Wenezuela',[['42:','Wenezuela'],['42_4276','Wyc. Objazdowe',36],['42_3369','Wyspa Coche',40993],['42_2510','Wyspa Margarita',40993]],40997],
['Wielka Brytania',[['43:','Wielka Brytania'],['43_1479','Edynburg',36],['43_1478','Londyn',4133],['43_4276','Wyc. Objazdowe',36]],4133],
['Wietnam',[['3030:','Wietnam'],['3030_4204','Binh Thuan',40993],['3030_4240','Da Nang',40993],['3030_4206','Khanh Hoa',40993],['3030_4207','Thua Thien-hue',40993],['3030_4276','Wyc. Objazdowe',36]],40997],
['Węgry',[['41:','Węgry'],['41_1109','Balaton',8226],['41_1463','Budapeszt',4131],['41_3127','Węgry Wschodnie',8227],['41_3321','Węgry Zachodnie',34]],12323],
['Włochy',[['247:,698','Włochy'],['247_2059','Apulia',8226],['247_2697,699','Dolina Aosty',16419],['247_2448','Gargano',8226],['247_3809','Jezioro Comer',34],['247_1274','Jezioro Garda',8234],['247_3810','Jezioro Iseo',33],['247_1279','Kalabria',8226],['247_1740','Kampania',8226],['247_71','Katania',40],['247_1858','Lazio',8226],['247_1219,701','Lombardia',24611],['247_1356','Marche',8226],['247_2879','Mediolan',37],['247_1220,700','Piemont',16419],['247_4601,703','Południowy Tyrol',16419],['247_1223','Riwiera Adriatycka',12323],['247_1450','Rzym',4135],['247_1273','Sardynia',8226],['247_175','Sycylia',8227],['247_1259','Toskania',12322],['247_1227,702','Trentino',24611],['247_1260,704','Veneto',16419],['247_1597','Wenecja',12325],['247_2358','Wybrzeże Liguryjskie',8226],['247_4276','Wyc. Objazdowe',36]],28719]];
var desArrDesc = {'PA':1,'NH':2,'RR':4,'NF':8,'CR':16,'1':32,'2':64,'3':128,'4':256,'5':512,'6':1024,'7':2048,'city':4096,'sea':8192,'ski':16384,'egzo':32768};


function ess_loadDur(st){
 var des = document.getElementById('desCode');
 if(!des)
return;
 var dur_values = Array(0
  ,Array(1,'1-8 dni')
  ,Array(4,'9-15 dni')
  ,Array(6,'&gt;16 dni')
  );
 var sn=des.options[des.selectedIndex];
 var m=sn.getAttribute('msk');
 var e;  if (m)
 {
 e=m*1;
 }
 else
 {
 c=sn.getAttribute('c');
 r=sn.getAttribute('r');
 if (r=='x')
 e=desArr[c*1][2];
 else
 e=desArr[c*1][1][r*1][2];  }

st = st.toUpperCase();
 var str = '<select id="'+des.id+'" name="'+des.name+'" class="'+des.className+'" onchange="ep3_getdep()" style="width:'+(des.style.width)+'"><option value="">'+(AnyText||'Dowolny')+'</option>';
 var str2 = '';
 var arr1 = [];

  }

function loadDes(st, dur){
    var des = document.getElementById('desCode');
    if(!des)return;

    st = st.toUpperCase();
    // var __type = st+'_'+dur;
    var __ntype=desArrDesc[''+st];/*+desArrDesc[''+dur];*/

    if (document.getElementById("content_type") && document.getElementById("content_type").value != '' && st != 'NF'){
        var tmpctval = document.getElementById("content_type").value;
        __ntype = __ntype + desArrDesc[''+tmpctval];
    }

    var desStyle = des.style;
    var str2 = '';
    var mask=0;
    var popularDest = [['3:','Bułgaria'],['11:','Egipt'],['14:','Grecja'],['15:','Hiszpania'],['27:','Maroko'],
                       ['38:','Tunezja'],['39:','Turcja']];

    var str_sel = '';
    var str_sel2 = '';
    
    for(var i=0,j=0, lc = desArr.length, lr = 0; i<lc; i++){
            var da1=desArr[i][2];
            mask= mask | da1;
            if( (da1 & __ntype) != __ntype ) 
            continue;

            for(var ii=0, ispop=0; ii< popularDest.length; ii++){
                if( popularDest[ii][0] == desArr[i][1][0][0] )ispop=1;
            }

            // kierunek - petla po regionach
            for(j=0,lr=desArr[i][1].length; j<lr; j++){
                var da2=desArr[i][1][j][2];
                if( (da2 & __ntype) != __ntype)continue;
                str2 += '<option msk="'+da2+'" c="'+i+'" r="'+j+'" value="'+desArr[i][1][j][0]+'">&nbsp;&nbsp;&nbsp;&nbsp;' +desArr[i][1][j][1]+'</option>';
            }
            // nazwa kierunku
            if( ispop ) {
                str_sel += '<option msk="'+da1+'" c="'+i+'" r="x" class="dest_name" value="'+desArr[i][1][0][0]+'">'+desArr[i][0]+'</option>';
                str_sel += str2; 
            } 
                
			str_sel2 += '<option msk="'+da1+'" c="'+i+'" r="x" class="dest_name" value="'+desArr[i][1][0][0]+'" class="label">'+desArr[i][0]+'</option>';
            str_sel2 += str2;
            
            str2 = '';
    }
    

    str_sel = '<select id="'+des.id+'" name="'+des.name+'"  onchange="ess_loadDur(\''+st+'\')" style="width:'+(des.style.width)+'"><option value="">dowolny</option><optgroup label="Najpopularniejsze">'+str_sel+'</optgroup>';
    str_sel2 = '<option></option><optgroup label="Wszystkie">'+str_sel2+'</optgroup>';

    var str = str_sel+str_sel2/*+'<option msk="'+mask+'"  value="">'+(AnyText||'Dowolny')+'</option>'+str;*/;
    des.parentNode.innerHTML = str+'</select>';
    des = document.getElementById('desCode');
    des.value = '';
    if (des.selectedIndex == -1)des.selectedIndex = 0;
}

function ep3_getdep(){
}

var selectedFilters = [];
function updateSelectedFilters()
{
 var filterFields = ['fiday','fidep','fidur','fioper','firoom','fihm'];
 for (var i=0; i < filterFields.length; i++)
 {
 var curField = document.getElementById(filterFields[i]);
 if (curField)
 selectedFilters[curField.name] = curField.options.selectedIndex;
 }
}

function onLoad2()
{  loadDes('PA', '1');
 ep3_getdep();
 updateSelectedFilters();
 var _url = ep3_parseURL('ep3',self.location.href);
 if(_url[0].ep3_fulsearchform == -1 || _url[0].ep3_fullsearchform == -1)
 onClikLessCriteria(document.getElementById('lessCriteriaLink'));
 else if(_url[0].ep3_fulsearchform == 1 || _url[0].ep3_fullsearchform == 1
 || Cookies.get('ep3_fulsearchform',0) == 1)
 onClikMoreCriteria(document.getElementById('moreCriteriaLink'));
  var _el = document.getElementById("searchtype");
 if(_el){
 document.searchtypeSubmit = document.getElementById("searchtype").value;
 if ( document.searchtypeSubmit == 'NF')
 {
if(_el=document.getElementById("radioNF"))
 _el.checked = true;
 fieldsNF();
 }
 else if ( document.searchtypeSubmit == 'NH')
 {
if(_el=document.getElementById("radioNH"))
 _el.checked = true;
 fieldsNH();
 }
 else if ( document.searchtypeSubmit == 'RR')
 {
if(_el=document.getElementById("radioRR"))
 _el.checked = true;
 fieldsRR();
 }
 else if ( document.searchtypeSubmit == 'CR' )
 { document.getElementById("radioCR").checked = true;
 fieldsCR();
 }
 else
 { //another value (?), then
 if(_el=document.getElementById("radioPA"))
 _el.checked = true;
 fieldsPA();
 }
 }
  //destination

//kids age
 if(document.getElementById('child1Age')){
 var c1a = document.getElementById('child1Age').value;
 var c2a = document.getElementById('child2Age').value;
 var c3a = document.getElementById('child3Age').value;  var i = 0;
 if (c1a != "")  i++;
 if (c2a != "")  i++;
 if (c3a != "")  i++;  document.getElementById('kidsSel').value = i;
 if(i > 0)
 {
var numofkids ='';
 if (i == 1)
 { if (c1a != "")
 document.getElementById('child1AgeSel').value = c1a;
 else
 document.getElementById('child1AgeSel').value = c2a;
 }
 if (i > 1 )
 { document.getElementById('child1AgeSel').value = c1a;
 document.getElementById('child2AgeSel').value = c2a;
 }
 if (i > 2 )
 document.getElementById('child3AgeSel').value = c3a;  }
 }  onChangeTrans(document.getElementById('transs'), '');
 var el = document.body;
 if (el.addEventListener)
 {  el.addEventListener('click', ep3HideHotelHint, false);
 }
 else if (el.attachEvent)
 {
 el.attachEvent('onclick', ep3HideHotelHint);
 }
 ep3ExpandMoreCriteria();
}

function setEasyIBEStep(stepnr)
 {
 var stype = ep3_getSearchType();
 var prev = document.URL;
 var regex = /sp=./g;  //pattern
 if ( regex.test(prev) )  //param "step" exists
 {
if ( (stepnr == 3) && (stype == "NF") )  stepnr--;  }
 prev = prev.replace(/&bk=1/g, "");
 prev = prev.replace(/#.*/g, ""); // remove possible anker from link (IE)
 window.location.href = (prev.indexOf('?')!=-1?prev:prev+'?')+'&ep3[]=sp%3D'+stepnr;
 }  function setSpecialAttribute(attr)
 {
 var prev = document.URL;
 prev = prev.replace(/&bk=1/g, "");
 prev = prev.replace(/#.*/g, ""); // remove possible anker from link (IE)
 if (prev.indexOf('ep3[]')==-1 && valprefixurl == '')
 {
 prev = prev.replace(/(ski|sea|city|egzo)\/.*/g, "");
 prev = prev.replace(/\?.+/g, "");
 window.location.href = prev+(attr!=''?attr+'/':'');
 }
 else if (prev.indexOf('ep3[]')==-1)
 window.location.href = (prev.indexOf('?')!=-1?prev+'&ep3[]=%3Fkt%3D'+attr:prev+'?'+'&ep3[]=%3Fkt%3D'+attr);
 else
 window.location.href = (prev.indexOf('?')!=-1?prev+'&ep3[]=kt%3D'+attr:prev+'?'+'&ep3[]=%3Fkt%3D'+attr);
 }
function onclickButtonComeback()
 { //get decremental step param
 var stepnr = ep3_current_step>0?ep3_current_step:(document.getElementById('step')?document.getElementById('step').value:0);
 if ( isNaN(parseInt(stepnr)) )
 stepnr = "1";  //problems, then step=1, begin
 else
 { stepnr = parseInt(stepnr);
 if (2 <= stepnr)  stepnr--;  //previous step
 else  stepnr = "1"; //problems, then step=1, begin
 }
 setEasyIBEStep(stepnr);
 }

function recalcOpt()
 {
 var optlisttable = document.getElementById("optlisttable");
 if (optlisttable)
 {
 document.getElementById('attrDisp').innerHTML = '';
 var opt_inputs = optlisttable.getElementsByTagName("input");
 var opt_value = 0;
 var opt = document.getElementById("opt");
 var addClass = '';
 if (opt)
 {
 for (var i=0; i < opt_inputs.length; i++)
 {
 if (opt_inputs[i].parentNode.parentNode.parentNode.className.match(/ep3\_doubleLine/))
 addClass = 'ep3_doubleLine';
 else
 addClass = '';
 if (opt_inputs[i].checked)
 {
 document.getElementById('attrDisp').innerHTML += '<div class="'+opt_inputs[i].id+'"></div>';
 if (opt_inputs[i].type == 'radio')
 {
 if (document.getElementById("content_type"))
 {
 if (document.getElementById("content_type").value != opt_inputs[i].value)
 {
 document.getElementById("content_type").value = opt_inputs[i].value;
 loadDes((document.searchtypeRadio||ep3_getSearchType()||'PA'), document.getElementById('tripduration_search').value);
 }
 }
 }
 else
 {
 opt_value += parseInt(opt_inputs[i].value);
 }
 opt_inputs[i].parentNode.parentNode.parentNode.className = 'color4bg '+addClass;
 }
 else
 opt_inputs[i].parentNode.parentNode.parentNode.className = addClass;
 }
 opt.value = opt_value;
 }
 }
 }
 function disableOpt(setdisabled)
 {
 var optlisttable = document.getElementById("optlisttable");
 if (optlisttable)
 {
 var opt_inputs = optlisttable.getElementsByTagName("input");
 for (var i=0; i < opt_inputs.length; i++)
 opt_inputs[i].disabled = setdisabled;
 }
 }
 function clearOpt()
 {
 var optlisttable = document.getElementById("optlisttable");
 if (optlisttable)
 {
 document.getElementById('attrDisp').innerHTML = '';
 var opt_inputs = optlisttable.getElementsByTagName("input");
 for (var i=0; i < opt_inputs.length; i++)
 {
 if (opt_inputs[i].checked)
 opt_inputs[i].checked = false;
 }
 if (document.getElementById("attr_noSpecial"))
 document.getElementById("attr_noSpecial").checked = true;
 recalcOpt();
 }
 }
 function recalcRooms()
{
 var selectedRooms = [];
 var selectedRoomsNames = [];
 var roomlistdiv = document.getElementById("rooms_div");
 var room = document.getElementById("roomType");
 var roomSearch = document.getElementById("room_search");
 if (roomlistdiv && room)
 {
 var room_inputs = roomlistdiv.getElementsByTagName("input");
 for (var i=0, ril = room_inputs.length; i < ril; i++)
 {
 if (room_inputs[i].checked)
 {
 if (room_inputs[i].name != '')
 selectedRooms.push(room_inputs[i].value);
 selectedRoomsNames.push(room_inputs[i].nextSibling.innerHTML);
 room_inputs[i].parentNode.className = 'ep3roomLabel color4bg';
 }
 else
 room_inputs[i].parentNode.className = 'ep3roomLabel';
 }
 room.value = selectedRooms.join(',');
 if (document.getElementById("ep3addBed") && document.getElementById("ep3addBed").checked == true)
 room.value = room.value + '|1';
 if (selectedRoomsNames.length)
 roomSearch.value = selectedRoomsNames.join(', ');
 else
 roomSearch.value = 'Dowolny';
 }
}

function fillRooms()
{
 var selectedRooms = [];
 var selectedRoomsNames = [];
 var roomlistdiv = document.getElementById("rooms_div");
 var room = document.getElementById("roomType");
 var roomSearch = document.getElementById("room_search");
 if (roomlistdiv && room && room.value.length)
 {
 var RoomsValArr = room.value.split('|');
 selectedRooms = RoomsValArr[0].split(',');
 var room_inputs = roomlistdiv.getElementsByTagName("input");
 for (var i=0, ril = room_inputs.length; i < ril; i++)
 {
 if (inArray(room_inputs[i].value, selectedRooms) !== -1)
 {
 room_inputs[i].checked = true;
 room_inputs[i].parentNode.className = 'ep3roomLabel color4bg';
 selectedRoomsNames.push(room_inputs[i].nextSibling.innerHTML);
 }
 else
 {
 room_inputs[i].checked = false;
 room_inputs[i].parentNode.className = 'ep3roomLabel';
 }
 }
 if (RoomsValArr[1] != undefined && document.getElementById("ep3addBed"))
 {
 var ep3addBed = document.getElementById("ep3addBed")
 ep3addBed.checked = true;
 ep3addBed.parentNode.className = 'ep3roomLabel color4bg';
 selectedRoomsNames.push(ep3addBed.nextSibling.innerHTML);
 }
 if (selectedRoomsNames.length)
 roomSearch.value = selectedRoomsNames.join(', ');
 else
 roomSearch.value = 'Dowolny';
 }
 else
 roomSearch.value = 'Dowolny';
}
 



