// JavaScript Document
function writeHeaderImage()
{
getFlashPref();
document.write('<center><img src="' + headerImage + '" alt="Header" width="801" height="115" border="0" usemap="#Map2" /></center>');
}

function writeBannerImage()
{
	if (userFlash != "off") AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','799','height','234','align','middle','title','Candlelight Flash','src','../Flash Banner/flash3','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movie','../Flash Banner/flash3' ); //end AC code
	else document.write('<center><img src="../Background Images/flashalt.jpg" alt="Banner" width="800" height="234" border="0" /></center>');
}

function getFlashPref()
{
userFlash = getCookie ("userFlash");
if (userFlash == "off") headerImage = "../Background Images/header2.jpg"
else headerImage = "../Background Images/header.jpg"
}

function toggleFlashPref()
{
if (userFlash == "off") flashPref = "on";
else flashPref = "off";
setCookie("userFlash", flashPref, 1);
window.location.reload();
}

function getCookie(NameOfCookie)
{
	if (document.cookie.length > 0)
	{
		begin = document.cookie.indexOf(NameOfCookie+"=");
		if (begin != -1)
		{
			begin += NameOfCookie.length+1;
			end = document.cookie.indexOf(";", begin);
			if (end == -1) end = document.cookie.length;
			return unescape(document.cookie.substring(begin, end));
		}
	}
	return null;
}

function setCookie(NameOfCookie, value, expiredays)
{
var ExpireDate = new Date ();
ExpireDate.setTime(ExpireDate.getTime() + (expiredays * 24 * 3600 * 1000));
document.cookie = NameOfCookie + "=" + escape(value) + ";path=/;" +
((expiredays == null) ? "" : "; expires=" + ExpireDate.toGMTString());
}



function delCookie (NameOfCookie)
{
	if (getCookie(NameOfCookie)) {
	document.cookie = NameOfCookie + "=" +
	"; expires=Thu, 01-Jan-70 00:00:01 GMT";
	}
}