function dyngallery()
{
	var picId='powiekszone';
	var d=document.getElementById('galeria');
	if(!d){return;}
	var piclinks=d.getElementsByTagName('a');
	for(var i=0;i<piclinks.length;i++)
	{
	var anchor = piclinks[i];
	var relAttribute = String(anchor.getAttribute('rel'));
	if (anchor.getAttribute('href') && (relAttribute.toLowerCase().match('powieksz'))) {
		piclinks[i].onclick=function()
		{
			var oldp=document.getElementById(picId);
			if(oldp)
			{
			 oldp.parentNode.removeChild(oldp);
			}
			var nc=document.createElement('div');
			d.parentNode.insertBefore(nc,d);
			nc.style.display='none';
			nc.id=picId;
			var newpic=document.createElement('img');
			newpic.src=this.href;
			newpic.alt=this.getElementsByTagName('img')[0].alt;
			newpic.title='';
			newpic.onclick=function()
			{
			 this.parentNode.parentNode.removeChild(this.parentNode);
			}
			
			opis=this.getElementsByTagName('img')[0].alt;
			wstawka = document.createElement('p');
			wstawka.innerHTML = opis+('<br />Dodano dnia: ')+(this.getElementsByTagName('img')[0].title)+('<b class="maly"></b>');
			nc.appendChild(newpic);
			nc.appendChild(wstawka);
			nc.style.display='block';
			return false;
		}
	}
	}
}

window.onload=function()
{
	if(document.getElementById && document.createTextNode)
	{	var loadingId='ladowanie';
		document.getElementById(loadingId).style.display='none';
		document.body.onmouseover=function()
		{
			dyngallery();	
		}																
		
	}
}

