 
<?php
function getbbname() {
    global $_G;
    if($_G['mocuz_config']['app_name']) {
        $sitename = $_G['mocuz_config']['app_name'];
    }else{
        $sitename = $_G['setting']['bbname'];
    }
    return $sitename;
}
require_once 'includes/Mcrypt3Des.php';
$postarr = array();
foreach($postlist as $key => $post) {
    if($post['first']) {
        $post['message'] = odz_format_message($post['message']);
        $message = str_replace('size=', '', $post['message']);
        // $post['message'] =preg_replace("/<(\/?br.*?)>/si","",$message); //过滤br标签
        /*$post['message'] =preg_replace('/(<\/?br.*?>\s\D)+/i', '<br>', $message);*/ //过滤br标签
        $postarr = $post;
        unset($postlist[$key]);
        break;
    }
}

?>
<!DOCTYPE html>
<html class="h5-support">
<head lang="zh-cn">
    <meta charset="<?php echo CHARSET ?>">
    <title><?php echo $postarr['subject'];?></title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="format-detection" content="telephone=no">
    <script type="text/javascript" src="assets/js/jquery-1.8.3.min.js"></script>
    <script type="text/javascript" src="assets/js/commondz.js"></script>
    <link rel="stylesheet" type="text/css" href="assets/css/activity.css?hash=<?php echo date('YmdHi',time());?>">
    <link type="text/css" rel="Stylesheet" href="assets/css/share_pages.css?hash=<?php echo date('YmdHi',time());?>"/>
    <script type="text/javascript" src="assets/js/jquery.lazyload.min.js?hash=<?php echo date('YmdHi',time());?>"></script>
    <style type="text/css">
        /*视频播放器*/
        .videowrap { margin: 10px 0; }
        .videocontainer { border:1px solid #eaeaea; background-color:#f7f7f7; font-size: 12px; color:#666666; margin: 0 auto; height:203; width:300px; }
        .video_menu { height:24px; line-height:24px; padding-left: 5px; }
        .video_menu a { color: #666666; text-decoration:none; }
        .video_text { padding-top: 90px; text-align: center; }
        .video_error { color: #ff0000; }
        /*表格信息*/
	.photo_size{width:300px;}
        .html-data table{width: 100%;font-size: 14px;}
        .html-data table tr td{padding: 6px 5px 6px 5px !important;}
        .html-data table caption{background: #FAFAFA;padding: 6px 5px 6px 5px !important;font-weight: bold;text-align: left;border:1px solid #EEEEEE;}
        .html-data table tr td{border-bottom:1px solid #C2D5E3;padding: 6px 5px 6px 5px !important;}
        .html-data table tr td.textname{border-bottom:1px solid #EEEEEE;border-left:1px solid #EEEEEE;border-right:1px solid #EEEEEE;color:#B0B0B0;width: 26%}
        .html-data table tr td.textvalue{border-bottom:1px solid #EEEEEE;border-right:1px solid #EEEEEE;color:#6F6F6F;}
        .join_show{width: 90%;margin: 0px auto;position: absolute;background-color: #fff;border-radius: 5px;z-index: 2000;left: 0px;top: 0px;display: none;}
        .join_show h4{padding: 8px 0px 8px 15px;}
        .join_pop{ border-top: solid 1px #E4E4E4;}
        .join_pop .ipt{background-color: #fff; margin-bottom: 15px;}
        .join_pop .ipt > div{margin-left: 10px; border-bottom: solid 1px #EEEEEE;padding: 15px 0px 15px 5px;}
        .join_pop .ipt p{margin-left: 10px; border-bottom: solid 1px #EEEEEE;padding: 15px 0px 15px 5px;}
        .join_pop .ipt .sn{color: #959595; width: 63px;display: block;float: left;}
        /*输入框*/
        .join_pop .ipt input{ margin-left: 10px;font-size: 14px; width:60%;border:1px solid #979797;}
        /*提交*/
        .join_pop  .sub{width: 30%;border-radius: 5px;background-color: #42A8EC; color: #fff;font-size: 20px;text-align: center;padding: 10px 0px 10px 0px;display: block;-webkit-appearance: none; float: left;}
        .jremarks{border: 1px solid #979797;}
        .jabolish{background-color: #42A8EC;color: #fff;font-size: 15px;text-align: center;padding: 5px 17px 5px 17px;border-radius: 5px;display: block;float: left;margin-right: 15px;}
        .jit{margin-left: 10px;}
        .join_b{overflow: hidden;float: right;margin-bottom: 15px;}
        .disabled{background: #B9B4B4;border-color:#908E8E;color: #7E7E7E}
        .quote{background-color: #F8F8F8;padding: 6px;font-size: 14px;color: #7D7D7d;border-radius: 4px;margin-right: 11px;margin-bottom: 12px;}
        .quote a{color: #7D7D7D!important;}


        /*活动贴样式下沉修订*/
        .change_active_content{
            width:auto !important;
            border-left: 1px solid #D5D5D5;
            border-bottom: 0px !important;
            padding-left: 10px;
        }
    </style>
    <script type="text/javascript">
        $(function() {
            $(".img_detail").lazyload();
        });
    </script>
</head>
<body>

    <div class="share_box">
	<div class="content head_content">
        <div class="head_box">
                <p class="head_title"><?php echo $postarr['subject'];?></p>
                <span class="head_font"><?php echo $postarr['dateline'];?></span>
                <span class="head_font"><?php echo $postarr['author'];?></span>
                <span class="head_type head_font"><?php echo getbbname();?></span>
        </div>
        <?php if ($threadsort && $threadsortshow && $threadsortshow['optionlist'] && $threadsortshow['optionlist'] != 'expire') {?>
            <div class="html-data " style="margin-bottom: 14px;">
                <table cellspacing="0">
                    <caption><?php echo  $_G['forum']['threadsorts']['types'][$_G['forum_thread']['sortid']]?></caption>
                    <tbody>
                        <?php foreach($threadsortshow['optionlist'] as $option) { ?>    
                            <?php if ($option['type'] != 'info') { ?>
                                <tr>
                                    <td class="textname"><?php echo $option['title'];?></td>
                                    <td class="textvalue">
                                        <?php if(preg_match('/^http:\/\/.*?[\.jpg|\.png|\.jpeg|\.gif]$/i',$option['value'])):?>
                                                <?php echo "<img class='photo_size' src=".$option['value'].">";?>
                                        <?php else:?>
                                                <?php echo $option['value'] !== '' ? $option['value'].' '.$option['unit'] : '-'; ?>
                                        <?php endif;?>
                                    </td>
                                </tr>
                            <?php } ?>
                        <?php } ?>
                    </tbody>
                </table>
            </div>
        <?php } ?>
        <div class="head_box">
            <?php echo $postarr['message'];?>
        </div>

    <div class="html-data hd-s ">
    <!-- 活动 START -->
    <?php if($_G['forum_thread']['special'] == 4) { ?>
        <?php if($activity['thumb']) {?>
        <div><img src="<?php echo $_G['baseurl'].$activity['thumb'];?>"></div>
        <?php } ?>
        <div class="regmain">
            <ul class="activity-list">
                <li>
                    <span class="ac-adress"><?php echo lang('forum/template', 'activity_space'); ?></span>
                    <span class="content change_active_content"><?php echo $activity['place']; ?></span>
                </li>
                <li>
                    <span class="ac-adress"><?php echo lang('forum/template', 'activity_starttime'); ?></span>
                    <span class="content change_active_content">
                        <?php if($activity['starttimeto']) {
                            echo odz_lang('activity_start_between', array('starttimefrom'=>$activity['starttimefrom'], 'starttimeto'=>$activity['starttimeto']));
                        } else {
                            echo $activity[starttimefrom];
                        } ?>
                    </span>
                </li>
                <li>
                    <span class="ac-adress"><?php echo lang('forum/template', 'activity_type'); ?> </span>
                    <span class="content change_active_content"><?php echo $activity['class']; ?></span>
                </li>
                <?php  if(!$_G['forum_thread']['is_archived']) {?>
                <li>
                    <span class="ac-adress"><?php echo lang('forum/template', 'activity_already'); ?></span>
                    <span class="content change_active_content"><?php echo $allapplynum.lang('forum/template', 'activity_member_unit');?></span>
                </li>
                <?php } ?>
                <li>
                    <span class="ac-adress"><?php echo lang('forum/template', 'gender');?></span>
                    <span class="content change_active_content">
                        <?php if($activity['gender'] == 1) {
                            echo lang('forum/template', 'male');
                        } elseif ($activity['gender'] == 2) {
                            echo lang('forum/template', 'female');
                        } else{
                            echo lang('forum/template', 'unlimited');
                        }?>
                    </span>
                </li>
                <?php if($activity['cost']) { ?>
                    <li>
                        <span class="ac-adress"><?php echo lang('forum/template', 'activity_payment'); ?></span>
                        <span class="content change_active_content"><?php echo $activity[cost].lang('forum/template', 'payment_unit');?></span>
                    </li>
                <?php } ?>
                <?php if($activity['number']) { ?>
                    <li>
                        <span class="ac-adress"><?php echo lang('forum/template', 'activity_about_member'); ?></span>
                        <span class="content change_active_content"><?php echo $aboutmembers.lang('forum/template', 'activity_member_unit');?></span>
                    </li>
                <?php } ?>
                <?php if($activity['expiration']) { ?>
                    <li>
                        <span class="ac-adress"><?php echo lang('forum/template', 'post_closing'); ?></span>
                        <span class="content change_active_content"><?php echo $activity[expiration];?></span>
                    </li>
                <?php } ?>
            </ul>
            <?php if($_G['uid'] && !$activityclose && (!$applied || $isverified == 2)) {?>
                <a href="javascript:void(0);" class="sign-up baoming">我要报名</a>
            <?php } elseif($_G['uid'] && !$activityclose && $applied) {?>
                <a href="javascript:void(0);" class="sign-up baoming">取消报名</a>
            <?php } ?>
        </div>
    <?php } ?>
    <!-- 活动 END -->
    <!-- 投票 START -->
    <?php if ($_G['forum_thread']['special'] == 1) { ?>
        <p class="take-number">
            <?php
                if($multiple) {
                    echo lang('forum/template', 'poll_multiple').lang('forum/template', 'thread_poll');
                    if($maxchoices) {
                        echo "（ ".odz_lang('poll_more_than', array('maxchoices'=>$maxchoices))."）";
                    }
                } else {
                    echo lang('forum/template', 'poll_single').lang('forum/template', 'thread_poll');
                }
                if($visiblepoll && $_G['group']['allowvote']) {
                    echo ' , '.lang('forum/template', 'poll_after_result');
                }
                echo ' , '.odz_lang('poll_voterscount', array('voterscount'=>'<span class="allVote">'.$voterscount.'</span>'));
                if(!$visiblepoll && ($overt || $_G['adminid'] == 1 || $thread['authorid'] == $_G['uid']) && $post['invisible'] == 0) {
                    echo '<a href="javascript:viod(0)" id="showpoll">'.lang('forum/template', 'poll_view_voters').'</a>';
                }
            ?>
        </p>
        <?php if($_G['forum_thread']['remaintime']) { ?>
            <p>
                <?php
                    echo lang('forum/template', 'poll_count_down');
                    if($_G['forum_thread']['remaintime'][0]) {
                        echo $_G['forum_thread']['remaintime'][0].lang('forum/template', 'days');
                    }
                    if($_G['forum_thread']['remaintime'][1]) {
                        echo $_G['forum_thread']['remaintime'][1].lang('forum/template', 'poll_hour');
                    }
                    echo $_G['forum_thread']['remaintime'][2].lang('forum/template', 'poll_minute');
                ?>
            </p>
        <?php } elseif ($expiration && $expirations < TIMESTAMP) { ?>
            <p><?php echo lang('forum/template', 'poll_end'); ?></p>
        <?php }?>
        <?php if($isimagepoll) { //图片投票?>
        <div class="regmain">
            <ul class="poll-list">
                <?php foreach ($polloptions as $key => $row) { ?>
                    <li>
                        <img src="<?php
                        $parse = parse_url($row['imginfo']['big']);
                        echo empty($parse['scheme'])? $_G['baseurl'].$row['imginfo']['big']:$row['imginfo']['big']?>" alt="" class="textimg">
                        <span class="poll-bot">
                          <span class="progress">
                              <span class="v-sp1"><?php echo $row['votes']; ?></span>
                              <span class="v-sp2">(<?php echo $row[
                              'percent']; ?>%)</span>
                              <div class="bc" style="width:<?php echo $row['width']; ?>"></div>
                          </span>
                        </span>
                        <p data="<?php echo $row['polloptionid']; ?>">
                            <?php if($_G['group']['allowvote']) { ?>
                                <?php if($maxchoices) {?>
                                    <input type="checkbox" value="<?php echo $row['polloptionid'];?>" class="vote-check" >
                                <?php } else {?>
                                    <a href="javascript:void(0);" class="v-hide"><img src="<?php echo $_G['siteurl'] ?>assets/images/noselect.png" alt=""></a>
                                <?php } ?>
                            <?php } ?>
                            <?php echo $row['polloption']; ?>
                        </p>
                    </li>
                <?php } ?>
            </ul>
            <?php if($_G['group']['allowvote'] && !$_G['forum_thread']['is_archived']) { ?>
                <a href="javascript:void(0);" class="sign-up v-hide signimg">投票</a>
            <?php } ?>
        </div>
        <?php } else { // 文字投票?>
        <div class="vPage">
            <ul class="v-list">
                <?php foreach ($polloptions as $key => $row) { ?>
                    <li>
                        <?php if($_G['group']['allowvote']) { ?>
                            <?php if(!$maxchoices) { ?>
                                <a href="javascript:void(0)" class="them toupiao v-hide" data="<?php echo $row['polloptionid']; ?>"><img src="<?php echo $_G['siteurl'] ?>assets/images/noselect.png" alt="" ></a>
                            <?php } else { ?>
                                <input type="checkbox" value="<?php echo $row['polloptionid']; ?>" class="vote-check vote-margin" >
                            <?php } ?>
                        <?php } ?>
                        <div class="v-list-left">
                            <span class="v-list-left-title"><?php echo $row['polloption'] ?></span>
                            <div class="bc" style="width:<?php echo $row['width']; ?>"></div>
                            <div class="v-sp">
                            <span class="poll"><?php echo $row['votes']; ?></span>
                            (<?php echo $row['percent']; ?>%)
                            </div>
                        </div>
                    </li>
                <?php } ?>
            </ul>
            <?php if($_G['group']['allowvote'] && !$_G['forum_thread']['is_archived']) { ?>
                <a href="javascript:void(0)" class="sign-up v-hide signtext" >投票</a>
            <?php } ?>
        </div>
        <?php } ?>
        <?php
         if($_G['group']['allowvote'] && !$_G['forum_thread']['is_archived']) { ?>
            <?php if($overt) { echo lang('forum/template', 'poll_msg_overt');}?>
        <?php } elseif(!$allwvoteusergroup) {
            echo lang('forum/template', 'poll_msg_allwvoteusergroup');
        } elseif(!$allowvotepolled) {
            echo lang('forum/template', 'poll_msg_allowvotepolled');
        } elseif(!$allowvotethread) {
            echo lang('forum/template', 'poll_msg_allowvotethread');
        }
        ?>
    <?php } ?>
    <!-- 投票 END -->
    <?php if($postarr['attachment']>0){  ?>
        <?php foreach($postarr['annexlist']['thumb'] as $val){  ?>
            <img src="<?php echo $val?>" alt="">
        <?php }?>
    <?php }?>
    <?php if($postarr['annexlist']['sound']){ ?>
        <audio src="<?php echo  $postarr['annexlist']['sound'];?>" preload="auto" />
    <?php }?>
    </div>

    <!-- 新增  分享、喜欢、点赞数-->
    <div class="content_zan">
        <p>登录<?php echo $_G['mocuz_config']['app_name']."客户端";?>，分享美好心情</p>
        <a href="<?php echo $_G['baseurl'].'mocuzapp.php'; ?>" class="content_zan_like">我喜欢</a>
        <?php if($postarr['praisenum']):?>
            <p><span class="content_zan_num"><?php echo $postarr['praisenum'];?></span> 人点赞</p>
        <?php else:?>
            <p><span class="content_zan_num"></span> 等你来点赞</p>
        <?php endif;?>

    </div>

    <!-- 新增阅读浏览评论 -->
    <div class="look_time">
        <ul>
            <li class="read_alltext"><a href="<?php echo $_G['baseurl']; ?>mocuzapp.php?tid=<?php echo $_G['tid'];?>&is_share=1&type=bbs">阅读全文</a></li>
            <li>阅读 <?php echo $_G['forum_thread']['views']; ?></li>
            <li>评论 <?php echo $_G['forum_thread']['replies']; ?></li>
        </ul>
    </div>

    <!-- 原来 浏览回复数 -->
    <!-- <div class="note_read">
            <span>来自<span><?php echo $_G['forum']['name']?></span></span>
            <span class="read_left"><?php echo odz_lang('share_tips_4');?></span>
            <span><?php echo $_G['forum_thread']['views']; ?></span>
            <span class="read_left"><?php echo odz_lang('share_tips_5');?></span>
            <span><?php echo $_G['forum_thread']['replies']; ?></span>
    </div> -->

  </div>

  <!-- 新增广告位 -->
<script type="text/javascript" src="http://common.api.mocuz.com/android/1.0/getAdvert?cid=<?php echo ODZ_CHANNELID;?>&pid=22&type=share"></script>
    <div class="note_selective">
        <!-- <div class="selective_title">
                <span><?php echo odz_lang('share_tips_7');?></span>
        </div> -->
         <div>
                <div class="discuss_type_fgline"></div>
                    <p class="discuss_type">精选留言</p>
               </div>
                <a href="<?php echo $_G['baseurl']; ?>mocuzapp.php">
                    <div class="write_comment">
                        <span>写留言</span>
                        <img src="assets/images/writeComment.png" alt="">
                    </div>
                </a>


       <div class="selective_list">
            <ul class="discuss_ul selective_ul">
                <?php foreach($postlist as $post):?>
                <?php
                    // 匿名发帖用户使用默认头像
                    if(empty($post['authorid']) || $post['anonymous'] == 1) {
                        $post['avatar'] = "<img class='discuss_portrait' src=".$_G['baseurl']."uc_server/images/noavatar_small.gif>";
                        $post['author'] = odz_lang('anonymous');
                    }
                    $post['message'] = str_replace('!post_quote!:', '<font color="#999999">'.odz_lang('post_quote')."：</font>", $post['message']);
                ?>
                <div class="discuss_box selective_ul_div">
                    <li class="item-view" pid="">
                        <div class="discuss_box selective_ul_div ">

                            <div class="discuss_user">
                                 <?php echo $post['avatar'];?>
                                <span class="user_name"><?php echo $post['author']; ?></span>
                                <span class="discuss_span_time"><?php echo $post['dateline']; ?></span>
                            </div>

                            <!-- 更多选项去除 -->
                            <!-- <img src="assets/images/more.png" class="discuss_more"> -->
                            <div class="discuss_content"><?php echo $post['message']; ?></div>

                            <!-- 底部点赞回复去除 -->
                            <!-- <div class="discuss_bottom">
                                    <img src="assets/images/zan.png" ><span class="discuss_zan"><?php echo $val['praisenum']?$val['praisenum']:"0" ;?></span>
                                    <img src="assets/images/reply.png" ><span><?php echo odz_lang('reply'); ?></span>
                            </div> -->
                        </div>
                    </li>
                </div>
                <?php endforeach; ?>
            </ul>
       </div>

       <!-- 修改   打开**客户端 -->
       <div>
            <a href="<?php echo $_G['baseurl']; ?>mocuzapp.php?tid=<?php echo $_G['tid'];?>&is_share=1&type=bbs" class="open_khd">
                <img src="assets/images/open_khd.png" alt="">
                打开<?php echo $_G['mocuz_config']['app_name']."客户端";?>，查看更多神评论
            </a>
        </div>
        <!-- <div class="open_khd">
                <a href="<?php echo $_G['baseurl']; ?>mocuzapp.php"><p><?php echo odz_lang('share_tips_9');?></p></a>
        </div> -->

        <!--新增精彩推荐 开始-->
        <?php if(!empty($outputs)):?>
          <div class="jingcai_tuijian">
              <div>
                      <div class="discuss_type_fgline"></div>
                      <p class="discuss_type tuijian_tle">精彩推荐</p>
                 </div>
              <div>
                  <ul>

                  <?php foreach($outputs as $key => $val):?>
                      <li>
                          <a class="arecommend" target="_blank" href="<?php echo $_G['baseurl'].$_G['mocuz_config']['mocuz_type'].'/index.php?mod=viewthread&tid='.$val['tid'].'&viewthread_share=1';?>">
                              <div class="<?php if($val['thumb']):?><?php echo 'tuijian_tu'?><?php else:?><?php echo 'tuijian_tu_noimg';?><?php endif;?>">
                                  <p class="tuijian_title"><?php echo $val['subject'];?></p>
                                  <div class="tuijian_laiyuan">
                                      <span><?php echo $val['dateline'];?></span>
                                      <span><?php echo $val['author']?></span>
                                  </div>
                              </div>
                              <!-- 有图片的话放在这里 -->
                              <?php if($val['thumb']):?>
                                  <img src="<?php echo $val['thumb']?>" alt="" class="tuijian_img">
                              <?php endif;?>

                          </a>
                      </li>
                  <?php endforeach;?>

                  </ul>
              </div>
          </div>

        <!--精彩推荐 结束-->
        <div>
          <a href="<?php echo $_G['baseurl']; ?>mocuzapp.php?tid=<?php echo $_G['tid'];?>&is_share=1&type=bbs" class="open_khdmore">
              <img src="assets/images/open_khdmore.png" alt="">
              打开<?php echo $_G['mocuz_config']['app_name']."客户端";?>，查看更多精彩内容
          </a>
        </div>
      <?php endif;?>
    </div>
    <div class="share_load">
            <div class="load_logo">
                    <img src="assets/images/icon.png" alt="">
            </div>
            <div class="load_text">
                    <p class="note_text_head ">更多精彩</p>
                    <p class="note_text_btm">尽在<?php echo $_G['mocuz_config']['app_name']."客户端";?></p>
            </div>
            <div class="load_btn">
                    <a class="btn_clk" href="<?php echo $_G['baseurl']; ?>mocuzapp.php?tid=<?php echo $_G['tid'];?>&is_share=1&type=bbs">立即下载</a>
            </div>
            <div class="load_close">
                    <img src="assets/images/close.png" alt="">
            </div>
    </div>
</div>
</body>
</html>
<script type="text/javascript" src='assets/js/big.image.js?_=<?php echo date('YmdHis'); ?>'></script>
<script type="text/javascript">
    /*视频处理*/
        (function() {
            var serviceUrl = 'http://tool.mocuz.com/videoplay.php';
            var videoCon = $('.videocontainer');
            function loadVideo() {
                videoCon.each(function() {
                    var that = $(this);
                    $.getJSON(serviceUrl+'?url='+that.attr('videourl')+'&callback=?', function(data) {
                        if (typeof data.url != 'undefined') {
                            that.html('<div style="margin:2px 2px 0 2px;background-color:#dddddd;"><iframe height="199" width="296" frameborder="0" src="'+data.url+'" /></div>');
                        } else {
                            that.html('<div class="video_text video_error">视频加载失败</div>');
                        }
                    });
                });
            }
            setTimeout(loadVideo, 1);
        })();
</script>
<?php if(in_array('xj_event', $_G['setting']['plugins']['available']) && ($items['postclass'] == 1 || $items['postclass'] == 2)) { ?>
    <script type="text/javascript">
        /*插件活动报名*/
        function joinin_show(){
            window.ontouchmove=function(e){
                e.preventDefault && e.preventDefault();
                e.returnValue=false;
                e.stopPropagation && e.stopPropagation();
                return false;
            }
            $('.shade').show();
            $('.join_show').show();
            var div=$('.join_show');
            $('.join_show').css('left',parseInt(($(window).width()-div.width())/2));
            $('.join_show').css('top',parseInt((document.body.clientHeight-div.height())/2+$(document).scrollTop()));
        }
        $('.event-go').click(function(){
            joinin_show();
        })
        // 取消
        $('.jclance').click(function(event) {
            $('.join_show').hide();
            $('.shade').hide();
            window.ontouchmove=function(e){
                e.preventDefault && e.preventDefault();
                e.returnValue=true;
                e.stopPropagation && e.stopPropagation();
                return true;
            }
        });

        $('.jconfirm').click(function(event) {
            window.ontouchmove=function(e){
                e.preventDefault && e.preventDefault();
                e.returnValue=true;
                e.stopPropagation && e.stopPropagation();
                return true;
            }
            var auth = '<?php echo $_GET['auth']; ?>';
            var realname = $('#realname').val() || '';
            var telephone = $('#telephone').val() || '';
            var mobile = $('#mobile').val() || '';
            var idcardtype = $('#idcardtype').val() || '';
            var idcard = $('#idcard').val() || '';
            var applynumber = $('#applynumber').val() || '';
            var message = $('#message').val() || '';
            var qq = $('#qq').val() || '';
            auth = encodeURIComponent(auth);
            href = location.href+'&auth='+auth;
            <?php
                $arr = array('auth'=>$_GET['auth'], 'tid'=>$_G['tid']);
                $params = json_encode($arr);
                $e = new Mcrypt3Des();
                $params = $e->encrypt($params);
            ?>
            params = '<?php echo $params; ?>';
            $.ajax({
                type: "POST",
                url: "<?php echo $_G['siteurl'] ?>index.php?mod=xj_event&realname="+realname+"&telephone="+telephone+"&mobile="+mobile+"&qq="+qq+"&idcardtype="+idcardtype+"&idcard="+idcard+"&ishtml=1&applynumber="+applynumber+"&message="+message,
                data: params,
                dataType: "html",
                success: function(data){
                    // $('.eroll-show').hide();
                    $('.join_show').hide();
                    $('.shade').hide();
                    v_dialog(data);
                }
            });
        });
        $('.quxiao').click(function(){
            if(confirm("是否取消报名？")) {
                var auth = '<?php echo $_GET['auth']; ?>';
                auth = encodeURIComponent(auth);
                href = location.href+'&auth='+auth;
                <?php
                    $arr = array('auth'=>$_GET['auth'], 'tid'=>$_G['tid']);
                    $params = json_encode($arr);
                    $e = new Mcrypt3Des();
                    $params = $e->encrypt($params);
                ?>
                params = '<?php echo $params; ?>';
                $.ajax({
                    type: "POST",
                    url: "<?php echo $_G['siteurl'] ?>index.php?mod=xj_event&action=cannel&ishtml=1",
                    data: params,
                    dataType: "html",
                    success: function(data){
                        v_dialog(data);
                    }
                });
            }
        })
    </script>
<?php } ?>
<script type="text/javascript">
    /*checkbox投票*/
    var checknum = '<?php echo $maxchoices;?>'; // 最多可选几项
    checknum = parseInt(checknum);
    function votecheck(){
        var str = '';
        if($(".vote-check:checked").length <= checknum){
            // var chkVal = [];
            $(".vote-check:checked").each(function(){
                // chkVal.push($(this).val());
                str += "&pollanswers[]="+$(this).val();
            });
        }

        return str;
    }
    /*checkbox选中未选中*/
    $('.vote-check').click(function(event) {
        if($(".vote-check:checked").length ==checknum){
            $('.vote-check').not("input:checked").each(function(){
                $(this).attr('disabled',true);
            });
        }else{
            $('.vote-check').attr('disabled',false);
        }
    });
    // 跳转到投票列表
    $('#showpoll').click(function(){
        var auth = '<?php echo $_GET['auth']; ?>';
        auth = encodeURIComponent(auth);
        var url = '<?php echo $_G['siteurl'].'index.php?mod=forum_misc&action=viewvote&tid='.$_G['tid'] ?>';
        url = url+'&auth='+auth;
        if (MocuzMobile.Android()) {
            window.commonjs.tonextpage(url); //安卓刷新
            return;
        }
        location.href = url;
    })
    // 活动报名框
    function erollshow(){
        $('.shade').show();
        $('.eroll-show').show();
        var div=$('.eroll-show');
        $('.eroll-show').css('left',parseInt(($(window).width()-div.width())/2));
        $('.eroll-show').css('top',parseInt((document.body.clientHeight-div.height())/2+$(document).scrollTop()));
    }
    // 点击报名
    $('.baoming').click(function() {
        erollshow();
    })
    //提交活动报名之后弹出层
    function subshow(html){
        window.ontouchmove=function(e){
            e.preventDefault && e.preventDefault();
            e.returnValue=false;
            e.stopPropagation && e.stopPropagation();
            return false;
        }
        $('.subshade').show();
        $('.subdialog').show();
        $('.subdTop').text(html);
        var div=$('.subdialog');
        $('.subdialog').css('left',parseInt(($(window).width()-div.width())/2));
        $('.subdialog').css('top',parseInt((document.body.clientHeight-div.height())/2+$(document).scrollTop()));
    }

    //提交活动报名之后弹出层 关闭
    function sub_dBottom(){
        window.ontouchmove=function(e){
            e.preventDefault && e.preventDefault();
            e.returnValue=true;
            e.stopPropagation && e.stopPropagation();
            return true;
        }
        $('.subdialog').hide();
        $('.subshade').hide();

    }
    var href;
    // 提交活动报名信息
    $('.sub').click(function() {
        var auth = '<?php echo $_GET['auth']; ?>';
        var action = 'activityapplies';
        var fid = <?php echo $_G['fid']; ?>;
        var tid = <?php echo $_G['tid'] ?>;
        var pid = <?php echo $postarr['pid']; ?>;
        var realname = $('.realname').val() || '';
        var mobile = $('.mobile').val() || '';
        var qq = $('.qq').val() || '';
        var message = $('.remarks').val() || '';
        var payvalue = "";
        var payment = 0;
        var activitysubmit = 1;
        auth = encodeURIComponent(auth);
        href = location.href+'&auth='+auth;
        var action, activitysubmit = 0, activitycancel = 0;
        var errmsg = '提交成功';
        if ($('.realname').hasClass('must')) {
            if(realname == '') {
                subshow('请输入真实姓名');
                return;
            }
        }
        if ($('.mobile').hasClass('must')) {
            if(mobile == '') {
                subshow('请输入mobile');
                return;
            }
        }
        if ($('.qq').hasClass('must')) {
            if(qq == '') {
                subshow('请输入qq');
                return;
            }
        }
        if($('.payImg').attr('alt')=='1'){
            payment = 1
            payvalue = $('.pay').val();
        }
        action = 'activityapplies';
        if($(this).attr('data') == 'go') {
            activitysubmit = 1;
        } else if($(this).attr('data') == 'back') {
            activitycancel = 1;
        }
        <?php
            $arr = array('auth'=>$_GET['auth'], 'fid'=>$_G['fid'], 'tid'=>$_G['tid'], 'pid'=>$postarr['pid']);
            $params = json_encode($arr);
            $e = new Mcrypt3Des();
            $params = $e->encrypt($params);
        ?>
        params = '<?php echo $params; ?>';
        $.ajax({
            type: "POST",
            url: "<?php echo $_G['siteurl'] ?>index.php?mod=forum_misc&payment="+payment+"&realname="+realname+"&mobile="+mobile+"&qq="+qq+"&message="+message+"&payvalue="+payvalue+"&ishtml=1&action="+action+"&activitysubmit="+activitysubmit+"&activitycancel="+activitycancel,
            data: params,
            dataType: "html",
            success: function(data){
                $('.eroll-show').hide();
                v_dialog(data);
            }
        });
    })
    // 投票提交
    function votepoll(pollid) {
        var pollid = parseInt(pollid);
        var auth = '<?php echo $_GET['auth']; ?>';
        var str = votecheck();
        if(!checknum) {
            str += '&pollanswers[]='+pollid;
        }
        auth = encodeURIComponent(auth);
        href = location.href+'&auth='+auth;
        <?php
            $arr = array('auth'=>$_GET['auth'], 'fid'=>$_G['fid'], 'tid'=>$_G['tid'], 'action'=>'votepoll');
            $params = json_encode($arr);
            $e = new Mcrypt3Des();
            $params = $e->encrypt($params);
        ?>
        var params = '<?php echo $params; ?>';
        $.ajax({
            type: "POST",
            url: "<?php echo $_G['siteurl'] ?>index.php?mod=forum_misc&ishtml=1"+str,
            data: params,
            dataType: "html",
            success: function(data){
                v_dialog(data);
            }
        });
    }
    // 投票成功后调用
    //显示弹窗
    function v_dialog(html){
        window.ontouchmove=function(e){
            e.preventDefault && e.preventDefault();
            e.returnValue=false;
            e.stopPropagation && e.stopPropagation();
            return false;
        }
        $('.shade').show();
        $('.vdialog').show();
        $('.dTop').text(html);
        var div=$('.vdialog');
        $('.vdialog').css('left',parseInt(($(window).width()-div.width())/2));
        $('.vdialog').css('top',parseInt((document.body.clientHeight-div.height())/2+$(document).scrollTop()));
    }
    //关闭弹窗
    function v_dBottom(){
        window.ontouchmove=function(e){
            e.preventDefault && e.preventDefault();
            e.returnValue=true;
            e.stopPropagation && e.stopPropagation();
            return true;
        }
        $('.vdialog').hide();
        $('.shade').hide();
        if (MocuzMobile.Android()) {
            window.commonjs.tonextpage(href); //安卓刷新
            return;
        }
        location.href = href;
    }
    //取消
    $('.opera a').click(function(event) {
        $('.shade').hide();
        $('.eroll-show').hide();
        window.ontouchmove=function(e){
            e.preventDefault && e.preventDefault();
            e.returnValue=true;
            e.stopPropagation && e.stopPropagation();
            return true;
        }
    });
    //操作居中
    function op_center(){
        var liindex=$('.operation li').length;
        /*var lihidden=$(".operation li:hidden").length;*/
        var licount=liindex
        var op_w=$('.operation').width();
        $('.operation li').width(op_w/licount-1);

    }
    op_center();

    //弹出框
    $('.move_op').click(function(event) {
        window.ontouchmove=function(e){
            e.preventDefault && e.preventDefault();
            e.returnValue=false;
            e.stopPropagation && e.stopPropagation();
            return false;
        }
        $('.frame-box').show();
        $('.shade').show();
        var div=$('.frame-box');
        $('.frame-box').css('left',parseInt(($(window).width()-div.width())/2));
        $('.frame-box').css('top',parseInt((document.body.clientHeight-div.height())/2+$(document).scrollTop()));

    });

    //切换选择
    $('.them').click(function(event) {
        $('.them').find('img').attr('data',"false");
        $('.them').find('img').attr('src','<?php echo $_G['siteurl'] ?>assets/images/nselect.png');
        $(this).find('img').attr('data',"true");
        if($(this).find('img').attr('data',"true")){
            $(this).find('img').attr('src','<?php echo $_G['siteurl'] ?>assets/images/select.png');
        }
    });

    //下拉
    $('.frame-main select:first').change(function(event) {
        var options=$(".test option:selected");
        if(options.text()!='默认板块'){
            $('.select-them').show();
            $('.frame-main select').css('color','#454545');
        }else{
            $('.select-them').hide();
        }
    });
    $('.clance').click(function(event) {
        $('.frame-box').hide();
        $('.shade').hide();
        window.ontouchmove=function(e){
            e.preventDefault && e.preventDefault();
            e.returnValue=true;
            e.stopPropagation && e.stopPropagation();
            return true;
        }
    });

    //确定
    $('.confirm').click(function(event) {
        window.ontouchmove=function(e){
            e.preventDefault && e.preventDefault();
            e.returnValue=true;
            e.stopPropagation && e.stopPropagation();
            return true;
        }
        var auth = "<?php echo $_GET['auth']; ?>";
        var action = 'moderate';
        var fid = <?php echo $_G['fid']; ?>;
        var moveto = $('select[name=moveto]').val();
        var threadtypeid = $('select[name=threadtypeid]').val();
        var moderate = <?php echo $_G['tid']; ?>;
        var operations = 'move';
        var type = $('.them1 img').attr('data') ? 'normal' : 'redirect';

        // 调用客户端移动帖子方法
        if (MocuzMobile.Android()) {
            window.myjs.executeMove(""+fid, ""+moderate, ""+moveto, ""+threadtypeid, ""+type);
            return;
        }
        if (MocuzMobile.iOS()) {
            var cmd = "executeMove";
            window.location.href="objc://"+cmd+":/"+action+"/"+fid+"/"+moderate+"/"+operations+"/"+moveto+"/"+threadtypeid+"/"+type;
        }
    });

    // 编辑帖子
    function editpost(pid) {
        var auth = "<?php echo $_GET['auth']; ?>",
            fid = <?php echo $_G['fid']; ?>,
            tid = <?php echo $_G['tid']; ?>,
            pid = pid;
        // alert($('.item-view').length);
        // 调用客户端编辑帖子方法
        if (MocuzMobile.Android()) {
            window.myjs.executeEdit(""+fid, ""+tid, ""+pid);
            return;
        }
        if (MocuzMobile.iOS()) {
            var cmd = "executeEdit";
            window.location.href="objc://"+cmd+":/"+fid+"/"+tid+"/"+pid;
        }
    }
    // 帖子删除  post删除帖子  topic 删除主题
    function deletepost(type, pid) {
        if(confirm("确认要删除吗？")) {
            if (type == 'post') {
                data = {auth:'<?php echo $_GET['auth']; ?>', action:'delpost', fid:<?php echo $_G['fid']; ?>, tid:<?php echo $_G['tid']; ?>, topiclist:pid};
                // alert(data.tid);
                //调用客户端删除帖子方法
                if (MocuzMobile.Android()) {
                    window.myjs.executeDelete(""+data.action, ""+data.fid, ""+data.tid, ""+data.topiclist);//android
                    return;
                }
                if (MocuzMobile.iOS()) {
                    var cmd = "executeDelete";
                    window.location.href="objc://"+cmd+":/"+data.action+"/"+data.fid+"/"+data.tid+"/"+data.topiclist;
                }
            } else if (type == 'topic') {
                data = {auth:'', action:'moderate', fid:<?php echo $_G['fid']; ?>, moderate:<?php echo $_G['tid']; ?>, operations:'delete'};
                // 调用客户端删除主题方法
                if (MocuzMobile.Android()) {
                    window.myjs.executeDelete(""+data.action, ""+data.fid, ""+data.moderate, ""+data.operations);//android
                    return;
                }
                if (MocuzMobile.iOS()) {
                    var cmd = "executeDelete";
                    window.location.href="objc://"+cmd+":/"+data.action+"/"+data.fid+"/"+data.moderate+"/"+data.operations;
                }
            } else {
                return;
            }
        }
    }

    // 帖子删除成功调用方法
    function afterdel(pid) {
        var item = document.getElementsByClassName('item-view');
        for(var i=0; i<item.length; i++) {
            tagid = item[i].getAttribute('pid');
            if (tagid == pid) {
                item[i].style.display = 'none';;
            }
        }
    }
    // 获取板块类型
    function getthreadtypes(fid) {
        if (!fid) {
            return;
        }
        $.ajax({
            type: "GET",
            url: "<?php echo $_G['baseurl']; ?>mocuz/index.php?mod=forum_ajax&action=getthreadtypes&fid="+fid,
            dataType: "html",
            success: function(data){
                $('#threadtypeid').html('');
                $('#threadtypeid').append(data);
                return;
            }
        });
    }
    // 投票
    //li居中
    function op_center1(){
        var op_w=$('.poll-list').width();
        $('.poll-list li').width(op_w/2-6);
    }
    op_center1();
    // 投票
    var param=0;                      //判断是否选择了一项
    $('.toupiao').click(function() {
        $(this).children().attr('src','<?php echo $_G['siteurl']; ?>assets/images/select.png');
        //记录已选择
        param=$(this).attr('data');
        obj=$(this);
        if ($(this).children().attr('src','<?php echo $_G['siteurl']; ?>assets/images/select.png')) {
            $('.toupiao').not(this).children().attr('src','<?php echo $_G['siteurl']; ?>assets/images/noselect.png')
        };
    });
    /*
     改变投票结果
     */
    $('.signtext').click(function(){
        votepoll(param);
    })
    // 投票后
    function hideVote(){
        $('.v-hide').css('visibility','hidden');
    }
    //活动报名切换选择
    $('.payable').click(function(event) {
        $('.payable').find('img').attr('alt',"0");
        $('.payable').find('img').attr('data',"false");
        $('.payable').find('img').attr('src','<?php echo $_G['siteurl'] ?>assets/images/noselect.png');
        $(this).find('img').attr('data',"true");
        if($(this).find('img').attr('data',"true")){
            $(this).find('img').attr('alt',"1");
            $(this).find('img').attr('src','<?php echo $_G['siteurl'] ?>assets/images/select.png');
        }
    });

    //切换选择
    $('.poll-list p').click(function(event) {
        $('.poll-list p').find('img').attr('data',"false");
        $('.poll-list p').find('img').attr('src','<?php echo $_G['siteurl'] ?>assets/images/noselect.png');
        $(this).find('img').attr('data',"true");
        //记录已选择
        s_param=$(this).attr('data');
        //获取勾选的对象上上级(那个li)
        s_obj=$(this).prev().parent();
        if($(this).find('img').attr('data',"true")){
            $(this).find('img').attr('src','<?php echo $_G['siteurl'] ?>assets/images/select.png');
        }
    });
    /*
     改变投票结果
     */
    $('.signimg').click(function(){
        votepoll(s_param);
    })
    var tagindex = 1;
    var MocuzMobile = {
        Android: function() {
            return /Android/i.test(navigator.userAgent);
        },
        BlackBerry: function() {
            return /BlackBerry/i.test(navigator.userAgent);
        },
        iOS: function() {
            return /iPhone|iPad|iPod/i.test(navigator.userAgent);
        },
        Windows: function() {
            return /IEMobile/i.test(navigator.userAgent);
        },
        any: function() {
            return (isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Windows());
        }
    };
    $(function() {
        //分享出去页面打开点击回复按钮进去下载引导页
        var wei_href="<?php echo $_G['baseurl']; ?>app.html#mp.weixin.qq.com"
        $('.report-advert').attr('href',wei_href);
        /*获取页面中img*/
        var  contentid = '<?php echo $_G['tid']?>';
        var data = {
            'tid'        : '<?php echo $_G['tid']?>'
        };
        // DetailHandler.sendDataToClientIOS(data, "getBbsContentInfo");
        // if (window.androidclient && window.androidclient.onClientInit) {
        //     window.androidclient.onClientInit(DetailHandler.json2str(data));
        // }
        var contentid = "<?php echo $_G['tid']?>";
        var auth = "<?php echo $_GET['auth']?>";
        var totalpage = "<?php echo $totalpage?>";
        //加载获取更多内容
        var tabContainter = $("div.bbs-feed-list");
        var loadinInter   = tabContainter .find('div.loading-con');
        var containter    = tabContainter .find("#comments");
        var currentP = 1 ,currentLoaded = false ,currentLoading = false ;
        var refresh = function(){
            currentLoading =  true;
            $.ajax({
                url:"<?php echo $_G['baseurl']; ?>mocuz/index.php?mod=viewthread",
                type:'GET',
                data:{tid:contentid,item_view:1,page:currentP,auth:auth,viewthread_share:1},
                dataType: "html",success:function(html) {
                    var viewLen = $(html).find('li.item-view') .length;
                    if(viewLen < "<?php echo $h5_page ?>"){
                        currentLoaded = true;
                        loadinInter .hide();
                    }else currentP ++;
                    if(viewLen>0&&currentP-1<=totalpage){
                        $(".parameter").remove();
                        $("#comments") .html(html);
                        $('.ul-reply li:last-child a').css('border-right','0px');
                    }else {
                        loadinInter .hide();
                        currentLoaded = true;
                    }
                    img_bind();
                    currentLoading = false;
                    //评论列表回复的回复
                    tabContainter.find(".reply-box-btn").on("click",function(event){
                        var authorid = $(this).attr("authorid");
                        var data = {
//                            'username' : $(this).attr("username"),
                            'tid': $(this).attr("commentid")
                        };
                        DetailHandler.sendDataToClientIOS(data, "commentReplyKey");
                        if( window.androidclient){
                            window.androidclient.onReplyBtnClick(DetailHandler.json2str(data));
                        }
                    });
                }
            })
        }
        //滚动触发加载
        var scrollTrriget = function(){
            if(currentLoaded || currentLoading) return;
            var bodyTop = document.documentElement.scrollTop ;//document.body.scrollTop;
            if(!bodyTop) bodyTop = document.body.scrollTop;
            //滚动到底部时出发函数
            //滚动的当前位置+窗口的高度 >= 整个body的高度
            var oBody = $('body')[0];
            if(bodyTop+oBody.clientHeight >= $(document.body).height()&&!currentLoaded){
                if(currentLoaded==false ){
                    refresh();
                }
            };
        }

    })
    /**
     * 夜间模式切换
     * @param isNight 是否启用夜间模式
     */
    function switchNightMode(isNight) {
        var colorVal = '';
        if (isNight == 1) {
            $('.bbs-cv-hd .btm').css('border-bottom','1px solid #454545');
            $('.bbs-feed-list li').css('border-top','1px solid #454545');
            $('.quote').css('background-color','#A5A7AA');
            colorVal = '#2C2D32';
        } else {
            colorVal = '';
        }
        document.body.style.backgroundColor = colorVal;
    }
    //论坛举报客户端加载
    function report(){
        var pid="<?php echo $postarr['pid']?>";
        var fid="<?php echo $_G['fid']?>";
        if(MocuzMobile.Android()) {
            window.myjs.report(fid,pid);//android
            return;
        }
        if(MocuzMobile.iOS()) {
            window.location.href="objc://report:/"+fid+"/"+pid;
            return;
        }
    }
    //论坛h5客户端加载
    function testClick(cmd, pid, author){
        var tid = '<?php echo $_G['tid']?>';
        var author = author || "<?php echo $_G['forum_thread']['author']; ?>";
        if(MocuzMobile.Android()) {
            window.myjs.runJs(""+tid, ""+pid);//android
            return;
        }
        if(MocuzMobile.iOS()) {
            window.location.href="objc://"+cmd+":/"+tid+"/"+author+"/"+pid;
        }
    }

    function scrollParameter(){
        $(window).bind('scroll', AdapterObj.scrollEvent);
    };
    //回复跳转
    tagindex = 1;
    function  postParameter(uid,username,message) {
        var divFeedList = $("div.bbs-feed-list");
        var divFeedItem = divFeedList.find("div.itm");
        var author="<?php echo $_G['mocuz_config']['userimage_url'];?>";
        var html ='';
        html+="<ul class='parameter'>";
        html+= "<li class='item-view'>";
        html+=  "<div class='hd'>";
        html+=  "<a href='javascript:void(0);' class='user-hd'><img src="+author+"></a>";
        html+=  "<div class='hd-name'>";
        html+=   "<a href='javascript:void(0);' class='user-txt-name'>"+username+"</a>";
        html+=  "<div class='hd-time hd-s'>"+message+"</div>";
        html+=  " </div>";
        html+=  "</div>";
        html+=  " </li>";
        html+="</ul>";
        $(window).unbind('scroll');
        if (tagindex == 1) {
            divFeedItem.append(html);
            tagindex = 1;
        }
        var oBody = $('body')[0];
        var scrollTop = oBody.scrollHeight - oBody.clientHeight;
        scrollTop = scrollTop - 45;
        $('body').animate({scrollTop:scrollTop}, 300, '', function() {
            $(window).bind('scroll', AdapterObj.scrollEvent);
        });
    };

    $("body").on("touchstart", function(e) {
        startX = e.originalEvent.changedTouches[0].pageX,
            startY = e.originalEvent.changedTouches[0].pageY;
    });
    $("body").on("touchmove", function(e) {
        moveEndX = e.originalEvent.changedTouches[0].pageX,
            moveEndY = e.originalEvent.changedTouches[0].pageY,
            X = moveEndX - startX,
            Y = moveEndY - startY;

        if ( Math.abs(Y) > Math.abs(X) && Y > 0) {
            $('.backtop').show();
            if($("body").scrollTop()<=0){
                $('.backtop').hide();
            }

        }else if ( Math.abs(Y) > Math.abs(X) && Y < 0 ) {
            $('.backtop').hide();
        }

    });
    //返回顶部
    $('.backtop').click(function(event) {
        $('.backtop img').attr('src','assets/images/backtop2.png');
        $("html,body").animate({scrollTop:"0px"},300,function(){
            $('.backtop img').attr('src','assets/images/backtop.png');
            $('.backtop').hide();
        });
    });

    // 快捷回复委托方法
    function odz_quick_reply() {
        var pid = '<?php echo $postarr['pid']; ?>';
        var tid = '<?php echo $_G['tid']; ?>';
        var author = "<?php echo $_G['forum_thread']['author']; ?>";
        if (MocuzMobile.Android()) {
            window.myjs.runJs(""+tid, ""+pid);//android
            return;
        }
        if (MocuzMobile.iOS()) {
            var cmd = "changePage";
            window.location.href="objc://"+cmd+":/"+tid+"/"+author+"/"+pid;
        }
    }
    // 数据交互
    function jiaohu(cmd,str) {
        var client="<?php echo $_GET['client'];?>";
        var favid="<?php echo $postarr['favid'];?>";
        var sharelink="<?php echo urlencode($sharelink); ?>";
        var share_text="<?php echo odz_format_sharetext($sharetext); ?>";
        var sharesubject="<?php echo $_G['forum_thread']['subject']; ?>";
        if(favid){
            var status='1';
        }else{
            var status='0';
        }
        var cmd ='jiaohu';
        var str = '{"shoucang":'+status+', "shareSNS":{"sharelink":"'+sharelink+'", "sharetext":"'+share_text+'", "sharesubject":"'+sharesubject+'"}}';
//        var str = '{"shoucang":'+subject+'}';
        if(MocuzMobile.Android()&&client==1) {
            window.shareInfo.jiaohu(str);//android
            return;
        }
        if (MocuzMobile.iOS()&&client==1) {
            window.location.href="objc://"+cmd+":/"+str;
        }
    }
    window.onload = jiaohu();

    /*4个分享的宽度*/
    function sharew(){
        var su=$('.toshare ul').width();
        $('.toshare ul li').width(su/4-20);
    }
    sharew();
</script>
<script type="text/javascript">
$(document).ready(function(){
    var discuss_type_left=($('.note_selective').width()-100)/2;
    $('.discuss_type').css('left',discuss_type_left) ;

     var height = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
     if(height<504){
        $('.content,.note_selective,.selective_title,.discuss_ul li,.discuss_type_fgline').css('border-width','1px');
     }
        var u = navigator.userAgent;
    if (u.indexOf('Android') > -1 || u.indexOf('Linux') > -1) {
        $('.content,.note_selective,.selective_title,.discuss_ul li,.discuss_type_fgline').css('border-width','1px');
    }
});
</script>
<script type="text/javascript">
  var doc = $(".discuss_box").find(".img_detail");
  doc.css("max-width","100%");
  var width = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
  doc.parent().css({"padding-right":(width)*0.02});
  var biaoqing=$('.head_box').children('img');
  biaoqing.css({'width':'auto','vertical-align':'text-bottom'})
  $(".load_close").click(function(){
      $('.share_load').hide();
  })
</script>
