

// ---------- [ js/jquery/cookie.js ] -------- 

/**
 * Cookie plugin
 *
 * Copyright (c) 2006 Klaus Hartl (stilbuero.de)
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 *
 */

/**
 * Create a cookie with the given name and value and other optional parameters.
 *
 * @example $.cookie('the_cookie', 'the_value');
 * @desc Set the value of a cookie.
 * @example $.cookie('the_cookie', 'the_value', { expires: 7, path: '/', domain: 'jquery.com', secure: true });
 * @desc Create a cookie with all available options.
 * @example $.cookie('the_cookie', 'the_value');
 * @desc Create a session cookie.
 * @example $.cookie('the_cookie', null);
 * @desc Delete a cookie by passing null as value. Keep in mind that you have to use the same path and domain
 *       used when the cookie was set.
 *
 * @param String name The name of the cookie.
 * @param String value The value of the cookie.
 * @param Object options An object literal containing key/value pairs to provide optional cookie attributes.
 * @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object.
 *                             If a negative value is specified (e.g. a date in the past), the cookie will be deleted.
 *                             If set to null or omitted, the cookie will be a session cookie and will not be retained
 *                             when the the browser exits.
 * @option String path The value of the path atribute of the cookie (default: path of page that created the cookie).
 * @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie).
 * @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will
 *                        require a secure protocol (like HTTPS).
 * @type undefined
 *
 * @name $.cookie
 * @cat Plugins/Cookie
 * @author Klaus Hartl/klaus.hartl@stilbuero.de
 */

/**
 * Get the value of a cookie with the given name.
 *
 * @example $.cookie('the_cookie');
 * @desc Get the value of a cookie.
 *
 * @param String name The name of the cookie.
 * @return The value of the cookie.
 * @type String
 *
 * @name $.cookie
 * @cat Plugins/Cookie
 * @author Klaus Hartl/klaus.hartl@stilbuero.de
 */
jQuery.cookie = function(name, value, options) {
    if (typeof value != 'undefined') { // name and value given, set cookie
        options = options || {};
        if (value === null) {
            value = '';
            options.expires = -1;
        }
        var expires = '';
        if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
            var date;
            if (typeof options.expires == 'number') {
                date = new Date();
                date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
            } else {
                date = options.expires;
            }
            expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE
        }
        // CAUTION: Needed to parenthesize options.path and options.domain
        // in the following expressions, otherwise they evaluate to undefined
        // in the packed version for some reason...
        var path = options.path ? '; path=' + (options.path) : '';
        var domain = options.domain ? '; domain=' + (options.domain) : '';
        var secure = options.secure ? '; secure' : '';
        document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
    } else { // only name given, get cookie
        var cookieValue = null;
        if (document.cookie && document.cookie != '') {
            var cookies = document.cookie.split(';');
            for (var i = 0; i < cookies.length; i++) {
                var cookie = jQuery.trim(cookies[i]);
                // Does this cookie string begin with the name we want?
                if (cookie.substring(0, name.length + 1) == (name + '=')) {
                    cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
                    break;
                }
            }
        }
        return cookieValue;
    }
};
function get_cookies_array() {
 
	var cookies = { };
 
	if (document.cookie && document.cookie != '') {
		var split = document.cookie.split(';');
		for (var i = 0; i < split.length; i++) {
			var name_value = split[i].split("=");
			name_value[0] = name_value[0].replace(/^ /, '');
			cookies[decodeURIComponent(name_value[0])] = decodeURIComponent(name_value[1]);
		}
	}
 
	return cookies;
	
}

// ---------- [ js/units/classStringUtils.js ] -------- 

/*
  (C) by KSI media sp. z o.o. ( www.ksimedia.pl )  
  Description : StringUtils class.
  Author      : MS
  Create date : 2010-09-13
  Comment     :
*/

function classStringUtils() {

  this.dateFormat = function ( strDate )
  {
    var y ;
    var m ;
    var d ;
    y = new String ;
    m = new String ;
    d = new String ;
    
    y = strDate.substr ( 0 , 4 ) ;
    //alert ( y ) ;
    m = strDate.substr ( 5 , 2 ) ;
    d = strDate.substr ( 8 , 2 ) ;
    return d+'.'+m+'.'+y ;
  }

  this.inArray = function ( value, arr )
  {
    var i ;
    for ( i = 0 ; i<arr.length; i++ )
    {
      if ( arr[i] == value ) return i ;
    }
    return -1 ;
  }
   
  this.arrayToString = function ( arr )
  {
    var value ;
    for ( x in arr )
    {
      try 
      {
        arr[x] = arr[x].replace ( /,/g, '~' ) ;
      } catch ( err ) {}
    }
    value = arr.toString() ;
    value = value.replace ( /,/g, ';' ) ;
    value = value.replace ( /~/g, ',' ) ;
    return value ;
  }
  
  this.arrayDeleteItem = function ( value, arr )
  {
    var i ;
    for ( i = 0;  i < arr.length; i++ )
    { 
      if ( arr[i] == value ) arr.splice ( i ,1 ) ; 
    } 
  }
  
}

StringUtils = new classStringUtils ;

// ---------- [ js/units/extComponents/classExtComponents.js ] -------- 

/*
  (C) by KSI media sp. z o.o. ( www.ksimedia.pl )  
  Description : ExtComponents class.
  Author      : MS
  Create date : 2010-09-14
  Comment     :
*/

function classExtComponents ()
{
  
  this.updateFunctions = new Array() ;
  
  //
  // funkcje zwi¹zane z obs³ug¹ "wartoœci podstawowych"
  //
  this.setValue = function ( name, value, sort )
  {
    var tmp ;
    try
    {
      if ( value == '' )
      {
        document.getElementById ( 'vis_'+name ).style.color = '#888888' ;
      }
      else
      {
        document.getElementById ( 'vis_'+name ).style.color = '#222222' ;
      }
    }
    catch(err){}
    
    tmp = value.split ( ';' ) ;
    
    if ( sort == undefined )
    {
      sort = false ;
    }
    if ( sort )
    {
      tmp.sort();
    }
    StringUtils.arrayDeleteItem ( '', tmp ) ;
    document.getElementById ( name ).value = StringUtils.arrayToString ( tmp ) ;
    this.updateValue( name ) ;
    return true ;
  }

  this.getValue = function ( name )
  {
    var tmp ;
    tmp = document.getElementById ( name ).value ;
    return tmp ;
  }
  
  this.getValueArray = function ( name )
  {
    var tmp ;
    tmp = document.getElementById ( name ).value ;
    return tmp.split( ';' ) ;
  }

  //
  // funkcje zwi¹zane z obs³ug¹ "multi wartoœci"
  //
  this.addMultiValue = function ( name, value, sort )
  {
    var tmp ;
    var oval ;
    if ( sort == undefined )
    {
      sort = false ;
    }

    oval = this.getValue( name ) ;
    tmp = oval.split ( ';' ) ;
    if ( StringUtils.inArray ( value, tmp ) < 0 )
    {
      tmp.push ( value ) ;      
      this.setValue ( name, StringUtils.arrayToString ( tmp ), sort ) ;
    }
    else
    {
      return false ;
    }
  }

  this.deleteMultiValue = function ( name, value )
  {
    var tmp ;
    var oval ;
    oval = this.getValue( name ) ;
    tmp = oval.split ( ';' ) ;
    if ( StringUtils.inArray ( value, tmp ) >= 0 )
    {
      StringUtils.arrayDeleteItem ( value, tmp ) ;
      this.setValue ( name, StringUtils.arrayToString ( tmp ) ) ;
    }
    else
    {
      return false ;
    }
  }
  
  this.isMultiValue = function ( name, value )
  {
    var tmp ;
    var oval ;
    oval = this.getValue( name ) ;
    tmp = oval.split ( ';' ) ;
    if ( StringUtils.inArray ( value, tmp ) >= 0 )
    {
      return true ;
    }
    else
    {
      return false ;
    }
  }
  //
  // Updating visual components
  //
  this.updateValue = function ( name )
  {
    // aktualizuje elementy wizualne komponentu
    var fn ;
    if ( this.updateFunctions [ name ] != undefined )
    {
      fn = this.updateFunctions [ name ] + "('" + name + "')" ;
      try
      {
        eval ( fn ) ;
      }
      catch ( err ){}
    }
  }
}

ExtComponents = new classExtComponents ;

// ---------- [ js/ucs/main/default/classMain.js ] -------- 

function classMain_default() {

  this.tabBox_button = function(id) 
  {
    for ( i = 1; i <= 8; i++ )
    {
      $('#Main_default_tabBox_button_'+i).css('background','#caeafa');  
      $('#Main_default_tabBox_button_'+i).css('color','#333333');  
    }
  
   $('#Main_default_tabBox_button_'+id).css('background','url(data/images/main/box_przesuwny_button2.png) repeat-x');  
   $('#Main_default_tabBox_button_'+id).css('color','#ffffff');  
  }
  
  
  this.tabBox_layer = function(id)
  {
    for (i = 1; i <= 8; i++)
    {
      $('#Main_default_tabBox_layer_'+ i).css('display', 'none');
    }
    
    $('#Main_default_tabBox_layer_'+ id).css('display', 'block');
    this.tabBox_button(id);
  }
  
  this.tabBox_button_next = function(id)
  {
      for (i = 1; i <= 8; i++)
      {
        $('#Main_default_tabBox_layer_'+ i).css('display', 'none');
      }
      
      $('#Main_default_tabBox_layer_'+ id).css('display', 'block');
      this.tabBox_button(id);
  }
  
  this.tabBox_button_prev = function(id)
  {
      for (i = 1; i <= 8; i++)
      {
        $('#Main_default_tabBox_layer_'+ i).css('display', 'none');
      }
      
      $('#Main_default_tabBox_layer_'+ id).css('display', 'block');
      this.tabBox_button(id);
  }
  
}

var Main_default = new classMain_default();

// ---------- [ js/ucs/widgets/slideBox/slidebox_1/classSlideBox.js ] -------- 

/*
  (C) by KSI media sp. z o.o. ( www.ksimedia.pl )  
  Description : SlideBox
  Author      : MP
  Create date : 2010-08-22
  Comment     :
*/

