function findPos(obj)
{
	var curleft = curtop = 0;
	if (obj.offsetParent)
	{
		curleft = obj.offsetLeft
		curtop = obj.offsetTop
		while (obj = obj.offsetParent)
		{
			curleft += obj.offsetLeft
			curtop += obj.offsetTop
		}
	}
	return [curleft,curtop];
}

var pyramidCategories = new Array("grains", "vegetables", "fruit", "milk", "meat");
var leftSmartChoices = new Array("act2", "blue_bonnet", "egg", "fleischmanns", "guldens", "healthy_choice", "hunts", "kid", "lachoy", "lucks");
var rightSmartChoices = new Array("orville", "pam", "parkay", "peter_pan", "ranch", "rosarita", "van_camps", "wesson");
var hcLists = new Array("entrees", "steamers", "asian_steamers", "select_entrees", "complete_meals_beef", "complete_meals_poultry", "complete_meals_pasta", "pizza", "fresh_mixers", "sauces", "soups_canned", "soups_bowls");

function hideSliders() {
	if (document.getElementById(pyramidCategories[0]) != null) {
		for (i = 1; i < pyramidCategories.length; i++) {
			document.getElementById(pyramidCategories[i]).style.display = "none";
			document.getElementById(pyramidCategories[i] + "Img").src = "/images/mypyramid/mypyramid/" + pyramidCategories[i] + "_off.jpg";		
		}
	} else if (document.getElementById(leftSmartChoices[0]) != null) {
		for (i = 0; i < leftSmartChoices.length; i++) {
			document.getElementById(leftSmartChoices[i]).style.display = "none";
			document.getElementById(leftSmartChoices[i] + "Img").src = "/images/nutrition/smart-choices-program/off/" + leftSmartChoices[i] + ".jpg";		
		}
		for (i = 0; i < rightSmartChoices.length; i++) {
			document.getElementById(rightSmartChoices[i]).style.display = "none";
			document.getElementById(rightSmartChoices[i] + "Img").src = "/images/nutrition/smart-choices-program/off/" + rightSmartChoices[i] + ".jpg";		
		}
		for (i = 0; i < hcLists.length; i++) {
			document.getElementById(hcLists[i]).style.display = "none";
			document.getElementById(hcLists[i] + "Img").innerHTML = "+";		
		}
	}
}

function hideCategory(category) {
	new Effect.BlindUp(category);
	document.getElementById(category.id + "Img").src = "/images/nutrition/smart-choices-program/off/" + category.id + ".jpg";	
}

function displayHCLists(list) {
	for (i = 0; i < hcLists.length; i++) {
		var current = hcLists[i];
		var currentImg = current + "Img";
		if (document.getElementById(current).style.display != "none" && current != list) {
			new Effect.BlindUp(current);
			document.getElementById(currentImg).innerHTML = "+";
		}
	}
	new Effect.BlindDown(list);
	document.getElementById(list + "Img").innerHTML = "&ndash;";
}

function displayLeftSmartChoices(categoryType) {
	for (i = 0; i < leftSmartChoices.length; i++) {
		var current = leftSmartChoices[i];
		var currentImg = current + "Img";
		if (document.getElementById(current).style.display != "none" && current != categoryType) {
			new Effect.BlindUp(current);
			document.getElementById(currentImg).src = "/images/nutrition/smart-choices-program/off/" + current + ".jpg";
		}
	}
	new Effect.BlindDown(categoryType);
	document.getElementById(categoryType + "Img").src = "/images/nutrition/smart-choices-program/over/" + categoryType + ".jpg";
}

function displayRightSmartChoices(categoryType) {
	for (i = 0; i < rightSmartChoices.length; i++) {
		var current = rightSmartChoices[i];
		var currentImg = current + "Img";
		if (document.getElementById(current).style.display != "none" && current != categoryType) {
			new Effect.BlindUp(current);
			document.getElementById(currentImg).src = "/images/nutrition/smart-choices-program/off/" + current + ".jpg";
		}
	}
	new Effect.BlindDown(categoryType);
	document.getElementById(categoryType + "Img").src = "/images/nutrition/smart-choices-program/over/" + categoryType + ".jpg";
}

function displayPyramidCategory(categoryType) {
	for (i = 0; i < pyramidCategories.length; i++) {
		var current = pyramidCategories[i];
		var currentImg = current + "Img";
		if (document.getElementById(current).style.display != "none" && current != categoryType) {
			new Effect.BlindUp(current);
			document.getElementById(currentImg).src = "/images/mypyramid/mypyramid/" + current + "_off.jpg";
		}
	}
	new Effect.BlindDown(categoryType);
	document.getElementById(categoryType + "Img").src = "/images/mypyramid/mypyramid/" + categoryType + "_on.jpg";
}