//XPOW © author:tf2199@yahoo.com.cn  {build:2007.7   lastUpdate:2009.8  version: 1.3.0}

xpow.point = new Object;
xpow.emObj = new Object;

xpow.point.dlg = function(){}
Object.extend(xpow.point.dlg.prototype,{
	doInit : function(objName){
		this.objName = objName;
		this.mHeight = 'auto';
		this.mWidth = 240;
		this.mLeft = -228;
		this.mTop = 35;
		this.topOffset = 60;
		this.leftOffset = 25;
		
		this.id = objName;
		this.isTitle = 0;
		this.isMask = 1;
		this.maskName = this.objName+'.mask'
		this.maskOpacity = 70;
		this.maskBgColor = '#FFF';
		this.ISEXPORT = false
		
		this.expImg = ''
		this.mx = 0
		this.my = 0
	},
	Export : function(strhtml){
		if (this.ISEXPORT){return}
		this.html=strhtml
		if(typeof(this.objName)=='undefined'){this.objName = 'popmsg'}
		var self = this,dlgObj = $(this.objName),isie=xpow.browser.isIE?'ie':'moz',tparam={};
		if(xpow.point.Lang.isUndefined($j))var $j=jQuery
		tparam.der = $j(this.der)
		if (tparam.der.size()<1){
			tparam.elmtSl_h = document.documentElement.scrollHeight
			tparam.elmtSl_l = document.documentElement.scrollLeft
			tparam.elmtSl_t = xpow.browser.isSafari? document.body.scrollTop : document.documentElement.scrollTop
			tparam.elmtCl_w = document.documentElement.clientWidth
			tparam.elmtCl_h = document.documentElement.clientHeight
			tparam.bodyCl_h = document.body.clientHeight
			tparam.bodyCl_w = document.body.clientWidth
			this.mLeft = (typeof(this.mWidth)!='number'?tparam.bodyCl_w:tparam.bodyCl_w-this.mWidth)/2
			this.mLeft += tparam.elmtSl_l + parseInt(this.leftOffset)
			this.mHeight = (typeof(this.mHeight)!='number'?tparam.elmtCl_h-300:tparam.elmtCl_h-this.mHeight)/2
			this.mHeight += tparam.elmtSl_t + parseInt(this.topOffset)
		}else{
			var tOffset = xpow.point.getoffset(tparam.der[0],1)
			this.mTop = parseInt(tOffset.top) + parseInt(this.topOffset);
			this.mLeft = parseInt(tOffset.left) + parseInt(this.leftOffset);
		}
		
		
		if (this.expImg){
			this.html = '<table cellspacing="0" cellpadding="0" border="0" width="100%" for="popmsg.hold"><tr><td width="70" valign="top" align="left"><img src="http://www.chnimg.com/images/status/pop.'+this.expImg+'.png" /></td><td id="'+this.id+'_expimg_cc">'+this.html+'</td></tr></table>'
		}
		this.onSComplete=function(obj){ var obj=obj; setTimeout( function() { obj.adjastPos('center',false)},1)}
		this.onClose= this.onClose || function(){self.Clear()}
		this.ISEXPORT = true
		xpow.Use('script').jLoad('mbwindow',function(){self.Show()})
	}
})

xpow.point.dlg.prototype.Show = function(){
	this.makeMask()
	//try{
		makeContainer('','new',{top:this.mTop,button:this.button,properties:this.properties,id:this.id,left:this.mLeft,width:this.mWidth,description:this.html},{onClose:this.onClose,onComplete:this.onComplete,onSComplete:this.onSComplete})
	//}catch(e){
	//	if (this.onComplete)this.onComplete()
	//}
}

xpow.point.dlg.prototype.makeMask = function(){
	var tparam={}
	if (!this.isMask){ return }
	tparam.height = (document.documentElement.scrollHeight > document.body.clientHeight)?document.documentElement.scrollHeight:document.body.clientHeight
	tparam.width = document.documentElement.scrollWidth
	tparam.elmt = xpow.m_cfg['ELEMT'].split(',')
	tparam.prop = 'id='+this.maskName+',name='+this.maskName+',background='+this.maskBgColor;
	tparam.objmask = $(this.maskName); if (!tparam.objmask) {xpow.CreateElemt(tparam.elmt[2],tparam.prop);tparam.objmask = $(this.maskName)}
	tparam.objmask.style.background = this.maskBgColor;
	tparam.objmask.style.height = tparam.height+'px'
	tparam.objmask.style.width = tparam.width+'px'
	tparam.objmask.className = 'dlgmask'
}

xpow.point.dlg.prototype.setBtns = function(json){
	setContainerButton(json)
}

xpow.point.dlg.prototype.setInner = function(inner){
	if ($(this.id+'_expimg_cc'))$(this.id+'_expimg_cc').innerHTML=inner
}

xpow.point.getoffset = function(e,t)
{
	if (!xpow.point.Lang.isObject(e)){
		return alert('xpow.point.getoffset：\n\n['+this.der+'] object not exist!')
	}
	
	var et=e.offsetTop,el=e.offsetLeft;
	while(e=e.offsetParent)
	{
		et+=e.offsetTop;
		el+=e.offsetLeft;
	}
	var reOffset = new Array(1);     
	reOffset[0] = et;
	reOffset[1] = el;
	if (t){return {top:et,left:el}}
	return reOffset.toString()
}

xpow.point.dlg.prototype.Clear = function ()
{
	xpow.point.clear(this.objName)
	xpow.point.clear(this.id)
	this.ISEXPORT = false
}


xpow.point.setPop = function (iJSONParmas){xpow.emObj._PMS_.POPITEM = iJSONParmas}
xpow.point.getPop = function (key){ return eval('xpow.emObj._PMS_.POPITEM.'+key)}
xpow.point.setBtns = function (json){xpow.emObj._PMS_.COMMONPOP.setBtns(json)}
xpow.point.setInner = function (html){xpow.emObj._PMS_.COMMONPOP.setInner(html)}
xpow.point.doPop = function (inner,type)
{
	var re = '',_imgs = '',tPitm = xpow.emObj._PMS_.POPITEM,tIsbutton = false
	if(xpow.emObj._PMS_.COMMONPOP.ISEXPORT){xpow.emObj._PMS_.COMMONPOP.Clear()}
	xpow.emObj._PMS_.COMMONPOP = xpow.Use('dlg')
	xpow.emObj._PMS_.COMMONPOP.doInit('xpow.emObj._PMS_.COMMONPOP')
	xpow.emObj._PMS_.COMMONPOP.isMask = 0;
	xpow.emObj._PMS_.COMMONPOP.der = '';
	xpow.emObj._PMS_.COMMONPOP.isTitle = 1;
	xpow.emObj._PMS_.COMMONPOP.topOffset = 0;
	xpow.emObj._PMS_.COMMONPOP.leftOffset = 0;
	xpow.emObj._PMS_.COMMONPOP.mWidth = 478;
	xpow.emObj._PMS_.COMMONPOP.mHeight = 30;
	xpow.emObj._PMS_.COMMONPOP.PoPCss = 'popmsg';
	xpow.emObj._PMS_.COMMONPOP.canMove = true
	xpow.emObj._PMS_.COMMONPOP.maskBgColor = '#fff'
	xpow.emObj._PMS_.COMMONPOP.adjust = true
	xpow.emObj._PMS_.COMMONPOP.properties= 'draggable isfixtop '
	xpow.emObj._PMS_.COMMONPOP.id='xpow.emObj._PMS_.COMMONPOP'
	Object.extend(xpow.emObj._PMS_.COMMONPOP,tPitm)
	switch(type){
	default :_imgs = ''; break
	case 0 : _imgs = 'point'; break //仅提示，带关闭
	case 1 : _imgs = 'error'; xpow.emObj._PMS_.COMMONPOP.isMask = 1; tIsbutton = 1; break //错误，带确定
	case 2 : _imgs = 'sigh'; break //提示+确定+取消(！)
	case 3 : _imgs = 'point'; break //确定+取消
	case 4 : //单确定
		_imgs = 'point';
		xpow.emObj._PMS_.COMMONPOP.isMask = 1;
		xpow.emObj._PMS_.COMMONPOP.isTitle = 2
		tPitm.mode = 'sign'
		tIsbutton = 1
		break
	case 5 : //仅提示(p)
		_imgs = 'point';
		xpow.emObj._PMS_.COMMONPOP.isTitle = 2
		xpow.emObj._PMS_.COMMONPOP.isMask = 1;
		break;
	case 5.1 : //仅文字
		xpow.emObj._PMS_.COMMONPOP.isMask = 0;
		tPitm.mode = 'close'
		tIsbutton = 0;
		break;
	case 5.2 : //仅文字+确定+取消
		xpow.emObj._PMS_.COMMONPOP.isMask = 0;
		tPitm.mode = 'confirm'
		tIsbutton = 1;
		break;
		
	case 6 : _imgs = 'point'; tIsbutton = 1; break; //提示，带确定+取消
	case 7 : _imgs = 'succ'; break; //提示成功！
	case 7.2 :
		_imgs = 'succ'; 
		xpow.emObj._PMS_.COMMONPOP.isMask = 1;
		xpow.emObj._PMS_.COMMONPOP.isTitle = 2
		tPitm.mode = 'sign'
		tIsbutton = 1
		break; //提示成功！
	case 7.3 :
		_imgs = 'succ';
		xpow.emObj._PMS_.COMMONPOP.isMask = 1;
		xpow.emObj._PMS_.COMMONPOP.isTitle = 2
		tIsbutton = false
		break; //提示操作失败！
	case 7.1 : _imgs = 'faild'; break; //提示操作失败！
	case 8 : _imgs = 'access'; break; //提示操作正确！
	}
	
	xpow.emObj._PMS_.COMMONPOP.expImg=_imgs
	xpow.emObj._PMS_.COMMONPOP.Export(inner)
	xpow.emObj._PMS_.POPITEM=''
}

xpow.point.adjustment = function(){xpow.Try.these(function(){$j($('xpow.emObj._PMS_.COMMONPOP')).adjastPos('center',true)})}
xpow.point.popClear = function(){xpow.Try.these(function(){xpow.emObj._PMS_.COMMONPOP.Clear()})}

xpow.point.fixWindow = function(){}
xpow.point.fixWindow.prototype.doInit = function(objName){
	this.objName = objName
	this.width = 220
	this.height = 'auto'
	this.bdcolor = '#666'
	this.bgcolor = '#f1f1f1'
	this.topOffset = 0
	this.leftOffset = 0
	this.mTop = 150
	this.mLeft = 150
	this.der = ''
	this.ISEXPORT = false
	this.innerHTML = ''
}
xpow.point.fixWindow.prototype.Export = function (strHTML){
	if (!$(this.der)){
		alert('xpow.point.fixWindow error: position element not exist!')
		return
	}else{
		var tOffset = xpow.point.getoffset($(this.der)).split(',')
		this.mTop = parseInt(tOffset[0]) + parseInt(this.topOffset)
		this.mLeft = parseInt(tOffset[1]) + parseInt(this.leftOffset)
	}
	this.innerHTML=strHTML
	xpow.point.Content.append('<div id="bgLayer" class="bgLayer">')
	xpow.point.Content.append('<div class="ptb" style="border-left:1px ',this.bdcolor,' solid;border-right:1px ',this.bdcolor,' solid; margin-left:2px;width:',this.width-4,'px"></div>')
	xpow.point.Content.append('<div class="ptb" style="border-left:1px ',this.bdcolor,' solid;border-right:1px ',this.bdcolor,' solid; margin-left:1px;width:',this.width-2,'px"></div>')
	xpow.point.Content.append('<div id="_html"></div>')
	xpow.point.Content.append('<div class="ptb" style="border-left:1px ',this.bdcolor,' solid;border-right:1px ',this.bdcolor,' solid; margin-left:1px;width:',this.width-2,'px"></div>')
	xpow.point.Content.append('<div class="ptb" style="border-left:1px ',this.bdcolor,' solid;border-right:1px ',this.bdcolor,' solid; margin-left:2px;width:',this.width-4,'px"></div>')
	xpow.point.Content.append('<div style="background:url(http://www.chnimg.com/images/shop/p_window_b_99.gif) center top no-repeat; position:relative; top:-1px; overflow:hidden; width:',this.width-4,'px; height:6px"></div>')
	xpow.point.Content.append('</div>')
	xpow.point.Content.append('<div class="ptb" style="border-left:1px ',this.bdcolor,' solid;border-right:1px ',this.bdcolor,' solid; background:',this.bdcolor,'; margin-left:2px;width:',this.width-4,'px"></div>')
	xpow.point.Content.append('<div class="ptb" style="border-left:1px ',this.bdcolor,' solid;border-right:1px ',this.bdcolor,' solid; background:',this.bgcolor,'; margin-left:1px;width:',this.width-2,'px"></div>')
	xpow.point.Content.append('<div class="ptba" id="',this.objName,'_inner" style="border-left:1px ',this.bdcolor,' solid; background:',this.bgcolor,'; border-right:1px ',this.bdcolor,' solid; width:',this.width-10,'px">')
	xpow.point.Content.append(strHTML)
	xpow.point.Content.append('</div><div class="ptb" style="border-left:1px ',this.bdcolor,' solid; border-right:1px ',this.bdcolor,' solid; background:',this.bgcolor,'; margin-left:1px;width:',this.width-2,'px"></div>')
	xpow.point.Content.append('<div class="ptb" style="border-left:1px ',this.bdcolor,' solid;border-right:1px ',this.bdcolor,' solid;background:',this.bdcolor,'; margin-left:2px;width:',this.width-4,'px"></div>')
	xpow.point.Content.append('<div style="background:url(http://www.chnimg.com/images/shop/p_window_b.gif) center top no-repeat; position:relative; top:-1px; overflow:hidden; width:',this.width-4,'px; height:6px"></div>')
	vprop = 'id='+this.objName+',name='+this.objName+'display=,top='+this.mTop+'px,left='+this.mLeft+'px' 
	var dlgObj = $(this.objName)
	if (!dlgObj){xpow.CreateElemt('div',vprop);dlgObj = $(this.objName)}
	dlgObj.innerHTML = xpow.point.Content.toString()
	dlgObj.className = 'pointbox'
	dlgObj.setStyle({display:''})
	dlgObj.style.top = (this.mTop-dlgObj.offsetHeight)+'px'
	dlgObj.style.left = ($(this.der).offsetWidth/2 + tOffset[1]*1-dlgObj.offsetWidth/2)+'px'
	$('bgLayer').style.height = dlgObj.offsetHeight+'px'
	$('bgLayer').style.width = dlgObj.offsetWidth+'px'
	$('_html').style.height = $(this.objName+'_inner').offsetHeight+'px'
	$('_html').style.width = $(this.objName+'_inner').offsetWidth+'px'
	this.ISEXPORT = true
	tOmove ={der:this.der,obj:this.objName,topOffset:parseInt(this.topOffset),leftOffset: parseInt(this.leftOffset)}
	window.onresize = function(ev){
		if(!$(tOmove.der)){return}
		var tOffset = xpow.point.getoffset($(tOmove.der)).split(',')
		this.Top = parseInt(tOffset[0]) + parseInt(tOmove.topOffset)-dlgObj.offsetHeight
		this.Left = $(tOmove.der).offsetWidth/2 + tOffset[1]*1-dlgObj.offsetWidth/2
		animate(dlgObj,{'top':this.Top,'left':this.Left})
	}
	window.document.onclick = function(){
		xpow.osEvent.catchSrc()
		var celmt = xpow.osEvent.cSrcElmt.id
		var oxy = {mx:xpow.osEvent.cX*1+document.documentElement.scrollLeft*1,my:(xpow.browser.isIE)?xpow.osEvent.cY*1+document.documentElement.scrollTop*1:xpow.osEvent.cY*1,left:dlgObj.offsetLeft,top:dlgObj.offsetTop,right:(dlgObj.offsetLeft)*1+(dlgObj.offsetWidth)*1,bottom:(dlgObj.offsetTop)*1+(dlgObj.offsetHeight)*1}
	/*	xpow.point.Content.append('oxy.mx:'+oxy.mx+' > oxy.left:'+oxy.left+'<br>' )
		xpow.point.Content.append('oxy.right:'+oxy.right+' > oxy.mx:'+oxy.mx+'<br>')
		xpow.point.Content.append('oxy.my:'+oxy.my+' > oxy.top:'+ oxy.top+'<br>')
		xpow.point.Content.append('oxy.bottom:'+oxy.bottom+' > oxy.my:'+ oxy.my+'<br>')
		xpow.point.Content.append('scrollTop:'+document.documentElement.scrollTop+'<br>')
		xpow.point.Content.append('scrollLeft:'+document.documentElement.scrollLeft+'<br>')
		$('test').innerHTML = xpow.point.Content.toString()
	*/	
		if(celmt != tOmove.der){
			if ($g(xpow.osEvent.cSrcElmt,'for')=='popmsg.hold'){return}
			if( oxy.mx>oxy.left && oxy.mx<oxy.right && oxy.my>oxy.top && oxy.my<oxy.bottom ){return }
			$('bgLayer').style.display='none'
			animate(dlgObj,{'width':'show','height':'show'},function(){xpow.point.clear(tOmove.obj)})
		}
	}
}
xpow.point.fixWindow.prototype.reExport = function(){this.Export($(this.objName+'_inner').innerHTML)}
xpow.point.fixWindow.prototype.getInnerHTML = function(){return $(this.objName).innerHTML}
xpow.point.fixWindow.prototype.getExportHTML = function(){return this.innerHTML}
xpow.point.fixWindow.prototype.selfClear = function(action){$('bgLayer').style.display='none';animate($(this.objName),{'height':'hide','width':'hide'},function(){xpow.point.clear(this.objName);xpow.point.Exec(action)})/*; Effect.DropOut($(this.objName),{after:function(){xpow.point.clear(this.objName);xpow.point.Exec(action)}})*/}
xpow.point.fixWindow.prototype.Clear = function(){xpow.point.clear(this.objName)}
xpow.point.Exec = function(arg){if (typeof arg == 'function'){arg()}}
xpow.point.clear = function(obj)
{
	switch(obj){
	case 'alert':

	case 'pop':
		if (xpow.emObj._PMS_.COMMONPOP)xpow.emObj._PMS_.COMMONPOP.Clear()
		break;
	case 'fixwindow':
		if($(obj)) $(obj).setStyle({opacity: 100})
		xpow.removeElemt(obj,0);
		xpow.removeElemt(obj+'.mask',0)
		break;
	default:
		xpow.removeElemt(obj,0);
		xpow.removeElemt(obj+'.mask',0)
		window.document.onclick=null
		break;
	}
	document.oncontextmenu = new Function('xpow.osEvent.cEvent.returnValue=true');
}


function animate(obj,effect,cfunc,speed){
	jQuery(obj).animate(effect, {
	   duration:speed?speed:300,
	   complete:function(){if (cfunc)cfunc()}
	});
}


