// Autorem skryptu jest: SŁAWOMIR KOKŁOWSKI
// www.kurshtml.boo.pl
// Jeśli chcesz wykorzystać ten skrypt na swojej stronie, nie usuwaj tego komentarza!





var szybko = false;
var czas = new Date();


function display(id, wartosc)
{
  if (wartosc)
  {
    if (document.getElementById) document.getElementById(id).style.display = wartosc;
    else if (document.all) document.all[id].style.display = wartosc;
  }
  else
  {
    var wart = "";
    if (document.getElementById) wart = document.getElementById(id).style.display;
    else if (document.all) wart = document.all[id].style.display;
    return wart;
  }
}

function ukryj(id)
{
  for (var i = 0; i < karty[id].ilosc; i++) display("nr" + id + "_" + i, "none");
  display("nr" + id, "none");
  karty[id].rozwinieta = false;
}

var id_rozwin_zwin = 0;

function rozwin_zwin(id, nr)
{
  if (!nr)
  {
    var nr = 0;
    if (!karty[id].rozwinieta) for (var i = 0; i < karty.length; i++) if (i != id) ukryj(i);
    czas = new Date();
  }

  if (nr < karty[id].ilosc)
  {
    if (karty[id].rozwinieta)
    {
      if (szybko) display("nr" + id + "_" + nr++, "none");
      if (nr < karty[id].ilosc) display("nr" + id + "_" + nr, "none");
    }
    else
    {
      display("nr" + id, "block");
      if (szybko) display("nr" + id + "_" + nr++, "block");
      if (nr < karty[id].ilosc) display("nr" + id + "_" + nr, "block");
    }
  }

  nr++;
  clearTimeout(id_rozwin_zwin);
  if (nr < karty[id].ilosc) id_rozwin_zwin = setTimeout('rozwin_zwin(' + id + ',' + nr + ')', 10);
  else
  {
    if (karty[id].rozwinieta) display("nr" + id, "none");
    if (!szybko && new Date() - czas > karty[id].ilosc*25) szybko = true;
    else if (szybko && new Date() - czas < karty[id].ilosc*12) szybko = false;
    karty[id].rozwinieta = (karty[id].rozwinieta ? false : true);
  }
}

function karta(il)
{
  this.ilosc = il;
  this.rozwinieta = true;
}

function obraz_on( obraz, i_path )
{
 document[obraz].src="./img/"+i_path;
}
function obraz_off( obraz, i_path )
{
 document[obraz].src="./img/"+i_path;
}



<!--
//Autor: Bart Jellema
    var hellotext="Bienvenue sur les pages echecs.creakaz.com"
    var thetext=""
    var started=false
    var step=0
    var times=1
    function welcometext()
    {
      times--
      if (times==0)
      {
        if (started==false)
        {
          started = true;
          window.status = hellotext;
          setTimeout("anim()",1);
        }
        thetext = hellotext;
      }
    }
    function showstatustext(txt)
    {
      thetext = txt;
      setTimeout("welcometext()",4000)
      times++
    }

    function anim()
    {
      step++
      if (step==7) {step=1}
      if (step==1) {window.status='>==='+thetext+'===<'}
      if (step==2) {window.status='=>=='+thetext+'==<='}
      if (step==3) {window.status='>=>='+thetext+'=<=<'}
      if (step==4) {window.status='=>=>'+thetext+'<=<='}
      if (step==5) {window.status='==>='+thetext+'=<=='}
      if (step==6) {window.status='===>'+thetext+'<==='}
      setTimeout("anim()",200);
    }
//welcometext();
//-->


<!--// Copyright 1996 - Tomer and Yehuda Shiran
// This example will appear in our forthcoming book on JavaScript.
// Feel free to "steal" this code provided that you leave this notice as is.
// Additional examples from the book can be found at http://www.geocities.com/SiliconValley/9000/
// For more information contact Tomer or Yehuda Shiran <yshiran@iil.intel.com>

// set speed of banner (pause in milliseconds between addition of new character)
var speed = 30

// decrease value to increase speed (must be positive)
// set pause between completion of message and beginning of following message
var pause = 2500

// increase value to increase pause
// set initial values
var timerID = null
var bannerRunning = false

// create array
var ar = new Array()

// assign the strings to the array's elements
ar[0] = "Grand choix d'articles en bois: echecs, boîtes ŕ bijoux, rangement vin..."
ar[1] = "Des articles uniques fabriqués par des artisans! Certains de nos articles sont peints ŕ la main - veritable travail d'artisan."
ar[2] = "Nos tarifs sont plus qu'attractifs!!!"


// assign index of current message
var message = 0

// empty string initialization
var state = ""

// no value is currently being displayed
clearState()

// stop the banner if it is currently running
function stopBanner() {	
	// if banner is currently running	
	if (bannerRunning)		
	// stop the banner		
	clearTimeout(timerID)	
	// timer is now stopped	
	timerRunning = false
}

// start the banner
function startBanner() {	
	// make sure the banner is stopped	
	stopBanner()	
	// start the banner from the current position	
	showBanner()
}

// assign state a string of "0" characters of the length of the current message
function clearState() {	
	// initialize to empty string	
	state = ""	
	// create string of same length containing 0 digits	
	for (var i = 0; i < ar[message].length; ++i) {		
		state += "0"	
	}
}

// display the current message
function showBanner() {	
	// if the current message is done	
	if (getString()) {		
		// increment message		
		message++		
		// if new message is out of range wrap around to first message		
	if (ar.length <= message)			
		message = 0		
		// new message is first displayed as empty string		
		clearState()		
		// display next character after pause milliseconds		
		timerID = setTimeout("showBanner()", pause)	
	}
	else {		
		// initialize to empty string		
		var str = ""		
		// built string to be displayed (only character selected thus far are displayed)		
	for (var j = 0; j < state.length; ++j) {			
		str += (state.charAt(j) == "1") ? ar[message].charAt(j) : "     "		
	}		
	// partial string is placed in status bar		
	window.status = str		
	// add another character after speed milliseconds		
	timerID = setTimeout("showBanner()", speed)	
	}
}

function getString() {	
	// set variable to true (it will stay true unless proven otherwise)	
	var full = true	
	// set variable to false if a free space is found in string (a not-displayed char)	
	for (var j = 0; j < state.length; ++j) {		
		// if character at index j of current message has not been placed in displayed string		
		if (state.charAt(j) == 0)			
		full = false	
	}	
	// return true immediately if no space found (avoid infinitive loop later)	
	if (full) return true	
	// search for random until free space found (braoken up via break statement)	
	while (1) {		
		// a random number (between 0 and state.length - 1 == message.length - 1)		
		var num = getRandom(ar[message].length)		
		// if free space found break infinitive loop		
	if (state.charAt(num) == "0")			
		break	
	}	
	// replace the 0 character with 1 character at place found	
	state = state.substring(0, num) + "1" + state.substring(num + 1, state.length)	
	// return false because the string was not full (free space was found)	
	return false
}

function getRandom(max) {	
	// create instance of current date	
	var now = new Date()		
	// create a random number (good generator)	
	var num = now.getTime() * now.getSeconds() * Math.random()	
	// cut random number to value between 0 and max - 1, inclusive	
	return num % max
}
 startBanner()
// -->






