$(document).ready( function() {
	Cufon.replace('#header-menu li a', { hover: true });
	Cufon.replace('#watchword-quote h2');
	Cufon.replace('h3');
});


function addToCart( type, id, lang )
{
	$.get("/_ajax/cart.php", { type: type, id: id, ilosc: '1', action: 'update',lang: lang }, function(data) {
		//document.getElementById('cart').innerHTML = data;
		window.location.href = "/order/" + lang + "/koszyk.html";
	});
}

function showCart(lang)
{
	$.get("/_ajax/cart.php", { action: 'show', lang: 'en' }, function(data) {
		document.getElementById('cart').innerHTML = data;
	});
}


function cyfraCheck(eventObj, obj)
{
	var keyCode
	if (document.all)
	{ 
		keyCode=eventObj.keyCode
	}
	else
	{
		keyCode=eventObj.which
	}
	var str=obj.value
	if(keyCode==46)
	{ 
		if (str.indexOf(".")>0)
		{
			return false
		}
	}
	if((keyCode<48 || keyCode >58)   &&   (keyCode != 44) && (keyCode != 46) &&   (keyCode != 8))
	{
		return false
	}
	return true
}

function showHide(id)
{
	if ( document.getElementById(id) )
	{
		document.getElementById(id).style.display = (document.getElementById(id).style.display == 'block' ? 'none' : 'block');
	}
}

function dodajDoOferty( cena ) {
	if ( cena != '' ) {
		document.doOferty.submit();
	}
	else {
		alert( 'Nie ustalono ceny.' );
	}
}
