function print_livekeyword(title, query, where){
	var default_action = "http://search.fr.aiononline.com/aion/index.jsp";
	var where = encodeURIComponent("aionweb^tsearch");
	var wrap_rank = document.getElementById("wrap_live");
	h2 = document.createElement("h2");
	h2.innerHTML = title;
	wrap_rank.appendChild(h2);
	ol = document.createElement("ol");
	ol.id = "liveTopList";
	wrap_rank.appendChild(ol);
	for(i = 0; i < live_keywords.count; i++) {
		name = live_keywords.item[i].name;
		url = default_action + "?where=" + where + "&query=" + encodeURIComponent(name)+ "&pos=livekwd&site=aion";
		rank = live_keywords.item[i].rank;
		if(live_keywords.item[i].updown == "new" || live_keywords.item[i].updown == "same")
			rank = "";
		rank_index = i + 1;
		li = document.createElement("li");
		li.className = "num num" + i;
		div2 = document.createElement("span");
		div2.className = "word";
		a = document.createElement("a");
		a.href = url;
		a.title = name;
		resize_name = name.cut(16);
		if(name == query) {
			strong  = document.createElement("strong");
			strong.appendChild(document.createTextNode(resize_name));
			a.appendChild(strong);
		}else { 
			a.appendChild(document.createTextNode(resize_name));
		}
		div2.appendChild(a);
		div3 = document.createElement("span");
		div3.className = "rank";
		div3.className = "rank " + live_keywords.item[i].updown;  
		div3.appendChild(document.createTextNode(rank))
		li.appendChild(div2);
		li.appendChild(div3);
		ol.appendChild(li);
	}
}

String.prototype.cut = function(len) {
	var str = this;
	var l = 0;
	for (var i=0; i<str.length; i++) {
			l += (str.charCodeAt(i) > 128) ? 2 : 1;
			if (l > len) return str.substring(0,i) + "...";
	}
	return str;
}