function classSlideBox_default() {

  this.slideBoxStartArray = new Array();  
  this.slideBoxUrlArray = new Array() ;
  this.slideBoxContainerId = ''; // id div do ktorego zostana wczytane divy z tablicy Url
  this.containerId = '';
  this.position = 0;
  this.position_min = 0;
  this.position_max = 0;
  this.max_width = 0;
  this.step = 1; // co ile ma skakac
  this.margin = 1; // przy pieknym zapetleniu ile pozycji ma byc marginesem, aby bylo ladnie musi miec tyle ile jest w jednym oknie wyswietlana
  this.timerSleep = 4000;
  this.timerPause = 4000;
  this.timerStop = false;
  this.animationType = 'slide'; // slide,fade
  this.timerId = null;
  this.isLoop = true; // czy jest pieknie zapetlone
  this.isBusy = false; // czy jest zajety
  
  // button
  this.buttonHtmlClassActive = null;
  this.buttonsObject = null;
  
  
  this.setContainer = function ( containerId ) {
    this.slideBoxContainerId = containerId; 
    this.containerId = '#'+containerId; 
  }
  
  // wypelnia wskazany kontener
  this.fillContainer = function () {
    if ( this.slideBoxContainerId == '' ) alert('Blad, nie podano nazwy kontenera do SlideBox');
    var containerId = this.containerId;  
    this.position_min = 0;
    this.position_max = this.slideBoxUrlArray.length-1;
    this._laduj(0);
  }  
  
  this._buttonGenerate = function () {
    var obj = this;
    $(this.containerId+' > div').each( function(index) {
      var indeks = index+1;
      $('#'+obj.buttonContainer).append('<div class="'+obj.buttonHtmlClassOff+' '+obj.buttonHtmlClassOn+'" id="'+ obj.slideBoxContainerId+'_div_'+indeks+'">'+indeks+'</div>');
    });
    $('#'+this.buttonContainer+' > div').each( function(index) {
      $(this).click( function() {
       obj.setView(index); 
      });
    });    
  }
  
  
  this._laduj = function (indeks) {
    this.isBusy = true;
    var obj = this;    
    if ( indeks < obj.slideBoxUrlArray.length ) {
      $.ajax({
        url: this.slideBoxUrlArray[indeks],
        success: function ( data ) {
          $(obj.containerId).append(data);
        },
        complete: function() {
          this.isBusy = false;      
          if ( indeks == obj.slideBoxUrlArray.length-1 ) obj._przelicz();
            else obj._laduj(indeks+1);
        }
      });
    }
  }  
  
  // przelicza szerokosci i ilosci elementow
  this._przelicz = function () {
  
    this.isBusy = true;
    this.position = 1;    
    this.position_min = 0;
    var szerokosc = 0;
    var obj = this;    
    
    if ( this.isLoop === true && this.animationType == 'slide' ) { 
    // dla zaptelonej 
      this.position = this.margin;
      var tnij = $(this.containerId+' > div').length-this.margin-1;
      var ogonek = $(this.containerId + ' > div:gt('+tnij+')').clone();
      // $(this.containerId + ' > div:lt('+this.margin+')').clone().appendTo( this.containerId );
      $(this.containerId).prepend( ogonek );
      
    }
    $(this.containerId+' > div').each( function(index) { 
      obj.slideBoxStartArray[index] = szerokosc;
      szerokosc += $(this).outerWidth(true);
    });
    this.position_max = obj.slideBoxStartArray.length -1;
    if ( this.isLoop === true ) { 
      $(this.containerId).css('left','-'+this.slideBoxStartArray[this.position]+'px');
    }  
    this.max_width = szerokosc;    
    $(this.containerId).css('width',szerokosc+'px');
    if ( this.timerStop === false ) {
      this.startNextTimer( this.timerSleep );
    }
   
    this.isBusy = false; 
  }

  // 0 - wylacza, wieksze ustawia
  this.startNextTimer = function( timerSleep ) {
    if ( timerSleep > 0 ) {
      this.timeStop = false;
      var obj = this;
      if ( this.timerId !== null ) {
        clearInterval( this.timerId );      
      }
      this.timerId = setInterval( function() { obj.nextBtn(100) }, this.timerSleep );        
    } else {
      this.timeStop = true;
      if ( this.timerId !== null ) clearInterval( this.timerId );
      this.timerId = null;
    }
  
  }  
  // setActiveButton
    this._setActiveButton = function (index) {
      if ( this.position_max < index ) index = 0;
      pozycja = 0;
      for( var i in this.buttonsObject ) {
        pozycja++;
          $( '#'+this.buttonsObject[i] ).removeClass( this.buttonHtmlClassActive );          
          if ( pozycja == index ) {
            $( '#'+this.buttonsObject[i] ).addClass( this.buttonHtmlClassActive );
          }
      }
    }
    
  // next  
  this.nextBtn = function (setPause) {
    this._przesun('N',setPause);
  }
  
  // set
  this.setView = function(numer,setPause) {
    this._przesun(numer,setPause);  
  }
  
  // prev
  this.prevBtn = function (setPause,setPause) {
    this._przesun('P');
  }  
  
  // przesuwa klatki wzgledem okna
  // int - konkretne pozycja, 'N' - next, 'P' - prev
  this._przesun = function ( move, setPause) {
    if ( this.isBusy === true ) return false;    
    if ( setPause !== 100 ) {
      this.setPause();
    }  
    this.isBusy = true;
    
    // oblicz pozycje do przesuniecia i jaka ma miec po przesunieciu    
    if ( move == 'N' ) {
      this.position += this.step;    
    } else if ( move == 'P' ) {
      this.position -= this.step;    
    } else if ( parseInt( move, 10 ) !== 'NaN' ) {
      if ( this.position == parseInt(move,10) ) {
        this.isBusy = false;
        return true;
      }      
      this.position = parseInt(move,10);
    }; 
    
    // ustaw klatke
    if ( this.position > this.position_max ) { 
      $( this.containerId ).css("left","0");
      this.position = this.margin;
    } else if ( this.position < 0 ) { 
      $( this.containerId ).css("left",'-'+this.slideBoxStartArray[this.position_max]+'px');
      this.position = this.position_max-1;      
    }
    
    switch( this.animationType ) {
      case 'slide':            
      default:
        var obj = this;
        $( this.containerId ).animate({"left": '-'+obj.slideBoxStartArray[obj.position]+'px'}, "slow", function () {
          // korekta klatki
          if ( obj.position == 0 ) {
            $( obj.containerId ).css("left",'-'+obj.slideBoxStartArray[obj.position_max]+'px');
            obj.position = obj.position_max;              
          }          
            obj._setActiveButton( obj.position );               
            obj.isBusy = false;
          });
      break;  
    }
  }
 
  this.setPause = function() {
    this.startNextTimer(0);
    var obj = this;
    setTimeout( function() { obj.startNextTimer( obj.timerSleep ) }, this.timerPause );
  }  

// end object  
}

jQuery.fn.fadeIn = function(speed, callback) { 
    return this.animate({opacity: 'show'}, speed, function() { 
        if (jQuery.browser.msie)  
            this.style.removeAttribute('filter');  
        if (jQuery.isFunction(callback)) 
            callback();  
    }); 
}; 
 
jQuery.fn.fadeOut = function(speed, callback) { 
    return this.animate({opacity: 'hide'}, speed, function() { 
        if (jQuery.browser.msie)  
            this.style.removeAttribute('filter');  
        if (jQuery.isFunction(callback)) 
            callback();  
    }); 
};

// ---------- [ js/ucs/bp/search/elements/countryRegion/default/classSearchWindowCountryRegion.js ] -------- 

/*
  (C) by KSI media sp. z o.o. ( www.ksimedia.pl )  
  Description : 
  Author      : MS
  Create date : 2010-08-22
  Comment     :
*/

function classSearchWindowCountryRegion_default()
{

  this.updateValue = function ( name )
  {
    if ( ExtComponents.getValue( name ) == '' )
    {
      document.getElementById( 'vis_'+name ).value = ' - dowolne - ' ;
    }
    else
    {
      document.getElementById( 'vis_'+name ).value = ExtComponents.getValue( name ) ; //.replace ( /;/g, ',' );
    }
    try
    {
      this.itemsUpdateValues ( name ) ;
    }
    catch(err)
    { 
      // alert ( 'noItems' ) ;
    }
  }
  
  //
  // Akcje z interfejsu okna Items
  //
  
  this.itemsUpdateValues = function ( name )
  {
    ExtComponents.setValue ( 'mb_'+name, ExtComponents.getValue ( name ) ) ;
  }
    
  
  this.itemsCloseWindow = function ( name )
  {
    EditBox.itemsHideWindow( name ) ;
    ExtComponents.setValue ( name, ExtComponents.getValue ( 'mb_'+name ) );
  }
  
  this.itemsClear = function ( name )
  {
    ExtComponents.setValue ( name, '' ) ;
    this.itemsUpdateValues ( name ) ;
  }

}

SearchWindowCountryRegion_default = new classSearchWindowCountryRegion_default ;

// ---------- [ js/units/extComponents/editBox/classEditBox.js ] -------- 

/*
  (C) by KSI media sp. z o.o. ( www.ksimedia.pl )  
  Description : EditBox class.
  Author      : MS
  Create date : 2010-08-22
  Comment     :
*/

function classEditBox ()
{
  this.itemsLoaded = new Array() ;
  
  //
  // funckcje obsÅ‚ugi komponentu
  //
  this.onClickAjaxReady = function ( name )
  {
    this.itemsLoaded [ name ] = 'yes' ;
    ExtComponents.updateValue( name ) ;    
  }
  
  this.onClick = function ( name, ajaxContentUrl )
  {
    if ( document.getElementById('itemsList_'+name).style.display == 'block' )
    {
      this.itemsHideWindow ( name ) ;
    }
    else
    {     
      this.itemsShowWindow ( name ) ;
      
      if ( ajaxContentUrl != '' ) 
      {
        if ( this.itemsLoaded[ name ] !==  'yes' ) { 
        // jeÅ›li coÅ› nie bÄ™dzie dziaÅ‚aÄ‡ naleÅ¼y zakomentowaÄ‡
          document.getElementById ( 'itemsList_'+name ).innerHTML = "<table style='width:100%;height:100%;background-color:#ffffff;'><tr><td style='vertical-align:middle;text-align:center;'><img src='data/images/load.gif' alt='loading ...' /></td></tr></table>";
          
          $('#itemsList_'+name).load( ajaxContentUrl, function() {
            EditBox.onClickAjaxReady( name );
          });
        } else { 
        // jeÅ›li coÅ› nie bÄ™dzie dziaÅ‚aÄ‡ naleÅ¼y zakomentowaÄ‡
          document.getElementById('itemsList_'+name).style.display == 'block';
          ExtComponents.updateValue( name ) ;  
        } 
        // jeÅ›li coÅ› nie bÄ™dzie dziaÅ‚aÄ‡ naleÅ¼y zakomentowaÄ‡
      }
    }    
    return null ;
  }  
  
  this.itemsShowWindow = function ( name )
  {
    $('div.classEditBox_default_ajax').css('display','none');
    $('div.classEditBox_terminy_ajax').css('display','none');
    document.getElementById('itemsList_'+name).style.display='block';
  }
  
  this.itemsHideWindow = function ( name )
  {
    document.getElementById('itemsList_'+name).style.display='none';
  }
  
  this.updateValue = function ( name )
  {
    document.getElementById('vis_'+name).value = ExtComponents.getValue( name ) ;
  }

}

