function fadeElement (id)
{
	var fadeFx = new Fx.Tween($(id));
	fadeFx.start ('opacity', '0');
}

function hideElement (id)
{
	var warningFx = new Fx.Tween($(id));
	warningFx.start ('opacity', '0').chain (function () {this.set('display', 'none')});
}

function showElement (id)
{
	var warningFx = new Fx.Tween($(id));
	warningFx.set ('display', '');
	warningFx.start('opacity', '1');
}

function showAlert ()
{

	// if this is the first time in the site, show the alert
	if (Cookie.read ('timemap') == null)
	{
		$('alert').innerHTML = "First time here? Check out the <a href=\"faq\">Frequently Asked Questions</a>!";
		$('alert').addEvent ('click', function(e) {
					hideElement ('alert');
				});

		// show the alert
		showElement ('alert');
	}

	Cookie.write ('timemap', new Date (), {domain: 'www.cannonade.net', duration: 1000}); 
}

function clearCookie ()
{
	Cookie.dispose ('timemap', {domain: 'www.cannonade.net', duration: 1000}); 
}
