<!--
var pos=null;
function killErr() {
	return true;
}
window.onerror=killErr;
function Trim() {
	return this.replace(/\s+$|^\s+/g,"");
}
String.prototype.Trim=Trim;
function F(id) {
	if(G(id).value!=undefined)
	return G(id).value.Trim();
	else
	return "";
}
function G(id) {
	if(document.getElementById) {
		return document.getElementById(id);
	}else if(document.all) {
		return document.all[id];
	}else if(document.layers) {
		return document.layers[id];
	}
}

function setPos(){ 
	if (document.all){
		document.myform.Content.focus();
		pos = document.selection.createRange();
	}else{
		pos = document.getElementById("Content").selectionStart;
	}
}

function InsertValue(str){
  	if (pos==null) {alert('请先定位要插入的位置!');return false;}
	if (document.all){
		pos.text=str;
	}else{
		var obj   = document.getElementById('Content');
		var lstr  = obj.value.substring(0,pos);
		var rstr  = obj.value.substring(pos);
		obj.value = lstr+str+rstr;
	}
}

function FunParam(){
	var obj = F('LabelParam');
	obj=obj.replace(/\，/g,",");
	var ParamName = "";
	if (obj!=''){
		var ParamNameArr=obj.split(",");
		for(var I=0;I<ParamNameArr.length;I++){
			 ParamName += "<li><a href='#' onclick='javascript:InsertValue(\"{$Param("+I+")}\");'>"+ParamNameArr[I]+"</a></li>";
		}
 	}
	if (ParamName!=''){
		G('ParamLabel').style.display = "";
		G("ParamLabel").innerHTML=ParamName;
	}else{
		G('ParamLabel').style.display = "none";
		G("ParamLabel").innerHTML="";
	}
	
}

function InsertFunctionLabel(id){ 
	if(pos==null) {alert('请先定位插入位置!');return false;}
	var Label = new Dialog();
	Label.Modal = false;
	Label.Width = 650;
	Label.Height= 480;
	Label.Title = "爱青檬CMS系统函数标签编辑器";
	Label.URL   = web_url+"/admin/label/write/?id="+id;
	Label.MessageTitle = "温馨提示：";
	Label.Message = "选择函数标签，按照文字提示设置调整相关参数；循环体标签需设置循环内容，将可选字段标签按需插入循环体。";
	Label.show();
}

function showdisplay(id,txt){
        if (txt == 1) {
	        G(id).style.display = "";
        }else{
	        G(id).style.display = "none";	        
        }
}

function InsertCustomValue(id){
	var htm0='';
	var htm1='<a href="" title="" target="_blank"></a>';
	var htm2='<img src="" width="" height="" alt="" />';
	if(id==1){
		InsertValue(htm1);
	}else if(id==2){
		InsertValue(htm2);
	}else{
		InsertValue(htm0);
	}
}
//========动画展开/关闭信息========
var fnqw=0,fnqh=0;
function emotion(id,w,h,t){
	if(fnqw <= 10){
		if(t==1){showCreateIconTree();} 	//打开时加载图标
		G(id).style.display = "block";
		fnLarge(id,w,h);
	}else{
		fnSmall(id,w,h);
	}
}
function fnLarge(id,w,h){
	if(fnqw < w){
		fnqw += w/10;
		fnqh += h/10;
		G(id).style.width = fnqw+"px";
		G(id).style.height = fnqh+"px";
		setTimeout("fnLarge('"+id+"',"+w+","+h+")",3);
	}
}
function fnSmall(id,w,h){
	if(fnqw > 0){
		fnqw -= w/10;
		fnqh -= h/10;
		G(id).style.width = fnqw+"px";
		G(id).style.height = fnqh+"px";
		setTimeout("fnSmall('"+id+"',"+w+","+h+")",3);
	}else{
		G(id).style.display = "none";
	}
}
-->