EditBox = new classEditBox () ;

// ---------- [ js/ucs/bp/search/elements/price/default/classSearchWindowPrice.js ] -------- 

/*
  (C) by KSI media sp. z o.o. ( www.ksimedia.pl )  
  Description : SearchWindowLengthPresentation class.
  Author      : MS
  Create date : 2010-08-22
  Comment     :
*/

function classSearchWindowPrice_default()
{

  this.updateValue = function ( name )
  {
    if ( ExtComponents.getValue( name ) == '' )
    {
      document.getElementById( 'vis_'+name ).value = ' - dowolna - ' ;
    }
    else
    {
      var val ;
      var tmp ;
      tmp = '' ;
      val = ExtComponents.getValue( name ) ;     
      if ( tmp == '' )
      {
        valArr = val.split ( ';' ) ;      
        if ( valArr[0] != undefined )
        {
          if (( valArr[0] != '' )&&( valArr[0] != 0 ))
          {
            tmp = 'od '+ valArr[0]/100 + 'zÅ‚';
          }
        }
        if ( valArr[1] != undefined )
        {
          if ( valArr[1] != '' )
          {
            tmp = tmp + ' do '+ valArr[1]/100 + 'zÅ‚' ;
          }
        }
      }
      document.getElementById( 'vis_'+name ).value = tmp ;      
    }
    try
    {
      this.itemsUpdateValues ( name ) ;
    }
    catch(err)
    { 
      // alert ( 'noItems' ) ;
    }
  }
  
  //
  // Akcje z interfejsu okna Items
  //
  
  this.itemsUpdateValues = function ( name )
  {
    ExtComponents.setValue ( 'mb_'+name, ExtComponents.getValue ( name ) ) ;
  }
  
  this.itemsCloseWindow = function ( name )
  {
    EditBox.itemsHideWindow( name ) ;
    ExtComponents.setValue ( name, ExtComponents.getValue ( 'mb_'+name ) );
  }
  
  this.itemsClear = function ( name )
  {
    ExtComponents.setValue ( name, '' ) ;
    this.itemsUpdateValues ( name ) ;
  }

}
SearchWindowPrice_default = new classSearchWindowPrice_default ;


// ---------- [ js/ucs/bp/search/elements/departureFrom/default/classSearchWindowDepartureFrom.js ] -------- 

/*
  (C) by KSI media sp. z o.o. ( www.ksimedia.pl )  
  Description : SearchWindowLengthPresentation class.
  Author      : MS
  Create date : 2010-08-22
  Comment     :
*/

function classSearchWindowDepartureFrom_default()
{

  this.updateValue = function ( name )
  {
    if ( ExtComponents.getValue( name ) == '' )
    {
      document.getElementById( 'vis_'+name ).value = ' - dowolny - ' ;
    }
    else
    {
      document.getElementById( 'vis_'+name ).value = ExtComponents.getValue( name ).replace ( /;/g, ',' );
    }
    try
    {
      this.itemsUpdateValues ( name ) ;
    }
    catch(err)
    { 
      // alert ( 'noItems' ) ;
    }
  }
  
  //
  // Akcje z interfejsu okna Items
  //
  
  this.itemsUpdateValues = function ( name )
  {
    ExtComponents.setValue ( 'mb_'+name, ExtComponents.getValue ( name ), true ) ;
  }
    
  
  this.itemsCloseWindow = function ( name )
  {
    EditBox.itemsHideWindow( name ) ;
    ExtComponents.setValue ( name, ExtComponents.getValue ( 'mb_'+name ), true );
  }
  
  this.itemsClear = function ( name )
  {
    ExtComponents.setValue ( name, '', true ) ;
    this.itemsUpdateValues ( name ) ;
  }

}

SearchWindowDepartureFrom_default = new classSearchWindowDepartureFrom_default ;

// ---------- [ js/ucs/calendar/datePicker/departureDateFrom/classCalendarDatePicker.js ] -------- 

//
// Created by KSI ( www.ksimedia.pl )
//

function classCalendarDatePicker_departureDateFrom() {
  
  this.fillLeadingZeros = function ( i )
  {
    if ( i > 9 )
    {
      return i ;
    }
    else
    {
      return '0'+i;
    }        
  }
  
  this.updateValue = function ( name ) 
  {
    var secondElmane = new String() ;
    secondElmane = name ;
    secondElmane = secondElmane.replace ( /departureDateFrom/i, "returnDateTo" ); 
    
    if ( ExtComponents.getValue( name ) == '' )
    {
      document.getElementById( 'vis_'+name ).value = ' - dowolny - ' ;
    }
    else
    {
      
      
      document.getElementById( 'vis_'+name ).value = StringUtils.dateFormat ( ExtComponents.getValue( name ) ) ;

      // dodajê do daty 28 dni      
      var yy = new String() ;
      var mm = new String() ;
      var dd = new String() ;
      var df = new String() ;
      var dataFull = new String() ;
      
      df = ExtComponents.getValue( name ) ;
      yy = df.substr ( 0, 4 ) ;
      mm = df.substr ( 5, 2 ) ;
      dd = df.substr ( 8, 2 ) ;
      var newDate = new Date ( yy, mm - 1, dd, 0, 0, 0, 0 ) ;
      newDate.setDate ( newDate.getDate() + 28 ) ;      
      yy = newDate.getFullYear();
	    mm = parseInt(newDate.getMonth()+1);
	    dd = newDate.getDate();
      dataFull = yy + '-' + this.fillLeadingZeros ( mm ) + '-' + this.fillLeadingZeros ( dd ) ;
      
      if ( ( ExtComponents.getValue ( secondElmane ) == '' ) || ( ExtComponents.getValue ( secondElmane ) != dataFull ) )
      {
        ExtComponents.setValue ( secondElmane, dataFull ) ;
      }      

    }
    return true ;
  }
  
  this.updateItemsValues = function ( name )
  {
    return true ;
  }
}

CalendarDatePicker_departureDateFrom = new classCalendarDatePicker_departureDateFrom() ;

// ---------- [ js/ucs/calendar/datePicker/default/classCalendarDatePicker.js ] -------- 

//
// Created by KSI ( www.ksimedia.pl )
//

function classCalendarDatePicker() {
  
  this.updateValue = function ( name ) 
  {
    if ( ExtComponents.getValue( name ) == '' )
    {
      document.getElementById( 'vis_'+name ).value = ' - dowolny - ' ;
    }
    else
    {
      document.getElementById( 'vis_'+name ).value = StringUtils.dateFormat ( ExtComponents.getValue( name ) ) ;
    }
    return true ;
  }
  
  this.updateItemsValues = function ( name )
  {
    return true ;
  }
  
}

CalendarDatePicker = new classCalendarDatePicker() ;


// ---------- [ js/ucs/bp/search/elements/category/default/classSearchWindowCategory.js ] -------- 

/*
  (C) by KSI media sp. z o.o. ( www.ksimedia.pl )  
  Description : SearchWindowLengthPresentation class.
  Author      : MS
  Create date : 2010-08-22
  Comment     :
*/

function classSearchWindowCategory_default()
{

  this.updateValue = function ( name )
  {
    var valArr ;
    var value ;
    var categoryFrom ;
    var categoryTo ;
     
    if ( ExtComponents.getValue( name ) == '' )
    {
      document.getElementById( 'vis_'+name ).value = ' - dowolne - ' ;
    }
    else
    {
      value = ExtComponents.getValue( name ) ;
      valArr = value.split ( ';' ) ;
      categoryFrom = valArr[0] / 10 ;
      categoryTo = valArr[1] / 10 ;      
      document.getElementById( 'vis_'+name ).value = 'od ' + categoryFrom + ' do ' + categoryTo + ' ( gwiazdek )' ;
    }
    try
    {
      this.itemsUpdateValues ( name ) ;
    }
    catch(err)
    { 
      // alert ( 'noItems' ) ;
    }
  }
  
  //
  // Akcje z interfejsu okna Items
  //
  
  this.itemsUpdateValues = function ( name )
  {
    ExtComponents.setValue ( 'mb_'+name, ExtComponents.getValue ( name ), true ) ;
  }
    
  
  this.itemsCloseWindow = function ( name )
  {
    EditBox.itemsHideWindow( name ) ;
    ExtComponents.setValue ( name, ExtComponents.getValue ( 'mb_'+name ), true );
  }
  
  this.itemsClear = function ( name )
  {
    ExtComponents.setValue ( name, '', true ) ;
    this.itemsUpdateValues ( name ) ;
  }

}

SearchWindowCategory_default = new classSearchWindowCategory_default ;

// ---------- [ js/ucs/bp/search/elements/text/default/classSearchWindowText.js ] -------- 

/*
  (C) by KSI media sp. z o.o. ( www.ksimedia.pl )  
  Description : SearchWindowLengthPresentation class.
  Author      : MS
  Create date : 2010-08-22
  Comment     :
*/

function classSearchWindowText_default()
{
  this.focused = Array();
  this.updateValue = function ( name )
  {
    var tmp ;
    var ifNullValue ;
    ifNullValue = ' - wpisz np. nazwÄ™ hotelu - ' ;
    tmp = ExtComponents.getValue( name ) ;
    if ( tmp == '' ) 
    {      
      if ( this.focused [ name ] == true )
      {
        document.getElementById( 'vis_'+name ).value = '' ;
      }
      else
      {
        document.getElementById( 'vis_'+name ).value = ifNullValue ;
      }
    }
    
    if ( tmp.substr ( 0, ifNullValue.length ) == ifNullValue )
    {
      tmp = tmp.substr ( ifNullValue.length ) ;
      if ( tmp.length > 0 ) document.getElementById( 'vis_'+name ).value = tmp ;
    }
    else
    {
      if ( tmp.length > 0 ) document.getElementById( 'vis_'+name ).value = tmp ;
    }
    
  }
  
  this.onKeyUp = function ( name )
  {
    ExtComponents.setValue ( name, ExtComponents.getValue ( 'vis_' + name ) ) ;
  }
  
  this.onFocus = function ( name )
  {
    var tmp ;
    this.focused [ name ] = true ;
    tmp = ExtComponents.getValue ( name ) ;
    if ( tmp == '' ) 
    {
      ExtComponents.setValue ( 'vis_'+name,'' ) ;
    }
  }
  
  this.onBlur = function ( name )
  {
    this.focused [ name ] = false ;
    ExtComponents.updateValue ( name ) ;
  }

}
SearchWindowText_default = new classSearchWindowText_default ;


// ---------- [ js/ucs/bp/search/elements/adults/default/classSearchWindowAdults.js ] -------- 

/*
  (C) by KSI media sp. z o.o. ( www.ksimedia.pl )  
  Description : SearchWindowLengthPresentation class.
  Author      : MS
  Create date : 2010-08-22
  Comment     :
*/