xpow.point.Lang ={
	apply : function(C,A){if(C&&A&&typeof A=="object"){for(var B in A){C[B]=A[B]}}return C},
	applyIf : function(C,A){if(C&&A&&typeof A=="object"){for(var B in A){if(!this.hasOwnProperty(C,B)){C[B]=A[B]}}}return C},
	hasOwnProperty : function(C,D){if(Object.prototype.hasOwnProperty){return C.hasOwnProperty(D)}},
	isArray:function(D){if(D){var C=xpow.point.Lang;return C.isNumber(D.length)&&C.isFunction(D.splice)}return false},
	isBoolean:function(B){return typeof B==="boolean"},
	isFunction:function(B){return typeof B==="function"},
	isNull:function(B){return B===null},
	isNumber:function(B){return typeof B==="number"&&isFinite(B)},
	isInt:function(B){if (B=='')return false; return !/[^0-9]/ig.test(B)},
	isObject:function(B){return(B&&(typeof B==="object"||this.isFunction(B)))||false},
	isString:function(B){return typeof B==="string"},
	isUndefined:function(B){return typeof B==="undefined"}
}


xpow.point.getStyle = function( elmt, name ) 
{
	if (!xpow.point.Lang.isObject(elmt)){elmt = $(elmt)}
    if (elmt.style[name]){ 
        return elmt.style[name]; 
    }else if (elmt.currentStyle) { 
        return elmt.currentStyle[name]; 
    }else if (document.defaultView && document.defaultView.getComputedStyle)  { 
        name = name.replace(/([A-Z])/g,'-$1');  //传统的"text-Align"风格的规则书写方式，而不是"textAlign" 
        name = name.toLowerCase(); 
        var s = document.defaultView.getComputedStyle(elmt,''); 
        return s && s.getPropertyValue(name); 
    } else { 
        return null; 
    }
} 

xpow.point.Slide = {
	oMdps : '', oIdps:'',oEdps : '',oTag:'',sTagname:'a',iWidth:0,speed:3000,length:0,current:{},timer : new Array(),
	init : function(maindps,imgdps,exdps,indextag,intagname,auto,width){
		this.oMdps = xpow.point.Lang.isObject(maindps)?maindps:$(maindps)
		this.oIdps = xpow.point.Lang.isObject(imgdps)?imgdps:$(imgdps)
		this.oEdps = xpow.point.Lang.isObject(exdps)?exdps:$(exdps)
		this.oTag = xpow.point.Lang.isObject(indextag)?indextag:$(indextag)
		this.sTagname = (intagname)?intagname:'a'
		this.iWidth= (width)?width:$t(this.oIdps,'img')[0].width+3
		this.n=20;this.t=50;this.auto=auto;var s=this
		var c=$t(this.oTag,this.sTagname)
		for(var i=0;i<c.length;i++){c[i].index=i;c[i].onmouseover = s.doMaual;}
		c=null
		this.oEdps.innerHTML=this.oIdps.innerHTML
		this.oIdps.scrollLeft=this.oIdps.scrollWidth
		if (this.auto){
			this.timer['smar'] = setInterval(function(){s.doAuto()},s.speed)
			this.oIdps.onmouseover=function() {clearInterval(s.timer['smar'])}
			this.oIdps.onmouseout=function() {s.timer['smar']=setInterval(function(){s.doAuto()},s.speed)}
			this.oTag.onmouseout=function() {if(!s.timer['smar'])s.timer['smar']=setInterval(function(){s.doAuto()},s.speed)}
		}
	},
	doAuto : function(){
		if (!this.current.sn)this.current.sn=0
		this.current.sn +=1
		if(this.length>0){ if (this.current.sn == this.length) this.current.sn=0}
		this.doSlide(this.current.sn)
	},
	doMaual : function(sn){
		var t = xpow.point.Slide
		clearInterval(t.timer['smar'])
		t.doSlide(-1,this)
	},
	doSlide : function(sn,obj){
		var ot = obj,t=this
		var x=this.oMdps.scrollLeft,c=$t(this.oTag,this.sTagname)
	
		if (sn>=0){
			ot = c[sn]
			ot.index=sn
		}
		d=ot.index*this.iWidth-x
		this.length = c.length
		this.current.sn = ot.index
		this.current.obj = ot
		for(var ix=0;ix<c.length;ix++){
			c[ix].className=(ix!=this.current.sn)?'Es':'Esc'
		}
		
		if(!d) return;
		for(var i=0;i<this.n;i++)(function(){
			if(t.timer[i]){clearTimeout(t.timer[i])}
			var j=i;t.timer[i]=setTimeout(function(){
			t.oMdps.scrollLeft=x+Math.round(d*Math.sin(Math.PI*(j+1)/(2*t.n)))
			},(i+1)*t.t);
		})();
	},
	Marquee : function(){
		var oT = xpow.point.Slide.oMdps,oE = xpow.point.Slide.oEdps
		if(oT.scrollLeft<=0){oT.scrollLeft+=oE.offsetWidth}else{oT.scrollLeft--}
	}
}


xpow.point.Message = {
	params :{},
	lang:{
		'login':'请你 <a class="linkchn-n" href="http://passport.chndesign.{$app}/?comefrom={$url}">登陆</a>/ <a class="linkchn-n" href="http://passport.chndesign.{$app}/register">注册</a> 为个人用户后继续当前的操作！<p></p>',
		'login.co':'请你 <a class="linkchn-n" href="http://passport.chndesign.{$app}/?comefrom={$url}">登陆</a>/ <a class="linkchn-n" href="http://passport.chndesign.{$app}/register">注册</a> 为企业会员后继续当前的操作！<p></p>',
		'utp.co':'对不起，只有个人会员才能使用！<BR>你当前是 企业会员 ！',
		'utp.user':'对不起，只有企业会员才能使用！<BR>你当前是 个人会员！',
		'integral':'对不起，你的积分不够！<p></p>'
	},
	Export : function(ibt,s,c,d){
		ibt = (ibt)?ibt:0
		s = (s)?s:'',c = (c)?c:''
		if (xpow.osEvent.cSrcElmt&&!d){
			xpow.point.setPop({der:xpow.osEvent.cSrcElmt.id,isButton:ibt,Submit:s,Cancel:c,isMask:1,topOffset:40,leftOffset:0})
		}else{
			xpow.point.setPop({isMask:1,topOffset:40,Submit:s,Cancel:c,leftOffset:0,isButton:ibt})
		}
		xpow.point.doPop(this.params.msg,2);
		return false
	},
	getLang : function(t,url){
		try{ xpow.osEvent.catchSrc() }catch(e){ }
		this.params.msg = this.lang[t].replace(/{\$app}/g,xpow.point.Path.getApp())
		if (url)this.params.msg = this.params.msg.Replace('url',url)
		return this.params.msg
	},
	login : function(url,t){
		if (t){
			this.getLang('login.co',url)
		}else{
			this.getLang('login',url)
		}
		return this.Export()
	},
	UTP : function(t){
		if (t){ this.getLang('utp.user') }else{ this.getLang('utp.co') }
		return this.Export()
	},
	integral : function(){
		this.getLang('integral')
		return this.Export(1)
	},
	self : function(m,s,c){
		this.params.msg = m+'<p></p>'
		return this.Export(1,s,c,1)
	},
	Send :{
		oDLG : '',param:{},
		init : function(param){
			this.param = param
			this.oDLG = xpow.Use('dlg')
			var tpl='<div class="globalusermsgbox"><div class="title">给<span class="username" id="username">'+param.username+'</span>发消息</div><div class="msgbox"><textarea id="msgarea"></textarea></div></div>'
			this.doExport(tpl)
		},
		doExport : function(restr){
			var self = this
			if (this.oDLG.ISEXPORT){this.oDLG.Clear()}
			this.oDLG.doInit('xpow.point.Message.Send.oDLG');
			this.oDLG.onComplete = function(){}
			this.oDLG.button = [{description:'确 定',action:function(){self.ac()}}]
			this.oDLG.mWidth = 350
			this.oDLG.mHeight = 410
			this.oDLG.isMask = 0
			this.oDLG.Export(restr);
		},
		ac : function(){
			var param={}
			var otxt = $j('#msgarea')[0],oval = otxt.value.toHtmlTrim()
			if (oval==''){otxt.value=''; return alert('请输入消息内容！')}
			param._mail_f_remark=oval
			param._mail_f_userid=this.param.userid
			this.param.insend=true
			this.JSNinit('vsi')
			xpow.JSN.SendX('sms',JSON2Post(param))
		},
		JSNinit : function(st){
			xpow.JSN.Init('\\\\/system/user/','',0,st,0,0)
		},
		succ : function(){
			
		}
	},
	toAdmin : {
		oDLG : '',param:{},
		init : function(param){
			this.param = param
			this.oDLG = this.oDLG ? this.oDLG : xpow.Use('dlg')
			this.doExport(this.getInner())
		},
		getInner : function(){
			var tpl='<form id="am_cm_form" method="post"><div class="am_cm_box">'
			tpl+='<table><tr><td>姓名：</td><td><input type="text" class="amtxt" maxlength="50" name="am_cm_username" id="am_cm_username" /></td></tr>'
			tpl+='<tr><td>Email：</td><td><input type="text" class="amtxt" maxlength="150" name="am_cm_email" id="am_cm_email" /></td></tr>'
			tpl+='<tr><td>联系电话：</td><td><input type="text" class="amtxt" maxlength="150" name="am_cm_tel" id="am_cm_tel" /></td></tr>'
			tpl+='<tr><td valign="top">反馈内容：</td><td><textarea name="am_cm_remark" id="am_cm_remark" ></textarea></td></tr>'
			tpl+='</table></div></form>'
			return tpl
		},
		ac : function(){
			var param={}
			if (xpow.Check.Form('am_cm_username,am_cm_email,am_cm_tel,am_cm_remark','用户名,Email,联系电话,反馈内容','am_cm_form',0)){
				param.username=trim($('am_cm_username').value)
				param.email=trim($('am_cm_email').value)
				param.tel=trim($('am_cm_tel').value)
				param.remark=trim($('am_cm_remark').value)
				xpow.JSN.Init('\\\\/system/user/','',0,0,0,0)
				xpow.JSN.SendX('toadmin',JSON2Post(param))
			}
			
		},
		succ : function(){
			alert('发送成功！'); this.oDLG.Clear()
		},
		doExport : function(restr){
			var self = this
			if (this.oDLG.ISEXPORT){this.oDLG.Clear()}
			this.oDLG.doInit('xpow.point.Message.toAdmin.oDLG');
			this.oDLG.onComplete = function(){}
			this.oDLG.button = [{description:'确 定',action:function(){self.ac()}}]
			this.oDLG.mWidth = 520
			this.oDLG.mHeight = 410
			this.oDLG.isMask = 0
			this.oDLG.Export(restr);
		}
		
	}
	
}

xpow.Try = {
	sn : 0,
	emssage : '',
	isreport : 0,
	_err_ : {location:'',line:0,name:''},
	foundErr : false,
	these: function() {
		var returnValue
		this.Clear()
		for (var i = 0, length = arguments.length; i < length; i++) {
			var lambda = arguments[i];
			if(i==0){if(lambda==1){this.isreport=1}}
			if(i==1 && this.isreport){this._err_ = lambda }
			if (typeof lambda == 'function'){
				try {
					returnValue = lambda();
					break;
				} catch (e) {
					this.sn += 1
					this.foundErr = true
					this.emssage += 'error #'+this.sn+': '+e.message+'\n'
				}
			}
		}
		if (this.isreport){this.outErr()}
		return returnValue;
	},
	outErr : function(){
		var tMsg = '[xpow.Try] catch these errors:\n'
		if (this.foundErr){
			for (var i in this._err_){
				tMsg += i+': '+this._err_[i]+'\n'	
			}
			this.emssage = tMsg+'=================\n'+this.emssage
			alert(this.emssage)
		}
		this.Clear()
	},
	Clear : function(){
		this.emssage = ''
		this._err_ = {location:'',line:0,name:''}
		this.isreport = 0
		this.sn = 0
		this.foundErr = false
	}
}


xpow.osEvent = {
	aEvent : '',
	debug : 0,
	aFunc : '',
	cEvent : '',
	cSrcElmt : '',
	cKeyCode : '',
	aElement : '',
	cButton : '',
	cX : '',
	cY : '',
	attEventList : function(regElement,Event,Func){
		if (this.debug)alert(regElement + '#' + $(regElement))
		this.aEvent = Event;var tAct = ($(regElement))?$(regElement).value : regElement ,
		tAct = tAct.toReSymbol('，',',')
		tAry = tAct.split(',')
		for (var i=0; i<tAry.length; i++){if (this.debug){alert(tAry[i]+' ==> '+$(tAry[i])+'  '+Func+' ')};if(tAry[i]!=''&&$(tAry[i]))eval('$(\''+tAry[i]+'\').'+this.getEvent()+' = function(){'+Func+'}')}
	},
	attEvent : function(regElement,Event,Func){
		if (xpow.point.Lang.isObject(regElement)){
			switch(Event){
			case 'change': regElement.onchange=Func;break;
			case 'click': regElement.onclick=Func;break;
			case 'omv': regElement.onmouseover=Func;break;
			case 'omt': regElement.onmouseout=Func;break;
			
			}
			return
		}
		
		if (!regElement){return}
		this.aEvent = Event
		this.aFunc = Func
		this.aElement = regElement
		xpow.Try.these(
			xpow.osEvent.debug,{Location:'http://www.chnimg.com/js/xpow.js',Line:660,CallBackName:'xpow.osEvent.attEvent()'},
			function (){
				if (xpow.osEvent.debug)alert(xpow.osEvent.aElement + $(xpow.osEvent.aElement)+'#['+ xpow.osEvent.getEvent()+']' +'==>' + xpow.osEvent.aFunc);
				eval('$("'+xpow.osEvent.aElement+'").'+xpow.osEvent.getEvent()+' = function(){'+xpow.osEvent.aFunc+'}')
			}
		)
	},
	setEvent : function(t){try{window.event.keyCode=t}catch(e){}},
	attEvents : function(regElement,Event,Func){
		this.aEvent = Event;
		if (this.debug)alert(regElement + ' =*>' + regElement+' **>'+Func);
		eval(regElement+'.'+this.getEvent()+' = function(){'+Func+'}')
	},
	Search : function(){
		func=this.Search.caller;
		while(func!=null){
			var arg0=func.arguments[0];
			if(arg0){
				if(arg0.constructor==MouseEvent) return arg0;
				if(arg0.constructor==KeyboardEvent){this.cKeyCode=arg0.which; return arg0}
				if (this.debug)alert('event:\n'+arg0.constructor+'=='+Event+'+'+(arg0.constructor==MouseEvent)+' **which='+arg0.which)
			}
			func=func.caller;
		}
		return null;
	},
	Catch : function(){ if (window.event){this.cEvent = window.event; this.cButton=window.event.button ;this.cKeyCode = window.event.keyCode}else{this.cEvent = this.Search(); this.cButton=this.cEvent.button }; return this.cEvent },
	catchSrc : function(){ this.Catch(); if (this.cEvent.srcElement){this.cSrcElmt = this.cEvent.srcElement}else{this.cSrcElmt = this.cEvent.target}; this.getX(); this.getY(); return this.cSrcElmt},
	getX : function(){ this.cX = (window.event)?event.x:this.cEvent.pageX; return this.cX },
	getY : function(){ this.cY = (window.event)?event.y:this.cEvent.pageY; return this.cY },
	testXY : function(){
		var re = 'window X Y test ##in browser\''+xpow.browser.userAgent+'\' :\n==================================='
		if (xpow.browser.isIE5){
			re += '\n\nwindow.event.[x,y]:'+window.event.x+','+window.event.y
			re += '\n\nevent.[clientX,clientY]:'+event.clientX+','+event.clientY
			re += '\n\nevent.[offsetX,offsetY]:'+event.offsetX+','+event.offsetY
			re += '\n\nwindow.event.[screenX,screenY]:'+window.event.screenX+','+window.event.screenY
		}else{
			var evt = this.cEvent
			re += '\n\nevent.[pageX,pageY]:'+evt.pageX+','+evt.pageY
			re += '\n\nevent.[clientX,clientY]:'+evt.clientX+','+evt.clientY
			/*re += '\n\nevent.[offsetX,offsetY]:'+evt.offsetX+','+evt.offsetY*/
			re += '\n\nevent.[screenX,screenY]:'+evt.screenX+','+evt.screenY
		}
		alert(re)
	},
	getElmtXY : function(obj){
		if(!obj){return}
		var re=''
		var t=parseInt(obj.offsetTop);
		var l=parseInt(obj.offsetLeft);
		var h=parseInt(obj.offsetHeight);
		var w=parseInt(obj.offsetWidth);
		
		re+="左上:("+l+","+t+")";
		re+="右上:("+(l+w)+","+t+")";
		re+="左下:("+l+","+(t+h)+")";
		re+="右下:("+(l+w)+","+(t+h)+")";
		alert(re)
		
	},
	getEvent : function(){
		var tE;switch (this.aEvent){
		case 'ock' : tE = 'onclick'; break;
		case 'okp' : tE = 'onkeyup'; break;
		case 'okd' : tE = 'onkeydown'; break;
		case 'ofc' : tE = 'onFocus'; break;
		case 'omv' : tE = 'onmouseover'; break;
		case 'omm' : tE = 'onmousemove'; break;
		case 'omt' : tE = 'onmouseout'; break;
		case 'omd' : tE = 'onmousedown'; break;
		case 'omp' : tE = 'onmouseup'; break;
		case 'obl' : tE = 'onblur'; break;
		case 'ocg' : tE = 'onchange'; break;
		default : tE = this.aEvent; break;
		}return tE
	}
}

xpow.emObj._PMS_ = {
	ZONEUPLOADPATH : '', COMMONPOP : '',POPITEM:''
}

xpow.dir = function(objname)
{
	this.objname = objname;
	this.dirnum = 5;
	this.sn = 1;
	this.timeout = ''
	this._interval = 1000;
	this._interval = 3000;
	this.dirAry = '';
}
xpow.dir.prototype.doInit = function(){this._interval = ($('interval'))?$('interval').value * 1000:3000;this.dirAry = ($('focus'))?$('focus').value.split(','):'';if ($(this.dirAry[0]) && this._interval > 0){this.timeout = setInterval(this.objname+'.chgFocus()',this._interval)}}
xpow.dir.prototype.chgFocus = function(){this.sn ++;if (this.dirAry ==''){this.dirAry = $('focus').value.split(',')};if (this.sn > this.dirAry.length){this.sn = 1;};this.setFocus(this.sn)}
xpow.dir.prototype.setFs = function(i) {this.sn = i; this.setFocus(i)}
xpow.dir.prototype.setFocus = function(i){for (var x = 0; x < this.dirAry.length; x ++){($(this.dirAry[x]))?$(this.dirAry[x]).style.display='none':''};($(this.dirAry[i-1]))?$(this.dirAry[i-1]).style.display='':''}
xpow.dir.prototype.next = function(){if (this.sn < this.dirAry.length){clearInterval(this.timeout);this.setFs(this.sn+1)}}
xpow.dir.prototype.prev = function(){if (this.sn >1){clearInterval(this.timeout);this.setFs(this.sn-1)}}

