// FHL: MCD66 - product browsing
var productType = "";
var productActive = 1;

function initProducts(type, count) {
	for (i=2; i<=count; i++) {
		obj(type + i).style.display = "none";
	}
	productType = type;
}

function showProduct(url) {
	var hasParam = url.indexOf("#");
	if (hasParam > -1) var id = url.substring(hasParam+2);

	if (id == productActive) return;
	obj(productType + productActive).style.display = "none";
	obj(productType + id).style.display = "block";
	productActive = id;
}

function showProductAmerica(ele) {
	showProduct(ele.href);
	$(ele).parent().parent().find("li").not(".actual").find("a").removeClass("active");
	$(ele).parent().not(".actual").find("a").addClass("active");
	$(ele).parent().parent().find("li").filter(".actual").find("a").addClass("deactive");
	$(ele).parent().filter(".actual").find("a").removeClass("deactive");
}
