function $(i) {
	return document.getElementById(i);
}

function rownaj(rownajElement1, rownajElement2) {
	if(rownajElement1) {
		if(rownajElement1.scrollHeight < rownajElement2.scrollHeight) var height = rownajElement2.scrollHeight;
		else var height = rownajElement1.scrollHeight;

		rownajElement1.style.height = height + 'px';
		rownajElement2.style.height = height + 'px';
	}
}

var blockRedirection = false;
function redirectToItem(link) {
	if(!blockRedirection) {
		//alert(link);
		document.location = link;
	}
	blockRedirection = false;
}


function addToBasket(id) {
	blockRedirection = true;
}

function showTab(tabName, caller) {
	var a = caller.parentNode.parentNode.getElementsByTagName('A');
	for(var p = 0; p < a.length ; p++) {
		a[p].className = '';
	}
	caller.className = 'active';
	caller.blur();

	var div = document.getElementById('polecContainer').getElementsByTagName('DIV');
	for(var p = 0 ; p < div.length ; p++) {
		if(div[p].className.indexOf('polecContainer') > -1) div[p].style.display = 'none';
	}
	document.getElementById('polecamy'+tabName).style.display = 'block';

}

function changeCount(what, count) {
	var ajax = new AjaxObject101();
	ajax.sndReq('GET', '/ajax/count.php', 'what='+what+'&count='+count);

}

function dostawaDodatki(uncheck) {
	uncheck.checked = false;
}

function tylkoDostepne(v, url) {
	var f = document.createElement('FORM');
	f.action = url;
	f.method = 'post';
	f.style.display = 'none';
	var i = document.createElement('INPUT');
	i.name = 'tylkoDostepne';
	i.value = (v == true) ? 1 : 0;
	f.appendChild(i);
	document.body.appendChild(f);
	f.submit();
}

function przelicz() {
	document.location = '/koszyk';
	return false;
}