function go_to (target, href)
{
	try { target.location = href; } 
	catch (e) { }
}

$(document).ready(function(){
$("a").each(function(){
var url = window.location.href;
var uri = url.substr(url.indexOf("herbaloja.com.pt/"));
uri = uri.replace("herbaloja.com.pt","");
uri = ((uri.charAt(uri.length-1,1) == "/") ? uri.substring(0,uri.length-1) : uri);

var href = $(this).attr("href");
href = ((href.charAt(href.length-1,1) == "/") ? href.substring(0,href.length-1) : href);
if (href == uri)
	$(this).addClass("active");
});					  
});

$(document).ready(function(){
$(".tab_title > .tab:first").addClass("active");
$(".tab_content > .tab:first").show();
});

function tab (id)
{
	$(".tab_title > .tab").removeClass("active");
	$(".tab_content > .tab").hide();
	
	$(".tab_title > #tab_title_"+id).addClass("active");
	$(".tab_content > #tab_content_"+id).show();
}

function updateKart(id)
{
	var value =	$("#"+id+" option:selected").val();
	$.post('/carrinho/update_kart/', {id : id, value : value});
}