xpow.point.Search = {
	sTxt : '请输入搜索条件',sBody : '',sURI : '',sParam : '',isSet:false,dirNew : false,sMax:30,sElemt:''/*$('s.txt')*/,sAC:'',isKey:false,sMode:0,Modes : '',
	errChar : [',','@','$','&','%','?','!','|','"','\'','\\','\*','/','=','<','>',';','(',')','[',']','{','}','^','_','`','-'],
	init : function(){this.setInner();this.setElmt()},
	iTxt : function(){this.setElmt(); if (this.sParam == ''){this.setVal(this.sTxt)}},
	iInput : function(){this.setElmt();if (this.sParam == this.sTxt){this.setVal('')}},
	getElmt : function(){this.sElemt = $('s.txt')},
	setVal : function(str){this.getElmt(); this.sElemt.value =  str; this.sElemt.className = (str=='')?'txtval':'txtinit'},
	setElmt : function(){this.getElmt();this.sParam = trim(this.sElemt.value)},
	iKey : function(){xpow.osEvent.catchSrc(); if(xpow.osEvent.cKeyCode==13){this.Go()/*eval(this.sAC)*/}},
	setModes : function(json){ this.Modes = json},
	getModes : function(){return this.Modes},
	setsMode : function(num){ this.sMode = num },
	setModesOp : function(mode,json){
		this.setsMode(mode)
		this.setModes(json)
		this.getModesOp()
	},
	getModesOp : function(){
		var re = '<select name="s.modes.s" id="s.modes.s">'
		for (var i in this.Modes){re += '<option value='+this.Modes[i]+'>'+i+'</option>'}
		re += '</select>'
		return re
	},
	setDefault : function(json){
		try{
			var tSel = $('s.modes.s')
			tSel.value = json.s_modes_s
		}catch(e){	}
		$('s.txt').value= json.s_txt
		$('s.txt').className = ''
	},
	setInner : function(){
		//if (this.isSet){return}
		this.sBody = '<input maxlength="'+this.sMax+'" class="txtinit" onBlur="xpow.point.Search.iTxt()" type="text" value="'+this.sTxt+'" id="s.txt">'
		switch (this.sMode){
		case 0 :
		this.sBody += ' <input type="button" class="sch-btn" onClick="xpow.point.Search.Go()" value="搜 索"/>'
		break;
		case 1 :
		this.sBody += this.getModesOp()+' <input type="button" class="sch-btn" onClick="xpow.point.Search.Go()" value="搜 索" />'
		break;
		default : this.sBody = '';break;
		}

		try{
			$('search.body').innerHTML = this.sBody;
			xpow.osEvent.attEvent('s.txt','ock','xpow.point.Search.iInput()')
			xpow.osEvent.attEvent('s.txt','obl','xpow.point.Search.iTxt()')
			xpow.osEvent.attEvent('s.txt','okp','xpow.point.Search.iKey()')
			//this.isSet = true
		}catch(e){/*alert('search.body not exist!\n\n'+e.message)*/}
	},
	Go : function(){
		this.setElmt();
		if (this.sParam =='' || this.sParam == this.sTxt){return};
		var tKey = this.ParseKey()
		if (tKey == ''){$('s.txt').value = '';return false}
		tKey = this.sURI.Replace('sch.text',encodeURI(tKey))
		if ($('s.modes.s'))tKey = tKey.Replace('modes',$('s.modes.s').value)
		if (this.dirNew){
			xpow.point.Path.RedirNew(tKey)
		}else{
			xpow.point.Path.Redirect(tKey)
		}
	},
	ParseKey : function(){
		var tKey = trim($('s.txt').value)
		for(var i=0;i<this.errChar.length;i++){
			if(tKey.indexOf(this.errChar[i])>-1){
				try{
					tKey = tKey.toReSymbol(this.errChar[i],'')
				}catch(e){
					tKey = this.errChar[i]
				}
			}
		}
		return tKey
	}
}


xpow.point.Cookie = {
	set : function(name, value, hours){
		var expire = '';
		if(hours){
			expire = new Date((new Date()).getTime() + hours * 3600000);
			expire = '; expires=' + expire.toGMTString();
		}
		document.cookie = name + '=' + escape(value) + expire+';path=/;domain=.chndesign.'+xpow.point.Path.getApp(); 
	},
	get : function(name){
		var cookieValue = '';
		var search = name + '=';
		if(document.cookie.length > 0){ 
			offset = document.cookie.indexOf(search);
			if (offset != -1){ 
				offset += search.length;
				end = document.cookie.indexOf(';', offset);
				if (end == -1) end = document.cookie.length;
				cookieValue = unescape(document.cookie.substring(offset, end))
			}
		}
		return cookieValue;
	},
	getA : function(name){name = name.replace('\.','%2E');return this.get(name).split('&')[0]}
}

xpow.point.Favo ={
	objName : 'xpowFavo',appendURI : '',
	channel : '',aChannel : '',aUTP : 0,
	oDLG : '',oJSN :'',oDer : '',param:{},
	Body : '',url : '',src : '',islogin : '',
	topic : '',reID : 'reid',fucMode : 0,
	init : function(reid){
		if (!this.oDLG){
			this.oDLG = xpow.Use('dlg')
			this.oDLG.doInit(this.objName+'.oDLG');
		}
		this.getBody()
		this.reID = (reid)?reid: $('reid').value;
		if (this.oDer == '')this.oDer = 'collect';
	},
	setAppendUrl : function(re){this.appendURI = re	},
	addItem : function(){
		if (!this.islogin){return xpow.point.Message.login() }
		if (this.utp==1){ return xpow.point.Message.UTP()}
		else{
			this.init(1)
			this.Export(0,1,20,0,0,0,this.oDer,this.Body);
		}
	},
	ColSucc : function(t){
		var re=(t)?'收藏成功！':'你已经收藏了此网址！'
		alert(re)
		try{this.oDLG.Clear();xpow.point.popClear()}catch(e){}
	},
	Export : function(ismask,istitle,toffset,loffset,h,w,der,restr,m){
		var self = this
		xpow.point.setPop({mWidth:380,id:this.objName+'.oDLG',der:der,button:[{description:'确定',action:function(){self.doAddlinks()}}],onComplete:function(){
			$('coll-isclassid-a').onclick=function(){ xpow.show2disable('coll-classid','coll-class-topic'); if(this.checked){$('islockinner').className='disnone'} }
			$('coll-isclassid-b').onclick=function(){ xpow.show2disable('coll-class-topic','coll-classid'); if(this.checked){$('islockinner').className=''} }
			$j.getJSON('http://me.chndesign.net/zone.xhtml?action=getcollectionclass&jsoncallback=?',function(data){
				$j('#coll-classid').html(data.inner);
				var obj = $('coll-classid')
				if ($g(obj.options[obj.options.selectedIndex],'for')==1){ $('coll-islock-b').checked=true	}
				if (m){
					$('isaddnew').className='disnone'
					$j.getJSON('/zone.xhtml?action=editcollectionitem&dataid='+m.id+'&type='+m.type+'&jsoncallback=?',function(data){for(var i in data){$(i).value=data[i]}})
				}
			})
			$('coll-classid').onchange=function(){$('coll-islock-a').checked=true;if ($g(this.options[this.options.selectedIndex],'for')==1){$('coll-islock-b').checked=true	}}
		}}),
		xpow.point.doPop(restr,5.1);
	},
	getBody : function(){
		this.Body = '<table id="addcollection">'
		this.Body += '	<tr><td colspan=2>'+this.topic+'<INPUT type="hidden" id="coll-topic" value="'+this.topic+'" name="coll-topic"><INPUT type="hidden" id="coll-url" value="'+this.url+'" name="coll-url"></td></tr>'
		this.Body += '	<tr><td></td><td>&nbsp;</td></tr>'
		this.Body += '	<tr><td width="90"><label><input class="checkbox" id="coll-isclassid-a" checked="checked" name="coll-isclassid" value="0" type="radio" />选择分类：</label></td><td><select id="coll-classid" name="coll-classid"><option value="" style="color:#999">正在加载...</option></select></td></tr>'
		this.Body += '	<tr id="isaddnew"><td><label><input class="checkbox" id="coll-isclassid-b" name="coll-isclassid" value="1" type="radio" />新建分类：</label></td><td><input class="disabled" disabled="disabled" type="text" style="width:205px" name="coll-class-topic" id="coll-class-topic" /></td></tr>'
		this.Body += '	<tr id="islockinner" class="disnone"><td></td><td><label><input type="radio" class="checkbox" checked="checked" value="0" id="coll-islock-a" name="coll-islock" />公开</label> <label><input type="radio" class="checkbox" id="coll-islock-b" value="1" name="coll-islock" />私藏</label></td></tr>'
		this.Body += '</table>'
	},
	doAddlinks : function(){
		var oErr = xpow.point.Error,param={}
		param.topic = trim($('coll-topic').value)
		param.url = trim($('coll-url').value)
		param.isclassid = getRadioValue('coll-isclassid')
		param.classid = $('coll-classid').value
		param.classtopic = trim($('coll-class-topic').value)
		param.islock = getRadioValue('coll-islock')
		param.channel = 'collect'
		if (param.topic == ''){oErr.setErr('err.title','标题不能为空')}
		if (param.url == ''){oErr.setErr('err.url','网址不能为空')}
		
		if(param.isclassid==1){
			param.classid = ''
			if (param.classtopic == '' ){oErr.setErr('err.class','新建分类的标题不能为空！')}
		}else{
			if (param.classid  == ''){oErr.setErr('err.class.name','请选择一个分类！')}
		}
		
		if (param.url.substr(0,4).toUpperCase() != 'HTTP' && param.url.substr(0,1) !='/' ){param.url = 'http://' + param.url}
		
		if (oErr.foundErr)return oErr.Out('','','',2.2)
		this.oJSN = xpow.JSN
		this.oJSN.Init('\\\\{$xm}{$chn}/',this.aChannel,'','vsi',0)
		this.oJSN.SendX('addcollection',JSON2Post(param))
	},
	reCmdImg : function(tid){
		this.src = $('img_'+(tid.split('_')[1])).src
		this.Export(0,1,0,0,50,0,tid,this.getManageBody(this.reID))
	},
	getManageBody : function(reid){
		var reHt = '';
		switch(this.fucMode){
			case 0:
				reHt += '<input type="hidden" name="aryc" id="aryc" value="src,url,topic,classid,t_id,class,img" />';
				reHt += '<div id="menum" style="display:"><div class="d_dlg"><li class="li_m"><span style="cursor:pointer" onMouseOut="this.className=\'\'" onMouseOver="this.className=\'aa\'" onClick="'+this.objName+'.doParseImgA(this,1,'+reid+')">推荐图片到首页</span>&nbsp;&nbsp;&nbsp;'
				reHt += '<span style="cursor:pointer" onMouseOut="this.className=\'\'" onMouseOver="this.className=\'aa\'" onClick="'+this.objName+'.doParseImgA(this,0,'+reid+')">取消</span>&nbsp;</li><div class="space"></div>'
				reHt += '<div style="display:none" id="vsi"></div>';
				break;
			case 1:
				reHt += '<li class="li_m"><span style="cursor:pointer" onMouseOut="this.className=\'\'" onMouseOver="this.className=\'aa\'" onClick="'+this.objName+'.doParseImgA(this,2,'+reid+')">推荐图片到首页轮显</span>&nbsp;&nbsp;&nbsp;'
				reHt += '<span style="cursor:pointer" onMouseOut="this.className=\'\'" onMouseOver="this.className=\'aa\'" onClick="doParseImgA(this,4,'+reid+')">取消</span>&nbsp;</li><div class="space"></div></div></div>';
				reHt += '<li class="li_m"><span style="cursor:pointer" onMouseOut="this.className=\'\'" onMouseOver="this.className=\'aa\'" onClick="'+this.objName+'.doParseImgA(this,8,'+reid+')">删除</span>&nbsp;</li><div class="space"></div>';
				reHt += '<div style="display:none" id="vsi"></div>';
				break;
			case 2:
				reHt += '<input type="hidden" name="aryc" id="aryc" value="src,url,topic,classid,t_id,class,img" />';
				reHt += '<div id="menum" style="display:"><div class="d_dlg"><li class="li_m"><span style="cursor:pointer" onMouseOut="this.className=\'\'" onMouseOver="this.className=\'aa\'" onClick="'+this.objName+'.doParseImgA(this,1,'+reid+')">推荐图片到首页</span>&nbsp;&nbsp;&nbsp;'
				reHt += '<span style="cursor:pointer" onMouseOut="this.className=\'\'" onMouseOver="this.className=\'aa\'" onClick="'+this.objName+'.doParseImgA(this,0,'+reid+')">取消</span>&nbsp;</li><div class="space"></div>'
				reHt += '<li class="li_m"><span style="cursor:pointer" onMouseOut="this.className=\'\'" onMouseOver="this.className=\'aa\'" onClick="'+this.objName+'.doParseImgA(this,2,'+reid+')">推荐图片到首页轮显</span>&nbsp;&nbsp;&nbsp;'
				reHt += '<span style="cursor:pointer" onMouseOut="this.className=\'\'" onMouseOver="this.className=\'aa\'" onClick="doParseImgA(this,4,'+reid+')">取消</span>&nbsp;</li><div class="space"></div></div></div>';
				reHt += '<li class="li_m"><span style="cursor:pointer" onMouseOut="this.className=\'\'" onMouseOver="this.className=\'aa\'" onClick="'+this.objName+'.doParseImgA(this,8,'+reid+')">删除</span>&nbsp;</li><div class="space"></div>';
				reHt += '<div style="display:none" id="vsi"></div>';
				break;
		}
		return reHt;
	},
	doParseImgA : function (obj,type,reid,sid){
		var sucMsg = '';
		switch (type){
		case 0: type = 'goindexs';break;
		case 1: type = 'goindex';break;
		case 2: type = 'dir';break;
		case 4: type = 'dirs';break;
		case 8: type = 'delete';break;
		}
		var tType = (type == 'goindexs' || type == 'goindex')?'index':'dir';
		var tAc_x = (type.indexOf('s')>=0)?'goindexs':'goindex';
		sucMsg += 'type=' + tType + this.oJSN.aSyb + 'channel=' + this.channel + this.oJSN.aSyb;
		sucMsg += 'id=' + reid + this.oJSN.aSyb + 'src=' + this.src + this.oJSN.aSyb;
		Parmas = {HASE:'E|G|X|Z',PS : '',debug:1,ST:'\\\\http://www.chnimg.com{$xm}{$chn}/'}
		JSNinit('vsi')
		this.oJSN.SendX('handle&tAc_x='+tAc_x,sucMsg);
	}
}
xpow.point.MD5 = {
	hashChr : '0123456789abcdef',
	rehex : function(num){str='';for(j=0;j<=3;j++)str+=this.hashChr.charAt((num>>(j*8+4))&0x0F)+this.hashChr.charAt((num>>(j*8))&0x0F);return str;},
	str2bytes : function(str){nbts=((str.length+8)>>6)+1;bts=new Array(nbts*16);for(i=0;i<nbts*16;i++)bts[i]=0;for(i=0;i<str.length;i++)bts[i>>2]|=str.charCodeAt(i)<<((i%4)*8);bts[i>>2]|=0x80<<((i%4)*8);bts[nbts*16-2]=str.length*8;return bts;},
	ff : function(a,b,c,d,x,s,t){return this.cmn((b&c)|((~b)&d),a,b,x,s,t)},gg : function(a,b,c,d,x,s,t){return this.cmn((b&d)|(c&(~d)),a,b,x,s,t)},
	hh : function(a,b,c,d,x,s,t){return this.cmn(b^c^d,a,b,x,s,t)},ii : function(a,b,c,d,x,s,t){return this.cmn(c^(b|(~d)),a,b,x,s,t)},
	add : function(x,y){var ts=(x&0xFFFF)+(y&0xFFFF);var tw=(x>>16)+(y>>16)+(ts>>16);return(tw<<16)|(ts&0xFFFF)},rol : function(num,cnt){return(num<<cnt)|(num>>>(32-cnt))},
	cmn : function(q,a,b,x,s,t){return this.add(this.rol(this.add(this.add(a,q),this.add(x,t)),s),b)},
	get : function(str){
		var a=1732584193,b=-271733879,c=-1732584194,d=271733878,x=this.str2bytes(str);
		for(i=0;i<x.length;i+=16){
			var olda=a,oldb=b,oldc=c,oldd=d;
			a=this.ff(a,b,c,d,x[i+0],7,-680876936);d=this.ff(d,a,b,c,x[i+1],12,-389564586);
			c=this.ff(c,d,a,b,x[i+2],17,606105819);b=this.ff(b,c,d,a,x[i+3],22,-1044525330);
			a=this.ff(a,b,c,d,x[i+4],7,-176418897);d=this.ff(d,a,b,c,x[i+5],12,1200080426);
			c=this.ff(c,d,a,b,x[i+6],17,-1473231341);b=this.ff(b,c,d,a,x[i+7],22,-45705983);
			a=this.ff(a,b,c,d,x[i+8],7,1770035416);d=this.ff(d,a,b,c,x[i+9],12,-1958414417);
			c=this.ff(c,d,a,b,x[i+10],17,-42063);b=this.ff(b,c,d,a,x[i+11],22,-1990404162);
			a=this.ff(a,b,c,d,x[i+12],7,1804603682);d=this.ff(d,a,b,c,x[i+13],12,-40341101);
			c=this.ff(c,d,a,b,x[i+14],17,-1502002290);b=this.ff(b,c,d,a,x[i+15],22,1236535329);
			a=this.gg(a,b,c,d,x[i+1],5,-165796510);d=this.gg(d,a,b,c,x[i+6],9,-1069501632);
			c=this.gg(c,d,a,b,x[i+11],14,643717713);b=this.gg(b,c,d,a,x[i+0],20,-373897302);
			a=this.gg(a,b,c,d,x[i+5],5,-701558691);d=this.gg(d,a,b,c,x[i+10],9,38016083);
			c=this.gg(c,d,a,b,x[i+15],14,-660478335);b=this.gg(b,c,d,a,x[i+4],20,-405537848);
			a=this.gg(a,b,c,d,x[i+9],5,568446438);d=this.gg(d,a,b,c,x[i+14],9,-1019803690);
			c=this.gg(c,d,a,b,x[i+3],14,-187363961);b=this.gg(b,c,d,a,x[i+8],20,1163531501);
			a=this.gg(a,b,c,d,x[i+13],5,-1444681467);d=this.gg(d,a,b,c,x[i+2],9,-51403784);
			c=this.gg(c,d,a,b,x[i+7],14,1735328473);b=this.gg(b,c,d,a,x[i+12],20,-1926607734);
			a=this.hh(a,b,c,d,x[i+5],4,-378558);d=this.hh(d,a,b,c,x[i+8],11,-2022574463);
			c=this.hh(c,d,a,b,x[i+11],16,1839030562);b=this.hh(b,c,d,a,x[i+14],23,-35309556);
			a=this.hh(a,b,c,d,x[i+1],4,-1530992060);d=this.hh(d,a,b,c,x[i+4],11,1272893353);
			c=this.hh(c,d,a,b,x[i+7],16,-155497632);b=this.hh(b,c,d,a,x[i+10],23,-1094730640);
			a=this.hh(a,b,c,d,x[i+13],4,681279174);d=this.hh(d,a,b,c,x[i+0],11,-358537222);
			c=this.hh(c,d,a,b,x[i+3],16,-722521979);b=this.hh(b,c,d,a,x[i+6],23,76029189);
			a=this.hh(a,b,c,d,x[i+9],4,-640364487);d=this.hh(d,a,b,c,x[i+12],11,-421815835);
			c=this.hh(c,d,a,b,x[i+15],16,530742520);b=this.hh(b,c,d,a,x[i+2],23,-995338651);
			a=this.ii(a,b,c,d,x[i+0],6,-198630844);d=this.ii(d,a,b,c,x[i+7],10,1126891415);
			c=this.ii(c,d,a,b,x[i+14],15,-1416354905);b=this.ii(b,c,d,a,x[i+5],21,-57434055);
			a=this.ii(a,b,c,d,x[i+12],6,1700485571);d=this.ii(d,a,b,c,x[i+3],10,-1894986606);
			c=this.ii(c,d,a,b,x[i+10],15,-1051523);b=this.ii(b,c,d,a,x[i+1],21,-2054922799);
			a=this.ii(a,b,c,d,x[i+8],6,1873313359);d=this.ii(d,a,b,c,x[i+15],10,-30611744);
			c=this.ii(c,d,a,b,x[i+6],15,-1560198380);b=this.ii(b,c,d,a,x[i+13],21,1309151649);
			a=this.ii(a,b,c,d,x[i+4],6,-145523070);d=this.ii(d,a,b,c,x[i+11],10,-1120210379);
			c=this.ii(c,d,a,b,x[i+2],15,718787259);b=this.ii(b,c,d,a,x[i+9],21,-343485551);
			a=this.add(a,olda);b=this.add(b,oldb);c=this.add(c,oldc);d=this.add(d,oldd);
		}
		return this.rehex(a)+this.rehex(b)+this.rehex(c)+this.rehex(d);
	}
}



