/*! * lhgcore javascript library v1.4.1 * date: 2010-04-16 08:40:11 * copyright (c) 2009 - 2010 by li hui gang */ (function(t,x){var f=function(a,b){return new f.fn.init(a,b)},k=t.document,ra=array.prototype.push,sa=array.prototype.slice,r=object.prototype.tostring,s=object.prototype.hasownproperty,z=false,l=[],j,ta=/^#[\w-]+$/,ua=/^(\s|\u00a0)+|(\s|\u00a0)+$/g;f.fn=f.prototype={init:function(a,b){if(!a)return this;if(a.nodetype){this[0]=a;this.length=1;return this}var c;b=b||k;if(typeof a==="string")if(a.indexof("<")===0){b=b.ownerdocument||b;if(c=va.exec(a))a=[b.createelement(c[1])];else{c=$([a],[b]);a=(c.cacheable?c.fragment.clonenode(true):c.fragment).childnodes}}else if(ta.test(a)&&b.nodetype===9){a=a.slice(1);if(c=b.getelementbyid(a)){if(c.id!==a)c=b.all[a];this.length=1;this[0]=c}return this}else a=f.find(a,b);else if(t(a))return wa.ready(a);return this.setarray(m(a)?a:k(a))},lhgren:"lihuigang",setarray:function(a){this.length=0;ra.apply(this,a);return this},each:function(a){return f.each(this,a)},get:function(a){return a===x?sa.call(this):this[a]},eq:function(a){return this.setarray([this[a]])},bind:function(a,b){for(var c=0,d=this.length;c=0||u(i.text,c)>=0});if(!c.length)i.selectedindex=-1}else i.value=a}return this},css:function(a,b){return aa(this,a,b,"css")},attr:function(a,b){return aa(this,a,b,"attr")},addclass:function(a){for(var b=0,c=this.length,d,g=(a||"").split(ba);b=0)return true;return false},append:function(){return this.insert(arguments,true,function(a){this.nodetype===1&&this.appendchild(a)})},prepend:function(){return this.insert(arguments,true,function(a){this.nodetype===1&&this.insertbefore(a,this.firstchild)})},before:function(){return this.insert(arguments,false,function(a){this.parentnode.insertbefore(a,this)})},after:function(){return this.insert(arguments,false,function(a){this.parentnode.insertbefore(a,this.nextsibling)})},insert:function(a,b,c){function d(y,p){return b&&f(y,"table")&&f(p,"tr")?y.getelementsbytagname("tbody")[0]||y.appendchild(y.ownerdocument.createelement("tbody")):y}var g;g=a[0];var h=[],i;if(this[0]){a=(g=g&&g.parentnode)&&g.nodetype===11&&g.childnodes.length===this.length?{fragment:g}:$(a,this,h);i=a.fragment;if(g=i.childnodes.length===1?(i=i.firstchild):i.firstchild){b=b&&f(g,"tr");for(var m=0,z=this.length;m1||a.cacheable||m>0?i.clonenode(true):i)}h.length>0&&f.each(h,aa)}return this},ready:function(a){f.bindready();if(f.isready)a.call(k,f);else l&&l.push(a);return this}};f.fn.init.prototype=f.fn;f.isplainobject=function(a){if(!a||r.call(a)!=="[object object]"||a.nodetype||a.setinterval)return false;if(a.constructor&&!s.call(a,"constructor")&&!s.call(a.constructor.prototype,"isprototypeof"))return false;var b;for(b in a);return b===x||s.call(a,b)};f.extend=f.fn.extend=function(){var a=arguments[0]||{},b=1,c;if(arguments.length===b){a=this;--b}b=arguments[b];for(var d in b){c=b[d];if(a!==c)a[d]=f.isplainobject(c)&&!m(c)?arguments.callee(a[d]||{},c):c}return a};f.extend({isfunction:function(a){return r.call(a)==="[object function]"},isarray:function(a){return r.call(a)==="[object array]"},trim:function(a){return(a||"").replace(ua,"")},globaleval:function(a){if(a&&/\s/.test(a)){var b=k.getelementsbytagname("head")[0]||k.documentelement,c=k.createelement("script");c.type="text/javascript";if(g.ie)c.text=a;else c.appendchild(k.createtextnode(a));b.insertbefore(c,b.firstchild);b.removechild(c)}},now:function(){return(new date).gettime()},nodename:function(a,b){return a.nodename&&a.nodename.touppercase()==b.touppercase()},root:function(a){a=a||k;return a.compatmode==="css1compat"?a.documentelement:a.body},each:function(a,b){var c,d=0,g=a.length;if(g===x)for(c in a){if(b.call(a[c],c,a[c])===false)break}else for(c=a[0];d|\+)/,m=/(\([^)]*)\+/,z=/(\[[^\]]+)~/,y=/ +/,p={"":function(e,j){return!!e.getattribute(j)},"=":function(e,j,l){return(j=e.getattribute(j))&&j===l},"^=":function(e,j,l){return(j=e.getattribute(j)+"")&&!j.indexof(l)},"$=":function(e,j,l){return(j=e.getattribute(j)+"")&&j.indexof(l)==j.length-l.length},"*=":function(e,j,l){return(j=e.getattribute(j)+"")&&j.indexof(l)!==-1},"!=":function(e,j,l){return!(j=e.getattribute(j))||!(new regexp("(^| +)"+l+"($| +)")).test(j)}},u={"first-child":function(e){return e.parentnode.getelementsbytagname("*")[0]===e},"last-child":function(e){for(e=e;(e=e.nextsibling)&&e.nodetype===1;);return!!e},"nth-child":function(e,j){var l=j[1]+(j[2]||1)-0;j=j[3]-0;var q=e.parentnode;if(q&&!q.nodeindex){var n=0,s=e;for(s=q.firstchild;s;s=s.nextsibling)if(s.nodetype===1)s.nodeindex=++n}e=e.nodeindex-j;return l===0?e===0:e%l===0&&e/l>=0},empty:function(e){return!e.firstchild},parent:function(e){return e.firstchild},checked:function(e){return e.checked},enabled:function(e){return!e.disabled&&e.type!=="hidden"},disabled:function(e){return e.disabled},hidden:function(e){return e.type==="hidden"||e.style.display==="none"},visible:function(e){return e.type!=="hidden"&&e.style.display!=="none"},selected:function(e){return e.selected},radio:function(e){return e.type==="radio"},checkbox:function(e){return e.type==="checkbox"},text:function(e){return e.type==="text"},button:function(e){return e.type==="button"||e.nodename.tolowercase()==="button"}};f.find=function(e,j){j=j||k;var l=[];if(c.test(e)&&j.nodetype){var q=0;switch(e.charat(0)){case".":var n=e.slice(1);if(a)l=j.getelementsbyclassname(n);else{n=" "+n+" ";for(var s=j.getelementsbytagname("*"),h=0;j=s[h++];)if((" "+j.classname+" ").indexof(n)!==-1)l[q++]=j;l=q?l:[]}break;case":":s=j.getelementsbytagname("*");h=0;for(e=e.slice(1);j=s[h++];)if(u[e]&&u[e](j))l[q++]=j;l=q?l:[];break;default:l=j.getelementsbytagname(e);break}}else{if(b)try{return j.queryselectorall(e)}catch(qa){}for(var ea=e.split(d),fa=ea.length-1,da=!!fa,ga,ha,o,x,a,b,c,v,w,n,d,ia,r,o,q,i;q=ea[fa--];){ha=(ga=q.replace(m,"$1%").replace(z,"$1&").replace(i," $1 ").split(y)).length;h=0;x=" ";for(s=j.nodetype?[j]:k(j);o=ga[h++];)if(o!==" "&&o!==">"&&o!=="~"&&o!=="+"&&s){o=o.match(g);a=o[1]||"*";b=o[2];c=o[3]?" "+o[3]+" ":"";v=o[4];w=o[5]||"";e=o[7];n=e==="nth-child"?h.exec(o[8]==="even"&&"2n"||o[8]==="odd"&&"2n+1"||!/\d/.test(o[8])&&"0n+"+o[8]||o[8]):o[8];d=[];q=ia=0;for(o=h==ha;r=s[ia++];)switch(x){case" ":q=r.getelementsbytagname(a);for(i=0;n=q[i++];)if((!b||n.id===b)&&(!c||(" "+n.classname+" ").indexof(c)!==-1)&&(!v||p[w]&&(p[w](n,v,o[6])||v==="class"&&p[w](n,"classname",o[6])))&&!n.yeasss&&(u[e]?u[e](n,n):!e)){if(o)n.yeasss=1;d[q++]=n}break;case"~":for(a=a.tolowercase();(r=r.nextsibling)&&!r.yeasss;)if(r.nodetype===1&&(a==="*"||r.nodename.tolowercase()===a)&&(!b||r.id===b)&&(!c||(" "+r.classname+" ").indexof(c)!==-1)&&(!v||p[w]&&(p[w](n,v,o[6])||v==="class"&&p[w](n,"classname",o[6])))&&!r.yeasss&&(u[e]?u[e](r,n):!e)){if(o)r.yeasss=1;d[q++]=r}break;case"+":for(;(r=r.nextsibling)&&r.nodetype!==1;);if(r&&(r.nodename.tolowercase()===a.tolowercase()||a==="*")&&(!b||r.id===b)&&(!c||(" "+n.classname+" ").indexof(c)!==-1)&&(!v||p[w]&&(p[w](n,v,o[6])||v==="class"&&p[w](n,"classname",o[6])))&&!r.yeasss&&(u[e]?u[e](r,n):!e)){if(o)r.yeasss=1;d[q++]=r}break;case">":q=r.getelementsbytagname(a);for(i=0;n=q[i++];)if(n.parentnode===r&&(!b||n.id===b)&&(!c||(" "+n.classname+" ").indexof(c)!==-1)&&(!v||p[w]&&(p[w](n,v,o[6])||v==="class"&&p[w](n,"classname",o[6])))&&!n.yeasss&&(u[e]?u[e](n,n):!e)){if(o)n.yeasss=1;d[q++]=n}break}s=d}else x=o;if(da){if(!s.concat){d=[];for(i=0;n=s[i];)d[i++]=n;s=d}l=s.concat(l.length==1?l[0]:l)}else l=s}for(q=l.length;q--;)w(l[q],["yeasss","nodeindex"])}return l}})();var ja=k.defaultview||{},ka=/href|src|style/,ba=/\s+/,ya=/[\n\t]/g,la=/float/i,ma=/-([a-z])/ig,ea=/([a-z])/g,na={"class":"classname","for":"htmlfor"},fa={"float":g.ie?"stylefloat":"cssfloat"},oa=function(a,b){return b.touppercase()},aa=function(a,b,c,d){var g=b,h=0,i=a.length;if(typeof b==="string")if(c===x){d=d==="css"?"getcss":"getattr";return i?f[d](a[0],b):null}else{g={};g[b]=c}for(;h(?:<\/\1>)?$/,ga=/(<([\w:]+)[^>]*?)\/>/g,ha=/<|&\w+;/,ia=/<([\w:]+)/,xa=/"},e={option:[1,'"],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],rdefault:[0,"",""]};e.tbody=e.caption=e.thead;e.th=e.td;if(g.ie)e.link=e.script=[1,"div
","
"];var la=function(a,b,c,d){b=b||k;if(typeof b.createelement==="undefined")b=b.ownerdocument||b[0]&&b[0].ownerdocument||k;for(var g=[],h=0,i=a.length,m;h0&&settimeout(function(){e&&!u&&l("timeout")},a.timeout)}try{e.send(a.data)}catch(n){f.handleerror(a,e,null,n)}a.async||l();return e},handleerror:function(a,b,c,d){a.error&&a.error(b,c,d)},httpsuccess:function(a){try{return!a.status&&location.protocol=="file:"||a.status>=200&&a.status<300||a.status==304||a.status==1223}catch(b){}return false},httpdata:function(a,b){var c=a.getresponseheader("content-type");a=(c=b=="xml"||!b&&c&&c.indexof("xml")>=0)?a.responsexml:a.responsetext;if(c&&a.documentelement.tagname=="parsererror")throw"parsererror";if(typeof a==="string"){b=="script"&&f.globaleval(a);if(b=="json")a=t.eval("("+a+")")}return a},param:function(a){function b(i,m){c[c.length]=encodeuricomponent(i)+"="+encodeuricomponent(m)}var c=[];if(m(a)||a.lhgren)for(var d=0,g=a.length;d