
function really_empty(element) {
	element.value = '';
	element.onclick = null;
}

function sendToCart(id) {
	if (!cartUrl) {
		return true;
	}

	if (!dojo.byId(id)) {
		return true;
	}

	dojo.xhrPost({
		url: cartUrl,
		load: function(response, ioArgs) {
			var smallCartContainer = dojo.byId('smallCart');
			if (smallCartContainer) {
				smallCartContainer.innerHTML = response;
			}
		},
		error: function(response, ioArgs) {
			return true;
		},
		timeout: 30000,
		form: id
	});
	
	return false;
}

function showTellAFriend() {
	if (dojo.byId('tellAFriend')) {
		dojo.byId('tellAFriend').style.display = 'block';
		dojo.byId('tellAFriendLink').onclick = hideTellAFriend;
		location.hash = 'tellAFriend';
		return false; // disable link
	}
}

function hideTellAFriend() {
	if (dojo.byId('tellAFriend')) {
		dojo.byId('tellAFriend').style.display = 'none';
		dojo.byId('tellAFriendLink').onclick = showTellAFriend;
		return false; // disable link
	}
}

dojo.addOnLoad(function() {
	hideTellAFriend();
});
