// JavaScript Document

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,userportraitList,total_con);
}
function quote(val){
	document.getElementById('defind').value = val;
	document.getElementById('content').value = "[quote="+val+"]";
	document.getElementById('content').focus();
}