//trim
String.prototype.trim = function() { return this.replace(/^\s+|\s+$/g, ''); }

//This prototype is provided by the Mozilla foundation and
//is distributed under the MIT license.
//http://www.ibiblio.org/pub/Linux/LICENSES/mit.license
if (!Array.prototype.forEach)
{
  Array.prototype.forEach = function(fun /*, thisp*/)
  {
    var len = this.length;
    if (typeof fun != "function")
      throw new TypeError();

    var thisp = arguments[1];
    for (var i = 0; i < len; i++)
    {
      if (i in this)
        fun.call(thisp, this[i], i, this);
    }
  };
}
/* gettext library */
var catalog = new Array();

function pluralidx(n) {
  var v=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);
  if (typeof(v) == 'boolean') {
    return v ? 1 : 0;
  } else {
    return v;
  }
}
catalog['6 a.m.'] = '6 rano';
catalog['Add'] = 'Dodaj';
catalog['Available %s'] = 'Dost\u0119pne %s';
catalog['Calendar'] = 'Kalendarz';
catalog['Cancel'] = 'Anuluj';
catalog['Choose a time'] = 'Wybierz czas';
catalog['Choose all'] = 'Wybierz wszystko';
catalog['Chosen %s'] = 'Wybrano %s';
catalog['Clear all'] = 'Wyczy\u015b\u0107 wszystko';
catalog['Clock'] = 'Zegar';
catalog['Hide'] = 'Ukryj';
catalog['January February March April May June July August September October November December'] = 'Stycze\u0144 Luty Marzec Kwiecie\u0144 Maj Czerwiec Lipiec Sierpie\u0144 Wrzesie\u0144 Pa\u017adziernik Listopad Grudzie\u0144';
catalog['Midnight'] = 'P\u00f3\u0142noc';
catalog['Noon'] = 'Po\u0142udnie';
catalog['Now'] = 'Teraz';
catalog['Remove'] = 'Usu\u0144';
catalog['S M T W T F S'] = 'N Pn Wt \u015ar Cz Pt So';
catalog['Select your choice(s) and click '] = 'Zaznacz sw\u00f3j wyb\u00f3r i kliknij ';
catalog['Show'] = 'Poka\u017c';
catalog['Sunday Monday Tuesday Wednesday Thursday Friday Saturday'] = 'Niedziela Poniedzia\u0142ek Wtorek \u015aroda Czwartek Pi\u0105tek Sobota';
catalog['Today'] = 'Dzisiaj';
catalog['Tomorrow'] = 'Jutro';
catalog['Yesterday'] = 'Wczoraj';


function gettext(msgid) {
  var value = catalog[msgid];
  if (typeof(value) == 'undefined') {
    return msgid;
  } else {
    return (typeof(value) == 'string') ? value : value[0];
  }
}

function ngettext(singular, plural, count) {
  value = catalog[singular];
  if (typeof(value) == 'undefined') {
    return (count == 1) ? singular : plural;
  } else {
    return value[pluralidx(count)];
  }
}

function gettext_noop(msgid) { return msgid; }

function interpolate(fmt, obj, named) {
  if (named) {
    return fmt.replace(/%\(\w+\)s/g, function(match){return String(obj[match.slice(2,-2)])});
  } else {
    return fmt.replace(/%s/g, function(match){return String(obj.shift())});
  }
}

//$(document).ready(function(){
//});

$.fn.equalHeights = function() {
	var currentTallest = 0;
	$(this).each(function(){
		if ($(this).height() > currentTallest) { currentTallest = $(this).height(); }
	});	
	// for ie6, set height since min-height isn't supported
	if ($.browser.msie) { $(this).css({'height': currentTallest}); }
	$(this).css({'min-height': currentTallest}); 
	return this;
};