function classSearchWindowAdults_default()
{

  this.updateValue = function ( name )
  {
    if ( ExtComponents.getValue( name ) == '' )
    {
      document.getElementById( 'vis_'+name ).value = ' - dowolna - ' ;
    }
    else
    {
      var val ;
      var tmp ;
      tmp = '' ;      
      val = ExtComponents.getValue( name ) ;
      if ( val == 1 ) tmp = '1 osoba dorosÅ‚a' ;
      if ( val >  1 ) tmp = val +' osoby dorosÅ‚e' ;
      if ( val >  4 ) tmp = val + ' osÃ³b dorosÅ‚ych' ;
      document.getElementById( 'vis_'+name ).value = tmp ;      
    }
    try
    {
      this.itemsUpdateValues ( name ) ;
    }
    catch(err)
    { 
      // alert ( 'noItems' ) ;
    }
  }
  
  //
  // Akcje z interfejsu okna Items
  //
  
  this.itemsUpdateValues = function ( name )
  {
    ExtComponents.setValue ( 'mb_'+name, ExtComponents.getValue ( name ) ) ;
  }
  
  this.itemsCloseWindow = function ( name )
  {
    EditBox.itemsHideWindow( name ) ;
    ExtComponents.setValue ( name, ExtComponents.getValue ( 'mb_'+name ) );
  }
  
  this.itemsClear = function ( name )
  {
    ExtComponents.setValue ( name, '' ) ;
    this.itemsUpdateValues ( name ) ;
  }

}
SearchWindowAdults_default = new classSearchWindowAdults_default ;


// ---------- [ js/ucs/bp/search/elements/children/default/classSearchWindowChildren.js ] -------- 

/*
  (C) by KSI media sp. z o.o. ( www.ksimedia.pl )  
  Description : SearchWindowLengthPresentation class.
  Author      : MS
  Create date : 2010-08-22
  Comment     :
*/

function classSearchWindowChildren_default()
{
  this.blockItemsUpdate = false ;
  
  this.updateValue = function ( name )
  {    
    if ( ExtComponents.getValue( name ) == '' )
    {
      document.getElementById( 'vis_'+name ).value = ' - brak - ' ;
    }
    else
    {
      var val ;
      var val2 ;
      var tmp ;
      var itmp ;
      var tmp2 ;
      var i ;
      itmp = 0 ;
      tmp = '' ;
      val = ExtComponents.getValue( name ) ;     
      valArr = val.split ( ';' ) ;
      itmp = valArr.length ;
      if ( itmp == 1 ) tmp = '1 dziecko' ;
      if ( itmp == 2 ) tmp = '2 dzieci' ;
      if ( itmp == 3 ) tmp = '3 dzieci' ;
      if ( itmp == 4 ) tmp = '4 dzieci' ;
      tmp2 = '' ;
      for ( i in valArr )
      {
        val2 = valArr [ i ] ;
        if ( tmp2 != '' ) tmp2 = tmp2 + ', ' ;        
        if ( val2 == 0 ) tmp2 = tmp2 + '<2 lata' ;
        if ( val2 == 1 ) tmp2 = tmp2 + val2 + ' lata' ;
        if ( val2 == 2 ) tmp2 = tmp2 + val2 + ' lata' ;
        if ( val2 == 3 ) tmp2 = tmp2 + val2 + ' lata' ;
        if ( val2 == 4 ) tmp2 = tmp2 + val2 + ' lata' ;
        if ( val2 >  4 ) tmp2 = tmp2 + val2 + ' lat' ;
      }
      document.getElementById( 'vis_'+name ).value = tmp + ' (' + tmp2 + ')' ;
    }
    try
    {
      this.itemsUpdateValues ( name ) ;
    }
    catch(err)
    { 
      // alert ( 'noItems' ) ;
    }
  }
  
  //
  // Akcje z interfejsu okna Items
  //
  
  this.itemsUpdateValues = function ( name )
  {    
    var value ;
    if ( this.blockItemsUpdate == true ) return ;
    value = ExtComponents.getValue ( name ) ;
    valArr = value.split ( ';' ) ;
    for ( i in valArr )
    {
      ExtComponents.setValue ( 'mb_'+name+'_' + i, valArr[i] ) ;
    }
  }
  
  this.itemsOnClick = function ( name )
  {
    this.blockItemsUpdate = true ;
    ExtComponents.setValue ( name, this.itemsGetValue ( name ), true );
    this.blockItemsUpdate = false ;
  }
  
  this.itemsGetValue = function ( name ) 
  {
    var inValue ;
    var i ;
    var tmp ;
    inValue = '' ;
    for ( i = 0 ; i < 4 ; i++ )
    {
      tmp = ExtComponents.getValue ( 'mb_'+name+'_'+i ) ;
      if ( tmp != '' )
      {
        if ( inValue != '' ) inValue = inValue + ';' ;
        inValue = inValue + tmp ;
      }
    }
    return inValue ;
  }  
  
  this.itemsCloseWindow = function ( name )
  {
    EditBox.itemsHideWindow( name ) ;    
    ExtComponents.setValue ( name, this.itemsGetValue ( name ), true );
  }
  
  this.itemsClear = function ( name )
  {
    for ( i = 0 ; i < 4 ; i++ )
    {
      ExtComponents.setValue ('mb_'+ name +'_'+ i, '' ) ;       
    }
  
    ExtComponents.setValue (name, '' ) ;
    this.itemsUpdateValues ( name ) ;
  }

}
SearchWindowChildren_default = new classSearchWindowChildren_default ;


// ---------- [ js/ucs/bp/search/elements/feeding/default/classSearchWindowFeeding.js ] -------- 

/*
  (C) by KSI media sp. z o.o. ( www.ksimedia.pl )  
  Description : SearchWindowLengthPresentation class.
  Author      : MS
  Create date : 2010-08-22
  Comment     :
*/

function classSearchWindowFeeding_default()
{

  this.updateValue = function ( name )
  {
    if ( ExtComponents.getValue( name ) == '' )
    {
      document.getElementById( 'vis_'+name ).value = ' - dowolne - ' ;
    }
    else
    {
      document.getElementById( 'vis_'+name ).value = ExtComponents.getValue( name ).replace ( /;/g, ',' );
    }
    try
    {
      this.itemsUpdateValues ( name ) ;
    }
    catch(err)
    { 
      // alert ( 'noItems' ) ;
    }
  }
  
  //
  // Akcje z interfejsu okna Items
  //
  
  this.itemsUpdateValues = function ( name )
  {
    ExtComponents.setValue ( 'mb_'+name, ExtComponents.getValue ( name ), true ) ;
  }
    
  
  this.itemsCloseWindow = function ( name )
  {
    EditBox.itemsHideWindow( name ) ;
    ExtComponents.setValue ( name, ExtComponents.getValue ( 'mb_'+name ), true );
  }
  
  this.itemsClear = function ( name )
  {
    ExtComponents.setValue ( name, '', true ) ;
    this.itemsUpdateValues ( name ) ;
  }

}

SearchWindowFeeding_default = new classSearchWindowFeeding_default ;

// ---------- [ js/ucs/bp/search/elements/transport/default/classSearchWindowTransport.js ] -------- 

/*
  (C) by KSI media sp. z o.o. ( www.ksimedia.pl )  
  Description : SearchWindowLengthPresentation class.
  Author      : MS
  Create date : 2010-08-22
  Comment     :
*/

function classSearchWindowTransport_default()
{

  this.updateValue = function ( name )
  {
    if ( ExtComponents.getValue( name ) == '' )
    {
      document.getElementById( 'vis_'+name ).value = ' - dowolne - ' ;
    }
    else
    {
      document.getElementById( 'vis_'+name ).value = ExtComponents.getValue( name ).replace ( /;/g, ',' );
    }
    try
    {
      this.itemsUpdateValues ( name ) ;
    }
    catch(err)
    { 
      // alert ( 'noItems' ) ;
    }
  }
  
  //
  // Akcje z interfejsu okna Items
  //
  
  this.itemsUpdateValues = function ( name )
  {
    ExtComponents.setValue ( 'mb_'+name, ExtComponents.getValue ( name ), true ) ;
  }
    
  
  this.itemsCloseWindow = function ( name )
  {
    EditBox.itemsHideWindow( name ) ;
    ExtComponents.setValue ( name, ExtComponents.getValue ( 'mb_'+name ), true );
  }
  
  this.itemsClear = function ( name )
  {
    ExtComponents.setValue ( name, '', true ) ;
    this.itemsUpdateValues ( name ) ;
  }

}

SearchWindowTransport_default = new classSearchWindowTransport_default ;

// ---------- [ js/ucs/bp/search/elements/length/default/classSearchWindowLength.js ] -------- 

/*
  (C) by KSI media sp. z o.o. ( www.ksimedia.pl )  
  Description : SearchWindowLengthPresentation class.
  Author      : MS
  Create date : 2010-08-22
  Comment     :
*/

function classSearchWindowLength_default()
{

  this.updateValue = function ( name )
  {
    if ( ExtComponents.getValue( name ) == '' )
    {
      document.getElementById( 'vis_'+name ).value = ' - dowolna - ' ;
    }
    else
    {
      var val ;
      var tmp ;
      tmp = '' ;
      val = ExtComponents.getValue( name ) ;     
      if ( val == '6;8' ) tmp = '1 tydzieÅ„' ;
      if ( val == '13;15' ) tmp = '2 tygodnie' ;
      if ( val == '20;22' ) tmp = '3 tygodnie' ; 
      if ( val == '21' ) tmp = 'powyÅ¼ej 3 tygodni' ;
      if ( tmp == '' )
      {
        valArr = val.split ( ';' ) ;      
        if ( valArr[0] != undefined )
        {
          if ( valArr[0] != '' )
          {
            tmp = 'od '+ valArr[0] ;
          }
        }
        if ( valArr[1] != undefined )
        {
          if ( valArr[1] != '' )
          {
            tmp = tmp + ' do '+ valArr[1] ;
          }
        }
        tmp = tmp + ' dni' ;
      }
      document.getElementById( 'vis_'+name ).value = tmp ;      
    }
    try
    {
      this.itemsUpdateValues ( name ) ;
    }
    catch(err)
    { 
      // alert ( 'noItems' ) ;
    }
  }
  
  //
  // Akcje z interfejsu okna Items
  //
  
  this.itemsUpdateValues = function ( name )
  {
    ExtComponents.setValue ( 'mb_'+name, ExtComponents.getValue ( name ) ) ;
  }
  
  this.itemsCloseWindow = function ( name )
  {
    EditBox.itemsHideWindow( name ) ;
    ExtComponents.setValue ( name, ExtComponents.getValue ( 'mb_'+name ) );
  }
  
  this.itemsClear = function ( name )
  {
    ExtComponents.setValue ( name, '' ) ;
    this.itemsUpdateValues ( name ) ;
  }

}
SearchWindowLength_default = new classSearchWindowLength_default ;


