<form method="post" name="form1" action="<?php if(front::$act=='edit') $id="/id/".$data[$primary_key]; else $id=''; echo modify("/act/".front::$act."/table/".$table.$id);?>"  onsubmit="return checkform();">
<input type="hidden" name="onlymodify" value=""/>


    <script type="text/javascript" src="{$base_url}/common/js/ajaxfileupload.js"></script>
    <script type="text/javascript" src="{$base_url}/common/js/jquery.imgareaselect.min.js"></script>
    <script type="text/javascript" src="{$base_url}/common/js/ThumbAjaxFileUpload.js"></script>
    <script type="text/javascript" src="{$base_url}/common/swfupload/swfupload.js"></script>
    <script type="text/javascript" src="{$base_url}/common/swfupload/swfupload.queue.js"></script>
    <script type="text/javascript" src="{$base_url}/common/swfupload/fileprogress.js"></script>
    <script type="text/javascript" src="{$base_url}/common/swfupload/handlers.js"></script>

<script>
function attachment_delect(id) {
$.ajax({
url: '<?php echo url('tool/deleteattachment/site/'.front::get('site'),false)?>&id='+id,
type: 'GET',
dataType: 'text',
timeout: 1000,
error: function(){
//	alert('Error loading XML document');
},
success: function(data){
document.form1.attachment_id.value=0;
get('attachment_path').innerHTML='';
get('file_info').innerHTML='';
}
});
}
</script>
<script type="text/javascript">
    $(document).ready(function(){
        var swfu;
        var settings = {
            flash_url : "{$base_url}/common/swfupload/swfupload.swf",
            upload_url: "{url('tool/uploadimage/site/'.front::get('site'),false)}",
            post_params: {"PHPSESSID" : "<?php echo session_id(); ?>"},
            file_size_limit : "{ini_get('upload_max_filesize')}B",
            file_types : "*.jpg;*.gif;*.png;*.bmp",
            file_types_description : "图片", //All Files
            file_upload_limit : 100,
            file_queue_limit : 0,
            custom_settings : {
progressTarget : "fsUploadProgress",
cancelButtonId : "btnCancel"
            },
            debug: false,

            // Button settings
            //button_image_url: "",
            button_width: "141",
            button_height: "41",
            button_placeholder_id: "spanButtonPlaceHolder",
            button_text: '<span class="theFont"></span>',
            //button_text_style: ".theFont{clear:both;colro:#9999;font-size:12px;width:141px;height:41px;line-height:41px;}",
            //button_text_left_padding: 7,
            //button_text_top_padding: 5,
            button_disabled : false,
            button_window_mode: SWFUpload.WINDOW_MODE.TRANSPARENT,
            button_cursor: SWFUpload.CURSOR.HAND,

            // The event handler functions are defined in handlers.js
            file_queued_handler : fileQueued,
            file_queue_error_handler : fileQueueError,
            file_dialog_complete_handler : fileDialogComplete,
            upload_start_handler : uploadStart,
            upload_progress_handler : uploadProgress,
            upload_error_handler : uploadError,
            upload_success_handler : uploadSuccess,
            upload_complete_handler : uploadComplete,
            queue_complete_handler : queueComplete	// Queue plugin event
        };

        swfu = new SWFUpload(settings);
    });
</script>

<div class="tags">
<div id="tagstitle">
<a href="#" id="one1" onclick="setTab('one',1,6)" class="hover">基本信息</a>
<a href="#" id="one2" onclick="setTab('one',2,6)">SEO信息</a>
<a href="#" id="one3" onclick="setTab('one',3,6)">属性设置</a>
<a href="#" id="one4" onclick="setTab('one',4,6)">扩展信息</a>
<a href="#" id="one5" onclick="setTab('one',5,6)">权限审核</a>
</div>
<div id="tagscontent" class="right_box">
<div id="con_one_1">
    
<table width="100%" border="0" cellspacing="0" cellpadding="0" id="table1">
<tr>
<td width="19%" align="right">所属栏目</td>
<td width="1%">&nbsp;</td>
<td width="70%">{form::getform('parentid',$form,$field,$data)}
<span class="hotspot" onmouseover="tooltip.show('如果为一级栏目，不需选择！');" onmouseout="tooltip.hide();"><img src="{$skin_path}/images/remind.gif" alt="" width="14" height="20"  style="margin-left:10px; margin-right:5px;"></span
></td>
</tr>

