/*************************************************************
 *Filename:      ue.pri.download.hottags.js
 *Version:       1.0.0(9.29.2009)
 *Website:       http://download.mmosite.com/down_search.php
 *Author:        S.S.L
**************************************************************/

function UE_HotTags( pArr ){
	var _size = [ "9px","10px","11px","12px","13px","14px" ,"15px"];
	var _color = [ "#d4ae17","#ff8a00","#986063","#553310","#876a6c","#4d3c42","#333","#9b9c2f"];
	var _weight = [ "normal","blod" ];
	var _cache;
	
	function radomNum( pDown,pUp ){
		return parseInt(Math.random()*(pUp-pDown+1)+pDown);
	}
	
	function doCss(){
		var str = '';
		
		str += '<style type="text/css">';
		str += '.ue_hottags{ width:97%; margin-left:10px}';
		str += '	h3.ue_hottags_title{ color:#986063; height:35px; line-height:30px; font-size:16px;}';
		str += '	.ue_hottags_cnt{ padding-left:20px;line-height:2;}';
		str += '		.ue_hottags_cnt a{ margin:0 2px;}';
		str += '		.ue_hottags_cnt a:hover{ text-decoration:underline;}';
		str += '</style>';
		
		document.write( str );
	}
	
	function doDiv(){
		try{
			var str = '';
		
			str += '<div class="ue_hottags">';
			str += '	<h3 class="ue_hottags_title">Hot Key Words:</h3>';
			str += '	<div class="ue_hottags_cnt">';
			
			for( var i = 0; i < pArr.length; i++ ){
				var sizeitem = radomNum( 0,(_size.length-1) );
				var colitem = radomNum( 0,(_color.length-1) );
				var weightitem = radomNum( 0,(_weight.length-1) );
				
				while( _cache != null && _cache == colitem ){
					colitem = radomNum( 0,(_color.length-1) );
				}				
				_cache = colitem;
				
				var sty = 'font:' + _weight[weightitem] + ' ' + _size[sizeitem] + ' Arial; color:' + _color[colitem];
				str += '	<a href="' + sword_cloud[i]['url'] + '" title="' + sword_cloud[i]['word'] + '" style="' + sty + '">'  + sword_cloud[i]['word'] + '</a>';
			}
			
			str += '	</div>';
			str += '</div>';

			document.write( str );
			
		}catch( e ){
			alert( "There was an error on this page.\nFrom:ue.pri.download.hottags.js.\nError:" + e.description );
		}
		
	}
	
	function init(){
		if( pArr == null ) return;
		doCss();
		doDiv();
	}
	
	init();
	
}