
var xpow = new Object;xpow.m_cfg = new Array();xpow.m_cfg['cm']='';xpow.m_cfg['m_r']='m_r';
xpow.m_cfg['m_left']='m_left';xpow.m_cfg['quto']='?';xpow.m_cfg['dir']='/manage/';xpow.m_cfg['app']='.asp';xpow.m_cfg['apps']='.do';xpow.m_cfg['common_dir']='/common/xpow/';
xpow.m_cfg['l_pre']='mnu.';xpow.m_cfg['r_pre']='manage';xpow.m_cfg['CHECK_FROM']='listForm';xpow.m_cfg['LETTE']='abcdefghijklmnopqrstuvwxyz/.:?ξ$σ§ζABCDEFGHIJKLMNOPQRSTUVWXYZ&%$#@()0123456789~*';
xpow.m_cfg['CHECK_INPUT']='_chk_id';xpow.m_cfg['menu']='welcome,index,group,shop,me,edu,forum,idea,etc,hr,ads,search,tags';
xpow.m_cfg['ELEMT']='iframe,table,div,span,a,h4,p,img,textarea,form,textbox,hidden';xpow.m_cfg['client']='xpow.captchImg';xpow.m_cfg['appendobj'] = ''

Object.extend = function(destination, source) {for (var property in source) {destination[property] = source[property];};return destination}
Object.extend(String.prototype,{
	Right : function(len){ if (this != '') return this.substr(0,len) },
	Left : function(len){ if (this != '') return this.substr(this.length-len,len) },
	toLeft : function(len){ if (this != '') {return this.substr(0,this.length-len)}else{return ''} },
	toRight : function(len){ if (this != '') return this.substr(len,this.length-len) },
	toMid : function(len){ if (this != '') return this.substr(len,this.length-len-len) },
	toHtmlTrim : function(){ var str=trim(this); str=str.toReSymbol('&nbsp;','');str=str.toReSymbol('<?(&nbsp;|br|p)[^>]*>','');str=str.toReSymbol('<\\/',''); return str },
	toFileExt : function(t){ if (!t){t=0} ; if (this != '') return this.substr(this.lastIndexOf('.')+1,this.length-this.lastIndexOf('.')-1).toLowerCase()},
	toReSymbol : function(symbol,tosymbol){var str = '/'+symbol+'/gi'; return this.replace(eval(str),tosymbol)},
	toJSON : function() { return xpow.point.Keyword.Check(this) },
	toArray : function(spy){ spy=spy?spy:','; return this.split(spy)},
	toHTML : function() {var str=this; str = str.replace(/<br>/g, '&lt;BR&gt;').replace(/<BR>/g, '\n').replace(/"/g, '&quot;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/'/g, '&#146;'); return str },
	deHTML : function() {var str=this; str = str.replace(/<br>/g, '\n').replace(/&quot;/g, '\"').replace(/&lt;/g, '<').replace(/&gt;/g, '>').replace(/&#146;/g, '\''); return str },
	clearHTML : function() { this.formateHtml(); return this.replace(/<[^>]*>/g, '') },
	isKeyword : function() { return xpow.point.Keyword.Check(this) },
	Replace : function(str1,str2) { return this.replace('{$'+str1+'}',str2) },
	MD5 : function() { return xpow.point.MD5.get(this) },
	toLetter : function() {
		var tjsn,isobj = false
		for (var i = 0, length = arguments.length; i < length; i++) {if (isObject(arguments[i])){tjsn = arguments[i];isobj = true}}
		return (isobj)?xpow.m_cfg['LETTE'].substr(tjsn.start,tjsn.length):xpow.m_cfg['LETTE']
	},
	toHexColor:function() {if (this.Right(1)!='#') {return '#'+this.parseColor()}else{return this}},
	toGcColor:function() {return this.replace('#','')},
	pxToNum:function() {return Number(this.replace("px",""))},
	TrimBr : function(){
		var str = this
//		var tpat = /<(\/\s*)?((\w+:)?\w+)(\w+(\s*=\s*((["])(\\["tbnr]|[^\7])*?\7|\w+)|.{0})|\s)*?(\/\s*)?>/ig;
//		tAry = str.match(tpat)
//		//alert(tAry.length+' ==> '+str)
//		for (var i in tAry){
//			if (i!='input' && typeof tAry[i]=='string'){
//				alert(tAry[i])
//	//			if (tAry[i].toLowerCase().indexOf('<br')>-1) str = str.replace(tAry[i],'')
//	//			if (tAry[i].toLowerCase().indexOf('<br')<0){break}
//			}
//		}
		return str
	},
	
	isApp : function(mode){
		if (isEmpty(this)||this.substr(this.length-1,1)=='/'||this.substr(this.length-5,5).toLowerCase()=='.html'||this.substr(this.length-6,6).toLowerCase()=='.xhtml'){return true};
		if (mode){if(this.substr(this.length-1,1)!='?'){return true}};
		if (this.Left(xpow.m_cfg['app'].length).toLowerCase()==xpow.m_cfg['app']){return true }
		if (this.Left(xpow.m_cfg['apps'].length).toLowerCase()==xpow.m_cfg['apps']){return true }
		return false
	},
	
	formateHtml : function(){
		var str = this.toString()
		str = str.replace(/<br.*?>/gi, '<br />');
		str = str.replace(/(<hr\s+[^>]*[^\/])(>)/gi, '$1 />');
		str = str.replace(/(<img\s+[^>]*[^\/])(>)/gi, '$1 />');
		str = str.replace(/(<\/\w+>)/gi, function ($0,$1) { return($1.toLowerCase()) } );
		return str
	},

	isDate : function(){
		var p;
		var re1 = /(\d{4})[年./-](\d{1,2})[月./-](\d{1,2})[日]?$/;
		var re2 = /(\d{1,2})[月./-](\d{1,2})[日./-](\d{2})[年]?$/;
		var re3 = /(\d{1,2})[月./-](\d{1,2})[日./-](\d{4})[年]?$/;
		if(re1.test(this)) {p = re1.exec(this); return new Date(p[1],p[2],p[3])}
		if(re2.test(this)) {p = re2.exec(this); return new Date(p[3],p[1],p[2])}
		if(re3.test(this)) {p = re3.exec(this); return new Date(p[3],p[1],p[2])}
		return false;
	},
	parseColor : function() {  
		var color = '#';
		if(this.slice(0,4) == 'rgb(') {  
			var cols = this.slice(4,this.length-1).split(',');  
			var i=0; do { color += parseInt(cols[i]).toColorPart() } while (++i<3);  
		} else {  
			if(this.slice(0,1) == '#') {  
				if(this.length==4) for(var i=1;i<4;i++) color += (this.charAt(i) + this.charAt(i)).toLowerCase();  
				if(this.length==7) color = this.toLowerCase();  
			}  
		}  
		return(color.length==7 ? color : (arguments[0] || this))
	}

})
		
if (!Array.prototype.forEach){Array.prototype.forEach = function(fun /*, thisp*/){var len = this.length; if (typeof fun != "function")throw new TypeError();var thisp = arguments[1];for (var i = 0; i < len; i++){if (i in this)fun.call(thisp, this[i], i, this);}}}
xpow.URLencode=function (sStr){ return escape(sStr).replace(/\+/g,'%2B').replace(/\"/g,'%22').replace(/\'/g,'%27')}
xpow.URLdecode=function (psEncodeString){ var lsRegExp = /\+/g; return unescape(String(psEncodeString).replace(lsRegExp,"   ")) }
xpow.decodeURI=function (encodestr){return decodeURI(encodestr).replace(/\+/g,' ').replace(/\%3A/g,'：')}

/*var browserName = navigator.userAgent.toLowerCase();
mybrowser = {
	version: (browserName.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/) || [0, '0'])[1],
	safari: /webkit/i.test(browserName) && !this.chrome,
	opera: /opera/i.test(browserName),
	firefox:/firefox/i.test(browserName),
	ie: /msie/i.test(browserName) && !/opera/.test(browserName),
	mozilla: /mozilla/i.test(browserName) && !/(compatible|webkit)/.test(browserName) && !this.chrome,
	chrome: /chrome/i.test(browserName) && /webkit/i.test(browserName) && /mozilla/i.test(browserName)
}*/


xpow.browser=new Object();
xpow.browser.userAgent		= navigator.userAgent.toLowerCase();
xpow.browser.appVersion		= navigator.appVersion;
xpow.browser.doInit=function()
{
	this.isIE=this.userAgent.indexOf('msie')!=-1;
	this.isIE5=false; this.isGecko=false; this.isNS=false; this.isMozilla=false; this.isFirefox=false; this.isOpera=false;
	this.isMaxthon = false; this.is360 = false
	try{
		this.isMaxthon = external.max_version?true:false
		this.MaxthonVer = external.max_version
		/*if(external.max_version.indexOf('1.')==0){
			this.isMaxthon1 = 1;
		}else{
			this.isMaxthon1 = 0;
		}*/
	}catch(e){
		/*this.isMaxthon1 = 0;*/
	}
	
	this.is360 = this.userAgent.toLowerCase().indexOf('360se')>-1 ? true : false;
	this.isQQbrowser = this.userAgent.toLowerCase().indexOf('qqpinyinsetup')>-1 ? true : false;
	if (this.is360 || this.isQQbrowser )this.isMaxthon=true
	
	if (this.isIE){
		this.MajorVer=this.appVersion.match(/MSIE (.)/)[1];
		this.MinorVer=this.appVersion.match(/MSIE .\.(.)/)[1];
		this.isIE5=(this.MajorVer==5);
		if (this.isIE5) this.type="ie5";
		else this.type='ie';
		this.typeName="IE"+this.MajorVer;
		//this.typeName=/msie/.test(navigator.userAgent.toLowerCase()) ? 'ie' : 'gecko';
	}else{
		this.isGecko=true;	
		this.type="gecko";
		this.typeName="gecko";
		this.MajorVer=0; this.MinorVer=0;
		this.isNS=this.userAgent.indexOf("netscape")!=-1;
		if(this.isNS) this.type="ns";
		this.isMozilla=(typeof document.implementation != 'undefined') && (typeof document.implementation.createDocument != 'undefined') && (typeof HTMLDocument!='undefined');
		this.isFirefox=(navigator.userAgent.toLowerCase().indexOf("firefox")!=-1);
		this.isOpera=(navigator.userAgent.toLowerCase().indexOf("opera")!=-1);
		this.isSafari=(navigator.userAgent.toLowerCase().indexOf("safari")!=-1);
	}
}
xpow.browser.doInit();

xpow.browser.getObject=function(strname) { return this.getElementById(strname); }
xpow.browser.getElementById=function(strname)
{
	if (this.isIE5 || this.isMozilla || this.isFirefox) return document.getElementById(strname);
	if (this.isIE) return document.all(strname);
	if (this.isNS) return document.layers[strname];
}
xpow.browser.getElementsByName=function(strname)
{
	if (this.isIE5 || this.isMozilla || this.isFirefox) return document.getElementsByName(strname);
	if (this.isIE) return document.all(strname);
	if (this.isNS) return document.layers[strname];
}

xpow.browser.toAgent=function(strer,strHtml)
{
	var re,tmpstr,tmp1,tmp2;
	var tmpAry=strer.split(';');
	if (tmpAry.length<3) { re='未知的系统信息'; }
	else
	{
		tmpstr=tmpAry[2];
		tmp1=tmpstr.length-1;
		tmp2=tmpstr.substr(tmp1,1);
		if (tmp2==')') { tmpstr=tmpstr.substr(1,tmp1-1); }
		re='操作系统: '+tmpstr;
		re+=', 浏览器: '+tmpAry[1];
		re=re.replace('MSIE','Internet Explorer');
		re=re.replace('NT 5.0','2000');
		re=re.replace('NT 5.1','XP');
		re=re.replace('NT 5.2','2003');
	}
	if (strHtml!=null && strHtml!='') re=xpow.common.toDisp(strHtml,'agent',re);
	return re;
}

function $(strname) { return (!isObject(strname))?xpow.browser.getElementById(strname):strname }
function $t(node,strname) { var tn=node; node = (isObject(node))?node:$(node); if (!isObject(node)){/*alert('getElemtByTag Err:\n\n\''+tn+'\' is not an [object] or it\'s not exist!');*/return false};return node.getElementsByTagName(strname) }
function $g(o,items){ return ( !isObject(o))? $(o).getAttribute(items): o.getAttribute(items)} //$g.caller
function $s(o,key,items){return (!isObject(o))? $(o).setAttribute(key,items):o.setAttribute(key,items)}
function $e(strname){return document.getElementsByName(strname) || new Array() } 
function $c(strname) { return document.getElementsByClassName(strname) || new Array() }
xpow.browser.getDomain=function() { return window.document.domain; }
xpow.browser.getURLs=function() { return window.document.URL; }
xpow.browser.getTitle=function() { return window.document.title; }
xpow.browser.getReferer=function() { return window.document.referrer; }

xpow.window=new Object();
xpow.window._QueuesOnLoad=new Array();
xpow.window.addOnLoad=function(strer) { this._QueuesOnLoad[this._QueuesOnLoad.length]=strer;}
xpow.window.doOnLoad=function(){ for (var i=0;i<this._QueuesOnLoad.length;i++){ eval(this._QueuesOnLoad[i]); }}
xpow.window.getClipBoardData=function(strType){ if (window.clipboardData){ if (isEmpty(strType)) strType='text'; return window.clipboardData.getData(strType); }}
xpow.window.setClipBoardData=function(strer) {if (window.clipboardData){window.clipboardData.setData('text', strer);if (this.getClipBoardData('text')!=strer){return false}else{return true}}}
xpow.window.doClipBoardClear=function() { if (window.clipboardData) window.clipboardData.clearData(); }
window.onload=function() { xpow.window.doOnLoad() }
//window.onbeforeunload=function(){ if(event.clientX>document.body.clientWidth&&event.clientY<0)alert('unload'); window.open('/passport/logout.asp')}   


xpow.doParseMenu=function(mnupage,mnurank)
{
	var mnuAry=this.m_cfg['menu'].split(','),m_r=$(this.m_cfg['m_r']),m_l=$(this.m_cfg['m_left']),m_css=$(mnupage),_app='?module='+mnupage;
	//for(var ii=0;ii<mnuAry.length;ii++){$(mnuAry[ii]).className=''}
	var m_l={},m_r={}
	//return
	if (mnurank==''){
		alert('当前Session为空，请刷新本页！')
	}else{
		if (mnupage=='welcome'){
			m_l.src=this.m_cfg['dir']+this.m_cfg['l_pre']+mnupage+this.m_cfg['app'];
			m_r.src='/welcome.xpm'
		}else{
			m_l.src=this.m_cfg['dir']+this.m_cfg['l_pre']+mnupage+this.m_cfg['app'];
			m_r.src=this.m_cfg['dir']+this.m_cfg['r_pre']+mnupage+this.m_cfg['app']+_app;
		}
		if(m_r.src)location.href=m_r.src
		//m_css.className='abc';
		//m_css.blur();
	}
}

xpow.goMenu=function(mnupage,mnurank)
{
	var m_r=document.getElementById(this.m_cfg["m_r"])
	var _app="&module="+mnupage;
	var _apps="?module="+mnupage;
	var m_l={},m_r={}
	if (mnurank==''){
		alert('当前Session为空，请刷新本页！')
	}else{
		if (mnupage=='welcome'){
			m_r.src='/welcome.xpm'
		}else{
			if (mnupage.indexOf('?')>0){ var _pageAry=mnupage.split('?')
				if (!m_r){location.href=this.m_cfg['dir']+this.m_cfg['r_pre']+_pageAry[0]+this.m_cfg['app']+'?'+_pageAry[1]+'&module='+_pageAry[0] }
				else{m_r.src=this.m_cfg["dir"]+this.m_cfg["r_pre"]+_pageAry[0]+this.m_cfg['app']+'?'+_pageAry[1]+'&module='+_pageAry[0]}
			}else{
				if (!m_r){location.href=this.m_cfg['dir']+this.m_cfg['r_pre']+mnupage+this.m_cfg['app']+_apps}
				else{m_r.src=this.m_cfg["dir"]+this.m_cfg['r_pre']+mnupage+this.m_cfg['app']+_apps}
			}
		}
	}
	
	if(m_r.src)location.href=m_r.src
}

xpow.doSelectAll=function(theform)
{
	var _objForm=theform;
	var _nvalue=_objForm._chk_all.checked;
	var _ncheckbox;
	for(var i=0;i<_objForm.elements.length;i++)
	{
		var _ncheckbox=_objForm.elements[i];
		if(_ncheckbox.name==this.m_cfg["CHECK_INPUT"]) { _ncheckbox.checked=_nvalue; }
	}
}

xpow.goUrl=function(theurl){if(theurl!=''){location.href=theurl}}
xpow.dirUrl=function(theurl){if(theurl!=''){document.getElementById(this.m_cfg["m_r"]).src=theurl}}

xpow.doSelectHandle=function(theform)
{
	var _objform=theform;
	var _ncheckbox='';
	var _objHandle=_objform.opHandle;
	var isChecked=false;
	for(var i=0;i<_objform.elements.length;i++)
	{
		var _ncheckbox=_objform.elements[i];
		if(_ncheckbox.name==this.m_cfg["CHECK_INPUT"]&& _ncheckbox.checked) {isChecked=true; break;}
	}
	if (_objHandle){
		var __handle=_objHandle.value
		if (__handle!=''){
			if (confirm('您确定要执行此操作吗？此操作可能无法恢复！')){
				if (!isChecked){
					alert('没有选择任何记录！\n\n请选择要操作的记录！')
					_objHandle.options[0].selected=true
					_objHandle.blur()
				}else{
					var _HandleUrl='';
					if (__handle.indexOf('?')>0){ var _pageAry=__handle.split('?')
						_HandleUrl=this.m_cfg["dir"]+this.m_cfg["r_pre"]+_pageAry[0]+this.m_cfg["app"]+'?'+_pageAry[1]
					}else{
						_HandleUrl=this.m_cfg["dir"]+this.m_cfg["r_pre"]+__handle+this.m_cfg["app"]
					}
					_objform.action=_HandleUrl;
					_objform.submit();
				}
			}else{
				_objHandle.options[0].selected=true
				_objHandle.blur()
			}
		}
	}
}


xpow.Check = {
	Null : '',
	form : '',
	outMode : 1,
	listMode : 2.2,
	setItem : function(n,t){ this.setOutMode(t); this.setNull(n)},
	setOutMode : function(t){ this.outMode=t },
	setParmas : function(field,fieldtt,theform){this.form={sfield:field,sfieldtt:fieldtt,stheform:theform} },
	setNull : function(re){this.Null=re},
	Form : function(field,fieldtt,theForm,mode,lmode){
		this.outMode = (typeof mode!='undefined')?mode:this.outMode
		this.listMode = (typeof lmode!='undefined')?lmode:this.listMode
		var br='\n',reMsg='',tmpTree = xpow.Use('tree'),tsn = 0
		var tFieldAry = field.split(','),tMsgAry = fieldtt.split(',')
		if (!isObject(theForm)){theForm = $(theForm)}
		if(theForm && theForm.elements){
			for(var i=0;i<theForm.elements.length;i++){var nElemt=theForm.elements[i];tmpTree.addItem(nElemt.name,trim(nElemt.value))}
		}else{
			for(var i=0;i<tFieldAry.length;i++){
				tmpTree.addItem(tFieldAry[i],trim($(tFieldAry[i]).value))
			}
		}
		for(i=0;i<tFieldAry.length;i++){
			if (inSpace(tmpTree.getItem(tFieldAry[i])) == this.Null || isEmpty(tmpTree.getItem(tFieldAry[i]))){
				if (tMsgAry[i]!=''){
					tsn +=1
					xpow.point.Error.setErr('_err.'+tsn,tMsgAry[i])
				}
			}
		}
		
		if (xpow.point.Error.foundErr){
			xpow.point.Error.setErr('_err.'+tsn,xpow.point.Error.getErr('_err.'+tsn)+' 不能为空！')
			xpow.point.Error.Out(this.outMode,'','',this.listMode)
			return false
		}
		return true
	}
}

xpow.doHandleSucc=function(sucMsg)
{
	var _sucAry=sucMsg.split('$$$');
	var m_r=document.getElementById(this.m_cfg['m_r']);
	var _app='module='+_sucAry[1];
	if(_sucAry[0])alert(_sucAry[0])
	this.goMenu(_sucAry[1],1)
}

xpow.dolistSubClass=function(dataId,subid,msg,title)
{
	var dataAry=dataId.split(',');
	var unitAry=subid.split('|');
	var mainIdAry=unitAry[0].split(',');
	var subIdAry=unitAry[1].split(',');
	var subClsIds='';
	if (msg==''){
		msg='<font color="red">没有查询到子分类......！</font><button onclick=document.getElementById("sub'+dataAry[1]+'").style.display="none">确定</button>';
	}else{
		var subsImg='<img style="cursor:hand" src="http://www.chnimg.com/images/status/arrow_a.gif">  '
		var subImg='<img style="cursor:hand" src="http://www.chnimg.com/images/status/arrow_a.gif">  '
		for (i=0;i<msg.length;i++){
			if (msg.charAt(i)=='*'){ msg=msg.replace(msg.charAt(i),subsImg) }
			if (msg.charAt(i)=='`'){ msg=msg.replace(msg.charAt(i),subImg) }
		}
		var _msgAry=msg.split(",");
		var titImg='<img style="cursor:hand" src="http://www.chnimg.com/css/admin/sysclass/i_ar01.gif" >  '
		msg='';
		for (i=1;i<_msgAry.length;i++){
			msg+='<div id="'+mainIdAry[i]+'" style="padding-left:10px"> <img style="cursor:hand" src="http://www.chnimg.com/images/status/i_ar01.gif" onclick="return xpow.showSubClass('+mainIdAry[i]+')">'  +_msgAry[i]+'</div><div id="ff">'
		}
	}
	$('sub'+dataAry[1]).style.display=''
	$('subClassList'+dataAry[1]).style.display=''
	$('scsTitle').innerHTML=title
	$('subClassList'+dataAry[1]).innerHTML=msg
	$('showlistlink'+dataAry[1]).style.display=''
}

xpow.go = function(path){window.open(path,'_blank')}
xpow.paging=new Object();
xpow.paging.doGO=function(strtxt,strnum,strpage)
{
	if (isEmpty(strtxt)) strtxt="paging_url";
	if (isEmpty(strnum)) strnum="paging_num";
	if (isEmpty(strpage)) strpage="{$page}";
	var tmpurl=xpow.form.getValue(strtxt);
	var tmppage=xpow.form.getValue(strnum);
	if (tmppage==''){tmppage=0}
	tmpurl=toReplace(tmpurl,strpage,tmppage);
	try{eval(tmpurl)}catch(e){redirect(tmpurl)}
}


xpow.form=new Object();
xpow.form.getValue=function(strName)
{
	var re='',tmpElement=this.getElement(strName);
	if (isObject(tmpElement)){
		if (tmpElement.length){
			var tmpType='';
			for(var i=0;i<tmpElement.length;i++){
				if (isEmpty(tmpType)) tmpType=tmpElement[i].type;
				switch (tmpType){
				case 'radio':if (tmpElement[i].checked) re=tmpElement[i].value;break;
				case 'checkbox':if (tmpElement[i].checked) re+=','+tmpElement[i].value;break;
				}
			} if (tmpType=='checkbox' && !isEmpty(re)) re=re.substring(2);
		} else { re=tmpElement.value; }
	}return re;
}

xpow.form.setValue=function(strName,strValue,strMode)
{
	var tmpElement=this.getElement(strName);
	if (isObject(tmpElement)){
		if (isEmpty(strValue)) strValue='';
		if (tmpElement.length){
			var tmpType='';
			for(var i=0;i<tmpElement.length;i++){
				if (isEmpty(tmpType)){tmpType=tmpElement[i].type;}
				switch (tmpType){
				case 'radio':if (strValue.inPart(tmpElement[i].value)>0 || strMode==('__no'+(i+1))) tmpElement[i].checked=true;break;
				case 'checkbox':if (strValue.inPart(tmpElement[i].value)>0 || strMode=='__all__') tmpElement[i].checked=true;break;
				}
			}
		}
		else{
			if (strMode=="append") tmpElement.value+=strValue;
			else tmpElement.value=strValue;
		}
	}
}

xpow.form.getElement=function(strName)
{
	var reElement=null;
	try{
		if (!isEmpty(strName)){
			var tmpTarget='';
			if (strName.indexOf(':')!=-1) { tmpTarget=strName.substring(0,strName.indexOf(':')); strName=strName.substring(strName.indexOf(':')+1); }
			var tmpForm;
			if (tmpTarget=='parent'){
				if (strName.indexOf('.')==-1) { reElement=window.parent.document.getElementById(strName); }
				else { if (isObject(tmpForm=window.parent.document.forms[strName.substring(0,strName.indexOf('.'))])) reElement=tmpForm.elements[strName.substring(strName.indexOf('.')+1)]; }
			}
			else if (tmpTarget!='') { }
			else{
				if (strName.indexOf('.')==-1) { reElement=document.getElementById(strName); }
				else { if (isObject(tmpForm=document.forms[strName.substring(0,strName.indexOf('.'))])) reElement=tmpForm.elements[strName.substring(strName.indexOf('.')+1)]; }
			}
		}
	}
	catch(e) { dbg.obj(e); }
	return reElement;
}

xpow.form.getObject=function(strName,strType)
{
	var reObject=null;
	switch (strType){
		case 'parent':
			var tmpObject=this.getElement(strName);
			if (isObject(tmpObject)){reObject=xpow.browser.isIE ? tmpObject.parentElement : tmpObject.parentNode;}
			break;
	}
	return reObject;
}

xpow.doActionsFilterField=function(strForm,strFiledName,strSelectDefault)
{
	if (!isObject(strForm)){
		if (!isEmpty(strForm)) strForm=this.form.getObject(strForm,"parent");
		if (!isObject(strForm)) return false;
	}
	var _objForm=strForm;
	var _objSelect=eval('_objForm._actions_filter_'+strFiledName);
	if (!_objSelect) return false;
	var tmpValue="",s;
	if (isEmpty(strSelectDefault)){
		tmpValue=_objSelect.options[_objSelect.selectedIndex].value;
	}else{
		var tmpTrue=false;
		for(s=0;s<_objSelect.options.length;s++){
			if (_objSelect.options[s].value==strSelectDefault){
				_objSelect.options[s].selected=true;
				tmpTrue=true;
				break;
			}
		}
		if (tmpTrue) tmpValue=strSelectDefault;
	}
	if (tmpValue){
		var _AryFields=new Array();
		for(s=0;s<_objSelect.options.length;s++) { _AryFields[s]=_objSelect.options[s].value; }
		var _ncheckbox,_id,a;
		var _objSpan,_objSpanDefault,_objSpanSelect;
		for(var i=0;i<_objForm.elements.length;i++){
			var _ncheckbox=_objForm.elements[i];
			if(_ncheckbox.name=='_chk_id'){
				_id=_ncheckbox.value;
				_objSpan=$('row_'+_id+'_'+strFiledName);
				_objSpanDefault=$('row_'+_id+'_'+strFiledName+'__default');
				if (_objSpan && _objSpanDefault){
					if (tmpValue=='_default'){
						if (_objSpanDefault.innerHTML) _objSpan.innerHTML=_objSpanDefault.innerHTML;
					}else{
						if (!_objSpanDefault.innerHTML) _objSpanDefault.innerHTML=_objSpan.innerHTML;
						_objSpanSelect=$('row_'+_id+'_'+tmpValue);
						if (_objSpanSelect) _objSpan.innerHTML=_objSpanSelect.innerHTML;
					}
				}
			}
		}
	}
}

xpow.CreateElemt=function(objElemt,objPorperty,appitem)
{
	var _ary=xpow.m_cfg['ELEMT'].split(',');
	for (i=0;i<_ary.length;i++){
		if (objElemt==_ary[i]){
			var ELEMT=document.createElement(objElemt);
			this.m_cfg['cm']=i;
			return this.setProperty(ELEMT,objPorperty,appitem)
			break;
		}
	}
}

xpow.getProperty=function(){ return this.m_cfg['cm'] }
xpow.setProperty=function(theElemt,objPorperty,appitem)
{
	var proAry = new Array()
	var Propertys = new Array()
	proAry = objPorperty.split(',');/*.toLowerCase()*/
	for(i=0;i<proAry.length;i++){
		if (proAry[i].indexOf('name=')>=0){
			Propertys['name']=this.getProtParame(proAry[i],'name')
			theElemt.setAttribute('name',Propertys['name']);
		}else if(proAry[i].indexOf('id=')>=0){
			Propertys['id']=this.getProtParame(proAry[i],'id')
			theElemt.id=Propertys['id'];
		}else if(proAry[i].indexOf('border-top=')>=0){
			Propertys['border-top'] = this.getProtParame(proAry[i],'border-top')
			theElemt.setAttribute('border-top',Propertys['border-top'])
		}else if(proAry[i].indexOf('border-bottom=')>=0){
			Propertys['border-bottom'] = this.getProtParame(proAry[i],'border-bottom')
			theElemt.setAttribute('border-bottom',Propertys['border-bottom'])
		}else if(proAry[i].indexOf('display=')>=0){
			Propertys['display'] = this.getProtParame(proAry[i],'display')
		}else if(proAry[i].indexOf('width=')>=0){
			Propertys['width']= this.getProtParame(proAry[i],'width')
			if (Propertys['width']=='document.body.scrollWidth'){ Propertys['width']=document.body.scrollWidth + "px"};
			theElemt.style.width = Propertys['width'];
		}else if(proAry[i].indexOf('height=')>=0){
			Propertys['height']= this.getProtParame(proAry[i],'height')
			if (Propertys['height']=="document.body.scrollHeight"){ Propertys['height']=document.body.scrollHeight + "px"};
			theElemt.style.height = Propertys['height'];
		}else if(proAry[i].indexOf('position=')>=0){
			Propertys['position']= this.getProtParame(proAry[i],'position')
			theElemt.style.position = Propertys['position'];
		}else if(proAry[i].indexOf('zIndex=')>=0){
			Propertys['zIndex']= this.getProtParame(proAry[i],'zIndex')
			theElemt.style.zIndex = Propertys['zIndex'];
		}else if(proAry[i].indexOf('title=')>=0){
			Propertys['title']= this.getProtParame(proAry[i],'title')
			theElemt.title = Propertys['title'];
		}else if(proAry[i].indexOf('cursor=')>=0){
			Propertys['cursor']= this.getProtParame(proAry[i],'cursor')
			theElemt.style.cursor = Propertys['cursor'];
		}else if(proAry[i].indexOf('border=')>=0){
			Propertys['border']= this.getProtParame(proAry[i],'border')
			theElemt.style.border = Propertys['border'];
		}else if(proAry[i].indexOf('padding=')>=0){
			Propertys['padding']= this.getProtParame(proAry[i],'padding')
			theElemt.style.padding =  Propertys['padding'];
		}else if(proAry[i].indexOf('top=')>=0){
			Propertys['top']= this.getProtParame(proAry[i],'top')
			if (Propertys['top']=='center'){Propertys['top']=(parseInt(document.body.scrollHeight) - Propertys['height']) / 2 + "px"; };
			/*theElemt.setAttribute('top',Propertys['top']);*/
			theElemt.style.top = Propertys['top']
		}else if(proAry[i].indexOf('left=')>=0){
			Propertys['left']= this.getProtParame(proAry[i],'left')
			if (Propertys['left']=='center'){Propertys['left']=(parseInt(document.body.scrollWidth) - Propertys['width']) / 2 + "px";}
			theElemt.style.left = Propertys['left'];
		}else if(proAry[i].indexOf('background=')>=0){
			Propertys['background']= this.getProtParame(proAry[i],'background')
			theElemt.style.background = Propertys['background'].toString();
		}else if(proAry[i].indexOf('filter=')>=0){
			Propertys['filter']= this.getProtParame(proAry[i],'filter')
			theElemt.style.filter = Propertys['filter'];
		}else if(proAry[i].indexOf('opacity=')>=0){
			Propertys['opacity']= this.getProtParame(proAry[i],'opacity')
			theElemt.style.background = Propertys['opacity'];
		}else if(proAry[i].indexOf('textAlign=')>=0){
			Propertys['textAlign']= this.getProtParame(proAry[i],'textAlign')
			theElemt.style.textAlign = Propertys['textAlign'];
		}else if(proAry[i].indexOf('lineHeight=')>=0){
			Propertys['lineHeight']= this.getProtParame(proAry[i],'lineHeight')
			theElemt.style.lineHeight = Propertys['lineHeight'];
		}else if(proAry[i].indexOf('align=')>=0){
			Propertys['align'] = this.getProtParame(proAry[i],'align')
			theElemt.setAttribute("align",Propertys['align']);
		}else if(proAry[i].indexOf('src=')>=0){
			Propertys['src'] = this.getProtParame(proAry[i],'src')
			theElemt.setAttribute("src",Propertys['src']);
		}else if(proAry[i].indexOf('frameBorder=')>=0){
			Propertys['frameBorder'] = this.getProtParame(proAry[i],'frameBorder')
			theElemt.setAttribute("frameBorder",Propertys['frameBorder']);
		}else if(proAry[i].indexOf('scrolling=')>=0){
			Propertys['scrolling'] = this.getProtParame(proAry[i],'scrolling')
			theElemt.setAttribute("scrolling",Propertys['scrolling']);
		}else if(proAry[i].indexOf('value=')>=0){
			Propertys['value'] = this.getProtParame(proAry[i],'value')
			theElemt.value=Propertys['value'];
		}
	}
	theElemt.style.display = ''
	if (Propertys['display']=='none')theElemt.style.display = 'none';
	if (!appitem)document.body.appendChild(theElemt);
	return theElemt
	/*removeAttribute('href')*/
}

xpow.getProtParame=function (inParame,pars)
{
	var _index = parseInt(inParame.indexOf(pars)+pars.length+1);
	var _last = inParame.length-_index;
	var _parame = inParame.substr(parseInt(_index),parseInt(_last));
	return _parame;
}

xpow.removeElemts=function(type,intRe)
{
	var isMoved=false;
	var iElements = document.getElementsByTagName(type);
	for (i=0; i<iElements.length; i++) {
		var iElement = iElements[i];
		if (intRe){
			var msg = "Found an "+type+" element!";
			var atts = iElement.attributes;
			for (j=0; j<atts.length; j++) {
				var att = atts.item(j);
				msg = msg + "\n  " + att.nodeName + ": '" + att.nodeValue + "'";
			}
			alert(msg)
		}
		document.body.removeChild(iElement);
		isMoved=true;
	}
	if (isMoved && intRe) alert('remove '+i+' elements \"'+type+'\"')
}

xpow.removeElemt = function(eid,intRe)
{
	var isMoved = false;
	var iElement = isObject(eid) ? eid : document.getElementById(eid);
	try{
		if (iElement){ document.body.removeChild(iElement);isMoved=true; }
	}catch(e){
		alert(iElement+'#'+e.message)
	}
	
	if (isMoved && intRe==1){
		var msg = "Found an "+eid+" element!";
		var atts = iElement.attributes;
		for (j=0; j<atts.length; j++) {
			var att = atts.item(j);
			msg = msg + "\n  " + att.nodeName + ": '" + att.nodeValue + "'";
		}
		alert(msg);
	}
	if (isMoved && intRe==2) alert('remove '+eid+' element succesed!"')
}

xpow.setFromTarget=function (theform,action,targetName,theEnctype)
{
	if (typeof(theform)=='string')theform = $(theform)
	theform.method='post';
	theform.action=action;
	theform.target=targetName;
	if (theEnctype){ theform.encoding=theEnctype;}
	theform.submit();
}


xpow.setFormTarget=function (theform,action,targetName,theEnctype)
{
	theform.method='post';
	theform.action=action;
	theform.target=targetName;
	if (theEnctype!=''){ theform.encoding=theEnctype;}
	theform.submit();
}


xpow.editor = new Object()
xpow.editor.getEditor = function(eName,height,width,param)
{
	param=param?param:{}
	var config = {
		id : '_editor_concc',width:width+'px',height:height+'px',
		cssPath : 'http://www.chnimg.com/common/xEditor/index/common.css',
		skinsPath : 'http://www.chnimg.com/common/xEditor/skins/',
		pluginsPath : 'http://www.chnimg.com/common/xEditor/plugins/',
		resizeMode : 1,
		unFullScreen: param.unFullScreen,
		onFullScreen: param.onFullScreen,
		onComplete: param.onComplete
	}
	xpow.Use('script').jLoad('editor',function(){
		if (xpow.browser.isIE){
			KE.show(config)
		}else{
			$j(document).ready(function(){
				KE.show(config)
			})
		}						  
	})
}

xpow.editor.setAppendObj = function(obj){ xpow.m_cfg['appendobj'] = obj }
xpow.editor.clearAppendObj = function() {try{xpow.point.popClear(); $('upbtn-a').style.display='none'}catch(e){}; if (xpow.m_cfg['appendobj']){xpow.m_cfg['appendobj'].Clear()} }

xpow.upload = function(){}
xpow.upload.prototype.doInit = function()
{
	this.VERSION = '1.3.2'
	this.objName = 'xUploader';
	this._dir = 'http://www.chnimg.com/';
	this._path = 'cm.xp.xup.html';
	this._form = 'upform';
	this._vFileSize = '_vFileSize';
	this._vFileExt = '_vFileExt';
	this._vFileName = '_vFileName';
	this._vElemt = 'velemt';
	this._vsElemt = 'vselemt';
	this._upPath = '';
	this._showElemt = 'showpic';
	this.img_h = 'img_h';
	this.img_w = 'img_w';
	this._parent = 'edtparent';
	this._frameid = 'uploaderframe';
	this._framename = 'uploaderframe';
	this.exportObj = '';
	this._channel='';
	this._isResize = 0;
	this._resizeMode = 0;
	this._filename = '';
	this._maxsize = 0;
	this._re_maxw = 180;
	this._re_maxh = 180;
	this._re_size = '|';
	this.width = 340;
	this.height = 30;
	this.bodyWidth = 580;
	this.bodyHeight = 160;
	this._cursorPos_start = 0;
	this._cursorPos_end = 0;
	this._editorObjname = '';
	this._vimg = 'vimg';//当actmode=1时,记录最后输出的文件名
	this._focus = 'vimg';//当actmode=1时,上传后输出焦点名
	this.isRecycle = 1;
	this.actmode = 0;
	this.allowExt = 'jpg,gif'
	this._succ = ''
}

xpow.upload.prototype.getUploader = function()
{
	var _prop;
	var _e = xpow.m_cfg['ELEMT'].split(',');
	_prop = "id="+this._frameid+",name="+this._framename+",frameBorder=0,scrolling=no,width="+this.width+",height="+this.height
	xpow.CreateElemt(_e[0],_prop);
	_prop = this._dir+this._path+'?&filesize='+this._maxsize+'&vselemt='+this._vsElemt;
	_prop += '&velemt='+this._vElemt+'&filepath='+this._upPath+xpow.getDater.Get('toPath',1)+'&isresize='+this._isResize+'&maxh='+this._re_maxh;
	_prop += '&maxw='+this._re_maxw+'&showpic='+this._showElemt+'&remode='+this._resizeMode+'&formname='+this._form+'&channel='+this._channel+'&domainapp='+xpow.point.Path.getApp();
	_prop += '&v_reimg_h='+this.img_h+'&v_reimg_w='+this.img_w+'&allowext='+this.allowExt+'&r_sz='+this._re_size+'&filename='+this._filename+'&succ='+this._succ
	$(this._frameid).height=this.height+'px'
	if ($(this._frameid)){$(this._frameid).src=_prop}
}

xpow.upload.prototype.Body = function()
{
	this.SetButton()
	var tc = xpow.point.Content
	tc.append('<FORM id="'+this._form+'">')
	tc.append('<TABLE height="160" align="center" class="uplbox" cellSpacing=0 cellPadding=0 width="580" border=0><TBODY><TR>')
	tc.append('<TD width=378 height=10 class="title">选择文件进行上传 </TD>')
	tc.append('<TD width=202 class="title">上传后预览图</TD>')
	tc.append('</TR><TR><TD vAlign=top bgcolor="#FFFFFF" class="uplitem">')
	tc.append('<div id="edtparent"></div><div class="space"></div>')
	tc.append('<div class="tips">上传须知：文件大小 ≤',this._maxsize,' K，',this.allowExt,' 文件格式</div>')
	tc.append('<div class="tips">* 如果上传后无法看到预览图，请检查是否上传了 CMYK 色的图片，如果是请调整为 RGB 色重新上传</div><div class="space"></div>')
	tc.append('<div class="sizebox"><div id="file_size"><B>图片大小：</B></div><div id="file_ext"><B>文件格式：</B></div>')
	tc.append('<div id="file_width"><B>图片宽度：</B></div><div id="file_height"><B>图片高度：</B></div></div></TD>')
	tc.append('<TD><div class="review" id="showpic"></div></TD>')
	tc.append('<input type="hidden" id="',this.img_h,'"><input type="hidden" id="',this.img_w,'"><input type="hidden" id="',this._vElemt,'"><input type="hidden" id="',this._vsElemt,'">')
	tc.append('<input type="hidden" id="',this._vFileName,'"><input type="hidden" id="',this._vFileSize,'"><input type="hidden" id="',this._vFileExt,'">')
	tc.append('</TR></TBODY></TABLE></FORM>')
	return tc.toString();
}

xpow.upload.prototype.SetButton = function(){
	this.enterAction = (this.actmode == 0)?'window.frames[\'Editor\'].'+this._editorObjname+'.'+this.objName+'.getContent()':this.objName+'.setImg2E()'
	this.objName = (this.actmode == 0)?'window.frames[\'Editor\'].'+this._editorObjname+'.'+this.objName:this.objName
}

xpow.upload.prototype.GetCursorPsn = function(txb) 
{ 
    var slct = document.selection;
    var rng = slct.createRange();
    txb.select();
    rng.setEndPoint('StartToStart', slct.createRange());
    var psn = rng.text.length;
    rng.collapse(false);
    rng.select();
    return psn;
}

xpow.upload.prototype.setUploader = function(){this.getUploader(); if ($(this._parent)){$(this._parent).appendChild($(this._frameid));}}
xpow.upload.prototype.doDel = function()
{
	var imgpth=$(this._vElemt).value+'$$$'+$(this._vsElemt).value;
	var timer
	
	if ($(this._vElemt).value != '' || $(this._vsElemt).value != ''){
		if (confirm('您确实要取消吗？\n\n取消将删除此次上传的文件！')){
			//window.frames[this._frameid].doDeleteImg(imgpth,0)
			//alert(window.frames[this._frameid].src)
		}else{return}
	}
	if (this.exportObj !=''){
		setTimeout(this.exportObj+'.Clear()',300)
		//setTimeout('xpow.point.popClear()',300)
	}else{
		try{
			//setTimeout('xpow.point.popClear()',300)
			setTimeout('window.frames[\'Editor\'].'+this._editorObjname+'.edtDlg.Clear()',300)
		}catch(e){
			alert(e.message)
		}
	}
	//clearTimeout(timer)
	try{
		window.frames['Editor'].focus()
	}catch(e){
		$(this._focus).focus()
	}
}


xpow.upload.prototype.test = function(inRe)
{
	var tbr = '\n'
	var str = this.objName + ' is here!' + tbr;
	str += 'version : ' + this.VERSION + tbr;
	str += 'parent : ' + this._parent + tbr;
	str += 'frameid : ' + this._frameid + tbr;
	str += 'width : ' + this.width + tbr;
	str += 'height : ' + this.height + tbr;
	str += 'editorObjname : ' + this._editorObjname + tbr;
	str += 'allowExt : ' + this.allowExt + tbr;
	str += 'isResize : ' + this._isResize + tbr;
	str += 'uploadPath : ' + this._upPath;
	if (inRe){alert(str)}
	return true;
}

xpow.upload.prototype.getContent = function()
{
	var w_e_h = window.frames['Editor'].window.frames['HtmlEditor'];
	var w_e = window.frames['Editor'];
	var tbr = '<br><br>';
	var imgurl = $(this._vElemt).value
	if (imgurl == ''){alert('请上传一张图片或者文件!');return}
	try{
		w_e_h.document.body.innerHTML += tbr+'<br><img width='+$(this.img_w).value+' height='+this.img_h.value+' src=\"'+this._vElemt.value+'\"></BR>';
	}catch (e){
		var ext = $(this._vFileExt).value.toLowerCase(),tT = false;
		var extAry = 'jpg,gif,png,bmp'.split(',')
		for (i=0;i<extAry.length;i++){if (ext == extAry[i]){tT = true;break;}}
		var fileName = $(this._vFileName).value
		var filesize = $(this._vFileSize).value
		if (!tT){
			w_e.eval(this._editorObjname).insertFile('<br><a style="PADDING-LEFT: 20px; height:20px; line-height:20px; BACKGROUND: url(http://www.chnimg.com/images/common/linkicons/'+ext+'.png) no-repeat left 50%" href="'+imgurl+'" title="点击下载">'+fileName+' ['+filesize+' K]</a><br>');
		}else{
			w_e.eval(this._editorObjname).insertImage(imgurl,$(this.img_w).value,$(this.img_h).value,0,'',0,0,0);
		}
	}
	if (this.exportObj !=''){this.exportObj+'.Clear()'}
	else{eval('window.frames[\'Editor\'].'+this._editorObjname+'.edtDlg.Clear()')}
	if (this.isRecycle){
//		var _prop = "name=vchkpath,id=vchkpath,width=130,height=120,display=none,src=myzone?action=upimg2rec&channel="+xpow.URLencode('上传图片')+'&topic='+xpow.URLencode('上传图片')+'&remark='+imgurl;
//		var _e = xpow.m_cfg['ELEMT'].split(',');xpow.CreateElemt(_e[0],_prop);
	}
}

xpow.upload.prototype.setImg2E = function()
{
	var imgurl = $(this._vElemt).value
	if (imgurl == ''){alert('请上传一张图片或者文件');return}
	$(this._vimg).value=imgurl
	if (this.exportObj !=''){setTimeout(this.exportObj+'.Clear()',500)}
	else{setTimeout("xpow.point.clear('alert')",500)}
	var tObjArray=new Array()
	tObjArray['img'] = $('img_'+this._vimg)
	tObjArray['imgs'] = $('img_'+this._vimg+'s')
	tObjArray['img_w'] = $('_g_'+this.img_w)
	tObjArray['img_h'] = $('_g_'+this.img_h)
	tObjArray['img_m'] = $('_g_'+this._vFileSize)
	tObjArray['img_ext'] = $('_g_'+this._vFileExt)
	if (tObjArray['img']){
		if (tObjArray['img'].tagName.toLowerCase()=='img' ){
			tObjArray['img'].style.display='block';tObjArray['img'].src=imgurl+'?'+ new Date().getTime()
		}else{
			tObjArray['img'].background=imgurl+'?'+ new Date().getTime()
			if(tObjArray['imgs'])tObjArray['imgs'].style.background='url('+imgurl+'?'+ new Date().getTime()+') left repeat-y'
		}
		if (tObjArray['img_w'])tObjArray['img_w'].value=$(this.img_w).value
		if (tObjArray['img_h'])tObjArray['img_h'].value=$(this.img_h).value
	}
	if (tObjArray['img_m'])tObjArray['img_m'].value=$(this._vFileSize).value
	if (tObjArray['img_ext'])tObjArray['img_ext'].value=$(this._vFileExt).value
	if ($(this._focus) && $(this._focus).style.display !='none'){$(this._focus).focus()}else{window.focus()}
}

function doParseUpJSON(j){
	var JSON = j
	if (JSON.showpic!=''&&JSON.filemode==0){
		if (JSON.isresize>1){
			$(JSON.showpic).innerHTML = (JSON.smallimg!='')?'<a href="'+JSON.domain+JSON.smallimg+'" target="_blank"><img src="'+JSON.domain+JSON.smallimg+'?'+ new Date().getTime()+'"></a>':''
		}else{
			$(JSON.showpic).innerHTML = (JSON.smallimg!='')?'<a href="'+JSON.domain+JSON.bigimg+'" target="_blank"><img src="'+JSON.domain+JSON.smallimg+'?'+ new Date().getTime()+'"></a>':''
		}
	}else{
		$(JSON.showpic).innerHTML = '<a class="linkchna" target="_blank" title="点击下载" style="PADDING-LEFT: 20px; BACKGROUND: url('+JSON.domain+'/'+JSON._vFileExt+'image.gif) no-repeat" href="'+JSON.domain+JSON.velemt+'">'+JSON.sourcename+' ['+JSON._vFileSize+' '+JSON.sizeapp+']</a>'
	}
	
	if(JSON._vFileSize==''&& JSON.velemt )JSON._vFileSize='< 1'
	$('file_size').innerHTML = (JSON._vFileSize!='')?' <B>文件大小：</B>'+JSON._vFileSize+' '+JSON.sizeapp:' <B>文件大小：</B>'
	$('file_ext').innerHTML = (JSON._vFileExt!='')?' <B>文件类型：</B>.'+JSON._vFileExt:' <B>文件类型：</B>'
	$('_vFileSize').value = parseInt(JSON._vFileSize)
	$('_vFileExt').value = JSON._vFileExt
	$('_vFileName').value = JSON.sourcename
	if ($(JSON.velemt$v)){
		$(JSON.velemt$v).value=''
		if(JSON.velemt!='')$(JSON.velemt$v).value=JSON.domain+JSON.velemt
	}
	
	if ($(JSON.velemt$v)){
		$(JSON.velemt$v).value=''
		if(JSON.velemt!='')$(JSON.velemt$v).value=JSON.domain+JSON.velemt
	}
	
	if (JSON.succ){
		eval(JSON.succ.Replace('param',JSON2Str(JSON)))
	}
	
	
	xpow.Try.these(
		0,{location:'common.js',line:905,args:JSON.velemt$v+','+JSON.v_reimg_h$v+','+JSON.velemt},
		function(){
			if (JSON.filemode==0){
				$('file_width').innerHTML = (JSON.v_reimg_w)?' <B>图片宽度：</B>'+JSON.v_reimg_w+' dpi':' <B>图片宽度：</B>'
				$('file_height').innerHTML = (JSON.v_reimg_h)?' <B>图片宽度：</B>'+JSON.v_reimg_h+' dpi':' <B>图片宽度：</B>'
				$(JSON.v_reimg_w$v).value = JSON.v_reimg_w
				$(JSON.v_reimg_h$v).value = JSON.v_reimg_h
			}else{

			}
		}
	)
}


function JSON2Str(jsn){
	var re=''
	for(var i in jsn){
		app = ''; if (!xpow.point.Lang.isNumber(jsn[i]))app='\''
		re += i+':'+app+jsn[i]+app+','
	}
	re =re.toLeft(1)
	return '{'+re+'}'
}

function JSON2Post(jsn){
	return JSON2String(jsn,xpow.Use('letter').get(30))
}
function JSON2URI(jsn){
	return JSON2String(jsn,xpow.Use('letter').get(26))
}

function JSON2String(json,str){
	var re=new Array(),py=str,app = ''
	for(var i in json){ re.push(i+'='+app+json[i]+app) }
	return re.join(py)
}


xpow.setAttribute = function(o,ev){var arr=Array.prototype.slice.call(arguments,2);o[ev]=function(){for(var i=0,l=arr.length;i<l;i++){arr[i]()}}}	

//1 function dblEvt(el){
//2     if (document.all){
//3         el.fireEvent('ondblclick');
//4     }else{
//5         var evt = document.createEvent("MouseEvents");
//6         evt.initEvent("dblclick", true, true);
//7         el.dispatchEvent(evt);
//8     }
//9 }
//var responseText = document.createTextNode(xmlHttp.responseText);
//########################################
//########################################
var dbg=new Object();

dbg.obj=function(strObject,strMode,strRow)
{
	var _k,_v,_n=1,re='';
	if (isEmpty(strRow) || strRow==-1) strRow=20;
	try{
		for(_k in strObject){
			if (_n>=strRow) { alert(re); re=''; _n=1; }
			if (strMode=='key') re+=_k+'\n';
			else{
				_v=strObject[_k];
				if (typeof(_v)=='number' || typeof(_v)=='string' || typeof(_v)=='boolean') _v=(_v.length>50) ? _v.substr(0,50)+' ...' : _v;
				else _v='['+typeof(_v)+']';
				re+=_k+'='+_v+'\n';
			}
			_n++;
		}
		if (re!='') { alert(re); re=''; }
	}
	catch(e) { dbg.e(e); }
}

dbg.objString=function(strObject,strMode,strRow)
{
	var _k,_v,_n=1,re='';
	if (isEmpty(strRow) || strRow==-1) strRow=20;
	try{
		for(_k in strObject){
			if (strMode=='key') re+=_k+'\n';
			else{
				_v=strObject[_k];
				if (typeof(_v)=='number' || typeof(_v)=='string' || typeof(_v)=='boolean') _v=(_v.length>50) ? _v.substr(0,50)+' ...' : _v;
				else _v='['+typeof(_v)+']';
				re+=_k+'='+_v+'\n';
			}
			_n++;
		}
	}
	catch(e) { re=dbg.eString(e); }
	return re;
}

function fnBreakWordAll(o){
	var o = o || {},
	iWord = o.word || 13,
	iRe = o.re || '[a-zA-Z0-9]',
	bAll = o.all || false,
	sClassName = o.className || 'word-break-all',
	aEls = o.els || (function(){
	var aEls = [],
	aAllEls = document.getElementsByTagName('*'),
	re = new RegExp('(?:^|\\s+)' + sClassName + '(?:\\s+|$)');
	for(var i =0,iLen = aAllEls.length; i < iLen ; ++i){
	if(re.test(aAllEls[i].className)){
	aEls[aEls.length] = aAllEls[i];
	}
	}
	return aEls;
	})() || [],
		fnBreakWord = function(oEl){
		if(!oEl || oEl.nodeType !== 1){
			return false;
		}else if(oEl.currentStyle && typeof oEl.currentStyle.wordWrap==='string'){
			breakWord = function(oEl){
			oEl.runtimeStyle.wordWrap = 'break-word';
			return true;
		}
		return breakWord(oEl);
	}else if(document.createTreeWalker){
		var trim = function  (str) {
		str = str.replace(/^\s\s*/, '');
		var ws = /\s/,
		i = str.length;
		while (ws.test(str.charAt(--i)));
			return str.slice(0, i + 1);
		}
		breakWord = function(oEl){
			var dWalker=document.createTreeWalker(oEl,NodeFilter.SHOW_TEXT,null,false);
			var node,s,c = String.fromCharCode('8203'),
			//re = /([a-zA-Z0-9]{0,13})/;
			re = new RegExp('('+ iRe +'{0,' + iWord + '})');
			while (dWalker.nextNode()){
			node = dWalker.currentNode;
			s = trim(node.nodeValue).split(re).join(c);
			node.nodeValue = s;
		}
		return true;
	}
		return breakWord(oEl);
	}
	};
	for(var i=0,n=aEls.length; i<n; ++i){
		var sUa = navigator.userAgent,
		sTn = aEls[i].tagName.toLowerCase() ;
		if((/Opera/).test(sUa) || (/Firefox/).test(sUa) || ((/KHTML/).test(sUa) &&
		(sTn === 'td' || sTn === 'th')) || bAll){
		fnBreakWord(aEls[i]);
	}
	}
}

xpow.show2hide=function(tag,mode){
	if (!$(tag)){return}
	switch(mode){
	case 'slide':
		if($(tag).style.display==''){
			$j($(tag)).slideUp()
		}else{
			$j($(tag)).slideDown()
		}
	default:
		if($(tag).style.display==''){
			$(tag).style.display='none';
		}else{
			$(tag).style.display=''
		}
	}
}

dbg.e=function(e) { alert(dbg.eString(e))}
dbg.eString=function(e){var re='';for(var k in e) { re+=k+'='+e[k]+'\n' }return re;}
function doTestObject(strObject,strMode,strRow) { dbg.obj(strObject,strMode,strRow); }
xpow.show2hidev=function(tag,elemt,css){if ($(tag).style.display ==''){$(tag).style.display = 'none';$(elemt).className = css+'s';}else{$(tag).style.display = '';$(elemt).className = css;}}
xpow.show2hides=function(tag,elemt){if ($(tag).style.display == '' && $(elemt).value == ''){$(tag).style.display = 'none';}else{$(tag).style.display = '';}}
xpow.doShowCommentBox=function(){$('_sendCmts_').style.display = ''}
xpow.show2disable=function(tag,tags){if ($(tag)){$(tags).disabled=true;$(tag).disabled=false;$(tags).style.background='#f1f1f1';$(tag).style.background='#ffffff'}}
xpow.doConfirm=function(action){var _url=action;if(!confirm('确实要执行此操作吗?\n\n此操作可能无法恢复！')){return false;} else{location.href=_url}}

