function menuon(x)
{
document.getElementById(x).className = "plink1";
}
function menuout(x)
{
document.getElementById(x).className = "plink0";
}

function zmien_banner(x,y,z)
{
a=p[y];
b=p[z];
ban = parseInt(a) + parseInt(b) + parseInt(x);
mod = ban % 15;
if (mod > 0)
dzielnik = parseInt(ban/15) + 1;
else
dzielnik = parseInt(ban/15);
ban = parseInt(ban/dzielnik);
obrazek = 'url(grafika/head_' + ban + '.jpg)';
document.getElementById("k2").style.backgroundImage = obrazek;
pokaz_obrazki();
}

function pokaz_produkt()
{
k=1;
while (k<produkty[0])
{
if (document.getElementById("o" + k).selected)
	{
	prod=k;
	k=produkty[0];
	}
k++;
}
adres = '?' + lprodukty[prod];
document.location.replace(adres);
}

function lista_prodoktow()
{
wpis = '<select id="szukaj_select" style="width:160px; font-size: 12px;" onchange="pokaz_produkt()"><option value="0">Wybierz produkt</option>';
for (k=1; k<produkty[0]; k++)
wpis = wpis + '<option id="o' + k +'" value="' + k +'">' + produkty[k] + '</option>';
wpis= wpis + '</select>';
document.getElementById("szukaj").innerHTML = wpis;
}