// ---------- [ js/ucs/bp/search/elements/rating/default/classSearchWindowRating.js ] -------- 

/*
  (C) by KSI media sp. z o.o. ( www.ksimedia.pl )  
  Description : SearchWindowLengthPresentation class.
  Author      : MS
  Create date : 2010-08-22
  Comment     :
*/

function classSearchWindowRating_default()
{

  this.updateValue = function ( name )
  {
    if ( ExtComponents.getValue( name ) == '' )
    {
      document.getElementById( 'vis_'+name ).value = ' - dowolna - ' ;
    }
    else
    {
      var val ;
      var tmp ;
      tmp = '' ;
      val = ExtComponents.getValue( name ) ;     
      if ( tmp == '' )
      {
        valArr = val.split ( ';' ) ;
        if ( valArr[0] != undefined )
        {
          if ( valArr[0] != '' )
          {
            tmp = 'od '+ valArr[0]/10 ;
          }
        }
        if ( valArr[1] != undefined )
        {
          if ( valArr[1] != '' )
          {
            tmp = tmp + ' do '+ valArr[1]/10 ;
          }
        }
        tmp = tmp + ' pkt.' ;
      }
      document.getElementById( 'vis_'+name ).value = tmp ;      
    }
    try
    {
      this.itemsUpdateValues ( name ) ;
    }
    catch(err)
    { 
      // alert ( 'noItems' ) ;
    }
  }
  
  //
  // Akcje z interfejsu okna Items
  //
  
  this.itemsUpdateValues = function ( name )
  {
    ExtComponents.setValue ( 'mb_'+name, ExtComponents.getValue ( name ) ) ;
  }
  
  this.itemsCloseWindow = function ( name )
  {
    EditBox.itemsHideWindow( name ) ;
    ExtComponents.setValue ( name, ExtComponents.getValue ( 'mb_'+name ) );
  }
  
  this.itemsClear = function ( name )
  {
    ExtComponents.setValue ( name, '' ) ;
    this.itemsUpdateValues ( name ) ;
  }

}
SearchWindowRating_default = new classSearchWindowRating_default ;


// ---------- [ js/ucs/bp/search/elements/attributes/default/classSearchWindowAttributes.js ] -------- 

/*
  (C) by KSI media sp. z o.o. ( www.ksimedia.pl )  
  Description : SearchWindowLengthPresentation class.
  Author      : MS
  Create date : 2010-08-22
  Comment     :
*/

function classSearchWindowAttributes_default()
{

  this.updateValue = function ( name )
  {
    if ( ExtComponents.getValue( name ) == '' )
    {
      document.getElementById( 'vis_'+name ).value = ' - dowolne - ' ;
    }
    else
    {
      document.getElementById( 'vis_'+name ).value = ExtComponents.getValue( name ).replace ( /;/g, ',' );
    }
    try
    {
      this.itemsUpdateValues ( name ) ;
    }
    catch(err)
    { 
      // alert ( 'noItems' ) ;
    }
  }
  
  //
  // Akcje z interfejsu okna Items
  //
  
  this.itemsUpdateValues = function ( name )
  {
    ExtComponents.setValue ( 'mb_'+name, ExtComponents.getValue ( name ), true ) ;
  }
    
  
  this.itemsCloseWindow = function ( name )
  {
    EditBox.itemsHideWindow( name ) ;
    ExtComponents.setValue ( name, ExtComponents.getValue ( 'mb_'+name ), true );
  }
  
  this.itemsClear = function ( name )
  {
    ExtComponents.setValue ( name, '', true ) ;
    this.itemsUpdateValues ( name ) ;
  }

}

SearchWindowAttributes_default = new classSearchWindowAttributes_default ;

// ---------- [ js/ucs/bp/search/elements/tourOperator/default/classSearchWindowTourOperator.js ] -------- 

/*
  (C) by KSI media sp. z o.o. ( www.ksimedia.pl )  
  Description : SearchWindowLengthPresentation class.
  Author      : MS
  Create date : 2010-08-22
  Comment     :
*/

function classSearchWindowTourOperator_default()
{

  this.updateValue = function ( name )
  {
    if ( ExtComponents.getValue( name ) == '' )
    {
      document.getElementById( 'vis_'+name ).value = ' - dowolny - ' ;
    }
    else
    {
      document.getElementById( 'vis_'+name ).value = ExtComponents.getValue( name ).replace ( /;/g, ',' );
    }
    try
    {
      this.itemsUpdateValues ( name ) ;
    }
    catch(err)
    { 
      // alert ( 'noItems' ) ;
    }
  }
  
  //
  // Akcje z interfejsu okna Items
  //
  
  this.itemsUpdateValues = function ( name )
  {
    ExtComponents.setValue ( 'mb_'+name, ExtComponents.getValue ( name ), true ) ;
  }
    
  
  this.itemsCloseWindow = function ( name )
  {
    EditBox.itemsHideWindow( name ) ;
    ExtComponents.setValue ( name, ExtComponents.getValue ( 'mb_'+name ), true );
  }
  
  this.itemsClear = function ( name )
  {
    ExtComponents.setValue ( name, '', true ) ;
    this.itemsUpdateValues ( name ) ;
  }

}

SearchWindowTourOperator_default = new classSearchWindowTourOperator_default ;

// ---------- [ js/ucs/google/maps/classGoogleMaps.js ] -------- 

/*
  (C) by KSI media sp. z o.o. ( www.ksimedia.pl )  
  Description : Google Maps class.
  Author      : MS
  Create date : 2010-09-16
  Comment     :
*/

function classGoogleMaps ()
{
  this.maps = new Array() ;
  this.lastPosLat = new Array() ;
  this.lastPosLng = new Array() ;
  
  this.markersArrays = new Array() ;  
  this.linesArrays = new Array() ;
  
  this.lastEvent = new Array() ;
  this.events_click = new Array() ;
  this.events_dblclick = new Array() ;
  
  this.setPositionByLatLng = function ( name, latLng )
  {
  }
  
  this.setPositionByName = function ( name, searchLoc )
  {
    alert ( searchLoc ) ;
    var address = searchLoc ;
    var geocoder;
    geocoder = new google.maps.Geocoder();
    geocoder.geocode ( { 'address': address}, function(results, status) {
      if (status == google.maps.GeocoderStatus.OK)
      {
        GoogleMaps.maps[name].setCenter(results[0].geometry.location);
        var marker = new google.maps.Marker({
            map: GoogleMaps.maps[name], 
            position: results[0].geometry.location
        });
      }
      else
      {
        alert ( "Nie znaleziono lokalizacji ( " + status + ") :" + searchLoc ) ;
      }
    });
  }

  // adding Marker to map
  this.addMarker = function ( name, location )
  {
    marker = new google.maps.Marker({
      position: location, 
      map: GoogleMaps.maps[name] 
    });
    GoogleMaps.markersArrays[name].push(marker);
  }
  
  this.getLatLng = function ( lat, lng )
  {
    return new google.maps.LatLng( lat,lng ) ;
  }
  
  this.addCircle = function (__0_,__0,_0_,__0__){var _0_____ ;var __0____ ;var ____0___ ;var _____0__ ;var ______0_ ;var _______0 ;var ___0____ ;var _0_______ ;var __0______ ;var ___0_____ ;var ____0____ ;var _____0___ ;var ______0__ ;var _______0_ ;var ________0 ;var ________0__ ;var _________0_ ;var __________0 ;var __0__________ ;var __________0__ ;if(__0__==undefined)__0__='888888';__________0__=Math.PI;_0_______=__________0__/(18*10);___0____=_0_*0.0089907844459429085187*_0_______;_0_____=__0.lng()*_0_______;__0____=__0.lat()*_0_______;____0____=Math.sin(__0____)*Math.cos(___0____);_____0___=Math.cos(__0____)*Math.sin(___0____);______0__=Math.sin(___0____);_______0_=Math.cos(__0____)*Math.cos(___0____);________0=Math.sin(__0____)*Math.sin(___0____);_______0=__0____-___0____;______0_=_0_____;for(___0_____=1;___0_____<=72;___0_____++){__0______=(___0_____*5)*_0_______;________0__=Math.cos(__0______);_____0__=Math.asin(____0____-_____0___*________0__);__________0=______0__*Math.sin(__0______);__0__________=Math.atan(__________0/(_______0_+________0*________0__));_________0_=__________0/Math.cos(_____0__);____0___=_0_____+__0__________;GoogleMaps.addLine(__0_,GoogleMaps.getLatLng(_______0/_0_______,______0_/_0_______),GoogleMaps.getLatLng(_____0__/_0_______,____0___/_0_______),__0__);_______0=_____0__;______0_=____0___;}
  }

  this.addLine = function ( name, from, to, color )
  {
    if ( color == undefined ) color = '888888' ;
    var myLineC = [ from, to ] ;
    var myLine = new google.maps.Polyline({
      path: myLineC,
      strokeColor: color,
      strokeOpacity: 0.85,
      strokeWeight: 2
    });
    myLine.setMap ( GoogleMaps.maps[name] ) ;
    GoogleMaps.linesArrays[name].push(myLine);
  }

  // Removes the overlays from the map, but keeps them in the array
  this.clearOverlays = function ( name )
  {
    if (GoogleMaps.markersArrays[name])
    {
      for (i in GoogleMaps.markersArrays[name])
      {
        GoogleMaps.markersArrays[name][i].setMap(null);
      }
    }
  }

  // Shows any overlays currently in the array
  this.showOverlays = function ( name )
  {
    if (GoogleMaps.markersArrays[name])
    {
      for (i in GoogleMaps.markersArrays[name])
      {
        GoogleMaps.markersArrays[name][i].setMap(map);
      }
    }
  }

  // Deletes all markers in the array by removing references to them
  this.deleteOverlays = function ( name )
  {
    if (GoogleMaps.markersArrays[name])
    {
      for (i in GoogleMaps.markersArrays[name])
      {
        GoogleMaps.markersArrays[name][i].setMap(null);
      }
      GoogleMaps.markersArrays[name].length = 0;
    }
    
    if (GoogleMaps.linesArrays[name])
    {
      for (i in GoogleMaps.linesArrays[name])
      {
        GoogleMaps.linesArrays[name][i].setMap(null);
      }
      GoogleMaps.linesArrays[name].length = 0;
    }
  }

  this.init = function ( name, centerLatLng, zoom, mapTypeId )
  {    
	if ( centerLatLng == undefined ) 
    {
      centerLatLng = new google.maps.LatLng( 34.25, 16.88 ) ;
    }
    
    if ( zoom == undefined ) 
    {
      zoom = 3 ;
    }

    if ( mapTypeId == undefined ) 
    {
      mapTypeId = google.maps.MapTypeId.TERRAIN ;
    }
    
    this.maps[name] = new google.maps.Map(document.getElementById(name), {
      'zoom': zoom,
      'center': centerLatLng,
      'navigationControl':true,
      'mapTypeControl': false,
      'scaleControl': false,
      'mapTypeId': mapTypeId
    });
    
    GoogleMaps.markersArrays[name] = new Array();
    GoogleMaps.linesArrays[name] = new Array();
  
    google.maps.event.addListener( this.maps[name], 'click', function(mEvent) {
      var fn ;
      GoogleMaps.lastEvent [ name ] = mEvent ;
      if ( GoogleMaps.events_click [ name ] == undefined )
      {
      }
      else
      {
        fn = GoogleMaps.events_click [ name ] + "('" + name + "')" ;
        eval ( fn ) ;
      }
    });
    
    google.maps.event.addListener( this.maps[name], 'dblclick', function(mEvent) {
      var fn ;
      GoogleMaps.lastEvent [ name ] = mEvent ;
      if ( GoogleMaps.events_dblclick [ name ] == undefined )
      {
      }
      else
      {
        fn = GoogleMaps.events_dblclick [ name ] + "('" + name + "')" ;
        eval ( fn ) ;
      }
    });
  }
}