xpow.point.Script = {
	param:{},Module:{},isModule : true,isExecute:false,
	Load : function(path,src,type,complete,id ) {
		if (!src) return
		var oHead = document.getElementsByTagName('HEAD').item(0),self=this; 
		this.param.src = this.param.href = false
		switch(type){
		case 'css':
			this.param.rel="stylesheet" 
			this.param.type='text/css'
			this.param.tag='link'
			this.param.app='.css'
			this.param.href = true
			this.param.language=false
			break
		default:
			this.param.language='javascript'
			this.param.type='text/javascript'
			this.param.tag='script'
			this.param.app='.js'
			this.param.rel=false
			this.param.src=true
			break
		}
		
		var rndL = Math.round(Math.random()*10000)
		this.param.obj = []
		var tary = src.split('|')
		
		for(var i=0; i<tary.length; i++){
			var _tag = 'sct'+i+'_'+rndL
			if (!$(this.param.tag+'.'+tary[i])){
				this.param.obj[_tag]=document.createElement(this.param.tag)
				this.param.obj[_tag].type = this.param.type
				if (this.param.src) this.param.obj[_tag].src = path + tary[i] + this.param.app
				if (this.param.href) this.param.obj[_tag].href = path + tary[i] + this.param.app
				if (this.param.language) this.param.obj[_tag].language = this.param.language
				if (this.param.rel) this.param.obj[_tag].rel = this.param.rel
				this.param.obj[_tag].id=this.param.tag+'.'+tary[i]
				oHead.appendChild(this.param.obj[_tag]);
			}else{
				this.param.obj[_tag] = $(this.param.tag+'.'+tary[i])
			}
			
			if (complete&& (i==tary.length-1) ){
				var selfobj = this.param.obj[_tag],done = false
				if(selfobj.addEventListener) {
					selfobj.addEventListener('load', complete , false)
				} else if(selfobj.attachEvent){
					if (selfobj.readyState == 'loaded' || selfobj.readyState == 'complete'	){
						setTimeout(complete,50)
					}else{
						selfobj.attachEvent('onreadystatechange', 
						function(){
							if (selfobj.readyState == 'loaded' || selfobj.readyState == 'complete'	){setTimeout(complete,50)}
						})
					}
				}
			}
		}
	},
	Execute : function (callback){
		if (this.isLoadComplete()){callback(); this.isExecute=true}
	},
	isExecuteComplete : function(){
		return this.isExecute
	},
	isLoadComplete : function(){
		var tary = this.param.jsary.split('|'),iscomplete=false
		for(var i=0; i<tary.length; i++){
			try{
				var obj = eval('is_'+tary[i].toReSymbol('\\.','_'))
				if (!obj){
					iscomplete = false
					break;
				}
			}catch(e){
				iscomplete = false
				break;
			}
		}
		
		return iscomplete
	},
	loadExtend : function(url,type,callback){
		var opts={}
		opts.path = type?'http://www.chnimg.com/css/':'http://www.chnimg.com/js/libextend/'
		this.Load(opts.path,url,type,callback)
	},
	preLoad : function(module){
		this.isModule=false
		this.jLoad(module)
	},
	jLoad : function(module,callback){
		var self = this
		if (eval('self.Module.'+module)){ if (callback) {return callback()} return false}
		switch(module){
		case 'mbwindow'	:
			this.param.jsary = 'ui.core|ui.draggable|jquery.metadata|jquery.timers|ui.resizable.min|mb|mbContainer'
			this.loadExtend('mbContainer|buttons','css')
			this.loadExtend(this.param.jsary,'',callback)
			if (this.isModule)this.Module.mbwindow=true
			break;
		case 'ajax':
			this.param.jsary = 'xpow.ajax|xpow.ajax.extend'
			this.Load('http://www.chnimg.com/js/','xpow.ajax|xpow.ajax.extend','',callback)
			if (this.isModule)this.Module.ajax=true
			break;
		case 'editor':
			this.param.jsary = 'xpow.editor'
			this.Load('http://www.chnimg.com/common/xEditor/plugins/','media','css')
			this.Load('http://www.chnimg.com/js/',this.param.jsary,'',callback)
			if (this.isModule)this.Module.editor=true
			break;
		case 'swfupload':
			this.param.jsary = 'xpow.plugs.flashdetect|swfupload.handlers|swfupload|swfupload.queue|swfupload.fileprogress'
			this.Load('http://www.chnimg.com/js/libextend/swfupload/','default','css')
			this.Load('http://www.chnimg.com/js/libextend/swfupload/',this.param.jsary,'',callback)
			if (this.isModule)this.Module.swfupload=true
			break;
		case 'dragdrop':
			this.param.jsary = 'ui.core|ui.draggable|ui.draggable.ext|ui.droppable|ui.droppable.ext'
			this.loadExtend(this.param.jsary,'',callback)
			if (this.isModule)this.Module.dragdrop=true
			break;
		}
		this.isModule = true
	}}
			  
function setitem(items){$('test').innerHTML=items}

xpow.point.Menu = {
	currentLocation :'',
	sn : 0,
	loalary : '',
	mnuCss : {mAry:new Array(),inCss:'',outCss:''},
	setLocal : function(){ this.currentLocation=xpow.browser.getURLs().toString(); this.loalary = this.currentLocation.split('.')},
	init : function(){
		this.setLocal()
		var tLocal = this.loalary[0].split('//')[1]
		if ($('headermenu')){var m = $('headermenu').childNodes}else{return};
		for(var i=0;i<m.length; i++){var mid = m[i].id; if (mid != '') {if($(mid)){if (mid.replace('_','') == tLocal){$(tLocal).src=$(tLocal).src.replace('.gif','-.gif');this.sn = 1}}}}
	},
	setMenu : function(dir,todir){
		var tLocal = this.loalary[0].split('//')[1]
		if (this.sn == 0){if (tLocal == dir){tLocal = todir;$(tLocal).src=$(tLocal).src.replace('.gif','-.gif')}}
	},
	setMenuCss : function(obj){
		this.mnuCss.mAry = ($(obj))?$(obj).value.split(','):obj.split(',')
	},
	setCss : function(inCss,outCss){
		this.mnuCss.inCss = inCss
		this.mnuCss.outCss = outCss
	},
	chgCss : function(t,currentCss,allCss){
		if (this.mnuCss.inCss =='')this.mnuCss.inCss = currentCss;
		if (this.mnuCss.outCss=='')this.mnuCss.outCss = allCss;
		if (this.mnuCss.mAry.length <=0)this.setMenuCss('menus');
		for(var i=0; i<this.mnuCss.mAry.length;i++){
			var tmss = $(this.mnuCss.mAry[i])
			if (tmss){
				if(tmss.className==this.mnuCss.inCss){
					tmss.className = this.mnuCss.outCss
				}
			}
		};
		if ($(t))$(t).className = this.mnuCss.inCss;
		this.cssClear()
	},
	cssClear : function(){
		this.mnuCss = {mAry:new Array(),inCss:'',outCss:''}
	}
}

xpow.point.Error = {
	foundErr : false,
	objName : '',
	title : '',
	err : '',
	outMode : 0,
	listMode : 0,
	oDLG : '',
	oDer : '',
	treeErr : '',
	self : false,
	isSelfErr : false,
	init : function(){
		this.treeErr = xpow.Use('tree')
		this.oDLG = xpow.Use('dlg')
	},
	setErrHtml : function(e){this.err = e;this.isSelfErr = true;this.foundErr=true},
	setOutMode : function(str){if (str !='')this.outMode = str},
	setLstMode : function(str){if (str !='')this.listMode = str},
	setDer : function(str){if (str !='')this.oDer = str},
	setTree : function(tree){if(isObject(tree))this.treeErr = tree},
	setErr : function(e,m){
		if (this.treeErr==''){this.init()}
		if(!e){return}
		this.treeErr.addItem(e,m)
		this.self = true
		this.foundErr=true
	},
	getErr : function(e){return this.treeErr.getItem(e)},
	Clear : function(){
		this.err = this.title
		this.treeErr = xpow.Use('tree')
		this.foundErr = false
	},
	parOut : function(){
		if (!this.outMode){alert(this.err)}else{
			this.doExport(0,1,0,0,-1,'auto',this.oDer,this.err)
		}
		this.Clear()
	},
	Out : function(mode,der,tree,lmd){
		this.setDer(der)
		this.setOutMode(mode)
		this.setLstMode(lmd)
		if (xpow.point.Lang.isObject(tree))this.setTree(tree)
		if (this.isSelfErr){this.err = this.title + '\n' + this.err; this.parOut();return}
		this.treeErr.doBegin()
		var tbr = (this.outMode)?'<br>':'\n\n'
		this.err = (this.title!='')? this.title + tbr:'\n'
		switch (this.listMode){
		default :
		case 0 :
		
		case 1 :
			for(var i=1 ; i <= this.treeErr.getCount(); i++){
				this.err += this.treeErr.getItemValue() + tbr
				this.treeErr.doMove(i)
			}
			break;
		case 1.1 :
			for(var i=1 ; i <= this.treeErr.getCount(); i++){
				this.err += this.treeErr.getItemValue() + tbr
				this.treeErr.doMove(i)
			}
			break;
		case 2.1 :
			for(var i=1 ; i <= this.treeErr.getCount(); i++){
				this.err += i + ': ' + this.treeErr.getItemKey() + ' = ' + this.treeErr.getItemValue() + ' ┆ '
				if (i%2==0){this.err += tbr}
				this.treeErr.doMove(i)
			}
			break;
		case 2.2 :
			tbr = '、'
			for(var i=1 ; i <= this.treeErr.getCount(); i++){
				if (this.treeErr.getItemKey()!='_append'){
					this.err += this.treeErr.getItemValue() + tbr
				}
				this.treeErr.doMove(i)
			}
			this.err = this.err.toLeft(1) + this.treeErr.getItem('_append')
			break;
		}
		this.parOut()
	},
	Send : function(t){JSNinit('vsi',2);xpow.JSN.Send(t)},
	sysOut : function(){this.doExport(0,0,0,0,'auto',180,0,$('_error_').value),180},
	doExport : function(ismask,istitle,toffset,loffset,h,w,der,restr,tsH){
		if (!w){w = (xpow.browser.isIE)?60:40}
		xpow.point.setPop({mWidth:478,mHeight:h,isMask:1,pHeight:w})
		xpow.point.doPop(restr,1)
	}
}

var xZone={
	Friends : {
		saveSucc : function(){
			alert('添加成功！')
		}
	}
}

xpow.point.RegExps={
	patrn : '',
	regStr : '',
	regMode : 0,
	result : '',
	res : '',
	reArry : '',
	oReg : '',
	debug : 0,
	init : function(p,re,md){
		this.patrn = p
		this.regStr = re
		this.regMode = md
	},
	Create : function(){
		if (this.regMode){
			this.oReg = new RegExp(this.patrn,'ig')
		}else{
			this.oReg = this.patrn
		}
	},
	Match : function(re){
		this.Create()
		if (isEmpty(re))re='$1'
		if (re.indexOf(',')>0){
			this.oReg.exec(this.regStr)
			this.reArry = re.split(',')
			for (i=0; i<this.reArry.length; i++){this.result += eval('xpow.point.RegExps.oReg.'+re) + ','}
		}else{
			this.result = this.regStr.match(this.patrn)// eval('RegExp.'+re)
		}
		if (this.debug)this.test()
		return (this.result==null)?'':this.result
	},
	Light : function(node,key){
		var thtml;
		jQuery(node).each(function(){
			jQuery(this).children().each(function(){
				if (this.innerHTML){
					thtml = this.innerHTML;
					this.innerHTML = thtml.replace(eval('/'+key+'/ig'),'<font class="light">'+key+'</font>')
				}
			})
		})
	},
	Replace : function(strReg,fstr,tostr){
		return strReg.replace(strReg,tostr)
	},
	ReplaceTo : function(tostr){
		return this.regStr.replace(this.oReg,tostr)
	},
	test : function(){
		var re = '',tBr='\n\n'
		re += 'regMode : '+ this.regMode + tBr
		re += 'patrn : '+ this.patrn + tBr
		re += (this.regMode)?'express : RegExp("'+this.patrn+'","ig")':''
		re += tBr + 'result : '+this.result + tBr
		re += 'regStr : '+ this.regStr
		alert(re)
	}
}


xpow.emObj.SUpload = {
	oEMUpload : '',oDLG : '',isInit : false,isupload:false,
	init : function(){
		if (this.isInit){return}
		this.oEMUpload = xpow.Use('MultiUploader');
		this.oDLG = xpow.Use('dlg')
		this.isInit = true
	},
	doUpload : function(ops,der,vimg,filename,succ){
		var self = this
		this.init()
		this.oEMUpload.exportObj = 'xpow.emObj.SUpload.oDLG';
		this.oEMUpload.vimg = vimg
		ops.post_params['_velemt'] = vimg?vimg:ops.post_params['_velemt']
		ops.post_params['_filename'] = filename?filename:ops.post_params['_filename']
		ops.post_params['__succ'] = succ?succ:ops.post_params['__succ']
		xpow.emObj.Parmas.MultiUploader = this.oEMUpload
		xpow.emObj.Parmas.edtDlg = this.oDLG
		this.doExport(0,der,this.oEMUpload.Export(),function(){self.oEMUpload.doUploadInit(ops)})
	},
	doExport : function(ismask,der,restr,func){
		if (this.oDLG.ISEXPORT){this.oDLG.Clear()}
		this.oDLG.doInit(this.oEMUpload.exportObj);
		this.oDLG.isMask = ismask;
		this.oDLG.onComplete = func
		this.oDLG.isTitle = 1
		this.oDLG.mWidth = 540
		this.oDLG.mHeight = 100
		//this.oDLG.der = der;
		this.oDLG.Export(restr);
	}
}

xpow.emObj.Upload = {
	doAc2info : function(mode){
		if (mode){
			$('classid').value = ''; xpow.show2disable('class.topic','classid'); this.doInitWorkClass()
		}else{
			xpow.show2disable('classid','class.topic');this.doParseWorksClass($('classid').value)
		}
	},
	doParseWorksClass : function(classid){
		if (typeof(tableClass)=='undefined'){return false}
		if (classid == ''){
			this.doInitWorkClass()
		}else{
			tableClass.doItemBegin()
			for (var i = 1; i <= tableClass.getRow(); i++){
				if (xpow.URLdecode(tableClass.getItemValue('clsid_filter')) == classid){
					if (tableClass.getItemValue('islock_inclass') == 1){
						$('wk.islock').checked = true;$('showpass').style.display = '';$('islock').value = 1;
						$('password').value = tableClass.getItemValue('psd');
					}else{
						this.doInitWorkClass();
					}
					break;
				}
				tableClass.doItemMove(i);
			}
		}
	},
	doInitWorkClass : function(){
		if ($('wk.islock'))$('wk.islock').checked = false;
		if ($('showpass'))$('showpass').style.display = 'none';
		if ($('islock'))$('islock').value = 0;
		if ($('password'))$('password').value = '';
	}
}


xpow.emObj.Editor = {
	PostStatu : 'zone.xhtml',
	aParam : {list:'',classer:''},
	commDomain : 'http://www.chnimg.com',
	commDir : '/common/xpow/',
	getUploadPath : function(mode){var tPath = this.commDomain+this.commDir;if (mode){tPath += 'xpow.multiUpload'}else{tPath += 'xpow.upLoad'};tPath += xpow.m_cfg['app'];return tPath;}
}




