/* MENU */


/**
 * Toggle the children elements from a category
 * @param tableId 
 * @return
 */
function toggleChildren(tableId){
		$(tableId).select("tr.children").each(function(item){ item.toggle()} );
		$('parent-' + tableId).toggleClassName('groupIndicatorActive');
		$('parent-' + tableId).toggleClassName('groupIndicatorInactive');
		
	}

// QUOTATION

/**
 * Removes a part from a quotation 
 * @param partId
 * @return
 */
function removePart(partId){
	
	if($('partida' + partId))
	{
		$('partida' + partId).remove();
	}
}




/**
 * Check if we have an empty quotation
 * and insert a message about it 
 * @param mensaje
 * @return
 */
function mensajeCotVacia(mensaje){
	var mensajeTbody = '<tr><td class="mensaje" colspan="6">'+mensaje+'</td></tr>';
	$('quotTbody').insert({ top : mensajeTbody});
	
	
		
}
/**
 * Removes the submit button from the quotation
 * @param id submit button id
 * @return
 */
function removeSubmit(id){
	if($(id))
	{
		$(id).remove();
	}
}




/**
 * 
 */
function updateItemCount(itemCount){
	
	if($('itemsEnCarrito'))
	{
		
		$('itemsEnCarritoSpan').hide();
		$('itemsEnCarritoSpan').update(itemCount) ;
		Effect.Appear('itemsEnCarritoSpan',  {delay:0.5, queue: 'front'});
	}
}