<tr>
<td width="19%" align="right">栏目名称</td>
<td width="1%">&nbsp;</td>
<td width="70%">{form::getform('catname',$form,$field,$data,'class="input"')}
<span class="hotspot" onmouseover="tooltip.show('填写网站栏目名称！');" onmouseout="tooltip.hide();"><img src="{$skin_path}/images/remind.gif" alt="" width="14" height="20"  style="margin-left:10px; margin-right:5px;"></span>
</td>
</tr>


<tr>
<td width="19%" align="right">目录名称</td>
<td width="1%">&nbsp;</td>
<td width="70%">
{form::getform('htmldir',$form,$field,$data,'123 class="input"')}
<span class="hotspot" onmouseover="tooltip.show('目录必须是英文名，留空则自动使用拼音名');" onmouseout="tooltip.hide();"><img src="{$skin_path}/images/remind.gif" alt="" width="14" height="20"  style="margin-left:10px; margin-right:5px;"></span>
</td>
</tr>

<tr>
<td width="19%" align="right">在导航中显示</td>
<td width="1%">&nbsp;</td>
<td width="70%">{form::getform('isnav',$form,$field,$data)}
<span class="hotspot" onmouseover="tooltip.show('如果是一级目录，可选择是否在导航中显示栏目名称和链接！');" onmouseout="tooltip.hide();"><img src="{$skin_path}/images/remind.gif" alt="" width="14" height="20"  style="margin-left:10px; margin-right:5px;"></span>
</td>
</tr>

</table>
</div>

<div id="con_one_2" style="display:none">
<table width="100%" border="0" cellspacing="0" cellpadding="0" id="table2">
<tr>
<td width="19%" align="right">网页标题</td>
<td width="1%">&nbsp;</td>
<td width="70%">	
{form::getform('meta_title',$form,$field,$data,'class="input"')}
<span class="hotspot" onmouseover="tooltip.show('可填写不同于内容名称的关键词，有利于搜索优化！');" onmouseout="tooltip.hide();"><img src="{$skin_path}/images/remind.gif" alt="" width="14" height="20"  style="margin-left:10px; margin-right:5px;"></span>
</td>
</tr>

<tr>
<td width="19%" align="right">关键词</td>
<td width="1%">&nbsp;</td>
<td width="70%">
{form::getform('keyword',$form,$field,$data,'class="input"')}
<span class="hotspot" onmouseover="tooltip.show('网页META信息中的keywords信息，可填写与内容相关的关键词，以英文逗号相隔，有利于搜索优化！');" onmouseout="tooltip.hide();"><img src="{$skin_path}/images/remind.gif" alt="" width="14" height="20"  style="margin-left:10px; margin-right:5px;"></span>
</td>
</tr>

<tr>
<td width="19%" align="right">页面描述</td>
<td width="1%">&nbsp;</td>
<td width="70%">
{form::getform('description',$form,$field,$data,'')}
<span class="hotspot" onmouseover="tooltip.show('网页META信息中的description信息，可填写与内容相关的简介，有利于搜索优化！');" onmouseout="tooltip.hide();"><img src="{$skin_path}/images/remind.gif" alt="" width="14" height="20"  style="margin-left:10px; margin-right:5px;"></span>
</td>
</tr>

<tr>
<td colspan="3" align="left">&nbsp;&nbsp;URL规则</td>
</tr>

<tr>
<td width="19%" align="right">当前栏目列表</td>
<td width="1%">&nbsp;</td>
<td width="70%">
{form::getform('htmlrule',$form,$field,$data,'')}
<span class="hotspot" onmouseover="tooltip.show('<strong>默&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;认：</strong>&#123;$caturl&#125;/&#123;$page&#125;.html <br /><strong>短&nbsp;&nbsp;目&nbsp;&nbsp;录：</strong>&#123;$dir&#125/&#123;$page&#125;.html<br /><strong>自&nbsp;&nbsp;定&nbsp;&nbsp;义：</strong>自定义（英文或拼音）/&#123;$page&#125;.html<br /><strong>栏目目录：</strong>&#123;$caturl&#125;<br /><strong>当前目录：</strong>&#123;$dir&#125;<br /><strong>注&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;意：</strong>&#123;$page&#125;必须存在URL内且为最后！');" onmouseout="tooltip.hide();"><img src="{$skin_path}/images/remind.gif" alt="" width="14" height="20"  style="margin-left:10px; margin-right:5px;"></span>		
</td>
</tr>

