<!--<?php
InitGP('s');
print <<<EOT
-->
<!-- 
EOT;
if($cssForum){print <<<EOT
-->
<div class="c"></div>
<link rel="stylesheet" type="text/css" href="$pwModeImg/app.css" />
<!-- 
EOT;
}print <<<EOT
-->
<div id="content" class="fr">
	<div style="padding:15px 15px 0;">
		<div class="app-title cc">
<!--
EOT;
if($m == 'o'){print<<<EOT
-->
			<a href="{$basename}space=1" class="gray fr">进入个人空间浏览&raquo;</a>
<!--
EOT;
}print<<<EOT
-->
			<span>日志</span>
		</div>
		<div class="tabB cc">
			<ul>
<!--
EOT;
$b = $a;
$u && $u != $winduid && $b = 'friend';
$a == 'edit' && $b = 'write';
print <<<EOT
-->
				<li id="a_friend"><a href="{$temp_basename}a=friend">好友日志</a></li>
				<li id="a_my"><a href="{$temp_basename}">我的日志</a></li>
<script language="JavaScript">
setCurrent('a_$b','a_my','current');
</script>
			</ul>
				<a href="{$temp_basename}a=write" class="app-post">写新日志</a>
		</div>
    </div>
<!--
EOT;
if (empty($a) || $a == 'privacy' || $a == 'friend') {print <<<EOT
-->
    <div id="content_main" class="fl">
    	<table width="100%">
        <tr class="vt"><td height="400">
        <div class="p15">
<!--
EOT;
$privacy = array('全站可见','仅好友可见','仅自己可见');
if(!$did){
if($sum){print <<<EOT
-->
				<div class="o-info-a">&nbsp;共&nbsp;{$sum}&nbsp;条日志</div>
				<div class="p10" style="padding-top:0;">
				<table cellpadding="0" cellspacing="0" width="100%" style=" table-layout:fixed;">
<!--
EOT;
foreach($diarydb as $value){
$typename = !$value[dtid] ?  '默认分类' : $diarytype[$value[dtid]][name];
$title = '所属:'.$value[username].'&nbsp;'.$value[title];
$descrip = $value[subject];
if($value[uid]==$winduid){
	$author = '';
}else{
	$author = "<a href=\"u.php?uid=$value[uid]\">$value[username]</a> ";
}
print <<<EOT
-->
					<tr id="diary_{$value[did]}" class="tr5 vt">
<!--
EOT;
if($value[icon]){print <<<EOT
-->
					<td width="55"><img src="$value[icon]" class="img-50" /></td>
<!--
EOT;
}print <<<EOT
-->
					<td>			
<!--
EOT;
if($db_share_open && !$shareGM){print<<<EOT
-->
					<span class="fr"><a class="a-reply" href="javascript:;" onclick="sendmsg('operate.php?action=share&ajax=1&type=diary&id=$value[did]','',this.id);">分享<span>+</span></a></span>
                   
<!--
EOT;
}print <<<EOT
-->
					<a href="{$basename}did=$value[did]&u=$value[uid]" class="b f14">{$value[subject]}</a>
						<p style="padding:10px 0 15px;" class="gray">$author 发表于：$value[postdate]&nbsp;&nbsp;&nbsp;评论：$value[c_num]&nbsp;&nbsp;&nbsp;浏览：$value[r_num]</p>
						<p id="img-width" class="f14">
						$value[content]
<!--
EOT;
if($value['pic']){
foreach($value['pic'] as $pic){
if($pic){print <<<EOT
-->
						<div class="f12" id="att_$pic[aid]" style="width:450px;overflow:hidden;margin:0;">
<!--
EOT;
if($pic['desc']){print <<<EOT
-->
							描述:$pic[desc]<br />
<!--
EOT;
}print <<<EOT
-->
							图片: $pic[img]
						</div>
<!--
EOT;
}}}print <<<EOT
-->
						</p>
						<div style="padding:20px 0 0;">
<!--
EOT;
if(($a!='friend' && $u==$winduid) || $groupid==3){print <<<EOT
-->
						<span class="del fr" style="cursor:pointer;" onclick="pwConfirm('是否确认删除',this,function(){delDiary('$value[did]','$u')})">删除</span>
<!--
EOT;
}if($u==$winduid && $a!='friend'){print <<<EOT
-->
					 <a style="cursor: pointer;" class="fr mr10" title="编辑" href="{$basename}a=edit&did=$value[did]">编辑</a>
<!--
EOT;
}print <<<EOT
-->

<!--
EOT;
!$value[dtid] && $value[dtid] = '-1';
print <<<EOT
-->
						<span class="mr10">分类：<a href="{$basename}dtid=$value[dtid]&u=$value[uid]" class="black uline">{$typename}</a></span>
<!--
EOT;
if($u==$winduid && $a!='friend'){
print <<<EOT
-->
						<span>{$privacy[$value[privacy]]}</span>
<!--
EOT;
}print <<<EOT
-->						
						</div>
					</td>
					</tr>
<!--
EOT;
}print <<<EOT
-->	
				</table>
				</div>
				<div class="p10 cc">$pages</div>
<!--
EOT;
}else{
if($a == 'friend'){print <<<EOT
-->
				<div class="p10">好友最近没有日志</div>
<!--
EOT;
}else{print<<<EOT
-->
				<div class="p10">您最近没有日志</div>	
<!--
EOT;
}}}elseif(is_numeric($did)){
$typename = !$rt[dtid] ?  '默认分类' : $diarytype[$diary[dtid]][name];
$copy = $diary[copyurl] ? '转载于' : '发表于';
if($diary[uid]==$winduid){
	$author = '';
}else{
	$author = "<a href=\"u.php?uid=$diary[uid]\" class=\"b blue\">$diary[username]</a> ";
}
$title = '所属:'.$diary[username].'&nbsp;'.$diary[title];
$descrip = $diary[subject];
print <<<EOT
--><div class="p10">
		<h1 class="b blue f14" style="padding:10px 0 0;">{$diary[subject]}</h1>
						<p class="cc p10 mt10" style="background:#f9f9f9;line-height:1.8;">
<!--
EOT;
if($db_share_open && !$shareGM){print<<<EOT
-->
						<span class="fr"><a class="a-reply" href="javascript:;" onclick="sendmsg('operate.php?action=share&ajax=1&type=diary&id=$did','',this.id);">分享<span>+</span></a></span>
<!--
EOT;
}print <<<EOT
-->
						<span class="gray"><span class="f10 mr10">{$author}{$copy}$diary[postdate]</span> <span class="mr10">评论：$diary[c_num]</span><span class="mr10">浏览：$diary[r_num]</span></span><br />
<!--
EOT;
if($winduid==$u || $groupid==3){print <<<EOT
-->

					 <a class="del fr" style="cursor:pointer;" onclick="pwConfirm('确认删除？',this,function(){delDiary('$diary[did]','$u','read')})">删除</a>
<!--
EOT;
}if($diary[ifcopy] && $u != $winduid){print <<<EOT
-->
				<span class="fr mr10"><a style="cursor: pointer;" title="转载" href="{$basename}a=copydiary&did=$diary[did]" onclick="return ajaxurl(this);">转载</a></span>
<script language="JavaScript">
function ajaxurl(o) {
	read.obj = o;
	ajax.send(o.href,'',ajax.get);
	return false;
}
</script>
<!--
EOT;
}if($winduid==$u){print <<<EOT
-->
				<span class="fr mr10"><a style="cursor: pointer;" title="编辑" href="{$basename}a=edit&did=$diary[did]">编辑</a></span>
<!--
EOT;
}if($_G['allowreport']){print <<<EOT
-->
    		<a style="cursor: pointer;" class="fr mr10" onclick="sendmsg('pw_ajax.php?action=report&type=diary&tid=$did&pid=$u','',this.id);" id="report_diary">举报</a>
<!--
EOT;
}
!$rt[dtid] && $diary[dtid] = '-1';
print <<<EOT
-->
					<span>分类：<a href="{$basename}dtid=$diary[dtid]&u=$diary[uid]">{$typename}</a></span>
<!--
EOT;
if($u==$winduid){
print <<<EOT
-->
					<span>{$privacy[$diary[privacy]]}</span>
<!--
EOT;
}print <<<EOT
-->
</p>
				<table cellpadding="0" cellspacing="0" width="100%" style=" table-layout:fixed;overflow:hidden;">
					<tr id="diary_{$diary[did]}">
						<td height="200">
						<p style="line-height:2;font-size:14px;padding:10px 0;" id="img-width">										
<!--
EOT;
if($diary[copyurl]){print <<<EOT
-->
						<div style="margin-left:15px;">转载自:<a href="u.php?uid=$diary[copyuid]" target="_blank" style="color:#2484C7">$diary[copyer]</a> <a href="$diary[url]" target="_blank">$diary[url]</a></div><br />
<!--
EOT;
}print <<<EOT
-->
						$diary[content]
<!--
EOT;
if($diary['pic']){
foreach($diary['pic'] as $pic){
if($pic){print <<<EOT
-->
						<div class="f12" id="att_$pic[aid]" style="width:450px;overflow:hidden;margin:5px 0px 5px 0;">
<!--
EOT;
if($pic['desc']){print <<<EOT
-->
							描述:$pic[desc]<br />
<!--
EOT;
}print <<<EOT
-->
							图片:$pic[img]
<!--
EOT;
if($pic['dfadmin']){print <<<EOT
-->
							[<a style="cursor:pointer" onclick="delatt('$diary[pid]','$pic[aid]');">删除</a>]
<!--
EOT;
}print <<<EOT
-->
						</div>
<!--
EOT;
}}}print <<<EOT
-->
						</p>
						<div class="c"></div>
					</td>
				</tr>
				</table>
<div class="cc mt10">
						<a style="cursor: pointer;" class="fl" title="下一篇" href="{$basename}a=next&did=$diary[did]" onclick="return ajaxpage(this.href,'next','$u','$space');">下一篇</a>
						<a style="cursor: pointer;" class="fr" title="上一篇"href="{$basename}a=pre&did=$diary[did]" onclick="return ajaxpage(this.href,'pre','$u','$space');">上一篇</a></div>
<!-- 
EOT;
$rateSets = unserialize($db_ratepower);
if($rateSets[2] && isset($db_hackdb['rate'])){
print <<<EOT
-->	 
						<link rel="stylesheet" type="text/css" href="hack/rate/images/rate.css" />
						<script language="JavaScript" src="js/rate_ajax.js"></script>
						<script language="javascript">
						window.onload = function() {
							rate.getVote("vote_box","{$db_bbsurl}/hack.php?H_name=rate&action=ajax","elementid=vote_box&typeid=2&objectid={$did}&authorid={$u}");
						};
						</script>						
						<div id="vote_box" class="mt10"></div>
<!-- 
EOT;
}
print <<<EOT
-->	
						
<!--
EOT;
require_once PrintEot('m_comment');print <<<EOT
-->
	</div>
<!--
EOT;
}print <<<EOT
-->
		</div></td></tr></table>
    </div>
<!--
EOT;
if($a != 'friend'){print <<<EOT
-->
    <div id="sidebar" class="fr">
        <div class="p10 lh24">
        <p>
<!--
EOT;
if($u==$winduid || $groupid==3){
print <<<EOT
-->
        <span class="fr gray"><a style="cursor: pointer;" onclick="addType('dt_ul','$u')">+添加分类</a></span>
<!--
EOT;
}print <<<EOT
-->
        <span class="b">日志分类</span></p>
        <p class="mt10"><a href="{$basename}" id="dtype_all"  class="black unline">全部日志</a> <span class="fn f10 gray">({$count})</span></p>
        <ul id="dt_ul">

<!--
EOT;
foreach($diarytype as $value){
print <<<EOT
-->
            <li id="dt_{$value[dtid]}" onmouseover="changSpanDisplay(this);" onmouseout="changSpanDisplay(this);"> 
<!--
EOT;
if($u==$winduid || $groupid==3){
print <<<EOT
-->
            <span class="fr del" style="cursor: pointer;display:none" onclick="pwConfirm('确认删除？',this,function(){delDiaryType('$value[dtid]','$u')})">删除</span><span style="cursor: pointer;display:none;" onclick="showEidt('$value[dtid]','$u');"  class="black uline fr mr10">编辑</span> 
<!--
EOT;
}print <<<EOT
-->
            <a href="{$basename}dtid={$value[dtid]}" id="dtype_{$value[dtid]}" class="black uline">$value[name]</a> <b class="fn gray f10" id="dnum_{$value[dtid]}">({$value[num]})</b></li>
<!--
EOT;
}print <<<EOT
-->
            <li id="dt_null"><a href="{$basename}dtid=-1" id="dtype_null"  class="black uline">默认分类</a> <b class="fn gray f10">({$other})</b></li>
        </ul>
<!--
EOT;
if($u==$winduid){print <<<EOT
-->
        <div class="o-info-a"><img src="$pwModeImg/icon/key.png" align="absmiddle" /> <a href="{$basename}a=privacy"  class="black uline">私密日志</a> <b class="fn gray f10">($dnum)</b> </div>
<!--
EOT;
}print <<<EOT
-->
    </div>
    </div>
<!--
EOT;
}print <<<EOT
-->
<script language="javascript">
setCurrent('dtype_$dtype','dtype_all','current');
</script>
</div>
<!--
EOT;
} elseif ($a == 'write' || $a == 'edit') {print <<<EOT
-->
	<div class="p15">
        <div class="o-info-a">
<!--
EOT;
if ($a == 'write') {print <<<EOT
-->
            写新日志
<!--
EOT;
} else {print <<<EOT
-->
            编辑日志
<!--
EOT;
}
$shortcut=$_GET['s']?'target=formTarget':'';
$formiframe=$shortcut?"<iframe width=0 height=0 name=formTarget src='javascript:;' onload=\"this.contentWindow.document.body.innerHTML.indexOf('操作完成')==-1?'':showDialog('success','日志发表成功！')&setEditorContent()&(read.menu.style.top='400px')&getObj('FORM').reset()\"></iframe>":"";
print <<<EOT
-->
            | <a href="{$basename}">返回我的日志</a>
        	</div>
			$formiframe
			<form action="{$basename}&a=$a" method="post" enctype="multipart/form-data" onsubmit="return checkpost(document.FORM);" name="FORM" id="FORM" $shortcut />
			<input type="hidden" name="did" value="$did" />
			<input type="hidden" name="dtided" value="$diary[dtid]" />
			<input type="hidden" name="privacyed" value="$diary[privacy]" />
			<input type="hidden" name="atc_autourl" value="1" />
			<input type="hidden" name="step" value="2" />
			<input type="hidden" name="verify" value="$verifyhash" />
			<div style="padding:0 5px;">
			<div style="padding:10px 0 0 0;"><input type="text" class="input" name="atc_title" id="atc_title" value="$diary[subject]" size="70"/>&nbsp;<span id="atc_title_warn" class="gray">限 $db_titlemax 字节</span>
			</div>
			<div id="menu_face" class="menu" style="display:none;"></div>
            <div style="padding:10px 0;">
<!--
EOT;
require_once PrintEot('wysiwyg_editor');
print <<<EOT
-->
            </div>
            <table cellpadding="0" cellspacing="0" width="100%">
                <tr class="tr3">
                    <td>日志分类</td>
                    <td>
                        <select name="dtid" id="dtid_add">
                            <option value="0" $dtid_0>默认分类</option>
                            $dtsel
                        </select> <a style="cursor: pointer;" onclick="javascript:add_dtid('$u','dtid_add');">+添加分类</a>
                    </td>
                </tr>
                <tr class="tr3">
                    <td>隐私设置</td>
                    <td>
                        <select name="privacy" onchange="optionsel(this.value)">
                            <option value="0" $privacy_0>全站可见</option>
                            <option value="1" $privacy_1>仅好友可见</option>
                            <option value="2" $privacy_2>仅自己可见</option>
                        </select>  <input id="if_copy" type="checkbox" name="ifcopy" value="1" $checked $disabled>允许好友转载
                        <input type="checkbox" name="atc_convert" id="atc_convert" value="1" checked/>Wind Code自动转换
                    </td>
                </tr>
<!--
EOT;
if ($db_allowupload && $_G['allowupload'] || $attach) {print <<<EOT
-->
                <tr><td colspan="2">
                    <table cellPadding="0" cellSpacing="0" style="display:none" width="100%">
                    <tbody id="att_mode"><tr>
                        <td><input class="input" type="file" name="attachment_" size="20" /></td><td><input class="input" type="text" name="atc_desc" size="20" /></td>
                        <td><select style="display:none;"><option value="0"></option><option value="1">加密</option><option value="2">出售</option></select></td>
                        <td><select name="att_ctype" style="display:none;">{$alltype}</select></td>
                        <td><input class="input" type="hidden" name="atc_needrvrc" value="0" size="1" /></td>
                        <td></td></tr>
                    </tbody>
                    </table>
                </td>
            </tr>
<script language="JavaScript">
var allow_ext = '$uploadfiletype';
var attachnum = parseInt('$db_attachnum');
var charset = '$db_charset';
var titlemax = '$db_titlemax';
var postmax = '$db_postmax';
initCheckTextNum('atc_title','atc_title_warn',titlemax);
initCheckTextNum('textarea','textarea_warn',postmax);
</script>
<script type="text/javascript" language="JavaScript" src="js/upload.js"></script>
<!--
EOT;
}if($attach){print <<<EOT
-->
<tr class="tr3">
    <th colspan="2">
        <div class="editor-mwidth">
            该帖包含附件<span class="gray">(不想保留的附件去掉√)</span> :
            <table class="tr_p10">
                <tr>
                    <td width="3%"></td>
                    <td width="31%">附件</td>
                    <td width="20%">描述</td>
                    <td width="10%"></td>
                    <td width="10%"></td>
                    <td width="8%"></td>
                    <td></td>
                </tr>
                <tbody id="ajaxtable"></tbody>
            </table>
<script language="JavaScript">
var attachs = {{$attach}};
oldAtt.init();
</script>
        </div>
    </th>
</tr>
<!--
EOT;
}
$shortcut=$_GET['s']?'':'tr3';

if($db_allowupload && $_G['allowupload']){print <<<EOT
-->
<tr class="$shortcut">
    <td style="padding-top:0;" colspan="2">
<!--
EOT;
$shortcut=$_GET['s']?' style="display:none"':'';
print <<<EOT
-->
        <table class="tr_p10">
            <tr valign="top">
                <td height="24" style="padding-right:3em" width="35%">上传图片附件</td>
                <td width="20%">描述</td>
                <td width="10%"></td>
                <td width="10%"></td>
                <td width="8%"></td>
                <td></td>
            </tr>
            <tbody id="attach"></tbody>
        </table>
        <div id="viewimg" class="menu" style="display:none;"></div>
        <div id="attsize" $shortcut style="margin-top:10px">有效文件类型:$uploadfilesize</div>
    </td>
</tr>
<script language="JavaScript">
newAtt.create();
</script>
<!--
EOT;
}print <<<EOT
-->
<!--
EOT;
if ($o_diary_gdcheck) {print <<<EOT
-->
                <tr class="tr3 vt">
                    <td class="tar">认证码:</td>
                    <td>
                        <input class="input" onfocus="showCK();" type="text" name="gdcode" id="gdcode" size="5" tabindex="3"  />
<img id="ckcode" style=" vertical-align:bottom;cursor:pointer;display:none;margin-top:0px;border:1px solid #ccc;" onclick="this.src='ck.php?nowtime='+new Date().getTime();" alt="看不清楚，换一张" />
                    </td>
                </tr>
<script type="text/javascript" LANGUAGE="JavaScript" src="js/core/core.js"></script>	

<!--
EOT;
}if($o_diary_qcheck){print <<<EOT
-->
                <tr class="tr3">
                    <td class="tar">验证问答:</td>
                    <td>
                    {$db_question[$qkey]} （正确答案:{$db_answer[$qkey]}）
                    <input class="input" name="qanswer" id="qanswer" size="25" tabindex="7" />
                    <input type="hidden" name="qkey" id="qkey" value="$qkey" />
                    </td>
                </tr>
<!--
EOT;
}print <<<EOT
-->
                <tr>
                    <td>&nbsp;</td>
                    <td>
                    <div class="mt10"><span class="button"><span><button name="Submit" type="submit">提 交</button></span></span></div>
                    </td>
                </tr>
            </table>
			</div>
			</form>
    </div>
<!--
EOT;
if($a == 'edit'){print <<<EOT
-->
<script language="JavaScript">setTimeout("editor.gotoEnd();",50);</script>
<!--
EOT;
}else{print <<<EOT
-->
<script language="JavaScript">setTimeout("document.FORM.atc_title.focus()",50);</script>
<!--
EOT;
}print <<<EOT
-->
<script language="JavaScript">var stylepath = 'wind';</script>
<!--
EOT;
if(R_P!=D_P){
$facedb = readover(D_P.'data/bbscache/face.js');
print <<<EOT
-->
<script language="javascript">
{$facedb}
</script>
<!--
EOT;
}else{print <<<EOT
-->
<script language="JavaScript" src="data/bbscache/face.js"></script>
<!--
EOT;
}print <<<EOT
-->
<script language="JavaScript">
editor.init();
var cnt  = 0;
document.FORM.Submit.disabled = false;
function checkpost(obj) {
	if (obj.atc_title.value == "") {
		showDialog("error","标题不能为空",2);
		obj.atc_title.focus();
		return false;
	} else if (strlen(obj.atc_title.value) > $db_titlemax) {
		showDialog("error","标题超过最大长度 $db_titlemax 个字节",2);
		obj.atc_title.focus();
		return false;
	}
	if (strlen(obj.atc_content.value) < $db_postmin) {
		showDialog("error","文章内容少于 $db_postmin 个字节",2);
		editor.focusEditor();
		return false;
	} else if (strlen(obj.atc_content.value) > $db_postmax) {
		showDialog("error","文章内容大于 $db_postmax 个字节",2);
		editor.focusEditor();
		return false;
	}
	//过滤检测上传图片
	var a = /\[url=(\d)\]/gmi.exec(obj.atc_content.value);
	for(var i=1;i<a.length;i++)
	{
		if(getObj('attachment_'+a[i]).value=='')
			obj.atc_content.value=obj.atc_content.value.replace(new RegExp('\\\\[url='+a[i]+'\]','gm'),'');
	}
	document.FORM.Submit.disabled = true;
	cnt++;
	if (cnt != 1) {
		showDialog("warning","Submission Processing. Please Wait");
		return false;
	}
	return true;
}
</script>
<script language="JavaScript" src="js/post.js"></script>
<!--
EOT;
}print <<<EOT
-->
<script language="JavaScript" src="apps/$appdir/js/diarytype.js"></script>
<script language="JavaScript" src="js/app_comment.js"></script>
<script language="javascript">
var ifcheck = true;
function CheckAll(form,match) 
{
	for (var j = 0; j < form.length; j++) {
		for (var i = 0; i < form[j].elements.length; i++) {
			var e = form[j].elements[i];
			if (e.type == 'checkbox' && (typeof match == 'undefined' || e.name.match(match))) {
				e.checked = ifcheck;
			}
		}
	}
	ifcheck = ifcheck == true ? false : true;
}
</script>
<!--
EOT;
if((empty($a) || $a == 'privacy' || $a == 'friend') && !empty($sum)) {print <<<EOT
-->
<script language="javascript">
// JavaScript Document
var imgMaxWidth=450; //控制内容中图片大小
var content = document.getElementById("img-width");
M_DIARY_CTRL="ctrl+鼠标滚轮缩放";
</script>
<SCRIPT type="text/javascript" LANGUAGE="JavaScript" src="js/core/space.js"></SCRIPT>
<!--
EOT;
}print <<<EOT
-->
</div>
<!--
EOT;
?>-->
<script type="text/javascript">
var ld=window.onload;
/*
 *重定义插入链接的方法，这个地方用到的是完整的编辑器
 */
 /*
window.onload=function()
{
if(ld)
{
ld();
}
addlink=function (){
	var s = getObj('linkmode').firstChild.cloneNode(true);
	var linknum = ++editor._linknum;
	var tags = s.getElementsByTagName('input');
	for (var i=0;i<tags.length;i++) {
		if (tags[i].id == 'linkdiscrip') {
			tags[i].id = 'linkdiscrip' + linknum;
		}
		if (tags[i].id == 'linkaddress') {
			tags[i].id = 'linkaddress' + linknum;
		}
	}
	getObj('linkbody').appendChild(s);
};

insertlink=function (){
	try{editor.setpos();}catch(e){}
	var AddTxt = '';
	var downadd = '';
	var linknum = editor._linknum;
	if (document.getElementsByName('linktype')[1].checked == true) {
		downadd = ',1'
	}
	for (var i=1;i<=linknum;i++) {
		if (getObj('linkdiscrip'+i).value.length == 0 && getObj("linkaddress"+i).value == 'http://') continue;
		if (getObj('linkdiscrip'+i).value){
			AddTxt += "[url=" + encodeURI(getObj("linkaddress"+i).value) + downadd +"]" + getObj("linkdiscrip"+i).value + "[/url]";
		} else {
			AddTxt += "[url=" + encodeURI(getObj("linkaddress"+i).value) + downadd +"]" + getObj("linkaddress"+i).value + "[/url]";
		}
	}
	if (editor._editMode=='wysiwyg') {
		AddTxt = codetohtml(AddTxt);
	}
	AddCode(AddTxt,'');
	editor._linknum = 1;
	closep();
};
};
*/
/*增加一标识，用于ie6，在页面未记载完成时操作的判断*/
/*
var IE6=navigator.userAgent.indexOf("MSIE 7.0")==-1&&navigator.userAgent.indexOf("MSIE 8.0")==-1&&navigator.userAgent.indexOf("MSIE 6.0")>0;
if(IE6)
{
var wl=window.onload;
window.onload=function()
{
	wl?wl():0;
	WINDOW_LOADED=1;
	$("wy_windcode")?($("wy_windcode").disabled=false)&($("wy_htmlmode").disabled=false):0;
};
}
else
{
	WINDOW_LOADED=1;
	$("wy_windcode")?($("wy_windcode").disabled=false)&($("wy_htmlmode").disabled=false):0;
}
*/
</script>