/***********************************************************************
*
* 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;
	}

/***********************************************************************
*
*Random Banner 
*
************************************************************************/

function random_banner(){
  var banneri=0;
  banners = new Array();
  banners[0] = '<td align="right" width="100%" height="70"><a href="http://www.cooks-knives.co.uk/acatalog/Knife_Sets_Special_Offers.html"><img border="0" src="http://www.cooks-knives.co.uk/acatalog/banner1.jpg" alt="SALE ON and New Special Offers"></a></td>';
  banners[1] = '<td align="right" width="100%" height="70"><a href="http://www.cooks-knives.co.uk/acatalog/Henckels_Knives_-_Twin_Fin.html"><img border="0" src="http://www.cooks-knives.co.uk/acatalog/banner3.jpg" alt="New - Henckels Twin Fin Knife Range - Click for Details"></a></td>';
  banners[2] = '<td align="right" width="100%" height="70"><a href="http://www.cooks-knives.co.uk/acatalog/Knife_Sharpeners.html"><img border="0" src="http://www.cooks-knives.co.uk/acatalog/banner4.jpg" alt="Knife Sharpeners - Steels, Whetstones, Manual and Electric Sharpeners..."></a></td>';
  banners[3] = '<td align="right" width="100%" height="70"><a href="http://www.cooks-knives.co.uk/acatalog/Global_Knives.html"><img border="0" src="http://www.cooks-knives.co.uk/acatalog/banner5.jpg" alt="Global Knives - Huge Range - Save £100s!"></a></td>';  
  banners[4] = '<td align="right" width="100%" height="70"><a href="http://www.cooks-knives.co.uk/acatalog/Henckels_Knives.html"><img border="0" src="http://www.cooks-knives.co.uk/acatalog/banner6.gif" alt="Henckels Knives - 6 Ranges - Save Up To £200!"></a></td>';  
  
  bannern=banners.length;
  var randombannernumber=Math.floor(Math.random()*bannern)
  return banners[randombannernumber];
}

/***********************************************************************
*
*MakeItSo function - moves fragments to the bottom of a page 
*
************************************************************************/


function makeitso() {
 //make an array of all the divs on this page.
 MoveUs = document.getElementsByTagName("div"); 
 
 //loop all the divs.
 for( var i = 0; i < MoveUs.length; i++ ) 
 { 
 
 //only if it has the class 'movethis'
 if (MoveUs[i].className=="movethis") {
 ThisItem = MoveUs[i]
 
	//get the html from inside this div
	temp = ThisItem.innerHTML;
	
	//where is it going?
	//document.write (ThisItem.title);
	
	//empty the old div
	ThisItem.innerHTML = "";

	//append it to the end of the target div, found in the rel attribute
	document.getElementById(ThisItem.title).innerHTML = document.getElementById(ThisItem.title).innerHTML+temp;
	}
 } 

}