(function($) {

	// ******************************************************************************** //
	//	W E B S I T E     U I
	// ******************************************************************************** //
	
	StoreFrontUI = 
	{
		settings: {
			test: "settings success!!!"
		},
		
		//----------------------------------------------------------------------
		//
		//----------------------------------------------------------------------
		config: function(options)
		{
			this.settings = jQuery.extend(this.settings, options || {});		
		},
		
		
		//----------------------------------------------------------------------
		//	adds a golfer to the pro shop
		//----------------------------------------------------------------------
		AddItemToCart: function(item)
		{
			jQuery.ajax(
			{
				url: "/store/ajax/add-item-to-cart",
				type: 'POST',
				cache: false,
				data: item,
				beforeSend: function(response, settings)
				{
					Processing.show('Updating Course...');
				},
				success: function(data) 
				{
					jQuery.facebox.close();
					
					Processing.show('Course Updated', {autohide: 3, type:'success'});
				},
				error: function(response, text_status, error)
				{
					WebSiteUI.SiteModalMessage(response.responseText, 'error');
				},
				complete: function(response, text_status)
				{
					Processing.hide();
				}
			});						
		},		

		//----------------------------------------------------------------------
		//	adds a golfer to the pro shop
		//----------------------------------------------------------------------
		UpdateWebSiteChannel: function(channel)
		{
			jQuery.ajax(
			{
				url: "/admin/timeline/ajax/channel-save",
				type: 'POST',
				cache: false,
				data: channel,
				beforeSend: function(response, settings)
				{
					Processing.show('Updating Channel...');
				},
				success: function(data) 
				{
					jQuery.facebox.close();
					
					Processing.show('Channel Updated', {autohide: 3, type:'success'});
				},
				error: function(response, text_status, error)
				{
					WebSiteUI.SiteModalMessage(response.responseText, 'error');
				},
				complete: function(response, text_status)
				{
					Processing.hide();
				}
			});						
		}
	
		/////
	};

	
})(jQuery);
