(function(){var c=this,f=c.JUI,e=c.$,b=1,d=JUI=c.JUI=c.$=function(g,h){if(g==c){return d.Window?new d.Window(g):c}if(d.Element){return new d.Element(g,false)}return document.getElementById(g)};var a={initialize:function(l){l=l||{};var h=l.initialize;var g=l.legacy;var k=l.name||JUI.name;var j=h||g;var i=l.protect;var m=l.afterImplement||function(){};j.constructor=this.initialize;j.$family=k.toLowerCase();if(g&&h){j.prototype=g.prototype}j.prototype.constructor=j;j.prototype.$family=j.$family;var o=function(r,p,s,q){if(!i||q||!r.prototype[p]){r.prototype[p]=s}m.call(r,p,s);return r};j.alias=function(r,p,s){if(typeof r=="string"){if((r=this.prototype[r])){return o(this,p,r,s)}}for(var q in r){this.alias(q,r[q],p)}return this};j.genericize=function(q,p){if(typeof q=="string"){if((!p||!this[q])&&typeof this.prototype[q]=="function"){this[q]=function(){var s=Array.prototype.slice.call(arguments);return this.prototype[q].apply(s.shift(),s)}}return}for(var r=0;r<q.length;r++){this.genericize(q[r],p)}return this};j.implement=function(r,q,t){if(typeof r=="string"){return o(this,r,q,t)}for(var s in r){o(this,s,r[s],q)}return this}},genericize:function(g,h){g&&g.genericize(h)},implement:function(i,h){var g=i.length;while(g--){i[g].implement(h)}}};d.Native=a;(function(){var h={Array:Array,Boolean:Boolean,Date:Date,Function:Function,Number:Number,RegExp:RegExp,String:String,JUI:d};for(var m in h){a.initialize({name:m,initialize:h[m],protect:true})}var l={Array:["concat","indexOf","join","lastIndexOf","pop","push","reverse","shift","slice","sort","splice","toString","unshift","valueOf"],String:["charAt","charCodeAt","concat","indexOf","lastIndexOf","match","replace","search","slice","split","substr","substring","toLowerCase","toUpperCase","valueOf"]};for(var k in l){for(var j=l[k].length;j--;){a.genericize(c[k],l[k])}}})();d.name="jui";d.version="1.0.0.0";d.expando="_JUI_"+new Date,d.type=function(g){if(g==undefined){return false}if(g.$family){return(g.$family=="number"&&!isFinite(g))?false:g.$family}if(g.nodeName){switch(g.nodeType){case 1:return"element";case 3:return(/\S/).test(g.nodeValue)?"textnode":"whitespace"}}else{if(typeof g.length=="number"){if(g.callee){return"arguments"}else{if(g.item){return"collection"}}}}return typeof g};d.empty=function(){};d.noConfilict=function(){c.$=e;return this};d.extend=function(k,i){if(!i){throw"Failed! Inherit from a null object"}var g=i.prototype,j=function(){};j.prototype=g;var h=new j();k.prototype=h;h.constructor=k;k.superclass=g;if(i!=Object&&g.constructor==Object.prototype.constructor){g.constructor=i}return k};d.now=function(){return +new Date};d.getUid=(c.ActiveXObject)?function(g){return(g[d.expando]||(g[d.expando]=[b++]))[0]}:function(g){return g[d.expando]||(g[d.expando]=b++)}})();(function(b){var a=(function(){var z={},p={},m={},f={"class":"className"},d=/^(?:(?:([-]?\d*)(n{1}))?([-+]?\d*)|(odd|even))$/,y=/((?:[_a-zA-Z][\w-]*)|\*)|(?:#([\w-]+))|(?:\.([\w-]+))|(?:\[([a-z]+\w*)+([~\|\^\$\*!]?=)?['"]?([^\]]*?)["']?\])|(?::([\-\w]+)(?:\(['"]?(.+?)["']?\))*)|(?:\s*((?:[>+~\s,])|$)\s*)/g;(function(){var E=document.createElement("div"),F=(new Date()).getTime();E.innerHTML='<a name="'+F+'" class="€ b"></a>';p.qsa=!!(E.querySelectorAll&&E.querySelectorAll(".€").length)})();function D(F){var E=b.getUid(F);return(z[E])?null:(z[E]=true)}function v(E){return true}function g(E){return E.replace(/[-.*+?^${}()|[\]\/\\]/g,"\\$&")}function q(E){return{combinator:E||" ",tag:"*",id:null,classes:[],attributes:[],pseudos:[]}}function x(H){if(m[H]){return m[H]}var G=[],K=[],E,F,J,I=sli=ci=ai=pi=0;E=q();y.lastIndex=0;while(F=y.exec(H)){if(F[1]){E.tag=F[1].toUpperCase()}else{if(F[2]){E.id=F[2]}else{if(F[3]){E.classes[ci++]=F[3]}else{if(F[4]){E.attributes[ai++]={key:F[4],op:F[5],value:F[6]}}else{if(F[7]){E.pseudos[pi++]={key:F[7],value:F[8]}}else{if(F[9]){K[I++]=E;if(F[9]==","){G[sli++]=K;K=[];I=0;J=null}else{J=F[9]}E=q(J);ci=ai=pi=0}else{break}}}}}}}K[I++]=E;G[sli++]=K;return m[H]=G}var A={" ":function(F,G,I,K){var H,L,J=0,E=I.length;H=G.getElementsByTagName(F);if(K){while(L=H[J++]){L.nodeType==1&&K(L)&&(I[E++]=L)}}else{while(L=H[J++]){L.nodeType==1&&(I[E++]=L)}}return I},">":function(F,G,I){var H,K,J=0,E=I.length;H=G.getElementsByTagName(F);while(K=H[J++]){K.parentNode==G&&(I[E++]=K)}return I},"+":function(F,G,H,I){var E=H.length;while(G=G.nextSibling){if(G.nodeType==1){G.tagName==F&&I(G)&&(H[E++]=G);break}}return H},"~":function(F,G,H,I){var E=H.length;while(G=G.nextSibling){if(G.nodeType==1){if(!I(G)){break}G.tagName==F&&(H[E++]=G)}}return H}};var k={" ":function(F,E){while(F=F.parentNode){if(F==E||(E==document&&F.documentElement)){return true}}return false},">":function(F,E){return F.parentNode==E},"+":function(F,E){while(F=F.previousSibling){if(F.nodeType!=1){continue}if(F==E){return true}else{if(F.tagName==F.tagName){return false}}}return false},"~":function(F,E){while(n=n.previousSibling){if(n==E){return true}}return false}};var j={"=":function(E){return E},"~=":function(E){return new RegExp("(?:^|\\s+)"+g(E)+"(?:\\s+|$)")},"!=":function(E){return E},"^=":function(E){return new RegExp("^"+g(E))},"$=":function(E){return new RegExp(g(E)+"$")},"*=":function(E){return new RegExp(g(E))},"|=":function(E){return new RegExp("^"+g(E)+"-?")}};var s={"=":function(E,F){return E==F},"~=":function(E,F){return F.test(E)},"!=":function(E,F){return E!=F},"^=":function(E,F){return F.test(E)},"$=":function(E,F){return F.test(E)},"*=":function(E,F){return F.test(E)},"|=":function(E,F){return F.test(E)}};var r={},t={};function u(H){if(r[H]){return r[H]}var F,G,E;F=H.match(d);switch(F[4]){case"even":G=2;E=0;break;case"odd":G=2;E=1;break;default:G=parseInt(F[1],10);G=isNaN(G)?(F[2]?1:0):G;E=parseInt(F[3],10);isNaN(E)&&(E=0);break}return(r[H]={a:G,b:E})}function i(F,J,L,M){var I,G,K,E,H=1;I=b.getUid(F);G=b.getUid(F.parentNode);E=t[G]||(t[G]={});if(!E[I]){while((F=F[L])){if(F.nodeType!=1||(M&&F.tagName!=M)){continue}K=E[b.getUid(F)];if(K){H=K+H;break}H++}E[I]=H}return J.a?E[I]%J.a==J.b:J.b==E[I]}function w(H,E){var G=H;while((G=G.previousSibling)){if(G.nodeType===1&&(!E||G.tagName==E)){return false}}var F=H;while((F=F.nextSibling)){if(F.nodeType===1&&(!E||F.tagName==E)){return false}}return true}var e={root:function(E){return E===E.ownerDocument.documentElement},"nth-child":function(F,E){return(E.a==1&&!E.b)?true:i(F,E,"previousSibling",false)},"nth-last-child":function(F,E){return(E.a==1&&!E.b)?true:i(F,E,"previousSibling",false)},"nth-of-type":function(F,E){return i(F,E,"previousSibling",F.tagName)},"nth-last-of-type":function(F,E){return i(F,E,"nextSibling",F.tagName)},"first-child":function(F){var E=F.parentNode.firstChild;while(E.nodeType!=1){E=E.nextSibling}return F===E},"last-child":function(E){while((E=E.nextSibling)){if(E.nodeType===1){return false}}return true},"first-of-type":function(G){var F=G.parentNode.firstChild,E=G.tagName;while(F.nodeType!=1||F.tagName!=E){F=F.nextSibling}return G===F},"last-of-type":function(F){var E=F.tagName;while((F=F.nextSibling)){if(F.nodeType==1&&F.tagName==E){return false}}return true},"only-child":function(E){return w(E)},"only-of-type":function(E){return w(E,E.tagName)},empty:function(E){return !E.firstChild},parent:function(E){return !!E.firstChild},enabled:function(){return node.disabled===false&&node.type!=="hidden"},disabled:function(){return node.disabled===true},checked:function(E){return E.checked===true},selected:function(E){E.parentNode.selectedIndex;return E.selected===true},visible:function(E){return E.offsetWidth>0||E.offsetHeight>0},hidden:function(E){return E.offsetWidth===0||E.offsetHeight===0},not:function(E,F){return !c(E,F)},contains:function(F,E){return E.test(F.innerText||F.textContent||"")},odd:function(E){return},even:function(E){return}};e.nth=e["nth-child"];e.index=e["nth-child"];var B={t:function(E){return x(E)},n:function(E){return new RegExp(g(E))},h:function(E){return u(E)}};var o={klass:function(E,F){var K,H=0,G=[],I=0,J;J=new RegExp("(?:^|\\s+)"+g(F)+"(?:\\s+|$)");while(K=E[H++]){J.test(K.className)&&(G[I++]=K)}return G},attribute:function(F,J){var G,H=0,I=[],E=0,L,M=f[J.key]||J.key,K=/^(?:src|href|action)$/.test(M)?2:0;if(J.op){L=j[J.op](J.value);while(G=F[H++]){s[J.op](G[M]||G.getAttribute(M,K),L)&&(I[E++]=G)}}else{while(G=F[H++]){((G[M]||G.getAttribute(M,K))!=null)&&(I[E++]=G)}}return I},pseudo:function(F,G){var E=G.value,J=G.key,L,I=0,H=[],K=0;E&&(E=B[J.charAt(2)](E));while(L=F[I++]){e[J](L,E)&&(H[K++]=L)}return H}};function C(I,K){var M=[],N,L=0,P,R=D,F=I.combinator,E=I.id,Q=I.tag,H=I.classes,J=I.attributes,O=I.pseudos;if(E){var G=document.getElementById(E);if(Q=="*"||G.tagName==Q){while(cxt=K[L++]){if(k[F](G,cxt)){M=[G];break}}}}else{if(Q){L=0;z={};if(K.length==1){R=false}while(cxt=K[L++]){M=A[F](Q,cxt,M,R)}}}if(H.length>(L=0)){while(P=H[L++]){M=o.klass(M,P)}}if(J.length>(L=0)){while(P=J[L++]){M=o.attribute(M,P)}}if(O.length>(L=0)){while(P=O[L++]){M=o.pseudo(M,P)}}return M}function l(G,H){var F=0,E;z={};t={};while(E=G[F++]){H=C(E,H)}return H}function h(E,J){var H=[],G=0,I,F=x(E);while(I=F[G++]){if(H.length>0){H=l(I,J).concat(H)}else{H=l(I,J)}}return H}function c(J,F){var H=0,I,G,K,E;F=F[0][0];if(F.id&&F.id!=J.id){return false}if(F.classes.length>(H=0)){while(I=F.classes[H++]){if(!(new RegExp("(?:^|\\s+)"+g(I)+"(?:\\s+|$)")).test(J.className)){return false}}}if(F.attributes.length>(H=0)){while(I=F.attributes[H++]){G=f[I.key];E=/^(?:src|href|action)$/.test(G)?2:0;G=J[G]||J.getAttribute(G,E);if(I.op){if(!s[I.op](G,j[I.op](I.value))){return false}}else{if(G==null){return false}}}}if(F.pseudos.length>(H=0)){while(I=F.pseudos[H++]){(K=I.value)&&(K=B[I.key.charAt(2)](K));if(!e[I.key](J,K)){return false}}}return true}return function(E,F){if(!E||typeof E!=="string"){return[]}F=F||document;if(F.nodeType!==1&&F.nodeType!==9){return[]}if(p.qsa){try{return F.querySelectorAll(E)}catch(G){return h(E,[F])}}else{return h(E,[F])}}})();b.Selector=a})(JUI);(function(e){var k={};(function(){var o=document.createElement("div"),q="_jui_"+(new Date()).getTime(),m;o.innerHTML='   <link/><table></table><a name="'+q+'" class="€ b" href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select>';k={opacity:(typeof o.style.opacity)!=="undefined"?true:false,innerText:(typeof o.innerText)!==undefined?true:false,leadingWhitespace:o.firstChild&&o.firstChild.nodeType==3,cssFloat:!(o.style.cssFloat===undefined),cloneEvent:false,tbody:false,htmlSerialize:false};if(o.getElementsByTagName){k.tbody=!!o.getElementsByTagName("tbody").length;k.htmlSerialize=!!o.getElementsByTagName("link").length}if(o.attachEvent&&o.fireEvent){o.attachEvent("onclick",function p(){k.cloneEvent=true;o.detachEvent("onclick",p)});o.cloneNode(true).fireEvent("onclick")}})();function i(m){return m.replace(/-\D/g,function(o){return o.charAt(1).toUpperCase()})}function d(m){return m.replace(/[A-Z]/g,function(o){return("-"+o.charAt(0).toLowerCase())})}var f={"class":"className","for":"htmlFor","float":k.cssFloat?"cssFloat":"styleFloat"},j={left:"@px",top:"@px",bottom:"@px",right:"@px",width:"@px",height:"@px",maxWidth:"@px",maxHeight:"@px",minWidth:"@px",minHeight:"@px",backgroundColor:"rgb(@, @, @)",backgroundPosition:"@px @px",color:"rgb(@, @, @)",fontSize:"@px",letterSpacing:"@px",lineHeight:"@px",clip:"rect(@px @px @px @px)",margin:"@px @px @px @px",padding:"@px @px @px @px",border:"@px @ rgb(@, @, @) @px @ rgb(@, @, @) @px @ rgb(@, @, @)",borderWidth:"@px @px @px @px",borderStyle:"@ @ @ @",borderColor:"rgb(@, @, @) rgb(@, @, @) rgb(@, @, @) rgb(@, @, @)",zIndex:"@",zoom:"@",fontWeight:"@",textIndent:"@px",opacity:"@"},h={margin:{},padding:{},border:{},borderWidth:{},borderStyle:{},borderColor:{}};(function(){var A=["Top","Right","Bottom","Left"],r="margin",o="padding",z="border",t=A.length,w;while(w=A[--t]){var y=r+w,x=o+w,v=z+w;h[r][y]=j[y]="@px";h[o][x]=j[x]="@px";h[z][v]=j[v]="@px @ rgb(@, @, @)";var s=v+"Width",u=v+"Style",q=v+"Color";h[v]={};h.borderWidth[s]=h[v][s]=j[s]="@px";h.borderStyle[u]=h[v][u]=j[u]="@";h.borderColor[q]=h[v][q]=j[q]="rgb(@, @, @)"}})();var b={compact:true,nowrap:true,ismap:true,declare:true,noshade:true,checked:true,disabled:true,readonly:true,multiple:true,selected:true,noresize:true,defer:true};var c=function(m,r){if(r!==false){var q=l(document.createElement(m));if(r&&r.style){q.css(r.style);delete r.style}q.attr(r);return q}if(e.type(m)!=="string"){return l(m)}var q,o,p=/^#([\w-]+)$/;if(p.test(m)||!e.Selector){return l(document.getElementById(m.replace("#","")))}else{o=e.Selector(m);return new a(o,false)}};var a=function(o){if(o&&o.$family!=="elements"){var m=0,s=[];while((s[m]=l(o[m++]))){}s.length--;var q=a.prototype;for(var r in q){s[r]=q[r]}o=s}return o};function l(m){if(m&&!m.$family&&!(/^object|embed$/i).test(m.tagName)){var o=c.prototype;for(var q in o){m[q]=o[q]}}return m}e.Native.initialize({name:"Element",initialize:c,protect:true,afterImplement:function(m,o){if(Array[m]){return}a.implement(m,function(){var p=[],t=true;for(var r=0,q=this.length;r<q;r++){var s=this[r][m].apply(this[r],arguments);p.push(s);if(t){t=(e.type(s)=="element")}}return(t)?new a(p,false):p})}});e.Native.initialize({name:"Elements",initialize:a,protect:true});function g(t){var u=/^<(\w+)\s*\/?>$/.exec(t);if(u){return document.createElement(u[1])}var v=[],q=[],m=document.createElement("div");t=t.replace(/(<(\w+)[^>]*?)\/>/g,function(y,z,x){return x.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?y:z+"></"+x+">"});var w=t.replace(/^\s+/,"").substring(0,10).toLowerCase();var p=!w.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!w.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||w.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!w.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!w.indexOf("<td")||!w.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!w.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!k.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];m.innerHTML=p[1]+t+p[2];while(p[0]--){m=m.lastChild}if(k.tbody){var o=/<tbody/i.test(t),s=!w.indexOf("<table")&&!o?m.firstChild&&m.firstChild.childNodes:p[1]=="<table>"&&!o?m.childNodes:[];for(var r=s.length-1;r>=0;--r){if((s[r].tagName=="TBODY")&&!s[r].childNodes.length){s[r].parentNode.removeChild(s[r])}}}if(!k.leadingWhitespace&&/^\s/.test(t)){m.insertBefore(document.createTextNode(t.match(/^\s*/)[0]),m.firstChild)}return m.firstChild}c.implement({setStyle:function(r,s){if(r=="opacity"){s=parseFloat(s);if(k.opacity){this.style.opacity=s}else{this.style.filter=(this.style.filter||"").replace(/alpha\([^)]*\)/,"")+(s+""=="NaN"?"":"alpha(opacity="+s*100+")");this.zoom=1}if(opacity==0){if(this.style.visibility!="hidden"){this.style.visibility="hidden"}}else{if(this.style.visibility!="visible"){this.style.visibility="visible"}}return}r=f[r]||i(r);var q=e.type(s);if(q!="string"){s=(q!="array"&&q!="arguments")?[s]:s;var m=(j[r]||"@").split(" "),p=m.length,o;while(p--){o=s[p];if(!(o===0||o)){m[p]=""}else{m[p]=e.type(o)=="number"?m[p].replace("@",Math.round(o)):o}}s=m.join(" ")}else{if(s==""+Number(s)){s=Math.round(s)}}try{this.style[r]=s}catch(t){}return this},getStyle:function(q){if(q=="opacity"){if(k.opacity){return this.style.opacity}else{return this.style.filter&&this.style.filter.indexOf("opacity=")>=0?(parseFloat(this.style.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}}q=f[q]||i(q);var m=this.style[q];if(!(m===0||m)){m=[];for(var o in h){if(q!=o){continue}for(var p in h[o]){m.push(this.getStyle(p))}return m.join(" ")}if(this.currentStyle){return this.currentStyle[q]}var r=this.getDocument().defaultView.getComputedStyle(this,null);return(r)?r.getPropertyValue([d(q)]):null}return m},css:function(m,o){if(e.type(m)=="object"){for(var q in m){this.setStyle(q,m[q])}return this}if(o===undefined){return this.getStyle(m)}else{this.setStyle(m,o);return this}},getProperty:function(m){var o=f[m];var p=(o)?this[o]:this.getAttribute(m,2);return(b[m])?!!p:(o)?p:p||null},setProperty:function(m,p){var o=f[m];if(o&&b[m]){p=!!p}o?this[o]=p:this.setAttribute(m,""+p);return this},attr:function(m,p){if(e.type(m)=="object"){for(var o in m){this.setProperty(o,m[o])}return this}if(p===undefined){return this.getProperty(m)}else{this.setProperty(m,p);return this}},dimension:function(m){if(!(m===0||m)){return{width:this.offsetWidth,height:this.offsetHeight}}if(m.width!==undefined){this.css("width",m.width)}if(m.height!==undefined){this.css("height",m.height)}return this},position:function(r){if(r===undefined){if(this.parentNode===null||this.style.display=="none"){return false}if(this.getBoundingClientRect){box=this.getBoundingClientRect();var o=Math.max(document.documentElement.scrollTop,document.body.scrollTop);var p=Math.max(document.documentElement.scrollLeft,document.body.scrollLeft);return{x:box.left+p,y:box.top+o}}else{if(document.getBoxObjectFor){box=document.getBoxObjectFor(this);var m=(this.style.borderLeftWidth)?parseInt(this.style.borderLeftWidth):0;var q=(this.style.borderTopWidth)?parseInt(this.style.borderTopWidth):0;r=[box.x-m,box.y-q]}else{r=[this.offsetLeft,this.offsetTop];parent=this.offsetParent;if(parent!=this){while(parent){r[0]+=parent.offsetLeft;r[1]+=parent.offsetTop;parent=parent.offsetParent}}if(this.style.position=="absolute"){r[0]-=document.body.offsetLeft;r[1]-=document.body.offsetTop}}}if(this.parentNode){parent=this.parentNode}else{parent=null}while(parent&&parent.tagName!="BODY"&&parent.tagName!="HTML"){r[0]-=parent.scrollLeft;r[1]-=parent.scrollTop;if(parent.parentNode){parent=parent.parentNode}else{parent=null}}return{x:r[0],y:r[1]}}if(r.x!==undefined){this.css("left",r.x)}if(r.y!==undefined){this.css("top",r.y)}return this}});c.implement({getDocument:function(){return this.ownerDocument},getElement:function(m){var o=[];if(e.Selector){o=e.Selector(m,this)}else{o=this.getElementsByTagName(m)}return o[0]?new c(o[0],false):null},getElements:function(m){if(e.Selector){return new a(e.Selector(m,this),false)}else{return new a(this.getElementsByTagName(m),false)}}});c.implement({txt:function(m){if(m===undefined){return this[k.innerText?"innerText":"textContent"]}else{this.html(m.escapeHTML());return m}},html:function(m){if(m!==undefined){this.innerHTML=m}return this.innerHTML},clone:function(o){o=o!==false;if(k.cloneEvent){var m=this.outerHTML;if(!m){var p=this.ownerDocument.createElement("div");p.appendChild(this.cloneNode(o));m=p.innerHTML}return new c(g(m.replace(new RegExp(e.expando+'="(?:\d+|null)"',"g"),"").replace(/^\s*/,"")),false)}else{return new c(this.cloneNode(o),false)}},prependTo:function(m){m.insertBefore(this,m.firstChild);return this},appendTo:function(m){m.appendChild(this);return this},inject:function(m,o){if(o=="top"){this.prependTo(m)}else{this.appendTo(m)}return this},insert:function(m,o){if(o=="after"){this.after(m)}else{this.before(m)}return this},before:function(m){m.parentNode.insertBefore(this,m);return this},after:function(m){var o=m.parentNode;if(m.nextSibling){o.insertBefore(this,m.nextSibling)}else{o.appendChild(this)}return this},dispose:function(){return(this.parentNode)?this.parentNode.removeChild(this):this},empty:function(){var p,o=this.childNodes,m=0;while(p=o[m++]){p.destroy()}return this},destroy:function(){this.empty();this.dispose();this.removeEvents();return null}});c.alias({dispose:"remove"});e.Element=c;e.Elements=a})(JUI);(function(c){var d=[],a={};c.Element&&d.push(c.Element);c.Window&&d.push(c.Window);function b(e,g){var f=e.length;while(f){if(e[f--]==g){return true}}return false}c.Native.implement(d,{data:function(e,g){var f=c.getUid(this);if(e&&!a[f]){a[f]={}}if(g!==undefined){a[f][e]=g;return g}return e?a[f][e]:f},erase:function(e){var f=c.getUid(this);if(e){if(a[f]){delete a[f][e];e="";for(e in a[f]){break}(!e)&&this.erase()}}else{delete a[f]}return this}});c.Native.implement(d,{addEvent:function(i,h,k,j){var f=this.data("events")||this.data("events",{});k=k?k:this;f[i]=f[i]||{keys:[],values:[]};if(!j&&b(f[i].keys,h)){return this}var g=function(l){if(c.Event){l=new c.Event(l)}h.call(k,l)};if(i=="unload"){var e=g;g=function(){self.removeListener("unload",g);e()}}if(this.addEventListener){this.addEventListener(i,g,false)}else{this.attachEvent("on"+i,g)}f[i].keys.push(h);f[i].values.push(g);return this},removeEvent:function(k,j){var h=this.data("events");if(!h||!h[k]){return this}if(!j){var g=0,e=h[k].keys;while(j=e[g++]){this.removeEvent(k,j)}delete h[k];k="";for(k in h){break}if(!k){this.erase()}else{this.data("events",h)}return this}var m=-1,g=0,l;while(l=h[k].keys[g]){if(l==j){m=g;break}g++}if(m==-1){return this}h[k].keys.splice(m,1);j=h[k].values.splice(m,1)[0];if(this.removeEventListener){this.removeEventListener(k,j,false)}else{this.detachEvent("on"+k,j)}return this},addEvents:function(e){for(var f in e){this.addEvent(f,e[f])}return this},removeEvents:function(e){if(c.type(e)=="object"){for(var g in e){this.removeEvent(g,e[g])}return this}var f=this.data("events");if(!f){return this}if(!e){for(var g in f){this.removeEvent(g)}this.erase("events")}else{this.removeEvent(e)}return this},fireEvent:function(j,h,f){var o=this.data("events");if(!o||!o[j]){return this}var e=0,l=o[j],k,g,m=this;while(k=l[e++]){g=function(i){return function(){i.apply(m,h)}};setTimeout(g(k),f)}return this}})})(JUI);(function(c){var b={"8":"backspace","9":"tab","13":"enter","27":"esc","32":"space","38":"up","40":"down","37":"left","39":"right","46":"delete"};var a=function(d){if(d.$family==="event"){return d}var o=document,i=window,m=d.type;var j=d.target||d.srcElement;while(j&&j.nodeType==3){j=j.parentNode}if(/key/.test(m)){var e=d.which||d.keyCode;var p=b[e];if(m=="keydown"){var g=e-111;if(g>0&&g<13){p="f"+g}}p=p||String.fromCharCode(e).toLowerCase()}else{if(m.match(/(click|mouse|menu)/i)){o=(!o.compatMode||o.compatMode=="CSS1Compat")?o.documentElement:o.body;var l={x:d.pageX||d.clientX+o.scrollLeft,y:d.pageY||d.clientY+o.scrollTop};var f={x:(d.pageX)?d.pageX-i.pageXOffset:d.clientX,y:(d.pageY)?d.pageY-i.pageYOffset:d.clientY};if(m.match(/DOMMouseScroll|mousewheel/)){var k=(d.wheelDelta)?d.wheelDelta/120:-(d.detail||0)/3}var h=(d.which==3)||(d.button==2)}}return(function(r,q){for(var s in q){r[s]=q[s]}return r})(this,{event:d,type:m,page:l,client:f,rightClick:h,wheel:k,target:j,code:e,key:p,shift:d.shiftKey,control:d.ctrlKey,alt:d.altKey,meta:d.metaKey})};c.Native.initialize({name:"Event",initialize:a,protect:true});a.implement({stop:function(){return this.stopPropagation().preventDefault()},stopPropagation:function(){if(this.event.stopPropagation){this.event.stopPropagation()}else{this.event.cancelBubble=true}return this},preventDefault:function(){if(this.event.preventDefault){this.event.preventDefault()}else{this.event.returnValue=false}return this}});c.Event=a})(JUI);(function(b){var a=function(c){this.events=[];this.name=c};b.Native.initialize({name:"CustomEvent",initialize:a,protect:true});a.implement({fire:function(){var d=[];for(var e=0;e<arguments.length;e++){d.push(arguments[e])}for(var e=0,c=this.events.length;e<c;e++){var f=this.events[e];f[0].call(f[1],this.name,d)}},subscribe:function(d,c){this.events.push([d,c])},clear:function(){this.events=[]}});b.CustomEvent=a})(JUI);(function(d){var a={encode:false,decode:false,path:false,domain:false,duration:false,secure:false,document:document};function c(e){for(var f in e){a[f]=e[f]}}var b={write:function(g,h,f){c(f);if(a.encode){h=encodeURIComponent(h)}if(a.domain){h+="; domain="+a.domain}if(a.path){h+="; path="+a.path}if(a.duration){var e=new Date();e.setTime(e.getTime()+a.duration*24*3600000);h+="; expires="+e.toGMTString()}if(a.secure){h+="; secure"}a.document.cookie=g+"="+h;return this},read:function(f,e){var g=a.document.cookie.match("(?:^|;)\\s*"+f.replace(/([-.*+?^${}()|[\]\/\\])/g,"\\$1")+"=([^;]*)");if(a.decode){return(g)?decodeURIComponent(g[1]):null}else{return(g)?g[1]:null}},remove:function(f,e){c(e);a.duration=-1;b.write(f,"");return this}};d.Cookie=b})(JUI);(function(e){var g={},a,c=1,b="jui_cb_";var f=function(h){a=h;return this};e.Native.initialize({name:"Loader",initialize:f,protect:true});function d(r){r=r||a||{};var h,j,p="js",q=e.empty,k,o,i;h=r.url;p=r.type;j=r.charset;q=r.callback;o=r.bind;k=r.param;i=r.cache;if(!h||h==""){return}try{if(k&&q){e.Loader[b+c]=function(){q.apply(o,arguments)};if(h.indexOf("?")>-1){h=h+"&cb=JUI.Loader."+b+c}else{h=h+"?cb=JUI.Loader."+b+c}if(!i){h=h+"&r="+Math.random()}c++}var l;if(p=="css"){l=document.createElement("link");l.rel="stylesheet";l.type="text/css";l.href=h}else{l=document.createElement("script");l.src=h;l.type="text/javascript"}j&&(l.charset=j);if(!k&&q){l.onload=function(){q.apply(o,[h,true])};l.onerror=function(){q.apply(o,[h,false])};l.onreadystatechange=function(){if(l.readyState=="loaded"){q.apply(o,[h,true])}}}g[h]=l;document.getElementsByTagName("head")[0].appendChild(l)}catch(m){q(h,false)}}f.implement({load:function(k){if(!k){k=[a]}else{if(e.type(k)!="array"){k=Array.prototype.slice.call(arguments,0)}}var h=0,j;while(j=k[h++]){d(j)}return this},chain:function(j){if(e.type(j)!="array"){j=Array.prototype.slice.call(arguments,0)}if(!j||j.length==0){return}var i=j.shift(),h=this;cb=function(k,m){m.callback(m.url);h.chain(k)};this.load({url:i.url,type:i.type,callback:cb(j,i)})},cancel:function(h){if(!g[h]){return}document.removeChild(g[h]);delete g[h]}});e.Loader=f})(JUI);(function(d){var c="pplive.com";if(document.domain.toLowerCase().indexOf("pptv.com")!=-1){c="pptv.com"}var e={login:"http://passport.pptv.com/weblogin.do?",addFavor:"http://bk.pptv.com/xihttp/ikan2/favor/json/post/?",favorCheck:"http://bk.pptv.com/xihttp/ikan2/favor/json/check/?",like:"http://bk.pptv.com/xihttp/ikan2/score/json/post/?",likeCheck:"http://bk.pptv.com/xihttp/ikan2/score/json/check/?"};var f=false,b=true;var a={onLogined:new d.CustomEvent("onLogined"),onlogouted:new d.CustomEvent("onlogouted"),userInfo:{Gender:"",PpNum:"",ExpNum:"",LevelName:"",NextLevelName:"",NextLevelExpNum:"",Area:"",Subscribe:"",UnreadNotes:"",HeadPic:"",Email:"",OnlineTime:"",UserName:""},tryReadUserInfo:function(){var l=d.Cookie.read("UDI");var j=d.Cookie.read("PPName");if(l==null||j==null){this.onlogouted.fire();return}var h=j.split("$");this.userInfo.UserName=decodeURIComponent(h[0]);var i=l.split("$");var g=0;for(var k in this.userInfo){if(k=="UserName"){break}this.userInfo[k]=decodeURIComponent(i[g]);g++}f=true;this.onLogined.fire(this.userInfo)},wirteUserInfo:function(i){var g={domain:c,path:"/",duration:7};for(var h in i){d.Cookie.write(h,i[h],g)}},logout:function(){var g={domain:c,path:"/"};d.Cookie.remove("PPKey",g);d.Cookie.remove("UDI",g);d.Cookie.remove("PPName",g);f=false;this.onlogouted.fire()},login:function(i,j){var g=this;var h=e.login+"username="+i+"&password="+j;new d.Loader({url:h,type:"js",callback:function(k,l){g.loginFnc(k,l)},param:true}).load()},loginFnc:function(g,h){if(g==0){alert(h);return}if(g==1){this.usernameel.value="";this.userpwdel.value="";this.hideLoginBox();this.wirteUserInfo(h)}this.tryReadUserInfo()},checkLogined:function(){return f},showLoginBox:function(h){if(b){b=false;this.boxel=d("#loginBox");this.btnpostel=this.boxel.getElement(".btnPost");this.usernameel=this.boxel.getElement(".userName");this.userpwdel=this.boxel.getElement(".userPwd");this.usernameel.value="";this.userpwdel.value="";d(document).addEvent("click",function(j){if(j.target.getAttribute("stopdocumentclick")==null){this.hideLoginBox()}},this);this.boxel.addEvent("click",function(j){if(j.target.tagName!="A"){j.stop()}});this.btnpostel.addEvent("click",function(j){this.checkLoginForm()},this);this.usernameel.addEvent("keydown",function(j){if(j.key=="enter"){this.checkLoginForm()}},this);this.userpwdel.addEvent("keydown",function(j){if(j.key=="enter"){this.checkLoginForm()}},this)}this.boxel.css({display:"block"});var g=0;var i=0;g=h.x;i=h.y;this.boxel.css({top:i,left:g});this.usernameel.focus()},hideLoginBox:function(){this.boxel.css("display","none")},checkLoginForm:function(){if(this.usernameel.value.length==0){this.usernameel.focus();return}if(this.userpwdel.value.length==0){this.userpwdel.focus();return}this.login(this.usernameel.value,this.userpwdel.value)},favor:function(j,i,k,g){var h=(j=="add"?e.addFavor:e.favorCheck)+"type="+i+"&id="+k;new d.Loader({url:h,type:"js",callback:function(l){g(l)},param:true}).load()},like:function(k,i,l,j,g){var h=(k=="add"?e.like:e.likeCheck)+"type="+i+"&id="+l+"&attitude="+j;new d.Loader({url:h,type:"js",callback:function(m){g(m)},param:true}).load()}};if(typeof d.IKan=="undefined"){d.IKan={}}d.IKan.User2=a})(JUI);(function(c){var b="pplive.com";if(document.domain!=""){b=document.domain.indexOf("pptv.com")!=-1?"pptv.com":b}var a=function(f,e,d){this.inputel=f;this.btnel=e;this.ops={defaultText:"-- 请输入关键字 --",defaultTextColor:"#999999",textColor:"#000000",tipBoxWidth:"182px",strLength:26,searchSuggestUrl:"http://ikan."+b+"/search/suggest/?kw=",searchUrl:"http://ikan."+b+"/search/?kw="};this.mergeOptions(d);this.init()};c.Native.initialize({name:"SearchTips",initialize:a,protect:true});a.implement({mergeOptions:function(d){for(var e in d){this.ops[e]=d[e]}},truncate:function(e,d,h){var f=0,k=[],j=e.length;for(var g=0;g<j;g++){if(e.charCodeAt(g)>255){f+=2}else{f++}if(f>d){break}}return(h&&g<j)?e.substring(0,g)+"...":e.substring(0,g)},getText:function(){return this.inputel.value.replace(/(^\s+)|(\s+$)/gm,"")},setDefaultState:function(){this.inputel.value=this.ops.defaultText;this.inputel.css("color",this.ops.defaultTextColor)},setNormalState:function(d){this.inputel.value=d?d:"";this.inputel.css("color",this.ops.textColor)},init:function(){this.tipsLis=[];this.selectedIx=-1;this.prevText="";this.gotourl="";this.setDefaultState();this.tipboxel=document.createElement("ul");this.tipboxel.className="sm_search_tips";this.tipboxel.style.overflow="hidden";this.tipboxel.style.position="absolute";this.tipboxel.style.zIndex=1000;this.tipboxel.style.width=this.ops.tipBoxWidth;this.tipboxel.style.display="none";document.documentElement.getElementsByTagName("body")[0].appendChild(this.tipboxel);this.inputel.addEvent("focus",this.input_focus,this);this.inputel.addEvent("blur",this.input_blur,this);this.inputel.addEvent("keydown",this.input_key_down,this);this.inputel.addEvent("keyup",this.input_key_up,this);this.btnel.addEvent("click",this.btn_click,this);c(document).addEvent("click",function(){this.hideTipBox()},this)},fillList:function(h){this.tipsLis=[];this.selectedIx=-1;this.prevText=this.getText();if(h.length==0){this.hideTipBox();return}var g=[];for(var f=0,e=h.length;f<e;f++){g.push(['<li><a href="',h[f].link,'">',this.truncate(h[f].name,this.ops.strLength),"</a></li>"].join(""))}this.tipboxel.innerHTML=g.join("");this.tipsLis=this.tipboxel.getElementsByTagName("li");this.showTipBox()},setSelectedItem:function(d){if(this.tipsLis.length==0){return}if(this.selectedIx==-1){this.selectedIx=0}else{this.tipsLis[this.selectedIx].className="";this.selectedIx+=d}if(this.selectedIx<0){this.selectedIx=this.tipsLis.length-1}if(this.selectedIx>=this.tipsLis.length){this.selectedIx=0}this.tipsLis[this.selectedIx].className="current";this.gotourl=this.tipsLis[this.selectedIx].getElementsByTagName("a")[0].href;this.inputel.value=this.tipsLis[this.selectedIx].getElementsByTagName("a")[0].innerHTML},showTipBox:function(){this.gotourl="";var d=this.inputel.position();this.tipboxel.style.top=d.y+24+"px";this.tipboxel.style.left=d.x+"px";this.tipboxel.style.display="block"},hideTipBox:function(){this.gotourl="";this.tipboxel.style.display="none"},getSuggestList:function(){var d=this;var e=new c.Loader({url:this.ops.searchSuggestUrl+encodeURIComponent(this.getText()),type:"js",callback:function(f){d.fillList.call(d,f)},param:true});e.load()},input_key_up:function(e){if(e.key=="up"||e.key=="down"){return}if(this.getText()==""){this.hideTipBox()}if(this.getText()!=""&&this.getText()!=this.ops.defaultTex&&this.prevText!=this.getText()){var d=this;clearTimeout(this.tid);this.tid=setTimeout(function(){d.getSuggestList()},400)}},input_focus:function(){if(this.getText()==this.ops.defaultText){this.setNormalState()}},input_blur:function(){if(this.getText()==""){this.setDefaultState()}},btn_click:function(){if(this.getText()!=""&&this.getText()!=this.ops.defaultText){window.location.href=this.ops.searchUrl+encodeURIComponent(this.getText())}},input_key_down:function(d){switch(d.key){case"enter":d.stop();if(this.gotourl!=""){window.location.href=this.gotourl}else{this.btn_click()}break;case"up":d.stop();this.setSelectedItem(-1);break;case"down":d.stop();this.setSelectedItem(1);break}}});if(typeof c.IKan=="undefined"){c.IKan={}}c.IKan.SearchTips=a})(JUI);