var mySnacsLeftPanelOneSelected	=	true;

function browserCorrections()	{
	//center content in IE6 using variables set in brwsniff.js
	if(theDreadedIE6)	{
		/*08.04.28 - not necessary anymore
		footerNode	=	document.getElementById("footer");
		paddingLeft	=	((975/2)-300);
		//footerNode.style.marginLeft	=	""+paddingLeft+"px";
		
		if(document.getElementById("darkenScreenObject"))	{
			screenNode	=	document.getElementById("darkenScreenObject");
			paddingLeft	=	((975/2)-(document.body.offsetWidth/2));
			//screenNode.style.marginLeft	=	""+paddingLeft+"px";
		}//the following fixes a very strange IE6 "rendering" bug - on(loadSettings()) it fails to render the top portion of the inner rounded corner box correctly.  call loadSettings 2x, and voila.
		*/
		if(document.getElementById("darkenScreenSettingsContainer"))	{	//on Settings page
			grayOut(true);
			
				//MySnacs <divs>
				if(document.getElementById("darkenScreenObjectSettings"))				{loadMySnacsHover("settings");		loadMySnacsHover("settings");}
				if(document.getElementById("darkenScreenObjectInfo"))					{loadMySnacsHover("showInfo");		loadMySnacsHover("showInfo");}
				if(document.getElementById("darkenScreenObjectSnacRemove"))				{loadMySnacsHover("removeSnac");	loadMySnacsHover("removeSnac");}
				if(document.getElementById("darkenScreenObjectConfirmSnacRemove"))		{loadMySnacsHover("confirmRemove");	loadMySnacsHover("confirmRemove");}
				if(document.getElementById("darkenScreenObjectConfirmSave"))			{loadMySnacsHover("confirmSave");	loadMySnacsHover("confirmSave");}
				
				//Join Beta, Join Now, My Account <divs>
				if(document.getElementById("darkenScreenObjectValidate"))				{loadHover("validateForm");			loadHover("validateForm");}
				
				//Unload <divs>
				if(document.getElementById("darkenScreenObjectConfirmSave"))			unloadMySnacsHovers();
				if(document.getElementById("darkenScreenObjectValidate"))				unloadHover("validateForm");
			grayOut(false);
				//Positioning bug in IE6 whereby the contents of the right-hand pane somehow shift over 15px when grayOut() is called.  only scrolling over the navbar brings the contents back to where they should be
				if(document.getElementById("myAccountContainer"))	{mySnacsCategorySwap("mySnacsCategory1");mySnacsCategoryRestore("mySnacsCategory1")};
		}
	}
}