GoogleMaps = new classGoogleMaps ;

// ---------- [ js/units/extComponents/editBox/gps/classEditBox.js ] -------- 

/*
  (C) by KSI media sp. z o.o. ( www.ksimedia.pl )  
  Description : GPS EditBox class.
  Author      : MS
  Create date : 2010-08-22
  Comment     :
*/

function classEditBox_gps ()
{

  this.updateValues = function ( name )
  {
    var tmp ;
    var o ;
    var latLng ;
    tmp = ExtComponents.getValue ( name ) ;
    if ( tmp == '' )
    {
      document.getElementById ( 'vis_'+name ).value = ' - dowolny - ' ;
    }
    else
    {
      tmp = tmp.split ( ';' ) ;    
      if ( tmp.length == 3 ) 
      {
        o = '[' + tmp[0].substr ( 0,5 ) + ',' + tmp[1].substr ( 0,5 ) + '] +/- ' + tmp[2] + 'km'  ;
        ExtComponents.setValue ( 'gps_r_'+name, tmp[2] ) ;
        try
        {
          latLng = new google.maps.LatLng ( tmp[0], tmp[1] ) ;
          GoogleMaps.deleteOverlays ( name+'_gm' ) ;
          GoogleMaps.addMarker ( name+'_gm', latLng ) ;
          GoogleMaps.addCircle ( name+'_gm', latLng, tmp[2], '#ee4422' ) ;
        }
        catch(err)
        {
          //alert ( 'jeszcze nie ma' );
        }
      }
      else
      {
        o = '' ;
      }
      document.getElementById ( 'vis_'+name ).value = o ;
    }
  }
  
  this.mapClick = function ( name )
  {
    var p ;
    var name_obj ;    
    name_obj = name.substr(0,name.length-3);
    if ( GoogleMaps.lastEvent [ name ] == undefined )
    {
      var latLng ;
      var tmp ;
      tmp = ExtComponents.getValue ( name_obj ) ;
      tmp = tmp.split ( ';' ) ;
      latLng = new google.maps.LatLng ( tmp[0], tmp[1] ) ;
      p = document.getElementById ( 'gps_r_'+name_obj ).value ;
      p = latLng.lat() + ';' + latLng.lng() + ';' + p ;
      ExtComponents.setValue ( name_obj, p, false ) ;
    }
    else
    {
      mEvent = GoogleMaps.lastEvent [ name ] ;
      p = document.getElementById ( 'gps_r_'+name_obj ).value ;
      p = mEvent.latLng.lat() + ';' + mEvent.latLng.lng() + ';' + p ;
      ExtComponents.setValue ( name_obj, p, false ) ;
    }
  }

}

EditBox_gps = new classEditBox_gps () ;

// ---------- [ js/ucs/bp/search/elements/offerType/default/classSearchWindowOfferType.js ] -------- 

/*
  (C) by KSI media sp. z o.o. ( www.ksimedia.pl )  
  Description : SearchWindowLengthPresentation class.
  Author      : MS
  Create date : 2010-08-22
  Comment     :
*/

function classSearchWindowOfferType_default()
{

  this.updateValue = function ( name )
  {
    if ( ExtComponents.getValue( name ) == '' )
    {
      document.getElementById( 'vis_'+name ).value = ' - dowolne - ' ;
    }
    else
    {
      document.getElementById( 'vis_'+name ).value = ExtComponents.getValue( name ).replace ( /;/g, ',' );
    }
    try
    {
      this.itemsUpdateValues ( name ) ;
    }
    catch(err)
    { 
      // alert ( 'noItems' ) ;
    }
  }
  
  //
  // Akcje z interfejsu okna Items
  //
  
  this.itemsUpdateValues = function ( name )
  {
    ExtComponents.setValue ( 'mb_'+name, ExtComponents.getValue ( name ), true ) ;
  }
    
  
  this.itemsCloseWindow = function ( name )
  {
    EditBox.itemsHideWindow( name ) ;
    ExtComponents.setValue ( name, ExtComponents.getValue ( 'mb_'+name ), true );
  }
  
  this.itemsClear = function ( name )
  {
    ExtComponents.setValue ( name, '', true ) ;
    this.itemsUpdateValues ( name ) ;
  }

}

SearchWindowOfferType_default = new classSearchWindowOfferType_default ;

// ---------- [ js/ucs/bp/search/elements/temperature/default/classSearchWindowTemperature.js ] -------- 

/*
  (C) by KSI media sp. z o.o. ( www.ksimedia.pl )  
  Description : SearchWindowLengthPresentation class.
  Author      : MS
  Create date : 2010-08-22
  Comment     :
*/

function classSearchWindowTemperature_default()
{

  this.updateValue = function ( name )
  {
    if ( ExtComponents.getValue( name ) == '' )
    {
      document.getElementById( 'vis_'+name ).value = ' - dowolna - ' ;
    }
    else
    {
      var val ;
      var tmp ;
      tmp = '' ;
      val = ExtComponents.getValue( name ) ;     
      if ( tmp == '' )
      {
        valArr = val.split ( ';' ) ;      
        if ( valArr[0] != undefined )
        {
          if ( valArr[0] != '' )
          {
            tmp = 'od '+ valArr[0] + 'Â°C';
          }
        }
        if ( valArr[1] != undefined )
        {
          if ( valArr[1] != '' )
          {
            tmp = tmp + ' do '+ valArr[1] + 'Â°C';
          }
        }
      }
      document.getElementById( 'vis_'+name ).value = tmp ;      
    }
    try
    {
      this.itemsUpdateValues ( name ) ;
    }
    catch(err)
    { 
      // alert ( 'noItems' ) ;
    }
  }
  
  //
  // Akcje z interfejsu okna Items
  //
  
  this.itemsUpdateValues = function ( name )
  {
    ExtComponents.setValue ( 'mb_'+name, ExtComponents.getValue ( name ) ) ;
  }
  
  this.itemsCloseWindow = function ( name )
  {
    EditBox.itemsHideWindow( name ) ;
    ExtComponents.setValue ( name, ExtComponents.getValue ( 'mb_'+name ) );
  }
  
  this.itemsClear = function ( name )
  {
    ExtComponents.setValue ( name, '' ) ;
    this.itemsUpdateValues ( name ) ;
  }

}
SearchWindowTemperature_default = new classSearchWindowTemperature_default ;


// ---------- [ js/ucs/bp/search/searchWindow/classSearchWindow.js ] -------- 

/*
  (C) by KSI media sp. z o.o. ( www.ksimedia.pl )  
  Description : Search window params class.
  Author      : MS
  Create date : 2010-08-22
  Comment     :
*/

