/***********************************************************************
*
* 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 toggle2(showHideDiv, switchTextDiv) {
	var ele = document.getElementById(showHideDiv);
	var text = document.getElementById(switchTextDiv);
	if(ele.style.display == "block") {
    		ele.style.display = "none";
		text.innerHTML = "+";
  	}
	else {
		ele.style.display = "block";
		text.innerHTML = "-";
	}
}
function toggle3(contentDiv, controlDiv) {
        if (contentDiv.constructor == Array) {
                for(i=0; i < contentDiv.length; i++) {
                     toggle2(contentDiv[i], controlDiv[i]);
                }
        }
        else {
               toggle2(contentDiv, controlDiv);
        }
}



/***********************************************************************
*
* ACT_DropListBox -	returns a string containing the HTML for the SELECT listbox
*
************************************************************************/

function ACT_DropListBox(ar)
{
var strIDs = '<SELECT WIDTH="180px" SIZE="1" NAME="ACT_droplstbox" onClick="if(options[selectedIndex].value) window.location.href=(options[selectedIndex].value)">';
var sel = " SELECTED"
strIDs += '<OPTION ' + sel + ' VALUE="">Select a Section</OPTION>';
for (var i=1;i<=ar.length;i++)
  {
  if (ar[i].sURL !=null)
    {
    strIDs += '<OPTION VALUE="' + ar[i].sURL + '">' + ar[i].sName + '</OPTION>';
      {
      if (ar[i].pChild)
        {
        for (var j=1;j<=ar[i].pChild.length;j++)
          {
          strIDs += '<OPTION VALUE="' + ar[i].pChild[j].sURL + '">' + '- ' + ar[i].pChild[j].sName + '</OPTION>';
            {
            if (ar[i].pChild[j].pChild)
              {
              for (var k=1;k<=ar[i].pChild[j].pChild.length;k++)
                {
                strIDs += '<OPTION VALUE="' + ar[i].pChild[j].pChild[k].sURL + '">' + '- - ' + ar[i].pChild[j].pChild[k].sName + '</OPTION>';
                }
              }
            }
          }
        }
      }
    }
  }
strIDs+='</SELECT>'
return strIDs
}
