if (window.XMLHttpRequest)
{
ObiektXMLHttp = new XMLHttpRequest();
}
else if (window.ActiveXObject)
{
ObiektXMLHttp = new ActiveXObject("Microsoft.XMLHTTP");
}

function wybierzPlik()
	{
	if(document.forms.upload){document.getElementById('nazwapliku').innerHTML='<h6>'+document.forms.upload.plik_upload.value+'</h6>';}
	if(document.forms.okladka){document.getElementById('nazwaokladki').innerHTML='<h6>'+document.forms.okladka.okladka.value+'</h6>';}
	}

function checkImages()
	{
	var d=document; i=0; szer=0; dl=d.meble.length;
	for(i=0; i<dl; i++){if(d.meble[i].complete == true){szer=szer+(250/dl)}};
	with(wybierz('meter')){width=szer+'px'};
	document.getElementById('loading').innerHTML='loading furniture '+Math.round(100*szer/250)+'% ';
	if(szer>240){
		with(wybierz('pasek')){display='none'};
		with(wybierz('logo')){opacity=1; filter='alpha(opacity: 100)'};
	}
	else{setTimeout("checkImages();",100);}
	}

function preloadImages()
	{
	var d=document; i=0; a=preloadImages.arguments;

	if(d.images){
	if(!d.meble)d.meble= new Array();
	var dl=d.meble.length;
	for(i=0; i<a.length; i++)
	{d.meble[dl]=new Image; d.meble[dl++].src=a[i];}
	checkImages();
	}
	}

function Start()
	{
	if(document.layers)document.captureEvents(Event.MOUSEMOVE);
	}

function wybierz(id)
	{
	var d=document;
	d=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
	if(!document.layers)d=d.style;
	return d
	}

function pokaz_opis(etykieta)
	{ 
	var kod='',i=1;
	for(i=1; i<10; i++){kod=kod+'<h2 class="lit'+i+'">'+etykieta+etykieta+etykieta+'<br></h2>';}
	kod=kod+kod;
	document.getElementById('opisy').innerHTML=kod;
	}

function losujObrazek()
	{
	var a=losujObrazek.arguments;
	var adres=a[Math.round(Math.random()*(a.length-1))];
	document.images.kod.src=adres;
	}

function checkCode()
	{
	var kod=document.forms.ksiega.kodp.value+'.jpg';
	var kod1=document.images.kod.src;
	if (kod == kod1.substr((kod1.length-9),(kod1.length-1))){document.forms.ksiega.kodp.value = 'ok'}
	}