<tr>
<td width="19%" align="right">所属子栏目</td>
<td width="1%">&nbsp;</td>
<td width="70%">
{form::getform('listhtmlrule',$form,$field,$data,'')}
<span class="hotspot" onmouseover="tooltip.show('<strong>默&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;认：</strong>&#123;$caturl&#125;/&#123;$page&#125;.html <br /><strong>短&nbsp;&nbsp;目&nbsp;&nbsp;录：</strong>&#123;$dir&#125/&#123;$page&#125;.html<br /><strong>自&nbsp;&nbsp;定&nbsp;&nbsp;义：</strong>自定义（英文或拼音）/&#123;$page&#125;.html<br /><strong>栏目目录：</strong>&#123;$caturl&#125;<br /><strong>当前目录：</strong>&#123;$dir&#125;<br /><strong>注&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;意：</strong>&#123;$page&#125;必须存在URL内且为最后！');" onmouseout="tooltip.hide();"><img src="{$skin_path}/images/remind.gif" alt="" width="14" height="20"  style="margin-left:10px; margin-right:5px;"> </span>
</td>
</tr>

<tr>
<td width="19%" align="right">所属内容页</td>
<td width="1%">&nbsp;</td>
<td width="70%">
{form::getform('showhtmlrule',$form,$field,$data,'class=""')}
<span class="hotspot" onmouseover="tooltip.show('<strong>默&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;认：</strong>&#123;$caturl&#125;/show_&#123;$aid&#125;(_&#123;$page&#125;).html<br /><strong>短&nbsp;&nbsp;目&nbsp;&nbsp;录：</strong>&#123;$dir&#125/show_&#123;$aid&#125;(_&#123;$page&#125;).html<br /><strong>自&nbsp;&nbsp;定&nbsp;&nbsp;义：</strong>自定义（英文或拼音）/&#123;$page&#125;.html<br /><strong>栏目目录：</strong>&#123;$caturl&#125;<br /><strong>当前目录：</strong>&#123;$dir&#125;<br /><strong>注&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;意：</strong>&#123;$page&#125;必须存在URL内且为最后！');" onmouseout="tooltip.hide();"><img src="{$skin_path}/images/remind.gif" alt="" width="14" height="20"  style="margin-left:10px; margin-right:5px;"></span>
</td>
</tr>
</table>
</div>

<div id="con_one_3" style="display:none">
<table width="100%" border="0" cellspacing="0" cellpadding="0" id="table3">
<tr>
<td width="19%" align="right">当前使用模板</td>
<td width="1%">&nbsp;</td>
<td width="70%">
{form::getform('template',$form,$field,$data)}
<span class="hotspot" onmouseover="tooltip.show('当前栏目应用的模板样式！');" onmouseout="tooltip.hide();">
<img src="{$skin_path}/images/remind.gif" alt="" width="14" height="20"  style="margin-left:10px; margin-right:5px;">
</span>
</td>
</tr>

<tr>
<td width="19%" align="right">所属列表模板</td>
<td width="1%">&nbsp;</td>
<td width="70%">
{form::getform('listtemplate',$form,$field,$data)}
<span class="hotspot" onmouseover="tooltip.show('栏目下属子级栏目应用模板样式！');" onmouseout="tooltip.hide();">
<img src="{$skin_path}/images/remind.gif" alt="" width="14" height="20"  style="margin-left:10px; margin-right:5px;">
</span>
</td>
</tr>

<tr>
<td width="19%" align="right">所属内容模板</td>
<td width="1%">&nbsp;</td>
<td width="70%">
{form::getform('showtemplate',$form,$field,$data)}
<span class="hotspot" onmouseover="tooltip.show('栏目下属内容页模板样式！');" onmouseout="tooltip.hide();">
<img src="{$skin_path}/images/remind.gif" alt="" width="14" height="20"  style="margin-left:10px; margin-right:5px;">
</span>
</td>
</tr>

