var $jq = jQuery.noConflict();

jQuery(document).ready(
	function()
	{
		jQuery.getIdUser = function (callBack)
		{
			jQuery.post(
			    "inc/ajax.i.php", 
			    { 
			      page: 'user',
			      fonction : "getIdUser"
			    },
			   function(data)
			   {
			      callBack(data);
			   }
		   );
		}

		jQuery.getUserCustomField = function (name, callBack)
		{
			jQuery.post(
			    "inc/ajax.i.php", 
			    { page: 'user',
			      fonction : "getUserCustomField",
			      name:name 
			    },
			    function(data)
			    {
		    		callBack(data, name);
			    }
		   );
		}
		
		jQuery.getArticleAttribute = function (name, idArticle, callBack)
		{
			jQuery.post(
			    "inc/ajax.i.php", 
			    { page: 'spot',
			      fonction : "getArticleAttribute",
			      name:name,
			      idArticle: idArticle
			    },
			   function(data)
			   {
			      callBack(data, name, idArticle);
			   }
		   );
		}

		jQuery.updateArticleAttribute = function (name, idArticle, val, callBack)
		{
		  jQuery.post(
				'inc/ajax.i.php',
				{ 
					page: 'spot',
				      fonction : "updateArticleAttribute",
				      name:name, 
				      idArticle: idArticle,
				      value:val 
				},
				function (data) 
				{
					callBack(data, name, idArticle, val);
				}
			);
		}

		/*jQuery.idUserCallBack = function(val)
		{
			jQuery.idUser = val;
		}
		jQuery.getIdUser(jQuery.idUserCallBack);	*/
	}
);