toggleContent = {

/************************************* CSS Classes ********************************************************/
	dynamicClass:'hide',
  	hiddenContainerId:'shopping-basket-container',
	hiddenContainerClass:'hidden_content',
	// Set variables for link text
	closeLabel : 'Hide Extra Options for the above Product',
	openLabel : 'Show Extra Options for the above Product',

	
/************************************* Initialise functionality ********************************************************/
  	// Initilise the div that stores the hidden content
  	init:function()
  	{
		if(!document.getElementById || !document.createTextNode){return;}
		container = document.getElementById(toggleContent.hiddenContainerId);
		// If the 'hidden_content' element isnt available - terminate script
		if(container)
		{
			// If the 'hidden_content' element is availabe (we've got this far , so it must be) - apply a dynamic style
			// to hide it (display:none)
			
			_link = helper.getElementsByClass(toggleContent.hiddenContainerClass,container, 'div');
			
			if(!_link) { return;}
			
			for (j=0;j<_link.length;j++)
			{

				helper.cssjs('add', _link[j], toggleContent.dynamicClass);
				// Initilise the link that toggles the didden content 
				toggleContent.initDisplayLink(_link[j]);
			}
		};
  	},
  	
  	/****************** Toggle Link ****************************/

  	// Build the link that toggles the divs display status
  	initDisplayLink:function(element)
  	{
   		// Create link element
  		toggleContent.closelink=document.createElement('a');
		toggleContent.closelink.setAttribute('class', 'show_hide_attribute');
  		// Create textnode (note we can use the var keyword because the variable is only needed within the funtion
  		var closetext=document.createTextNode(toggleContent.openLabel);
  		// Assign hash to closelink
  		toggleContent.closelink.href='';
  		// Use appendchild to add the text node to the link node
  		toggleContent.closelink.appendChild(closetext);
		// Add the onclick event behaviour to the link
		helper.addEvent(toggleContent.closelink,'click',toggleContent.applyLinkEvent,false);
		//helperMethods.addEvent(closelink,'onkeypress',fp.applyLinkEvent,false);
		
		// Set object div so we can determine the parentnode
		// var objectDiv = document.getElementById(toggleContent.hiddenContainerId);
		// Get parentnode so we use the insertBefore method to insert the toggle link
		var parentDiv = element.parentNode;
		// Use insertBefore method to insert the link before the hidden content
		parentDiv.insertBefore(toggleContent.closelink, element);
	},
	
	// Method used to determine wheather to hide or show content
	applyLinkEvent:function(e)
	{
		var target=helper.getTarget(e);
		//nextSibling
		var container = target.nextSibling;
		// Use the cssjs method to determine if the hide class is already attatched to the container div
		if(helper.cssjs('check', container, toggleContent.dynamicClass))
		{
			//var myText = document.createTextNode("hello world");
			// If it is, remove the style (show hidden content)
			this.innerHTML=toggleContent.closeLabel;
			helper.cssjs('remove', container, toggleContent.dynamicClass);
		}
		else // If the hide class is not already applied to the container div, add it (hiding the content)
		{
			this.innerHTML=toggleContent.openLabel;
			helper.cssjs('add', container, toggleContent.dynamicClass);
		}
		// Cancel click - very important because the link doesnt have a hash
		helper.cancelClick(e);
	}
}
helper.addEvent(window, 'load', toggleContent.init, false);