<tr>
<td width="19%" align="right">是否启用</td>
<td width="1%">&nbsp;</td>
<td width="70%">{form::getform('isshow',$form,$field,$data)}
<span class="hotspot" onmouseover="tooltip.show('选择栏目是否启用！');" onmouseout="tooltip.hide();">
<img src="{$skin_path}/images/remind.gif" alt="" width="14" height="20"  style="margin-left:10px; margin-right:5px;">
</span>
</td>
</tr>

<tr>
<td width="19%" align="right">动静态设置</td>
<td width="1%">&nbsp;</td>
<td width="70%">{form::getform('ishtml',$form,$field,$data)}
<span class="hotspot" onmouseover="tooltip.show('选择栏目是否生成静态，如设置了浏览与下载权限，栏目必须为动态显示！<br />默认为继承网站动静态设置！');" onmouseout="tooltip.hide();">
<img src="{$skin_path}/images/remind.gif" alt="" width="14" height="20"  style="margin-left:10px; margin-right:5px;">
</span>
</td>
</tr>

<tr>
<td width="19%" align="right">分页设置</td>
<td width="1%">&nbsp;</td>
<td width="70%">{form::getform('ispages',$form,$field,$data)}
<span class="hotspot" onmouseover="tooltip.show('选择栏目是否分页显示！');" onmouseout="tooltip.hide();">
<img src="{$skin_path}/images/remind.gif" alt="" width="14" height="20"  style="margin-left:10px; margin-right:5px;">
</span>
</td>
</tr>

<tr>
<td width="19%" align="right">分页值</td>
<td width="1%">&nbsp;</td>
<td width="70%">{form::getform('attr3',$form,$field,$data,'class="input_c"')}
<span class="hotspot" onmouseover="tooltip.show('留空按全局设置数量显示！');" onmouseout="tooltip.hide();">
<img src="{$skin_path}/images/remind.gif" alt="" width="14" height="20"  style="margin-left:10px; margin-right:5px;">
</span>
</td>
</tr>

<tr>
<td width="19%" align="right">子内容设置</td>
<td width="1%">&nbsp;</td>
<td width="70%">{form::getform('includecatarchives',$form,$field,$data)}
<span class="hotspot" onmouseover="tooltip.show('选择栏目列表中是否包含下属栏目中的内容！');" onmouseout="tooltip.hide();">
<img src="{$skin_path}/images/remind.gif" alt="" width="14" height="20"  style="margin-left:10px; margin-right:5px;">
</span>
</td>
</tr>

<tr>
<td width="19%" align="right">外部链接</td>
<td width="1%">&nbsp;</td>
<td width="70%">{form::getform('linkto',$form,$field,$data,'class="input"')}
<span class="hotspot" onmouseover="tooltip.show('填写外部链接地址后，访问栏目将跳转到填写的地址！');" onmouseout="tooltip.hide();">
<img src="{$skin_path}/images/remind.gif" alt="" width="14" height="20"  style="margin-left:10px; margin-right:5px;">
</span>
</td>
</tr>
</table>
</div>

<div id="con_one_4" style="display:none">
<table width="100%" border="0" cellspacing="0" cellpadding="0" id="table4">
<tr>
<td width="19%" align="right">封面内容</td>
<td width="1%">&nbsp;</td>
<td width="70%">
{form::getform('categorycontent',$form,$field,$data)} 
<span class="hotspot" onmouseover="tooltip.show('如使用设置栏目封面，请在模板处选择本栏目应用list_page.html模板！');" onmouseout="tooltip.hide();">
<img src="{$skin_path}/images/remind.gif" alt="" width="14" height="20"  style="margin-left:10px; margin-right:5px;">
</span>
<div style="width: 575px;margin-top: 0px;">
<div class="fieldset flash" id="fsUploadProgress">
    <span class="legend"></span>
</div>
<div id="divStatus"></div>

            </div>
							<div class="blank30"></div>
</td>
</tr>

