function showHide(whichSwitch,thisDiv){
	if (whichSwitch == "show") {
		$(thisDiv).style.display = 'block';
	} else if (whichSwitch == "hide") {
		$(thisDiv).style.display = 'none';		
	}
}
		
function toggleLB(lbDiv,onoff,i,whichSide){
	var thisDiv = $(lbDiv);
	var onoffswitch = onoff;
	var container = $('container');
	var lbp = "tt_product_" + i;
	var lightBox = $(lbp);
	if (onoffswitch == 'on') {
		lightBox.style.visibility = "hidden";
		lightBox.style.display = "block";
		var divLocation = thisDiv.offsetTop;
		var divLeft = thisDiv.offsetLeft;
		//alert('divLocation: ' + divLocation + '\n' + 'divLeft: ' + divLeft);
		//alert('container location: ' + container.offsetTop + '\n' + 'container.offsetLeft: ' + container.offsetLeft);
		if (whichSide == "left") {
			var arrow = 'tt_arrow_left_' + i
			var arrowDiv = $(arrow);
			arrowDiv.style.top = "142px";
			arrowDiv.style.display = "block";
			lightBox.style.top = (divLocation + 150) + "px";
			lightBox.style.left = (container.offsetLeft + divLeft + 360) + "px";
		} else {
			var arrow = 'tt_arrow_right_' + i
			var arrowDiv = $(arrow);
			arrowDiv.style.top = "142px";
			arrowDiv.style.display = "block";
			lightBox.style.top = (divLocation + 150) + "px";
			lightBox.style.left = (container.offsetLeft + divLeft - 65) + "px";
		}
		lightBox.style.visibility = "visible";
	} else {
		if (whichSide == 'left') {
			var arrow = 'tt_arrow_left_' + i
			var arrowDiv = $(arrow);
			arrowDiv.style.display = "none";
		} else {
			var arrow = 'tt_arrow_right_' + i
			var arrowDiv = $(arrow);
			arrowDiv.style.display = "none";
		}
		lightBox.style.display = "none";
	}
}

function toggleHomePageLB(lbDiv,onoff,i,whichSide){
	var thisDiv = $(lbDiv);
	var container = $('container');
	var onoffswitch = onoff;
	var lbp = "tt_product_" + i;
	var lightBox = $(lbp);
	//FIND OUT POSITION OF DIV TOOLTIP IS ASSOCIATED WITH
	var offsetArr = thisDiv.cumulativeOffset();
	//
	if (onoffswitch == 'on') {
		lightBox.style.visibility = "hidden";
		lightBox.style.display = "block";
		//GET LOCATION FROM THE TOP
		var divLocation = offsetArr[1];
		var divLeft = thisDiv.offsetLeft;
		//alert('divLocation: ' + divLocation + '\n' + 'divLeft: ' + divLeft);
		if (whichSide == "left") {
			var arrow = 'tt_arrow_left_' + i
			var arrowDiv = $(arrow);
			arrowDiv.style.display = "block";
			arrowDiv.style.top = "87px";
			lightBox.style.top = (divLocation - 52) + "px";
			lightBox.style.left = (container.offsetLeft + divLeft + 235) + "px";
		} else {
			var arrow = 'tt_arrow_right_' + i
			var arrowDiv = $(arrow);
			arrowDiv.style.display = "block";
			arrowDiv.style.top = "85px";
			lightBox.style.top = (divLocation - 60) + "px";
			lightBox.style.left = (container.offsetLeft + divLeft) + "px";
		}
		lightBox.style.visibility = "visible";
	} else {
		if (whichSide == 'left') {
			var arrow = 'tt_arrow_left_' + i
			var arrowDiv = $(arrow);
			arrowDiv.style.display = "none";
		} else {
			var arrow = 'tt_arrow_right_' + i
			var arrowDiv = $(arrow);
			arrowDiv.style.display = "none";
		}
		lightBox.style.display = "none";
	}
}

function toggleMainCatLB(leftDiv,topDiv,onoff,i,whichSide){
	//alert('topDiv: ' + topDiv);
	var thisDiv = $(leftDiv);
	var container = $('container');
	//alert('container location: ' + container.offsetTop + '\n' + 'left: ' + container.offsetLeft);
	var topPositionDiv = $(topDiv);
	var onoffswitch = onoff;
	var lbp = "tt_product_" + i;
	var lightBox = $(lbp);
	if (onoffswitch == 'on') {
		lightBox.style.visibility = "hidden";
		lightBox.style.display = "block";
		var divLocation = topPositionDiv.offsetTop;
		var divLeft = thisDiv.offsetLeft;
		//alert('divLocation: ' + divLocation + '\n' + 'divLeft: ' + divLeft);
		if (whichSide == "left") {
			var arrow = 'tt_arrow_left_' + i
			var arrowDiv = $(arrow);
			arrowDiv.style.display = "block";
			arrowDiv.style.top = "85px";
			lightBox.style.top = (divLocation - 11) + "px";
			lightBox.style.left = (container.offsetLeft + divLeft + 235) + "px";
		} else {
			var arrow = 'tt_arrow_right_' + i
			var arrowDiv = $(arrow);
			arrowDiv.style.display = "block";
			arrowDiv.style.top = "85px";
			lightBox.style.top = (divLocation - 11) + "px";
			lightBox.style.left = (container.offsetLeft + divLeft - 250) + "px";
		}
		lightBox.style.visibility = "visible";
	} else {
		if (whichSide == 'left') {
			var arrow = 'tt_arrow_left_' + i
			var arrowDiv = $(arrow);
			arrowDiv.style.display = "none";
		} else {
			var arrow = 'tt_arrow_right_' + i
			var arrowDiv = $(arrow);
			arrowDiv.style.display = "none";
		}
		lightBox.style.display = "none";
	}
}

