/*********************************************
 *Description:CMSManagePortlet Client,send 
 *request to server,and receive the response
 *
 ********************************************/


/*
 *Description:Send Request To PortalServer,For
 *Getting The ArticleList From PortletService
 *Author:Majc
 */
function getArticleList(channelID){
    var xmlhttp = getXmlHttpRequest();
	xmlhttp.onreadystatechange = function(){
		getArticleListReturn(xmlhttp);
	}
	doURLProcess("PortletService","getCMSArticleList","channelID="+channelID,null,xmlhttp,true);
}

/*
 *Description:The ReturnCall Function Of getArticleList,For
 *Handling The Response
 *Author:Majc 
 */
function getArticleListReturn(xmlhttp){
  if(xmlhttp.readyState == 4){
		if(xmlhttp.status == 200){
		 var articleTable = xmlhttp.responseText;
		 var articleTableArea = document.getElementById("cmsArticlesTable");
		 if(articleTableArea != null){
		   articleTableArea.innerHTML = articleTable;
		 }
		}
    }
}
/*
 *Description:Send Request To PortalServer,For
 *Getting The ArticleContent From PortletService
 *Author:Majc
 */
function getArticleContent(articleID){
    var xmlhttp = getXmlHttpRequest();
	xmlhttp.onreadystatechange = function(){
		getArticleContentReturn(xmlhttp);
	}
	doURLProcess("PortletService","getCMSArticleContent","articleID=" + articleID,null,xmlhttp,true);

}

/*
 *Description:The ReturnCall Function Of getArticleContent,For
 *Handling The Response
 */
function getArticleContentReturn(xmlhttp){
  if(xmlhttp.readyState == 4){
		if(xmlhttp.status == 200){
		 var articleContent = xmlhttp.responseText;
		 var articleContentArea = document.getElementById("cmsArticleContent");
		 if(articleContentArea != null){
		   articleContentArea.innerHTML = articleContent;
		 }
		}
    }
}