var idelement_focused='';


function show_hide(list) {
	var listElementStyle=document.getElementById(list).style; 
	if (listElementStyle.display=="none") {
		listElementStyle.display="inline";
	} else {
		listElementStyle.display="none";
	} 
}

function show_hide_block(list) {
	var listElementStyle=document.getElementById(list).style; 
	if (listElementStyle.display=="none") {
		listElementStyle.display="block";
	} else {
		listElementStyle.display="none";
	} 
}

function potwierdzenie(link,pytanie,komunikat) {
	var sprawdz = window.confirm(pytanie);
	if(sprawdz==true) {
		window.location=link;
		if(komunikat!="" && komunikat!=" ") alert(komunikat);
		return false;
	}
}

function link_potwierdzenie(link,pytanie) {
	var sprawdz = window.confirm(pytanie);
	if(sprawdz==true) window.location=link;
}


function input_validator(e, regexp) {
	if(navigator.userAgent.indexOf('Gecko') != -1) charCode = e.which; else charCode = e.keyCode;
	if(charCode > 31) {
		znak = String.fromCharCode(charCode);
		return regexp.test(znak);
	}
}


function update_cart(id,ilosc) {
	var SID=document.getElementById('SID').value;

	advAJAX.post({
		url : "includes/ajax_ilosc.php?SID="+SID,
		parameters : {
			"produkt_id":id,
			"ilosc":ilosc
		}
	});

	document.getElementById('realizuj_zamowienie').style.display='none';
	document.getElementById('aktualizuj_koszyk').style.display='inline';
}