function classSearchWindow ()
{
  this.onLoadSrchParams = new Array();
  
  this.getCmpntValue = function ( srchName, cmpntName )
  {
    var value ;
    if ( document.getElementById ( srchName + cmpntName ) != null )
    {
      value = document.getElementById ( srchName + cmpntName ).value ;
      return value ;
    }
    else
    {
      return null ;
    }
  }
  
  this.setCmpntValue = function ( srchName, cmpntName, value )
  {
    if ( document.getElementById ( srchName + cmpntName ) != null )
    {
      ExtComponents.setValue ( srchName + cmpntName, value ) ;
    }
  }

  this.addParamArray = function ( paramName, strParam, addNullParams )
  {
    if ( strParam == null ) return '' ;
    var url = new String ;
    if ( addNullParams == undefined ) addNullParams = false ;
    if ( ( addNullParams == true )&&( strParam == '' ) )
    {
      url = '&' + paramName + '=' + strParam ;
    }
    else
    {
      if ( strParam == '' ) return '' ;
      var tmp ;
      var i ;
      url = '' ;
      tmp = strParam.split ( ';' ) ;
      for ( i = 0 ; i<tmp.length ; i++ )
      {
        url = url + '&' + paramName + '[]=' +tmp[i] ;
      }
    }
    return url ;
  }
  
  this.addParam = function ( paramName, strParam, addNullParams )
  {
    if ( strParam == null ) return '' ;
    if ( addNullParams == undefined ) addNullParams = false ;
    if (( addNullParams == false )&&( strParam == '' )) return '' ;
    var url = new String ;
    url = '&' + paramName + '=' + strParam ;
    return url ;
  }
  
  this.generateUrl = function ( srchParams, addNullParams, paramPrefix )
  {    
    var url = new String ;
    if ( addNullParams == undefined ) addNullParams = false ;
    if ( paramPrefix == undefined ) paramPrefix = 'srch' ;
    url = '' ;
    url = url + this.addParamArray ( paramPrefix+'CountryRegion', srchParams [ '_countryRegion' ], addNullParams ) ;    
    url = url + this.addParamArray ( paramPrefix+'Country', srchParams['_country' ], addNullParams ) ;
    url = url + this.addParamArray ( paramPrefix+'Region', srchParams['_region' ], addNullParams ) ;
    url = url + this.addParamArray ( paramPrefix+'City', srchParams['_city' ], addNullParams ) ;
    url = url + this.addParamArray ( paramPrefix+'DepartureFrom', srchParams [ '_departureFrom' ], addNullParams ) ;
    url = url + this.addParam      ( paramPrefix+'DepartureDateFrom', srchParams [ '_departureDateFrom' ], addNullParams ) ;
    url = url + this.addParam      ( paramPrefix+'DepartureDateTo', srchParams [ '_departureDateTo' ], addNullParams ) ;
    url = url + this.addParam      ( paramPrefix+'ReturnDateFrom', srchParams [ '_returnDateFrom' ], addNullParams ) ;
    url = url + this.addParam      ( paramPrefix+'ReturnDateTo', srchParams [ '_returnDateTo' ], addNullParams ) ;
    url = url + this.addParam      ( paramPrefix+'Adults', srchParams [ '_adults' ], addNullParams ) ;
    url = url + this.addParamArray ( paramPrefix+'Children', srchParams [ '_children' ], addNullParams ) ;
    url = url + this.addParamArray ( paramPrefix+'Feeding', srchParams [ '_feeding' ], addNullParams ) ;
    url = url + this.addParamArray ( paramPrefix+'Category', srchParams [ '_category' ], addNullParams ) ;
    url = url + this.addParamArray ( paramPrefix+'Transport', srchParams [ '_transport' ], addNullParams ) ;
    url = url + this.addParamArray ( paramPrefix+'Price', srchParams [ '_price' ], addNullParams ) ;
    url = url + this.addParamArray ( paramPrefix+'OfferName', srchParams [ '_offerName' ], addNullParams ) ;
    url = url + this.addParamArray ( paramPrefix+'Attributes', srchParams [ '_attributes' ], addNullParams ) ;
    url = url + this.addParamArray ( paramPrefix+'OfferType', srchParams [ '_offerType' ], addNullParams ) ;
    url = url + this.addParamArray ( paramPrefix+'Length', srchParams [ '_length' ], addNullParams ) ;
    url = url + this.addParamArray ( paramPrefix+'Rating', srchParams [ '_rating' ], addNullParams ) ;
    url = url + this.addParamArray ( paramPrefix+'Gps', srchParams [ '_gps' ], addNullParams ) ;
    url = url + this.addParamArray ( paramPrefix+'RoomType', srchParams [ '_roomType' ], addNullParams ) ;
    url = url + this.addParam      ( paramPrefix+'ResultsPerPage', srchParams [ '_resultsPerPage' ], addNullParams ) ;
    url = url + this.addParam      ( paramPrefix+'ResultsPageNumber', srchParams [ '_resultsPageNumber' ], addNullParams ) ;
    url = url + this.addParamArray ( paramPrefix+'OfferId', srchParams [ '_offerId' ], addNullParams ) ;
    url = url + this.addParamArray ( paramPrefix+'OfferCatalog', srchParams [ '_offerCatalog' ], addNullParams ) ;
    url = url + this.addParamArray ( paramPrefix+'Sort', srchParams [ '_sort' ], addNullParams ) ;
    url = url + this.addParamArray ( paramPrefix+'Temperature', srchParams [ '_temperature' ], addNullParams ) ;
    url = url + this.addParam      ( paramPrefix+'Currency', srchParams [ '_currency' ], addNullParams ) ;
    url = url + this.addParamArray ( paramPrefix+'TourOperator', srchParams [ '_tourOperator' ], addNullParams ) ;
    url = url + this.addParamArray ( paramPrefix+'Text', srchParams [ '_text' ], addNullParams ) ;
    return url ;    
  }
  
  this.collectData = function ( srchName, addNullParams, paramPrefix )
  {
    var params ;
    if ( addNullParams == undefined ) addNullParams = false ;
    if ( paramPrefix == undefined ) paramPrefix = 'srch' ;
    params = new Array ;
    params['_countryRegion' ]     = this.getCmpntValue ( srchName, 'countryRegion' ) ;    
    params['_country' ]           = this.getCmpntValue ( srchName, 'country' ) ;
    params['_region' ]            = this.getCmpntValue ( srchName, 'region' ) ;
    params['_city' ]              = this.getCmpntValue ( srchName, 'city' ) ;
    params['_departureFrom' ]     = this.getCmpntValue ( srchName, 'departureFrom' ) ;
    params['_departureDateFrom' ] = this.getCmpntValue ( srchName, 'departureDateFrom' ) ;
    params['_departureDateTo' ]   = this.getCmpntValue ( srchName, 'departureDateTo' ) ;
    params['_returnDateFrom' ]    = this.getCmpntValue ( srchName, 'returnDateFrom' ) ;
    params['_returnDateTo' ]      = this.getCmpntValue ( srchName, 'returnDateTo' ) ;
    params['_adults' ]            = this.getCmpntValue ( srchName, 'adults' ) ;
    params['_children' ]          = this.getCmpntValue ( srchName, 'children' ) ;
    params['_feeding' ]           = this.getCmpntValue ( srchName, 'feeding' ) ;
    params['_category' ]          = this.getCmpntValue ( srchName, 'category' ) ;
    params['_transport' ]         = this.getCmpntValue ( srchName, 'transport' ) ;
    params['_price' ]             = this.getCmpntValue ( srchName, 'price' ) ;
    params['_offerName' ]         = this.getCmpntValue ( srchName, 'offerName' ) ;
    params['_attributes' ]        = this.getCmpntValue ( srchName, 'attributes' ) ;
    params['_offerType' ]         = this.getCmpntValue ( srchName, 'offerType' ) ;
    params['_length' ]            = this.getCmpntValue ( srchName, 'length' ) ;
    params['_rating' ]            = this.getCmpntValue ( srchName, 'rating' ) ;
    params['_gps' ]               = this.getCmpntValue ( srchName, 'gps' ) ;
    params['_roomType' ]          = this.getCmpntValue ( srchName, 'roomType' ) ;
    params['_resultsPerPage' ]    = this.getCmpntValue ( srchName, 'resultsPerPage' ) ;
    params['_resultsPageNumber' ] = this.getCmpntValue ( srchName, 'resultsPageNumber' ) ;
    params['_offerId' ]           = this.getCmpntValue ( srchName, 'offerId' ) ;
    params['_offerCatalog' ]      = this.getCmpntValue ( srchName, 'offerCatalog' ) ;
    params['_sort' ]              = this.getCmpntValue ( srchName, 'sort' ) ;
    params['_temperature' ]       = this.getCmpntValue ( srchName, 'temperature' ) ;
    params['_currency' ]          = this.getCmpntValue ( srchName, 'currency' ) ;
    params['_tourOperator' ]      = this.getCmpntValue ( srchName, 'tourOperator' ) ;
    params['_text']               = this.getCmpntValue ( srchName, 'text' ) ;    
    return this.generateUrl ( params, addNullParams, paramPrefix ) ;
  }
  
  this.updateComponentsValues = function ( srchName ) 
  {    
    this.setCmpntValue ( srchName, 'countryRegion', this.onLoadSrchParams['_countryRegion' ] ) ;
    this.setCmpntValue ( srchName, 'country', this.onLoadSrchParams['_country' ] ) ;
    this.setCmpntValue ( srchName, 'region', this.onLoadSrchParams['_region' ] ) ;
    this.setCmpntValue ( srchName, 'city', this.onLoadSrchParams['_city' ] ) ;
    this.setCmpntValue ( srchName, 'departureFrom', this.onLoadSrchParams['_departureFrom' ] ) ;
    this.setCmpntValue ( srchName, 'departureDateFrom', this.onLoadSrchParams['_departureDateFrom' ] ) ;
    this.setCmpntValue ( srchName, 'departureDateTo', this.onLoadSrchParams['_departureDateTo' ] ) ;
    this.setCmpntValue ( srchName, 'returnDateFrom', this.onLoadSrchParams['_returnDateFrom' ] ) ;
    this.setCmpntValue ( srchName, 'returnDateTo', this.onLoadSrchParams['_returnDateTo' ] ) ;
    this.setCmpntValue ( srchName, 'adults', this.onLoadSrchParams['_adults' ] ) ;
    this.setCmpntValue ( srchName, 'children', this.onLoadSrchParams['_children' ] ) ;
    this.setCmpntValue ( srchName, 'feeding', this.onLoadSrchParams['_feeding' ] ) ;
    this.setCmpntValue ( srchName, 'category', this.onLoadSrchParams['_category' ] ) ;
    this.setCmpntValue ( srchName, 'transport', this.onLoadSrchParams['_transport' ] ) ;
    this.setCmpntValue ( srchName, 'price', this.onLoadSrchParams['_price' ] ) ;
    this.setCmpntValue ( srchName, 'offerName', this.onLoadSrchParams['_offerName' ] ) ;
    this.setCmpntValue ( srchName, 'attributes', this.onLoadSrchParams['_attributes' ] ) ;
    this.setCmpntValue ( srchName, 'offerType', this.onLoadSrchParams['_offerType' ] ) ;
    this.setCmpntValue ( srchName, 'length', this.onLoadSrchParams['_length' ] ) ;
    this.setCmpntValue ( srchName, 'rating', this.onLoadSrchParams['_rating' ] ) ;
    this.setCmpntValue ( srchName, 'gps', this.onLoadSrchParams['_gps' ] ) ;
    this.setCmpntValue ( srchName, 'roomType', this.onLoadSrchParams['_roomType' ] ) ;
    this.setCmpntValue ( srchName, 'resultsPerPage', this.onLoadSrchParams['_resultsPerPage' ] ) ;
    this.setCmpntValue ( srchName, 'resultsPageNumber', this.onLoadSrchParams['_resultsPageNumber' ] ) ;
    this.setCmpntValue ( srchName, 'offerId', this.onLoadSrchParams['_offerId' ] ) ;
    this.setCmpntValue ( srchName, 'offerCatalog', this.onLoadSrchParams['_offerCatalog' ] ) ;
    this.setCmpntValue ( srchName, 'sort', this.onLoadSrchParams['_sort' ] ) ;
    this.setCmpntValue ( srchName, 'temperature', this.onLoadSrchParams['_temperature' ] ) ;
    this.setCmpntValue ( srchName, 'currency', this.onLoadSrchParams['_currency' ] ) ;
    this.setCmpntValue ( srchName, 'tourOperator', this.onLoadSrchParams['_tourOperator' ] ) ;
    this.setCmpntValue ( srchName, 'text', this.onLoadSrchParams['_text'] ) ;
  }
  
  this.closeParamItems = function ( objName )
  {
    if ( document.getElementById ( objName ) != null )
    {
      document.getElementById ( objName ).style.display = 'none' ;
    }
  }
  
  this.closeAllParams = function ( obj )
  {    
    this.closeParamItems ( 'itemsList_' + obj + 'countryRegion' ) ;
    this.closeParamItems ( 'itemsList_' + obj + 'country' ) ;
    this.closeParamItems ( 'itemsList_' + obj + 'region' ) ;
    this.closeParamItems ( 'itemsList_' + obj + 'city' ) ;
    this.closeParamItems ( 'itemsList_' + obj + 'departureFrom' ) ;
    this.closeParamItems ( 'itemsList_' + obj + 'departureDateFrom' ) ;
    this.closeParamItems ( 'itemsList_' + obj + 'departureDateTo' ) ;
    this.closeParamItems ( 'itemsList_' + obj + 'returnDateFrom' ) ;
    this.closeParamItems ( 'itemsList_' + obj + 'returnDateTo' ) ;
    this.closeParamItems ( 'itemsList_' + obj + 'adults' ) ;
    this.closeParamItems ( 'itemsList_' + obj + 'children' ) ;
    this.closeParamItems ( 'itemsList_' + obj + 'feeding' ) ;
    this.closeParamItems ( 'itemsList_' + obj + 'category' ) ;
    this.closeParamItems ( 'itemsList_' + obj + 'transport' ) ;
    this.closeParamItems ( 'itemsList_' + obj + 'price' ) ;
    this.closeParamItems ( 'itemsList_' + obj + 'offerName' ) ;
    this.closeParamItems ( 'itemsList_' + obj + 'attributes' ) ;
    this.closeParamItems ( 'itemsList_' + obj + 'offerType' ) ;
    this.closeParamItems ( 'itemsList_' + obj + 'length' ) ;
    this.closeParamItems ( 'itemsList_' + obj + 'rating' ) ;
    this.closeParamItems ( 'itemsList_' + obj + 'gps' ) ;
    this.closeParamItems ( 'itemsList_' + obj + 'roomType' ) ;
    this.closeParamItems ( 'itemsList_' + obj + 'resultsPerPage' ) ;
    this.closeParamItems ( 'itemsList_' + obj + 'resultsPageNumber' ) ;
    this.closeParamItems ( 'itemsList_' + obj + 'offerId' ) ;
    this.closeParamItems ( 'itemsList_' + obj + 'offerCatalog' ) ;
    this.closeParamItems ( 'itemsList_' + obj + 'sort' ) ;
    this.closeParamItems ( 'itemsList_' + obj + 'temperature' ) ;
    this.closeParamItems ( 'itemsList_' + obj + 'currency' ) ;
    this.closeParamItems ( 'itemsList_' + obj + 'tourOperator' ) ;
    this.closeParamItems ( 'itemsList_' + obj + 'text' ) ;
  }

}

