function getCookie(key) {
	var cookieValue = null;

	if (key) {
		var cookieSearch = key + "=";

		if (document.cookie) {
			var cookieArray = document.cookie.split(";");

			for (var i = 0; i < cookieArray.length; i++) {
				var cookieString = cookieArray[i];

				// skip past leading spaces
				while (cookieString.charAt(0) == ' ') {
					cookieString = cookieString.substr(1);
				}

				// extract the actual value
				if (cookieString.indexOf(cookieSearch) == 0) {
					cookieValue = cookieString.substr(cookieSearch.length);
				}
			}
		}
	}

	return cookieValue;
}

function updateShapeCode(shape) {
	var replacement = '(shape <span>' + shape + '</span>)';
	$('#myshape-header > .myshape-ps > .single-line > #shape-display').html(replacement);
}

function clickChatButton() {
	$('.live-chat').click();
}
