<?php TPL::output('mobile/header.tpl.htm'); ?>

<script type="text/javascript">
	var TOPIC_ID = '<?php echo $this->topic_info['topic_id']; ?>';
	
	$(document).ready(function () {
		$('#contents_nav span').click(function () {
			$('#contents_nav span').removeClass('click');
			
			$('div.tpage').hide();
			$('div.tpage._contents' + $(this).attr('class')).show();
			
			if ($('div.tpage._contents' + $(this).attr('class')).find('ul').html() == '')
			{
				switch ($(this).attr('class'))
				{					
					case '_best':
						mobile_more_load(GET_BASE_URL + '/topic/ajax/question_list/type-best__template-mobile__topic_id-' + TOPIC_ID, $('#io_best_question_more'), $('#c_best_question_list'));
					break;
					
					case '_noanswer':
						mobile_more_load(GET_BASE_URL + '/question/ajax/discuss/template-mobile__answer_count-0__topic_id-' + TOPIC_ID, $('#noanswer-more'), $('#c_noanswer_list'), 1);
					break;
				}
			}
			
			$(this).addClass('click');
		});
		
		mobile_more_load(GET_BASE_URL + '/topic/ajax/question_list/template-mobile__topic_id-' + TOPIC_ID, $('#all-more'), $('#c_all_list'));
	});
</script>

<div class="subject">
	<div style=" text-align:center;">
		<img class="hp" src="<?php echo get_topic_pic_url('max', $this->topic_info['topic_pic']); ?>" />
		<div class="name"><?php echo $this->topic_info['topic_title']; ?><div class="lock"></div></div>
        <?php if ($this->user_id) { ?><span class="sub<?php if ($this->topic_info['has_focus']) { ?> cur <?php } ?>" onclick="focus_topic($(this), $(this), <?php echo $this->topic_info['topic_id']; ?>); return false;"><?php if ($this->topic_info['has_focus']) { ?>Un<?php } ?>follow</span><?php } ?>
        <div class="sign"></div>
    </div>
        
    <div class="nav" id="contents_nav">
    	<span class="click _all">All questions</span>
    	<span class="_best">Best Answer</span>
    	<span class="_noanswer">Unanswered</span>
    </div>
        
    <div class="con">
    	<div class="tpage _contents_all">
        	<ul id="c_all_list"></ul>
        	
            <div class="more" id="all-more">More</div>
        </div>
        
        <div class="tpage _contents_best" style="display:none">
        	<ul id="c_best_question_list"></ul>
        	
            <div class="more" id="io_best_question_more">More</div>
        </div>
        
        <div class="tpage _contents_noanswer" style="display:none"s>
        	<ul id="c_noanswer_list"></ul>
        	
            <div class="more" id="noanswer-more">More</div>
        </div>
    </div>
</div>

<?php TPL::output('mobile/footer.tpl.htm'); ?>