function removeAccents(str) {
  var convMap = {
    "ą" : "a",
    "ć" : "c",
    "ę" : "e",
    "ł" : "l",
    "ń" : "n",
    "ó" : "o",
    "ś" : "s",
    "ź" : "z",
    "ż" : "z"
  }
  for (var i in convMap) {
    str = str.replace(new RegExp(i, "g"), convMap[i]);
  }
  return str;
}
$(window).addEvent('domready', function () {
  externalLinks();
  var imageList = [];
  MooTools.lang.setLanguage('pl-PL');
  $$('.mo').each(function(img) {
    var src = img.getProperty('src');
    var extension = src.substring(src.lastIndexOf('.'),src.length)
    imageList.push(src.replace(extension,'-mo' + extension));
    img.addEvent('mouseenter', function() { if (img.hasClass('mo')) img.setProperty('src',src.replace(/-mo/g,'').replace(extension,'-mo' + extension)); });
    img.addEvent('mouseleave', function() { if (img.hasClass('mo')) img.setProperty('src',src.replace(/-mo/g,'')); });
  });  
  $$('h1').each(function(node){
    node.addEvent('click', function(e){
      window.location.href='/';
    });
  });
  new Asset.images(imageList);
  Shadowbox.init({ language:"pl"});
});

