function hoverStart(n) {
	if (n == 1) {
		document.getElementById('s01').style.backgroundImage = 'url(../graphics/start/s01a.gif)';
		document.getElementById('s02').style.backgroundImage = 'url(../graphics/start/s02a.gif)';
		document.getElementById('s04').style.backgroundImage = 'url(../graphics/start/s04a.gif)';
		document.getElementById('s09').style.backgroundImage = 'url(../graphics/start/s09.gif)';
		document.getElementById('s11').style.backgroundImage = 'url(../graphics/start/s11.gif)';
		document.getElementById('so').style.backgroundImage = 'none';
		document.getElementById('sr').style.backgroundImage = 'none';
		document.getElementById('ss').style.backgroundImage = 'none';
		document.getElementById('su').style.backgroundImage = 'none';
	} else {
		document.getElementById('s01').style.backgroundImage = 'url(../graphics/start/s01.gif)';
		document.getElementById('s02').style.backgroundImage = 'url(../graphics/start/s02.gif)';
		document.getElementById('s04').style.backgroundImage = 'url(../graphics/start/s04.gif)';
		document.getElementById('s09').style.backgroundImage = 'url(../graphics/start/s09a.gif)';
		document.getElementById('s11').style.backgroundImage = 'url(../graphics/start/s11a.gif)';
		document.getElementById('so').style.backgroundImage = 'url(../graphics/start/so.gif)';
		document.getElementById('sr').style.backgroundImage = 'url(../graphics/start/sr.gif)';
		document.getElementById('ss').style.backgroundImage = 'url(../graphics/start/ss.gif)';
		document.getElementById('su').style.backgroundImage = 'url(../graphics/start/su.gif)';
	}
}

function openID(id) {
	this.location.href = './' + id;
}

function startImage() {
	for (i = 1; i < 15; ++i) {
		id = (i < 10) ? ('0' + i) : i;
		hover = (i == 11) ? ' class="sHover" onmouseover="hoverStart(1)" onmouseout="hoverStart(2)" onclick="openID(\'home\')"' : '';
		document.write('<div id="s' + id + '"' + hover + '></div>')
    }
	document.write('<div id="opis"></div>');
    document.write('<div id="so" onmouseover="hLink(1)" onmouseout="hLink(0)" onclick="openID(\'obrazy\')"></div>');
	document.write('<div id="sr" onmouseover="hLink(2)" onmouseout="hLink(0)" onclick="openID(\'rysunki\')"></div>');
	document.write('<div id="ss" onmouseover="hLink(3)" onmouseout="hLink(0)" onclick="openID(\'sgraffito\')"></div>');
	document.write('<div id="su" onmouseover="hLink(4)" onmouseout="hLink(0)" onclick="openID(\'uzytkowe\')"></div>');
	
}

function hLink(n) {
	switch (n)
	{
	case 0:
	  document.getElementById('s13').style.backgroundImage = 'url(../graphics/start/s13.gif)';
	  document.getElementById('so').style.backgroundImage = 'url(../graphics/start/so.gif)';
	  document.getElementById('sr').style.backgroundImage = 'url(../graphics/start/sr.gif)';
	  document.getElementById('ss').style.backgroundImage = 'url(../graphics/start/ss.gif)';
	  document.getElementById('su').style.backgroundImage = 'url(../graphics/start/su.gif)';
	  document.getElementById('opis').style.backgroundImage = 'none';
	  break
	case 1:
	  document.getElementById('s13').style.backgroundImage = 'url(../graphics/start/s13o.jpg)';
	  document.getElementById('opis').style.backgroundImage = 'url(../graphics/start/obrazy.png)';
	  document.getElementById('so').style.backgroundImage = 'none';
	  break
	case 2:
	  document.getElementById('s13').style.backgroundImage = 'url(../graphics/start/s13r.jpg)';
	  document.getElementById('opis').style.backgroundImage = 'url(../graphics/start/rysunki.png)';
	  document.getElementById('sr').style.backgroundImage = 'none';
	  break
	case 3:
	  document.getElementById('s13').style.backgroundImage = 'url(../graphics/start/s13s.jpg)';
	  document.getElementById('opis').style.backgroundImage = 'url(../graphics/start/sgraffito.png)';
	  document.getElementById('ss').style.backgroundImage = 'none';
	  break
	case 4:
	  document.getElementById('s13').style.backgroundImage = 'url(../graphics/start/s13u.jpg)';
	  document.getElementById('opis').style.backgroundImage = 'url(../graphics/start/uzytkowe.png)';
	  document.getElementById('su').style.backgroundImage = 'none';
	  break
	}
}