function fixPNG(myImage)
{
if ((version >= 5.5) && (document.body.filters))
{
var imgID = (myImage.id) ? "id='" + myImage.id + "' " : ""
var imgClass = (myImage.className) ? "class='" + myImage.className + "' " : ""
var imgTitle = (myImage.title) ? "title='" + myImage.title  + "' " : "title='" + myImage.alt + "' "
var imgStyle = "display:inline-block;" + myImage.style.cssText
var strNewHTML = "<span " + imgID + imgClass + imgTitle  + " style=\"" + "width:" + myImage.width + "px; height:" + myImage.height + "px;" + imgStyle + ";" + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader" + "(src=\'" + myImage.src + "\', sizingMethod='scale');\"></span>"
myImage.outerHTML = strNewHTML;
}
}

function pokaz_obrazki()
{
x = Math.random();
l = String(x);
l1 = l.substr(2,1);
l2 = l.substr(3,1);
l3 = l.substr(4,1);
if (l1 == l2)
l2 = '10';
if (l1 == l3)
l3 = '11';
if (l2 == l3)
l3 = '12';
a = new Array();
a[1] = parseInt(l1);
a[2] = parseInt(l2)
a[3] = parseInt(l3);
wpis='<div class="kont1">';
for (k=1; k<4; k++)
wpis = wpis + obrazki[a[k]];
document.getElementById("k3").innerHTML = wpis + '</div>';
}

function ekran_jest(x)
{
// po id
wys= screen.height * 1.5;
document.getElementById("ekran_a").className = "ekran_jest_a";
document.getElementById("ekran_b").className = "ekran_jest_b";
document.getElementById("ekran_c").className  = "ekran_jest_c";
document.getElementById("ekran_b").innerHTML = '<div style="padding-top: ' + wys + 'px"> &nbsp; </div>';
document.getElementById("ekran_c").innerHTML = '<img src="' + document.getElementById(x).alt + '"  onclick="ekran_niema()" id="ekran_obrazek" class="ekran_obrazek">';
}

function ekran_jest1(x)
{
//po adresie
if (x == 2213)
x = 2208;
if (x == 2214)
x = 2208;

wys= screen.height * 1.5;
document.getElementById("ekran_a").className = "ekran_jest_a";
document.getElementById("ekran_b").className = "ekran_jest_b";
document.getElementById("ekran_c").className  = "ekran_jest_c";
document.getElementById("ekran_b").innerHTML = '<div style="padding-top: ' + wys + 'px"> &nbsp; </div>';
document.getElementById("ekran_c").innerHTML = '<img src="' + 'grafika/' + x + '.jpg"  onclick="ekran_niema()" id="ekran_obrazek" class="ekran_obrazek">';
}

function ekran_jest2(x)
{
//po adresie z modyfikacją
x = x.substr(1,4);
if (x == '6036')
x = '6020';
wys= screen.height * 1.5;
document.getElementById("ekran_a").className = "ekran_jest_a";
document.getElementById("ekran_b").className = "ekran_jest_b";
document.getElementById("ekran_c").className  = "ekran_jest_c";
document.getElementById("ekran_b").innerHTML = '<div style="padding-top: ' + wys + 'px"> &nbsp; </div>';
document.getElementById("ekran_c").innerHTML = '<img src="' + 'grafika/' + x + '.jpg"  onclick="ekran_niema()" id="ekran_obrazek" class="ekran_obrazek">';
}

function ekran_niema()
{
document.getElementById("ekran_a").className = "";
document.getElementById("ekran_b").className = "ekran_niema";
document.getElementById("ekran_c").className = "ekran_niema";
}

function menu_p(x)
{
wpis='';
wpis = '<div class="plink2">';
wpis = wpis + '<a href="?Produkty"><div style="font-family: arial, sans-serif;font-size: 16px; line-height: 16px; font-weight: bold;color:#09339d; padding-bottom: 8px;">Produkty</div></a>';
for (k=1; k<pmenu[0]; k++)
wpis = wpis + pmenu[k] + '<br>';
wpis = wpis + '</div>';
document.getElementById("mx1").innerHTML = wpis;
if (x > 0)
document.getElementById("am" + x).style.textDecoration = "underline";
}

function menu_t(x)
{
wpis='';
wpis = '<div class="plink3">';
wpis = wpis + '<a href="?Tak_to_dziala"><div style="font-family: arial, sans-serif;font-size: 16px; line-height: 16px; font-weight: bold;color:#09339d; padding-bottom: 8px;">Tak to działa</div></a>';
for (k=1; k<tmenu[0]; k++)
wpis = wpis + tmenu[k] + '<br>';
wpis = wpis + '</div>';
document.getElementById("mx3").innerHTML = wpis;
if (x > 0)
document.getElementById("cm" + x).style.textDecoration = "underline";
}

function pfoto(x)
{
//po adresie - seria
obr=document.getElementById("fo" + x).innerHTML;
opis = obr;
if (obr.substr(0,1) == "R")
obr = obr.substr(1,4);
ops=opis + ' ' + document.getElementById("op" + x).innerHTML;
if (obr == 2213)
obr = 2208;
if (obr == 2214)
obr = 2208;
if (obr == '6036')
obr = '6020';
y = x-1;
z = x+1;
wys= screen.height * 1.5;
document.getElementById("ekran_a").className = "ekran_jest_a";
document.getElementById("ekran_b").className = "ekran_jest_b";
document.getElementById("ekran_c").className  = "ekran_jest_c";
document.getElementById("ekran_b").innerHTML = '<div style="padding-top: ' + wys + 'px"> &nbsp; </div>';
wpis = '<img src="' + 'grafika/' + obr + '.jpg" id="ekran_obrazek" class="ekran_obrazek" style="cursor: text;border-bottom: 30px solid #fdc41b">';
wpis= wpis + '<br><span style="background: #fdc41b; font-size: 12px; color: #09339d; position: relative; top: -22px;">';
wpis = wpis + ops + '</span><br>';
if (document.getElementById("fo" + y))
wpis= wpis + '<img style="padding-left: 59px;padding-right: 58px; background-color: #ffffff;border-left:4px solid #fdc41b; border-top:4px solid #fdc41b; border-bottom:4px solid #fdc41b; top: -16px;position: relative; cursor: pointer;" src="techniczny/sl.jpg" onclick="pfoto(' + y + ')" alt="Poprzedni" title = " Poprzedni ">';
else
wpis= wpis + '<img style="padding-left: 59px;padding-right: 58px; background-color: #ffffff;border-left:4px solid #fdc41b; border-top:4px solid #fdc41b; border-bottom:4px solid #fdc41b; top: -16px;position: relative; cursor: text;" src="techniczny/sl.jpg" alt="To jest pierwsze zdjęcie" title = " To jest pierwsze zdjęcie ">';
wpis=wpis + '<img style="border-top:4px solid #fdc41b;border-bottom:4px solid #fdc41b; cursor: pointer; background-color: #ffffff; top: -16px;position: relative;" src="techniczny/sc.jpg" onclick="ekran_niema()" alt="Zakończ przeglądanie" title=" Zakończ przeglądanie zdjęć ">';
if (document.getElementById("fo" + z))
wpis = wpis + '<img style="border-right:4px solid #fdc41b;border-top:4px solid #fdc41b; border-bottom:4px solid #fdc41b;padding-right: 59px;  padding-left: 58px;background-color: #ffffff; top: -16px;position: relative; cursor: pointer;" src="techniczny/sp.jpg" onclick="pfoto(' + z + ')" alt="Następny" title = " Następny ">';
else
wpis = wpis + '<img style="border-right:4px solid #fdc41b;border-top:4px solid #fdc41b; border-bottom:4px solid #fdc41b;padding-right: 59px;   padding-left: 58px;background-color: #ffffff; top: -16px;position: relative; cursor: text;" src="techniczny/sp.jpg" alt="To jest ostatnie zdjęcie" title = " To jest ostatnie zdjęcie ">';
document.getElementById("ekran_c").innerHTML = wpis;
}

function video_lista()
{
wpis = '<div id="video_str1" style="display: block;">';
for (k=1; k<17;k++)
{
wpis = wpis + '<p style="clear: both;"><a href="#skok" style="text-decoration: none;"><img src="grafika/v' + k + '.jpg" align="left" border="0" style="margin-bottom: 10px; margin-right: 10px;cursor: pointer;" onclick="pokaz_video(' + k + ')"></a>' + vo[k] + '</p>';
if (k == 9)
wpis = wpis + '<p style="text-align: right; margin-right: 20px;clear: both;"><span style="cursor: pointer" onclick="video_s2()">Następne</span></p></div><div id="video_str2" style="display: none;">';
}
wpis = wpis + '<p style="text-align: right; margin-right: 20px;clear: both;"><span style="cursor: pointer" onclick="video_s1()">Poprzednie</span></p></div>';
document.getElementById("video_l").innerHTML = wpis;
}

function pokaz_video(x)
{
document.getElementById("video").innerHTML = vl[x];
}

function video_s1()
{
document.getElementById("video").innerHTML = '';
document.getElementById("video_str2").style.display="none";
document.getElementById("video_str1").style.display="block";
}

function video_s2()
{
document.getElementById("video").innerHTML = '';
document.getElementById("video_str2").style.display="block";
document.getElementById("video_str1").style.display="none";
}

function serieQX()
{
document.getElementById("k5").style.backgroundImage="url(grafika/background.jpg)";
document.getElementById("k5").style.height = "646px";
document.getElementById("k5").style.width = "500px";
document.getElementById("k5").style.border = "none";
document.getElementById("k5").style.marginTop = "8px";
document.getElementById("k5").style.marginLeft = "0px";
document.getElementById("xk5a").className="";
document.getElementById("xk5a").style.height="0px";
document.getElementById("xk5a").style.display = "none";
document.getElementById("xk5b").className="";
}

function menu_qx(x)
{
for (k=1; k<4; k++)
if (k == x)
document.getElementById("mqx" + k).style.textDecoration="underline";
else
document.getElementById("mqx" + k).style.textDecoration="none";
}

function fqxs()
{
wpis='';
for (k=1; k<qxs[0]; k++)
wpis = wpis + qxs[k] + '<br>';
document.getElementById("s_qx").innerHTML = wpis;
menu_qx(1);
}

function fqxo()
{
wpis='';
for (k=1; k<qxo[0]; k++)
wpis = wpis + qxo[k] + '<br>';
document.getElementById("s_qx").innerHTML = wpis;
menu_qx(2);
}

function fqxw()
{
wpis='';
for (k=1; k<qxw[0]; k++)
wpis = wpis + qxw[k] + '<br>';
document.getElementById("s_qx").innerHTML = wpis;
menu_qx(3);
}

