// JavaScript Document
function getcommentinfo(userList,conList,timeList,infoidList,diggList,buryList,fl)
{
if (userList.length<=0 || conList.length<=0)
return ;
var str="";
var imgurl = "http://images.mmosite.com/www/images/newpop/";
for (i=0;i<userList.length;i++)
{
str += "<table width=\"98%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td width=\"13\" height=\"15\"><img src=\""+ imgurl +"pop_01.gif\" width=\"13\" height=\"15\"><\/td><td background=\""+ imgurl +"pop_02.gif\"><\/td><td width=\"15\"><img src=\""+ imgurl +"pop_04.gif\" width=\"15\" height=\"15\"><\/td><\/tr><tr><td valign=\"top\" background=\""+ imgurl +"pop_09.jpg\"><img src=\""+ imgurl +"pop_05.gif\" width=\"13\" height=\"69\"><\/td><td height=\"50\" background=\""+ imgurl +"pop_06.gif\" valign=\"top\" class=\"comm_js_bg\"><div class=\"comm_js_conten\"><p class=\"floor\">#"+fl[i]+"</p><a href=\"javascript:quote("+infoidList[i]+")\" class=\"quote\">Quote</a><div class=\"comm_dig\"><a title=\"Digg\" href=\"#notop\" onClick=\"DoDigg('"+infoidList[i]+"');\"><img alt=\"digg\" title=\"digg\" src=\"http://images.mmosite.com/comment/digg.gif\" align=\"absmiddle\" border=\"0\"></a><span id=\"diggnum_"+infoidList[i]+"\">"+diggList[i]+"</span><a title=\"Bury\" href=\"#notop\" onClick=\"DoBury('"+infoidList[i]+"');\"><img alt=\"bury\" title=\"bury\" src=\"http://images.mmosite.com/comment/bury.gif\" align=\"absmiddle\" border=\"0\"></a><span id=\"burynum_"+infoidList[i]+"\">"+buryList[i]+"</span>   <\/div>"+conList[i]+"<\/div><\/td><td valign=\"top\" background=\""+ imgurl +"pop_10.jpg\"><img src=\""+ imgurl +"pop_08.gif\" width=\"15\" height=\"69\"><\/td><\/tr><tr><td valign=\"top\"><img src=\""+ imgurl +"pop_11.gif\" width=\"13\" height=\"26\"><\/td><td background=\""+ imgurl +"pop_14.gif\"><img src=\""+ imgurl +"pop_12.gif\" width=\"54\" height=\"26\"><\/td><td><img src=\""+ imgurl +"pop_16.gif\" width=\"15\" height=\"26\"><\/td><\/tr><\/table><div class=\"comm_js_title\"><em><span>"+userList[i]+" <\/span><\/em><p>  "+timeList[i]+"<\/p><div style=\"clear:both\"><\/div><\/div>";
}
document.getElementById('commentinfoDiv').innerHTML = str;
}
document.getElementById('url').value = location.href;
function orderBy(val){
	var order = val;
	var commentsubs=document.getElementById("topcomment").getElementsByTagName("a");
    for(var i=0;i<commentsubs.length;i++){
		 commentsubs[i].className = ""
     }
	commentsubs[val].className = "on"
  
	if(order == 1){
		commentUrl = "http://comment.mmosite.com/port/getcomment_info_order.php?comment=" + document.getElementById('commentparam').value + "&num=5&orderBy=hottest";
	}else if(order == 2){
		commentUrl = "http://comment.mmosite.com/port/getcomment_info_order.php?comment=" + document.getElementById('commentparam').value + "&num=5&orderBy=buried";
	}else{	
		commentUrl = "http://comment.mmosite.com/port/getcomment_info_order.php?comment=" + document.getElementById('commentparam').value + "&num=5";
	}
	
	var userAgent = navigator.userAgent.toLowerCase();
	var srcObj = document.createElement('script');
	
	var _fnCallback = callback;
	var _oTarget = '';
	if(/msie/.test( userAgent ) && !/opera/.test(userAgent)) {
		try {
			srcObj.setAttribute("src", commentUrl);
			srcObj.onreadystatechange = function() {
				if(/complete|loaded/i.test(this.readyState)) {
					_fnCallback(_oTarget);
				}
			};
			document.body.appendChild(srcObj);
		} catch(e) {
			alert(e.description);
			// do nothing
		}
	} else {						// FF, Opera
		try {
			srcObj.id = "testscript";
			srcObj.src = commentUrl;
			srcObj.onload = function() {
				_fnCallback(_oTarget);
			};
			document.body.appendChild(srcObj);
		} catch(e) {
			// do nothing
		}
	}
}

function callback() {
	getcommentinfo(userList,conList,timeList,infoidList,diggList,buryList,fl);
}
function quote(val){
	document.getElementById('defind').value = val;
	document.getElementById('content').value = "[quote="+val+"]";
	document.getElementById('content').focus();
}