function centerSettingsBlock()	{
	darkenScreenObjContainer	=	document.getElementById("darkenScreenObjectContainer");
	marginLeft	=	((document.body.offsetWidth - 975)/2);
	darkenScreenObjContainer.style.marginLeft	=	""+marginLeft+"px";
}function rolloverSwap(imgObj)	{
	/*Called from an <img> tag like so:
		<img src="images/buttons/emailSnac.up.jpg" onMouseOver="javascript:rolloverSwap(this);" onMouseOut="rolloverRestore(this)" border="0" />
		- expects file name to be blablala.up.jpg
		- replaces it with blalblalba.over.jpg
	*/
	imgSrc	=	imgObj.src;
	newSrcBeg	=	imgSrc.substring(0,imgSrc.lastIndexOf("up"));
	if(imgSrc.indexOf("jpg")!=-1)		newSrcEnd	=	imgSrc.substring(imgSrc.lastIndexOf(".jpg"),imgSrc.length);
	else if(imgSrc.indexOf("gif")!=-1)	newSrcEnd	=	imgSrc.substring(imgSrc.lastIndexOf(".gif"),imgSrc.length);
	else if(imgSrc.indexOf("png")!=-1)	newSrcEnd	=	imgSrc.substring(imgSrc.lastIndexOf(".png"),imgSrc.length);
	newSrc		=	newSrcBeg + "over" + newSrcEnd;
	imgObj.src	=	newSrc;
}function rolloverRestore(imgObj)	{
	imgSrc	=	imgObj.src;
	newSrcBeg	=	imgSrc.substring(0,imgSrc.lastIndexOf("over"));
	if(imgSrc.indexOf("jpg")!=-1)		newSrcEnd	=	imgSrc.substring(imgSrc.lastIndexOf(".jpg"),imgSrc.length);
	else if(imgSrc.indexOf("gif")!=-1)	newSrcEnd	=	imgSrc.substring(imgSrc.lastIndexOf(".gif"),imgSrc.length);
	else if(imgSrc.indexOf("png")!=-1)	newSrcEnd	=	imgSrc.substring(imgSrc.lastIndexOf(".png"),imgSrc.length);
	newSrc		=	newSrcBeg + "up" + newSrcEnd;
	imgObj.src	=	newSrc;
}function rolloverSwapLogo()	{
	logoImgObj		=	document.getElementById("snacNavbarLogo");
	logoImgSrc		=	logoImgObj.src;
	newSrcBeg		=	logoImgSrc.substring(0,logoImgSrc.lastIndexOf("up"));	
	newSrcEnd		=	logoImgSrc.substring(logoImgSrc.lastIndexOf(".gif"),logoImgSrc.length);
	newSrc			=	newSrcBeg + "over" + newSrcEnd; 
	logoImgObj.src	=	newSrc;
}function rolloverRestoreLogo()	{	
	logoImgObj		=	document.getElementById("snacNavbarLogo");
	logoImgSrc		=	logoImgObj.src;
	newSrcBeg		=	logoImgSrc.substring(0,logoImgSrc.lastIndexOf("over"));
	newSrcEnd		=	logoImgSrc.substring(logoImgSrc.lastIndexOf(".gif"),logoImgSrc.length);
	newSrc			=	newSrcBeg + "up" + newSrcEnd; 
	logoImgObj.src	=	newSrc;
}


function mySnacsCategorySwap(id)	{
	if(mySnacsLeftPanelOneSelected)	mySnacsClearCategories();
	linkObj	=	document.getElementById(id+"Link");
	pObj	=	document.getElementById(id);
	linkObj.style.color="#FFFFFF";
	pObj.className="mySnacsPaneLeftCategorySelected";
}
/*
08.04.30
This version of mySnacsCategoryRestore() emulates the behavior of always leaving the last mousedOver link highlighed.  Use with the following code:
<a id="mySnacsCategory1Link" class="mySnacsPaneLeftCategorySelected" href="doSomething.html"><p id="mySnacsCategory1" class="mySnacsPaneLeftCategorySelected" onMouseOver="mySnacsCategoryRestore(this.id);mySnacsCategorySwap(this.id)"  onClick="javascript:mySnacsSetCategory()">Executive</p></a>

function mySnacsCategoryRestore(id)	{
	for(i=1;i<14;i++)	{		//14 is the maximum number of categories possible on mySnacs left panel
		itemId	=	"mySnacsCategory" + i + "";
		if(id!=itemId && document.getElementById(itemId))	{
			linkObj	=	document.getElementById(itemId+"Link");
			pObj	=	document.getElementById(itemId);
			linkObj.style.color="#484848";
			pObj.className="mySnacsPaneLeftCategoryUnselected";
		}
	}
	mySnacsLeftPanelOneSelected	=	false;
}
*/
/*
This version of mySnacsCategoryRestore() emulates the behavior of unhighlighting the snac onRollOut so that it potentially leaves the menu without anything hightlighted
*/
function mySnacsCategoryRestore(id)	{
	linkObj	=	document.getElementById(id+"Link");
	pObj	=	document.getElementById(id);
	linkObj.style.color="#484848";
	pObj.className="mySnacsPaneLeftCategoryUnselected";
}

function mySnacsClearCategories()	{ 
	for(i=1;i<14;i++)	{		//14 is the maximum number of categories possible on mySnacs left panel
		itemId	=	"mySnacsCategory" + i + "";
		if(document.getElementById(itemId))	{
			mySnacsCategoryRestore(itemId);
		}
	}
	mySnacsLeftPanelOneSelected	=	false;
}function mySnacsSetCategory()	{
	mySnacsLeftPanelOneSelected	=	true;	
}