Drupal.locale = { 'pluralFormula': function ($n) { return Number((($n==1)?(0):((((($n%10)>=2)&&(($n%10)<=4))&&((($n%100)<10)||(($n%100)>=20)))?(1):2))); }, 'strings': {"An AJAX HTTP error occurred.":"Wyst\u0105pi\u0142 b\u0142\u0105d w AJAX HTTP.","HTTP Result Code: !status":"B\u0142\u0105d HTTP: !status","An AJAX HTTP request terminated abnormally.":"Zapytanie AJAX HTTP zosta\u0142o przerwane.","Debugging information follows.":"Informacje diagnostyczne.","Path: !uri":"\u015acie\u017cka: !uri","StatusText: !statusText":"StatusText: !statusText","ResponseText: !responseText":"ResponseText: !responseText","ReadyState: !readyState":"ReadyState: !readyState","Disabled":"Wy\u0142\u0105czony","Enabled":"W\u0142\u0105czony","Edit":"Edytuj","Configure":"Konfiguruj","Done":"Gotowe","Show":"Poka\u017c","Select all rows in this table":"Zaznacza wszystkie wiersze tabeli","Deselect all rows in this table":"Cofa zaznaczenie wszystkich wierszy tabeli","Not published":"Nie do publikacji","Please wait...":"Prosz\u0119 czeka\u0107...","Hide":"Ukryj","Loading":"\u0141adowanie","By @name on @date":"Przez @name w @date","By @name":"Przez @name","Not in menu":"Nie ma w menu","Alias: @alias":"Alias: @alias","No alias":"Brak aliasu","New revision":"Nowa wersja","Drag to re-order":"Chwy\u0107, by zmieni\u0107 kolejno\u015b\u0107","Changes made in this table will not be saved until the form is submitted.":"Zmiany wprowadzone w tabeli zachowuje si\u0119 przyciskiem u do\u0142u formularza.","The changes to these blocks will not be saved until the \u003cem\u003eSave blocks\u003c\/em\u003e button is clicked.":"Zmiany wprowadzone w blokach zachowuje si\u0119 przyciskiem u do\u0142u formularza.","This permission is inherited from the authenticated user role.":"Te uprawnienia s\u0105 dziedziczone wed\u0142ug rangi zalogowanego u\u017cytkownika.","No revision":"Brak wersji","@number comments per page":"@number odpowiedzi na stronie","Requires a title":"Tytu\u0142 wymagany","Not restricted":"Bez ogranicze\u0144","(active tab)":"(aktywna karta)","Not customizable":"Niekonfigurowalne","Restricted to certain pages":"Ograniczenie do okre\u015blonych stron.","The block cannot be placed in this region.":"Blok nie mo\u017ce by\u0107 umieszczony w tym obszarze.","Customize dashboard":"Dostosuj kokpit","Hide summary":"Ukryj podsumowanie","Edit summary":"Edytuj podsumowanie","Don't display post information":"Ukrycie informacji o wpisie","@title dialog":"@title dialog","The selected file %filename cannot be uploaded. Only files with the following extensions are allowed: %extensions.":"Wybrany plik %filename nie m\u00f3g\u0142 zosta\u0107 wys\u0142any. Dozwolone s\u0105 jedynie nast\u0119puj\u0105ce rozszerzenia: %extensions.","Re-order rows by numerical weight instead of dragging.":"Zmie\u0144 kolejno\u015b\u0107 wierszy podaj\u0105c warto\u015bci numeryczne zamiast przeci\u0105gaj\u0105c.","Show row weights":"Poka\u017c wagi wierszy","Hide row weights":"Ukryj wagi wierszy","An error occurred at ":"B\u0142\u0105d wyst\u0105pi\u0142 w ","jQuery UI Tabs: Mismatching fragment identifier.":"jQuery UI Tabs: Niepasuj\u0105cy fragment identyfikatora.","jQuery UI Tabs: Not enough arguments to add tab.":"jQuery UI Tabs: Za ma\u0142o argument\u00f3w by doda\u0107 zak\u0142adk\u0119."} };;
(function ($) {

Drupal.shoutbox = {}
Drupal.behaviors.shoutbox = {
    attach: function(context, settings) {
	// Declare AJAX behavior for the form
	var options = {
	    resetForm: true,
	    beforeSubmit: Drupal.shoutbox.validate,
	    success: Drupal.shoutbox.success
	};
	
	// Detect the shout form
	var shoutForm = $('#shoutbox-add-form:not(.shoutbox-processed)');
	
	if (shoutForm.length) {
	    // Set a class to the form indicating that it's been processed
	    $(shoutForm).addClass('shoutbox-processed');
	    
	    // Add AJAX behavior to the form
	    $(shoutForm).ajaxForm(options);

	    // Tell the form that we have Javascript enabled
	    $(shoutForm).find('#edit-js').val(1);
	    
	    // Empty the shout textfield
	    $(shoutForm).find('#edit-message').val('');
	    
	    // Close errors if they're clicked
	    $('#shoutbox-error').click(function() {
		$(this).hide(); 
	    });

	    // Show the admin links on hover
	    Drupal.shoutbox.adminHover();
	    
	    // Initialize the timer for shout updates
	    Drupal.shoutbox.shoutTimer('start');
	}
    }
};


/**
 * Attach a hover event to the shoutbox admin links
 */
Drupal.shoutbox.adminHover = function() {
  // Remove binded events
  $('#shoutbox-body .shoutbox-msg').unbind();
  
  // Bind hover event on admin links
  $('#shoutbox-body .shoutbox-msg').hover(
    function() {
      $(this).find('.shoutbox-admin-links').show();
    },
    function() {
      $(this).find('.shoutbox-admin-links').hide();
    }
  );
}

/**
 * Fix the destination query on shout admin link URLs
 * 
 * This is required because on an AJAX reload of shouts, the
 * ?destination= query on shout admin links points to the JS
 * callback URL
 */
Drupal.shoutbox.adminFixDestination = function() {
  var href = '';
  $('.shoutbox-admin-links').find('a').each(function() {
    // Extract the current href
    href= $(this).attr('href');
    // Remove the query
    href = href.substr(0, href.indexOf('?'));
    // Add the new destination
    href = href + '?destination=' + Drupal.settings.shoutbox.currentPath;
    // Set the new href
    $(this).attr('href', href);
  });
}

/**
 * Callback for a successful shout submission
 */
Drupal.shoutbox.success = function(responseText) {
  // Load the latest shouts
	var errorDiv = $('#edit-error-message');
	Drupal.shoutbox.loadShouts(true);
	$('#block-shoutbox-shoutbox div fieldset input.form-text').css('display','none');
	$('#edit-error-message').addClass('success');
	$('#edit-error-message').css('display','block');
	$('#edit-error-message').text('Wpis został przekazany do moderacji.');
  // var contentHeight = $('#content').height();
  // $('.half').height(contentHeight);
  // $('.quarter').height(contentHeight);

}

/**
 * Starts or stops a timer that triggers every delay seconds.
 */
Drupal.shoutbox.shoutTimer = function(op) {
  var delay = Drupal.settings.shoutbox.refreshDelay;
  if (delay > 0) {
    switch (op) {
      case 'start':
        Drupal.shoutbox.interval = setInterval("Drupal.shoutbox.loadShouts()", delay);
        break;
      
      case 'stop':
        clearInterval(Drupal.shoutbox.interval);
        break;
    }
	}	
}

/**
 * Reloads all shouts from the server.
 */
Drupal.shoutbox.loadShouts = function(restoreForm) {
  // Stop the timer
  Drupal.shoutbox.shoutTimer('stop');
  
	$.ajax({
    url: Drupal.settings.shoutbox.refreshPath,
    type: "GET",
    cache: "false",
    dataType: "json",
    data: {mode: Drupal.settings.shoutbox.mode},
    success: function (response) {
      // Update the shouts
      $("#shoutbox-body").html(response.data);
      
      // Rebind the hover for admin links
      Drupal.shoutbox.adminHover();
      
      // Fix the destination URL queries on admin links
      Drupal.shoutbox.adminFixDestination();
      
      // Resume the timer
      Drupal.shoutbox.shoutTimer('start');
      
      // Hide any errors
      $('#shoutbox-error').hide();
      
      // Invoke a hook for other modules to act on the added shout.
      $.each(Drupal.shoutbox.afterPost, function (func) {
        if ($.isFunction(this.execute)) {
          this.execute();
        }
      });
      
      // Restore the button
      if (restoreForm) {
        $('#shoutbox-add-form input#edit-submit').show();
        $('#shoutbox-throbber').hide();
      }
    },
    error: function() {
      $('#shoutbox-error').html(Drupal.t('Odśwież stronę.'));
      $('#shoutbox-error').show();
    }
  });
}

/**
 * Validate input before submitting.
 * Don't accept default values or empty strings.
 */
Drupal.shoutbox.validate = function (formData, jqForm, options) {
  var errorMsg = '';
  var errorDiv = $('#edit-error-message');
  var form = jqForm[0];

  // Check if a message is present
  if ((!form.message.value)) {
	  errorMsg = Drupal.t('Wpisz wiadomość');
  }
  
  // If a maxlength is set, enforce it
  if ((Drupal.settings.shoutbox.maxLength > 0) && (form.message.value.length > Drupal.settings.shoutbox.maxLength)) {
	  errorMsg = Drupal.t('Wpis jest za długi - max. 255 znaków.');
  }    
  
  if (errorMsg) {
    // Show the message and stop heres
    errorDiv.html(errorMsg);
    errorDiv.show();
    return false;
  }
  else {
    // No errors registered, continue
	errorDiv.hide();
	errorDiv.html('');
	//errorDiv.addClass('.success');
	//errorMsg = Drupal.t('Wpis został przekazany do moderacji.');
	
  }
  
  // Clear the form input 
  $('#shoutbox-add-form').resetForm();
  $('#shoutbox-throbber').show();
  $('#shoutbox-add-form input#edit-submit').hide();

  return true;	
};

})(jQuery);
;
// $Id: googleanalytics.js,v 1.11.2.2 2011/01/02 15:35:59 hass Exp $
(function ($) {

$(document).ready(function() {

  // Attach onclick event to document only and catch clicks on all elements.
  $(document.body).click(function(event) {
    // Catch only the first parent link of a clicked element.
    $(event.target).parents("a:first,area:first").andSelf().filter("a,area").each(function() {

      var ga = Drupal.settings.googleanalytics;
      // Expression to check for absolute internal links.
      var isInternal = new RegExp("^(https?):\/\/" + window.location.host, "i");
      // Expression to check for special links like gotwo.module /go/* links.
      var isInternalSpecial = new RegExp("(\/go\/.*)$", "i");
      // Expression to check for download links.
      var isDownload = new RegExp("\\.(" + ga.trackDownloadExtensions + ")$", "i");

      // Is the clicked URL internal?
      if (isInternal.test(this.href)) {
        // Is download tracking activated and the file extension configured for download tracking?
        if (ga.trackDownload && isDownload.test(this.href)) {
          // Download link clicked.
          var extension = isDownload.exec(this.href);
          _gaq.push(["_trackEvent", "Downloads", extension[1].toUpperCase(), this.href.replace(isInternal, '')]);
        }
        else if (isInternalSpecial.test(this.href)) {
          // Keep the internal URL for Google Analytics website overlay intact.
          _gaq.push(["_trackPageview", this.href.replace(isInternal, '')]);
        }
      }
      else {
        if (ga.trackMailto && $(this).is("a[href^=mailto:],area[href^=mailto:]")) {
          // Mailto link clicked.
          _gaq.push(["_trackEvent", "Mails", "Click", this.href.substring(7)]);
        }
        else if (ga.trackOutgoing && this.href) {
          // External link clicked.
          _gaq.push(["_trackEvent", "Outgoing links", "Click", this.href]);
        }
      }
    });
  });
});

})(jQuery);
;

