/** AJAX回傳值額外執行
 *  AJAX return value additional execution
 */
function csweb_ajax_prots(type, pary, afor, rtnm, tobj){
	var tid = null;
	if(type == 'beforeSend') pary = pary.abef;
	else if(type == 'success') pary = pary.asuc;
	else if(type == 'error') pary = pary.aerr;
	else if(type == 'complete') pary = pary.aerr;
	if(isck_STRING(pary.id,'Y')){
		if(pary.id == 'this' && (tobj)) tid = tobj;
		else if($(pary.id).length > 0) tid = $(pary.id);
	}
	if(pary.type == 'load'){
		if(tid) tid.empty().html(rtnm); else console.log(tid);
	}else if(pary.type == 'func'){
		if(isck_STRING(pary.name,'Y')){
			try{
				eval('if(typeof '+pary.name+' == "function"){'+pary.name+'('+
						((isck_OBJECT(pary.para)) ? JSON.stringify(pary.para) : '{}')+','+
						((isck_ARRAY(afor)) ? JSON.stringify(afor) : '[]')+','+
						((isck_JSON(rtnm)) ? rtnm : '\'\'')+
					 ');}');
			}catch(e){
				console.log('error:'+e+'('+rtnm+')');
			}
		}
	}else if(pary.type == 'egjq'){
		if(pary.para) csweb_ajax_jqenge(pary.para, tobj);
	}else if(pary.type == 'rstr'){
		if(isck_JSON(rtnm)){
			var jobj = JSON.parse(rtnm);
			if(jobj.type == 'fiveE'){
				if(typeof mode_valchange_action == 'function' && (jobj.data) && (jobj.dform)){
					mode_valchange_action(jobj.data, jobj.dform);
				}
			}else if(jobj.type == 'egjq'){
				if(jobj.para) csweb_ajax_jqenge(jobj.para, tobj);
			}
		}
	}else if(pary.type == 'tmsg'){
		if(isck_STRING(rtnm,'Y')) console.log(rtnm);
	}
}