xpow.point.Path = {
	path : '',
	letter : '',
	timer : '',
	target : '_self',
	pathTree : '',
	pathPre : '\\\\',
	isSet : false,
	delay : 1000,
	pthApp :'.xpm',
	init : function(){
		this.setPathTree()
		this.letter = xpow.Use('letter')
	},
	parsePath : function(pth){
		var tPthAry,rePath = '',reDir='',tUrl;
		if (!this.isSet)this.path = pth;
		this.letter = xpow.Use('letter')
		this.path = this.path.toString()
		this.ReplaceItem()
		if (this.path.Right(4).toLowerCase()=='http'){}
		switch(this.path.Right(1)){
		case '?':
//			tUrl = location.href.toString()
//			if(location.href.Left(4)!='.asp' || location.href.Left(5)!='.html'){
//				tUrl = tUrl.split('/')
//			}else{

//			}
			this.path = location.href+this.path
			return
		case '.':
			for (var i=0; i<this.path.length; i++){
				if (this.path.charAt(i)=='/'||this.path.charAt(i)=='?'){
					reDir={dir:this.path.Right(i),path:this.path.toRight(i),ary:'',repath:'',isSpy :false}
					if (this.path.charAt(i)=='/'){reDir.isSpy=1}
					break
				}	
			}
			reDir.ary = location.href.split('/')
			for (i=0; i<(reDir.ary.length-reDir.dir.length); i++){
				reDir.repath += reDir.ary[i]+'/'
			}
			if (reDir.isSpy){reDir.repath=reDir.repath.toLeft(1)}
			reDir.repath += reDir.path
			this.path = reDir.repath
		}
		
		if (this.path.indexOf(xpow.m_cfg['quto'])>0){
			tPthAry = this.path.split(xpow.m_cfg['quto']);
			for(var i=0; i<tPthAry.length; i++){
				rePath+=tPthAry[i].toString();
				if (!tPthAry[i].isApp(0)){
					if (i<tPthAry.length-1 && tPthAry.length>1)rePath+=this.pthApp+xpow.m_cfg['quto']
				}else{
					if (i<tPthAry.length-1 && tPthAry.length>1)rePath+=xpow.m_cfg['quto']
				}
			}
			if (rePath.Left(1)==xpow.m_cfg['quto'])rePath = rePath.toLeft(1)
		}else{
			if (!this.path.isApp(1)){
				this.path += this.pthApp
			}
			rePath = this.path
		}
		this.path = rePath
	},
	ReplaceItem : function(){
		this.setPathTree()
		if (this.path.Right(2)==this.pathPre){
			this.path = this.path.toRight(2)
			xpow.point.RegExps.init(/\{\$(.+?)\}/ig,this.path,0)
			var tDir = xpow.point.RegExps.Match()
			for (var i=0; i<tDir.length;i++){
				if (typeof tDir[i]!='function' && typeof tDir[i]!='object'){
					if (this.getQuItem(tDir[i])){
						this.path = this.path.replace(tDir[i],this.getQuItem(tDir[i]))
					}
				}
			}
		}
	},
	getQuItem : function(key){return this.getPT(key.replace('{$','').replace('}',''))},
	setPathTree : function(){
		if (this.pathTree==''){this.pathTree = xpow.Use('tree')}
		if (this.letter==''){this.letter = xpow.Use('letter')}
		this.setPT(this.letter.get(23,12),this.letter.get(26,2,12))
		this.setPT(this.letter.get(2,7,13),this.letter.get(27,2,7))
		this.setPT(this.letter.get(23,15),this.letter.get(23,15,14,22))
		this.setPT(this.letter.get(0,3,12),this.letter.get(0,3,12,8,13))
		this.setPT(this.letter.get(12,25),this.letter.get(12,24,25,14,13,4))
		this.setPT(this.letter.get(12,13,6),this.letter.get(12,0,13,0,6,4))
		this.setPT(this.letter.get(20,15,27,3,14,12,0,8,13),this.letter.get(2,12,27,23,15,27,23,20,15,27,7,19,12,11))
		this.setPT(this.letter.get(20,15,27,12,20,11,19),this.letter.get(2,12,27,23,15,27,23,12,20,15,27,7,19,12,11))
		this.setPT(this.letter.get(2,7,13,8,12,6),this.letter.get(7,19,19,15,28,26,26,22,22,22,27,2,7,13,8,12,6,27,2,14,12))/*,26*/
	},
	setPT : function(key,val){this.pathTree.addItem(key,val)},
	getPT : function(key){ return this.pathTree.getItem(key)},
	setDaliy : function (tim){ this.delay = tim * 1000},
	setApp : function(pth){this.pthApp=pth},
	setPath : function(pth){this.path = pth;this.isSet = true},
	getFPath : function(pth){ if(pth){this.Clear()}; this.parsePath(pth); return this.path },
	getPath : function(pth){ return this.getFPath() },
	Redirect : function(pth){ if(pth){this.isSet = false; this.parsePath(pth)};this.delay = 100;this.timer = setTimeout('xpow.point.Path.doOpen(1)',this.delay)},
	RedirNew : function(pth){
		if (!pth&&!this.isSet){return}
		if (pth){this.isSet=false}
		this.parsePath(pth);clearTimeout(this.timer)
		var tWin = window.open(this.path,'_blank')
		if (!tWin){this.isSet = true;this.Redirect(this.path)}
	},
	getDomain : function(t){
		xpow.point.RegExps.init('^http:\/\/[a-zA-Z]{1,10}',location.href,1)/*^http:\/\/[a-zA-Z\.]{1,50}*/
		var domain = xpow.point.RegExps.Match()
		domain = domain.toString().replace('http://','')
		if (t)domain = 'http://'+location.hostname.toString()
		return domain
	},
	getApp : function(){
		var tPath = location.hostname.toString().split('.')
		return tPath[tPath.length-1]
	},
	getPre : function(){
		var tPath = location.hostname.toString().split('.')
		return tPath[0].replace('http://','')
	},
	Clear : function(){this.Path='';this.isSet = false},
	doOpen : function(t){
		var tTarget = (t)?'_self':'_parent';
		var tWin = window.open(this.path,tTarget);
		if (!tWin)location.href=this.path
		clearTimeout(this.timer)
	},
	OpenParent : function(pth){this.parsePath(pth); this.timer = setTimeout('xpow.point.Path.doOpen()',this.delay)}
}

xpow.point.Path.Extend = {
	pth : 'xpow.point.Path',
	getUpload : function(mode){return this.pth.setPath('{$up.domain}')}, 	
	getPath :''
}


xpow.point.Effect = {
	hover :	'',
	icon : '',
	getLoadingIcon : function(t){
		t = (t)?t:0
		switch (t){
		case 0 : this.icon = 'snak' ; break
		case 0.1 : this.icon = 'snak.orange' ; break
		case 1 : this.icon = 'array' ; break
		case 1.1 : this.icon = 'array.orange' ; break
		case 2 : this.icon = 'loader' ; break
		case 2.1 : this.icon = 'loader.orange' ; break
		case 3 : this.icon = 'squares' ; break
		case 3.1 : this.icon = 'squares.orange' ; break
		case 3.2 : this.icon = 'rote.gary' ; break
		}
		return '<img align="absmiddle" class="loadingicon" src="'+this.getIcon()+'" />'
	},
	getIcon : function(){
		var ticon,tPre = 'http://www.chnimg.com/images/common/loading/'
		switch(this.icon){
		case 'snak' : ticon = 'ajax-loader.snake.gif' ; break
		case 'snak.orange' : ticon = 'ajax-loader.snake.orange.gif' ; break
		case 'array' : ticon = 'ajax-loader.array.gif' ; break
		case 'array.orange' : ticon = 'ajax-loader.array.orange.gif' ; break
		case 'loader' : ticon = 'ajax-loader.array.gif' ; break
		case 'loader.orange' : ticon = 'ajax-loader.orange.gif' ; break
		case 'squares' : ticon = 'ajax-loader.squares.gif' ; break
		case 'squares.orange' : ticon = 'ajax-loader.squares.orange.gif' ; break
		case 'rote.gary' : ticon = 'rote-gary.gif' ; break
		}
		return tPre + ticon
	}
}

xpow.point.IMG = {
	imgParma : {parentId:'',imgId:'',offset:15,maxWidth:0,imgAlt:'点击图片在新窗口中打开',ops:0},
	setOps : function(t){this.imgParma.ops=t},
	linkParma : {pTag:'',minWidth:'',reWidth:'',maxWidth:''},
	init : function(pid,iid,offset,maxw,alt){
		this.imgParma.parentId = pid
		this.imgParma.imgId = iid
		if (offset)this.imgParma.offset = offset
		if (maxw)this.imgParma.maxWidth = maxw
		if (alt)this.imgParma.imgAlt = alt
	},
	Resize : function(pid,iid,offset,maxw,alt){
		this.init(pid,iid,offset,maxw,alt)
		this.imgParma.parentId = (!isObject(this.imgParma.parentId))?$(this.imgParma.parentId):this.imgParma.parentId
		this.imgParma.imgId = (!isObject(this.imgParma.imgId))?$(this.imgParma.imgId):this.imgParma.imgId
		this.imgParma.maxWidth = this.imgParma.parentId.clientWidth-this.imgParma.offset;
		this.doResize();
	},
	doResize : function(){
		var tmpisInit = false;
		if (this.imgParma.maxWidth == null) {
			this.imgParma.maxWidth = 0.7
		} else if (this.imgParma.maxWidth == 0){
			if (this.imgParma.imgId.parentNode) tmpWidth = this.imgParma.imgId.parentNode.offsetWidth;
			if (this.imgParma.imgId.style.display == 'none'){
				this.imgParma.imgId.style.display = '';
				tmpisInit = true;
			}
		} else if (this.imgParma.maxWidth<0.1) { this.imgParma.maxWidth = 0.7; }
		if (this.imgParma.maxWidth < 1) this.imgParma.maxWidth = screen.width*this.imgParma.maxWidth;
		if (this.imgParma.imgId){
			if(this.imgParma.imgId.width > this.imgParma.maxWidth){
				if (isEmpty(this.imgParma.imgAlt)) this.imgParma.imgAlt = '点击图片在新窗口中打开';
				this.imgParma.imgId.resized = true;
				this.imgParma.imgId.width = this.imgParma.maxWidth;
				this.imgParma.imgId.alt = this.imgParma.imgAlt;
				this.imgParma.imgId.title = this.imgParma.imgAlt;
			}
			return false;
		}
	},
	Redomain : function(domain,tag,mode,maxw){
		tAry = $t(this.linkParma.pTag,'img')
		var timg
		var tReg = xpow.Use('regexp')
		for(var i in tAry){
			if (tAry[i]&&tAry[i].src){
				timg = tAry[i]
				if (mode){
					tReg.init(tag,tAry[i].src,1)
					if(tReg.Match()!=''){
						tAry[i].src = tAry[i].src.replace(tReg.Match(),domain)
					}
				}else{
					tAry[i].src=tAry[i].src.replace(tag,domain)
				}
				if (mode == 2){
					tAry[i].className='menu';
					if (tAry[i].width>=200)tAry[i].onclick=function(){xpow.point.Path.RedirNew(this.src)}
					if (tAry[i].width>maxw){
						tAry[i].height = (tAry[i].height*maxw)/tAry[i].width
						tAry[i].width = maxw
					}
				}
			}
		}

	},
	ReLink : function(tag,maxW,minW,reW){
		if (tag) this.linkParma.pTag = tag
		tAry = $t(this.linkParma.pTag,'img')
		for(var i=0; i<tAry.length; i++){
			if (tAry[i]){
				if (tAry[i].width > maxW){
					tAry[i].height = (tAry[i].height*reW)/tAry[i].width
					tAry[i].width = reW
				}
				tAry[i].className='menuimg'
				if (tAry[i].width >=minW){tAry[i].onclick=function(){xpow.point.Path.RedirNew(this.src)}}
				tAry[i].onload=function(){
					if (this.width > maxW){
						this.height = (this.height*reW)/this.width
						this.width = reW
					}
				}
			}
		}
	}
}

xpow.getDater=function(vElemt,inDate,intYear,sn,isshort)
{
	var reDate,sYear,sMonth,sDay,datAry=inDate.split('-')
	var tmpSl='',_ddate = new Date(),tName = vElemt
	var tmpShortAry = (isshort)? eval(isshort) : new Array('年','月','日')//new Array('','','')
	if (!sn){sn=''}
	var dElemAry = 'stryear'+sn+',strmonth'+sn+',strdate'+sn+'',isSet = false,starYear=1
	vElemt += 'ξ'
	reDate = '<select id="stryear'+sn+'">'// name="stryear"
	reDate += '<option style="color:#999999" value=""> 年</option>'
	intYear = intYear.toString()
	if (datAry.length > 1){if (datAry[2].length > 5) {datAry[2] = datAry[2].split(' ')[0]	}}
	if (!intYear){
		intYear=1800
	}else if(intYear.indexOf('now+')>=0 || intYear.indexOf('now-')>=0 ){
		var tYear = intYear.substr(3,1),tVal = intYear.substr(4,intYear.length)
		intYear = eval(_ddate.getYear()+tYear+tVal)
		isSet = true
	}
	intYear = parseInt(intYear)
	var ddYear = _ddate.getYear()
	ddYear = (ddYear<1900?(1900+ddYear):ddYear).toString(); 
	var _strInt=intYear,_strMax=parseInt(ddYear - _strInt) + 1
	if (isSet){
		if (intYear > _ddate.getYear()){
			_strInt = _ddate.getYear()
		}else{
			_strInt = intYear
		}
		_strInt = (_strInt<1900?(1900+_strInt):_strInt).toString();
		
		for (i=0;i<=tVal;i++){
			tmpSl=''
			if (parseInt(datAry[0])==parseInt(_strInt*1+i*1)){tmpSl='selected="Selected"'}
			reDate+='<option '+tmpSl+' value='+(_strInt*1+i*1)+'>'+(_strInt*1+i*1)+'</option>'
		}
	}else{
		for (i=starYear;i<_strMax;i++){
			tmpSl=''
			if (parseInt(datAry[0])==parseInt(_strInt*1+i*1)){tmpSl='selected="Selected"'}
			reDate+='<option '+tmpSl+' value='+(_strInt*1+i*1)+'>'+(_strInt*1+i*1)+'</option>'
		}
	}
	
	reDate+='</select> '+tmpShortAry[0]+' '
	reDate+='<select id="strmonth'+sn+'">'// name="strmonth"
	reDate+='<option style="color:#999999" value=""> 月</option>'
	for (i=1;i<13;i++){
		tmpSl=''
		if (parseInt(datAry[1])==parseInt(i)){tmpSl='selected="Selected"'}
		reDate+='<option '+tmpSl+' value='+i+'>'+i+'</option>'
	}
	reDate+='</select> '+tmpShortAry[1]+' '
	reDate+='<select id="strdate'+sn+'">'// name="strdate"
	reDate+='<option style="color:#999999" value="">  日</option>'
	for (i=1;i<32;i++){
		tmpSl=''
		if (parseInt(datAry[2])==parseInt(i)){tmpSl='selected="Selected"'}
		reDate+='<option '+tmpSl+' value='+i+'>'+i+'</option>'
	}
	reDate+='</select> '+tmpShortAry[2]
	if (!xpow.emObj.Parmas.daterset)reDate+=' <input value="1" type="hidden" id="'+tName+'" name="'+tName+'">'
	if($(vElemt)){$(vElemt).innerHTML=reDate;$(tName).value=$('stryear'+sn).value + '-' + $('strmonth'+sn).value + '-' +$('strdate'+sn).value}
	if (sn==''){
		xpow.osEvent.attEventList(dElemAry,'ocg','xpow.getDater.Change(\''+tName+'\')')
	}else{
		xpow.osEvent.attEventList(dElemAry,'ocg','xpow.getDater.Change(\''+tName+'\','+sn+')')
	}
}
xpow.getDater.Change = function(e,sn){if (!sn){sn=''}; $(e).value = $('stryear'+sn).value + '-' + $('strmonth'+sn).value + '-' +$('strdate'+sn).value; }
xpow.getDater.Time = function(mode,parent,css)
{
	var Digital,_tIMe
	if (!Digital){Digital=new Date()}
	var hours=Digital.getHours(),minutes=Digital.getMinutes(),seconds=Digital.getSeconds(),dn='AM'
	var year=Digital.getYear(),month=parseInt(Digital.getMonth())+1,day=Digital.getDate()
	year = (year<1900?(1900+year):year).toString(); 
	if(parseInt(minutes)<=9){minutes='0'+minutes}
	if(parseInt(seconds)<=9){seconds='0'+seconds}
	if(parseInt(hours)>12){dn='PM';hours=hours-12}
	if(parseInt(hours)==0){hours=12}
	if(parseInt(day)<=9){day='0'+day}
	if(parseInt(month)<=9){month='0'+month}
	switch(mode){
	case 0 : _tIMe = hours+':'+minutes+':'+seconds+'  '+dn;break
	case 1 : _tIMe = year+'年'+month+'月'+day+'日 '+hours+':'+minutes+':'+seconds+'  '+dn;break
	case 2 : _tIMe = year.substr(2,2)+'.'+month+'.'+day+' '+hours+':'+minutes+':'+seconds+'  '+dn;break
	case 3 : _tIMe = year.substr(2,2)+'.'+month+'.'+day;break
	}
	if (!$(parent)){return _tIMe}
	$(parent).innerHTML = '<span class="'+css+'">'+_tIMe+'</span>'
	setTimeout('xpow.getDater.Time('+mode+',\''+parent+'\',\''+css+'\')',1000)
}

xpow.getDater.Get = function(mode,tf)
{
	var d = new Date();
	m = (d.getMonth() + 1)
	t = d.getDate()
	y = d.getYear()*1
	m = (m<10)?'0'+m.toString():m
	t = (t<10)?'0'+t.toString():t
	s = d.getMinutes()
	ss = d.getSeconds()
	y<1900?y +=1900:y
	y = y.toString().substr(2)
	switch(mode){
	case 'toPath' : return (tf)?(y+'-'+m+'/'):(m+'-'+t+'/'); break;
	case 'toName' : return (tf)?(y+m+t):(m+t); break;
	case 'toDate' : return (tf)?(y+'.'+m+'.'+t):(m+'.'+t); break;
	case 'toFile' : return (tf)?(y+m+t):y+'-'+m; break;
	case 'toTimer':	return (tf)?(y+m+t+s+ss):m+t+s+ss; break;
	case undefined : return (tf)?(y+'.'+m+t):(m+'.'+t); break;
	}
}

xpow.point.Keyword = {
	maxLen : 20,
	errChar : ['@','$','&','%','?','!','|',':','"','\'','\\','*','/','=','<','>',';','(',')','《','》','[',']','{','}','^','_','`','-'],
	Check : function(key){
		var i,tags,last,tag,ret; 
		var tagarr = new Array(),tKey = trim(key);
		if(tKey.length > 255)
		{
			xpow.point.Error.setErr('xpow.point.Keyword.maxlen','标签数量过多，请修改！')
			return false;
		}
		if(tKey != ''){
			for(var i=0;i<this.errChar.length;i++){
				if(tKey.indexOf(this.errChar[i])>-1){
					xpow.point.Error.setErr('err.keyword.fromat','输入的标签内容含有不规范词语( '+this.errChar[i]+' )，请修改！')
					return false;
				}
			}
			
			ret = true;
			tags = tKey
			tags = tags.toReSymbol('，',',')
			last = tags.charAt(tags.length-1);
			if( last == ',' ){tags = tags.toLeft(1)}
			tagarr = tags.split(',')
			for(i=0; i<tagarr.length; i++){
				tagarr[i] = trim(tagarr[i]); 
				var tagarrlen = tagarr[i].length;
				/*if(tagarrlen < 2 ){
					xpow.point.Error.setErr('err.keyword','每个标签的最小长度不能少于2个字符，请修改！')
					return false;
				}*/
				if(tagarrlen > this.maxLen){
					xpow.point.Error.setErr('err.keyword.maxlen','每个标签不能多于'+this.maxLen+'个字符('+tagarr[i]+')，请修改！')
					return false;
				}
			}
		}
		return true
	}
}

function isKeyword()
{
	var i,tags,last,tag,ret,tagarr = new Array();	
	var vKey = ($('_vkey_'))?$($('_vkey_').value):$('keyword');
	tKey = trim(vKey.value);
	return xpow.point.Keyword.Check(tKey)
}