<tr>
<td width="19%" align="right">栏目说明图片</td>
<td width="1%">&nbsp;</td>
<td width="70%">

{form::getform('image',$form,$field,$data)}


<span class="hotspot" onmouseover="tooltip.show('栏目banner功能,需在模板中调用显示！');" onmouseout="tooltip.hide();">
<img src="{$skin_path}/images/remind.gif" alt="" width="14" height="20"  style="margin-left:10px; margin-right:5px;">
</span>
</td>
</tr>

<tr>
<td width="19%" align="right">缩略图大小</td>
<td width="1%">&nbsp;</td>
<td width="70%">{form::input('thumb_width',$data['thumb_width'],'size="5" class="input_c"')} px × {form::input('thumb_height',$data['thumb_height'],'size="5" class="input_c"')} px
<span class="hotspot" onmouseover="tooltip.show('默认: {type::getwidthofthumb(get('id'))} px × {type::getheightofthumb(get('id'))} px！');" onmouseout="tooltip.hide();">
<img src="{$skin_path}/images/remind.gif" alt="" width="14" height="20"  style="margin-left:10px; margin-right:5px;">
</span>
</td>
</tr>
</table>
</div>  

<div id="con_one_5" style="display:none">
<table border="0" cellspacing="0" cellpadding="0" id="table5" width="100%">
<thead>
<tr class="th">
<th width="38%">会员组</th>
<th  width="30%">浏览</th>
<th  width="30%">下载</th>
</tr>
<thead>
<tbody>
{loop usergroup::getInstance()->group $group}
<?php if($group['groupid']=='888') continue; ?>
<tr>
<td align="center">{$group.name}</td>
<td align="center">{form::checkbox("_ranks[".$group['groupid']."][view]",-1, @$data['_ranks'][$group['groupid']]['view'])}</td>
<td align="center">{form::checkbox("_ranks[".$group['groupid']."][down]",-1, @$data['_ranks'][$group['groupid']]['down'])}</td>
</tr>
</tbody>
{/loop}
</table>
<div class="blank30"></div>
<img src="{$skin_path}/images/remind.gif" alt="" width="14" height="20"  style="margin-left:10px; margin-right:5px;"> &nbsp;注意：勾选为该用户组禁止浏览或下载
</div>
</div>
</div>

<input type="submit" name="submit" value=" 提交 " class="btn_a" />
</form>
<script>

var isIE = (document.all) ? true : false;

var isIE6 = isIE && ([/MSIE (\d)\.0/i.exec(navigator.userAgent)][0][1] == 6);

var BoxObj = function (id) {
	return "string" == typeof id ? document.getElementById(id) : id;
};

var Class = {
	create: function() {
		return function() { this.initialize.apply(this, arguments); }
	}
}

var Extend = function(destination, source) {
	for (var property in source) {
		destination[property] = source[property];
	}
}

var Bind = function(object, fun) {
	return function() {
		return fun.apply(object, arguments);
	}
}

var Each = function(list, fun){
	for (var i = 0, len = list.length; i < len; i++) { fun(list[i], i); }
};

var Contains = function(a, b){
	return a.contains ? a != b && a.contains(b) : !!(a.compareDocumentPosition(b) & 16);
}


var OverLay = Class.create();
OverLay.prototype = {
  initialize: function(options) {

	this.SetOptions(options);

	this.Lay = BoxObj(this.options.Lay) || document.body.insertBefore(document.createElement("div"), document.body.childNodes[0]);

	this.Color = this.options.Color;
	this.Opacity = parseInt(this.options.Opacity);
	this.zIndex = parseInt(this.options.zIndex);

	with(this.Lay.style){ display = "none"; zIndex = this.zIndex; left = top = 0; position = "fixed"; width = height = "100%"; }

	if(isIE6){
		this.Lay.style.position = "absolute";
		this._resize = Bind(this, function(){
			this.Lay.style.width = Math.max(document.documentElement.scrollWidth, document.documentElement.clientWidth) + "px";
			this.Lay.style.height = Math.max(document.documentElement.scrollHeight, document.documentElement.clientHeight) + "px";
		});
		this.Lay.innerHTML = '<iframe style="position:absolute;top:0;left:0;width:100%;height:100%;filter:alpha(opacity=0);"></iframe>'
	}
  },
  SetOptions: function(options) {
    this.options = {
		Lay:		null,
		Color:		"#000",
		Opacity:	50,
		zIndex:		1000
    };
    Extend(this.options, options || {});
  },
  Show: function() {
	if(isIE6){ this._resize(); window.attachEvent("onresize", this._resize); }

	with(this.Lay.style){
		isIE ? filter = "alpha(opacity:" + this.Opacity + ")" : opacity = this.Opacity / 100;
		backgroundColor = this.Color; display = "block";
	}
  },
  Close: function() {
	this.Lay.style.display = "none";
	if(isIE6){ window.detachEvent("onresize", this._resize); }
  }
};



