var dlSch = document.location.search
var rCommHeadStr1 = '<table style="width:99%;padding-bottom:8px;"><tr valign="top"><td id="rCommentsHead">READER COMMENTS (<span id="cmHeaderCount"></span>)</td><td align="right" id="rCommentsSort">';
var rCommHeadStr2 = '</td></tr></table>';
if(dlSch.indexOf("comments=all")!=-1){
	if(dlSch.indexOf("csort=desc")!=-1){
		document.write(rCommHeadStr1 + 'Sort: <a href="http://' + document.location.host + document.location.pathname + '?comments=all">Chrono Order</a> | Latest First | <a href="http://' + document.location.host + document.location.pathname + '?comments=all&csort=rec">Most Recommended</a>' + rCommHeadStr2);
	}else{
  		if(dlSch.indexOf("csort=rec")!=-1){
  			document.write(rCommHeadStr1 + 'Sort: <a href="http://' + document.location.host + document.location.pathname + '?comments=all">Chrono Order</a> | <a href="http://' + document.location.host + document.location.pathname + '?comments=all&csort=desc">Latest First</a> | Most Recommended' + rCommHeadStr2);
  		}else{
  			document.write(rCommHeadStr1 + 'Sort: Chrono Order | <a href="http://' + document.location.host + document.location.pathname + '?comments=all&csort=desc">Latest First</a> | <a href="http://' + document.location.host + document.location.pathname + '?comments=all&csort=rec">Most Recommended</a>' + rCommHeadStr2);
  		}
	}
}else{document.write(rCommHeadStr1 + '&nbsp;' + rCommHeadStr2)}
if(dlSch.indexOf("csort=desc")!=-1){
	gSiteLife.CommentsOutput("ExternalResource", pluckID, true, commDisplayCount, "TimestampDescending");
}else{
	if(dlSch.indexOf("csort=rec")!=-1){
		gSiteLife.CommentsOutput("ExternalResource", pluckID, true, commDisplayCount, "RecommendationsDescending");
	}else{
		gSiteLife.CommentsOutput("ExternalResource", pluckID, true, commDisplayCount, "TimestampAscending");
	}
}
document.write('<div id="seeAllComm"><a href="http://' + document.location.host + document.location.pathname + '?comments=all">View all <span id="cCount2"></span>&nbsp;comments ></a></div>');