function element(id) {
	return document.getElementById(id);
}

function go(path) {
	if (arguments.length > 1) {
		var replace = arguments[1];
	} else {
		var replace = false;
	}
	
	if (replace) {
		window.location.replace(path);
	} else {
		window.location = path;
	}
}

function menuHide(id) {
	element('menu' + id).style.backgroundImage = '';
	if (element('pages' + id)) {
		element('pages' + id).style.backgroundImage = '';
		element('pages' + id).style.visibility = 'hidden';
	}
}

function menuShow(id) {
	element('menu' + id).style.backgroundImage = 'url(\'/images/menuBackground.png\')';
	if (element('pages' + id)) {
		element('pages' + id).style.backgroundImage = 'url(\'/images/menuBackground.png\')';
		element('pages' + id).style.visibility = 'visible';
	}
}

function showContactForm() {
	var to = '';
	
	if (arguments.length) {
		to = encodeURIComponent(arguments[0]);
	}
	
	window.open('/contact-form.php?to=' + to, 'contactForm', 'directories=no, height=620, left=' + Math.floor((screen.width - 620) / 2) + ', location=yes, menubar=no, scrollbars=no, status=no, toolbar=no, top=' + Math.floor((screen.height - 620) / 2) + ', width=620');
}

function viewCart() {
	element('cart').submit();
}

function watchFromBlossomToBarrel() {
	window.open('/blossom-to-barrel.php', 'fromBlossomToBarrel', 'directories=no, height=540, left=' + Math.floor((screen.width - 960) / 2) + ', location=yes, menubar=no, scrollbars=no, status=no, toolbar=no, top=' + Math.floor((screen.height - 540) / 2) + ', width=960');
}

function watchBeeSeason() {
	window.open('/bee-season.php', 'beeSeason', 'directories=no, height=540, left=' + Math.floor((screen.width - 960) / 2) + ', location=yes, menubar=no, scrollbars=no, status=no, toolbar=no, top=' + Math.floor((screen.height - 540) / 2) + ', width=960');
}