xpow.point.chnPage = {
	init : function(){
		var tAry = $t('chnpage','li')
		for(var i=0; i<tAry.length; i++){
			xpow.osEvent.attEvent(tAry[i],'omv',function(){ if (this.className!='current') {$s(this,'css',this.className); this.className='hover' }})
			xpow.osEvent.attEvent(tAry[i],'omt',function(){ if (this.className!='current') {this.className=$g(this,'css'); $s(this,'css','') }})
		}
		
		$j('.prv,.nxt').mouseover(function(){
			$j(this).addClass('phover')
		}).mouseout(function(){
			$j(this).removeClass('phover')
		})
		var current=parseInt($j('#chnpage li[class=current]').html())
		$j('.nxt').click(function(){
			if (current<tAry.length){redirect($('_custompage_url').value.Replace('page',current+1))}
		})
		$j('.prv').click(function(){
			if (current>1){redirect($('_custompage_url').value.Replace('page',current-1))}
		})
	}
}

xpow.emObj.EditorExtend = {}
xpow.emObj.EditorExtend.isViewSource=false
xpow.emObj.EditorExtend.bgcolor='#ffffff'
xpow.emObj.Parmas = {}
xpow.emObj.Extend = {
	Page : {
		isloaded : false,
		isfinished : function(){
			this.isloaded = true
			var reVal
			for (var i = 0, length = arguments.length; i < length; i++) {
				try {
					reVal = arguments[i]()
					break;
				} catch (e) {
					alert(e.message)
				}
			}
			return reVal;
		}
	}
}

xpow.point.Content={
	cArray : new Array(),
	append : function(){
		this.cArray.push.apply(this.cArray,arguments)
	},
	toString : function(){
		var str = this.cArray.join('')
		this.cArray = new Array()
		return str
	}
} 

xpow.emObj.Header = {
	init : function(){
		globalHeader.init()
		if (xpow.point.Path.getDomain(1).indexOf('passport.chndesign.')!=7){xpow.point.Cookie.set('applyinfo','')}
/*		if (!xpow.emObj.Extend.Page.isloaded){
			xpow.osEvent.attEvent('mailload','ock',"alert('请等待页面加载完成后再重试此操作！')")
		}else{
			xpow.osEvent.attEventList('mailload,mailloads','ock','xpow.emObj.Header.loadMail()')
		}
		this.extendFF()
*/	},
	extendFF : function(){
		if(xpow.browser.isIE){return false}
		/*if(window.Element && window.Element.prototype.__defineGetter__){
			Element.prototype.__defineGetter__('outerHTML',function(){
				return (new XMLSerializer()).serializeToString(this);
			});
		}*/
		

	},
	loadMail : function(){
	//	if (!$(xpow.emObj.Parmas.MailDer)){
			xpow.osEvent.catchSrc()
			xpow.emObj.Parmas.Channel = (xpow.osEvent.cSrcElmt.getAttribute('fortype')*1)?'co':'me'
			xpow.emObj.Parmas.MailRe = 'mailmsg'
			xpow.emObj.Parmas.MailDer = 'mailload'
			xpow.emObj.Parmas.MailChannel = (xpow.emObj.Parmas.Channel=='co')?'ex':'user'
			xpow.emObj.Parmas.SYSstatu = 'zone.xhtml'
			xpow.emObj.Parmas.MailPS = 'zone.xhtml'
			xpow.emObj.Parmas.MailStatu = 'zone.xhtml'
			if (xpow.emObj.Parmas.mailset){
				if (xpow.emObj.Parmas.mailset.MailDer) xpow.emObj.Parmas.MailDer = xpow.emObj.Parmas.mailset.MailDer
			}
	//	}
			try{if ( xpow.osEvent.cSrcElmt.id !='') xpow.emObj.Corp.RegItem()}catch(e){}
			User.Mail.Load()
	}
}


xpow.point.Letter = {tters : '/.:?ξ$σ§abcdefghijklmnopqrstuvwxyzζ$%^&*',get : function(){var result = '';for (i =0 ; i < arguments.length; i++){result += this.tters.toLetter({start:0,length:48}).substr(arguments[i],1)};return result}}

xpow.point.Recommend = {
	Body : '',
	rMode : '',
	oEvent : '',
	debug : false,
	postpath :'',
	aParam : {txt_toimg:'推荐图片到首页',submit:'推荐',cancel:'取消推荐'},
	setParam : function(jsn){
		if(isObject(jsn)){this.aParam=jsn}
	},
	getParam : function(sn){
		this.aParam.prefix = ''
		if(xpow.point.Path.getDomain()=='bbs'){this.aParam.prefix = this.oEvent.cSrcElmt.id+'$'}
		var tx = this.aParam.prefix+'ex.params'
		if (sn){
			var t = this.aParam.prefix+'ex.list.params.'+sn
			if($(t)){
				eval('xpow.point.Recommend.aParam.list='+ $(t).value)
			}else{
				this.aParam.list = null
			}
		}
		if($(tx)){
			eval('xpow.point.Recommend.aParam.classer='+ $(tx).value)
		}else{
			this.aParam.classer = null
		}
		eval('xpow.point.Recommend.aParam.app='+ $('_recommend.params').value)
		this.aParam.sn = sn
		this.aParam.t = t
		this.aParam.tx = tx
		if (this.debug){ this.test()}
	},
	doImg2Index : function(sn){
		var self = this
		this.setInner()
		this.oEvent = xpow.Use('event')
		this.oEvent.catchSrc()
		this.getParam(sn)
		this.doExport(0,function(){self.setItemValue()},0,0,180,285,this.oEvent.cSrcElmt.id,this.Body)/*60*/
	},
	setItemValue : function(){
		//*$('s.keyword').value = this.aParam.list.keyword
		if (this.aParam.list.src = '{$pics}'){
			$('rcmd.src').value =(this.aParam.prefix)? $(this.aParam.prefix.replace('div_','img_').toLeft(1)).src : $('img_'+(this.aParam.sn-1)).src
		}else{
			$('rcmd.src').value = this.aParam.list.src
		}
	},
	setInner : function(){
		var reHt = '',tN = (this.debug)?'':'none'
		reHt += '<form id="rcmd.form" style="border:1px solid #f1f1f1" method="post"><input type="hidden" name="aryc" id="aryc" value="src,url,topic,classid,t_id,class,img" />'
		reHt += '<ul class="rcmdul"><li><input type="radio" class="checkbox" value="1" name="rcmd_" checked id="rcmd.ac.i"/><label for="rcmd.ac.i">'+this.aParam.submit+'</label></li>'
		reHt += '<li><input type="radio" class="checkbox" value="1" name="rcmd_" id="rcmd.ac.c"/><label for="rcmd.ac.c">'+this.aParam.cancel+'</label></li>'
		//reHt += '<li style="margin-top:10px; margin-left:5px"><div>标签：</div><div><textarea name="s.keyword" id="s.keyword" class="rcmdultxt"></textarea>'
		//reHt += '<div class="gary">标签是一个让你通过设定关键字，使该主题易于分类整理及检索的功能。每个标签需要以一个逗号“，”分开，例如：包装，设计 ，牛奶。</div></div></li>'
		reHt += '</ul><input type=hidden id="rcmd.info" name="rcmd.info"><input type=hidden id="rcmd.src" name="rcmd.src"></form>'
		reHt += '<div id="test"></div><iframe id="aframe" name="aframe" style="display:'+tN+'"></iframe>'
		this.Body = reHt
	},
	ParseAc : function(){
		var tcontent = $('rcmd.content')
		var mode = ($('rcmd.ac.i').checked)?2:0
		switch(mode){
		case 0 : this.rMode = 'goindexs'; this.doRcmd(); break
		case 1 :
		case 2.1 :
			if(mode && tcontent.style.display == 'none'){
				jQuery(tcontent).slideDown();
				xpow.point.setBtns({id:'_recommend_dlg_s',button:[
					{description:'确 定',title:'保存当前的操作',action:function(){xpow.point.Recommend.ParseAc(2)}},
					{description:'取消推荐',title:'取消图片在首页列表中显示',action:function(){xpow.point.Recommend.ParseAc(0)}}
				]})
			}else{
				this.doClear()
			};
			break;
		case 2 : this.rMode = 'goindex'; this.doRcmd(); break
		}
	},
	doClear : function(){

	},
	opSucc : function(){
		xpow.point.popClear()
		alert('操作成功！')
	},
	doRcmd : function(){
		var c = xpow.Use('cookie'),p = xpow.Use('path')
		if (this.rMode.Left(1)!='s'){
//			xpow.point.Keyword.maxLen = 20
//*			if ($('s.keyword').value==''){return alert('请输入标签！')}
//			if (!xpow.point.Keyword.Check($('s.keyword').value)	){//|| !xpow.point.Keyword.Check($('n.keyword').value)
//				xpow.point.Error.Out(0,'','',2.2)
//				return
//			}
//			if (!xpow.Check.Form('s.keyword,n.keyword','原标签,新标签','rcmd.form',0)){
//				return
//			}
		}
		var aframe = $('aframe')
		if (!aframe){
			xpow.CreateElemt(xpow.m_cfg['ELEMT'].split(',')[0],'id=aframe,name=aframe,display=none')	
			aframe = $('aframe')
			$('rcmd.content').appendChild(aframe)
		}
		var tmpApp = (this.aParam.app.appitem)?this.aParam.app.appitem.toReSymbol('РРР',xpow.JSN.aNsyb).Replace('location',location.href.toString()):''
		$('rcmd.info').value = c.getA('username')+xpow.JSN.aSyb+c.getA('user.password')+xpow.JSN.aSyb+c.getA('userid')+xpow.JSN.aNsyb+xpow.JSN.aNsyb+'domain='+this.aParam.app.domain+xpow.JSN.aNsyb+'channel='+this.aParam.app.channel+xpow.JSN.aNsyb+'id='+this.aParam.list.id+xpow.JSN.aNsyb+tmpApp
		if (!this.postpath){
			p.setPath('\\\\{$chnimg}{$xm}{$chn}/'+this.aParam.app.src+'?action=handle&tAc_x=')
			this.postpath = p.getFPath()
		}
		
		xpow.setFromTarget($('rcmd.form'),this.postpath+this.rMode,'aframe','application/x-www-form-urlencoded')
		this.setStatus()
	},
	setStatus : function(){
		xpow.point.setBtns({id:'_recommend_dlg_s',button:[
			{description:'请稍候...',title:'保存当前的操作',action:function(){return false}}														 
		]})
	},
	doExport : function(ismask,complete,toffset,loffset,h,w,der,restr){
		xpow.point.setPop({der:der,id:'_recommend_dlg_s',mHeight:160,onComplete:complete,button:[{description:'确 定',title:'保存当前的操作',action:function(){xpow.point.Recommend.ParseAc()}}],isMask:ismask,topOffset:toffset,leftOffset:loffset,mWidth:w,mHeight:h})
		xpow.point.doPop(restr,5.1)
	},
	test : function(){
		var re = 'sn='+this.aParam.sn+'\n'
		re += 'pre='+this.aParam.prefix+'\n'
		re += '.app='+this.aParam.app+'\n'
		re += '.t='+this.aParam.t+'#'+$(this.aParam.t)+'\n'
		re += '.tx='+this.aParam.tx+'#'+$(this.aParam.tx)+'\n'
		re += '.list='+this.aParam.t+'#'+this.aParam.list+'\n'
		re += '.classer='+this.aParam.tx+'#'+this.aParam.classer+'\n'
		alert(re)
	}
}

xpow.Hidden = {
	Message : {
		aParam : {msgElmt:'ishr',opElmt : '_message',channel:'hr',sn:0,value:0,tT:''},
		delItem : function(){
			for(var i=0; i<this.aParam._oMsg.options.length; i++){
				this.aParam._oMsg.options[i]=null
			}
			for(var i=0; i<this.aParam._oMsg.options.length; i++){
				this.aParam._oMsg.options[i]=null
			}
		},
		setMsg : function(){
			switch(this.aParam.value*1){
			case 0 : this.aParam.tT = '';break
			case 1 : this.aParam.tT = 'hidden';break
			case 2 : this.aParam.tT = '';break
			case 3 : this.aParam.tT = 'unhidden';break
			default : this.aParam.tT = 'unhidden';
			}
			
			if ( this.aParam.tT == ''){
				this.delItem()
				this.aParam._oMsg.options[0] = new Option('没有可用的消息主题','')
				$('topic').value = ''
				$('remark').value = ''
				return
			}
			var tPs = this.aParam.channel+'.'+this.aParam.tT
			this.aParam._oMsg.options[0] = new Option('请选择一条消息主题','')
			this.aParam._oMsg.options[0].className='gary'
			for (var i=0; i<($(tPs).childNodes.length)/2; i++){
				this.aParam._oMsg.options[i+1] = new Option($(tPs).childNodes[i].innerHTML,$(tPs).childNodes[i+4].innerHTML)
			}
			
			this.aParam._oMsg.onchange=function(){
				if (this.value){
					$('topic').value = this.options[this.selectedIndex].text.Replace('name',$('co.topic').innerHTML)
					$('remark').value = this.value
				}else{
					$('topic').value = ''
					$('remark').value = ''
				}
			}
		},
		setInitV : function(){
			this.aParam.value = $(this.aParam.msgElmt).options[$(this.aParam.msgElmt).selectedIndex].value
			this.setMsg()
		},
		init : function(){
			this.aParam._oMsg = $(this.aParam.opElmt)
			if (this.aParam.channel==''){
				this.aParam.channel='co'
				this.aParam.msgElmt='hidden'
			}
			if($(this.aParam.msgElmt)){
				if ($(this.aParam.msgElmt).tagName!='SELECT'){this.aParam.msgElmt='hidden'}
			}else{
				this.aParam.msgElmt='hidden'
			}
			$(this.aParam.msgElmt).onchange = function(){
				xpow.Hidden.Message.aParam.value = this.value
				xpow.Hidden.Message.setMsg()
			}
			this.setInitV()
		}
	}
}

xpow.point.Color = {
	Hex : new Array('00','33','66','99','CC','FF'),
	SpHex : new Array('FF0000','00FF00','0000FF','FFFF00','00FFFF','FF00FF'),
	CharTree : '',
	srcElmt : '',
	isSetHex : false,
	HexAry : Array(),
	clickElemt : '',
	targetElement : '',
	current : '',
	vElemt : '',
	reColor : '',
	isColor : false,
	isDisp : '',
	tsElmt : '',
	aParam : {},
	initAlt : 'clrDlg',
	oDLG : '',
	init : function(){ this.setInner()},
	getSrc : function(evt){
		xpow.osEvent.catchSrc(evt)
		this.tsElmt = xpow.osEvent.cSrcElmt;
	},
	setInner : function(){
		if (this.aParam.colorBody){return}
		for (i=0;i<2;i++){
			for (j=0;j<6;j++){
				xpow.point.Content.append('<tr height=12><td width=11 style="background-color:#000000">')
				if (i==0){
					xpow.point.Content.append('<td width=11 style="background-color:#',this.Hex[j],this.Hex[j],this.Hex[j],'">')
				}else{
					xpow.point.Content.append('<td width=11 style="background-color:#',this.SpHex[j],'">')
				}
				xpow.point.Content.append('<td width=11 style="background-color:#000000">')
				for (k=0;k<3;k++){
					for (l=0;l<6;l++){
						xpow.point.Content.append('<td width=11 style="background-color:#',this.Hex[k+i*3],this.Hex[l],this.Hex[j],'">')
					}
				}
			}
		}
		var tClr = xpow.point.Content.toString()
		var app = xpow.point.Content
//		xpow.point.Content.append('<div id="clr_tab_sys" class="tab current">调色板</div><div id="clr_tab_cst" class="tab">自定义颜色</div><div class="clear"></div>')
//		xpow.point.Content.append('<div class="tabs" style="display:none" id="tab_clr_tab_cst"><div class="tabcst"><div id="tabcst_clr" style=""></div><br>')
//		xpow.point.Content.append('请输入颜色值： <input id="tabcst_clr_t" type="text" class="cstinput" value="#" maxlength="7" /><div style="text-align:right; padding-top:5px; padding-right:10px; border:0px solid"><input type="button" id="btnCstOk" value="确定"></div></div></div>')
//		xpow.point.Content.append('<div class="tabs" id="tab_clr_tab_sys"><div id="colorpanel" style=" border:0px #000000 solid;"><div class="colorsysinfo">')
//		xpow.point.Content.append('&nbsp;<input type="text" id="DisColor" name="DisColor" size="6" disabled style="border:solid 1px #000000;background-color:#ffff00"> <input type="text" name="HexColor" id="HexColor" size="7" style="border:inset 1px;font-family:Arial;" value="#000000"></div>')
//		xpow.point.Content.append('<table border="1" class="tabcolors" cellspacing="0" cellpadding="0" bordercolor="#000000" onmouseover="xpow.point.Color.doOver()" onmouseout="xpow.point.Color.doOut()" onclick="xpow.point.Color.doClick()" style="cursor:pointer;">')
//		xpow.point.Content.append(tClr,'</table></div>')
		
		app.append('<div class="colorbox"><div class="colorcc">')
		app.append('<div id="tab_clr_tab_cst" class="clrbox tab_clr_cst_box disnone">')
		app.append('<div id="cst_clr"></div><div>请输入颜色值： ')
		app.append('<input id="tabcst_clr_t" type="text" class="cstinput" value="#" maxlength="7" /><br>')
		app.append('<input type="button" id="btnCstOk" value="确定">')
		app.append('</div></div><div id="tab_clr_tab_sys" class="clrbox tab_clr_sys">')
		app.append('<div id="colorpanel"><div class="colorsysinfo">')
		app.append('<input type="text" id="DisColor" name="DisColor" size="6" disabled class="discolor" >&nbsp;')
		app.append('<input type="text" name="HexColor" id="HexColor" size="7" class="hexcolor" value="#000000">')
		app.append('</div><table class="tabcolors" cellspacing="1" cellpadding="0" bordercolor="#000000" onmouseover="xpow.point.Color.doOver()" onmouseout="xpow.point.Color.doOut()" onclick="xpow.point.Color.doClick()" style="cursor:pointer;">')
		app.append(tClr)
		app.append('</table></div></div></div></div>')
		this.aParam.colorBody = app.toString()
	},
	getInner : function(){
		this.setInner()
		return this.aParam.colorBody
	},
	Click : function(){
		this.getSrc()
		if (this.tsElmt.alt == 'clrDlg'){
			this.targetElement = this.tsElmt;
			this.Export(true);
		} else{
			this.Export(false);
		}
	},
	doOver : function() {
		this.getSrc()
		if ((this.tsElmt.tagName=='TD') && (this.current!=this.tsElmt)) {
			if (this.current!=''){this.current.style.backgroundColor = this.current._background}
			var hexClr = this.tsElmt.style.backgroundColor
			if (!xpow.browser.isIE){hexClr = hexClr.parseColor()}
			this.tsElmt._background = this.tsElmt.style.backgroundColor
			$('DisColor').style.backgroundColor = this.tsElmt.style.backgroundColor;
			$('HexColor').value = hexClr.toUpperCase();
			this.tsElmt.style.backgroundColor = '#fff'
			this.current = this.tsElmt
			this.reColor = $('HexColor').value.toUpperCase();
		}
	},
	doOut : function(){
		if (this.current!='') this.current.style.backgroundColor = this.current._background.toUpperCase();
	},
	doClick : function(){
		this.getSrc()
		if (this.tsElmt.tagName == 'TD'){this.out()}
	},
	out : function(){
		if (this.aParam.style){
			var tary,self=this
			if(this.aParam.style.indexOf('>')>0){
				tary = this.aParam.style.split('>')
				switch(tary[0]){
				case 'table':
					jQuery(tary[1].split('.')[0],this.targetElement).each(function(){
						if(this.style.background.indexOf('url(')<1)this.style.background=self.reColor
					})
				}
			}else{
				eval('xpow.point.Color.targetElement.style.'+this.aParam.style+'=\''+this.reColor+'\'')
			}
		}
		
		if($(this.vElemt)){$(this.vElemt).value=this.reColor.replace('#','')}
		if (this.oDLG)this.oDLG.Clear()
	},
	get : function(){
		this.getSrc()
		if (this.tsElmt.getAttribute('alt') == 'clrDlg'){ 
			this.aParam.style = (this.tsElmt.getAttribute('for'))?this.tsElmt.getAttribute('for'):'color'
			this.targetElement = (this.tsElmt.getAttribute('get'))? $(this.tsElmt.getAttribute('get')): $(this.tsElmt.id.replace('set','get'))
			this.clickElemt = this.tsElmt
			this.vElemt = $(this.tsElmt.id.replace('set.',''))
			this.reColor = this.vElemt.value
			this.Export();
		}
	},
	doExport : function(ismask,istitle,toffset,loffset,h,w,der,restr){
		var self = this
		if (this.oDLG.ISEXPORT){this.oDLG.Clear()}
		this.oDLG.doInit('xpow.point.Color.oDLG');
		this.oDLG.isMask = ismask;
		this.oDLG.isTitle = istitle;
		this.oDLG.topOffset = toffset;
		this.oDLG.leftOffset = loffset;
		if(h>0)this.oDLG.mHeight = h;
		if(w)this.oDLG.mWidth = w;
		this.oDLG.onComplete = function(){ self.regItem()}
		this.oDLG.der = der;
		this.oDLG.properties= 'draggable isfixtop'
		this.oDLG.Export(restr);
	},
	Export : function(){
		var tH = (xpow.browser.isIE)?181:176
		if(!this.oDLG)this.oDLG = xpow.Use('dlg')
		if(!this.aParam.colorBody){this.setInner()}
		this.doExport(0,1,5,5,tH,295,this.clickElemt.id,this.aParam.colorBody)
	},
	regItem : function(){
		xpow.osEvent.attEventList('clr_tab_sys,clr_tab_cst','ock','xpow.point.Color.parseTab()')
		xpow.osEvent.attEvent('tabcst_clr_t','okp','xpow.point.Color.parseCstClr()')
		xpow.osEvent.attEvent('tabcst_clr_t','onbeforepaste','xpow.point.Color.parseCstClr()')
		xpow.osEvent.attEvent('btnCstOk','ock','xpow.point.Color.parseCstOut()')
		this.setDefault()
	},
	setDefault : function(){
		try{
			$('DisColor').style.backgroundColor = this.reColor
			$('HexColor').value = this.reColor
		} catch(e){
			//alert(e.message)
		}
	},
	parseTab : function(){
		this.getSrc()
		this.isColor = false
		this.tsElmt.className = 'tab current'
		$('tab_'+this.tsElmt.id).className = ''
		if (this.tsElmt.id=='clr_tab_sys'){
			$('clr_tab_cst').className = 'tab'
			$('tab_clr_tab_cst').className = 'disnone'
		}else{
			$('clr_tab_sys').className = 'tab'
			$('tab_clr_tab_sys').className = 'disnone'
			$('tabcst_clr_t').value = this.reColor
			$('tabcst_clr').style.backgroundColor = this.reColor
			if(this.reColor)this.isColor = true
		}
	},
	parseCstClr : function(){
		this.getSrc()
		$('vsi').innerHTML = this.tsElmt.value
		var tval = this.tsElmt.value
		this.isColor = false
		if ( tval.length==6 && tval.indexOf('#')<0){
			this.tsElmt.value = '#'+tval.toUpperCase()
			this.isColor = true
		}else if( tval.length==7 && tval.indexOf('#')>=0){
			this.tsElmt.value = tval.toUpperCase()
			this.isColor = true
		}
		
		this.reColor = tval
		if(this.isColor){
			try{
				$('tabcst_clr').style.backgroundColor=tval
			}catch(e){
				alert('颜色值('+tval+')无效！')
				this.tsElmt.value = '#'
				this.reColor = ''
			}
		}
	},
	parseCstOut : function(){
		if (this.isColor){
			this.out()
		}else{
			alert('颜色值('+this.reColor+')无效！')
		}
	},
	setCharTree : function(){
		if (this.CharTree !=''){return}
		this.CharTree = new XPOWS.shellTree()
		for (var i=0; i<9; i++){
			this.CharTree.addItem(i+96,i)
		}
		/*this.setCharTree()
		if (this.keyColor.length < 7){
		if (event.keyCode>64 && event.keyCode<91){this.keyColor += String.fromCharCode(event.keyCode)}
		else if (event.keyCode>95 && event.keyCode<106){this.keyColor += this.CharTree.getItem(event.keyCode)}
		}*/
	}
}

