    function productList(){
	var tabContainers = $('div.tabPanels');
    
    $('div.product-description-tabs a').click(function () {
        tabContainers.hide().filter(this.hash).show();
        
        $('div.product-description-tabs li').removeClass('active-tab');
        $(this).parent().addClass('active-tab');
        
        return false;
    }).filter(':first').click();
	};
	function showdiv(id)
	{
		if(document.getElementById(id).style.display=='none')
		{
			document.getElementById(id).style.display='block';
		}else{
			document.getElementById(id).style.display='none';
		}
	}
	function mealList(val)
	{
		var len = 0;
		document.getElementById('idea').innerHTML = '';
		if(ideas[val])
		{
			len = ideas[val].length;
		}		
		addOption(document.product.idea, 'Select meal idea', '');
		for(i=0;i<len;i++)
		{
			s = ideas[val][i].split('~');
			addOption(document.product.idea, s[1], s[0]);
		}
		
	}
	function prodList(val)
	{
		var len = 0;
		document.getElementById('prod').innerHTML = '';
		if(prods[val])
		{
			len = prods[val].length;
		}
		addOption(document.product.product, 'Select Product', '');
		for(i=0;i<len;i++)
		{
			s = prods[val][i].split('~');
			addOption(document.product.product, s[1], s[0]);
		}
		
	}	
	function addOption(selectbox,text,value )
	{
		var optn = document.createElement("OPTION");
		optn.text = text;
		optn.value = value;
		selectbox.options.add(optn);
	}

// Added by Marius - 23.11.2010

function prodRedir(range, prod){
	
	var rangeId = range;
	var prodId = prod;
	
	var newForm = '<form method="POST" action="/product" name="product" style="display:none;"><input type="hidden" name="range" value="'+rangeId+'"/><input type="hidden" name="product" value="'+prodId+'"/><input type="submit" name="submit" value="Submit" id="btn-prod-redir"/></form>"';
	
	$('body').append(newForm);
	$('#btn-prod-redir').click();
	
}

$().ready(function(){

	$('a[title^="Product Of"]').bind("click", function(){ $(this).removeAttr('href'); prodRedir('22', '40'); });
	
});


