
//通用选择删除条目（反选-全选）-------------
function CheckAll(form)
{
for (var i=0;i<form.elements.length;i++)
{
var e = form.elements[i];
if (e.name != 'chkall')
e.checked = form.chkall.checked;
}
}

function lhgs(fu,ft,fw,fh){
	$.dialog({
		content: 'url:'+fu,
		title: ft,		
		width: fw,
		height: fh,		
		lock: true,
		fixed: true,
		background: '#000',
		opacity: 0.5,
	});	
}
 
function trim(str){return str.replace(/(^\s*)|(\s*$)/g, "");} //删除左右两端的空格
function ltrim(str){return str.replace(/(^\s*)/g,"");} //删除左边的空格
function rtrim(str){return str.replace(/(\s*$)/g,"");} //删除右边的空格
function $Obj(objname){return document.getElementById(objname);}
function display(y){$Obj(y).style.display=($Obj(y).style.display=="none")?"":"none";}

function display2(obji){
var objn=3;
var objs='Info';
	for (i=1;i<=objn;i++){
		if (i==obji){
		$Obj(objs+i).style.display='block';
		}else{
		$Obj(objs+i).style.display='none';
		}	
	}
}

//创建编辑器--------------------------------
KindEditor.ready(function(K) {
	var editor = K.create('textarea[name="ItemNote"]', {
		uploadJson : '../inc/upload_json.asp',
		fileManagerJson : '../inc/file_manager_json.asp',
		allowFileManager : true
	});
});


function ajax_res(fid,ftext){
var lid=fid;
var ltext=ftext;
var tid='t'+lid;
var lstr="<li class='close'><img src='img/no.gif' width='12' onclick=\"$Obj('"+tid+"').className='hidden'\"></li>";
switch(lid){
	case 'cTel':
		//---special
	break;
	default:
		var atext=ltext.split('|');
		for (i=1;i<atext.length;i++){lstr+="<li onclick=\"$Obj('"+lid+"').value='"+trim(atext[i])+"';$Obj('"+tid+"').className='hidden'\"><a>"+trim(atext[i])+"</a></li>";}
		$Obj(tid).innerHTML = lstr;
		$Obj(tid).className = 'afloat';
	/*
	select example
	------------------
	lstr+="<select id='f"+lid+"' onchange=\"$Obj('"+lid+"').value=this.value\">";
	for (i=1;i<atext.length;i++){lstr+="<option value='"+atext[i]+"'>"+atext[i]+"</option>";}
	lstr+="</select>";
	*/
}
//alert(lstr);
}