var list = "";
var val = "";
var url = "";	
function choice(group)
{
	list = document.getElementById(group);
	if(group == "acc")
	{
		val=list.options[list.selectedIndex].value;
		if(val == "Accessoarer")
		{
			
		}
		else
		{
			url = 'submit.php?acc='+val;
			window.location.href = url;
		}
		//url = 'search_ie.php?acc='+val;
	}
	else
	{
		//var i = list.selectedIndex;
		val=list.options[list.selectedIndex].value;
		//list.options[i].selected = true;
		if(val == group)
		{
			
		}
		else
		{
			url = 'submit.php?val='+val;
			window.location.href = url;
		}
		//url = 'search_ie.php?vegId='+val;
	}
	
	//document.ravara.submit();
}				
	
	/*if(group == "cole")
	{
		val=list.options[list.selectedIndex].value;
		url = 'submit_recipe.php?val='+val;
		window.location.href = url;
	}
	
	if(group == "beans")
	{
		val=list.options[list.selectedIndex].value;
		url = 'submit_recipe.php?val='+val;
		window.location.href = url;
	}
	
	if(group == "root")
	{
		val=list.options[list.selectedIndex].value;
		url = 'submit_recipe.php?val='+val;
		window.location.href = url;
	}
	
	if(group == "fruit")
	{
		val=list.options[list.selectedIndex].value;
		url = 'submit_recipe.php?val='+val;
		window.location.href = url;
	}
	
	if(group == "acc")
	{
		val=document.ravara.acc.options[document.ravara.acc.selectedIndex].value;
		url = 'submit_recipe.php?val='+val;
		window.location.href = url;
	}*/


function submit_veg(grp)
{
	var group = document.getElementById(grp);
	var len = group.length;
	for (i=0; i<len; i++) {  
  		if(group.options[i].selected == true)
		{
			group.options[i].value = true;
		}
	}
	document.ravara.submit();	
}

function submit_recipe()
{
	var from = document.getElementById('add_list');
	for (i=0; i<from.length; i++) {  
  		from.options[i].selected = true; 
	}
	document.save_recipe.submit();
}

function submit_add()
{
	var list = document.getElementById('add');
	for(i=0; i<list.length; i++) {
		list.options[i].selected = true;
	}
	document.keys.submit();
}

function submit_acc()
{
	document.save_acc.submit();	
}

function submit_edit(btn)
{
	if(btn == "upd_rec")
	{
		var vegs = document.getElementById('add');
		for (i=0; i<vegs.length; i++) {  
			vegs.options[i].selected = true; 
		}
		var acc = document.getElementById('add_list');
		for (i=0; i<acc.length; i++) {  
			acc.options[i].selected = true; 
		}
		document.update_rec.submit();
	}
	else
	{
		document.update_acc.submit();	
	}
}

function highlight_recipe()
{
	document.about_recipe.submit();	
}

function add_news()
{
	document.load_news.submit();	
}
