
	var replyData = new Array();
	var chargeData = new Array();

	var postHide  = '<span class="hiddenBox" onClick="var obj = this.parentNode.parentNode.parentNode;obj.innerHTML = parsePost(replyData[obj.id], 1)">为方便阅读，已隐藏重复显示的内容。　[点击展开]</span>';

	function getPostFloor(floor) {
		//return '<span class="citeRight">' + floor + '楼</span>';
		return '';
	}

	function parsePost(data, action) {
		if (typeof(data) == 'string') {
			return "<div style=\"width:90%; line-height: 20px;\">" + data + "</div>";
		}
		else {
			try {
				var postData = data;
				var counter = 0;
				for (i in postData) {
 					counter ++;
				}
				action = counter < 4 ? "1" : action;

				if (action == "1") {
					return changeClassToStyle(buildPost(postData, counter));
				}
				else {
					return destroyPost(postData, counter);
				}
			} catch (e) {
				return "<div style=\"width:90%; line-height: 20px;\">" + data + "</div>";
			}
		}
	}

	function buildPost(postData, counter) {
		for (var i = 0; i < counter; i ++) {
			var div = document.createElement("DIV");
			if (i < counter - 1) {
				div.className = 'commentBox';
			}
			if (i > 0) {
				div.appendChild(preDiv);
			}
			var span = document.createElement("SPAN");
			span.className = 'forCite';
			span.innerHTML = postData[i + 1].f + (i == 0 ? getPostFloor(i + 1) : '');
			div.appendChild(span);
			var p = document.createElement("P");
			p.innerHTML = postData[i + 1].b;
			div.appendChild(p);
			preDiv = div;
		}
		return preDiv.innerHTML;
	}

	function destroyPost(postData, counter) {
		var divFirst = document.createElement("DIV");
		divFirst.className = 'commentBox';
		var span = document.createElement("SPAN");
		span.className = 'forCite';
		span.innerHTML = postData[1].f + getPostFloor(1);
		divFirst.appendChild(span);
		var p = document.createElement("P");
		p.innerHTML = postData[1].b;
		divFirst.appendChild(p);

		var divMiddle = document.createElement("DIV");
		divMiddle.className = 'commentBox';
		divMiddle.appendChild(divFirst);
		var span = document.createElement("SPAN");
		span.className = 'forCite';
		span.innerHTML = postHide;
		divMiddle.appendChild(span);

		var divPost = document.createElement("DIV");
		divPost.appendChild(divMiddle);
		var p = document.createElement("P");
		p.innerHTML = postData[counter].b;
		divPost.appendChild(p);

		return divPost.innerHTML;
	}

	function changeClassToStyle(html) {
		html = html.replace(/class=titleTip/ig, 'style="clear:both;color: #666; padding:0 12px 0 16px; height:15px;"')
			.replace(/class=name/ig, 'style="float:left; color:#1f3a87;"')
			.replace(/class=title/ig, 'style="float:right;"')
			.replace(/class=commentBox/ig, 'style="padding:3px 3px; background:#FFFFEE; border:1px solid #999; overflow:hidden; margin-bottom:12px; text-align:left; line-height: 0;"')
			.replace(/class=forCite/ig, 'style="font-size:12px; padding:5px 3px; line-height:20px; color:#1F3A87; text-align:left;"')
			.replace(/<p>/ig, '<p style="margin:9px 3px; line-height:20px; text-align:left;color :#000;">');
		html = html.replace(/class=\"titleTip\"/ig, 'style="clear:both;color: #666; padding:0 12px 0 16px; height:15px;"')
			.replace(/class=\"name\"/ig, 'style="float:left; color:#1f3a87;"')
			.replace(/class=\"title\"/ig, 'style="float:right;"')
			.replace(/class=\"commentBox\"/ig, 'style="padding:3px 3px; background:#FFFFEE; border:1px solid #999; overflow:hidden; margin-bottom:12px; text-align:left; line-height: 0;"')
			.replace(/class=\"forCite\"/ig, 'style="font-size:12px; padding:5px 3px; line-height:20px; color:#1F3A87; text-align:left;"')
			.replace(/<p>/ig, '<p style="margin:9px 3px; line-height:20px; text-align:left;color :#000;">');
		return html;
	}

	function copyPost(postData) {
		var html = parsePost(postData, 1);
		setCopy(changeClassToStyle(html));
	}

	function setCopy(text) {
		try {
			if (window.clipboardData) {
				window.clipboardData.setData("Text", text);
			}
			else if (window.netscape) {
				netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
				var clip = Components.classes['@mozilla.org/widget/clipboard;1'].createInstance(Components.interfaces.nsIClipboard);
				if (!clip) return;
				var trans = Components.classes['@mozilla.org/widget/transferable;1'].createInstance(Components.interfaces.nsITransferable);
				if (!trans) return;
				trans.addDataFlavor('text/unicode');
				var str = new Object();
				var len = new Object();
				var str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);
				var copytext = text;
				str.data = copytext;
				trans.setTransferData("text/unicode", str, copytext.length*2);
				var clipid = Components.interfaces.nsIClipboard;
				if (!clip) return false;
				clip.setData(trans, null, clipid.kGlobalClipboard);
			}
		} catch (e) { alert('你的浏览器不支持哈') }
	}