/*--------------------------------------------------------------------------------*\
|	showCart
|----------------------------------------------------------------------------------
| Displays AJAX cart.
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|	Params:
|		NONE
|	Return:
|		bool	- Always FALSE.
\*--------------------------------------------------------------= by Mr.V!T =-----*/
function showCart () {
	return postCart('/cart/index');
} //FUNC showCart

/*--------------------------------------------------------------------------------*\
|	hideCart
|----------------------------------------------------------------------------------
| Hides AJAX cart window.
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|	Params:
|		NONE
|	Return:
|			bool	- Always FALSE.
\*--------------------------------------------------------------= by Mr.V!T =-----*/
function hideCart () {
	jQuery('#AJAXLoader').jqmHide();
	jQuery('#cartAJAX').jqmHide();
	return false;
} //FUNC hideCart

/*--------------------------------------------------------------------------------*\
|	postCart
|----------------------------------------------------------------------------------
| Posts form's data to controller and displays updated cart.
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|	Params:
|		form	MIXED
|			string	- ID of form to use as input.
|			object(HTMLFormElement)
|				- Form to use as input.
|	Return:
|			bool	- Always FALSE.
\*--------------------------------------------------------------= by Mr.V!T =-----*/
function postCart(controller, form) {
	
	AR = (new ajaxReturn('cartAJAX', controller + '/AJAX')).setModals('cartAJAX', 'AJAXLoader').postForm(form, true);
	
/*/	
	AR = new ajaxReturn('cartAJAX', controller + '/AJAX');
	AR.setModals('cartAJAX', 'AJAXLoader');
	
	AR.onSuccess = function (data) {
		
		alert('Success:' + data._message);
		
	}; //FUNC on success
	
	AR.onSimple = function (data) {
		
		alert('Simple:' + data._message);
		
	}; //FUNC on success
	
	AR.onError = AR.onFail = function (data) {
		
		alert('Fail');
		
	}; //FUNC on errors
	
	AR.postForm(form);
//*/	
	return false;
//*/	
} //FUNC postCart

