redirect="";

function showRegion(id)
{
regions = Array('1','3','5','6','7','8','9','10','11','12','13','14','15','16','17','18');

for (i=0;i<regions.length;i++)
{
	document.getElementById('part_'+regions[i]).style.display='none';
}
document.getElementById('part_'+id).style.display='block';
}

function goURL(url)
{
	document.location.href=url;
}

function changePicture(co,naco)
{
document.getElementById(co).src=naco.replace(/small/,"medium");
aktualna=document.getElementById(co).src;
}

function changePictureBig(co,naco)
{
document.getElementById(co).src=naco.replace(/small/,"big");
}

function zoomShow(idprod,act,kol)
{
window.open('zoom.htm?p='+idprod+'&a='+act+'&k='+kol,'','width=820,height=630,scrollbars=yes');	
}

function zoomerShow(idprod)
{
window.open('http://admin.but-s.com.pl/zoomer3d_start.php?id='+idprod,'','width=550,height=450,scrollbars=no');	
}

function init()
{
	optionTest = true;
	lgth = document.getElementById('k').options.length;
	document.getElementById('k').options[lgth] = null;
	if (document.getElementById('k').options[lgth]) optionTest = false;
	populate();
}


function populate()
{
	if (!optionTest) return;
	var box = document.getElementById('k');
	var number = box.selectedIndex+1;
	if (!number) return;
	var list = tabKol[number];
	var box2 = document.getElementById('r');
	box2.options.length = 0;
	for(i=0;i<list.length;i+=2)
	{
		box2.options[i/2] = new Option(list[i],list[i+1]);
	}
}

function changeColor(url,kolor)
{
document.location.href=url+'&k='+kolor;	
}

function check_quantity(ile,co)
{
    if(co.value>ile){co.value=0;alert('Kupując produkt z ofert stokowej nie można zamówić więcej niż wskazuje stan magazynowy.')}
}

