//*************************************************//
//     HIDE ALL DIV AND SHOW SELECTEDINDEX ID      //
//*************************************************//
function submitSearchBox( formID )
{
	// Return formID elements values as an imploded string
	var value = Object.values($( formID ).serialize( true )).first();

	//alert(value.length);

	if(value.length > 0)
	{
		if(value.length > 1) var value = value.join(' ');

		$( 'SearchText' ).value = value;

		$( formID ).submit();
	}
	else
	{
		alert('Veuillez entrer au moins un critere de recherche');
	}

	//alert($('searchArray'));

	//alert(Object.keys(jojo));
}
//*************************************************//
//     HIDE ALL DIV AND SHOW SELECTEDINDEX ID      //
//*************************************************//
function basketAction(index, action)
{
	if (arguments.length == 2)
	{
		// Find the element to modify
		var form = $('basketform');

		// Get all quantities
		var buttons = form.getInputs('text', 'ProductItemCountList[]');

		// Get value of selected quantity
		var quantity = $F(buttons[index]);


		// Based on action modify this quantity
		if (action == 'remove')
		{
			quantity = 0;
		}
		else if (action == 'plus')
		{
			quantity++;
		}
		else if (action == 'minus')
		{
			quantity--;
		}

		// Set value of selected quantity
		Form.Element.setValue(buttons[index], quantity);

		// Set action in action hidden field
		$('action').name = 'StoreChangesButton';

		// Submit
		$('basketform').submit();
	}
	else
	{
		alert("We cannot execute this action");
	}
}