globalHeader = {
	init : function(){
		this.regList()
		Search.init()
		$j('.mnubar .d').click(function(){xpow.point.dMsg.init()})
		if (xpow.browser.isIE){
			xpow.Use('script').preLoad('mbwindow')
			xpow.Use('script').preLoad('swfupload')
			xpow.Use('script').preLoad('editor')
		}
		xpow.Use('script').loadExtend('jquery.MultiFile.pack|jquery.metadata')
		if (xpow.browser.isSafari){
			xpow.Use('script').Load('http://www.chnimg.com/js/libextend/swfupload/','swfupload.handlers|swfupload|swfupload.queue')
			xpow.Use('script').loadExtend('ui.core.min|ui.draggable|jquery.metadata|jquery.timers|ui.resizable.min|mb')
		}
		if (xpow.browser.typeName=='IE6') {
			$j('.mnubar .gridr a').each(function(){if (this.innerHTML=='退出') $j(this).attr('href',User.getLogouturl())})
		}
	},
	regList : function(){
		var param={}
		param.mnumore = $j('.mnumore')
		param.mnubarpop = $j('.mnubarpop')
		param.mnubarpopli = $j('.mnubarpop li')
		param.mnumore.mouseover(function(){
			clearTimeout(param.timer)
			param.mnubarpop.removeClass('disnone')
			$j(this).addClass('hover')
			param.mnubarpop.css({left:$j(this).offset().left+'px',top:($j(this).offset().top+20)+'px'})
		}).mouseout(function(){
			$j(this).removeClass('hover')
			param.timer = setTimeout(function(){param.mnubarpop.addClass('disnone')},500)
		})
		param.mnubarpopli.click(function(){ var ccs = this.className; if (ccs=='corp')ccs='co'; if(ccs!='hr' && ccs!='shop') window.location.href='http://'+ccs+'.chndesign.net/' })
		param.mnubarpop.mouseover(function(){clearTimeout(param.timer)}).mouseout(function(){param.mnumore.mouseout()})
	}
	
}


var oDirContainer
lidir = {
	oCssElmt : '',aCt:'',qUy:'',dirsn:2,oTim:'',oIner:{},Length:0,
	init : function(){
		oDirContainer = $('oDirContainer')
		this.doParseLiDir()
	},
	doInterVal : function(){
		var tObj = liDirItem['liItem_'+this.dirsn]
		var tsn = (xpow.browser.isIE)?0:1
		var tsns = (xpow.browser.isIE)?0:2
		
		if (!tObj)return
		if (oDirContainer.filters)oDirContainer.filters[0].Apply();
		this.oCssElmt.childNodes[tsn].innerHTML = this.oIner.tInners.Replace('image',tObj.image).Replace('topic',tObj.topic).Replace('topics',tObj.topic).Replace('url',tObj.url)
		for (var ix in this.oCssElmt.childNodes){
			if (this.oCssElmt.childNodes[ix].className!='li-ileft'){
				this.oCssElmt.childNodes[ix].className = 'li-nos'
			}
		}
		this.oCssElmt.childNodes[this.dirsn+tsns].className = 'li-noo'
		if (oDirContainer.filters)oDirContainer.filters[0].Play(duration=1);
		if (this.oIner.isPush){this.setItv() }
		this.dirsn+=1;
		if ((this.dirsn-1)==this.Length){this.dirsn=1}
	},
	doParseLiDir : function(){
		if (!this.isinit){
			var sn = 0,tcss='li-noo',tChd,tCss
			this.oIner.tInner = '<div class="{$css}">{$sn}</div>'
			this.oIner.tInners = '<a href="{$url}" target="_blank" title="{$topic}"><img src="{$image}" alt="{$topics}"></a>'
			this.getItemCss('dir')
			for (var i in liDirItem){
				sn += 1; var tsn = (xpow.browser.isIE)?0:1
				if (sn==1){this.oCssElmt.childNodes[tsn].innerHTML = this.oIner.tInners.Replace('image',liDirItem[i].image).Replace('topic',liDirItem[i].topic).Replace('topics',liDirItem[i].topic).Replace('url',liDirItem[i].url)}
				if (sn>1){tcss = 'li-nos'}
				this.oCssElmt.innerHTML += this.oIner.tInner.Replace('sn',sn).Replace('css',tcss)
				this.Length+=1
			}
			this.isinit=true
		}
		for (var ix in this.oCssElmt.childNodes){
			tChd = this.oCssElmt.childNodes[ix]
			if (tChd.className){
				if (tChd.className != 'li-ileft'){
					tChd.onclick = function(){
						clearInterval(lidir.oTim)
						lidir.dirsn = this.innerHTML*1
						lidir.oIner.isPush = true
						lidir.doInterVal()
					}
				}
			}
		}
		this.setItv()
	},
	setItv : function(){this.oIner.isPush=false; this.oTim = setInterval('lidir.doInterVal()',5000)},
	getItemCss : function(c,tmplate,node){
		var tParent = (tmplate)?tmplate:'tplavds'
		var tNode = (node)?node:'div'
		var tAry = $t(tParent,tNode)
		for(var i in tAry){
			if (typeof tAry[i]){
				switch(tAry[i].className){
				case c : this.oCssElmt = tAry[i]; return
				}
			}
		}
	}
}

Search = {
	param : {},
	init : function(){
		this.regList()
	},
	Go : function(query){
		if (this.going)return
		this.going = true
		if (this.param.ischange ){
			this.param.Querykey = this.param.oQuerykey.attr('value')
			if (decodeURI(this.param.Querykey)=='包装'){
				this.going = false
				return xpow.point.doPop('<span class="skeytips">请输入如“牛奶，茶叶，酒” 等关键字进行搜索！</span>',3)
			}
			if (trim(this.param.Querykey)==this.param.initquerykey) {this.param.Querykey=''}else{this.param.Querykey=encodeURI(this.param.Querykey)}
			if (query) this.param.Querykey += query
			window.location.href='http://s.chndesign.'+xpow.point.Path.getApp()+'/search?'+this.param.Querykey
		}else{
			window.location.href='http://s.chndesign.'+xpow.point.Path.getApp()
		}
	},
	regList : function(){
		var self = this
		$j('.global-header .searchbox .title').attr('title','搜索首页').click(function(){window.location.href='http://s.chndesign.'+xpow.point.Path.getApp()})
		$j('.se-r').click(function(){ self.Go() })
		this.param.initquerykey = '输入关键字，搜索需要的包装'
		this.param.oQuerykey = $j('#querykey')
		this.param.oQuerykey.blur(function(){
			if (trim(this.value)=='') {this.value=self.param.initquerykey; self.param.ischange=false; this.className=''}
		}).click(function(){
			if (trim(this.value)==self.param.initquerykey) {this.value=''}
		}).mouseover(function(){
			this.focus()
			this.select()
		}).keyup(function(e){
			if (e.keyCode==13) {
				self.Go()
			}else{
				if (trim(this.value)!=self.param.initquerykey && trim(this.value)!='') { self.param.ischange=true; this.className='current'}			
			}
		})
		$j('#querykey').blur()
	}
}

xpow.point.Score = {
	params : {},
	init : function(){
		xpow.osEvent.catchSrc()
		this.params.pth = xpow.Use('path')
		this.getParams()
		this.setInner()
		this.params.isinit = true
	},
	getParams : function(sn){
		this.params.vlist = ''
		var sn = xpow.osEvent.cSrcElmt.id.split('.')[1]
		if (sn){
			var t = '_score.list.params.'+sn
			this.params.list = $(t).value.evalJSON()
			this.params.vlist = $(t).value
		}
		if (!this.params.isinit)this.params.Class = $('_score.common.params').value.evalJSON()
		this.params.vlist = this.params.vlist.toLeft(1)+','+$('_score.common.params').value.toRight(1)
	},
	setInner : function(){
		if (!this.params.body){
		xpow.point.Content.append('<form id="_scoreform" name="_scoreform" method="post">')
		xpow.point.Content.append('<input type="hidden" name="_score.params" id="_score.params">')
		xpow.point.Content.append('<table cellpadding="0" cellspacing="2" border=0 width="100%"><tr><td colspan=2>我当前共有 {$max} 积分<div class="space"></div></td></tr><tr><td width=105>给{$user}加分：</td>')
		xpow.point.Content.append('<td align=left><select name="_score.value" id="_score.value"><option value="">请选择分值</option><option value=5>5</option><option value=4>4</option><option value=3>3</option><option value=2>2</option><option value=1>1</option></select> </td>')
		xpow.point.Content.append('</tr><tr><td valign="top" colspan=2><input type="checkbox" name="_score.isre" id="_score.isre" class="checkbox" onclick="xpow.point.Score.getMsg()"><label for="_score.isre">发送原因</label></td><tr><td colspan=2><textarea name="_score.remark" value="" id="_score.remark" rows="6" style="width:98%; display:none"></textarea></td></tr></table></form>')
		xpow.point.Content.append('{$f}')
		this.params.body=xpow.point.Content.toString()
		}
	},
	getMsg : function(){
		xpow.show2hide($('_score.remark'))
		if(!('_score.isre').checked){$('_score.isre').value=''}
	},
	Submit : function(){
		var tErr=false,tMsg=''
		this.params.list.score = $('_score.value').value*1
		if(this.params.list.userid==this.params.Class.fromuid){alert('不能给自己加分！');return xpow.point.popClear();}
		if($('_score.value').value==''){tErr = true; tMsg+='请选择加分值！\n'}
		if($('_score.isre').checked&&$("_score.remark").value==''){tErr = true; tMsg +='请输入加分原因！\n'}
		if(this.params.Class.max<this.params.list.score){tErr = true; tMsg += '你的积分不够此次加分！\n';}
		if(tErr){alert(tMsg) ;return false}
		$('_score.params').value=this.params.vlist.Replace('url',top.location)
		if(!$('_score.iframe')){xpow.CreateElemt('iframe','width=200,height=200,name=_score.iframe,id=_score.iframe')}
		this.params.pth.setPath('\\\\{$chnimg}{$xm}{$chn}/channelModule?action=acscore')
		xpow.setFromTarget('_scoreform',this.params.pth.getFPath(),'_score.iframe','')
	},
	parseResult : function(t){
		if (t){
			alert('加分成功！')
			xpow.point.popClear()
			this.params.Class.max -= this.params.list.score
		}
	},
	add : function(){
		this.init()
		this.params.Exp=this.params.body.Replace('user',this.params.list.username).Replace('max',this.params.Class.max).Replace('f','<iframe style="display:none" src="about:blank" id="_score.iframe" name="_score.iframe"></iframe>')
		this.Export(xpow.osEvent.cSrcElmt.id,this.params.Exp)
	},
	Export : function(der,restr){
		xpow.point.setPop({mHeight:'100',mWidth:325,der:der,button:[{description:'确 定',action: function(){xpow.point.Score.Submit()}}]}),
		xpow.point.doPop(restr,5.2);
	}
}


CCpage = {
		param : {},
		init : function(){
			var re='<li class="tips" title="添加分页" onclick="CCpage.add()">&nbsp;</li>'
			if ($j('.CCpages .CCpagesItem').size()<1){
				$j('.CCpages').html('<div class="CCpagesItem" id="CCpage-1">&nbsp;</div>')
			}
			this.param.ccpageitemAry = $j('.CCpages .CCpagesItem')
			this.param.ccpageitemAry.each(function(i){ re += '<li class="tabitem" sn="'+(i+1)+'"><div class="spage" sn="'+(i+1)+'">'+(i+1)+'</div><div sn="'+(i+1)+'" title="删除该页" class="cchandle del"></div><div class="clear"></div></li>' })
			$j('.CCpagesTablist').html(re)
			this.regItem()
		},
		regItem : function(){
			var self = this
			this.param.tablist = $j('.CCpagesTablist li .spage')
			this.param.dellist = $j('.CCpagesTablist li .del')
			this.param.Max = this.param.tablist.size()
			this.param.dellist.each(function(i){ $s(this,'for',i+1) })
			this.param.tablist.each(function(i){ $s(this,'for',i+1) })
			this.param.tablist.hover(function(){
			if (!$j(this).hasClass('current'))$j(this).addClass('hover')}).mouseout(function(){
			if (!$j(this).hasClass('current'))$j(this).removeClass('hover')}).click(function(){
				self.param.tablist.each(function(){$j(this).removeClass('current').parent().removeClass('current')})
				$j(this).addClass('current')
				$j(this).parent().addClass('current')
				CCpage.setHTML($g(this,'sn'))
			})
			this.param.dellist.click(function(){
				self.del($g(this,'sn'),'',$g(this,'for'))
			})
		},
		add : function(){
			if (this.param.Max>19){return alert('已经达到最大页数！')}
			$j('.CCpages').append('<div class="CCpagesItem" id="CCpage-'+(this.param.Max+1)+'"></div>')
			this.init()
			this.setHTML(this.param.Max)
		},
		del : function(p,obj,f){
			var self = this,ctabary,cdelary
			if (this.param.Max<2){return alert('不能删除最后一页！')}
			if (!confirm('确定要删除此页吗？'))return
			xpow.osEvent.catchSrc()
			$j('.CCpages')[0].removeChild($j('#CCpage-'+p)[0])
			$j('.CCpagesTablist')[0].removeChild(xpow.osEvent.cSrcElmt.parentNode)
			ctabary = $j('.CCpagesTablist li.tabitem .spage'), cdelary = $j('.CCpagesTablist li.tabitem .del')
			ctabary.each(function(i){ $j(this).html(i+1); $s(this,'for',i+1) })
			cdelary.each(function(i){ $s(this,'for',i+1) })
			this.param.Max -=1
			if (this.param.current==p){
				if (ctabary.size()>=f){
					ctabary.each(function(){ if ($g(this,'for')==(f)){ self.param.current = $g(this,'sn') } })
				}else{
					ctabary.each(function(){ if ($g(this,'for')==(f-1)){ self.param.current = $g(this,'sn') } })
				}
				this.setHTML(this.param.current,1)
			}
		},
		hide : function(){
			$j('.CCpagesTablist').addClass('disnone')
		},
		show : function(){
			$j('.CCpagesTablist').removeClass('disnone')
		},
		setHTML : function(p,t){
			if (!$j('#CCpage-'+p)[0])return false
			if (this.param.current && !t){
				$j('#CCpage-'+this.param.current).html(KE.getData())
			}
			setTimeout(function(){KE.setData($j('#CCpage-'+p)[0].innerHTML)},1)
			$j(this.param.tablist[p-1]).addClass('current').parent().addClass('current')
			this.param.current = parseInt(p)
		},
		getHTML : function(){
			var re='',app,self=this,capy = $j('.CCpages .CCpagesItem')
			$j('#CCpage-'+this.param.current).html(KE.getData())
			capy.each(function(i){
				app = '{%page%}'
				if (this.innerHTML.toHtmlTrim()!=''){ re += this.innerHTML+app }
			})
			if (re!=''){re=re.toLeft(8)}
			return re
		}
	}