function toggleSubCatLB(leftDiv,topDiv,onoff,i,whichSide,ieBase,msieVersion){
	//alert('ieBase: ' + ieBase + '\n' + 'msieVersion: ' + msieVersion);
	var thisDiv = $(leftDiv);
	var topPositionDiv = $(topDiv);
	var container = $('container');
	var onoffswitch = onoff;
	var lbp = "tt_product_" + i;
	var lightBox = $(lbp);
	if (onoffswitch == 'on') {
		lightBox.style.visibility = "hidden";
		lightBox.style.display = "block";
		var divLocation = topPositionDiv.offsetTop;
		var divLeft = thisDiv.offsetLeft;
		//alert('divLocation: ' + divLocation + '\n' + 'divLeft: ' + divLeft);
		if (whichSide == "left") {
			var arrow = 'tt_arrow_left_' + i
			var arrowDiv = $(arrow);
			arrowDiv.style.display = "block";
			arrowDiv.style.top = "120px";
			if (msieVersion == '7') {
				var rc = $(ieBase);
				lightBox.style.top = (divLocation + rc.offsetTop + 23) + "px";
				lightBox.style.left = (container.offsetLeft + divLeft + rc.offsetLeft + 194) + "px";
			} else {
				lightBox.style.top = (divLocation + 23) + "px";
				lightBox.style.left = (container.offsetLeft + divLeft + 194) + "px";
			}
		} else {
			var arrow = 'tt_arrow_right_' + i
			var arrowDiv = $(arrow);
			arrowDiv.style.display = "block";
			arrowDiv.style.top = "120px";
			if (msieVersion == '7') {
				var rc = $(ieBase);
				lightBox.style.top = (divLocation + rc.offsetTop + 23) + "px";
				lightBox.style.left = (container.offsetLeft + divLeft - 250 + rc.offsetLeft) + "px";
			} else {
				lightBox.style.top = (divLocation + 23) + "px";
				lightBox.style.left = (container.offsetLeft + divLeft - 250) + "px";
			}
		}
		lightBox.style.visibility = "visible";
	} else {
		if (whichSide == 'left') {
			var arrow = 'tt_arrow_left_' + i
			var arrowDiv = $(arrow);
			arrowDiv.style.display = "none";
		} else {
			var arrow = 'tt_arrow_right_' + i
			var arrowDiv = $(arrow);
			arrowDiv.style.display = "none";
		}
		lightBox.style.display = "none";
	}
}

function toggleOrderConfLB(lbDiv,onoff,i,whichSide,ieBase,msieVersion){
	var thisDiv = $(lbDiv);
	var onoffswitch = onoff;
	var lbp = "tt_product_" + i;
	var lightBox = $(lbp);
	if (onoffswitch == 'on') {
		lightBox.style.visibility = "hidden";
		lightBox.style.display = "block";
		var divLocation = thisDiv.offsetTop;
		var divLeft = thisDiv.offsetLeft;
		//alert('divLocation: ' + divLocation + '\n' + 'divLeft: ' + divLeft);
		if (whichSide == "left") {
			var arrow = 'tt_arrow_left_' + i
			var arrowDiv = $(arrow);
			arrowDiv.style.display = "block";
			lightBox.style.top = (divLocation - 50) + "px";
			lightBox.style.left = (divLeft + 180) + "px";
		} else {
			var arrow = 'tt_arrow_right_' + i
			var arrowDiv = $(arrow);
			arrowDiv.style.display = "block";
			arrowDiv.style.top = "143px";
			if (msieVersion == '7') {
				var rc = $(ieBase);
				//alert('divLeft: ' + divLeft + '\n' + 'rc.offsetLeft: ' + rc.offsetLeft);
				lightBox.style.top = (divLocation + 98) + "px";
				lightBox.style.left = (divLeft - 260 + rc.offsetLeft) + "px";
			} else {
				lightBox.style.top = (divLocation - 50) + "px";
				lightBox.style.left = (divLeft - 260) + "px";
			}
		}
		lightBox.style.visibility = "visible";
	} else {
		if (whichSide == 'left') {
			var arrow = 'tt_arrow_left_' + i
			var arrowDiv = $(arrow);
			arrowDiv.style.display = "none";
		} else {
			var arrow = 'tt_arrow_right_' + i
			var arrowDiv = $(arrow);
			arrowDiv.style.display = "none";
		}
		lightBox.style.display = "none";
	}
}

function switchTab(whichDiv,whichTabSet){
	var oldContentArea = "";
	$(whichTabSet).childElements().each(function(thisOne){
		if(thisOne.className == "prodTabOn"){
			thisOne.className='prodTabOff';
		}
		oldContentArea = thisOne.id + '_content';
		if($(oldContentArea)){
			showHide('hide', oldContentArea);
		}
	});
			
	var newContentArea = whichDiv + '_content';
	$(whichDiv).className='prodTabOn';
	showHide('show',newContentArea);
}
