/***********************************************************************
*
* 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 format(el,f){
if (!el.value){
	return false;
	}
if (f=="upper"){
	el.value=(el.value.split(" ")).join("");
	el.value=el.value.substring(0,(el.value.length-3))+" "+el.value.substring((el.value.length-3),el.value.length)
	el.value=el.value.toUpperCase();
	}
else if (f=="lower"){
	el.value=el.value.toLowerCase();
	}
else if (f=="capitals"){
	el.value=el.value.toLowerCase();
	var re=/(^.|\s.)/gi;
	var arr=el.value.match(re);
	for (i=0;i<arr.length;i++){
		el.value=el.value.replace(arr[i],arr[i].toUpperCase());
		}
	var re=/(Mc(.)|Mac(.)|O'(.))/g;
	var arr=el.value.match(re);
	if (arr){
		for (i=0;i<arr.length;i++){
			el.value=el.value.replace(arr[i],arr[i].substring(0,arr[i].length-1)+(arr[i].substring(arr[i].length-1,arr[i].length)).toUpperCase());
			}
		}
	}
}