xpow.point.dMsg={
	oDLG : '',param:{},
	init : function(){
		this.oDLG = xpow.Use('dlg')
		this.loadtpl()
	},
	rest : function(){
		this.param.gavlist.each(function(){$j(this).removeClass('current');$j('.tab_'+$g(this,'for')).addClass('disnone')})
		$j('.tab_'+this.mnutag).removeClass('disnone')
	},
	setInner : function(){
		if (this.param.inner)return 
		var cc = xpow.point.Content
		cc.append('<div class="messagebox" >')
		cc.append('<ul class="morelist disnone"><li for="idea">智料</li><li for="edu">计算机辅助设计</li><li for="co">企业展馆</li><li for="me">Me 空间</li></ul>')//<li for="hr">人才</li><li for="shop">商城</li>
		cc.append('<div class="sxlogo"><img align="absmiddle" src="http://www.chnimg.com/images/common/icon/sxlogo.png" /></div>')
		cc.append('<ul class="gavlist">')
		cc.append('    <li for="news" class="current menumore">最新资讯</li><li for="notice" class="spy">好友小纸条(<span class="notice_counter">0</span>)</li>')
		cc.append('    <li for="mail" class="spy">消息(<span class="mail_counter">0</span>)</li>')
		cc.append('    <li for="system" class="spy">给管理员小纸条</li>')
		cc.append('</ul>')
		cc.append('<div class="clear"></div><div class="msgconcc">')
		cc.append('<div class="tab_news tab_idea tab_edu"><div class="tab_title">智料</div><div class="msglst"></div></div>')
		cc.append('<div class="tab_notice " style="overflow: hidden; ">')
		cc.append('    <div class="grid mailfriend"></div>')
		cc.append('    <div style="overflow: auto; float: right; height: 265px; width: 410px; "><ul class="msglst" style="height:217px;"></ul><div style="margin:-12px 0 10px 0;"><input type="checkbox" /> 删除</div><div class="_pages"></div><div class="clear"></div>')
		cc.append('    </div><div class="clear"></div>')
		cc.append('</div>')
		cc.append('<div class="tab_mail "><ul class="msglst" style="height:216px;"></ul><div style="margin:-12px 0 10px 0;"><input type="checkbox" /> 删除</div><div class="_pages"></div></div>')
		cc.append('<div class="tab_system "><div class="title">请输入内容：</div><div><textarea rows="5" cols="50"></textarea></div></div><div class="tab_co tab_me disnone"><div class="msglst"></div></div>')
		cc.append('</div></div>')
		this.param.inner=cc.toString()

	},
	regItem : function(){
		var self = this
		this.param.gavlist=$j('.gavlist li')
		this.param.gavlist.click(function(){
			self.param.gavlist.each(function(){$j(this).removeClass('current');$j('.tab_'+$g(this,'for')).addClass('disnone')})
			$j(this).addClass('current')
			self.mnutag = $g(this,'for')
			if (self.mnutag!='system') $j('.tab_'+self.mnutag).removeClass('disnone')
			self.list(self.mnutag)
		})
		$j(this.param.gavlist[0]).click()
		this.channelTag = '智料'
		$j('.menumore').mouseout(function(){
			self.timmorelist = setTimeout(function(){$j('.morelist').addClass('disnone')},500)
		})
		
		if (!self.morlst)self.morlst = $j('.morelist')
		if (!self.morlstli)self.morlstli = $j('.morelist li')
		self.morlstli.mouseover(function(){
			clearTimeout(self.timmorelist)
			if (self.removemorelist)self.removemorelist=false
			self.morlst.removeClass('disnone')
			$j(this).addClass('hover')
		}).mouseout(function(){
			clearTimeout(self.timmorelist)
			$j(this).removeClass('hover')
		}).click(function(){
			self.mnutag=$g(this,'for')
			self.rest()
			$j(self.param.gavlist[0]).addClass('current')
			self.channelTag = this.innerHTML
			self.list(self.mnutag)
			self.morlst.addClass('disnone')
		})
		self.morlst.mouseout(function(){
			clearTimeout(self.timmorelist)
			xpow.osEvent.catchSrc()
			self.removemorelist = true
			if(xpow.osEvent.cSrcElmt.parentNode.className==$j(this).parent().attr('class'))$j(this).addClass('disnone')
		})
		$j('.menumore').mouseover(function(){
			var offset={}
			clearTimeout(self.timmorelist)
			offset.top = ($j.browser.msie)?60:25
			offset.left = ($j.browser.msie)?30:0
			self.morlst.removeClass('disnone')
			self.morlst.css({'left':this.offsetLeft+offset.left,'top':this.offsetTop+offset.top})
		})
		setInterval(function(){self.flush()},300000)
		self.flush()
	},
	loadtpl : function(func){
		this.setInner()
		this.doExport(this.param.inner)
	},
	doExport : function(restr){
		var self = this
		if (this.oDLG.ISEXPORT){this.oDLG.Clear()}
		this.oDLG.doInit('xpow.point.dMsg.oDLG');
		this.oDLG.onComplete = function(){$j('.maintpl').empty(); self.regItem()}
		this.oDLG.mWidth = 610
		this.oDLG.mHeight = 410
		this.oDLG.isMask = 0
		this.oDLG.Export(restr);
	},
	list : function(type,page,uid){
		var self = this
		page = page ||0
		if (self.mnutag=='system'){
			xpow.point.Message.toAdmin.init()
		}else{
			$j('.tab_'+self.mnutag+' .msglst').html(xpow.point.Effect.getLoadingIcon(3.2))
			this.JSNinit('test')
			xpow.JSN.sendJSN('/system/user/?action=load'+type+'&page='+page+'&uid='+uid,function(data){self.getTpl(data)})
		}
	},
	getTpl : function(data,pg){
		var self = this
		$j('.msglst').empty()
		switch(this.mnutag){
		case 'idea':
		case 'edu':
		case 'news':
			self.news={}
			self.news.mtag = this.mnutag=='news'?'idea':this.mnutag
			$j.each(data,
				function(v,item){
					self.news.indeximgcss=''
					self.news.licss='right'
					if (item.index_img==''){
						self.news.indeximgcss='disnone'
						self.news.licss='left'
					}
					$j('<ul />').append(
						'<li class="left '+self.news.indeximgcss+'"><a href="http://'+self.news.mtag+'.chndesign.com/view/'+item.id+'.html" target="_blank"><img align="absbottom" src="'+item.index_img+'"></a></li>'+
						'<li class="'+self.news.licss+'">'+
						  '<div class="topic"><a href="http://'+self.news.mtag+'.chndesign.com/view/'+item.id+'.html" target="_blank">'+item.topic+'</a></div>'+
						  //'<div class="times">'+item.tim+'&nbsp;&nbsp;&nbsp;&nbsp;click:'+item.visited+'&nbsp;&nbsp;&nbsp;&nbsp;Replies:'+item.replies+'</div>'+
						  '<div class="summary"><a href="http://'+self.news.mtag+'.chndesign.com/view/'+item.id+'.html" target="_blank">'+item.summary.toString().deHTML()+'</a></div>'+
						'</li>'+
						'<li class="clear"></li>'
					).appendTo($j('.tab_'+self.news.mtag+' .msglst'))
				}
			)
			
			break;
		case 'notice':
			this.channelTag = false
			self.notice={}
			$j.each(data,
				function(v,item){
					if(item.error=='guest'){
						$j('.tab_'+self.mnutag).html('<div class="none">你没有登陆！<div>')
					}else{
						if (item.page){
							$j('.tab_'+self.mnutag+' ._pages').html(item.page.deHTML())
						}
						
						if (item.friends){
							$j('.tab_'+self.mnutag+' .mailfriend').html(item.friends.deHTML())
							self.regFriends()
						}
						
						//if (item.listcountss<1){
							//$j('<div class="none">暂时没有小纸条</div>').appendTo($j('.tab_'+self.mnutag+' .msglst'))
						//}else{
						
						if (item.remark){
							self.notice.imgcss=''
							if (item.u_headpic==''){ self.notice.imgcss='disnone' }
							self.notice.remark = item.remark.toString().clearHTML()
							$j('<li style="margin-bottom:5px" />').append(
								'<div class="grid" style=" margin-right:10px"><input type="checkbox" value="'+item.id+'" /> <img class="'+self.notice.imgcss+'" width="20" height="20" align="absmiddle" src="'+item.u_headpic+'" /></div>'+
								'<div class="grid" ><a class="linkmsg" onclick="xpow.point.dMsg.showmsg()" style=" width:290px; overflow:hidden" href="javascript:;" id="'+item.id+'">'+self.notice.remark+'</a> <span class="times">'+item.tim+'</span></div>'
							).append('<li class="clear" />').appendTo($j('.tab_'+self.mnutag+' .msglst'))
						}
							
						//}
					}
					
			});break;
		case 'mail':
			this.channelTag = false
			self.notice={}
			$j.each(data,
				function(v,item){
					if(item.error=='guest'){
						$j('.tab_'+self.mnutag).html('<div class="none">你没有登陆！<div>')
					}else{
					
						if (item.page){
							$j('.tab_'+self.mnutag+' ._pages').html(item.page.deHTML())
						}else{
							$j('<li style="margin-bottom:5px" />').append(
								'<div class="userimg"><input value="'+item.id+'" type="checkbox" /><a class="linkmsg" onclick="xpow.point.dMsg.showmsg()" href="javascript:;" id="'+item.id+'">'+ item.topic+'</a></div>'
							).append('<li class="clear" />').appendTo($j('.tab_'+self.mnutag+' .msglst'))
						}
					}
			});break;
		case 'co':
		case 'me':
			var re='',res=''
			$j.each(data, function(v,item){
				if (item.works){
					$j.each(item.works,function(v,items){
						res+='<a href="http://'+self.mnutag+'.chndesign.net/'+items.exid+'/exhibition-view-'+items.id+'.html" target="_blank"><img width="130" src='+items.pic+' alt="'+items.topic+'" title="'+items.topic+'" /></a>'
					})
				}else{
					re += '<li><a href="http://'+self.mnutag+'.chndesign.net/'+item.exid+'/news-view-'+item.id+'.html" target="_blank">'+item.topic+'</a></li>'
				}
			})
			
			$j('<div class="grid first"/>').append($j('<ul />').append(re)).appendTo($j('.tab_'+self.mnutag+' .msglst'))
			$j('.tab_'+self.mnutag+' .msglst').append(res)
			break;
		case 'system':
			self.channelTag = false
			//return xpow.point.Message.toAdmin()
			break;
		}
		
		if(self.channelTag){$j('.tab_title').removeClass('disnone');$j('.tab_title').css({'margin-bottom':'25px'}).html(self.channelTag)}else{$j('.tab_title').css({'margin-bottom':'0'}).html('')}
	},
	regFriends : function(){
		var self = this
		$j('.friendslist li a').attr('target','_self').click(function(){ self.list('notice',1,$g(this,'for')) })
	},
	showmsg : function(){
		var selftg = this.mnutag,self=this
		this.mailpop = {}
		this.mailpop.button=false
		if (this.mnutag=='notice'){this.mailpop.button=[{description:'发送',action:function(){self.sendMsg()}}]}
		xpow.osEvent.catchSrc()
		xpow.point.setPop({button:this.mailpop.button,onComplete:function(){
			xpow.JSN.sendJSN('/system/user/?action=readnotice&tag='+selftg+'&dataid='+xpow.osEvent.cSrcElmt.id,function(data){
				$j.each(data,function(v,item){$j('._msgbox').html(item.msg.deHTML())})
				self.flush()
			})
		}})
		xpow.point.doPop('<div class="_msgbox"></div>')
	},
	sendMsg : function(){
		var otxt = $j('.mailtxt')[0],oval = otxt.value.toHtmlTrim(),tSyb = xpow.Use('letter').get(30);
		if (oval==''){otxt.value=''; return alert('请输入纸条内容！')}
		var re= '_mail_f_userid='+$('_mail_f_userid').value+tSyb+'_mail_f_remark='+oval+tSyb
		this.JSNinit('test')
		xpow.JSN.SendX('sms',re)
	},
	sendSucc : function(){
		if (xpow.point.Message.Send.param.insend){
			xpow.point.Message.Send.oDLG.Clear()
			xpow.point.Message.Send.param.insend=false
			alert('消息发送成功！')
			return
		}
		xpow.point.setBtns({id:'xpow.emObj._PMS_.COMMONPOP',button:[{description:'确 定',action:function(){xpow.point.popClear()}}]})
		$j('._msgbox').html('小纸条发送成功！')
		this.flush()
	},
	flush : function(){
		var self = this
		var tary = ('mail,notice').split(',')
		for(var ix=0; ix<tary.length; ix++){ $j('.'+tary[ix]+'_counter').html('0') }
		xpow.JSN.sendJSN('/system/user/?action=getmsgflush',function(data){
			$j.each(data,
				function(v,item){
					for(var i in item){
						$j('.'+i+'_counter').html(item[i].total)
					}
				}
			)
		})
	},
	JSNinit : function(st){xpow.JSN.Init('\\\\/system/user/','',0,st,0,0) }
}

Object.extend(Number.prototype, {
		toColorPart: function() {return this.toPaddedString(2, 16)},
		succ: function() {return this + 1;},
		times: function(iterator) {$R(0, this, true).each(iterator);return this},
		toPaddedString: function(length, radix) {
			var string = this.toString(radix || 10);
			return '0'.times(length - string.length) + string;
		},
		toJSON: function() {return isFinite(this) ? this.toString() : 'null';}
	}
)

xpow.point.txtFocus = function(){}
Object.extend(xpow.point.txtFocus.prototype, {
		param:{},
		add : function(obj,initkey,keyup){
			var self = this
			this.param.initquerykey = initkey?initkey:''
			this.param.oQuerykey = xpow.point.Lang.isObject(obj)?obj:$j(obj)
			this.param.oQuerykey.blur(function(){
				if (trim(this.value)=='') {this.value=self.param.initquerykey; self.param.ischange=false; this.className=''}
			}).click(function(){
				if (trim(this.value)==self.param.initquerykey) {this.value=''}
			}).mouseover(function(){
				this.focus()
				this.select()
			}).keyup(function(e){
				if (e.keyCode==13) {
					if (keyup){keyup()}else{return false}
				}else{
					if (trim(this.value)!=self.param.initquerykey && trim(this.value)!='') { self.param.ischange=true; this.className='current'}			
				}
			})
		}
	}
)

function getRadioValue(RadioName){
    var obj;    
    obj=$e(RadioName);
    if(obj!=null){
        for(var i=0;i<obj.length;i++){
            if(obj[i].checked){
                return obj[i].value;            
            }
        }
    }
    return null;
}


xpow.Use = function(mode,objname){
	var OBJ
	switch (mode){
		case 'path' 		: OBJ = xpow.point.Path; break;
		case 'path.ext' 	: OBJ = xpow.point.Path.Extend; break;
		case 'img' 			: OBJ = xpow.point.IMG; break;
		case 'keyword'		: OBJ = xpow.point.Keyword; break;
		case 'color'		: OBJ = xpow.point.Color; break;
		case 'regexp'		: OBJ = xpow.point.RegExps; break;
		case 'favo'			: OBJ = xpow.point.Favo; break;
		case 'search'		: OBJ = xpow.point.Search; break;
		case 'error'		: OBJ = xpow.point.Error; break;
		case 'effect'		: OBJ = xpow.point.Effect; break;
		case 'menu'			: OBJ = xpow.point.Menu; break;
		case 'color'		: OBJ = xpow.point.Color; break;
		case 'cookie'		: OBJ = xpow.point.Cookie; break;
		case 'letter'		: OBJ = xpow.point.Letter; break;
		case 'recommend'	: OBJ = xpow.point.Recommend; break;
		case 'content'		: OBJ = xpow.point.Content; break;
		
		case 'em.extend'	: OBJ = xpow.emObj.Extend; break;
		case 'em.editor'	: OBJ = xpow.emObj.Editor; break;
		case 'em.upload'	: OBJ = xpow.emObj.Upload; break;
		case 'em.supload'	: OBJ = xpow.emObj.SUpload; break;
		
		
		case 'event'	: OBJ = xpow.osEvent; break;
		case 'script'	: OBJ = xpow.point.Script; break;
		case 'txtfocus'	: OBJ = new xpow.point.txtFocus(); break;
		case 'MultiUploader' : OBJ = new xpow.point.MultiUploader(); break;
		case 'tree'		: OBJ = new XPOWS.shellTree(); break;
		case 'table'	: OBJ = new XPOWS.shellTable(); break;
		case 'dlg'		: OBJ = new xpow.point.dlg(); break;
		case 'upload'	: OBJ = new xpow.upload(); break;
		case 'dir'		: OBJ = new xpow.dir(objname); break;
	}
	return OBJ
}


/**********************************
MD5 = xpow.point.MD5
Error = xpow.point.Error
**********************************/

xpow.point.init = function(){
	if (xpow.point.isinit)return
	try{xpow.JSN.init()}catch(e){}
	xpow.emObj.Header.init()
	xpow.point.isinit=true
}

Destroy = {
	add : function(obj){
		obj = null
	},
	onunload : function(obj){
		$j=null
		$jy=null
		xpow.emObj.MyZone=null
		xpow.JSN=null
		xpow.point.MultiUploader=null
		XPOWS.shellTree=null
		XPOWS.shellTable=null
		xpow.point=null
		xpow=null
		KE=null
		jQuery=null
		xZone=null
		this.Clear()
	},
	Clear : function(){
		if (typeof CollectGarbage =='undefined')CollectGarbage=function(){}
		try{
			setTimeout('CollectGarbage()',1)
		}catch (e){

		}
	}
}

function parseError(){
	var len=arguments.length,emsg='加载时产生了一个错误，需要重新刷新页面！';
	for(var i=0;i<len;i++){ emsg+='\n错误'+(i+1)+'：'+arguments[i] }
	if (emsg.indexOf('ui.mouse')>0 || emsg.indexOf('.prototype')>0 ){
		window.onerror=null;window.location.reload()
		return true;
	}
}

_xpExt_ = xpow.Use('em.extend')
xpow.point.isinit=false
window.onunload = function(){Destroy.onunload()}
window.onerror=parseError;
xpow.window.addOnLoad('xpow.point.init()')
