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