function changeTipCat(menuId) {
	if (!menuId) menuId = currentMenuCat;
	for(var ix=0; ix < numofImg; ix++) {
		var state = "off";	
		if (menuId == ix) state = "on";		
		changeRolloverImg(ix, state);
	}				
}

function changeTipCatInfo(cat, menuId) {
	currentMenuCat = menuId;
	changeTipCat(menuId);
	document.menuImg.src = menuImg[menuId].src;
	document.menuImg.alt = cat;				
	document.menuTipTitle.src = menuTipTitle[menuId].src;
	document.menuTipList.src = menuTipList[menuId].src;
}

function showTipPageContent(obj, num){
	if (document.getElementById && document.getElementById('stepInstruction')) {
		document.getElementById('stepInstruction').innerHTML = document.getElementById('stepInstruction' + num).innerHTML;		
		
		var stepImages = document.getElementById('stepsDiagram').getElementsByTagName('img');					
		for (var i=0; i < stepImages.length; i++) {
			stepImages[i].className = stepImages[i].className.replace(" solid", "");
		}				
		obj.className += " solid";		
	}			
}	



var defaultZInx; //keep track of current callout's original z-index number
var oldId;
function moveFront(id, zinx) { //move selected callout to the front		
	if (document.getElementById) {
		if (defaultZInx && oldId) {
			moveBack(oldId);
		}
		defaultZInx = zinx;
		oldId = id;
		document.getElementById(id).style.zIndex = 810;			
	}			
}
		
function moveBack(id) { //move callout back to the original position
	if (document.getElementById) document.getElementById(id).style.zIndex = defaultZInx;				
}

function loadTips(el, catID, menuContainer) {
	$('imgRolloverFlag').value = el.id
	try {
		ImgRollover.clearAll(menuContainer);
	} catch(err){}

	$('tipTitle').src = 'images/tipTitle'+catID+'.gif'
	$('imgTarget').src= 'images/menuImg'+catID+'.jpg';
	$('tipsContainer').innerHTML = $(catID+'Container').innerHTML;
	
}

window.onload = function() {
	var currentUrl = window.location.pathname;
	try{
		if(getQueryVariable("showVideos") == 'face') {
			loadTips('img105',105, 'menuList');
			$('img105').src = 'images/105_on.gif';
		}else{
			$('imgRolloverFlag').value=subProdId;
			loadTips('img'+subProdId, subProdId, 'tipMenu');
			$('tipMenu').getElementsByTagName('img')[0].src = eval($('tipMenu').getElementsByTagName('img')[0].id+'_on.src')
			$('imgRolloverFlag').value=$('tipMenu').getElementsByTagName('img')[0].id;
		}
	} catch(err) {}
}