// 上传授权
var boxy_lic;
function license_upload(){
	var con = "<iframe src='admin_uploadLicense.aspx' style='height:100%;width:100%'  frameborder='0'></iframe>";
	if (boxy_lic){
		boxy_lic.toggle();
	}else{
		boxy_lic=new Boxy(con,{title:'上传授权'});
		boxy_lic.resize(430,160);
	}
}

// 刷新授权
function license_refresh(ele){
	$.post('admin_uploadLicense.aspx',{act:'ajax',cmd:'refresh'},function(r){
		if(r.success){
			iwms.popMsg('refreshLic',ele,"授权已刷新成功！");
			iwms.hideMsg('refreshLic',5000);
		}
	},'json');

}

// 设置首页头条简介窗口
function OpenHeadlineSummary(){
	var con = "<textarea id='headlineSummary' class='mceHeadlineSummary'></textarea>";
	var b=boxys.hsummary;
	if (b){
		b.toggle();
	}else{
		b=new Boxy(con,{title:'设置首页头条简介'});
		boxys.hsummary=b;
		b.resize(530,150);
		$.post('admin_articleadd.aspx',{act:'ajax',cmd:'getHSummary'},function(r){
		//	alert(r);
			$('#headlineSummary').val(r);
			var tinysetHSummary=CloneObj(tinyset);
			tinysetHSummary.editor_selector="mceHeadlineSummary";
			tinysetHSummary.plugins="preview,media,inlinepopups,save,fullscreen";
			tinysetHSummary.theme_advanced_buttons2="";
			tinysetHSummary.theme_advanced_buttons3="";
			tinysetHSummary.theme_advanced_buttons1_add_before="save,|,undo,redo,|";
			tinysetHSummary.theme_advanced_buttons1_add="forecolor,backcolor,fontsizeselect,removeformat,|,fullscreen,link,unlink,image,media,preview,code,help";
			tinysetHSummary.theme_advanced_disable="styleselect,formatselect,justifyfull,strikethrough";
			tinysetHSummary.save_onsavecallback= "SetHeadlineSummary";
			tinysetHSummary.swfupload_sys=true;
			var ed=new tinymce.Editor('headlineSummary',tinysetHSummary);
			ed.render();
		});
	}
}

// 保存首页头条简介的修改
function SetHeadlineSummary(){
	$.post('admin_articleadd.aspx',{act:'ajax',cmd:'setHSummary',summary:iwms.ajEncode($('#headlineSummary').val())});
	OpenHeadlineSummary();
}
