

function reload_category_menu(idCategory,nameCategory)
{
	var menu = new Request(
	{
		url:window.location.protocol+'//'+window.location.host+'/ecommerce/catalog/select_category/filter_label_category/'+nameCategory,
		onSuccess: function(respText)
		{
		}
	}).send();

	var menu = new Request(
	{
		url:window.location.protocol+'//'+window.location.host+'/ecommerce/catalog/reload_category_list/id_category/'+idCategory,
		onSuccess: function(respText)
		{
			document.getElementById('menu-category').innerHTML=respText;
		}
	}).send();

	 var prodlist = new Request(
	{
		url:window.location.protocol+'//'+window.location.host+'/ecommerce/catalog/get_product_list/id_category/'+idCategory,
		onSuccess: function(respText)
		{
			document.getElementById('right-content').innerHTML=respText;
		}
	}).send();

	return false;
}


function show_hide_family_search()
{
	family_elem = document.getElementById('family-search');
	if(family_elem.style.display=='block' || !family_elem.style.display)
		family_elem.style.display='none';
	else
		family_elem.style.display='block';
}

function switch_arrow()
{
	arrow = document.getElementById('arrow_advanced_search');
	if(arrow.src=="http://vps1.elettrorama.com/ecommerce/images/katamac_02/common/arrow_adv_search_down.png")
		arrow.src = "http://vps1.elettrorama.com/ecommerce/images/katamac_02/common/arrow_adv_search_up.png";
	else
		arrow.src = "http://vps1.elettrorama.com/ecommerce/images/katamac_02/common/arrow_adv_search_down.png";
}
/*
vaCheckList = document.getElementsByClassName('check-list2');
for (i in vaCheckList)
alert(vaCheckList[i]);
	/*$(vaCheckList[i]).addEvent('click',function (e) {
		alert("OK");
	});*/


	/*var toggle = $('toggler').checked;
	$$('#formId input[type=checkbox]').each(function(check) {
		check.checked = toggle;
	});*/

/*
 * Funzione che permette di selezionare al massimo vnMax checkbox appartenenti alla classe dell'elemento voElem
 */
function testMaxCheck(voElem,vnMax)
{
	vaCheck = $$('.'+voElem.className);
	vnSel = 0;
	for(i in vaCheck)
		if(vaCheck[i].checked)
			vnSel++;
	if(vnSel > vnMax)
	{
		alert("Puoi selezionare al massimo 3 elementi per il confronto");
		voElem.checked = false;
	}
}

/*
 *
 */
function show_elem(idElem)
{
	document.getElementById(idElem).style.display = "block";
}

/*
 *
 */
function hide_elem(idElem)
{
	document.getElementById(idElem).style.display = "none";
}

/*
 *
 */
function show_only_elem(idElemToShow, firstToHide, lastToHide)
{
	for(i=firstToHide; i<=lastToHide; i++) {
		document.getElementById('spec_'+i).style.display = "none";
	}
	document.getElementById(idElemToShow).style.display = "block";
}
