function listToggle(id_name,mode){
	// id_name	=	"toggle_id3";
	
	// Length of id_name string
	id_length	=	id_name.length;
	// Trip string to get the parent ID name
	// id_name		=	id_name.substring(7,id_length);
	// Thumbnail Image (Returns Array)
	image		=	$$('#'+id_name+' img');
	
	// Length of imgage source
	image_length	=	image[0].src.length;
	// Image path and filename (-extension and suffix)
	image_source	=	image[0].src.substring(0,image_length-8);
	// Image exension
	image_ext		=	image[0].src.substring(image_length-4,image_length);
	
	// Parent DIV box
	id		=	$(id_name);
	
	// console.debug(image_source);
	// console.debug();
	
	/***	EFFECTS		***/
	
	toggle 	= 	new fx.Height(id, {duration: 130});
	imageH 	= 	new fx.Height(image[0], {duration: 130});
	imageW 	= 	new fx.Width(image[0], {duration: 130, onComplete: function(){
		// Change image source to large or small image,
		// depending if the product is active
		if(active){
			image[0].src	=	image_source+'_050'+image_ext;
		}else{
			image[0].src	=	image_source+'_120'+image_ext;
		}
		}});
	active	=	id.hasClassName('active');
	full	=	id.hasClassName('full');

	// console.debug(active);
	
	/***	RUN THE EFFECTS		***/
	if(active){
		
		if(full && mode == 'img'){
			
			
			showLightbox(image[0].parentNode,image_source+'_full'+image_ext);
			
			// image[0].parentNode.href = ;
			
			// image[0].parentNode.rel = 'lightbox';
			
			// image[0].parentNode.href = '#test';
			// id.removeClassName('active');
			// 		toggle.custom(130,55);
			// 		imageH.custom(120,50);
			// 		imageW.custom(120,50);
			
			
		}else{
			id.removeClassName('active');
			toggle.custom(130,55);
			imageH.custom(120,50);
			imageW.custom(120,50);
		}
		
	}else{
		id.addClassName('active');
		toggle.custom(55,130);
		imageH.custom(50,120);
	   	imageW.custom(50,120);
		// $('quantity_'+id_name).focus();
	}	
	
}


function listProcess(){
	var elements = document.getElementsByClassName("toggle");
	
	elements.each(  
		function(e) {  
			// 
			// list = e.parentNode.parentNode.id;
			
		// Assign the onclick method to the element
		// console.info(e.parentNode.parentNode.id);
		e.removeAttribute('href');
		Event.observe(e, "click", function(){ listToggle(e.parentNode.parentNode.id,'link') });
		
		// Add CSS
		// var list_height = new fx.Style(list,'height');
		// 	list_height.
		// e.parentNode.parentNode.style.height = '55px';
		// $(e.parentNode.parentNode.id + ' .expand').style.height = '55px';
		
		
		}  
	);

	var images = document.getElementsByClassName("toggle_image");
	
	images.each(  
		function(e) {  
		// Assign the onclick method to the element
		// console.info(e.parentNode.id);
		e.removeAttribute('href');
		Event.observe(e, "click", function(){ listToggle(e.parentNode.id,'img') });
		}  
	);	
	// console.debug(toggleProducts);	
}

// new Insertion.Bottom(document.tagName('HEAD'), html)




document.write('\n\t<style type="text/css" media="screen">\n\t.list{\n\t\theight: 55px;\n\t}\n\t.list .expand{\n\t\tvisibility: hidden;\n\t}\n\t</style>\n');

/*
function myFunction()
{
	alert("The DOM is ready");
};
var foobar = new domFunction(myFunction, { 'h1' : 'tag'});
*/


var process = new domFunction(function()
{
		listProcess();

});


// window.onload = function() {
// 	// containerHeight = new fx.Height('id1', {duration: 130});
// 	
// 	
// 
// 	listProcess();
// 	// listToggle('id3');
// 	
// }