<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가 
?>
<style type="text/css">
.bold	{ font-weight:bold; }
.normal	{ font-weight:normal; }
.small	{ font-size:11px; color:#A2A2A2;  }

#zmb_popular_s_body { position:absolute; overflow:hidden; height:22px; width:200px; font-family:굴림; font-size:12px; z-index:99; }
#zmb_popular_s_list	{ position:absolute; }
#zmb_popular_s_list .list_none		{ list-style:none; text-align:left; margin:0px; padding:0px; }
#zmb_popular_s_list .popular_word	{ width:140px; display:inline-block; }
#zmb_popular_s_list li { height:22px; line-height:140%; padding:0px; }
#zmb_popular_s_list li span a { text-decoration:none; }
</style>

<div id="zmb_popular_s_body">
<div id="zmb_popular_s_list">
<ul class="list_none">
<? for ($i=0; $i<count($list); $i++) : ?>
	<li>
		<span><img src="<?=$popular_skin_path?>/img/icon_num_<?=$i+1?>.gif"></span>
		<span class="popular_word <?=($i==0)?'bold':'normal'?>"><a href='<?=$g4[bbs_path]?>/search.php?sfl=wr_subject&sop=and&stx=<?=urlencode($list[$i][word])?>' title="<?=$list[$i][word]?>"><?=cut_str($list[$i][word], 20, "")?></a></span>
		<span class="small"><?=$list[$i][icon]?> <?=$list[$i][changerank]?></span>
	</li>
<? endfor; ?>
</ul>
</div>
</div>

<script language="javascript">
var scroll_div_height = $("#zmb_popular_s_list").height();
var scroll_count	= 0;
var scroll_height	= 22;		/*한 번에 스크롤 할 높이*/

scroll_div_pos = $("#zmb_popular_s_list").position();
$("#zmb_popular_s_list").css("top", scroll_div_pos.top+"px");
function zm_popular_scroll(){
	if(scroll_div_height < scroll_count) {
		$("#zmb_popular_s_list").css("top", scroll_height+"px");
		scroll_count = 0;
	}

	scroll_div_pos = $("#zmb_popular_s_list").position();
	var new_stop	= scroll_div_pos.top - 1;

	$("#zmb_popular_s_list").css("top", new_stop+"px");
	scroll_count++;

	if(scroll_count % scroll_height) {
		scrollTimmer = setTimeout("zm_popular_scroll()", 10);
	}else{
		scrollTimmer = setTimeout("zm_popular_scroll()", 1000);
	}
}

function zm_popular_scroll_stop() {
    clearTimeout(scrollTimmer);

	scroll_div.style.top	= 0;
	$("#zmb_popular_s_body").css("height", "230px");
	$("#zmb_popular_s_body").css("background-color", "#FFFFFF");
	$("#zmb_popular_s_body").css("border", "2px solid #769FFE");
	$("#zmb_popular_s_body .list_none").css("margin", "3px");
}

function zm_popular_scroll_again() {
	$("#zmb_popular_s_body").css("height", scroll_height+"px");
	$("#zmb_popular_s_body").css("background-color", "");
	$("#zmb_popular_s_body").css("border", "0");
	$("#zmb_popular_s_body .list_none").css("margin", "0");

	scroll_div.style.top = scroll_height;
	scrollTimmer = setTimeout("zm_popular_scroll()", 10);
}

setTimeout("zm_popular_scroll()", 1)
scroll_div.onmouseover = function() { zm_popular_scroll_stop(); }
scroll_div.onmouseout = function() { zm_popular_scroll_again(); } 
</script>