/**
 * Ajax 使用JavaScript
 */
function getCommentHtmlList(sid)
{
	var strText;
	var fError = false;
	if (xmlhttp.readyState == 4)
	{
		if (xmlhttp.status == 200)
		{
			
			strText = fetchXmlValue(xmlhttp.responseXML, 'body');
			//alert("回来了     " + strText);
			if (null == strText) 
			{
				fError = true;
			}
			else 
			{
				fetchObject("commentsec" + sid ).innerHTML = strText;
			}
		}
		
		else
		{
			fError = true;
		}
	}
	
	if (fError) 
	{
		fetchObject("commentsec" + sid ).innerHTML = "";			
		fetchObject("comment" + sid ).style.display = "none";
	} 
	else 
	{
	//	fetchObject("comment" + sid).scrollIntoView(true);
	}
}


function OpenSection(sid, pages)
{
	var sectionTitleObj = fetchObject("comment" + sid);
	
	if (pages >= 0)
	{
	}
	else
	{
		if (sectionTitleObj.style.display == "block")
		{
			Close(sid, pages);
			return ;
		}
	}
	
	if (sectionTitleObj.style.display == 'none' || sectionTitleObj.style.display == '') 
	{
		sectionTitleObj.style.display = "block";
	}
	if (pages >= 0) 
	{
		var strA = "soft_id="+ sid;
	  strA += "&pages=" +pages;

	  StartGETRequest('/servlet/cn.com.softhouse.software.controller.RequestSoftwareComment?'+strA, function() {getCommentHtmlList(sid)});
	} 
	else 
	{
		if(fetchObject("commentsec" + sid ).innerHTML == "") 
		{
			var strA = "soft_id="+ sid;

//	    alert("HHHHHHHH"+strA);
	    StartGETRequest('/servlet/cn.com.softhouse.software.controller.RequestSoftwareComment?'+strA, function() {getCommentHtmlList(sid)});
		} 
	}
}

function Close(sid,  pages)
{
	
	fetchObject("comment" + sid ).style.display = "none";
	
	if (pages > 0) 
	{
	  fetchObject("commentsec" + sid).innerHTML = "";
	}
}

function CloseComment(sid)
{
	//alert("点到取消评论");
	if (fetchObject("Err"+ sid) != null) {
		fetchObject("Err"+sid).innerHTML = "";
		fetchObject("txtComment"+sid).value = "";
	}
	Close(sid);
}