var LightBox = Class.create();
LightBox.prototype = {
  initialize: function(box, options) {

	this.Box = BoxObj(box);

	this.OverLay = new OverLay(options);

	this.SetOptions(options);

	this.Fixed = !!this.options.Fixed;
	this.Over = !!this.options.Over;
	this.Center = !!this.options.Center;
	this.onShow = this.options.onShow;

	this.Box.style.zIndex = this.OverLay.zIndex + 1;
	this.Box.style.display = "none";


	if(isIE6){
		this._top = this._left = 0; this._select = [];
		this._fixed = Bind(this, function(){ this.Center ? this.SetCenter() : this.SetFixed(); });
	}
  },
  SetOptions: function(options) {
    this.options = {
		Over:	true,
		Fixed:	true,
		Center:	true,
		onShow:	function(){}
	};
    Extend(this.options, options || {});
  },
  SetFixed: function(){
	this.Box.style.top = document.documentElement.scrollTop - this._top + this.Box.offsetTop + "px";
	this.Box.style.left = document.documentElement.scrollLeft - this._left + this.Box.offsetLeft + "px";

	this._top = document.documentElement.scrollTop; this._left = document.documentElement.scrollLeft;
  },
  SetCenter: function(){
	this.Box.style.marginTop = document.documentElement.scrollTop - this.Box.offsetHeight / 2 + "px";
	this.Box.style.marginLeft = document.documentElement.scrollLeft - this.Box.offsetWidth / 2 + "px";
  },
  Show: function(options) {
	  if('image' == options){ $("#d_idBoxSure").attr('alt','image');}
	  if('undefined' == typeof(options)){ $("#d_idBoxSure").attr('alt','content');}
	this.Box.style.position = this.Fixed && !isIE6 ? "fixed" : "absolute";

	this.Over && this.OverLay.Show();

	this.Box.style.display = "block";

	if(this.Center){
		this.Box.style.top = this.Box.style.left = "50%";
		if(this.Fixed){
			this.Box.style.marginTop = - this.Box.offsetHeight / 2 + "px";
			this.Box.style.marginLeft = - this.Box.offsetWidth / 2 + "px";
		}else{
			this.SetCenter();
		}
	}

	if(isIE6){
		if(!this.Over){
			this._select.length = 0;
			Each(document.getElementsByTagName("select"), Bind(this, function(o){
				if(!Contains(this.Box, o)){ o.style.visibility = "hidden"; this._select.push(o); }
			}))
		}
		this.Center ? this.SetCenter() : this.Fixed && this.SetFixed();
		this.Fixed && window.attachEvent("onscroll", this._fixed);
	}

	this.onShow();
  },
  Close: function() {
	this.Box.style.display = "none";
	this.OverLay.Close();
	if(isIE6){
		window.detachEvent("onscroll", this._fixed);
		Each(this._select, function(o){ o.style.visibility = "visible"; });
	}
  }
};

</script>
<div id="idBox" class="lightbox">
<input name="" type="button" value="" id="idBoxCancel" />

		<div class="box_nav">
		   <a href="javascript:void(0)" class="box_nav_on">本地上传</a>
		   <a href="javascript:void(0)" class="box_nav_out">图库选择</a>
		   <a href="javascript:void(0)" class="box_nav_out">网络图片</a>
		</div>
		<div class="box_con">
		   <div id="box_con_0" class="box_main">
				<div style="width:141px;margin:0px auto;padding-top:135px;">
				<span id="spanButtonPlaceHolder"></span>
				<input id="btnCancel" type="button" value="取消" disabled="disabled" style="display:none;" />
		</div>
		    </div>
		   <div id="box_con_1" class="box_main">
		       <div style="margin-left:10px;">
			      <span style="font-size:12px;color:#3e4558;">选择图库：</span>
			      <select name="img_dir" id="image_select">
				      <option value="default">请选择图库</option>
                     {loop $image_dir $k $v}
					  <option value="{$v}">{$v}</option>
					  {/loop}
			      </select>
