var View={};View.ListView=function(_1){var _2;var _3;var _4,_5;var _6;var _7;var _8;var _9;if(typeof _1=="object"){_2=_1.panel;_3=_1.item;_4=_1.rs;_5=_1.rs;_6=_1.column;_7=_1.className}if(typeof _3=="undefined"){alert("Lack of item param");return false}var _a="";_a=_2;_2=$("#"+_2);_3=$("#"+_3);if(_3.length==0){alert("item:'"+_a+"' can not find.");return false}else{_9=_3.clone(true)}function _b(oE){return $("ROW",oE).length>0?true:false};function _c(_d,oE){var s;for(var i=0;i<oE.childNodes.length;i++){s=oE.childNodes[i].tagName;_d=_d.replace("$"+s,$(oE.childNodes[i]).text())}return _d};function _e(_f){if(typeof(_f)!="object"){_f=_4}if(_b(_f)){var _10=$("ROW",_f);var _11=_9.clone(true);_2.html("");var _12,j,_13,_14;for(var i=0;i<_10.length;i++){_12=_10[i];_13=_11.clone(true).appendTo(_2);if(typeof _7=="string"){_13.addClass(_7)}else{if(typeof _7=="object"){_13.addClass(_7[i%_7.length])}}for(j=0;j<_6.length;j++){_14=typeof _6[j].render=="function"?_6[j].render(_12):_c(_6[j].tpl,_12);if(typeof _6[j].maxLength=="number"){if(_14.length>_6[j].maxLength){$("#"+_6[j].boxid,_13).attr("title",_14);_14=_14.substr(0,_6[j].maxLength)+"..."}}$("#"+_6[j].boxid,_13).html(_14)}}}else{}};function _15(_16,_17){if(_b(_4)){var _18=$("ROW>"+_16,_4);var _19=new Array();for(var i=0;i<_18.length;i++){_19[_19.length]=_18[i].childNodes[0].nodeValue}_19.sort();var _1a,j,_1b=_4.cloneNode(true);var _1c=_1b.documentElement;var _1a=_1c.childNodes;for(var i=0;_1a.length>0;){_1c.removeChild(_1a[0])}if(typeof _17!="string"){_17="asc"}if(_17.toLowerCase()=="asc"){for(var i=0;i<_19.length;i++){_1a=_1d(_16,_19[i]);for(j=0;j<_1a.length;j++){_1c.appendChild(_1a[j])}}}else{for(var i=_19.length;i>0;i--){_1a=_1d(_16,_19[i-1]);for(j=0;j<_1a.length;j++){_1c.appendChild(_1a[j])}}}return _1b}else{alert("No data to sort.")}};function _1e(_1f){var oRs=_4;if(_b(oRs)){var _20=$("ROW>"+sField,oRs);for(var i=0;i<_20.length;i++){if(!_21(_20[i],_1f)){_20[i].remove()}}}else{}return oRs;function _21(_22,_23){var _24;for(key in _23){_24=$(key,_22).text();if(_24!=_23[key]){return false}}return true}};function _25(oE){};function _1d(_26,val){var _27=$("ROW>"+_26,_4);var _28=new Array();for(var i=0;i<_27.length;i++){if(_27[i].childNodes[0].nodeValue==val){_28[_28.length]=_27[i].parentNode}}return _28};return{render:function(oEl){if(typeof oEl=="object"){_2=$(oEl)}else{if(typeof oEl=="string"){_2=$("#"+oEl)}}if(_2.length==0){alert("Lack of Panel param!");return false}_e()},update:function(res){_4=res;_e()},refresh:function(){_e()},sort:function(_29,_2a){var oRs=_15(_29,_2a);_e(oRs)},filter:function(){var oRs=_1e(oCondition);_e(oRs)}}};View.Update=function(_2b){var _2c,_2d;if(typeof _2b=="object"){_2c=_2b.panel;_2d=_2b.url}if(typeof _2c=="undefined"){alert("Lack of panel");return false}var tmp=_2c;_2c=$("#"+_2c);if(_2c.length==0){alert("Panel:'"+tmp+"' can not find.");return false}function _2e(res){if(res){_2c.html(res)}};return{refresh:function(){$.get(_2d,_2e)},update:function(url){var _2f=_2d;if(typeof url=="string"){_2f=url}$.get(_2f,_2e)}}};