SearchWindow = new classSearchWindow () ;

// ---------- [ js/ucs/bp/search/searchWindow/main/classSearchWindow.js ] -------- 

  /*
  (C) by KSI media sp. z o.o. ( www.ksimedia.pl )  
  Description : Search window params class.
  Author      : MS
  Create date : 2010-08-22
  Comment     :
*/

function classSearchWindow_main ()
{
  this.hiddenFields = Array() ;
   
  this.activateHiddenFields = function ( obj )
  {
    this.hiddenFields [ obj ] = $.cookie ( obj+'hiddenFields' ) ;
    if ( this.hiddenFields [ obj ] == 'open' )
    {
      document.getElementById ( obj+'hiddenFields' ).style.display = 'block' ;
      this.hiddenFields [ obj ] = 'open' ;
      $.cookie ( obj+'hiddenFields', 'open' ) ;
      document.getElementById ( obj+'_search_text' ).innerHTML = 'Wyszukiwanie proste';
    }
    else
    {
      document.getElementById ( obj+'hiddenFields' ).style.display = 'none' ;
      this.hiddenFields [ obj ] = 'close' ;
      $.cookie ( obj+'hiddenFields', 'close' ) ;
      document.getElementById ( obj+'_search_text' ).innerHTML = 'Wyszukiwanie zaawansowane';
    }
  }
  
  this.showHiddenFields = function ( obj )
  {
    if ( this.hiddenFields [ obj ] != 'open' )
    {
      document.getElementById ( obj+'hiddenFields' ).style.display = 'block' ;
      this.hiddenFields [ obj ] = 'open' ;
      $.cookie ( obj+'hiddenFields', 'open' ) ;
      document.getElementById ( obj+'_search_text' ).innerHTML = 'Wyszukiwanie proste';
    }
    else
    {
      document.getElementById ( obj+'hiddenFields' ).style.display = 'none' ;
      this.hiddenFields [ obj ] = 'close' ;
      $.cookie ( obj+'hiddenFields', 'close' ) ;
      document.getElementById ( obj+'_search_text' ).innerHTML = 'Wyszukiwanie zaawansowane';
    }
  }
  
  this.btnSearchMouseOver = function ( obj )
  {
    obj.style.background='url(data/images/search_main/button_over.png)';
  }
  
  this.btnSearchMouseOut = function ( obj )
  {
    obj.style.background='url(data/images/search_main/button.png)';
  }

  this.go = function ( srchName )
  {
    url = 'index.php?module=bp/regionsList&srchForceClearParams=yes' ;
    url = url + SearchWindow.collectData ( srchName ) ;
    location.href = encodeURI(url) ;
  }
  
  this.transportTab = function ( obj, transport )
  {
    document.getElementById('samolot').style.backgroundImage='url(data/images/main/search_samolot.png)';
    document.getElementById('autokar').style.backgroundImage='url(data/images/main/search_autokar.png)';
    document.getElementById('wlasny').style.backgroundImage='url(data/images/main/search_wlasny.png)';
    document.getElementById('classMain_default_search_t').style.backgroundImage='url(data/images/main/search_t2.png)';
    
    document.getElementById('samolot').style.color='#333333'; 
    document.getElementById('autokar').style.color='#333333'; 
    document.getElementById('wlasny').style.color='#333333'; 
    
    if ((transport == 'wlasny') || (transport == 'autokar'))
    {
      document.getElementById('classMain_default_search_t').style.backgroundImage='url(data/images/main/search_t3.png)';
    }
    
    document.getElementById(transport).style.backgroundImage='url(data/images/main/search_'+ transport +'_act.png)';
    document.getElementById(transport).style.color='#ffffff'; 
    
    ExtComponents.setValue ( obj + 'transport', transport ) ;
  }
}
SearchWindow_main = new classSearchWindow_main () ;

// ---------- [ js/ucs/cms/menu/classMenu.js ] -------- 

//
// Created by KSI ( www.ksimedia.pl )
//

function classMenu() {

  this.init2 = function ( x )
  {
    $(document).ready( function() {
      $('a[rel*=external]').attr('target','_blank');
      $('a[target="nowe_okno"]').parents('table').removeAttr('onclick');
      $('table a[target="nowe_okno"]').attr('target','_blank');
      $('table a[target="biezace_okno"]').removeAttr('target');
    });  
  }
  
}

var Menu = new classMenu() ;
Menu.init2();

// ---------- [ js/units/pageGenerator/classPageGenerator.js ] -------- 

function classPageGenerator()
{
  this.imgBuff = new Array() ;  

  this.initExternalLinks = function ()
  {
    $(document).ready( function() {
      $('a[rel*=external]').attr('target','_blank');
      $('a[target="nowe_okno"]').parents('table').removeAttr('onclick');
      $('table a[target="nowe_okno"]').attr('target','_blank');
      $('table a[target="biezace_okno"]').removeAttr('target');
    });  
  }

  this.preloadImage = function ( url )
  {
    this.imgBuff[0] = new Image() ;
    this.imgBuff[0].src = url ;    
  }
  
  this.addBookmark = function ( url, title )
  {  
    if (window.sidebar) {
      window.sidebar.addPanel(title, url,'');
    }
    else if( window.external ) {
      window.external.AddFavorite( url, title);
    }
    else if(window.opera && window.print)
    {
      return true;
    }  
  }
}
PageGenerator = new classPageGenerator;
PageGenerator.initExternalLinks();

// ---------- [ js/ucs/bp/offerNotes/default/classOffersNotes.js ] -------- 

/*
  (C) by KSI media sp. z o.o. ( www.ksimedia.pl )  
  Description : offer notes class.
  Author      : MS
  Create date : 2010-12-07
  Comment     :
*/

function classOfferNotes_default ()
{  

  this.getList = function ()
  {
    var lista ;
    lista = $.cookie ( 'KSIofferNotesList' ) ;
    if ( lista == undefined )
    {
      lista = '' ;
    }
    return lista ;
  }
  
  this.getListArray = function ()
  {
    var lista ;
    var valueArr ;
    lista = this.getList() ;
    valueArr = lista.split ( ',' ) ;
    return valueArr ;
  }
  
  this.saveArray = function ( listArr )
  {
    var lista ;
    lista = listArr.toString() ;
    $.cookie ( 'KSIofferNotesList', lista ) ; // i na 7 dni
    return true ;
  }
    
  this.removeElement = function ( extOfferId, contentToHideId, itemHide )
  {
    var listArr ;
    
    if (!( contentToHideId == undefined ))
    {
      document.getElementById( contentToHideId ).style.display = 'none' ;
    }

    if (itemHide == 'yes')
    {
      if(document.getElementById( 'offersListItem_'+extOfferId ))
      {
        document.getElementById( 'offersListItem_'+extOfferId ).style.display = 'none' ;
      }
    }
        
    listArr = this.getListArray() ;
    listArr.push ( extOfferId ) ;
    var i ;
    for ( i = 0;  i < listArr.length; i++ )
    {
      if ( listArr[i] == extOfferId )
      {
        listArr.splice ( i ,1 ) ; 
        i = i - 1 ;
      }
    }  
    this.saveArray ( listArr ) ;
    document.getElementById ( 'lista_notes_on_'+extOfferId ).style.display = 'none' ;
    document.getElementById ( 'lista_notes_off_'+extOfferId ).style.display = 'block' ;
    
    return true ;
  }

  this.addElement = function ( extOfferId )
  {
    var listArr ;
    listArr = this.getListArray();
    listArr.push ( extOfferId ) ;
    this.saveArray ( listArr ) ;
    document.getElementById ( 'lista_notes_on_'+extOfferId ).style.display = 'block' ;
    document.getElementById ( 'lista_notes_off_'+extOfferId ).style.display = 'none' ;
    return true ;
  }
  
  this.generateOfferLink = function ()
  {
    var listExtOfferIdStr;
    var listExtOfferIdTab;
    var link;
    var listExtOfferId;
    link = 'index.php?module=bp/notesList' ;
    listExtOfferIdStr = $.cookie ( 'KSIofferNotesList' ) ;

    if (listExtOfferIdStr != null && listExtOfferIdStr != undefined && listExtOfferIdStr != '')
    {
      listExtOfferIdTab = listExtOfferIdStr.split( ',' );
      link = 'index.php?module=bp/notesList&extOfferId[]=';
      for (listExtOfferId in listExtOfferIdTab)
      {
        if (listExtOfferIdTab[listExtOfferId] != '')
        {
          link = link + listExtOfferIdTab[listExtOfferId] +'&extOfferId[]=';
        }
      }
      link = link.slice(0, -14);
      
      if (link == 'index.php?module=bp/notesList')
      {
        link = 'index.php?module=bp/notesList' ;
      }
    }
    else
    {
      link = 'index.php?module=bp/notesList' ;
    }
    
    return link;
  }
}

OfferNotes_default = new classOfferNotes_default() ;
