var dsArticles=new Spry.Data.JSONDataSet("../JSON/rsComArticles.php?sort=date&dir=desc",{method:"POST",postData:"action=showArticles",subPaths:"results"});function updatePageArticle(page){var params=Spry.Utils.getURLParamsAsObject(dsArticles.getURL());var dirUrl=params.dir;var sortUrl=params.sort;var rechercheUrl=params.recherche;if(rechercheUrl!=undefined){dsArticles.setURL("../JSON/rsComArticles.php?sort="+sortUrl+"&dir="+dirUrl+"&recherche="+rechercheUrl,{method:"POST",postData:"action=showArticles&page="+page});}else{dsArticles.setURL("../JSON/rsComArticles.php?sort="+sortUrl+"&dir="+dirUrl,{method:"POST",postData:"action=showArticles&page="+page});}dsArticles.loadData();}function triColonne(sort,dir){var params=Spry.Utils.getURLParamsAsObject(dsArticles.getURL());var dirUrl=params.dir;var sortUrl= params.sort;var rechercheUrl=params.recherche;if(sortUrl!=sort){dir='desc';}else{if(dirUrl=='asc'){dir='desc';}else{dir='asc';}}if(rechercheUrl!=undefined){dsArticles.setURL("../JSON/rsComArticles.php?sort="+sort+"&dir="+dir+"&recherche="+rechercheUrl,{method:"POST", postData:"action=showArticles"});}else{dsArticles.setURL("../JSON/rsComArticles.php?sort="+sort+"&dir="+dir,{method:"POST",postData:"action=showArticles"});}dsArticles.loadData();}function FilterArticle(){var tf=document.getElementById("champRechercheArticle");var params=Spry.Utils.getURLParamsAsObject(dsArticles.getURL());var dirUrl=params.dir;var sortUrl=params.sort;if(!tf.value){dsArticles.setURL("../JSON/rsComArticles.php?sort="+sortUrl+"&dir="+dirUrl,{method:"POST",postData:"action=showArticles"});dsArticles.loadData();return;}var regExpStr=tf.value;var regExp=new RegExp(regExpStr,"i");dsArticles.setURL("../JSON/rsComArticles.php?sort="+sortUrl+"&dir="+dirUrl+"&recherche="+regExpStr,{method:"POST",postData:"action=showArticles"});dsArticles.loadData();}function StartFilterArticleTimer(){if(StartFilterArticleTimer.timerID)clearTimeout(StartFilterArticleTimer.timerID);StartFilterArticleTimer.timerID=setTimeout(function(){ StartFilterArticleTimer.timerID=null;FilterArticle();},100);}