﻿var gPageId;

function loadHSComments(commentId) {
	gPageId = commentId;
	if (hs[commentId])
		comCount = hs[commentId];
	else
		comCount = 0;
	if (hstb[commentId])
		tbCount = hs[commentId];
	else
		tbCount = 0;
	/* var hsFrame = document.createElement('iframe');
	hsFrame.src = "http://www.haloscan.com/comments/neonwang/" + commentId;
	// hsFrame.src = "index.html";
	hsFrame.scrolling = "no";
	hsFrame.name = "hsComment";
	hsFrame.width = "100%";
	hsFrame.frameBorder = 0;
	hsFrame.height = hs[commentId] * 70 + 400;
	hsFrame.id = "hsComment"; */
	var localDiv = document.getElementById('comments');
	// localDiv.appendChild(hsFrame);
	localDiv.innerHTML = '<a href="http://www.haloscan.com/comments/neonwang/' +
						 commentId +'" target="hsComment">留言回應（' +
						 comCount + '）</a> | <a href="http://' +
						 'www.haloscan.com/tb/neonwang/' + gPageId + '" ' +
						 'target="hsComment">引用（' + tbCount + '）</a>' +
						 '<iframe name="hsComment" id="hsComment" width="100%"' +
						 'class="hsFrame" src="http://www.haloscan.com/comments/' +
						 'neonwang/' + commentId + '" height="' +
						 (comCount * 70 + 400) + '"></iframe>';
	// alert(localDiv.innerHTML);
}
