
// Zainicjuj handler
if (document.addEventListener) {
  // BEWARE! DOMContentLoaded is a Gecko-specific event!
  document.addEventListener("DOMContentLoaded",
      function(e) {
        // http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Functions/arguments
        if (arguments.callee.done) return;
        arguments.callee.done = true;

        this.removeEventListener(e.type, arguments.callee, false);

        // Real work starts here:
        slajdSwapper.init(e);
      },
      false
  );
}


/* ***************************************** *
 *                                           *
 *   To jest obiekt, który zamienia slajdy.  *
 *                                           *
 * ***************************************** */
var slajdSwapper = {
  lista: ['foto/malbork_slajd.png', 'foto/grupa_slajd.png'],

  // Funkcja inicjująca obiekt. Ustawia handlery i inne takie.
  init: function(e) {
    //alert("slajdSwapper: Ja żyję!");
    debuguj("slajdSwapper: ja żyję!");
  },

}


/* przenieś to do jakiegoś general.js */

function debuguj(msg) {
  if( typeof(console) == 'object' && console.debug ) {
    console.debug(msg);
  }
}

function warninguj(msg) {
  if( typeof(console) == 'object' && console.warn ) {
    console.warn(msg);
  } else debuguj('WARNING: ' + msg);
}

function erroruj(msg) {
  if( typeof(console) == 'object' && console.error ) {
    if( (msg instanceof Error) && msg.fileName && msg.lineNumber) {
      msg = ''+msg+' ['+msg.fileName+' '+msg.lineNumber+']';
    }
    console.error(msg);
  } else debuguj('ERROR: ' + msg);
}