</div>
			   <div id="image_show" class="image_show" style="clear:both; width:638px;height:230px;margin:10px;overflow:auto; overflow-x:hidden;">
				</div>
<div style="margin-left:10px;">
			       <input type="button" alt="content" class="btn_e" value="确定" id="d_idBoxSure"/>
				   <input type="button" class="btn_d" value="取消" id="d_idBoxCancel"/>
				   </div>
		   </div>
		   <div id="box_con_2"  class="box_main">
              <div style="margin:0px auto;width:300px;padding-top:65px;">
			   请输入图片地址:
			   <input type="text" name="network_image_url" id="network_image_url" value="" style="clear:both; width:285px;font-size:14px;margin:10px 0px;line-height:22px;height:22px;"/>
			   <input type="button" name="net_idBoxSure" alt="content" class="btn_e" id="net_idBoxSure" value="添加"/>
			   </div>
		   </div>
		</div>

</div>
<script>

var box = new LightBox("idBox");

BoxObj("idBoxCancel").onclick = function(){ box.Close(); }
BoxObj("d_idBoxCancel").onclick = function(){ box.Close(); }
BoxObj("image_upload").onclick = function(){ box.Show('image'); }
$('#idBoxCancel').mouseover(function(){
    $(this).css('opacity','0.5');
}).mouseout(function(){
    $(this).css('opacity','1');
});
$(".box_nav > a").click(function(){
    $(".box_nav > a").each(function(){
	    $(this).removeClass('box_nav_on');

	});
	$(this).addClass('box_nav_on');

	$(".box_con > div").each(function(){
	    $(this).css('display','none');
	});
	switch($(this).text()){
	     case '本地上传':
		    $("#box_con_0").css('display','block');break;
		 case '图库选择':
		    $("#box_con_1").css('display','block');break;
	     case '网络图片':
		    $("#box_con_2").css('display','block');break;
	}
});

$("#image_select").change(function(){
    if($(this).val() == 'default') return;
    $("#image_show").load('index.php?case=table&act=add&table=archive&admin_dir=admin&site=default&ajax='+$(this).val());

});

function select_img(name){
   var obj = $("#"+name);
   var border = obj.css('border');
   if(border == 0){
      obj.css('border','2px solid red');
   }else{
      obj.css('border','');
   }
}
$(".box_button").mouseover(function(){
    $(this).css('background-color','#d9e7f5');
}).mouseout(function(){
    $(this).css('background-color','#F3F4F5');
});
$("#d_idBoxSure").click(function(){
   $(".image_show > img").each(function(){
       var border  = $(this).css('border');
	   if(border != 0){
		   if($("#d_idBoxSure").attr('alt') == 'image'){
			    $("#image").val($(this).attr("src"));
				image_preview('image',$(this).attr("src"));
		   }
		   if($("#d_idBoxSure").attr('alt') == 'content'){
	       		var url = 'http://<?php echo $_SERVER['HTTP_HOST'].config::get('base_url');?>/'+$(this).attr("src");
	       		getEditor('categorycontent').InsertHtml('<p><img src="'+url+'"/></p>');
		   }
		   $(this).css('border','');
	   }
   });
    box.Close();
});
$("#net_idBoxSure").click(function(){
   var val = $("#network_image_url").val();
   if(val.length < 4){
       alert('这不是一个有效的链接');
	   return false;
   }
   		   if($("#d_idBoxSure").attr('alt') == 'image'){
			    $("#image").val(val);
				image_preview('image',val);
		   }
		   if($("#d_idBoxSure").attr('alt') == 'content'){
	       		getEditor('categorycontent').InsertHtml('<p><img src="'+val+'"/></p>');
		   }
   box.Close();
});
</script>