if(typeof YAHOO=="undefined"||!YAHOO)var YAHOO={};YAHOO.namespace=function(){var a=arguments,h=null,i,j,f;for(i=0;i<a.length;i+=1){f=(""+a[i]).split(".");h=YAHOO;for(j=f[0]=="YAHOO"?1:0;j<f.length;j+=1){h[f[j]]=h[f[j]]||{};h=h[f[j]]}}return h};YAHOO.log=function(a,h,i){var j=YAHOO.widget.Logger;return j&&j.log?j.log(a,h,i):false};
YAHOO.register=function(a,h,i){var j=YAHOO.env.modules,f,m,n;j[a]||(j[a]={versions:[],builds:[]});j=j[a];f=i.version;i=i.build;m=YAHOO.env.listeners;j.name=a;j.version=f;j.build=i;j.versions.push(f);j.builds.push(i);j.mainClass=h;for(n=0;n<m.length;n+=1)m[n](j);if(h){h.VERSION=f;h.BUILD=i}else YAHOO.log("mainClass is undefined for module "+a,"warn")};YAHOO.env=YAHOO.env||{modules:[],listeners:[]};YAHOO.env.getVersion=function(a){return YAHOO.env.modules[a]||null};
YAHOO.env.ua=function(){var a={ie:0,opera:0,gecko:0,webkit:0,mobile:null,air:0,caja:0},h=navigator.userAgent,i;if(/KHTML/.test(h))a.webkit=1;if((i=h.match(/AppleWebKit\/([^\s]*)/))&&i[1]){a.webkit=parseFloat(i[1]);if(/ Mobile\//.test(h))a.mobile="Apple";else if(i=h.match(/NokiaN[^\/]*/))a.mobile=i[0];if(i=h.match(/AdobeAIR\/([^\s]*)/))a.air=i[0]}if(!a.webkit)if((i=h.match(/Opera[\s\/]([^\s]*)/))&&i[1]){a.opera=parseFloat(i[1]);if(i=h.match(/Opera Mini[^;]*/))a.mobile=i[0]}else if((i=h.match(/MSIE\s([^;]*)/))&&
i[1])a.ie=parseFloat(i[1]);else if(i=h.match(/Gecko\/([^\s]*)/)){a.gecko=1;if((i=h.match(/rv:([^\s\)]*)/))&&i[1])a.gecko=parseFloat(i[1])}if((i=h.match(/Caja\/([^\s]*)/))&&i[1])a.caja=parseFloat(i[1]);return a}();(function(){YAHOO.namespace("util","widget","example");if("undefined"!==typeof YAHOO_config){var a=YAHOO_config.listener,h=YAHOO.env.listeners,i=true,j;if(a){for(j=0;j<h.length;j+=1)if(h[j]==a){i=false;break}i&&h.push(a)}}})();YAHOO.lang=YAHOO.lang||{};
(function(){var a=YAHOO.lang,h=Object.prototype,i=["toString","valueOf"],j={isArray:function(f){return h.toString.apply(f)==="[object Array]"},isBoolean:function(f){return typeof f==="boolean"},isFunction:function(f){return h.toString.apply(f)==="[object Function]"},isNull:function(f){return f===null},isNumber:function(f){return typeof f==="number"&&isFinite(f)},isObject:function(f){return f&&(typeof f==="object"||a.isFunction(f))||false},isString:function(f){return typeof f==="string"},isUndefined:function(f){return typeof f===
"undefined"},_IEEnumFix:YAHOO.env.ua.ie?function(f,m){var n,p,d;for(n=0;n<i.length;n+=1){p=i[n];d=m[p];if(a.isFunction(d)&&d!=h[p])f[p]=d}}:function(){},extend:function(f,m,n){function p(){}if(!m||!f)throw new Error("extend failed, please check that all dependencies are included.");var d;p.prototype=m.prototype;f.prototype=new p;f.prototype.constructor=f;f.superclass=m.prototype;if(m.prototype.constructor==h.constructor)m.prototype.constructor=m;if(n){for(d in n)if(a.hasOwnProperty(n,d))f.prototype[d]=
n[d];a._IEEnumFix(f.prototype,n)}},augmentObject:function(f,m){if(!m||!f)throw new Error("Absorb failed, verify dependencies.");var n=arguments,p,d=n[2];if(d&&d!==true)for(p=2;p<n.length;p+=1)f[n[p]]=m[n[p]];else{for(p in m)if(d||!(p in f))f[p]=m[p];a._IEEnumFix(f,m)}},augmentProto:function(f,m){if(!m||!f)throw new Error("Augment failed, verify dependencies.");var n=[f.prototype,m.prototype],p;for(p=2;p<arguments.length;p+=1)n.push(arguments[p]);a.augmentObject.apply(this,n)},dump:function(f,m){var n,
p,d=[];p="f(){...}";if(a.isObject(f))if(f instanceof Date||"nodeType"in f&&"tagName"in f)return f;else{if(a.isFunction(f))return p}else return f+"";m=a.isNumber(m)?m:3;if(a.isArray(f)){d.push("[");n=0;for(p=f.length;n<p;n+=1){a.isObject(f[n])?d.push(m>0?a.dump(f[n],m-1):"{...}"):d.push(f[n]);d.push(", ")}d.length>1&&d.pop();d.push("]")}else{d.push("{");for(n in f)if(a.hasOwnProperty(f,n)){d.push(n+" => ");a.isObject(f[n])?d.push(m>0?a.dump(f[n],m-1):"{...}"):d.push(f[n]);d.push(", ")}d.length>1&&
d.pop();d.push("}")}return d.join("")},substitute:function(f,m,n){for(var p,d,k,r,v,e=[],l;;){p=f.lastIndexOf("{");if(p<0)break;d=f.indexOf("}",p);if(p+1>=d)break;r=l=f.substring(p+1,d);v=null;k=r.indexOf(" ");if(k>-1){v=r.substring(k+1);r=r.substring(0,k)}k=m[r];if(n)k=n(r,k,v);if(a.isObject(k))if(a.isArray(k))k=a.dump(k,parseInt(v,10));else{v=v||"";r=v.indexOf("dump");if(r>-1)v=v.substring(4);k=k.toString===h.toString||r>-1?a.dump(k,parseInt(v,10)):k.toString()}else if(!a.isString(k)&&!a.isNumber(k)){k=
"~-"+e.length+"-~";e[e.length]=l}f=f.substring(0,p)+k+f.substring(d+1)}for(p=e.length-1;p>=0;p-=1)f=f.replace(new RegExp("~-"+p+"-~"),"{"+e[p]+"}","g");return f},trim:function(f){try{return f.replace(/^\s+|\s+$/g,"")}catch(m){return f}},merge:function(){var f={},m=arguments,n=m.length,p;for(p=0;p<n;p+=1)a.augmentObject(f,m[p],true);return f},later:function(f,m,n,p,d){f=f||0;m=m||{};var k=n,r=p,v;if(a.isString(n))k=m[n];if(!k)throw new TypeError("method undefined");a.isArray(r)||(r=[p]);n=function(){k.apply(m,
r)};v=d?setInterval(n,f):setTimeout(n,f);return{interval:d,cancel:function(){this.interval?clearInterval(v):clearTimeout(v)}}},isValue:function(f){return a.isObject(f)||a.isString(f)||a.isNumber(f)||a.isBoolean(f)}};a.hasOwnProperty=h.hasOwnProperty?function(f,m){return f&&f.hasOwnProperty(m)}:function(f,m){return!a.isUndefined(f[m])&&f.constructor.prototype[m]!==f[m]};j.augmentObject(a,j,true);YAHOO.util.Lang=a;a.augment=a.augmentProto;YAHOO.augment=a.augmentProto;YAHOO.extend=a.extend})();
YAHOO.register("yahoo",YAHOO,{version:"2.7.0",build:"1796"});
(function(){YAHOO.env._id_counter=YAHOO.env._id_counter||0;var a=YAHOO.util,h=YAHOO.lang,i=YAHOO.env.ua,j=YAHOO.lang.trim,f={},m={},n=/^t(?:able|d|h)$/i,p=/color$/i,d=window.document,k=d.documentElement,r="ownerDocument",v="tagName",e=i.opera,l=i.webkit,t=i.gecko,q=i.ie;a.Dom={CUSTOM_ATTRIBUTES:!k.hasAttribute?{"for":"htmlFor","class":"className"}:{htmlFor:"for",className:"class"},get:function(b){var c,g,o,s;if(b){if(b.nodeType||b.item)return b;if(typeof b==="string"){c=b;if((b=d.getElementById(b))&&
b.id===c)return b;else if(b&&d.all){b=null;g=d.all[c];o=0;for(s=g.length;o<s;++o)if(g[o].id===c)return g[o]}return b}if(b.DOM_EVENTS)b=b.get("element");if("length"in b){c=[];o=0;for(s=b.length;o<s;++o)c[c.length]=a.Dom.get(b[o]);return c}return b}return null},getComputedStyle:function(b,c){if(window.getComputedStyle)return b[r].defaultView.getComputedStyle(b,null)[c];else if(b.currentStyle)return a.Dom.IE_ComputedStyle.get(b,c)},getStyle:function(b,c){return a.Dom.batch(b,a.Dom._getStyle,c)},_getStyle:function(){if(window.getComputedStyle)return function(b,
c){c=c==="float"?(c="cssFloat"):a.Dom._toCamel(c);var g=b.style[c];if(!g)if(b=b[r].defaultView.getComputedStyle(b,null))g=b[c];return g};else if(k.currentStyle)return function(b,c){var g;switch(c){case "opacity":g=100;try{g=b.filters["DXImageTransform.Microsoft.Alpha"].opacity}catch(o){try{g=b.filters("alpha").opacity}catch(s){}}return g/100;case "float":c="styleFloat";default:c=a.Dom._toCamel(c);g=b.currentStyle?b.currentStyle[c]:null;return b.style[c]||g}}}(),setStyle:function(b,c,g){a.Dom.batch(b,
a.Dom._setStyle,{prop:c,val:g})},_setStyle:function(){return q?function(b,c){var g=a.Dom._toCamel(c.prop);c=c.val;if(b)switch(g){case "opacity":if(h.isString(b.style.filter)){b.style.filter="alpha(opacity="+c*100+")";if(!b.currentStyle||!b.currentStyle.hasLayout)b.style.zoom=1}break;case "float":g="styleFloat";default:b.style[g]=c}}:function(b,c){var g=a.Dom._toCamel(c.prop);c=c.val;if(b){if(g=="float")g="cssFloat";b.style[g]=c}}}(),getXY:function(b){return a.Dom.batch(b,a.Dom._getXY)},_canPosition:function(b){return a.Dom._getStyle(b,
"display")!=="none"&&a.Dom._inDoc(b)},_getXY:function(){return d.documentElement.getBoundingClientRect?function(b){var c,g,o,s,w,y,x,z=Math.floor;g=false;if(a.Dom._canPosition(b)){g=b.getBoundingClientRect();o=b[r];b=a.Dom.getDocumentScrollLeft(o);c=a.Dom.getDocumentScrollTop(o);g=[z(g.left),z(g.top)];if(q&&i.ie<8){w=s=2;y=o.compatMode;x=u(o.documentElement,"borderLeftWidth");o=u(o.documentElement,"borderTopWidth");if(i.ie===6)if(y!=="BackCompat")w=s=0;if(y=="BackCompat"){if(x!=="medium")s=parseInt(x,
10);if(o!=="medium")w=parseInt(o,10)}g[0]-=s;g[1]-=w}if(c||b){g[0]+=b;g[1]+=c}g[0]=z(g[0]);g[1]=z(g[1])}return g}:function(b){var c,g,o,s=false,w=b;if(a.Dom._canPosition(b)){s=[b.offsetLeft,b.offsetTop];c=a.Dom.getDocumentScrollLeft(b[r]);g=a.Dom.getDocumentScrollTop(b[r]);for(o=t||i.webkit>519?true:false;w=w.offsetParent;){s[0]+=w.offsetLeft;s[1]+=w.offsetTop;if(o)s=a.Dom._calcBorders(w,s)}if(a.Dom._getStyle(b,"position")!=="fixed"){for(w=b;(w=w.parentNode)&&w[v];){b=w.scrollTop;o=w.scrollLeft;if(t&&
a.Dom._getStyle(w,"overflow")!=="visible")s=a.Dom._calcBorders(w,s);if(b||o){s[0]-=o;s[1]-=b}}s[0]+=c;s[1]+=g}else if(e){s[0]-=c;s[1]-=g}else if(l||t){s[0]+=c;s[1]+=g}s[0]=Math.floor(s[0]);s[1]=Math.floor(s[1])}return s}}(),getX:function(b){function c(g){return a.Dom.getXY(g)[0]}return a.Dom.batch(b,c,a.Dom,true)},getY:function(b){function c(g){return a.Dom.getXY(g)[1]}return a.Dom.batch(b,c,a.Dom,true)},setXY:function(b,c,g){a.Dom.batch(b,a.Dom._setXY,{pos:c,noRetry:g})},_setXY:function(b,c){var g=
a.Dom._getStyle(b,"position"),o=a.Dom.setStyle,s=c.pos;c=c.noRetry;var w=[parseInt(a.Dom.getComputedStyle(b,"left"),10),parseInt(a.Dom.getComputedStyle(b,"top"),10)],y;if(g=="static"){g="relative";o(b,"position",g)}y=a.Dom._getXY(b);if(!s||y===false)return false;if(isNaN(w[0]))w[0]=g=="relative"?0:b.offsetLeft;if(isNaN(w[1]))w[1]=g=="relative"?0:b.offsetTop;s[0]!==null&&o(b,"left",s[0]-y[0]+w[0]+"px");s[1]!==null&&o(b,"top",s[1]-y[1]+w[1]+"px");if(!c){g=a.Dom._getXY(b);if(s[0]!==null&&g[0]!=s[0]||
s[1]!==null&&g[1]!=s[1])a.Dom._setXY(b,{pos:s,noRetry:true})}},setX:function(b,c){a.Dom.setXY(b,[c,null])},setY:function(b,c){a.Dom.setXY(b,[null,c])},getRegion:function(b){function c(g){var o=false;if(a.Dom._canPosition(g))o=a.Region.getRegion(g);return o}return a.Dom.batch(b,c,a.Dom,true)},getClientWidth:function(){return a.Dom.getViewportWidth()},getClientHeight:function(){return a.Dom.getViewportHeight()},getElementsByClassName:function(b,c,g,o,s,w){b=h.trim(b);c=c||"*";g=g?a.Dom.get(g):d;if(!g)return[];
var y=[];c=g.getElementsByTagName(c);g=a.Dom.hasClass;for(var x=0,z=c.length;x<z;++x)if(g(c[x],b))y[y.length]=c[x];o&&a.Dom.batch(y,o,s,w);return y},hasClass:function(b,c){return a.Dom.batch(b,a.Dom._hasClass,c)},_hasClass:function(b,c){var g=false;if(b&&c){b=a.Dom.getAttribute(b,"className")||"";g=c.exec?c.test(b):c&&(" "+b+" ").indexOf(" "+c+" ")>-1}return g},addClass:function(b,c){return a.Dom.batch(b,a.Dom._addClass,c)},_addClass:function(b,c){var g=false,o;if(b&&c){o=a.Dom.getAttribute(b,"className")||
"";if(!a.Dom._hasClass(b,c)){a.Dom.setAttribute(b,"className",j(o+" "+c));g=true}}return g},removeClass:function(b,c){return a.Dom.batch(b,a.Dom._removeClass,c)},_removeClass:function(b,c){var g=false,o;if(b&&c){o=a.Dom.getAttribute(b,"className")||"";a.Dom.setAttribute(b,"className",o.replace(a.Dom._getClassRegex(c),""));c=a.Dom.getAttribute(b,"className");if(o!==c){a.Dom.setAttribute(b,"className",j(c));g=true;if(a.Dom.getAttribute(b,"className")===""){o=b.hasAttribute&&b.hasAttribute("class")?
"class":"className";b.removeAttribute(o)}}}return g},replaceClass:function(b,c,g){return a.Dom.batch(b,a.Dom._replaceClass,{from:c,to:g})},_replaceClass:function(b,c){var g,o,s=false;if(b&&c){g=c.from;if(o=c.to)if(g){if(g!==o){c=a.Dom.getAttribute(b,"className")||"";g=(" "+c.replace(a.Dom._getClassRegex(g)," "+o)).split(a.Dom._getClassRegex(o));g.splice(1,0," "+o);a.Dom.setAttribute(b,"className",j(g.join("")));s=true}}else s=a.Dom._addClass(b,c.to);else s=false}return s},generateId:function(b,c){function g(o){if(o&&
o.id)return o.id;var s=c+YAHOO.env._id_counter++;if(o){if(o[r].getElementById(s))return a.Dom.generateId(o,s+c);o.id=s}return s}c=c||"yui-gen";return a.Dom.batch(b,g,a.Dom,true)||g.apply(a.Dom,arguments)},isAncestor:function(b,c){b=a.Dom.get(b);c=a.Dom.get(c);var g=false;if(b&&c&&b.nodeType&&c.nodeType)if(b.contains&&b!==c)g=b.contains(c);else if(b.compareDocumentPosition)g=!!(b.compareDocumentPosition(c)&16);return g},inDocument:function(b,c){return a.Dom._inDoc(a.Dom.get(b),c)},_inDoc:function(b,
c){var g=false;if(b&&b[v]){c=c||b[r];g=a.Dom.isAncestor(c.documentElement,b)}return g},getElementsBy:function(b,c,g,o,s,w,y){c=c||"*";g=g?a.Dom.get(g):d;if(!g)return[];var x=[];c=g.getElementsByTagName(c);g=0;for(var z=c.length;g<z;++g)if(b(c[g]))if(y){x=c[g];break}else x[x.length]=c[g];o&&a.Dom.batch(x,o,s,w);return x},getElementBy:function(b,c,g){return a.Dom.getElementsBy(b,c,g,null,null,null,true)},batch:function(b,c,g,o){var s=[];o=o?g:window;if((b=b&&(b[v]||b.item)?b:a.Dom.get(b))&&c){if(b[v]||
b.length===undefined)return c.call(o,b,g);for(var w=0;w<b.length;++w)s[s.length]=c.call(o,b[w],g)}else return false;return s},getDocumentHeight:function(){return Math.max(d.compatMode!="CSS1Compat"||l?d.body.scrollHeight:k.scrollHeight,a.Dom.getViewportHeight())},getDocumentWidth:function(){return Math.max(d.compatMode!="CSS1Compat"||l?d.body.scrollWidth:k.scrollWidth,a.Dom.getViewportWidth())},getViewportHeight:function(){var b=self.innerHeight,c=d.compatMode;if((c||q)&&!e)b=c=="CSS1Compat"?k.clientHeight:
d.body.clientHeight;return b},getViewportWidth:function(){var b=self.innerWidth,c=d.compatMode;if(c||q)b=c=="CSS1Compat"?k.clientWidth:d.body.clientWidth;return b},getAncestorBy:function(b,c){for(;b=b.parentNode;)if(a.Dom._testElement(b,c))return b;return null},getAncestorByClassName:function(b,c){function g(o){return a.Dom.hasClass(o,c)}b=a.Dom.get(b);if(!b)return null;return a.Dom.getAncestorBy(b,g)},getAncestorByTagName:function(b,c){function g(o){return o[v]&&o[v].toUpperCase()==c.toUpperCase()}
b=a.Dom.get(b);if(!b)return null;return a.Dom.getAncestorBy(b,g)},getPreviousSiblingBy:function(b,c){for(;b;){b=b.previousSibling;if(a.Dom._testElement(b,c))return b}return null},getPreviousSibling:function(b){b=a.Dom.get(b);if(!b)return null;return a.Dom.getPreviousSiblingBy(b)},getNextSiblingBy:function(b,c){for(;b;){b=b.nextSibling;if(a.Dom._testElement(b,c))return b}return null},getNextSibling:function(b){b=a.Dom.get(b);if(!b)return null;return a.Dom.getNextSiblingBy(b)},getFirstChildBy:function(b,
c){return(a.Dom._testElement(b.firstChild,c)?b.firstChild:null)||a.Dom.getNextSiblingBy(b.firstChild,c)},getFirstChild:function(b){b=a.Dom.get(b);if(!b)return null;return a.Dom.getFirstChildBy(b)},getLastChildBy:function(b,c){if(!b)return null;return(a.Dom._testElement(b.lastChild,c)?b.lastChild:null)||a.Dom.getPreviousSiblingBy(b.lastChild,c)},getLastChild:function(b){b=a.Dom.get(b);return a.Dom.getLastChildBy(b)},getChildrenBy:function(b,c){var g=(b=a.Dom.getFirstChildBy(b,c))?[b]:[];a.Dom.getNextSiblingBy(b,
function(o){if(!c||c(o))g[g.length]=o;return false});return g},getChildren:function(b){b=a.Dom.get(b);return a.Dom.getChildrenBy(b)},getDocumentScrollLeft:function(b){b=b||d;return Math.max(b.documentElement.scrollLeft,b.body.scrollLeft)},getDocumentScrollTop:function(b){b=b||d;return Math.max(b.documentElement.scrollTop,b.body.scrollTop)},insertBefore:function(b,c){b=a.Dom.get(b);c=a.Dom.get(c);if(!b||!c||!c.parentNode)return null;return c.parentNode.insertBefore(b,c)},insertAfter:function(b,c){b=
a.Dom.get(b);c=a.Dom.get(c);if(!b||!c||!c.parentNode)return null;return c.nextSibling?c.parentNode.insertBefore(b,c.nextSibling):c.parentNode.appendChild(b)},getClientRegion:function(){var b=a.Dom.getDocumentScrollTop(),c=a.Dom.getDocumentScrollLeft(),g=a.Dom.getViewportWidth()+c,o=a.Dom.getViewportHeight()+b;return new a.Region(b,g,o,c)},setAttribute:function(b,c,g){c=a.Dom.CUSTOM_ATTRIBUTES[c]||c;b.setAttribute(c,g)},getAttribute:function(b,c){c=a.Dom.CUSTOM_ATTRIBUTES[c]||c;return b.getAttribute(c)},
_toCamel:function(b){function c(g,o){return o.toUpperCase()}return f[b]||(f[b]=b.indexOf("-")===-1?b:b.replace(/-([a-z])/gi,c))},_getClassRegex:function(b){var c;if(b!==undefined)if(b.exec)c=b;else{c=m[b];if(!c){b=b.replace(a.Dom._patterns.CLASS_RE_TOKENS,"\\$1");c=m[b]=new RegExp("(?:^|\\s)"+b+"(?= |$)","g")}}return c},_patterns:{ROOT_TAG:/^body|html$/i,CLASS_RE_TOKENS:/([\.\(\)\^\$\*\+\?\|\[\]\{\}])/g},_testElement:function(b,c){return b&&b.nodeType==1&&(!c||c(b))},_calcBorders:function(b,c){var g=
parseInt(a.Dom.getComputedStyle(b,"borderTopWidth"),10)||0,o=parseInt(a.Dom.getComputedStyle(b,"borderLeftWidth"),10)||0;if(t)if(n.test(b[v]))o=g=0;c[0]+=o;c[1]+=g;return c}};var u=a.Dom.getComputedStyle;if(i.opera)a.Dom.getComputedStyle=function(b,c){b=u(b,c);if(p.test(c))b=a.Dom.Color.toRGB(b);return b};if(i.webkit)a.Dom.getComputedStyle=function(b,c){b=u(b,c);if(b==="rgba(0, 0, 0, 0)")b="transparent";return b}})();
YAHOO.util.Region=function(a,h,i,j){this.y=this.top=a;this[1]=a;this.right=h;this.bottom=i;this.x=this.left=j;this[0]=j;this.width=this.right-this.left;this.height=this.bottom-this.top};YAHOO.util.Region.prototype.contains=function(a){return a.left>=this.left&&a.right<=this.right&&a.top>=this.top&&a.bottom<=this.bottom};YAHOO.util.Region.prototype.getArea=function(){return(this.bottom-this.top)*(this.right-this.left)};
YAHOO.util.Region.prototype.intersect=function(a){var h=Math.max(this.top,a.top),i=Math.min(this.right,a.right),j=Math.min(this.bottom,a.bottom);a=Math.max(this.left,a.left);return j>=h&&i>=a?new YAHOO.util.Region(h,i,j,a):null};YAHOO.util.Region.prototype.union=function(a){var h=Math.min(this.top,a.top),i=Math.max(this.right,a.right),j=Math.max(this.bottom,a.bottom);a=Math.min(this.left,a.left);return new YAHOO.util.Region(h,i,j,a)};
YAHOO.util.Region.prototype.toString=function(){return"Region {top: "+this.top+", right: "+this.right+", bottom: "+this.bottom+", left: "+this.left+", height: "+this.height+", width: "+this.width+"}"};YAHOO.util.Region.getRegion=function(a){var h=YAHOO.util.Dom.getXY(a),i=h[1],j=h[0]+a.offsetWidth;a=h[1]+a.offsetHeight;h=h[0];return new YAHOO.util.Region(i,j,a,h)};YAHOO.util.Point=function(a,h){if(YAHOO.lang.isArray(a)){h=a[1];a=a[0]}YAHOO.util.Point.superclass.constructor.call(this,h,a,h,a)};
YAHOO.extend(YAHOO.util.Point,YAHOO.util.Region);
(function(){var a=YAHOO.util,h=/^width|height$/,i=/^(\d[.\d]*)+(em|ex|px|gd|rem|vw|vh|vm|ch|mm|cm|in|pt|pc|deg|rad|ms|s|hz|khz|%){1}?/i,j={get:function(m,n){var p="";p=m.currentStyle[n];return n==="opacity"?a.Dom.getStyle(m,"opacity"):!p||p.indexOf&&p.indexOf("px")>-1?p:a.Dom.IE_COMPUTED[n]?a.Dom.IE_COMPUTED[n](m,n):i.test(p)?a.Dom.IE.ComputedStyle.getPixel(m,n):p},getOffset:function(m,n){var p=m.currentStyle[n],d=n.charAt(0).toUpperCase()+n.substr(1),k="offset"+d;d="pixel"+d;if(p=="auto"){d=p=m[k];
if(h.test(n)){m.style[n]=p;if(m[k]>p)d=p-(m[k]-p);m.style[n]="auto"}}else{if(!m.style[d]&&!m.style[n])m.style[n]=p;d=m.style[d]}return d+"px"},getBorderWidth:function(m,n){var p=null;if(!m.currentStyle.hasLayout)m.style.zoom=1;switch(n){case "borderTopWidth":p=m.clientTop;break;case "borderBottomWidth":p=m.offsetHeight-m.clientHeight-m.clientTop;break;case "borderLeftWidth":p=m.clientLeft;break;case "borderRightWidth":p=m.offsetWidth-m.clientWidth-m.clientLeft;break}return p+"px"},getPixel:function(m,
n){var p=null,d=m.currentStyle.right;n=m.currentStyle[n];m.style.right=n;p=m.style.pixelRight;m.style.right=d;return p+"px"},getMargin:function(m,n){return m.currentStyle[n]=="auto"?"0px":a.Dom.IE.ComputedStyle.getPixel(m,n)},getVisibility:function(m,n){for(var p;(p=m.currentStyle)&&p[n]=="inherit";)m=m.parentNode;return p?p[n]:"visible"},getColor:function(m,n){return a.Dom.Color.toRGB(m.currentStyle[n])||"transparent"},getBorderColor:function(m,n){m=m.currentStyle;n=m[n]||m.color;return a.Dom.Color.toRGB(a.Dom.Color.toHex(n))}},
f={};f.top=f.right=f.bottom=f.left=f.width=f.height=j.getOffset;f.color=j.getColor;f.borderTopWidth=f.borderRightWidth=f.borderBottomWidth=f.borderLeftWidth=j.getBorderWidth;f.marginTop=f.marginRight=f.marginBottom=f.marginLeft=j.getMargin;f.visibility=j.getVisibility;f.borderColor=f.borderTopColor=f.borderRightColor=f.borderBottomColor=f.borderLeftColor=j.getBorderColor;a.Dom.IE_COMPUTED=f;a.Dom.IE_ComputedStyle=j})();
(function(){var a=parseInt,h=RegExp,i=YAHOO.util;i.Dom.Color={KEYWORDS:{black:"000",silver:"c0c0c0",gray:"808080",white:"fff",maroon:"800000",red:"f00",purple:"800080",fuchsia:"f0f",green:"008000",lime:"0f0",olive:"808000",yellow:"ff0",navy:"000080",blue:"00f",teal:"008080",aqua:"0ff"},re_RGB:/^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i,re_hex:/^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i,re_hex3:/([0-9A-F])/gi,toRGB:function(j){i.Dom.Color.re_RGB.test(j)||(j=i.Dom.Color.toHex(j));if(i.Dom.Color.re_hex.exec(j))j=
"rgb("+[a(h.$1,16),a(h.$2,16),a(h.$3,16)].join(", ")+")";return j},toHex:function(j){j=i.Dom.Color.KEYWORDS[j]||j;if(i.Dom.Color.re_RGB.exec(j)){j=h.$1.length===1?"0"+h.$1:Number(h.$1);var f=h.$2.length===1?"0"+h.$2:Number(h.$2),m=h.$3.length===1?"0"+h.$3:Number(h.$3);j=[j.toString(16),f.toString(16),m.toString(16)].join("")}if(j.length<6)j=j.replace(i.Dom.Color.re_hex3,"$1$1");if(j!=="transparent"&&j.indexOf("#")<0)j="#"+j;return j.toLowerCase()}}})();
YAHOO.register("dom",YAHOO.util.Dom,{version:"2.7.0",build:"1796"});YAHOO.util.CustomEvent=function(a,h,i,j){this.type=a;this.scope=h||window;this.silent=i;this.signature=j||YAHOO.util.CustomEvent.LIST;this.subscribers=[];h="_YUICEOnSubscribe";if(a!==h)this.subscribeEvent=new YAHOO.util.CustomEvent(h,this,true);this.lastError=null};YAHOO.util.CustomEvent.LIST=0;YAHOO.util.CustomEvent.FLAT=1;
YAHOO.util.CustomEvent.prototype={subscribe:function(a,h,i){if(!a)throw new Error("Invalid callback for subscriber to '"+this.type+"'");this.subscribeEvent&&this.subscribeEvent.fire(a,h,i);this.subscribers.push(new YAHOO.util.Subscriber(a,h,i))},unsubscribe:function(a,h){if(!a)return this.unsubscribeAll();for(var i=false,j=0,f=this.subscribers.length;j<f;++j){var m=this.subscribers[j];if(m&&m.contains(a,h)){this._delete(j);i=true}}return i},fire:function(){this.lastError=null;var a=this.subscribers.length;
if(!a&&this.silent)return true;var h=[].slice.call(arguments,0),i=true,j,f=this.subscribers.slice(),m=YAHOO.util.Event.throwErrors;for(j=0;j<a;++j){var n=f[j];if(n){var p=n.getScope(this.scope);if(this.signature==YAHOO.util.CustomEvent.FLAT){var d=null;if(h.length>0)d=h[0];try{i=n.fn.call(p,d,n.obj)}catch(k){this.lastError=k;if(m)throw k;}}else try{i=n.fn.call(p,this.type,h,n.obj)}catch(r){this.lastError=r;if(m)throw r;}if(false===i)break}}return i!==false},unsubscribeAll:function(){var a=this.subscribers.length,
h;for(h=a-1;h>-1;h--)this._delete(h);this.subscribers=[];return a},_delete:function(a){var h=this.subscribers[a];if(h){delete h.fn;delete h.obj}this.subscribers.splice(a,1)},toString:function(){return"CustomEvent: '"+this.type+"', context: "+this.scope}};YAHOO.util.Subscriber=function(a,h,i){this.fn=a;this.obj=YAHOO.lang.isUndefined(h)?null:h;this.overrideContext=i};
YAHOO.util.Subscriber.prototype.getScope=function(a){if(this.overrideContext)return this.overrideContext===true?this.obj:this.overrideContext;return a};YAHOO.util.Subscriber.prototype.contains=function(a,h){return h?this.fn==a&&this.obj==h:this.fn==a};YAHOO.util.Subscriber.prototype.toString=function(){return"Subscriber { obj: "+this.obj+", overrideContext: "+(this.overrideContext||"no")+" }"};
if(!YAHOO.util.Event){YAHOO.util.Event=function(){var a=false,h=[],i=[],j=[],f=[],m=0,n=[],p=[],d=0,k={63232:38,63233:40,63234:37,63235:39,63276:33,63277:34,25:9},r=YAHOO.env.ua.ie?"focusin":"focus",v=YAHOO.env.ua.ie?"focusout":"blur";return{POLL_RETRYS:2E3,POLL_INTERVAL:20,EL:0,TYPE:1,FN:2,WFN:3,UNLOAD_OBJ:3,ADJ_SCOPE:4,OBJ:5,OVERRIDE:6,lastError:null,isSafari:YAHOO.env.ua.webkit,webkit:YAHOO.env.ua.webkit,isIE:YAHOO.env.ua.ie,_interval:null,_dri:null,DOMReady:false,throwErrors:false,startInterval:function(){if(!this._interval){var e=
this;this._interval=setInterval(function(){e._tryPreloadAttach()},this.POLL_INTERVAL)}},onAvailable:function(e,l,t,q,u){e=YAHOO.lang.isString(e)?[e]:e;for(var b=0;b<e.length;b+=1)n.push({id:e[b],fn:l,obj:t,overrideContext:q,checkReady:u});m=this.POLL_RETRYS;this.startInterval()},onContentReady:function(e,l,t,q){this.onAvailable(e,l,t,q,true)},onDOMReady:function(e,l,t){this.DOMReady?setTimeout(function(){var q=window;if(t)q=t===true?l:t;e.call(q,"DOMReady",[],l)},0):this.DOMReadyEvent.subscribe(e,
l,t)},_addListener:function(e,l,t,q,u,b){function c(x){return t.call(s,YAHOO.util.Event.getEvent(x,e),q)}if(!t||!t.call)return false;if(this._isValidCollection(e)){b=true;for(var g=0,o=e.length;g<o;++g)b=this.on(e[g],l,t,q,u)&&b;return b}else if(YAHOO.lang.isString(e))if(g=this.getEl(e))e=g;else{this.onAvailable(e,function(){YAHOO.util.Event.on(e,l,t,q,u)});return true}if(!e)return false;if("unload"==l&&q!==this){i[i.length]=[e,l,t,q,u];return true}var s=e;if(u)s=u===true?q:u;g=[e,l,t,c,s,q,u];o=
h.length;h[o]=g;if(this.useLegacyEvent(e,l)){var w=this.getLegacyIndex(e,l);if(w==-1||e!=j[w][0]){w=j.length;p[e.id+l]=w;j[w]=[e,l,e["on"+l]];f[w]=[];e["on"+l]=function(x){YAHOO.util.Event.fireLegacyEvent(YAHOO.util.Event.getEvent(x),w)}}f[w].push(g)}else try{this._simpleAdd(e,l,c,b)}catch(y){this.lastError=y;this.removeListener(e,l,t);return false}return true},addListener:function(e,l,t,q,u){return this._addListener(e,l,t,q,u,false)},addFocusListener:function(e,l,t,q){return this._addListener(e,
r,l,t,q,true)},removeFocusListener:function(e,l){return this.removeListener(e,r,l)},addBlurListener:function(e,l,t,q){return this._addListener(e,v,l,t,q,true)},removeBlurListener:function(e,l){return this.removeListener(e,v,l)},fireLegacyEvent:function(e,l){var t=true,q,u,b;q=f[l].slice();for(var c=0,g=q.length;c<g;++c)if((u=q[c])&&u[this.WFN]){b=u[this.ADJ_SCOPE];u=u[this.WFN].call(b,e);t=t&&u}(l=j[l])&&l[2]&&l[2](e);return t},getLegacyIndex:function(e,l){e=this.generateId(e)+l;return typeof p[e]==
"undefined"?-1:p[e]},useLegacyEvent:function(e,l){return this.webkit&&this.webkit<419&&("click"==l||"dblclick"==l)},removeListener:function(e,l,t,q){var u,b,c;if(typeof e=="string")e=this.getEl(e);else if(this._isValidCollection(e)){q=true;for(u=e.length-1;u>-1;u--)q=this.removeListener(e[u],l,t)&&q;return q}if(!t||!t.call)return this.purgeElement(e,false,l);if("unload"==l){for(u=i.length-1;u>-1;u--)if((c=i[u])&&c[0]==e&&c[1]==l&&c[2]==t){i.splice(u,1);return true}return false}u=null;q=q;if("undefined"===
typeof q)q=this._getCacheIndex(e,l,t);if(q>=0)u=h[q];if(!e||!u)return false;if(this.useLegacyEvent(e,l)){u=this.getLegacyIndex(e,l);var g=f[u];if(g){u=0;for(b=g.length;u<b;++u)if((c=g[u])&&c[this.EL]==e&&c[this.TYPE]==l&&c[this.FN]==t){g.splice(u,1);break}}}else try{this._simpleRemove(e,l,u[this.WFN],false)}catch(o){this.lastError=o;return false}delete h[q][this.WFN];delete h[q][this.FN];h.splice(q,1);return true},getTarget:function(e){e=e.target||e.srcElement;return this.resolveTextNode(e)},resolveTextNode:function(e){try{if(e&&
3==e.nodeType)return e.parentNode}catch(l){}return e},getPageX:function(e){var l=e.pageX;if(!l&&0!==l){l=e.clientX||0;if(this.isIE)l+=this._getScrollLeft()}return l},getPageY:function(e){var l=e.pageY;if(!l&&0!==l){l=e.clientY||0;if(this.isIE)l+=this._getScrollTop()}return l},getXY:function(e){return[this.getPageX(e),this.getPageY(e)]},getRelatedTarget:function(e){var l=e.relatedTarget;if(!l)if(e.type=="mouseout")l=e.toElement;else if(e.type=="mouseover")l=e.fromElement;return this.resolveTextNode(l)},
getTime:function(e){if(!e.time){var l=(new Date).getTime();try{e.time=l}catch(t){this.lastError=t;return l}}return e.time},stopEvent:function(e){this.stopPropagation(e);this.preventDefault(e)},stopPropagation:function(e){if(e.stopPropagation)e.stopPropagation();else e.cancelBubble=true},preventDefault:function(e){if(e.preventDefault)e.preventDefault();else e.returnValue=false},getEvent:function(e){e=e||window.event;if(!e)for(var l=this.getEvent.caller;l;){if((e=l.arguments[0])&&Event==e.constructor)break;
l=l.caller}return e},getCharCode:function(e){e=e.keyCode||e.charCode||0;if(YAHOO.env.ua.webkit&&e in k)e=k[e];return e},_getCacheIndex:function(e,l,t){for(var q=0,u=h.length;q<u;q+=1){var b=h[q];if(b&&b[this.FN]==t&&b[this.EL]==e&&b[this.TYPE]==l)return q}return-1},generateId:function(e){var l=e.id;if(!l){l="yuievtautoid-"+d;++d;e.id=l}return l},_isValidCollection:function(e){try{return e&&typeof e!=="string"&&e.length&&!e.tagName&&!e.alert&&typeof e[0]!=="undefined"}catch(l){return false}},elCache:{},
getEl:function(e){return typeof e==="string"?document.getElementById(e):e},clearCache:function(){},DOMReadyEvent:new YAHOO.util.CustomEvent("DOMReady",this),_load:function(){if(!a){a=true;var e=YAHOO.util.Event;e._ready();e._tryPreloadAttach()}},_ready:function(){var e=YAHOO.util.Event;if(!e.DOMReady){e.DOMReady=true;e.DOMReadyEvent.fire();e._simpleRemove(document,"DOMContentLoaded",e._ready)}},_tryPreloadAttach:function(){if(n.length===0){m=0;if(this._interval){clearInterval(this._interval);this._interval=
null}}else if(!this.locked){if(this.isIE)if(!this.DOMReady){this.startInterval();return}this.locked=true;var e=!a;e||(e=m>0&&n.length>0);var l=[],t=function(o,s){o=o;if(s.overrideContext)o=s.overrideContext===true?s.obj:s.overrideContext;s.fn.call(o,s.obj)},q,u,b,c,g=[];q=0;for(u=n.length;q<u;q+=1)if(b=n[q])if(c=this.getEl(b.id))if(b.checkReady){if(a||c.nextSibling||!e){g.push(b);n[q]=null}}else{t(c,b);n[q]=null}else l.push(b);q=0;for(u=g.length;q<u;q+=1){b=g[q];t(this.getEl(b.id),b)}m--;if(e){for(q=
n.length-1;q>-1;q--){b=n[q];if(!b||!b.id)n.splice(q,1)}this.startInterval()}else if(this._interval){clearInterval(this._interval);this._interval=null}this.locked=false}},purgeElement:function(e,l,t){e=YAHOO.lang.isString(e)?this.getEl(e):e;var q=this.getListeners(e,t),u;if(q)for(u=q.length-1;u>-1;u--){var b=q[u];this.removeListener(e,b.type,b.fn)}if(l&&e&&e.childNodes){u=0;for(q=e.childNodes.length;u<q;++u)this.purgeElement(e.childNodes[u],l,t)}},getListeners:function(e,l){var t=[],q;q=l?l==="unload"?
[i]:[h]:[h,i];e=YAHOO.lang.isString(e)?this.getEl(e):e;for(var u=0;u<q.length;u+=1){var b=q[u];if(b)for(var c=0,g=b.length;c<g;++c){var o=b[c];if(o&&o[this.EL]===e&&(!l||l===o[this.TYPE]))t.push({type:o[this.TYPE],fn:o[this.FN],obj:o[this.OBJ],adjust:o[this.OVERRIDE],scope:o[this.ADJ_SCOPE],index:c})}}return t.length?t:null},_unload:function(e){var l=YAHOO.util.Event,t,q,u,b=i.slice(),c;t=0;for(u=i.length;t<u;++t)if(q=b[t]){c=window;if(q[l.ADJ_SCOPE])c=q[l.ADJ_SCOPE]===true?q[l.UNLOAD_OBJ]:q[l.ADJ_SCOPE];
q[l.FN].call(c,l.getEvent(e,q[l.EL]),q[l.UNLOAD_OBJ]);b[t]=null}i=null;if(h)for(e=h.length-1;e>-1;e--)(q=h[e])&&l.removeListener(q[l.EL],q[l.TYPE],q[l.FN],e);j=null;l._simpleRemove(window,"unload",l._unload)},_getScrollLeft:function(){return this._getScroll()[1]},_getScrollTop:function(){return this._getScroll()[0]},_getScroll:function(){var e=document.documentElement,l=document.body;return e&&(e.scrollTop||e.scrollLeft)?[e.scrollTop,e.scrollLeft]:l?[l.scrollTop,l.scrollLeft]:[0,0]},regCE:function(){},
_simpleAdd:function(){return window.addEventListener?function(e,l,t,q){e.addEventListener(l,t,q)}:window.attachEvent?function(e,l,t){e.attachEvent("on"+l,t)}:function(){}}(),_simpleRemove:function(){return window.removeEventListener?function(e,l,t,q){e.removeEventListener(l,t,q)}:window.detachEvent?function(e,l,t){e.detachEvent("on"+l,t)}:function(){}}()}}();(function(){var a=YAHOO.util.Event;a.on=a.addListener;a.onFocus=a.addFocusListener;a.onBlur=a.addBlurListener;if(a.isIE){YAHOO.util.Event.onDOMReady(YAHOO.util.Event._tryPreloadAttach,
YAHOO.util.Event,true);var h=document.createElement("p");a._dri=setInterval(function(){try{h.doScroll("left");clearInterval(a._dri);a._dri=null;a._ready();h=null}catch(i){}},a.POLL_INTERVAL)}else if(a.webkit&&a.webkit<525)a._dri=setInterval(function(){var i=document.readyState;if("loaded"==i||"complete"==i){clearInterval(a._dri);a._dri=null;a._ready()}},a.POLL_INTERVAL);else a._simpleAdd(document,"DOMContentLoaded",a._ready);a._simpleAdd(window,"load",a._load);a._simpleAdd(window,"unload",a._unload);
a._tryPreloadAttach()})()}YAHOO.util.EventProvider=function(){};
YAHOO.util.EventProvider.prototype={__yui_events:null,__yui_subscribers:null,subscribe:function(a,h,i,j){this.__yui_events=this.__yui_events||{};var f=this.__yui_events[a];if(f)f.subscribe(h,i,j);else{f=this.__yui_subscribers=this.__yui_subscribers||{};f[a]||(f[a]=[]);f[a].push({fn:h,obj:i,overrideContext:j})}},unsubscribe:function(a,h,i){var j=this.__yui_events=this.__yui_events||{};if(a){if(j=j[a])return j.unsubscribe(h,i)}else{a=true;for(var f in j)if(YAHOO.lang.hasOwnProperty(j,f))a=a&&j[f].unsubscribe(h,
i);return a}return false},unsubscribeAll:function(a){return this.unsubscribe(a)},createEvent:function(a,h){this.__yui_events=this.__yui_events||{};var i=h||{};h=this.__yui_events;if(!h[a]){var j=i.scope||this,f=i.silent;j=new YAHOO.util.CustomEvent(a,j,f,YAHOO.util.CustomEvent.FLAT);h[a]=j;i.onSubscribeCallback&&j.subscribeEvent.subscribe(i.onSubscribeCallback);this.__yui_subscribers=this.__yui_subscribers||{};if(i=this.__yui_subscribers[a])for(f=0;f<i.length;++f)j.subscribe(i[f].fn,i[f].obj,i[f].overrideContext)}return h[a]},
fireEvent:function(a){this.__yui_events=this.__yui_events||{};var h=this.__yui_events[a];if(!h)return null;for(var i=[],j=1;j<arguments.length;++j)i.push(arguments[j]);return h.fire.apply(h,i)},hasEvent:function(a){if(this.__yui_events)if(this.__yui_events[a])return true;return false}};
(function(){var a=YAHOO.util.Event,h=YAHOO.lang;YAHOO.util.KeyListener=function(j,f,m,n){function p(k){if(!f.shift)f.shift=false;if(!f.alt)f.alt=false;if(!f.ctrl)f.ctrl=false;if(k.shiftKey==f.shift&&k.altKey==f.alt&&k.ctrlKey==f.ctrl){var r,v=f.keys,e;if(YAHOO.lang.isArray(v))for(var l=0;l<v.length;l++){r=v[l];e=a.getCharCode(k);if(r==e){d.fire(e,k);break}}else{e=a.getCharCode(k);v==e&&d.fire(e,k)}}}if(!n)n=YAHOO.util.KeyListener.KEYDOWN;var d=new YAHOO.util.CustomEvent("keyPressed");this.enabledEvent=
new YAHOO.util.CustomEvent("enabled");this.disabledEvent=new YAHOO.util.CustomEvent("disabled");if(h.isString(j))j=document.getElementById(j);h.isFunction(m)?d.subscribe(m):d.subscribe(m.fn,m.scope,m.correctScope);this.enable=function(){if(!this.enabled){a.on(j,n,p);this.enabledEvent.fire(f)}this.enabled=true};this.disable=function(){if(this.enabled){a.removeListener(j,n,p);this.disabledEvent.fire(f)}this.enabled=false};this.toString=function(){return"KeyListener ["+f.keys+"] "+j.tagName+(j.id?"["+
j.id+"]":"")}};var i=YAHOO.util.KeyListener;i.KEYDOWN="keydown";i.KEYUP="keyup";i.KEY={ALT:18,BACK_SPACE:8,CAPS_LOCK:20,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,META:224,NUM_LOCK:144,PAGE_DOWN:34,PAGE_UP:33,PAUSE:19,PRINTSCREEN:44,RIGHT:39,SCROLL_LOCK:145,SHIFT:16,SPACE:32,TAB:9,UP:38}})();YAHOO.register("event",YAHOO.util.Event,{version:"2.7.0",build:"1796"});YAHOO.register("yahoo-dom-event",YAHOO,{version:"2.7.0",build:"1796"});
if(typeof KISSY==="undefined"||!KISSY)KISSY={};
(function(a){var h=YAHOO.util,i=h.Dom,j=h.Event,f=YAHOO.lang,m=document.getElementsByTagName("head")[0],n=YAHOO.env.ua.ie,p={containerClassName:"suggest-container",containerWidth:"auto",keyElClassName:"suggest-key",resultElClassName:"suggest-result",resultFormat:"\u7ea6%result%\u6761\u7ed3\u679c",selectedItemClassName:"selected",bottomClassName:"suggest-bottom",showCloseBtn:false,closeBtnText:"\u5173\u95ed",closeBtnClassName:"suggest-close-btn",useShim:n===6,shimClassName:"suggest-shim",timerDelay:200,
autoFocus:false,submitFormOnClickSelect:true};a.Suggest=function(d,k,r){this.textInput=i.get(d);this.dataSource=k;this.JSONDataSource=f.isObject(k)?k:null;this.returnedData=null;this.config=f.merge(p,r||{});this.container=null;this.queryParams=this.query="";this._timer=null;this._isRunning=false;this.dataScript=null;this._dataCache={};this._latestScriptTime="";this._onKeyboardSelecting=this._scriptDataIsOut=false;this.selectedItem=null;this._init()};a.Suggest.prototype={_init:function(){this._initTextInput();
this._initContainer();this.config.useShim&&this._initShim();this._initStyle();this.createEvent("beforeDataRequest");this.createEvent("onDataReturn");this.createEvent("beforeShow");this.createEvent("onItemSelect");this._initResizeEvent()},_initTextInput:function(){var d=this;this.textInput.setAttribute("autocomplete","off");j.on(this.textInput,"focus",function(){d.start()});j.on(this.textInput,"blur",function(){d.stop();d.hide()});this.config.autoFocus&&this.textInput.focus();var k=0;j.on(this.textInput,
"keydown",function(r){r=r.charCode||r.keyCode;switch(r){case 27:d.hide();d.textInput.value=d.query;break;case 13:d.textInput.blur();d._onKeyboardSelecting&&d.textInput.value==d._getSelectedItemKey()&&d.fireEvent("onItemSelect",d.textInput.value);d._submitForm();break;case 40:case 38:if(k++==0){d._isRunning&&d.stop();d._onKeyboardSelecting=true;d.selectItem(r==40)}else if(k==3)k=0;break}if(r!=40&&r!=38){d._isRunning||d.start();d._onKeyboardSelecting=false}});j.on(this.textInput,"keyup",function(){k=
0})},_initContainer:function(){var d=document.createElement("div");d.className=this.config.containerClassName;d.style.position="absolute";d.style.visibility="hidden";this.container=d;this._setContainerRegion();this._initContainerEvent();document.body.insertBefore(d,document.body.firstChild)},_setContainerRegion:function(){var d=i.getRegion(this.textInput),k=d.left,r=d.right-k-2;if(document.documentMode===7&&(n===7||n===8))k-=2;else YAHOO.env.ua.gecko&&k++;this.container.style.left=k+"px";this.container.style.top=
d.bottom+"px";this.container.style.width=this.config.containerWidth=="auto"?r+"px":this.config.containerWidth},_initContainerEvent:function(){var d=this;j.on(this.container,"mousemove",function(r){r=j.getTarget(r);if(r.nodeName!="LI")r=i.getAncestorByTagName(r,"li");if(i.isAncestor(d.container,r))if(r!=d.selectedItem){d._removeSelectedItem();d._setSelectedItem(r)}});var k=null;this.container.onmousedown=function(r){r=r||window.event;k=r.target||r.srcElement;d.textInput.onbeforedeactivate=function(){window.event.returnValue=
false;d.textInput.onbeforedeactivate=null};return false};j.on(this.container,"mouseup",function(r){if(d._isInContainer(j.getXY(r))){r=j.getTarget(r);if(r==k)if(r.className==d.config.closeBtnClassName)d.hide();else{if(r.nodeName!="LI")r=i.getAncestorByTagName(r,"li");if(i.isAncestor(d.container,r)){d._updateInputFromSelectItem(r);d.fireEvent("onItemSelect",d.textInput.value);d.textInput.blur();d._submitForm()}}}})},_submitForm:function(){if(this.config.submitFormOnClickSelect){var d=this.textInput.form;
if(d){if(document.createEvent){var k=document.createEvent("MouseEvents");k.initEvent("submit",true,false);d.dispatchEvent(k)}else document.createEventObject&&d.fireEvent("onsubmit");d.submit()}}},_isInContainer:function(d){var k=i.getRegion(this.container);return d[0]>=k.left&&d[0]<=k.right&&d[1]>=k.top&&d[1]<=k.bottom},_initShim:function(){var d=document.createElement("iframe");d.src="about:blank";d.className=this.config.shimClassName;d.style.position="absolute";d.style.visibility="hidden";d.style.border=
"none";this.container.shim=d;this._setShimRegion();document.body.insertBefore(d,document.body.firstChild)},_setShimRegion:function(){var d=this.container,k=d.shim;if(k){k.style.left=parseInt(d.style.left)-2+"px";k.style.top=d.style.top;k.style.width=parseInt(d.style.width)+2+"px"}},_initStyle:function(){var d=i.get("suggest-style");if(!d){var k=".suggest-container{background:white;border:1px solid #999;z-index:99999}";k+=".suggest-shim{z-index:99998}";k+=".suggest-container li{color:#404040;padding:1px 0 2px;font-size:12px;line-height:18px;float:left;width:100%}";
k+=".suggest-container li.selected{background-color:#39F;cursor:default}";k+=".suggest-key{float:left;text-align:left;padding-left:5px}";k+=".suggest-result{float:right;text-align:right;padding-right:5px;color:green}";k+=".suggest-container li.selected span{color:#FFF;cursor:default}";k+=".suggest-bottom{padding:0 5px 5px}";k+=".suggest-close-btn{float:right}";k+=".suggest-container li,.suggest-bottom{overflow:hidden;zoom:1;clear:both}";k+=".suggest-container{*margin-left:2px;_margin-left:-2px;_margin-top:-3px}";
d=document.createElement("style");d.id="suggest-style";d.type="text/css";m.appendChild(d);if(d.styleSheet)d.styleSheet.cssText=k;else d.appendChild(document.createTextNode(k))}},_initResizeEvent:function(){var d=this,k;j.on(window,"resize",function(){k&&clearTimeout(k);k=setTimeout(function(){d._setContainerRegion();d._setShimRegion()},50)})},start:function(){a.Suggest.focusInstance=this;var d=this;d._timer=setTimeout(function(){d.updateData();d._timer=setTimeout(arguments.callee,d.config.timerDelay)},
d.config.timerDelay);this._isRunning=true},stop:function(){a.Suggest.focusInstance=null;clearTimeout(this._timer);this._isRunning=false},show:function(){if(!this.isVisible()){var d=this.container,k=d.shim;d.style.visibility="";if(k){if(!k.style.height){d=i.getRegion(d);k.style.height=d.bottom-d.top-2+"px"}k.style.visibility=""}}},hide:function(){if(this.isVisible()){var d=this.container,k=d.shim;if(k)k.style.visibility="hidden";d.style.visibility="hidden"}},isVisible:function(){return this.container.style.visibility!=
"hidden"},updateData:function(){if(this._needUpdate()){this._updateQueryValueFromInput();var d=this.query;if(f.trim(d).length)if(typeof this._dataCache[d]!="undefined"){this.returnedData="using cache";this._fillContainer(this._dataCache[d]);this._displayContainer()}else this.JSONDataSource?this.handleResponse(this.JSONDataSource[d]):this.requestData();else{this._fillContainer("");this.hide()}}},_needUpdate:function(){return this.textInput.value!=this.query},requestData:function(){if(!n)this.dataScript=
null;if(!this.dataScript){var d=document.createElement("script");d.type="text/javascript";d.charset="utf-8";m.insertBefore(d,m.firstChild);this.dataScript=d;if(!n){var k=(new Date).getTime();this._latestScriptTime=k;d.setAttribute("time",k);j.on(d,"load",function(){this._scriptDataIsOut=d.getAttribute("time")!=this._latestScriptTime},this,true)}}this.queryParams="q="+encodeURIComponent(this.query)+"&code=utf-8&callback=KISSY.Suggest.callback";this.fireEvent("beforeDataRequest",this.query);this.dataScript.src=
this.dataSource+"?"+this.queryParams},handleResponse:function(d){if(!this._scriptDataIsOut){this.returnedData=d;this.fireEvent("onDataReturn",d);this.returnedData=this.formatData(this.returnedData);var k="";d=this.returnedData.length;if(d>0){k=document.createElement("ol");for(var r=0;r<d;++r){var v=this.returnedData[r],e=this.formatItem(v.key,v.result);e.setAttribute("key",v.key);k.appendChild(e)}k=k}this._fillContainer(k);d>0&&this.appendBottom();f.trim(this.container.innerHTML)&&this.fireEvent("beforeShow",
this.container);this._dataCache[this.query]=this.container.innerHTML;this._displayContainer()}},formatData:function(d){var k=[];if(!d)return k;if(f.isArray(d.result))d=d.result;var r=d.length;if(!r)return k;for(var v,e=0;e<r;++e){v=d[e];k[e]=f.isString(v)?{key:v}:f.isArray(v)&&v.length>=2?{key:v[0],result:v[1]}:v}return k},formatItem:function(d,k){var r=document.createElement("li"),v=document.createElement("span");v.className=this.config.keyElClassName;v.appendChild(document.createTextNode(d));r.appendChild(v);
if(typeof k!="undefined"){d=this.config.resultFormat.replace("%result%",k);if(f.trim(d)){k=document.createElement("span");k.className=this.config.resultElClassName;k.appendChild(document.createTextNode(d));r.appendChild(k)}}return r},appendBottom:function(){var d=document.createElement("div");d.className=this.config.bottomClassName;if(this.config.showCloseBtn){var k=document.createElement("a");k.href="javascript: void(0)";k.setAttribute("target","_self");k.className=this.config.closeBtnClassName;
k.appendChild(document.createTextNode(this.config.closeBtnText));d.appendChild(k)}f.trim(d.innerHTML)&&this.container.appendChild(d)},_fillContainer:function(d){if(d.nodeType==1){this.container.innerHTML="";this.container.appendChild(d)}else this.container.innerHTML=d;this.selectedItem=null},_displayContainer:function(){f.trim(this.container.innerHTML)?this.show():this.hide()},selectItem:function(d){var k=this.container.getElementsByTagName("li");if(k.length!=0)if(this.isVisible()){if(this.selectedItem){d=
i[d?"getNextSibling":"getPreviousSibling"](this.selectedItem);if(!d)this.textInput.value=this.query}else d=k[d?0:k.length-1];this._removeSelectedItem();if(d){this._setSelectedItem(d);this._updateInputFromSelectItem()}}else this.show()},_removeSelectedItem:function(){i.removeClass(this.selectedItem,this.config.selectedItemClassName);this.selectedItem=null},_setSelectedItem:function(d){i.addClass(d,this.config.selectedItemClassName);this.selectedItem=d},_getSelectedItemKey:function(){if(!this.selectedItem)return"";
return this.selectedItem.getAttribute("key")},_updateQueryValueFromInput:function(){this.query=this.textInput.value},_updateInputFromSelectItem:function(){this.textInput.value=this._getSelectedItemKey(this.selectedItem)}};f.augmentProto(a.Suggest,h.EventProvider);a.Suggest.focusInstance=null;a.Suggest.callback=function(d){a.Suggest.focusInstance&&setTimeout(function(){a.Suggest.focusInstance.handleResponse(d)},0)}})(KISSY);
(function(){window.baidu={};var a="http://suggestion.baidu.com/su";window.window.baidu.sug=KISSY.Suggest.callback;a=new KISSY.Suggest("kw",a,{containerClassName:"b-sug"});a.subscribe("beforeDataRequest",function(h){this.dataScript.charset="GB18030";this.queryParams="p=3&wd="+encodeURIComponent(h)+"&callback=window.baidu.sug"});a.subscribe("onDataReturn",function(h){h=h.s||[];for(var i=[],j=0,f=h.length;j<f;++j)i.push(h[j]);this.returnedData=i});a="http://clients1.google.cn/complete/search";window.google=
{};window.google.ac={};window.google.ac.h=KISSY.Suggest.callback;a=new KISSY.Suggest("gq",a,{resultFormat:"",containerClassName:"g-sug"});a.subscribe("beforeDataRequest",function(h){this.dataScript.charset="utf-8";this.queryParams="hl=en&q="+encodeURIComponent(h)});a.subscribe("onDataReturn",function(h){this.returnedData=h[1]||[]})})();
