/***********************************************************************
*
* getCartItem		-	Gets the Actinic Cart Value & No of Items
*
* Input: nIndex	-	Cart item index to retrieve
*							1 = TOTAL_VALUE
*							3 = CART_COUNT
*
* Returns:				Requested cart item or 0 (zero) if not found
*
************************************************************************/

//CART_CONTENT = Cookie name
//1 = TOTAL_VALUE
//3 = CART_COUNT

function getCartItem(nIndex)
	{
	var act_cart= getCookie("CART_CONTENT")
	var sTemp =(act_cart != null) ? sTemp=act_cart.split("\t"):0;
	return (sTemp.length > 0) ? sTemp[nIndex] : 0;
	}

/***********************************************************************
*
* GotoAnchor - JS for jumping to an anchor - some user agents don't handle
*				anchors correctly if BASE HREF is present
*
* Input: 				sAnchor
*
* Returns:				nothing
*
************************************************************************/

function GotoAnchor(sAnchor)
	{
	window.location.hash = sAnchor;
	}

		function getWindowHeight() {
			var windowHeight = 0;
			if (typeof(window.innerHeight) == 'number') {
				windowHeight = window.innerHeight;
			}
			else {
				if (document.documentElement && document.documentElement.clientHeight) {
					windowHeight = document.documentElement.clientHeight;
				}
				else {
					if (document.body && document.body.clientHeight) {
						windowHeight = document.body.clientHeight;
					}
				}
			}
			return windowHeight;
		}
		
		function setFooter() {
			if (document.getElementById) {
				var windowHeight = getWindowHeight();
				if (windowHeight > 0) {
					var footerElement = document.getElementById('footer');
					var contentHeight = document.getElementById('main_body').offsetHeight;
					var leftHeight = document.getElementById('nav_container').offsetHeight + 150;
					var rightHeight = document.getElementById('right_bar').offsetHeight - 36;
					var headerHeight = document.getElementById('header').offsetHeight;
					var footerHeight  = footerElement.offsetHeight;
					
					var totalHeight = Math.max(leftHeight,contentHeight);
					totalHeight = Math.max(rightHeight,totalHeight);
					totalHeight = totalHeight + headerHeight;
					
					if (windowHeight - totalHeight < 0) {
						footerElement.style.position = 'absolute';
						footerElement.style.top = (totalHeight + 100) + 'px';
					}
					else {
						footerElement.style.position = 'absolute';
						footerElement.style.top = 700 + 'px';
					}
				}
			}
		}