if(typeof YAHOO=="undefined"||!YAHOO){var YAHOO={}}YAHOO.namespace=function(){var a=arguments,b=null,d,e,c;for(d=0;d<a.length;d=d+1){c=(""+a[d]).split(".");b=YAHOO;for(e=(c[0]=="YAHOO")?1:0;e<c.length;e=e+1){b[c[e]]=b[c[e]]||{};b=b[c[e]]}}return b};YAHOO.log=function(b,a,c){var d=YAHOO.widget.Logger;if(d&&d.log){return d.log(b,a,c)}else{return false}};YAHOO.register=function(d,i,a){var e=YAHOO.env.modules,c,f,g,h,b;if(!e[d]){e[d]={versions:[],builds:[]}}c=e[d];f=a.version;g=a.build;h=YAHOO.env.listeners;c.name=d;c.version=f;c.build=g;c.versions.push(f);c.builds.push(g);c.mainClass=i;for(b=0;b<h.length;b=b+1){h[b](c)}if(i){i.VERSION=f;i.BUILD=g}else{YAHOO.log("mainClass is undefined for module "+d,"warn")}};YAHOO.env=YAHOO.env||{modules:[],listeners:[]};YAHOO.env.getVersion=function(a){return YAHOO.env.modules[a]||null};YAHOO.env.ua=function(){var b={ie:0,opera:0,gecko:0,webkit:0,mobile:null,air:0,caja:0},c=navigator.userAgent,a;if((/KHTML/).test(c)){b.webkit=1}a=c.match(/AppleWebKit\/([^\s]*)/);if(a&&a[1]){b.webkit=parseFloat(a[1]);if(/ Mobile\//.test(c)){b.mobile="Apple"}else{a=c.match(/NokiaN[^\/]*/);if(a){b.mobile=a[0]}}a=c.match(/AdobeAIR\/([^\s]*)/);if(a){b.air=a[0]}}if(!b.webkit){a=c.match(/Opera[\s\/]([^\s]*)/);if(a&&a[1]){b.opera=parseFloat(a[1]);a=c.match(/Opera Mini[^;]*/);if(a){b.mobile=a[0]}}else{a=c.match(/MSIE\s([^;]*)/);if(a&&a[1]){b.ie=parseFloat(a[1])}else{a=c.match(/Gecko\/([^\s]*)/);if(a){b.gecko=1;a=c.match(/rv:([^\s\)]*)/);if(a&&a[1]){b.gecko=parseFloat(a[1])}}}}}a=c.match(/Caja\/([^\s]*)/);if(a&&a[1]){b.caja=parseFloat(a[1])}return b}();(function(){YAHOO.namespace("util","widget","example");if("undefined"!==typeof YAHOO_config){var d=YAHOO_config.listener,a=YAHOO.env.listeners,b=true,c;if(d){for(c=0;c<a.length;c=c+1){if(a[c]==d){b=false;break}}if(b){a.push(d)}}}})();YAHOO.lang=YAHOO.lang||{};(function(){var f=YAHOO.lang,b="[object Array]",e="[object Function]",a=Object.prototype,c=["toString","valueOf"],d={isArray:function(g){return a.toString.apply(g)===b},isBoolean:function(g){return typeof g==="boolean"},isFunction:function(g){return a.toString.apply(g)===e},isNull:function(g){return g===null},isNumber:function(g){return typeof g==="number"&&isFinite(g)},isObject:function(g){return(g&&(typeof g==="object"||f.isFunction(g)))||false},isString:function(g){return typeof g==="string"},isUndefined:function(g){return typeof g==="undefined"},_IEEnumFix:(YAHOO.env.ua.ie)?function(i,j){var k,g,h;for(k=0;k<c.length;k=k+1){g=c[k];h=j[g];if(f.isFunction(h)&&h!=a[g]){i[g]=h}}}:function(){},extend:function(h,g,i){if(!g||!h){throw new Error("extend failed, please check that all dependencies are included.")}var j=function(){},k;j.prototype=g.prototype;h.prototype=new j();h.prototype.constructor=h;h.superclass=g.prototype;if(g.prototype.constructor==a.constructor){g.prototype.constructor=g}if(i){for(k in i){if(f.hasOwnProperty(i,k)){h.prototype[k]=i[k]}}f._IEEnumFix(h.prototype,i)}},augmentObject:function(h,i){if(!i||!h){throw new Error("Absorb failed, verify dependencies.")}var l=arguments,j,g,k=l[2];if(k&&k!==true){for(j=2;j<l.length;j=j+1){h[l[j]]=i[l[j]]}}else{for(g in i){if(k||!(g in h)){h[g]=i[g]}}f._IEEnumFix(h,i)}},augmentProto:function(g,h){if(!h||!g){throw new Error("Augment failed, verify dependencies.")}var j=[g.prototype,h.prototype],i;for(i=2;i<arguments.length;i=i+1){j.push(arguments[i])}f.augmentObject.apply(this,j)},dump:function(o,j){var m,k,h=[],g="{...}",n="f(){...}",i=", ",l=" => ";if(!f.isObject(o)){return o+""}else{if(o instanceof Date||("nodeType" in o&&"tagName" in o)){return o}else{if(f.isFunction(o)){return n}}}j=(f.isNumber(j))?j:3;if(f.isArray(o)){h.push("[");for(m=0,k=o.length;m<k;m=m+1){if(f.isObject(o[m])){h.push((j>0)?f.dump(o[m],j-1):g)}else{h.push(o[m])}h.push(i)}if(h.length>1){h.pop()}h.push("]")}else{h.push("{");for(m in o){if(f.hasOwnProperty(o,m)){h.push(m+l);if(f.isObject(o[m])){h.push((j>0)?f.dump(o[m],j-1):g)}else{h.push(o[m])}h.push(i)}}if(h.length>1){h.pop()}h.push("}")}return h.join("")},substitute:function(g,u,n){var q,r,s,k,j,h,l=[],t,p="dump",m=" ",v="{",i="}",o;for(;;){q=g.lastIndexOf(v);if(q<0){break}r=g.indexOf(i,q);if(q+1>=r){break}t=g.substring(q+1,r);k=t;h=null;s=k.indexOf(m);if(s>-1){h=k.substring(s+1);k=k.substring(0,s)}j=u[k];if(n){j=n(k,j,h)}if(f.isObject(j)){if(f.isArray(j)){j=f.dump(j,parseInt(h,10))}else{h=h||"";o=h.indexOf(p);if(o>-1){h=h.substring(4)}if(j.toString===a.toString||o>-1){j=f.dump(j,parseInt(h,10))}else{j=j.toString()}}}else{if(!f.isString(j)&&!f.isNumber(j)){j="~-"+l.length+"-~";l[l.length]=t}}g=g.substring(0,q)+j+g.substring(r+1)}for(q=l.length-1;q>=0;q=q-1){g=g.replace(new RegExp("~-"+q+"-~"),"{"+l[q]+"}","g")}return g},trim:function(h){try{return h.replace(/^\s+|\s+$/g,"")}catch(g){return h}},merge:function(){var g={},i=arguments,j=i.length,h;for(h=0;h<j;h=h+1){f.augmentObject(g,i[h],true)}return g},later:function(h,n,g,l,k){h=h||0;n=n||{};var m=g,i=l,j,o;if(f.isString(g)){m=n[g]}if(!m){throw new TypeError("method undefined")}if(!f.isArray(i)){i=[l]}j=function(){m.apply(n,i)};o=(k)?setInterval(j,h):setTimeout(j,h);return{interval:k,cancel:function(){if(this.interval){clearInterval(o)}else{clearTimeout(o)}}}},isValue:function(g){return(f.isObject(g)||f.isString(g)||f.isNumber(g)||f.isBoolean(g))}};f.hasOwnProperty=(a.hasOwnProperty)?function(h,g){return h&&h.hasOwnProperty(g)}:function(h,g){return !f.isUndefined(h[g])&&h.constructor.prototype[g]!==h[g]};d.augmentObject(f,d,true);YAHOO.util.Lang=f;f.augment=f.augmentProto;YAHOO.augment=f.augmentProto;YAHOO.extend=f.extend})();YAHOO.register("yahoo",YAHOO,{version:"2.7.0",build:"1799"});(function(){YAHOO.env._id_counter=YAHOO.env._id_counter||0;var ao=YAHOO.util,ai=YAHOO.lang,aE=YAHOO.env.ua,at=YAHOO.lang.trim,aN={},aJ={},ag=/^t(?:able|d|h)$/i,y=/color$/i,aj=window.document,z=aj.documentElement,aM="ownerDocument",aD="defaultView",av="documentElement",ax="compatMode",aP="offsetLeft",ae="offsetTop",aw="offsetParent",x="parentNode",aF="nodeType",aq="tagName",af="scrollLeft",aI="scrollTop",ad="getBoundingClientRect",au="getComputedStyle",aQ="currentStyle",ah="CSS1Compat",aO="BackCompat",aK="class",an="className",ak="",ar=" ",ay="(?:^|\\s)",aG="(?= |$)",Y="g",aB="position",aL="fixed",G="relative",aH="left",aC="top",az="medium",aA="borderLeftWidth",ac="borderTopWidth",ap=aE.opera,al=aE.webkit,am=aE.gecko,aa=aE.ie;ao.Dom={CUSTOM_ATTRIBUTES:(!z.hasAttribute)?{"for":"htmlFor","class":an}:{htmlFor:"for",className:aK},get:function(f){var e,d,c,a,b;if(f){if(f[aF]||f.item){return f}if(typeof f==="string"){e=f;f=aj.getElementById(f);if(f&&f.id===e){return f}else{if(f&&aj.all){f=null;d=aj.all[e];for(a=0,b=d.length;a<b;++a){if(d[a].id===e){return d[a]}}}}return f}if(f.DOM_EVENTS){f=f.get("element")}if("length" in f){c=[];for(a=0,b=f.length;a<b;++a){c[c.length]=ao.Dom.get(f[a])}return c}return f}return null},getComputedStyle:function(a,b){if(window[au]){return a[aM][aD][au](a,null)[b]}else{if(a[aQ]){return ao.Dom.IE_ComputedStyle.get(a,b)}}},getStyle:function(a,b){return ao.Dom.batch(a,ao.Dom._getStyle,b)},_getStyle:function(){if(window[au]){return function(b,d){d=(d==="float")?d="cssFloat":ao.Dom._toCamel(d);var a=b.style[d],c;if(!a){c=b[aM][aD][au](b,null);if(c){a=c[d]}}return a}}else{if(z[aQ]){return function(b,e){var a;switch(e){case"opacity":a=100;try{a=b.filters["DXImageTransform.Microsoft.Alpha"].opacity}catch(d){try{a=b.filters("alpha").opacity}catch(c){}}return a/100;case"float":e="styleFloat";default:e=ao.Dom._toCamel(e);a=b[aQ]?b[aQ][e]:null;return(b.style[e]||a)}}}}}(),setStyle:function(b,c,a){ao.Dom.batch(b,ao.Dom._setStyle,{prop:c,val:a})},_setStyle:function(){if(aa){return function(c,b){var a=ao.Dom._toCamel(b.prop),d=b.val;if(c){switch(a){case"opacity":if(ai.isString(c.style.filter)){c.style.filter="alpha(opacity="+d*100+")";if(!c[aQ]||!c[aQ].hasLayout){c.style.zoom=1}}break;case"float":a="styleFloat";default:c.style[a]=d}}else{}}}else{return function(c,b){var a=ao.Dom._toCamel(b.prop),d=b.val;if(c){if(a=="float"){a="cssFloat"}c.style[a]=d}else{}}}}(),getXY:function(a){return ao.Dom.batch(a,ao.Dom._getXY)},_canPosition:function(a){return(ao.Dom._getStyle(a,"display")!=="none"&&ao.Dom._inDoc(a))},_getXY:function(){if(aj[av][ad]){return function(j){var i,a,h,c,d,e,f,l,k,g=Math.floor,b=false;if(ao.Dom._canPosition(j)){h=j[ad]();c=j[aM];i=ao.Dom.getDocumentScrollLeft(c);a=ao.Dom.getDocumentScrollTop(c);b=[g(h[aH]),g(h[aC])];if(aa&&aE.ie<8){d=2;e=2;f=c[ax];l=ab(c[av],aA);k=ab(c[av],ac);if(aE.ie===6){if(f!==aO){d=0;e=0}}if((f==aO)){if(l!==az){d=parseInt(l,10)}if(k!==az){e=parseInt(k,10)}}b[0]-=d;b[1]-=e}if((a||i)){b[0]+=i;b[1]+=a}b[0]=g(b[0]);b[1]=g(b[1])}else{}return b}}else{return function(h){var a,g,f,d,c,e=false,b=h;if(ao.Dom._canPosition(h)){e=[h[aP],h[ae]];a=ao.Dom.getDocumentScrollLeft(h[aM]);g=ao.Dom.getDocumentScrollTop(h[aM]);c=((am||aE.webkit>519)?true:false);while((b=b[aw])){e[0]+=b[aP];e[1]+=b[ae];if(c){e=ao.Dom._calcBorders(b,e)}}if(ao.Dom._getStyle(h,aB)!==aL){b=h;while((b=b[x])&&b[aq]){f=b[aI];d=b[af];if(am&&(ao.Dom._getStyle(b,"overflow")!=="visible")){e=ao.Dom._calcBorders(b,e)}if(f||d){e[0]-=d;e[1]-=f}}e[0]+=a;e[1]+=g}else{if(ap){e[0]-=a;e[1]-=g}else{if(al||am){e[0]+=a;e[1]+=g}}}e[0]=Math.floor(e[0]);e[1]=Math.floor(e[1])}else{}return e}}}(),getX:function(a){var b=function(c){return ao.Dom.getXY(c)[0]};return ao.Dom.batch(a,b,ao.Dom,true)},getY:function(a){var b=function(c){return ao.Dom.getXY(c)[1]};return ao.Dom.batch(a,b,ao.Dom,true)},setXY:function(b,a,c){ao.Dom.batch(b,ao.Dom._setXY,{pos:a,noRetry:c})},_setXY:function(i,f){var e=ao.Dom._getStyle(i,aB),g=ao.Dom.setStyle,b=f.pos,a=f.noRetry,d=[parseInt(ao.Dom.getComputedStyle(i,aH),10),parseInt(ao.Dom.getComputedStyle(i,aC),10)],c,h;if(e=="static"){e=G;g(i,aB,e)}c=ao.Dom._getXY(i);if(!b||c===false){return false}if(isNaN(d[0])){d[0]=(e==G)?0:i[aP]}if(isNaN(d[1])){d[1]=(e==G)?0:i[ae]}if(b[0]!==null){g(i,aH,b[0]-c[0]+d[0]+"px")}if(b[1]!==null){g(i,aC,b[1]-c[1]+d[1]+"px")}if(!a){h=ao.Dom._getXY(i);if((b[0]!==null&&h[0]!=b[0])||(b[1]!==null&&h[1]!=b[1])){ao.Dom._setXY(i,{pos:b,noRetry:true})}}},setX:function(b,a){ao.Dom.setXY(b,[a,null])},setY:function(a,b){ao.Dom.setXY(a,[null,b])},getRegion:function(a){var b=function(c){var d=false;if(ao.Dom._canPosition(c)){d=ao.Region.getRegion(c)}else{}return d};return ao.Dom.batch(a,b,ao.Dom,true)},getClientWidth:function(){return ao.Dom.getViewportWidth()},getClientHeight:function(){return ao.Dom.getViewportHeight()},getElementsByClassName:function(f,b,e,c,j,d){f=ai.trim(f);b=b||"*";e=(e)?ao.Dom.get(e):null||aj;if(!e){return[]}var a=[],k=e.getElementsByTagName(b),h=ao.Dom.hasClass;for(var i=0,g=k.length;i<g;++i){if(h(k[i],f)){a[a.length]=k[i]}}if(c){ao.Dom.batch(a,c,j,d)}return a},hasClass:function(b,a){return ao.Dom.batch(b,ao.Dom._hasClass,a)},_hasClass:function(a,c){var b=false,d;if(a&&c){d=ao.Dom.getAttribute(a,an)||ak;if(c.exec){b=c.test(d)}else{b=c&&(ar+d+ar).indexOf(ar+c+ar)>-1}}else{}return b},addClass:function(b,a){return ao.Dom.batch(b,ao.Dom._addClass,a)},_addClass:function(a,c){var b=false,d;if(a&&c){d=ao.Dom.getAttribute(a,an)||ak;if(!ao.Dom._hasClass(a,c)){ao.Dom.setAttribute(a,an,at(d+ar+c));b=true}}else{}return b},removeClass:function(b,a){return ao.Dom.batch(b,ao.Dom._removeClass,a)},_removeClass:function(f,a){var e=false,d,c,b;if(f&&a){d=ao.Dom.getAttribute(f,an)||ak;ao.Dom.setAttribute(f,an,d.replace(ao.Dom._getClassRegex(a),ak));c=ao.Dom.getAttribute(f,an);if(d!==c){ao.Dom.setAttribute(f,an,at(c));e=true;if(ao.Dom.getAttribute(f,an)===""){b=(f.hasAttribute&&f.hasAttribute(aK))?aK:an;f.removeAttribute(b)}}}else{}return e},replaceClass:function(a,c,b){return ao.Dom.batch(a,ao.Dom._replaceClass,{from:c,to:b})},_replaceClass:function(g,a){var f,c,e,b=false,d;if(g&&a){c=a.from;e=a.to;if(!e){b=false}else{if(!c){b=ao.Dom._addClass(g,a.to)}else{if(c!==e){d=ao.Dom.getAttribute(g,an)||ak;f=(ar+d.replace(ao.Dom._getClassRegex(c),ar+e)).split(ao.Dom._getClassRegex(e));f.splice(1,0,ar+e);ao.Dom.setAttribute(g,an,at(f.join(ak)));b=true}}}}else{}return b},generateId:function(b,a){a=a||"yui-gen";var c=function(e){if(e&&e.id){return e.id}var d=a+YAHOO.env._id_counter++;if(e){if(e[aM].getElementById(d)){return ao.Dom.generateId(e,d+a)}e.id=d}return d};return ao.Dom.batch(b,c,ao.Dom,true)||c.apply(ao.Dom,arguments)},isAncestor:function(c,a){c=ao.Dom.get(c);a=ao.Dom.get(a);var b=false;if((c&&a)&&(c[aF]&&a[aF])){if(c.contains&&c!==a){b=c.contains(a)}else{if(c.compareDocumentPosition){b=!!(c.compareDocumentPosition(a)&16)}}}else{}return b},inDocument:function(a,b){return ao.Dom._inDoc(ao.Dom.get(a),b)},_inDoc:function(c,a){var b=false;if(c&&c[aq]){a=a||c[aM];b=ao.Dom.isAncestor(a[av],c)}else{}return b},getElementsBy:function(a,b,f,d,i,e,c){b=b||"*";f=(f)?ao.Dom.get(f):null||aj;if(!f){return[]}var j=[],k=f.getElementsByTagName(b);for(var h=0,g=k.length;h<g;++h){if(a(k[h])){if(c){j=k[h];break}else{j[j.length]=k[h]}}}if(d){ao.Dom.batch(j,d,i,e)}return j},getElementBy:function(a,b,c){return ao.Dom.getElementsBy(a,b,c,null,null,null,true)},batch:function(a,c,f,e){var g=[],d=(e)?f:window;a=(a&&(a[aq]||a.item))?a:ao.Dom.get(a);if(a&&c){if(a[aq]||a.length===undefined){return c.call(d,a,f)}for(var b=0;b<a.length;++b){g[g.length]=c.call(d,a[b],f)}}else{return false}return g},getDocumentHeight:function(){var b=(aj[ax]!=ah||al)?aj.body.scrollHeight:z.scrollHeight,a=Math.max(b,ao.Dom.getViewportHeight());return a},getDocumentWidth:function(){var b=(aj[ax]!=ah||al)?aj.body.scrollWidth:z.scrollWidth,a=Math.max(b,ao.Dom.getViewportWidth());return a},getViewportHeight:function(){var a=self.innerHeight,b=aj[ax];if((b||aa)&&!ap){a=(b==ah)?z.clientHeight:aj.body.clientHeight}return a},getViewportWidth:function(){var a=self.innerWidth,b=aj[ax];if(b||aa){a=(b==ah)?z.clientWidth:aj.body.clientWidth}return a},getAncestorBy:function(a,b){while((a=a[x])){if(ao.Dom._testElement(a,b)){return a}}return null},getAncestorByClassName:function(c,b){c=ao.Dom.get(c);if(!c){return null}var a=function(d){return ao.Dom.hasClass(d,b)};return ao.Dom.getAncestorBy(c,a)},getAncestorByTagName:function(c,b){c=ao.Dom.get(c);if(!c){return null}var a=function(d){return d[aq]&&d[aq].toUpperCase()==b.toUpperCase()};return ao.Dom.getAncestorBy(c,a)},getPreviousSiblingBy:function(a,b){while(a){a=a.previousSibling;if(ao.Dom._testElement(a,b)){return a}}return null},getPreviousSibling:function(a){a=ao.Dom.get(a);if(!a){return null}return ao.Dom.getPreviousSiblingBy(a)},getNextSiblingBy:function(a,b){while(a){a=a.nextSibling;if(ao.Dom._testElement(a,b)){return a}}return null},getNextSibling:function(a){a=ao.Dom.get(a);if(!a){return null}return ao.Dom.getNextSiblingBy(a)},getFirstChildBy:function(b,a){var c=(ao.Dom._testElement(b.firstChild,a))?b.firstChild:null;return c||ao.Dom.getNextSiblingBy(b.firstChild,a)},getFirstChild:function(a,b){a=ao.Dom.get(a);if(!a){return null}return ao.Dom.getFirstChildBy(a)},getLastChildBy:function(b,a){if(!b){return null}var c=(ao.Dom._testElement(b.lastChild,a))?b.lastChild:null;return c||ao.Dom.getPreviousSiblingBy(b.lastChild,a)},getLastChild:function(a){a=ao.Dom.get(a);return ao.Dom.getLastChildBy(a)},getChildrenBy:function(c,d){var a=ao.Dom.getFirstChildBy(c,d),b=a?[a]:[];ao.Dom.getNextSiblingBy(a,function(e){if(!d||d(e)){b[b.length]=e}return false});return b},getChildren:function(a){a=ao.Dom.get(a);if(!a){}return ao.Dom.getChildrenBy(a)},getDocumentScrollLeft:function(a){a=a||aj;return Math.max(a[av].scrollLeft,a.body.scrollLeft)},getDocumentScrollTop:function(a){a=a||aj;return Math.max(a[av].scrollTop,a.body.scrollTop)},insertBefore:function(b,a){b=ao.Dom.get(b);a=ao.Dom.get(a);if(!b||!a||!a[x]){return null}return a[x].insertBefore(b,a)},insertAfter:function(b,a){b=ao.Dom.get(b);a=ao.Dom.get(a);if(!b||!a||!a[x]){return null}if(a.nextSibling){return a[x].insertBefore(b,a.nextSibling)}else{return a[x].appendChild(b)}},getClientRegion:function(){var a=ao.Dom.getDocumentScrollTop(),c=ao.Dom.getDocumentScrollLeft(),d=ao.Dom.getViewportWidth()+c,b=ao.Dom.getViewportHeight()+a;return new ao.Region(a,d,b,c)},setAttribute:function(c,b,a){b=ao.Dom.CUSTOM_ATTRIBUTES[b]||b;c.setAttribute(b,a)},getAttribute:function(b,a){a=ao.Dom.CUSTOM_ATTRIBUTES[a]||a;return b.getAttribute(a)},_toCamel:function(c){var a=aN;function b(e,d){return d.toUpperCase()}return a[c]||(a[c]=c.indexOf("-")===-1?c:c.replace(/-([a-z])/gi,b))},_getClassRegex:function(b){var a;if(b!==undefined){if(b.exec){a=b}else{a=aJ[b];if(!a){b=b.replace(ao.Dom._patterns.CLASS_RE_TOKENS,"\\$1");a=aJ[b]=new RegExp(ay+b+aG,Y)}}}return a},_patterns:{ROOT_TAG:/^body|html$/i,CLASS_RE_TOKENS:/([\.\(\)\^\$\*\+\?\|\[\]\{\}])/g},_testElement:function(a,b){return a&&a[aF]==1&&(!b||b(a))},_calcBorders:function(a,d){var c=parseInt(ao.Dom[au](a,ac),10)||0,b=parseInt(ao.Dom[au](a,aA),10)||0;if(am){if(ag.test(a[aq])){c=0;b=0}}d[0]+=b;d[1]+=c;return d}};var ab=ao.Dom[au];if(aE.opera){ao.Dom[au]=function(c,b){var a=ab(c,b);if(y.test(b)){a=ao.Dom.Color.toRGB(a)}return a}}if(aE.webkit){ao.Dom[au]=function(c,b){var a=ab(c,b);if(a==="rgba(0, 0, 0, 0)"){a="transparent"}return a}}})();YAHOO.util.Region=function(c,b,a,d){this.top=c;this.y=c;this[1]=c;this.right=b;this.bottom=a;this.left=d;this.x=d;this[0]=d;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(b){var d=Math.max(this.top,b.top),c=Math.min(this.right,b.right),a=Math.min(this.bottom,b.bottom),e=Math.max(this.left,b.left);if(a>=d&&c>=e){return new YAHOO.util.Region(d,c,a,e)}else{return null}};YAHOO.util.Region.prototype.union=function(b){var d=Math.min(this.top,b.top),c=Math.max(this.right,b.right),a=Math.max(this.bottom,b.bottom),e=Math.min(this.left,b.left);return new YAHOO.util.Region(d,c,a,e)};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(d){var b=YAHOO.util.Dom.getXY(d),e=b[1],c=b[0]+d.offsetWidth,a=b[1]+d.offsetHeight,f=b[0];return new YAHOO.util.Region(e,c,a,f)};YAHOO.util.Point=function(a,b){if(YAHOO.lang.isArray(a)){b=a[1];a=a[0]}YAHOO.util.Point.superclass.constructor.call(this,b,a,b,a)};YAHOO.extend(YAHOO.util.Point,YAHOO.util.Region);(function(){var v=YAHOO.util,w="clientTop",r="clientLeft",n="parentNode",m="right",a="hasLayout",o="px",c="opacity",l="auto",t="borderLeftWidth",q="borderTopWidth",h="borderRightWidth",b="borderBottomWidth",e="visible",g="transparent",j="height",s="width",p="style",d="currentStyle",f=/^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,k={get:function(A,y){var z="",x=A[d][y];if(y===c){z=v.Dom.getStyle(A,c)}else{if(!x||(x.indexOf&&x.indexOf(o)>-1)){z=x}else{if(v.Dom.IE_COMPUTED[y]){z=v.Dom.IE_COMPUTED[y](A,y)}else{if(i.test(x)){z=v.Dom.IE.ComputedStyle.getPixel(A,y)}else{z=x}}}}return z},getOffset:function(A,z){var x=A[d][z],E=z.charAt(0).toUpperCase()+z.substr(1),D="offset"+E,C="pixel"+E,y="",B;if(x==l){B=A[D];if(B===undefined){y=0}y=B;if(f.test(z)){A[p][z]=B;if(A[D]>B){y=B-(A[D]-B)}A[p][z]=l}}else{if(!A[p][C]&&!A[p][z]){A[p][z]=x}y=A[p][C]}return y+o},getBorderWidth:function(z,x){var y=null;if(!z[d][a]){z[p].zoom=1}switch(x){case q:y=z[w];break;case b:y=z.offsetHeight-z.clientHeight-z[w];break;case t:y=z[r];break;case h:y=z.offsetWidth-z.clientWidth-z[r];break}return y+o},getPixel:function(A,B){var y=null,x=A[d][m],z=A[d][B];A[p][m]=z;y=A[p].pixelRight;A[p][m]=x;return y+o},getMargin:function(y,z){var x;if(y[d][z]==l){x=0+o}else{x=v.Dom.IE.ComputedStyle.getPixel(y,z)}return x},getVisibility:function(y,z){var x;while((x=y[d])&&x[z]=="inherit"){y=y[n]}return(x)?x[z]:e},getColor:function(x,y){return v.Dom.Color.toRGB(x[d][y])||g},getBorderColor:function(z,A){var y=z[d],x=y[A]||y.color;return v.Dom.Color.toRGB(v.Dom.Color.toHex(x))}},u={};u.top=u.right=u.bottom=u.left=u[s]=u[j]=k.getOffset;u.color=k.getColor;u[q]=u[h]=u[b]=u[t]=k.getBorderWidth;u.marginTop=u.marginRight=u.marginBottom=u.marginLeft=k.getMargin;u.visibility=k.getVisibility;u.borderColor=u.borderTopColor=u.borderRightColor=u.borderBottomColor=u.borderLeftColor=k.getBorderColor;v.Dom.IE_COMPUTED=u;v.Dom.IE_ComputedStyle=k})();(function(){var c="toString",a=parseInt,d=RegExp,b=YAHOO.util;b.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(e){if(!b.Dom.Color.re_RGB.test(e)){e=b.Dom.Color.toHex(e)}if(b.Dom.Color.re_hex.exec(e)){e="rgb("+[a(d.$1,16),a(d.$2,16),a(d.$3,16)].join(", ")+")"}return e},toHex:function(e){e=b.Dom.Color.KEYWORDS[e]||e;if(b.Dom.Color.re_RGB.exec(e)){var f=(d.$1.length===1)?"0"+d.$1:Number(d.$1),g=(d.$2.length===1)?"0"+d.$2:Number(d.$2),h=(d.$3.length===1)?"0"+d.$3:Number(d.$3);e=[f[c](16),g[c](16),h[c](16)].join("")}if(e.length<6){e=e.replace(b.Dom.Color.re_hex3,"$1$1")}if(e!=="transparent"&&e.indexOf("#")<0){e="#"+e}return e.toLowerCase()}}}());YAHOO.register("dom",YAHOO.util.Dom,{version:"2.7.0",build:"1799"});YAHOO.util.CustomEvent=function(c,d,e,a){this.type=c;this.scope=d||window;this.silent=e;this.signature=a||YAHOO.util.CustomEvent.LIST;this.subscribers=[];if(!this.silent){}var b="_YUICEOnSubscribe";if(c!==b){this.subscribeEvent=new YAHOO.util.CustomEvent(b,this,true)}this.lastError=null};YAHOO.util.CustomEvent.LIST=0;YAHOO.util.CustomEvent.FLAT=1;YAHOO.util.CustomEvent.prototype={subscribe:function(a,c,b){if(!a){throw new Error("Invalid callback for subscriber to '"+this.type+"'")}if(this.subscribeEvent){this.subscribeEvent.fire(a,c,b)}this.subscribers.push(new YAHOO.util.Subscriber(a,c,b))},unsubscribe:function(d,b){if(!d){return this.unsubscribeAll()}var c=false;for(var f=0,a=this.subscribers.length;f<a;++f){var e=this.subscribers[f];if(e&&e.contains(d,b)){this._delete(f);c=true}}return c},fire:function(){this.lastError=null;var g=[],m=this.subscribers.length;if(!m&&this.silent){return true}var i=[].slice.call(arguments,0),k=true,a,h=false;if(!this.silent){}var b=this.subscribers.slice(),d=YAHOO.util.Event.throwErrors;for(a=0;a<m;++a){var e=b[a];if(!e){h=true}else{if(!this.silent){}var f=e.getScope(this.scope);if(this.signature==YAHOO.util.CustomEvent.FLAT){var c=null;if(i.length>0){c=i[0]}try{k=e.fn.call(f,c,e.obj)}catch(l){this.lastError=l;if(d){throw l}}}else{try{k=e.fn.call(f,this.type,i,e.obj)}catch(j){this.lastError=j;if(d){throw j}}}if(false===k){if(!this.silent){}break}}}return(k!==false)},unsubscribeAll:function(){var a=this.subscribers.length,b;for(b=a-1;b>-1;b--){this._delete(b)}this.subscribers=[];return a},_delete:function(a){var b=this.subscribers[a];if(b){delete b.fn;delete b.obj}this.subscribers.splice(a,1)},toString:function(){return"CustomEvent: '"+this.type+"', context: "+this.scope}};YAHOO.util.Subscriber=function(a,c,b){this.fn=a;this.obj=YAHOO.lang.isUndefined(c)?null:c;this.overrideContext=b};YAHOO.util.Subscriber.prototype.getScope=function(a){if(this.overrideContext){if(this.overrideContext===true){return this.obj}else{return this.overrideContext}}return a};YAHOO.util.Subscriber.prototype.contains=function(a,b){if(b){return(this.fn==a&&this.obj==b)}else{return(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 i=false;var h=[];var g=[];var j=[];var l=[];var b=0;var k=[];var c=[];var d=0;var a={63232:38,63233:40,63234:37,63235:39,63276:33,63277:34,25:9};var f=YAHOO.env.ua.ie?"focusin":"focus";var e=YAHOO.env.ua.ie?"focusout":"blur";return{POLL_RETRYS:2000,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 n=this;var m=function(){n._tryPreloadAttach()};this._interval=setInterval(m,this.POLL_INTERVAL)}},onAvailable:function(m,q,o,n,p){var s=(YAHOO.lang.isString(m))?[m]:m;for(var r=0;r<s.length;r=r+1){k.push({id:s[r],fn:q,obj:o,overrideContext:n,checkReady:p})}b=this.POLL_RETRYS;this.startInterval()},onContentReady:function(m,p,o,n){this.onAvailable(m,p,o,n,true)},onDOMReady:function(o,n,m){if(this.DOMReady){setTimeout(function(){var p=window;if(m){if(m===true){p=n}else{p=m}}o.call(p,"DOMReady",[],n)},0)}else{this.DOMReadyEvent.subscribe(o,n,m)}},_addListener:function(x,z,n,t,p,A){if(!n||!n.call){return false}if(this._isValidCollection(x)){var m=true;for(var s=0,q=x.length;s<q;++s){m=this.on(x[s],z,n,t,p)&&m}return m}else{if(YAHOO.lang.isString(x)){var u=this.getEl(x);if(u){x=u}else{this.onAvailable(x,function(){YAHOO.util.Event.on(x,z,n,t,p)});return true}}}if(!x){return false}if("unload"==z&&t!==this){g[g.length]=[x,z,n,t,p];return true}var y=x;if(p){if(p===true){y=t}else{y=p}}var w=function(C){return n.call(y,YAHOO.util.Event.getEvent(C,x),t)};var B=[x,z,n,w,y,t,p];var r=h.length;h[r]=B;if(this.useLegacyEvent(x,z)){var v=this.getLegacyIndex(x,z);if(v==-1||x!=j[v][0]){v=j.length;c[x.id+z]=v;j[v]=[x,z,x["on"+z]];l[v]=[];x["on"+z]=function(C){YAHOO.util.Event.fireLegacyEvent(YAHOO.util.Event.getEvent(C),v)}}l[v].push(B)}else{try{this._simpleAdd(x,z,w,A)}catch(o){this.lastError=o;this.removeListener(x,z,n);return false}}return true},addListener:function(p,m,q,o,n){return this._addListener(p,m,q,o,n,false)},addFocusListener:function(o,p,n,m){return this._addListener(o,f,p,n,m,true)},removeFocusListener:function(m,n){return this.removeListener(m,f,n)},addBlurListener:function(o,p,n,m){return this._addListener(o,e,p,n,m,true)},removeBlurListener:function(m,n){return this.removeListener(m,e,n)},fireLegacyEvent:function(q,s){var o=true,v,m,n,u,p;m=l[s].slice();for(var t=0,r=m.length;t<r;++t){n=m[t];if(n&&n[this.WFN]){u=n[this.ADJ_SCOPE];p=n[this.WFN].call(u,q);o=(o&&p)}}v=j[s];if(v&&v[2]){v[2](q)}return o},getLegacyIndex:function(n,m){var o=this.generateId(n)+m;if(typeof c[o]=="undefined"){return -1}else{return c[o]}},useLegacyEvent:function(n,m){return(this.webkit&&this.webkit<419&&("click"==m||"dblclick"==m))},removeListener:function(w,x,o){var t,q,m;if(typeof w=="string"){w=this.getEl(w)}else{if(this._isValidCollection(w)){var n=true;for(t=w.length-1;t>-1;t--){n=(this.removeListener(w[t],x,o)&&n)}return n}}if(!o||!o.call){return this.purgeElement(w,false,x)}if("unload"==x){for(t=g.length-1;t>-1;t--){m=g[t];if(m&&m[0]==w&&m[1]==x&&m[2]==o){g.splice(t,1);return true}}return false}var s=null;var r=arguments[3];if("undefined"===typeof r){r=this._getCacheIndex(w,x,o)}if(r>=0){s=h[r]}if(!w||!s){return false}if(this.useLegacyEvent(w,x)){var u=this.getLegacyIndex(w,x);var v=l[u];if(v){for(t=0,q=v.length;t<q;++t){m=v[t];if(m&&m[this.EL]==w&&m[this.TYPE]==x&&m[this.FN]==o){v.splice(t,1);break}}}}else{try{this._simpleRemove(w,x,s[this.WFN],false)}catch(p){this.lastError=p;return false}}delete h[r][this.WFN];delete h[r][this.FN];h.splice(r,1);return true},getTarget:function(m,n){var o=m.target||m.srcElement;return this.resolveTextNode(o)},resolveTextNode:function(m){try{if(m&&3==m.nodeType){return m.parentNode}}catch(n){}return m},getPageX:function(m){var n=m.pageX;if(!n&&0!==n){n=m.clientX||0;if(this.isIE){n+=this._getScrollLeft()}}return n},getPageY:function(n){var m=n.pageY;if(!m&&0!==m){m=n.clientY||0;if(this.isIE){m+=this._getScrollTop()}}return m},getXY:function(m){return[this.getPageX(m),this.getPageY(m)]},getRelatedTarget:function(m){var n=m.relatedTarget;if(!n){if(m.type=="mouseout"){n=m.toElement}else{if(m.type=="mouseover"){n=m.fromElement}}}return this.resolveTextNode(n)},getTime:function(m){if(!m.time){var n=new Date().getTime();try{m.time=n}catch(o){this.lastError=o;return n}}return m.time},stopEvent:function(m){this.stopPropagation(m);this.preventDefault(m)},stopPropagation:function(m){if(m.stopPropagation){m.stopPropagation()}else{m.cancelBubble=true}},preventDefault:function(m){if(m.preventDefault){m.preventDefault()}else{m.returnValue=false}},getEvent:function(n,p){var o=n||window.event;if(!o){var m=this.getEvent.caller;while(m){o=m.arguments[0];if(o&&Event==o.constructor){break}m=m.caller}}return o},getCharCode:function(m){var n=m.keyCode||m.charCode||0;if(YAHOO.env.ua.webkit&&(n in a)){n=a[n]}return n},_getCacheIndex:function(n,m,o){for(var p=0,q=h.length;p<q;p=p+1){var r=h[p];if(r&&r[this.FN]==o&&r[this.EL]==n&&r[this.TYPE]==m){return p}}return -1},generateId:function(n){var m=n.id;if(!m){m="yuievtautoid-"+d;++d;n.id=m}return m},_isValidCollection:function(m){try{return(m&&typeof m!=="string"&&m.length&&!m.tagName&&!m.alert&&typeof m[0]!=="undefined")}catch(n){return false}},elCache:{},getEl:function(m){return(typeof m==="string")?document.getElementById(m):m},clearCache:function(){},DOMReadyEvent:new YAHOO.util.CustomEvent("DOMReady",this),_load:function(m){if(!i){i=true;var n=YAHOO.util.Event;n._ready();n._tryPreloadAttach()}},_ready:function(m){var n=YAHOO.util.Event;if(!n.DOMReady){n.DOMReady=true;n.DOMReadyEvent.fire();n._simpleRemove(document,"DOMContentLoaded",n._ready)}},_tryPreloadAttach:function(){if(k.length===0){b=0;if(this._interval){clearInterval(this._interval);this._interval=null}return}if(this.locked){return}if(this.isIE){if(!this.DOMReady){this.startInterval();return}}this.locked=true;var n=!i;if(!n){n=(b>0&&k.length>0)}var o=[];var m=function(v,u){var w=v;if(u.overrideContext){if(u.overrideContext===true){w=u.obj}else{w=u.overrideContext}}u.fn.call(w,u.obj)};var s,t,p,q,r=[];for(s=0,t=k.length;s<t;s=s+1){p=k[s];if(p){q=this.getEl(p.id);if(q){if(p.checkReady){if(i||q.nextSibling||!n){r.push(p);k[s]=null}}else{m(q,p);k[s]=null}}else{o.push(p)}}}for(s=0,t=r.length;s<t;s=s+1){p=r[s];m(this.getEl(p.id),p)}b--;if(n){for(s=k.length-1;s>-1;s--){p=k[s];if(!p||!p.id){k.splice(s,1)}}this.startInterval()}else{if(this._interval){clearInterval(this._interval);this._interval=null}}this.locked=false},purgeElement:function(p,o,m){var r=(YAHOO.lang.isString(p))?this.getEl(p):p;var n=this.getListeners(r,m),q,t;if(n){for(q=n.length-1;q>-1;q--){var s=n[q];this.removeListener(r,s.type,s.fn)}}if(o&&r&&r.childNodes){for(q=0,t=r.childNodes.length;q<t;++q){this.purgeElement(r.childNodes[q],o,m)}}},getListeners:function(t,v){var q=[],u;if(!v){u=[h,g]}else{if(v==="unload"){u=[g]}else{u=[h]}}var o=(YAHOO.lang.isString(t))?this.getEl(t):t;for(var r=0;r<u.length;r=r+1){var m=u[r];if(m){for(var p=0,n=m.length;p<n;++p){var s=m[p];if(s&&s[this.EL]===o&&(!v||v===s[this.TYPE])){q.push({type:s[this.TYPE],fn:s[this.FN],obj:s[this.OBJ],adjust:s[this.OVERRIDE],scope:s[this.ADJ_SCOPE],index:p})}}}}return(q.length)?q:null},_unload:function(n){var t=YAHOO.util.Event,q,r,s,o,p,m=g.slice(),u;for(q=0,o=g.length;q<o;++q){s=m[q];if(s){u=window;if(s[t.ADJ_SCOPE]){if(s[t.ADJ_SCOPE]===true){u=s[t.UNLOAD_OBJ]}else{u=s[t.ADJ_SCOPE]}}s[t.FN].call(u,t.getEvent(n,s[t.EL]),s[t.UNLOAD_OBJ]);m[q]=null}}s=null;u=null;g=null;if(h){for(r=h.length-1;r>-1;r--){s=h[r];if(s){t.removeListener(s[t.EL],s[t.TYPE],s[t.FN],r)}}s=null}j=null;t._simpleRemove(window,"unload",t._unload)},_getScrollLeft:function(){return this._getScroll()[1]},_getScrollTop:function(){return this._getScroll()[0]},_getScroll:function(){var n=document.documentElement,m=document.body;if(n&&(n.scrollTop||n.scrollLeft)){return[n.scrollTop,n.scrollLeft]}else{if(m){return[m.scrollTop,m.scrollLeft]}else{return[0,0]}}},regCE:function(){},_simpleAdd:function(){if(window.addEventListener){return function(n,m,o,p){n.addEventListener(m,o,(p))}}else{if(window.attachEvent){return function(n,m,o,p){n.attachEvent("on"+m,o)}}else{return function(){}}}}(),_simpleRemove:function(){if(window.removeEventListener){return function(n,m,o,p){n.removeEventListener(m,o,(p))}}else{if(window.detachEvent){return function(n,m,o){n.detachEvent("on"+m,o)}}else{return 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 b=document.createElement("p");a._dri=setInterval(function(){try{b.doScroll("left");clearInterval(a._dri);a._dri=null;a._ready();b=null}catch(c){}},a.POLL_INTERVAL)}else{if(a.webkit&&a.webkit<525){a._dri=setInterval(function(){var c=document.readyState;if("loaded"==c||"complete"==c){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,e,b,c){this.__yui_events=this.__yui_events||{};var d=this.__yui_events[a];if(d){d.subscribe(e,b,c)}else{this.__yui_subscribers=this.__yui_subscribers||{};var f=this.__yui_subscribers;if(!f[a]){f[a]=[]}f[a].push({fn:e,obj:b,overrideContext:c})}},unsubscribe:function(f,d,b){this.__yui_events=this.__yui_events||{};var a=this.__yui_events;if(f){var c=a[f];if(c){return c.unsubscribe(d,b)}}else{var g=true;for(var e in a){if(YAHOO.lang.hasOwnProperty(a,e)){g=g&&a[e].unsubscribe(d,b)}}return g}return false},unsubscribeAll:function(a){return this.unsubscribe(a)},createEvent:function(g,a){this.__yui_events=this.__yui_events||{};var d=a||{};var e=this.__yui_events;if(e[g]){}else{var f=d.scope||this;var i=(d.silent);var c=new YAHOO.util.CustomEvent(g,f,i,YAHOO.util.CustomEvent.FLAT);e[g]=c;if(d.onSubscribeCallback){c.subscribeEvent.subscribe(d.onSubscribeCallback)}this.__yui_subscribers=this.__yui_subscribers||{};var h=this.__yui_subscribers[g];if(h){for(var b=0;b<h.length;++b){c.subscribe(h[b].fn,h[b].obj,h[b].overrideContext)}}}return e[g]},fireEvent:function(d,e,a,f){this.__yui_events=this.__yui_events||{};var b=this.__yui_events[d];if(!b){return null}var g=[];for(var c=1;c<arguments.length;++c){g.push(arguments[c])}return b.fire.apply(b,g)},hasEvent:function(a){if(this.__yui_events){if(this.__yui_events[a]){return true}}return false}};(function(){var a=YAHOO.util.Event,b=YAHOO.lang;YAHOO.util.KeyListener=function(i,d,h,g){if(!i){}else{if(!d){}else{if(!h){}}}if(!g){g=YAHOO.util.KeyListener.KEYDOWN}var f=new YAHOO.util.CustomEvent("keyPressed");this.enabledEvent=new YAHOO.util.CustomEvent("enabled");this.disabledEvent=new YAHOO.util.CustomEvent("disabled");if(b.isString(i)){i=document.getElementById(i)}if(b.isFunction(h)){f.subscribe(h)}else{f.subscribe(h.fn,h.scope,h.correctScope)}function e(m,n){if(!d.shift){d.shift=false}if(!d.alt){d.alt=false}if(!d.ctrl){d.ctrl=false}if(m.shiftKey==d.shift&&m.altKey==d.alt&&m.ctrlKey==d.ctrl){var l,o=d.keys,j;if(YAHOO.lang.isArray(o)){for(var k=0;k<o.length;k++){l=o[k];j=a.getCharCode(m);if(l==j){f.fire(j,m);break}}}else{j=a.getCharCode(m);if(o==j){f.fire(j,m)}}}}this.enable=function(){if(!this.enabled){a.on(i,g,e);this.enabledEvent.fire(d)}this.enabled=true};this.disable=function(){if(this.enabled){a.removeListener(i,g,e);this.disabledEvent.fire(d)}this.enabled=false};this.toString=function(){return"KeyListener ["+d.keys+"] "+i.tagName+(i.id?"["+i.id+"]":"")}};var c=YAHOO.util.KeyListener;c.KEYDOWN="keydown";c.KEYUP="keyup";c.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:"1799"});YAHOO.register("yahoo-dom-event",YAHOO,{version:"2.7.0",build:"1799"});(function(){var a=YAHOO.util;a.Selector={_foundCache:[],_regexCache:{},_re:{nth:/^(?:([-]?\d*)(n){1}|(odd|even)$)*([-+]?\d*)$/,attr:/(\[.*\])/g,urls:/^(?:href|src)/},document:window.document,attrAliases:{},shorthand:{"\\#(-?[_a-z]+[-\\w]*)":"[id=$1]","\\.(-?[_a-z]+[-\\w]*)":"[class~=$1]"},operators:{"=":function(c,b){return c===b},"!=":function(c,b){return c!==b},"~=":function(d,b){var c=" ";return(c+d+c).indexOf((c+b+c))>-1},"|=":function(c,b){return c===b||c.slice(0,b.length+1)===b+"-"},"^=":function(c,b){return c.indexOf(b)===0},"$=":function(c,b){return c.slice(-b.length)===b},"*=":function(c,b){return c.indexOf(b)>-1},"":function(c,b){return c}},pseudos:{root:function(b){return b===b.ownerDocument.documentElement},"nth-child":function(c,b){return a.Selector._getNth(c,b)},"nth-last-child":function(c,b){return a.Selector._getNth(c,b,null,true)},"nth-of-type":function(c,b){return a.Selector._getNth(c,b,c.tagName)},"nth-last-of-type":function(c,b){return a.Selector._getNth(c,b,c.tagName,true)},"first-child":function(b){return a.Selector._getChildren(b.parentNode)[0]===b},"last-child":function(b){var c=a.Selector._getChildren(b.parentNode);return c[c.length-1]===b},"first-of-type":function(c,b){return a.Selector._getChildren(c.parentNode,c.tagName)[0]},"last-of-type":function(c,b){var d=a.Selector._getChildren(c.parentNode,c.tagName);return d[d.length-1]},"only-child":function(b){var c=a.Selector._getChildren(b.parentNode);return c.length===1&&c[0]===b},"only-of-type":function(b){return a.Selector._getChildren(b.parentNode,b.tagName).length===1},empty:function(b){return b.childNodes.length===0},not:function(c,b){return !a.Selector.test(c,b)},contains:function(d,b){var c=d.innerText||d.textContent||"";return c.indexOf(b)>-1},checked:function(b){return b.checked===true}},test:function(b,d){b=a.Selector.document.getElementById(b)||b;if(!b){return false}var e=d?d.split(","):[];if(e.length){for(var c=0,f=e.length;c<f;++c){if(a.Selector._test(b,e[c])){return true}}return false}return a.Selector._test(b,d)},_test:function(b,i,j,k){j=j||a.Selector._tokenize(i).pop()||{};if(!b.tagName||(j.tag!=="*"&&b.tagName!==j.tag)||(k&&b._found)){return false}if(j.attributes.length){var d,h,c=a.Selector._re.urls;if(!b.attributes||!b.attributes.length){return false}for(var g=0,e;e=j.attributes[g++];){h=(c.test(e[0]))?2:0;d=b.getAttribute(e[0],h);if(d===null||d===undefined){return false}if(a.Selector.operators[e[1]]&&!a.Selector.operators[e[1]](d,e[2])){return false}}}if(j.pseudos.length){for(var g=0,f=j.pseudos.length;g<f;++g){if(a.Selector.pseudos[j.pseudos[g][0]]&&!a.Selector.pseudos[j.pseudos[g][0]](b,j.pseudos[g][1])){return false}}}return(j.previous&&j.previous.combinator!==",")?a.Selector._combinators[j.previous.combinator](b,j):true},filter:function(e,f){e=e||[];var c,g=[],b=a.Selector._tokenize(f);if(!e.item){for(var d=0,h=e.length;d<h;++d){if(!e[d].tagName){c=a.Selector.document.getElementById(e[d]);if(c){e[d]=c}else{}}}}g=a.Selector._filter(e,a.Selector._tokenize(f)[0]);return g},_filter:function(f,d,c,g){var h=c?null:[],b=a.Selector._foundCache;for(var e=0,i=f.length;e<i;e++){if(!a.Selector._test(f[e],"",d,g)){continue}if(c){return f[e]}if(g){if(f[e]._found){continue}f[e]._found=true;b[b.length]=f[e]}h[h.length]=f[e]}return h},query:function(d,c,b){var e=a.Selector._query(d,c,b);return e},_query:function(m,h,g,o){var e=(g)?null:[],p;if(!m){return e}var b=m.split(",");if(b.length>1){var f;for(var l=0,k=b.length;l<k;++l){f=arguments.callee(b[l],h,g,true);e=g?f:e.concat(f)}a.Selector._clearFoundCache();return e}if(h&&!h.nodeName){h=a.Selector.document.getElementById(h);if(!h){return e}}h=h||a.Selector.document;if(h.nodeName!=="#document"){a.Dom.generateId(h);m=h.tagName+"#"+h.id+" "+m;p=h;h=h.ownerDocument}var i=a.Selector._tokenize(m);var j=i[a.Selector._getIdTokenIndex(i)],d=[],c,n=i.pop()||{};if(j){c=a.Selector._getId(j.attributes)}if(c){p=p||a.Selector.document.getElementById(c);if(p&&(h.nodeName==="#document"||a.Dom.isAncestor(h,p))){if(a.Selector._test(p,null,j)){if(j===n){d=[p]}else{if(j.combinator===" "||j.combinator===">"){h=p}}}}else{return e}}if(h&&!d.length){d=h.getElementsByTagName(n.tag)}if(d.length){e=a.Selector._filter(d,n,g,o)}return e},_clearFoundCache:function(){var b=a.Selector._foundCache;for(var d=0,e=b.length;d<e;++d){try{delete b[d]._found}catch(c){b[d].removeAttribute("_found")}}b=[]},_getRegExp:function(b,d){var c=a.Selector._regexCache;d=d||"";if(!c[b+d]){c[b+d]=new RegExp(b,d)}return c[b+d]},_getChildren:function(){if(document.documentElement.children){return function(b,c){return(c)?b.children.tags(c):b.children||[]}}else{return function(c,f){if(c._children){return c._children}var d=[],b=c.childNodes;for(var e=0,g=b.length;e<g;++e){if(b[e].tagName){if(!f||b[e].tagName===f){d[d.length]=b[e]}}}c._children=d;return d}}}(),_combinators:{" ":function(b,c){while((b=b.parentNode)){if(a.Selector._test(b,"",c.previous)){return true}}return false},">":function(b,c){return a.Selector._test(b.parentNode,null,c.previous)},"+":function(b,c){var d=b.previousSibling;while(d&&d.nodeType!==1){d=d.previousSibling}if(d&&a.Selector._test(d,null,c.previous)){return true}return false},"~":function(b,c){var d=b.previousSibling;while(d){if(d.nodeType===1&&a.Selector._test(d,null,c.previous)){return true}d=d.previousSibling}return false}},_getNth:function(c,g,e,l){a.Selector._re.nth.test(g);var h=parseInt(RegExp.$1,10),d=RegExp.$2,k=RegExp.$3,j=parseInt(RegExp.$4,10)||0,f=[],n;var i=a.Selector._getChildren(c.parentNode,e);if(k){h=2;n="+";d="n";j=(k==="odd")?1:0}else{if(isNaN(h)){h=(d)?1:0}}if(h===0){if(l){j=i.length-j+1}if(i[j-1]===c){return true}else{return false}}else{if(h<0){l=!!l;h=Math.abs(h)}}if(!l){for(var b=j-1,m=i.length;b<m;b+=h){if(b>=0&&i[b]===c){return true}}}else{for(var b=i.length-j,m=i.length;b>=0;b-=h){if(b<m&&i[b]===c){return true}}}return false},_getId:function(c){for(var b=0,d=c.length;b<d;++b){if(c[b][0]=="id"&&c[b][1]==="="){return c[b][2]}}},_getIdTokenIndex:function(b){for(var c=0,d=b.length;c<d;++c){if(a.Selector._getId(b[c].attributes)){return c}}return -1},_patterns:{tag:/^((?:-?[_a-z]+[\w-]*)|\*)/i,attributes:/^\[([a-z]+\w*)+([~\|\^\$\*!=]=?)?['"]?([^\]]*?)['"]?\]/i,pseudos:/^:([-\w]+)(?:\(['"]?(.+)['"]?\))*/i,combinator:/^\s*([>+~]|\s)\s*/},_tokenize:function(i){var g={},c=[],b,d=false,e=a.Selector._patterns,h;i=a.Selector._replaceShorthand(i);do{d=false;for(var f in e){if(YAHOO.lang.hasOwnProperty(e,f)){if(f!="tag"&&f!="combinator"){g[f]=g[f]||[]}if((h=e[f].exec(i))){d=true;if(f!="tag"&&f!="combinator"){if(f==="attributes"&&h[1]==="id"){g.id=h[3]}g[f].push(h.slice(1))}else{g[f]=h[1]}i=i.replace(h[0],"");if(f==="combinator"||!i.length){g.attributes=a.Selector._fixAttributes(g.attributes);g.pseudos=g.pseudos||[];g.tag=g.tag?g.tag.toUpperCase():"*";c.push(g);g={previous:g}}}}}}while(d);return c},_fixAttributes:function(d){var c=a.Selector.attrAliases;d=d||[];for(var b=0,e=d.length;b<e;++b){if(c[d[b][0]]){d[b][0]=c[d[b][0]]}if(!d[b][1]){d[b][1]=""}}return d},_replaceShorthand:function(f){var e=a.Selector.shorthand;var d=f.match(a.Selector._re.attr);if(d){f=f.replace(a.Selector._re.attr,"REPLACED_ATTRIBUTE")}for(var b in e){if(YAHOO.lang.hasOwnProperty(e,b)){f=f.replace(a.Selector._getRegExp(b,"gi"),e[b])}}if(d){for(var c=0,g=d.length;c<g;++c){f=f.replace("REPLACED_ATTRIBUTE",d[c])}}return f}};if(YAHOO.env.ua.ie&&YAHOO.env.ua.ie<8){a.Selector.attrAliases["class"]="className";a.Selector.attrAliases["for"]="htmlFor"}})();YAHOO.register("selector",YAHOO.util.Selector,{version:"2.7.0",build:"1799"});var $Y=YAHOO.util,$D=$Y.Dom,$E=$Y.Event,$$=$Y.Selector.query,$=$D.get,FD=YAHOO.namespace("FD");var FYU=YAHOO.util,FYD=$Y.Dom,FYE=$Y.Event,FYS=$Y.Selector.query,FYG=$D.get;FD.namespace=function(){var a=Array.prototype.slice.call(arguments,0),b;for(b=0;b<a.length;++b){if(a[b].indexOf("FD")!=0){a[b]="FD."+a[b]}}return YAHOO.namespace.apply(null,a)};FD.namespace("core","util","widget");if(!Array.prototype.indexOf){Array.prototype.indexOf=function(c,b){if(b==null){b=0}else{if(b<0){b=Math.max(0,this.length+b)}}for(var a=b;a<this.length;a++){if(this[a]===c){return a}}return -1}}if(!Array.prototype.lastIndexOf){Array.prototype.lastIndexOf=function(c,b){if(b==null){b=this.length-1}else{if(b<0){b=Math.max(0,this.length+b)}}for(var a=b;a>=0;a--){if(this[a]===c){return a}}return -1}}if(!Array.prototype.forEach){Array.prototype.forEach=function(c,d){var a=this.length;for(var b=0;b<a;b++){c.call(d,this[b],b,this)}}}if(!Array.prototype.filter){Array.prototype.filter=function(d,e){var a=this.length;var c=[];for(var b=0;b<a;b++){if(d.call(e,this[b],b,this)){c.push(this[b])}}return c}}if(!Array.prototype.map){Array.prototype.map=function(d,e){var a=this.length;var c=[];for(var b=0;b<a;b++){c.push(d.call(e,this[b],b,this))}return c}}if(!Array.prototype.some){Array.prototype.some=function(c,d){var a=this.length;for(var b=0;b<a;b++){if(c.call(d,this[b],b,this)){return true}}return false}}if(!Array.prototype.every){Array.prototype.every=function(c,d){var a=this.length;for(var b=0;b<a;b++){if(!c.call(d,this[b],b,this)){return false}}return true}}Array.prototype.contains=function(a){return this.indexOf(a)!=-1};Array.prototype.copy=function(a){return this.concat()};Array.prototype.insertAt=function(b,a){this.splice(a,0,b)};Array.prototype.insertBefore=function(c,b){var a=this.indexOf(b);if(a==-1){this.push(c)}else{this.splice(a,0,c)}};Array.prototype.removeAt=function(a){this.splice(a,1)};Array.prototype.remove=function(b){var a=this.indexOf(b);if(a!=-1){this.splice(a,1)}};Array.prototype.del=function(a){if(a<0){return this}return this.slice(0,a).concat(this.slice(a+1,this.length))};if(!String.prototype.toQueryParams){String.prototype.toQueryParams=function(){var f={};var g=this.split("&");var d=/([^=]*)=(.*)/;for(var b=0;b<g.length;b++){var a=d.exec(g[b]);if(!a){continue}var c=decodeURIComponent(a[1]);var e=a[2]?decodeURIComponent(a[2]):undefined;if(f[c]!==undefined){if(f[c].constructor!=Array){f[c]=[f[c]]}if(e){f[c].push(e)}}else{f[c]=e}}return f}}if(!String.prototype.trim){String.prototype.trim=function(){var a=/(^[\u3000\s]+)|([\u3000\s]+$)/g;return function(){return this.replace(a,"")}}()}if(!String.prototype.replaceAll){String.prototype.replaceAll=function(b,a){return this.replace(new RegExp(b,"gm"),a)}}if(!String.prototype.lenB){String.prototype.lenB=function(){return this.replace(/[^\x00-\xff]/g,"**").length}}if(!String.prototype.cut){String.prototype.cut=function(a){var e=this;if(e=="undefined"){return""}var b=0;a=parseInt(a);if(e.lenB()<=a){return e}for(var c=0;c<e.length;c++){var d=e.charCodeAt(c);if(d<0||d>255){b+=2}else{b++}if(b>a){return e.substr(0,c==0?c=1:c)}}return""}}FD.common={trim:function(a){return a.replace(/(^\s*)|(\s*$)/g,"")},escapeHTML:function(b){var c=document.createElement("div");var a=document.createTextNode(b);c.appendChild(a);return c.innerHTML},unescapeHTML:function(a){var b=document.createElement("div");b.innerHTML=a.replace(/<\/?[^>]+>/gi,"");return b.childNodes[0]?b.childNodes[0].nodeValue:""},stripTags:function(a){return a.replace(/<\/?[^>]+>/gi,"")},toArray:function(b,d){var c=[];for(var a=d||0;a<b.length;a++){c[c.length]=b[a]}return c},applyIf:function(c,a){if(c&&a&&typeof a=="object"){for(var b in a){if(!YAHOO.lang.hasOwnProperty(c,b)){c[b]=a[b]}}}return c},apply:function(c,a){if(c&&a&&typeof a=="object"){for(var b in a){c[b]=a[b]}}return c},goTo:function(e){var d=document.createElement("a"),c="_blank",f=document.body,g=arguments[1]==c?c:"_self";if(!d.click){return window.open(e,g)}d.setAttribute("target",g);d.setAttribute("href",e);d.style.display="none";if(!f){return}f.appendChild(d);d.click();if(g==c){setTimeout(function(){try{f.removeChild(d)}catch(a){}},500)}},concat:function(){var d=arguments;var a=[],b,f;outer:for(var e=0,b=d.length;e<b;e++){inner:for(var c=0,f=d[e].length;c<f;c++){a.push(d[e][c])}}return a},getFormAction:function(a){a=FYG(a);if(a&&a.tagName.toLowerCase()=="form"){return a.attributes.getNamedItem("action").value}return null},formSerialize:function(a,c,b){a=FYG(a);b=b||"&";var k="";if(a&&a.tagName.toLowerCase()=="form"){var h=a.getElementsByTagName("input");var d=a.getElementsByTagName("select");var l=a.getElementsByTagName("textarea");h=FD.common.concat(h,d,l);var g=h.length;while(g-->0){var f=h[g].name+"="+encodeURIComponent(h[g].value);if(k==""){k+=f}else{k+=b+f}}}if(YAHOO.lang.isObject(c)){for(var j in c){var f=j+"="+encodeURIComponent(c[j]);if(k==""){k+=f}else{k+=b+f}}}return k},parse:function(str){var jsn;try{jsn=YAHOO.lang.JSON.parse(str)}catch(x){try{eval("jsn = "+str)}catch(e){}}return jsn}};FD.version="0.6.2009-5-5";
/*
Copyright (c) 2009, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.7.0
*/
YAHOO.util.Get=function(){var M={},L=0,R=0,E=false,N=YAHOO.env.ua,S=YAHOO.lang;var J=function(W,T,X){var U=X||window,Y=U.document,Z=Y.createElement(W);for(var V in T){if(T[V]&&YAHOO.lang.hasOwnProperty(T,V)){Z.setAttribute(V,T[V]);}}return Z;};var I=function(T,U,W){var V=W||"utf-8";return J("link",{"id":"yui__dyn_"+(R++),"type":"text/css","charset":V,"rel":"stylesheet","href":T},U);};var P=function(T,U,W){var V=W||"utf-8";return J("script",{"id":"yui__dyn_"+(R++),"type":"text/javascript","charset":V,"src":T},U);};var A=function(T,U){return{tId:T.tId,win:T.win,data:T.data,nodes:T.nodes,msg:U,purge:function(){D(this.tId);}};};var B=function(T,W){var U=M[W],V=(S.isString(T))?U.win.document.getElementById(T):T;if(!V){Q(W,"target node not found: "+T);}return V;};var Q=function(W,V){var T=M[W];if(T.onFailure){var U=T.scope||T.win;T.onFailure.call(U,A(T,V));}};var C=function(W){var T=M[W];T.finished=true;if(T.aborted){var V="transaction "+W+" was aborted";Q(W,V);return;}if(T.onSuccess){var U=T.scope||T.win;T.onSuccess.call(U,A(T));}};var O=function(V){var T=M[V];if(T.onTimeout){var U=T.scope||T;T.onTimeout.call(U,A(T));}};var G=function(V,Z){var U=M[V];if(U.timer){U.timer.cancel();}if(U.aborted){var X="transaction "+V+" was aborted";Q(V,X);return;}if(Z){U.url.shift();if(U.varName){U.varName.shift();}}else{U.url=(S.isString(U.url))?[U.url]:U.url;if(U.varName){U.varName=(S.isString(U.varName))?[U.varName]:U.varName;}}var c=U.win,b=c.document,a=b.getElementsByTagName("head")[0],W;if(U.url.length===0){if(U.type==="script"&&N.webkit&&N.webkit<420&&!U.finalpass&&!U.varName){var Y=P(null,U.win,U.charset);Y.innerHTML='YAHOO.util.Get._finalize("'+V+'");';U.nodes.push(Y);a.appendChild(Y);}else{C(V);}return;}var T=U.url[0];if(!T){U.url.shift();return G(V);}if(U.timeout){U.timer=S.later(U.timeout,U,O,V);}if(U.type==="script"){W=P(T,c,U.charset);}else{W=I(T,c,U.charset);}F(U.type,W,V,T,c,U.url.length);U.nodes.push(W);if(U.insertBefore){var e=B(U.insertBefore,V);if(e){e.parentNode.insertBefore(W,e);}}else{a.appendChild(W);}if((N.webkit||N.gecko)&&U.type==="css"){G(V,T);}};var K=function(){if(E){return;}E=true;for(var T in M){var U=M[T];if(U.autopurge&&U.finished){D(U.tId);delete M[T];}}E=false;};var D=function(a){var X=M[a];if(X){var Z=X.nodes,T=Z.length,Y=X.win.document,W=Y.getElementsByTagName("head")[0];if(X.insertBefore){var V=B(X.insertBefore,a);if(V){W=V.parentNode;}}for(var U=0;U<T;U=U+1){W.removeChild(Z[U]);}X.nodes=[];}};var H=function(U,T,V){var X="q"+(L++);V=V||{};if(L%YAHOO.util.Get.PURGE_THRESH===0){K();}M[X]=S.merge(V,{tId:X,type:U,url:T,finished:false,aborted:false,nodes:[]});var W=M[X];W.win=W.win||window;W.scope=W.scope||W.win;W.autopurge=("autopurge" in W)?W.autopurge:(U==="script")?true:false;S.later(0,W,G,X);return{tId:X};};var F=function(c,X,W,U,Y,Z,b){var a=b||G;if(N.ie){X.onreadystatechange=function(){var d=this.readyState;if("loaded"===d||"complete"===d){X.onreadystatechange=null;a(W,U);}};}else{if(N.webkit){if(c==="script"){if(N.webkit>=420){X.addEventListener("load",function(){a(W,U);});}else{var T=M[W];if(T.varName){var V=YAHOO.util.Get.POLL_FREQ;T.maxattempts=YAHOO.util.Get.TIMEOUT/V;T.attempts=0;T._cache=T.varName[0].split(".");T.timer=S.later(V,T,function(j){var f=this._cache,e=f.length,d=this.win,g;for(g=0;g<e;g=g+1){d=d[f[g]];if(!d){this.attempts++;if(this.attempts++>this.maxattempts){var h="Over retry limit, giving up";T.timer.cancel();Q(W,h);}else{}return;}}T.timer.cancel();a(W,U);},null,true);}else{S.later(YAHOO.util.Get.POLL_FREQ,null,a,[W,U]);}}}}else{X.onload=function(){a(W,U);};}}};return{POLL_FREQ:10,PURGE_THRESH:20,TIMEOUT:2000,_finalize:function(T){S.later(0,null,C,T);},abort:function(U){var V=(S.isString(U))?U:U.tId;var T=M[V];if(T){T.aborted=true;}},script:function(T,U){return H("script",T,U);},css:function(T,U){return H("css",T,U);}};}();YAHOO.register("get",YAHOO.util.Get,{version:"2.7.0",build:"1799"});
/// <reference path="../../core/fdev.js" />
/*
* @fileoverview 该文件封装了Alitalk初始化功能，构建一个组群实例方法为：FD.widget.Alitalk(...)，组件需要用到online这个全局变量，谨防冲突。
* @author Denis<danxia.shidx@alibaba-inc.com>
* @link http://page.china.alibaba.com/shtml/alitalk/alitalk-demo.html
* @version 2.0.1
*/
var online=null;
(function(w) {
/*
* 实例化Alitalk的入口.
* @param {HTMLElement|Array} Dom单一元素或元素组
* @param {object} opts 配置参数
*/
var Alitalk=function(els,opts) {
this.init(els,opts);
},
//是否为IE浏览器
isIE=!!(YAHOO.env.ua.ie),
//保存贸易通版本号，目前为5或6
version,
//是否安装贸易通或阿里旺旺
isInstalled=(function() {
var vers={
'aliimx.wangwangx': 6,
'Ali_Check.InfoCheck': 5
};
for(var p in vers) {
try {
new ActiveXObject(p)
version=vers[p];
return true;
} catch(e) { }
}
version=0;
return false;
})(),
//弹出阿里旺旺下载页
getAlitalk=function() {
window.open('http://alitalk.alibaba.com.cn/index.html','_blank');
},
//自动登陆
autoLogin=function(id) {
if(version==5) {
location.href='alitalk:'
} else {
id=id?'?uid='+id:'';
window.location.href='aliim:login'+id;
}
},
//默认配置
defaults={
type: 2,
//数组对应的类型依次为自定义、按钮和图标
cls: [{},{ base: 'btnAlitalk',on: 'btn-on',off: 'btn-off',mb: 'btn-mb' },{ base: 'iconAlitalk',on: 'icon-on',off: 'icon-off',mb: 'icon-mb'}],
siteID: 'cnalichn',
//是否请求用户在线状态
remote: true,
//实例化过程中是否开启自动登陆
autoLogin: false,
prop: ''
},
//回调函数
success=function(ali) {
for(var i=0;i<ali.els.length;i++) {
if(ali.els[i].opt.remote) { //对没有指定remote为false的判断在线状态并加上相应样式
ali.els[i].online=online[i]; //把在线状态保存到元素属性以便于后期调用
$D.addClass(ali.els[i],ali.els[i].opt.cls[ali.els[i].opt.type].base); //上基样式
switch(online[i]) {
case 0:
case 2:
case 6:
default: //不在线
$D.addClass(ali.els[i],ali.els[i].opt.cls[ali.els[i].opt.type].off);
break;
case 1: //在线
$D.addClass(ali.els[i],ali.els[i].opt.cls[ali.els[i].opt.type].on);
break;
case 4:
case 5: //手机在线
$D.addClass(ali.els[i],ali.els[i].opt.cls[ali.els[i].opt.type].mb);
break;
}
}
}
//重置
online=null;
};
Alitalk.prototype={
/*
* 实例化Alitalk的入口. 这是组件实例唯一暴露在外的方法
* @param {HTMLElement|Array} Dom单一对象或对象组
* @param {object} opts 配置参数
*/
init: function(els,opts) {
//防止多次调用online冲突
if(online!=null) {
setTimeout(function() { new w.Alitalk(els,opts); },Math.random()*1000+1000);
return;
} else {
this.opts=FD.common.applyIf(opts||{},defaults);
if(this.opts.remote) online=[];
}
if(els.nodeType) els=[els];
if(!els.length) return;
this.els=els;
var ids='',that=this;
for(var i=0;i<els.length;i++) {
var o=FD.common.applyIf(eval('('+($D.getAttribute(els[i],'alitalk')||'{}')+')'),this.opts);
if(!o.id||!YAHOO.lang.trim(o.id)) {
els.splice(i,1);
i--;
} else {
els[i].opt=o;
ids+=o.id+';';
}
}
//给按钮注册点击事件
$E.addListener(els,'click',function(e) {
$E.preventDefault(e);
//非ie浏览器不支持
if(!isIE) return;
//静态模式下 设置默认状态为在线
if(!that.opts.remote) this.online=1;
//还没有获取到状态
if(this.online==null) return;
//解析用户id
var userID=eval('('+($D.getAttribute(this,'alitalk')||'{}')+')').id;
switch(version) {
case 0:
default:
getAlitalk(); //下载阿里旺旺
break;
case 5:
window.location='Alitalk:Send'+(this.online==4?'Sms':'IM')+'?'+userID+'&siteid='+that.opts.siteID+'&status='+this.online+that.opts.prop;
break;
case 6:
if(this.online==4) window.location='aliim:smssendmsg?touid=cnalichn'+userID+that.opts.prop;
else window.location='aliim:sendmsg?touid=cnalichn'+userID+'&siteid='+that.opts.siteID+'&status='+this.online+that.opts.prop;
break;
}
});
//从阿里软件获取在线状态
if(this.opts.remote)
YAHOO.util.Get.script('http://amos.im.alisoft.com/muliuserstatus.aw?uids='+ids+'&site='+that.opts.siteID,{ charset: 'gb2312',onSuccess: function() { success(that); },onFailure: function() { online=null; },onTimeout: function() { online=null; } });
//自动登录
if(isIE&&this.opts.autoLogin)
autoLogin();
}
};
/*
* 静态变量及方法
*/
w.Alitalk=Alitalk;
/*
* Alitalk客户端版本
*/
w.Alitalk.version=version;
/*
* 客户端是否安装了Alitalk
*/
w.Alitalk.isInstalled=isInstalled;
/*
* 弹出alitalk下载页面
*/
w.Alitalk.getAlitalk=getAlitalk;
/*
* 自动启动alitalk客户端软件
*/
w.Alitalk.autoLogin=autoLogin;
})(FD.widget);
FD.Ali={checkAliTalk:function(){if(!YAHOO.env.ua.ie){return false}try{var B=new ActiveXObject("Ali_Check.InfoCheck")}catch(C){return false}try{var A=new ActiveXObject("aliimx.wangwangx")}catch(C){return false}return true},checkAliTool:function(){if(!YAHOO.env.ua.ie){return false}try{var A=new ActiveXObject("YAliALive.Live")}catch(B){return false}return true}};
/**
* @author search-engineer
* @version 2009-01-19
* 以下这些函数是由工程师写的函数，需遵循一定的命名规则
* 命名规则如下:
* <pre>
* S(表示search)_产品线+展示方式（共有的用P,public的缩写）_功能描述
* I、产品:命名规则如下:
* 		供应offer(列表)   S_S(sale)L(列表)_ 功能描述(eg:S_SL_getOfferName)
* 		供应offer(图文)   F_ST_功能描述(eg:S_ST_getOfferType)
* 		供应offer(橱窗)   F_SW_功能描述(eg:S_SW_getWindowID)
* 		注:如果是这个函数或者变量同时被上面三种情况公用，则命名如下:
* 		S_P_功能描述
*
* II、买家:对应的命名规则如下:
* 		买家列表: S_B(buy)L(列表)_ 功能描述(eg:S_BL_getBuyerName)
* 		买家图文: S_B(buy)T(图文)_ 功能描述(eg:S_BT_getBuyerID)
*
* III、公司:对应的命名规则如下
* 		公司列表:S_COMP_功能描述(eg:S_COMP_getCompanyName)
*
*
* Js函数根下的变量规则：（避免混淆）
* S(表示search)_产品线+展示方式（共有的用P,public的缩写）_ 变量描述
* </pre>
*
*/
/**
* 展示伪类目
* @method showul
* @param {String} ulId
* @param {String} liclsname
* @param{Boolean} showmorename
* @static
*
*/
function showul(ulId,liclsname,showmorename){
var showmore = document.getElementById(showmorename);
var disp = "none";
if(showmore){
if(showmore.className == "showmore"){
showmore.innerHTML = "<a href=javascript:showul('"+ulId+"','more','"+showmorename+"')>&lt;&lt;精简显示</a>";
showmore.className = "showless";
disp = "block";
}else{
showmore.innerHTML = "<a href=javascript:showul('"+ulId+"','more','"+showmorename+"')>显示更多&gt;&gt;</a>";
showmore.className = "showmore";
disp = "none";
}
}
var e = document.getElementById(ulId);
if(e){
for (var j = 0; j < e.childNodes.length; j++) {
var child = e.childNodes.item(j);
if (child && (child.nodeName.toLowerCase() == 'li') && child.className && child.className == liclsname)child.style.display=disp;
}
}
}
/**
* 侵权投诉
* @method doLaegal
* @param {String} userId
* @param {String} url
* @static
*/
function doLegal(userId,url){
var count = 0;
var ids = "";
var obj = document.batchForm.elements;
for(var i = 0;i < obj.length;i++){
if(obj[i].id.indexOf('compareBox') != -1){
if(obj[i].checked){
count++;
if(ids == ""){
ids = obj[i].name;
}else{
ids = ids + ","+obj[i].name;
}
}
}
}
if(count < 1){
alert("请至少选择1条信息进行投诉!");
return false;
}else if(count > 100){
alert("您已经选择了"+count+"条供应信息,候选供应信息不能超过50条");
return false;
}
url = url + "?offer_ids="+ids+"&user_id="+userId;
var inside_cooperate = window.open(url,"_inside_cooperate_legal");
inside_cooperate.focus();
}
/**
* @method actCheckbox
* @param {String} sign
* @param {String} keywords
* @static
*/
function actCheckbox(sign,keywords){
var count = 0;
var ids = "";
var obj = document.batchForm.elements;
for(var i = 0;i < obj.length;i++){
if(obj[i].id.indexOf('compareBox') != -1){
if(obj[i].checked){
count++;
if(ids == ""){
ids = obj[i].name;
}else{
ids = ids + ","+obj[i].name;
}
}
}
}
if(count < 1){
alert("请至少选择1条信息进行询价!");
return false;
}else if(count > 5){
alert("您已经选择了"+count+"条供应信息,候选供应信息不能超过5条");
return false;
}
var url = "";
if(sign == "inc"){
url = "http://redirect.china.alibaba.com/gateway/10023"+"?offer_ids="+ids+"&keywords="+keywords+"&tracelog=saleofferlist_feedbacks";
}else if(sign == "noimg"){
url = "http://redirect.china.alibaba.com/gateway/10023"+"?offer_ids="+ids+"&keywords="+keywords+"&tracelog=saleofferlist_feedbacks_nopic";
}
FD.common.goTo(url,'_blank');
//window.open(url);
}
/**
* 鹦鹉项目-询价留言及贸易通点击的反馈打点跟踪
* @method doParrotTrace
* @param {HTMLElement} logElem
* @param {String} logString
*/
function doParrotTrace(logElem, logString) {
var logURL = "http://stat.china.alibaba.com/feedback/click.html";
var d = new Date();
var cosite = "";
try{ cosite = document.cookie.match(/track_cookie[^;]*cosite=(\w+)/)[1]; }catch(e){}
logURL =logURL + logString + "&fromsite=" + cosite;
if(document.images) {
(new Image()).src=logURL + "&time=" + d.getTime();
}
}
/**
* @method doBatchParrotTrace
* @param {HTMLElement} logElem
* @param {String} logString
* @static
*/
function doBatchParrotTrace(logElem, logString) {
var logURL = "http://stat.china.alibaba.com/feedback/click.html";
var d = new Date();
var obj = document.batchForm.elements;
var cosite = "";
try{
try{ cosite = document.cookie.match(/track_cookie[^;]*cosite=(\w+)/)[1]; }catch(e){}
tmpLogURL =logURL + logString + "&fromsite=" + cosite;
for(var i = 0;i < obj.length;i++){
if(obj[i].id.indexOf('compareBox') != -1){
if(obj[i].checked){
logURL = tmpLogURL + "&toid=" + obj[i].getAttribute("memberId");
if(document.images) {
(new Image()).src=logURL + "&time=" + d.getTime();
}
}
}
}
} catch(e) {}
}
/**
* 获取cookie
* @param {String} name
* @static
*/
function getCookie(name) {
var arg = name + "=";
var alen = arg.length;
var clen = document.cookie.length;
var i=0;
while(i<clen) {
var j=i+alen;
if (document.cookie.substring(i, j) == arg) {
return www_helpor_net(j);
}
i=document.cookie.indexOf(" ",i)+1;if(i==0)
break;
}
return null;
}
/**
* @method www_helpor_net
* @param {Object} offset
* @static
*/
function www_helpor_net(offset) {
var endstr=document.cookie.indexOf(";",offset);
if (endstr == -1) {
endstr = document.cookie.length;
}
return unescape(document.cookie.substring(offset,endstr));
}
var cookieName = "offerId";
var domainName = ".alibaba.com";
var prefix = "";
var defaultClassName = "offer";
var checkedClassName = "offer_select";
var categoryId = 0;
var inside_cooperate_id = false;
var tempCount = 0;
var url;
//初始化cookie中的offerId
function initOfferId(){
var c = getCookie("categoryId");
if (c == null || c == "null" ){
addCookie("categoryId",categoryId);
if (categoryId !=null && categoryId!=""){
clearCookie(cookieName);
}
}else if(c != categoryId){
clearCookie("categoryId");
clearCookie(cookieName);
}
}
function addCookie(name,value) {
value = value+prefix;
if(categoryId =="")return;
document.cookie = name + "=" + value +";path=/;"+ "domain="+domainName;;
}
function clearCookie(name) {
var value = "null";
cookieValue= name + "=" + value + ";path=/;" + "domain="+domainName;
document.cookie = cookieValue;
}
function addOfferId(arg, box) {
arg  = arg + prefix;
if(hasOfferId(arg)) {
alert("要选择的商机已存在");
box.checked=false;
return;
}
if(arg == "") {
return;
}
value = getCookie(cookieName);
if(value == null || value == "null" ) {
value = arg ;
} else {
value=value+"x"+ arg;
}
cookieValue = cookieName + "=" + value + ";path=/;" + "domain="+domainName;
document.cookie = cookieValue;
var countId = box.id.substring("compareBox".length,box.id.length);
var trTag = document.getElementById("compareColor"+countId);
trTag.className=checkedClassName;
}
function delOfferId(arg) {
arg = arg + prefix;
if(!hasOfferId(arg)) {
alert("要删除的商机不存在");
return;
}
value = getCookie(cookieName);
var offerIds = stringToArray(value);
var len = offerIds.length;
var result = "";
var counter = 0;
for(var i=0;i<len;i++) {
if(offerIds[i] != arg) {
if(counter == 0) {
result = offerIds[i];
} else {
result = result + "x" + offerIds[i];
}
counter++;
}
}
cookieValue = cookieName + "=" + result + ";path=/;" + "domain="+domainName;
document.cookie = cookieValue;
}
function hasOfferId(arg) {
var value = getCookie(cookieName);
if(value == null || value == "null" || value.indexOf(arg) == -1 ) {
return false;
} else {
return true;
}
}
function getOfferIdCount() {
value = getCookie(cookieName);
if(value == null || value == 'null') {
return 0;
}
var count = 1;
while(value.indexOf("x") != -1) {
var position = value.indexOf("x");
var len = value.length;
value =  value.substring(position+1,len);
count++;
}
return count;
}
function stringToArray(str) {
var temp = str;
var strArray = new Array();
var count = 0;
while(temp.indexOf("x") != -1) {
var position = temp.indexOf("x");
strArray[count] = temp.substring(0,position);
count++;
var len = temp.length;
temp =  temp.substring(position+1,len);
}
strArray[count] = temp;
return strArray;
}
function clickcompareBox(id,box) {
if(box.checked){
if(getOfferIdCount()>=10 && !inside_cooperate_id){
alert('您已经选择了10条供应信息，候选供应信息不能超过10个');
box.checked=false;
}else{
addOfferId(id, box);
}
} else {
delOfferId(id);
var countId = box.id.substring("compareBox".length,box.id.length);
var trTag = document.getElementById("compareColor"+countId);
trTag.className=defaultClassName;
}
}
function doCompare(){
if(getOfferIdCount()<=1){
alert('请至少选择2条信息进行对比!');
}else if(getOfferIdCount()>10){
alert('您已经选择了10条供应信息，候选供应信息不能超过10个');
}else{
FD.common.goTo(url+'/offer/offer_compare.htm','_blank');
//window.open(url+'/offer/offer_compare.htm');
}
}
function cleanCookie() {
if(confirm("您确认执行清空操作吗？")){
var value = "null";
cookieValue= cookieName + "=" + value + ";path=/;" + "domain="+domainName;
document.cookie = cookieValue;
for(var i=1;i<=tempCount;i++){
var elem = document.getElementById("compareBox"+i);
if(elem != null && elem.checked){
elem.checked = false;
elem = document.getElementById("compareColor"+i);
elem.className=defaultClassName;
}
}
}
}
function iniOfferId(arg, value) {
if(value == null || value == "null" || value.indexOf(arg) == -1 ) {
return false;
} else {
return true;
}
}
//初始化
function initCheckbox(offerCount,catId,insideCooperateId,currentServer){
tempCount = offerCount + 1;
categoryId = catId;
inside_cooperate_id = insideCooperateId;
url = currentServer;
initOfferId();
var tempValue = getCookie(cookieName);
for(var i = 1;i < tempCount ;i++){
var cpbox = document.getElementById("compareBox"+i);
var cpcolor = document.getElementById("compareColor"+i);
if(cpbox!= null){
if(iniOfferId(cpbox.name, tempValue)){
cpbox.checked = true;
if(cpcolor != null){
cpcolor.className=checkedClassName;
}
tempValue = tempValue.replace(cpbox.name,"");
}else{
cpbox.checked = false;
}
}
}
}
//用于列表页面
function changeNoimgScreen(value){
var lowStyle;
if(value >= 0){
lowStyle = false;
}else{
lowStyle = true;
}
if(lowStyle){
document.write("<link rel=\"stylesheet\" rev=\"stylesheet\" href=\"http://style.china.alibaba.com/css/alisearch/1.0.0/list/offer/offer-noimg-low.css\" type=\"text/css\" media=\"screen\" />");
}
}
//用于图文页面
function changeImgScreen(showProperties){
var screenWidth = screen.width;
if(!showProperties){
document.write("<link rel='stylesheet' rev='stylesheet' href='http://style.china.alibaba.com/css/alisearch/1.0.0/list/offer/offer-img-low.css' type='text/css' media='screen'/>");
}
}
function boxSearchCheck(obj,searchTrace){
var k = obj.keywords;
if(k) {
var v = k.value;
if(v.length > 100){
alert("您输入的关键字过长！");
k.select();
return false;
}
if(v == "" || v.substring(0,3) =="请输入") {
alert("请输入关键字！");
k.focus();
return false;
}
}
var tracelog = "?searchtrace="+searchTrace;
aliclick(this,tracelog);
}
function topSearchCheck(obj,searchTopTrace){
return boxSearchCheck(obj,searchTopTrace);
}
function bottomSearchCheck(obj,searchBottomTrace){
return boxSearchCheck(obj,searchBottomTrace);
}
function zeroSearchCheck(obj,searchZeroTrace){
return boxSearchCheck(obj,searchZeroTrace);
}
function shieldOncontextmenu() {
var  target = getEvent().target || getEvent().srcElement; // 获得事件源
if(target.src){
return false;
}
}
function getEvent(e) {
var ev = e || window.event;
if (!ev) {
var c = this.getEvent.caller;
while (c) {
ev = c.arguments[0];
if (ev && Event == ev.constructor) {
break;
}
c = c.caller;
}
}
return ev;
}
//禁止右键点击图片链接
function unpremitImgUrl(){
document.oncontextmenu=shieldOncontextmenu
}
//右侧阿里旺旺群的显示,被阿里软件的ajax返回数据调用，零结果页面不调用
function display_alitalk(alitalkObj){
if(alitalkObj.length==0||alitalkObj=='error') {
return;
}
var htmlobj="";
for(i=0;i<alitalkObj.length;i++){
var url="http://www2.im.alisoft.com/webim/tribe/tribe_detail.htm?tribeId="+alitalkObj[i].id+"&userId=cnalichn"+"&isSingle=y";
htmlobj+="<li>" + '<span class="pd_h">' +"<a href=\"#\" onclick=\"javascript:popwin('" + url + "');return false;\" target=\"_blank\"  onmousedown=\"aliclick(this,'?searchtrace=list_nav_alitalk')\" >" + alitalkObj[i].name + "</a></span></li>";
}
document.getElementById("alitalk_group").innerHTML = htmlobj;
document.getElementById("alitalk_list").style.display = "block";
}
function popwin(theurl)
{
window.open(theurl, '', 'height=400, width=500, top=60, left=150, toolbar=no, menubar=no, scrollbars=yes, resizable=no,location=no, status=no');
}
(function(){
var rkCookieName = "h_keys";
//记录最近搜索词,零结果页面不记录
window.recordKeywords=function(keywords){
if(keywords != null && keywords != ""){
var needWrite =true;
var r_keywords = keywords.replace(/&#39;/g,"\'").replace(/#/g,"");
var h_keys_v =r_keywords;
var keys = getCookie(rkCookieName);
if(keys!=null){
var keys_array = keys.split("#");
for(var i=0;i < keys_array.length && i < 9 && needWrite;i++){
if(r_keywords == keys_array[i]){
if(i == 0)needWrite = false;
}else{
h_keys_v += "#"+keys_array[i];
}
}
}
if(needWrite){
addTimeCookie(rkCookieName,h_keys_v);
}
}
}
})();
function addTimeCookie(name,value) {
var expDate = new Date();
expDate.setYear(expDate.getFullYear()+1);
document.cookie = name + "=" + escape(value) +";expires="+ expDate.toGMTString()+";path=/;"+ "domain="+domainName;
}
(function(){
var _trustscoreUrl;
var _activeScoreUrl;
var _defaultSortUrl;
var _pageUrl;
var _showfeatureUrl;
var _noimgStyleUrl;
var _imgStyleUrl;
var _shopwindowStyleUrl;
var _priceSortUrl;
//初始化url
window.initSortTypeUrl = function(trustscoreUrl,activeScoreUrl,defaultSortUrl,pageUrl,showfeatureUrl,noimgStyleUrl,imgStyleUrl,shopwindowStyleUrl,priceSortUrl){
_trustscoreUrl = trustscoreUrl;
_activeScoreUrl = activeScoreUrl;
_defaultSortUrl = defaultSortUrl;
_pageUrl = pageUrl;
_showfeatureUrl = showfeatureUrl;
_noimgStyleUrl = noimgStyleUrl;
_imgStyleUrl = imgStyleUrl;
_shopwindowStyleUrl = shopwindowStyleUrl;
_priceSortUrl = priceSortUrl||"";
}
//诚信通排序
window.change_to_trustscore=function(){
if(_trustscoreUrl != ""){
FD.common.goTo(_trustscoreUrl);
//window.location.href=_trustscoreUrl ;
}
}
//阿里旺旺排序
window.sort_by_activescore=function(){
if(_activeScoreUrl != ""){
FD.common.goTo(_activeScoreUrl);
//window.location.href=_activeScoreUrl;
}
}
//默认排序
window.sort_by_default=function(){
if(_defaultSortUrl != ""){
FD.common.goTo(_defaultSortUrl);
//window.location.href=_defaultSortUrl;
}
}
window.sort_by_price=function(){
if(_priceSortUrl&&_priceSortUrl!=""){
FD.common.goTo(_priceSortUrl);
}
}
/**
* 属性下拉框
* @method change_show_fid
* @param {Int} v
* @static
*/
window.change_show_fid=function(v){
if(_pageUrl.indexOf("?") > 0){
FD.common.goTo(_showfeatureUrl+"&showFid=" + v);
//window.location.href = _showfeatureUrl+"&showFid=" + v;
}else{
FD.common.goTo(_showfeatureUrl+"?showFid=" + v);
//window.location.href = _showfeatureUrl+"?showFid=" + v;
}
}
/**
* 展示方式切换
* @method showstyle
* @param {String} v
* @static
*/
window.showstyle=function(v){
if(v =="noimg"){
FD.common.goTo(_noimgStyleUrl);
//window.location.href = _noimgStyleUrl;
}else if(v == "img"){
FD.common.goTo(_imgStyleUrl);
//window.location.href = _imgStyleUrl;
}else if(v == "shopwindow"){
FD.common.goTo(_shopwindowStyleUrl);
//window.location.href = _shopwindowStyleUrl;
}
}
})();
/**
* 地区下拉框回显
* @method changeprovince
* @param {String} province
* @param {String} beforeProvince
* @param {String} beforeCity
* @static
*/
function changeprovince(province,beforeProvince,beforeCity){
if(province != null){
for (var i=0;i<province.options.length;i++) {
var provinceValue = province.options[i].value;
var cityValue = province.options[i].getAttribute("city");
if(provinceValue == beforeProvince && (!cityValue || cityValue == beforeCity)){
province.options[i].selected=true;
break;
}
}
}
}
/**
* 地区下拉框筛选
* @method filtByCentralArea
* @param {Object} optionObj
* @static
*/
function filtByCentralArea(optionObj) {
var optionElem = optionObj.options[optionObj.selectedIndex];
var province = optionElem.value;
var city = optionElem.getAttribute("city");
changeRegion(province, city);
try{document.getElementById("sx_ctrl_btn").click();}catch(e){}
}
/**
* "联系方式"打点
* @param {String} linkObj
* @param {Boolean} isFreeMember
* @param {String} phponeTracelog
* @param {String} keywords
* @static
* @static
*/
function clickAddParam(linkObj, isFreeMember, phoneTracelog,keywords){
aliclick(linkObj,"?searchtrace=" + phoneTracelog);
addParam(linkObj,'contactFrom','sellofferlist_contact');
if(isFreeMember) {
if(keywords != ""){
addParam(linkObj,'keywords',keywords);
}
addParam(linkObj,'openContact','y#lxfs');
}
}
/**
* 阿里工具条的打点
* @param {String} ftrace
* @param {Strinh} query
* @return {Boolean} true
* @static
*/
function aliBussToolTrace(ftrace,query) {
var url = document.location;
var vNum=Math.random();
var t = Math.round(vNum*100000000);
var ourl="http://count.soft.cn.yahoo.com/count/icon?";
var log_str=ourl+"f="+ftrace+"&u="+encodeURIComponent(url)+"&q="+query+"&t="+t;
if(document.images){
(new Image()).src = log_str;
}
return true;
}
function focusit(inputobj){
if(inputobj.value.indexOf('请输入')!=-1)inputobj.value='';
inputobj.style.color="#666666";
}
function blurit(inputobj){
if(trim(inputobj.value)=="")inputobj.value=inputobj.title;
inputobj.style.color="#666666";
}
function trim(inputString) {
return inputString.replace(/^ +/,"").replace(/ +$/,"");
}
function showLessOrMore(obj){
if(obj.className == "ml5px less"){
if(document.getElementById('sx_self_param')){
document.getElementById('sx_more_param').style.display = "none";
document.getElementById('sx_top').style.height  = "36px";
document.getElementById('sx_ctrl_btn').className = "sx_but_small";
}else{
document.getElementById('sx_top').style.display  = "none";
}
obj.className = "ml5px more";
obj.innerHTML = "<span class='ml15px'>更多</span>";
document.frmAreaSearch.sm.value="";
}else{
if(document.getElementById('sx_self_param')){
document.getElementById('sx_more_param').style.display = "block";
document.getElementById('sx_top').style.height  = "62px";
document.getElementById('sx_ctrl_btn').className = "sx_but_big";
}else{
document.getElementById('sx_top').style.display  = "block";
}
obj.className = "ml5px less";
obj.innerHTML = "<span class='ml15px'>精简</span>";
document.frmAreaSearch.sm.value="true";
}
}
function displayMore() {
var obj = document.getElementById("sx_ctrl_a");
obj.className = "ml5px more";
showLessOrMore(obj);
}
function doQuickFilt() {
document.getElementById('sx_ctrl_btn').click();
}
function setOnlineStatus() {
var onlineStatus = document.getElementById("_onlineStatus").value;
if(onlineStatus == "all" || onlineStatus == "") {
onlineStatus = "yes";
}else if (onlineStatus == "yes") {
onlineStatus = "all";
}
document.getElementById("_onlineStatus").value = onlineStatus;
}
function setMemberlevelAndPmType(select) {
var option = select.options[select.selectedIndex];
var memberlevel = document.getElementById("_memberlevel").value;
var pmType = document.getElementById("_pmType").value;
if (option.value == "allTrust") {
memberlevel = "pm";
pmType = "";
} else if (option.value == "enterpriseTrust") {
memberlevel = "pm";
pmType = "enterprise";
} else if (option.value == "personalTrust") {
memberlevel = "pm";
pmType = "person";
} else if (option.value == "abroadTrust") {
memberlevel = "pm";
pmType = "etc";
var _province = document.getElementById("_province");
_province.value='';
document.getElementById("city_slt").value = "";
if(document.getElementById("_onlineStatus")){
document.getElementById("_onlineStatus").value = '';
}
if(document.getElementById("_onlyOnePrice")){
document.getElementById("_onlyOnePrice").value = '';
}
} else {
memberlevel = "";
pmType = "";
}
document.getElementById("_memberlevel").value = memberlevel;
document.getElementById("_pmType").value = pmType;
}
function setOnlyOnePrice(){
try{
var onlyOnePrice = document.getElementById("_onlyOnePrice").value;
if(onlyOnePrice == "true"){
document.getElementById("_onlyOnePrice").value = "";
} else {
document.getElementById("_onlyOnePrice").value = "true";
}
}catch(e){}
}
var qFilt = "_";
var oFilt = "_";
var count;
var trace_f ="";
var provincesel;
var citysel;
var _province;
var abroadTraceLog;
var escapeKeywords ;
var traceHead;
function initFIltParam(escapeKeywords,abroadTraceLog,traceHead){
this.provincesel = document.getElementById("province_slt");
this.citysel     = document.getElementById("city_slt");
this._province   = document.getElementById("_province");
this.abroadTraceLog = abroadTraceLog;
this.escapeKeywords = escapeKeywords;
this.traceHead = traceHead;
}
function changeProvince(list) {
if (list.selectedIndex<=0) {
provincesel.options[0].selected=true;
var len = citysel.options.length;
for (var i=len-1;i>0;i--){
citysel.options[i]=null;
}
}else {
var boards = catArr1[list.selectedIndex-1].getOptions();
var len = citysel.options.length;
for (var i=len-1;i>0;i--){
citysel.options[i]=null;
}
for (var i=0;i<boards.length;i++) {
citysel.options[i+1]=boards[i];
}
var tmpPro = list.options[list.selectedIndex].value;
//当省份只有一个城市的,不要显示city
var tmpCityList = "|北京|上海|天津|重庆|HK|MO|TW|海外|";
if(tmpCityList.indexOf("|" + tmpPro + "|") != -1) {
citysel.value = '';
citysel.disabled = true;
}else {
citysel.disabled = false;
}
}
var memberTypeSel = document.getElementById("memberType");
if(provincesel.value =='海外'){
for (var i=0;i<memberTypeSel.options.length;i++) {
if(memberTypeSel.options[i].value=='abroadTrust'){
memberTypeSel.options[i].selected=true;
setMemberlevelAndPmType(memberTypeSel);
}
}
_province.value = '';
aliclick(this,"?searchtrace="+abroadTraceLog);
}else{
if(memberTypeSel && memberTypeSel.value=='abroadTrust'){
memberTypeSel.options[0].selected=true;
setMemberlevelAndPmType(memberTypeSel);
}
_province.value = provincesel.value
}
}
function changeRegion(province,city) {
for (var i=0;i<catArr1.length;i++) {
provincesel.options[i+1]=new Option(catArr1[i].title,catArr1[i].id);
//设置省选择框的选择值
if(provincesel.options[i+1].value == province){
provincesel.options[i+1].selected=true;
}
}
changeProvince(provincesel);
var len = citysel.options.length;
for (var i=0;i<len;i++) {
//设置城市选择框的选择值
if(citysel.options[i].value == city) {
citysel.options[i].selected=true;
}
}
}
function onSearch(form,keywords){
var patrn=/^[1-9]\d*$/;
if(form.priceStart !=null) {
form.priceStart.value=form.priceStart.value.replace(/(^\s*)|(\s*$)/g,"");
if(form.priceStart.value!=""){
if(isNaN(form.priceStart.value)){
form.priceStart.focus();
alert("请输入正确的数字进行价格筛选！");
return false;
}else if(parseFloat(form.priceStart.value)>1000000000||parseFloat(form.priceStart.value)<0){
form.priceStart.focus();
alert("请输入正确的数字进行价格筛选！");
return false;
}
}
}
if(form.priceEnd !=null) {
form.priceEnd.value=form.priceEnd.value.replace(/(^\s*)|(\s*$)/g,"");
if(form.priceEnd.value!=""){
if(isNaN(form.priceEnd.value)){
form.priceEnd.focus();
alert("请输入正确的数字进行价格筛选！");
return false;
}else if(parseFloat(form.priceEnd.value)>1000000000||parseFloat(form.priceEnd.value)<0){
form.priceEnd.focus();
alert("请输入正确的数字进行价格筛选！");
return false;
}
}
}
if(form.quantityBegin!=null){
form.quantityBegin.value=form.quantityBegin.value.replace(/(^\s*)|(\s*$)/g,"");
if(form.quantityBegin.value!=""){
if((!patrn.exec(form.quantityBegin.value))||(parseInt(form.quantityBegin.value)>2147483647)){
form.quantityBegin.focus();
alert("请输入正确的数字进行起定量筛选！");
return false;
}
}
}
if(form.province != null && form.city != null){
if(form.province != null && form.province.value !=""){
qFilt=qFilt+ 'p';
}
if(form.city != null && form.city.value !=""){
qFilt= qFilt +'c';
}
}else{
qFilt= qFilt + "_";
}
if(form.postTime != null && form.postTime.value !=""){
qFilt= qFilt + "_" + form.postTime.value;
form.isNoRepost.value=true;
}else{
qFilt= qFilt + "_";
form.isNoRepost.value=false;
}
if(form.biztype != null && form.biztype.value !=""){
qFilt= qFilt + "_" + form.biztype.value;
}else{
qFilt= qFilt + "_";
}
if(form.established_year != null && form.established_year.value !=""){
qFilt= qFilt + "_" + form.established_year.value;
}else{
qFilt= qFilt + "_";
}
if(document.getElementById("memberType") != null && document.getElementById("memberType").value != "all"){
qFilt= qFilt + "_" + document.getElementById("memberType").value;
}else{
qFilt= qFilt + "_";
}
if(form.onlineStatus != null && form.onlineStatus.value == 'yes' ){
qFilt=qFilt+"_"+'2';
}else{
qFilt= qFilt + "_";
}
if(form.onlyOnePrice != null && form.onlyOnePrice.value == 'true' ){
qFilt=qFilt+"_"+'biz';
}else{
qFilt= qFilt + "_";
}
if(form.priceStart != null || form.priceEnd != null || form.quantityBegin || form.keywords != null){
if( (form.priceStart != null && form.priceStart.value !="") || (form.priceEnd != null && form.priceEnd.value !="")){
oFilt=oFilt+'s';
}
if(form.quantityBegin != null && form.quantityBegin.value !="" ){
oFilt=oFilt+'q';
}
if(form.keywords != null && form.keywords.value != keywords){
oFilt=oFilt+'k';
}
}else{
oFilt=oFilt+'_';
}
var str_tlog = "?searchtrace="+traceHead;
if(qFilt != ""){
str_tlog = str_tlog + qFilt ;
}
if(oFilt != ""){
str_tlog = str_tlog + oFilt + trace_f ;
}
str_tlog = str_tlog + "_" + escapeKeywords;
aliclick(this,str_tlog);
}
function onChangeFeature(list){
onChange(list);
trace_f='f';
}
function onChange(list){
var sel = list.options[list.selectedIndex]
var value =sel.value;
}
function filtByArea(id) {
if(id > 0) {
document.getElementById("townId").value = id;
document.getElementById("province_slt").value = "";
document.getElementById("city_slt").value = "";
try{
document.getElementById("sx_ctrl_btn").click();
}catch(e){}
}
}
function cleanArea() {
document.getElementById("townId").value = "";
document.getElementById("province_slt").value = "";
document.getElementById("city_slt").value = "";
try{
document.getElementById("sx_ctrl_btn").click();
}catch(e){}
}
function pop() {
if ( checkAlitalkpopup() )
{
window.open('http://china.alibaba.com/alitalk/3jump.html', 'myt','left=0,top=10,width=265, height=140,location=no,toolbar=no,status=no,resizable=no,scrollbars=no');
setCookieAlitalkpopup() ;
}
}
function p4pSearchClick(eurl){
var d = new Date();
if (document.images) {
(new Image()).src = eurl + "&j=1&time=" + d.getTime();
}
}
function showMoreS70Div(){
var divArray = YAHOO.util.Dom.getElementsByClassName('view-s70');
if(divArray[3].style.display == "")
{
for(var i = 3; i < divArray.length; i++)
{
divArray[i].style.display="none";
}
YAHOO.util.Dom.get('s70shownoreButton').innerHTML = '显示更多选择';
YAHOO.util.Dom.get('s70shownoreButton').style.backgroundImage = 'url(http://img.china.alibaba.com/images/cn/cms/1.gif)';
}
else
{
for(var i = 3; i < divArray.length; i++)
{
divArray[i].style.display="";
}
YAHOO.util.Dom.get('s70shownoreButton').innerHTML = '隐藏更多选择';
YAHOO.util.Dom.get('s70shownoreButton').style.backgroundImage = 'url(http://img.china.alibaba.com/images/cn/cms/2.gif)';
}
}
function initShortcutShowMore(){
if(YAHOO.util.Dom.getElementsByClassName('view-s70')){
var shorcutDivArr = YAHOO.util.Dom.getElementsByClassName('view-s70');
if(shorcutDivArr.length > 3){
for(var i = 3; i < shorcutDivArr.length; i++)
{
shorcutDivArr[i].style.display="none";
}
YAHOO.util.Dom.get('s70shownore').innerHTML='<div style="width:80%;float:left;"><span id="s70shownoreButton" onclick="showMoreS70Div()" style="background:url(http://img.china.alibaba.com/images/cn/cms/1.gif) no-repeat;width:120px;padding-left:18px;line-height:24px;cursor:pointer;">显示更多选择</span></div>';
}
}
}
initShortcutShowMore();
function setCookieAlitalkpopup()
{
if ( getCookieAlitalkpopup("alitalkpromote") == null )
{
var expires = new Date();
expires.setTime(expires.getTime() + 4*60*60*1000);
var the_cookie = "alitalkpromote=viewed;path=/;domain=.alibaba.com;expires=" + expires.toGMTString();
document.cookie = the_cookie;
}
}
function getCookieAlitalkpopup(cookieName) {
var cookieString = document.cookie;
var start = cookieString.indexOf(cookieName + '=');
if (start == -1)
return null;
start += cookieName.length + 1;
var end = cookieString.indexOf(';', start);
if (end == -1) return unescape(cookieString.substring(start));
return unescape(cookieString.substring(start, end));
}
function newCheckAlitalkInstalled()
{
var obj5,obj6;
try{
obj5 = new ActiveXObject("Ali_Check.InfoCheck");
}catch(e){
obj5 = null;
}
if (obj5 != null) {
alitalkVersion = 5;
return true;
}
try{
obj6 = new ActiveXObject("aliimx.wangwangx");
}catch(e){
obj6 = null;
}
if (obj6 != null) {
alitalkVersion = 6;
return true;
}
return false;
}
function checkAlitalkInstalledG(){
if (document.all&&!document.opera) {
var obj5 = obj6 = null;
try {
obj5 = new ActiveXObject("Ali_Check.InfoCheck");
}
catch (e) {
}
try {
obj6 = new ActiveXObject("aliimx.wangwangx");
}
catch (e) {
}
if (obj5 || obj6) {
return true;
}
else {
return false;
}
}else{
return true;
}
}
function checkAlitalkpopup()
{
if (checkAlitalkInstalledG())
{
setCookieAlitalkpopup() ;
return false;
}
if ( getCookieAlitalkpopup("alitalkpromote") != null )
{
return false;
}
return true;
}
function newCheckAlitoolbarInstalled()
{
var obj;
try{
obj = new ActiveXObject("YAliALive.Live");
}
catch(e){
}
if (null!=obj){
return true;
} else {
return false;
}
}
function checkAlitoolbarpopup()
{
if (newCheckAlitoolbarInstalled())
{
return false;
}
return true;
}
function addListener(el,eventType,fn){
if(el.addEventListener){
el.addEventListener(eventType,fn,false);
}else if(el.attachEvent){
el.attachEvent("on" + eventType,fn);
}else{
el["on"+eventType] = fn;
}
}
/*
Copyright (c) 2008, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.5.1
*/
YAHOO.namespace("util");YAHOO.util.Cookie={_createCookieString:function(B,D,C,A){var F=YAHOO.lang;var E=encodeURIComponent(B)+"="+(C?encodeURIComponent(D):D);if(F.isObject(A)){if(A.expires instanceof Date){E+="; expires="+A.expires.toGMTString();}if(F.isString(A.path)&&A.path!=""){E+="; path="+A.path;}if(F.isString(A.domain)&&A.domain!=""){E+="; domain="+A.domain;}if(A.secure===true){E+="; secure";}}return E;},_createCookieHashString:function(B){var D=YAHOO.lang;if(!D.isObject(B)){throw new TypeError("Cookie._createCookieHashString(): Argument must be an object.");}var C=new Array();for(var A in B){if(D.hasOwnProperty(B,A)&&!D.isFunction(B[A])&&!D.isUndefined(B[A])){C.push(encodeURIComponent(A)+"="+encodeURIComponent(String(B[A])));}}return C.join("&");},_parseCookieHash:function(E){var D=E.split("&");var F=null;var C=new Object();for(var B=0,A=D.length;B<A;B++){F=D[B].split("=");C[decodeURIComponent(F[0])]=decodeURIComponent(F[1]);}return C;},_parseCookieString:function(I,A){var J=new Object();if(YAHOO.lang.isString(I)&&I.length>0){var B=(A===false||1?function(K){return K;}:decodeURIComponent);if(/[^=]+=[^=;]?(?:; [^=]+=[^=]?)?/.test(I)){var G=I.split(/;\s/g);var H=null;var C=null;var E=null;for(var D=0,F=G.length;D<F;D++){E=G[D].match(/([^=]+)=/i);if(E instanceof Array){H=decodeURIComponent(E[1]);C=B(G[D].substring(H.length+1));}else{H=decodeURIComponent(G[D]);C=H;}J[H]=C;}}}return J;},get:function(A,B){var D=YAHOO.lang;var C=this._parseCookieString(document.cookie);if(!D.isString(A)||A===""){throw new TypeError("Cookie.get(): Cookie name must be a non-empty string.");}if(D.isUndefined(C[A])){return null;}if(!D.isFunction(B)){return C[A];}else{return B(C[A]);}},getSub:function(A,C,B){var E=YAHOO.lang;var D=this.getSubs(A);if(D!==null){if(!E.isString(C)||C===""){throw new TypeError("Cookie.getSub(): Subcookie name must be a non-empty string.");}if(E.isUndefined(D[C])){return null;}if(!E.isFunction(B)){return D[C];}else{return B(D[C]);}}else{return null;}},getSubs:function(A){if(!YAHOO.lang.isString(A)||A===""){throw new TypeError("Cookie.getSubs(): Cookie name must be a non-empty string.");}var B=this._parseCookieString(document.cookie,false);if(YAHOO.lang.isString(B[A])){return this._parseCookieHash(B[A]);}return null;},remove:function(B,A){if(!YAHOO.lang.isString(B)||B===""){throw new TypeError("Cookie.remove(): Cookie name must be a non-empty string.");}A=A||{};A.expires=new Date(0);return this.set(B,"",A);},set:function(B,C,A){var E=YAHOO.lang;if(!E.isString(B)){throw new TypeError("Cookie.set(): Cookie name must be a string.");}if(E.isUndefined(C)){throw new TypeError("Cookie.set(): Value cannot be undefined.");}var D=this._createCookieString(B,C,true,A);document.cookie=D;return D;},setSub:function(B,D,C,A){var F=YAHOO.lang;if(!F.isString(B)||B===""){throw new TypeError("Cookie.setSub(): Cookie name must be a non-empty string.");}if(!F.isString(D)||D===""){throw new TypeError("Cookie.setSub(): Subcookie name must be a non-empty string.");}if(F.isUndefined(C)){throw new TypeError("Cookie.setSub(): Subcookie value cannot be undefined.");}var E=this.getSubs(B);if(!F.isObject(E)){E=new Object();}E[D]=C;return this.setSubs(B,E,A);},setSubs:function(B,C,A){var E=YAHOO.lang;if(!E.isString(B)){throw new TypeError("Cookie.setSubs(): Cookie name must be a string.");}if(!E.isObject(C)){throw new TypeError("Cookie.setSubs(): Cookie value must be an object.");}var D=this._createCookieString(B,this._createCookieHashString(C),false,A);document.cookie=D;return D;}};YAHOO.register("cookie",YAHOO.util.Cookie,{version:"2.5.1",build:"984"});
function aliclick(u,param)
{
var url = "http://stat.china.alibaba.com/tracelog/click.html";
return baseClick(url,param);
}
function etcclick(u, param) {
var url = "http://stat.china.alibaba.com/etclistquery.html";
return baseClick(url,param);
}
function eeclick(u, param) {
var url ="http://stat.china.alibaba.com/ee.html";
return baseClick(url,param);
}
function aliclickType(u, param){
var urlTxt = window.location.href;
if(urlTxt){
var urlType = urlTxt.substring(urlTxt.lastIndexOf('/')+1,urlTxt.lastIndexOf('.'));
}
aliclick(u, param+'_'+urlType);
}
function baseClick(url,param)
{
if (typeof window.dmtrack != "undefined") {
dmtrack.clickstat(url, param);
} else {
var d = new Date();
if (document.images) {
(new Image).src = url + param+'&time='+d.getTime();
}
}
return true;
}
/*
function aliclickType(u, param){
var urlTxt = window.location.href;
if(urlTxt){
var urlType = urlTxt.substring(urlTxt.lastIndexOf('/')+1,urlTxt.lastIndexOf('.'));
}
aliclick(u, param+'_'+urlType);
}
function aliclick(u, param) {
d = new Date();
if(document.images) {
var img_aliclick = new Image();
img_aliclick.src="http://stat.china.alibaba.com/tracelog/click.html" + param + "&time=" + d.getTime();
}
return true;
}
function etcclick(u, param) {
d = new Date();
if(document.images) {
var img_etc_aliclick = new Image();
img_etc_aliclick.src="http://stat.china.alibaba.com/etclistquery.html" + param + "&time=" + d.getTime();
}
return true;
}
function eeclick(u, param) {
d = new Date();
if (document.images) {
(new Image()).src = "http://stat.china.alibaba.com/ee.html" + param + "&time=" + d.getTime();
}
return true;
}
*/
var activeMenu=null;
var activeItem=null;
function AlicnMenu(){
var value = null;
var children = [];
this.bindData = function(data){
value = data;
};
this.draw = function(parentObj){
for(var i=0;i<value.length;i++){
var nodeElement =  window.document.createElement("div");
nodeElement.id = "menu_"+ value[i].id;
nodeElement.className = "menu";
var statelink = window.document.createElement("a");
statelink.id = "statelink_"+value[i].id;
setStatueImg(value[i],statelink,true)
var namelink = window.document.createElement("a");
namelink.id = "menu" + value[i].id;
namelink.className = "linkItem";
if(value[i].children.length!=0){
statelink.href=namelink.href='javascript:menuClick(' + value[i].id + ',1)';
statelink.target=namelink.target="_self";
}else{
if(value[i].url&&value[i].url!="#"&&value[i].url!="")namelink.href =value[i].url;
if((value[i].target&&value[i].target=="_blank")||!value[i].target) namelink.target ="_self";
}
namelink.innerHTML = value[i].name;//中文类目
nodeElement.appendChild(statelink);
nodeElement.appendChild(namelink);
if(value[i].statusIcon){
var floatImg= window.document.createElement("img");
floatImg.src=value[i].statusIcon;
floatImg.alt='新';
floatImg.align="absmiddle";
nodeElement.appendChild(floatImg);
}
parentObj.appendChild(nodeElement);
if(value[i].children.length!=0){
drawChildren(value[i],parentObj);
}
}
};
this.setActivedItem=function(nodeId,fxxkthings){
// aissa 20091117
var fxxkId=nodeId, as, a;
//document.write(document.all.tree1.innerHTML)
if(document.getElementById("statelink_"+nodeId)!=null){
var namelink = document.getElementById("statelink_"+nodeId);
if(namelink.parentNode.className=="menu"){//当前为menu
namelink.parentNode.className="indexmenu";
return;
}
namelink.parentNode.className="selectItem2";
if(namelink.parentNode.parentNode.className=="itembox"){
var nodeId=namelink.parentNode.parentNode.id.replace("children_","")
setStateImg(nodeId,"collapse")
namelink.parentNode.parentNode.style.display="block";
activeMenu = namelink.parentNode.parentNode;
}
if(namelink.parentNode.parentNode.parentNode.className=="itembox"){
namelink.parentNode.parentNode.parentNode.style.display="block";
var nodeId = namelink.parentNode.parentNode.parentNode.id.replace("children_","")
setStateImg(nodeId,"collapse")
activeMenu = namelink.parentNode.parentNode.parentNode;
getObj("menu_"+nodeId).className="activedmenu";//arrow
}
if(fxxkthings!=""){
a=document.getElementById('children_'+fxxkId);
if(a != null){
a.style.display='block';
FYD.getFirstChild (FYD.getPreviousSibling(a)).innerHTML='<img src="http://img.china.alibaba.com/news/upload/0/tree3_1257575066703.png" border=0 align="absmiddle" style="cursor:hand">';
namelink.parentNode.className="item2";
as=a.getElementsByTagName('a');
for(var i=0, len=as.length;i<len;i++){
if(as[i].innerHTML==fxxkthings){
as[i].parentNode.className="selectItem2";
return true;
}
}
}
}else{
a=document.getElementById('children_'+fxxkId);
if(a != null){
a.style.display='block';
FYD.getFirstChild (FYD.getPreviousSibling(a)).innerHTML='<img src="http://img.china.alibaba.com/news/upload/0/tree3_1257575066703.png" border=0 align="absmiddle" style="cursor:hand">';
$D.setStyle(('children_'+fxxkId),"display","block");
}
}
}
}
}
function getObj(str){
return document.getElementById(str);
}
function drawChildren(value,nodeElement){
var childrenElement = null;
childrenElement =  window.document.createElement("div");
childrenElement.id="children_"+value.id;
childrenElement.className="itembox"
for(var i=0;i < value.children.length;i++){
var childElement =  window.document.createElement("div");
var statelink = window.document.createElement("a");
statelink.id = "statelink_"+value.children[i].id;
childElement.className="item2"
var namelink = window.document.createElement("a");
namelink.id = "namelink_" + value.children[i].id;
if(value.children[i].children.length>0){
statelink.href ='javascript:menuClick(' + value.children[i].id + ',2)';
namelink.href=value.children[i].url;
statelink.target=namelink.target="_self";
}else{
if(value.children[i].url&&value.children[i].url!="#"&&value.children[i].url!="")namelink.href=value.children[i].url;
if((value.children[i].target&&value.children[i].target=="_self")||value.children[i].target!="")namelink.target ="_self";
}
setStatueImg(value.children[i],statelink,false)
namelink.innerHTML =  value.children[i].name;
childElement.appendChild(statelink);
childElement.appendChild(namelink);
childrenElement.appendChild(childElement);
if(value.children[i].children.length>0){
drawChildren(value.children[i],childrenElement);
}
if(document.all&&value.children[i].tips){
tipsDiv= window.document.createElement("div");
tipsDiv.innerHTML="<div><div class='left'>"+value.children[i].tips+"<\/div><div class='right'><img src='http://img.china.alibaba.com/images/cn/club/others/080226/close.gif' alt='' style='cursor:pointer;' onclick='this.parentNode.parentNode.parentNode.className=\"hidebox\"'/><\/div>";
tipsDiv.className="myaliMenuTips";
childElement.appendChild(tipsDiv);
}
if(document.all&&value.children[i].statusIcon){
var floatImg= window.document.createElement("img");
floatImg.src=value.children[i].statusIcon;
floatImg.alt='新';
floatImg.align="absmiddle";
childElement.appendChild(floatImg);
}
}
childrenElement.style.display = "none";
nodeElement.appendChild(childrenElement);
}
function setStatueImg(value,statelink,flag){//flag代表叶子节点是否出现leaf.gif
if(value.children.length>0){
statelink.innerHTML="<img src='http://img.china.alibaba.com/news/upload/0/tree2_1257575066701.png' border=0 align='absmiddle' style='cursor:hand'>";
return;
}else{
statelink.innerHTML="<img src='http://img.china.alibaba.com/news/upload/0/tree3_1257575066703.png' border=0 align='absmiddle' style='cursor:hand'>";
return;
}
}
function menuClick(nodeId,flag){
if(flag==1){//click menu
if(getObj("children_"+nodeId).style.display=="none"){
getObj("children_"+nodeId).style.display="block";
setStateImg(nodeId,"collapse")
if(activeMenu!=null)
{
activeMenu.style.display="none";
setStateImg((activeMenu.id).replace("children_",""),"expand")
getObj("menu_"+(activeMenu.id).replace("children_","")).className="menu";//arrow
}
getObj("menu_"+nodeId).className="activedmenu";//arrow
activeMenu = getObj("children_"+nodeId);
return;
}else{
getObj("children_"+nodeId).style.display="none";
setStateImg(nodeId,"expand");
getObj("menu_"+nodeId).className="menu";//arrow
activeMenu =null;
return;
}
}
if(flag==2){
if(document.getElementById("children_"+nodeId).style.display=="none"){
document.getElementById("children_"+nodeId).style.display="block";
document.getElementById("statelink_"+nodeId).innerHTML="<img src='http://img.china.alibaba.com/news/upload/0/tree3_1257575066703.png' border=0 align='absmiddle' style='cursor:hand'>";
}else{
document.getElementById("children_"+nodeId).style.display="none";
document.getElementById("statelink_"+nodeId).innerHTML="<img src='http://img.china.alibaba.com/news/upload/0/tree2_1257575066701.png' border=0 align='absmiddle' style='cursor:hand'>";
}
}
}
function setStateImg(nodeId,state){
//alert(nodeId)
if(document.getElementById("statelink_"+nodeId)){}else return;
var statelink = document.getElementById("statelink_"+nodeId);
if(state=="collapse"){
if(statelink.parentNode.className=="menu")statelink.parentNode.className="activedmenu"
statelink.innerHTML="<img src='http://img.china.alibaba.com/news/upload/0/tree3_1257575066703.png' border=0 align='absmiddle' style='cursor:hand'>";
return;
}
if(state=="expand"){
statelink.innerHTML="<img src='http://img.china.alibaba.com/news/upload/0/tree2_1257575066701.png' border=0 align='absmiddle' style='cursor:hand'>";
return;
}
return;
}
function checkout(id1,id2){
var showid = document.getElementById(id1);
var hiddid = document.getElementById(id2);
showid.style.display="block";
hiddid.style.display="none";
}
function Condition(){
YAHOO.util.Event.on(YAHOO.util.Selector.query("#kf-myservice .kf-my"),"mouseover",function(){
YAHOO.util.Dom.replaceClass(this,"kf-my","kf-my-h");
});
YAHOO.util.Event.on(YAHOO.util.Selector.query("#kf-myservice .kf-my"),"mouseout",function(){
YAHOO.util.Dom.replaceClass(this,"kf-my-h","kf-my");
});
}
function cotrolPage(){
var nowpage = $D.getElementsByClassName('pagenum', 'ul');
var objnum = nowpage[0].getElementsByTagName('li').length;
if(objnum < 9){
$D.setStyle('contlist', 'padding-bottom', '250px');
}
}
function slideLine(lst, delay, speed, lh) {
var slideBox = (typeof lst == 'string')?document.getElementById(lst):lst;
var delay = delay||1000, speed=speed||20, lh = lh||20;
var tid = null, pause = false;
var start = function() {
tid=setInterval(slide, speed)}
var slide = function() {
if (pause) return;
slideBox.scrollTop += 2;
if (slideBox.scrollTop % lh == 0) {
clearInterval(tid);
slideBox.appendChild(slideBox.getElementsByTagName('dd')[0]);
slideBox.scrollTop = 0;
setTimeout(start, delay)}
}
slideBox.onmouseover=function(){pause=true}
slideBox.onmouseout=function(){pause=false}
setTimeout(start, delay)
}
function slideLine(lst, delay, speed, lh) {
var slideBox = (typeof lst == 'string')?document.getElementById(lst):lst;
var delay = delay||1000, speed=speed||20, lh = lh||20;
var tid = null, pause = false;
var start = function() {
tid=setInterval(slide, speed)}
var slide = function() {
if (pause) return;
slideBox.scrollTop += 2;
if (slideBox.scrollTop % lh == 0) {
clearInterval(tid);
slideBox.appendChild(slideBox.getElementsByTagName('dd')[0]);
slideBox.scrollTop = 0;
setTimeout(start, delay)}
}
slideBox.onmouseover=function(){pause=true}
slideBox.onmouseout=function(){pause=false}
setTimeout(start, delay)
}
FYE.on(window,'load',function (){
try{
Condition();
}catch(e){}
})
var t1Option = "";
var mid = "";
var time="";
var _ =	function(el){return YAHOO.util.Dom.get(el);};
function popShow(e){//显示信息
mid = "mid="+e.id;//根据userID发了请求
var handleSuccess = function(o){
var prod = eval("(" + o.responseText + ")");
t1Option = '<p><span class="excellingl">笔名：</span><a href="http://gonglue-test.china.alibaba.com:1111/user/profile.html?mid='+e.id+'">'+prod["n"]+'</a> <span class="leva_'+prod["l"]+'"></span>'
if(prod["e"]&&prod["e"]=="Y"){t1Option = t1Option + '<span class="pro2"></span>';}
t1Option = t1Option +'</p><p class="clr"><span class="excellingl">擅长领域：</span><span class="excellingr">'+prod["s"]+'</span></p><p class="clr"><span class="excellingl">回答次数：</span><span class="excellingr">'+prod["a"]+'</span></p>';
var showMsg = _("pop");
var opn = t1Option;
showMsg.innerHTML = opn; //浮动层输出
showMsg.style.display = "block"; //层显示
var xy = YAHOO.util.Dom.getXY(e);
xy[0,1] = xy[0,1]-23;//加上input框高度20
xy[1,0] = xy[1,0]+52;//加上input框高度20
YAHOO.util.Dom.setXY(showMsg, xy);
YAHOO.util.Event.addListener(showMsg, "mouseout", pophid);
YAHOO.util.Event.addListener(e, "mouseout", pophid);
YAHOO.util.Event.addListener(showMsg, "mouseover", popshw);
}
var handleFailure = function(){alert('操作失败！');}
var callback =
{
success:handleSuccess,
failure: handleFailure,
argument: e,
timeout: 5000
};
var request = YAHOO.util.Connect.asyncRequest('POST', 'http://gonglue-test.china.alibaba.com:1111/user/tip.html', callback, mid);
}
function popHidden(){//隐藏信息
var showMsg = _("pop");
showMsg.style.display = 'none';
}
function popshw(){//显示信息
clearTimeout(time);
var showMsg = _("pop");
showMsg.style.display = 'block';
}
function pophid(){
time = setTimeout("popHidden()",1500);
}
function doext(){
if(_("doext").className == "opn"){
_("extshow").className = "uloff";
_("doext").className = "cle";
_("doext").innerHTML = "收起";
}
else{
_("extshow").className = "ulon";
_("doext").className = "opn";
_("doext").innerHTML = "显示全部";
}
}
var _ =	function(el){return YAHOO.util.Dom.get(el);};
//重写insertAdjacentHTML函数 开始
if (!document.all) {
HTMLElement.prototype.insertAdjacentHTML = function (sWhere, sHTML) {
var df;
var r = this.ownerDocument.createRange();
switch (String(sWhere).toLowerCase()) {
case "beforebegin":
r.setStartBefore(this);
df = r.createContextualFragment(sHTML);
this.parentNode.insertBefore(df, this);
break;
case "afterbegin":
r.selectNodeContents(this);
r.collapse(true);
df = r.createContextualFragment(sHTML);
this.insertBefore(df, this.firstChild);
break;
case "beforeend":
r.selectNodeContents(this);
r.collapse(false);
df = r.createContextualFragment(sHTML);
this.appendChild(df);
break;
case "afterend":
r.setStartAfter(this);
df = r.createContextualFragment(sHTML);
this.parentNode.insertBefore(df, this.nextSibling);
break;
}
};
}
//重写insertAdjacentHTML函数 结束
function getSize() {
var xScroll, yScroll;
if (window.innerHeight && window.scrollMaxY) {
xScroll = document.body.scrollWidth;
yScroll = window.innerHeight + window.scrollMaxY;
} else if (document.body.scrollHeight > document.body.offsetHeight){      // all but Explorer Mac
xScroll = document.body.scrollWidth;
yScroll = document.body.scrollHeight;
} else {      // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
xScroll = document.body.offsetWidth;
yScroll = document.body.offsetHeight;
}
var windowWidth, windowHeight;
if (self.innerHeight) {      // all except Explorer
windowWidth = self.innerWidth;
windowHeight = self.innerHeight;
} else if (document.documentElement && document.documentElement.clientHeight) {      // Explorer 6 Strict Mode
windowWidth = document.documentElement.clientWidth;
windowHeight = document.documentElement.clientHeight;
} else if (document.body) {      // other Explorers
windowWidth = document.body.clientWidth;
windowHeight = document.body.clientHeight;
}
// for small pages with total height less then height of the viewport
if(yScroll < windowHeight){
pageHeight = windowHeight;
y = pageHeight;
} else {
pageHeight = yScroll;
y = pageHeight;
}
if(xScroll < windowWidth){
pageWidth = windowWidth;
} else {
pageWidth = xScroll;
}
arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight)
return arrayPageSize;
}
function popOutCenter(id,str,flag,xyz){
var p = _(id);
var pc = _(id+'_cont');
pc.innerHTML = str;
var frm = p.getElementsByTagName('iframe')[0];
var dv = p.getElementsByTagName('div')[0];
var a = getSize();
p.style.display = 'inline';
frm.style.height = _('sxbox').offsetHeight + 'px';
var scr = document.documentElement && document.documentElement.scrollTop ?document.documentElement.scrollTop : document.body.scrollTop;
if(flag&&flag !=""){
frm.style.left = dv.style.left = xyz[1,0] + 'px';
frm.style.top = dv.style.top =  xyz[0,1]  + 'px';
}else{
frm.style.left = dv.style.left = parseInt((a[0] - dv.offsetWidth)/2)- 150 + 'px';
frm.style.top = dv.style.top = (a[3] - dv.offsetHeight)/2 + scr - 100  + 'px';
}
}
function jumpOutMask(){
var a = getSize();
var o = _('mask');
var ob = _('mask_bg');
if(navigator.userAgent.indexOf('Firefox') >= 0){
a[0] -= 17
}
o.style.width = a[0] + 'px';
ob.style.height = a[1] + 'px';
o.style.display = 'block';
}
function closeMask(){
_('mask').style.display = _('popout').style.display = 'none';
}
function maskIni(){
var m = '<div class="mask_pr"> <div id="mask" class="mask"> <div id="mask_bg" class="mask_bg"></div> <div class="mask_ct"> <span id="popout" class="popout" > <iframe  class="popfrm" name="" src="about:blank" frameborder="0" scrolling="no" ></iframe>			<div id="sxbox" class="sxbox"> <div class="sxtt"></div> <div id="popout_cont" class="popout_cont"></div> </div> </span> </div>	</div> </div>';
if(!_('mask')) {document.body.insertAdjacentHTML('afterbegin',m);}
}
function domask(flag){
if(flag==1){
jumpOutMask();
popOutCenter('popout',str_login);
return false;
}else{
if(_("mask").style.display == "block"){
jumpOutMask();
popOutCenter('popout',str_login);
//YAHOO.util.Event.removeListener(window, "resize", domask);
}else{
return false;
}
}
}
//生意经公用js 包
var _ =	function(el){return YAHOO.util.Dom.get(el);};
/*
描述：	取cookie 方法
*/
function getCookie(name) {
var value = document.cookie.match('(?:^|;)\\s*'+name+'=([^;]*)');
return value ? unescape(value[1]): '';
}
/*
[[[[[[[[[[[[[[  此js方法生意经category页面下拉菜单使用  ]]]]]]]]]]]]]]]
描述：	doext : 展开收起更多
*/
function doext(){
if(_("doext").className == "opn"){
_("extshow").className = "uloff";
_("doext").className = "cle";
_("doext").innerHTML = "收起";
}
else{
_("extshow").className = "ulon";
_("doext").className = "opn";
_("doext").innerHTML = "显示全部";
}
}
/*
[[[[[[[[[[[[[[  此js方法在生意经编辑器项目中引用，具体位置不详（detail、history）  ]]]]]]]]]]]]]]]
描述：	setImgSize : img 重定义宽度、高度
参数：	B       - (Obj) 待处理的img 对象
D       - (Num) 宽度限制，图片重定义后最大宽度不得超过此值
A       - (Num) 高度限制，图片重定义后最大高度不得超过此值
*/
function setImgSize(img,w,h) {
img.removeAttribute("width");
img.removeAttribute("height");
var pic;
if(document.all) {
var pic=new Image();
pic.src=img.src;
}else pic=img;
//check images exist and width&height >0 and custom width >0
if(pic&&pic.width&&pic.height&&w) {
if(!h) h=w;
if(pic.width>w||pic.height>h) {
var scale=pic.width/pic.height,fit=scale>=w/h;
if(document.all)img=img.style;
img[fit?'width':'height']=fit?w:h;
if(document.all)img[fit?'height':'width']=(fit?w:h)*(fit?1/scale:scale);
}
}
}
/*
[[[[[[[[[[[[[[  此js方法在生意经admin 后台广泛使用（任务系统）  ]]]]]]]]]]]]]]]
描述：	selectCheckBoxAll : 全选或全不选指定className 节点下的复选框
参数：	c       - (Str)  特有的className
nm      - (Str) checkbox 的name 属性:
b       - (Bool) 是否全选 true-全选 false-全不选，默认全不选
*/
function selectCheckBoxAll(c,nm,b){
var cks = FYS('.'+c+' input[name='+nm+']');
var i = cks.length;
while( i-- > 0 ){
cks[i].checked = b || false;
}
}
/*
描述：监控input或 textarea的keyup事件，限制输入字符串长度
参数：	e     - (Eve) 事件对象
bytes - (Num) 字节数
pmtid - (Str) 提示区域id
pmtct - (Str) 提示内容
type  - (Num) 0 - 单位字节数 1 - 字符数
*/
function keyupLenLimit(e,bytes,pmtid,pmtct,type){
var o = FYE.getTarget(e);
bytes = bytes || 12;
pmtct = pmtct || '';
type = type || 0;
if(!type && o.value.lenB() >= bytes){
o.value = o.value.cut(bytes);
if(FYG(pmtid)){FYG(pmtid).innerHTML = pmtct}
return true;
}else if(type && o.value.length >= bytes){
o.value = o.value.substr(0,bytes);
if(FYG(pmtid)){FYG(pmtid).innerHTML = pmtct}
return true;
}else{
if(FYG(pmtid)){FYG(pmtid).innerHTML = ''}
return false;
}
}
/*
描述：点击按钮调用此函数，显示或隐藏目标对象并修改按纽文案
参数：	o      - (Obj) 事件触发对象
pm[0]  - (Str) 事件触发对象展示的文案（当目标对象未显示）
pm[1]  - (Str) 事件触发对象展示的文案（当目标对象显示中）
pm[2]  - (Str) 事件触发对象的className（当目标对象未显示）
pm[3]  - (Str) 事件触发对象的className（当目标对象显示中）
pm[4]  - (Str) 需要被隐藏或被显示的对象的id
pm[5]  - (Str) 需要被隐藏或被显示的对象的id 与 pm[4] 互斥
pm[6]  - (Str) 需要被隐藏或被显示的对象隐藏状态的 替代 className，由此可实现半截隐藏功能
pfun   - (Str) 传入的过程函数
*/
function closeOrOpen(o,pm,pfun){
o = FYG(o);
//pm[0] = pm[0] || '';				//需要隐藏或显示的对象节点id
//pm[1] = pm[1] || '';				//隐藏状态文案
//pm[2] = pm[2] || o.innerHTML;		//显示状态文案
//pm[3] = pm[3] || '';				//隐藏状态className
//pm[4] = pm[4] || '';				//显示状态className
//pfun = pfun || '';				//传入的过程函数，默认使用过程A
//o.blur();
var t,d,c;
if( t = FYG(pm[4])){
if(t.getAttribute('locked') == 1){return}
t.setAttribute('locked',1);
if(c = t.getAttribute('isClosed')){
}else{
c = pm[6] && FYD.hasClass(t,pm[6]) || (FYD.getStyle(t,'display') == 'none')
}
FYD.setStyle(t,'display','block');
if( typeof(pfun) != 'undefined' && YAHOO.lang.isFunction(pfun)){
pfun(o,c,pm)
}else{
closeOrOpenCall(o,c,pm)
}
}
}
/*
描述：closeOrOpen 的内调函数
参数：	o      - (obj) 事件触发对象
c      - (Bool) 是否已经为隐藏状态
pm[0]  - (Str) 事件触发对象展示的文案（当目标对象未显示）
pm[1]  - (Str) 事件触发对象展示的文案（当目标对象显示中）
pm[2]  - (Str) 事件触发对象的className（当目标对象未显示）
pm[3]  - (Str) 事件触发对象的className（当目标对象显示中）
pm[4]  - (Str) 需要被隐藏或被显示的对象的id
pm[5]  - (Str) 需要被隐藏或被显示的对象的id 与 pm[4] 互斥
pm[6]  - (Str) 需要被隐藏或被显示的对象隐藏状态的 替代 className，由此可实现半截隐藏功能
ex     - (Bool) 附加参数，解决ie6下设置display 抖动现象
*/
function closeOrOpenCall(o,c,pm,ex){
ex = ex || 0;
if(o && YAHOO.lang.trim(o.innerHTML)){
o.innerHTML = c ? pm[1] : pm[0];
if( pm[2] && pm[3] ){
o.className = c ? pm[3] : pm[2];
}
}else if(o && o.value){
o.value = c ? pm[1] : pm[0];
}
FYG(pm[4]).setAttribute('isClosed',c ? '':'1');
if(!ex){
if(pm[6]){
if(c){
FYD.removeClass(pm[4],pm[6]);
}else{
FYD.addClass(pm[4],pm[6]);
}
}else{
FYD.setStyle(pm[4],'display',c ? 'block' : 'none');
FYD.setStyle(pm[5],'display',c ? 'none' : 'block');
}
}
FYG(pm[4]).setAttribute('locked','0');
}
/*
描述：	pageJumpInpLimit 方法，适用于通用翻页，针对输入页码的input text的键盘输入限制
只允许输入 0-9 数字和 上下左右方向 del  back 键
参数：	ipt    - (str/obj) input text 对象或对象id
num      - (Bool) 最大页码数
*/
function pageJumpInpLimit(ipt,num){
FYE.on(ipt,'keyup',function (e){
if( !( e.keyCode >= 37 && e.keyCode <= 40 || e.keyCode == 46 || e.keyCode == 8 ) ){
var v = parseInt(this.value) || 0;
var t = num || 0;
if( v > t ){
this.value = t;
}else if( v < 1 ){
this.value = 1;
}else{
this.value = v;
}
}
})
}
/*
描述：	swInitialize : 简单的swich 切换初始化方法，使用鼠标移上或点击切换
依赖：	html 结构示例
<ul>
<li class="pswitch-a cur"><a href="">当前选项</a></li>
<li class="pswitch-a last"><a href="">普通选项</a></li>
</ul>
<dl>
<dd class="pswitch-b">第一个选项对应的内容区块</dd>
<dd class="pswitch-b">第二个选项对应的内容区块</dd>
</dl>
参数：	arr			- (Arr) 待处理的对象class名数组，必须包含两个class名，例如：xxx-a  xxx-b 组成一对，xxx-a是触发器，xxx-b是容器
curNum				- (Num) 当前激活的序号数，从 0 开始计数
eventType			- (Str) 事件类型
*/
function swInitialize(arr,curNum,eventType){
var lisa = FYS('.'+arr[0]);
var lisb = FYS('.'+arr[1]);
if(lisa.length && lisb.length && lisa.length == lisb.length){
var ulb = lisb[0].parentNode;
var curNum = curNum || 0;
var eventType = eventType || 'mouseover';
ulb.setAttribute('cur',curNum);
for(var i=0,l=lisb.length; i<l; i++){
if(i != curNum){
FYD.setStyle(lisb[i],'display','none');
}
else{
FYD.setStyle(lisb[i],'display','block');
}
}
for(i=0,l=lisa.length; i<l; i++){
lisa[i].setAttribute('num',i)
if(i == curNum){
FYD.addClass(lisa[i],'cur');
}else{
FYD.removeClass(lisa[i],'cur');
}
FYE.on(lisa[i],eventType,function (e){
var c = parseInt(ulb.getAttribute('cur'));
var t = this;
var n = t.getAttribute('num');
FYD.removeClass(lisa[c],'cur');
FYD.setStyle(lisb[c],'display','none');
FYD.addClass(t,'cur');
FYD.setStyle(lisb[n],'display','block');
ulb.setAttribute('cur',n)
})
}
}
}
//浮动窗口组件
/**
* FD.widget.SidePoper
*
* 边界浮出类
* 限制：
* 		1、此类对象限于viewport边界附近的浮出和隐去
* 		2、必须包含js/core/fdev.js(不依赖js/core/yui/animation.js)
* 		3、如果未提供必要的css设置（触点样式）则还需要包含css/widget/sidepoper.css文件
* 调用方法：
FD.widget.SidePoper.init('SidePop-1','http://blog.china.alibaba.com/misc/pop/searchPop.html?keywords=mp3',{dockSide:0,baseline:1,bias:300,expandDir:0,initWidth:353,initHeight:280,remainArea:26});
FD.widget.SidePoper.init('SidePop-2','<div>...</div>',{dockSide:0,baseline:1,bias:300,expandDir:0,initWidth:353,initHeight:280,remainArea:26});
*
*
* @author 	balibell
* @link    http://www.fdev-lib.cn/
*/
FD.widget.SidePop = function (id,cont,cfg){
this.init(id,cont,cfg);
}
FD.widget.SidePop.defConfig = {
originWidth : null,						/* 对象区域完全宽度 */
originHeight : null,					/* 对象区域完全高度 */
initWidth : null,						/* 对象区域初始宽度 */
initHeight : null,						/* 对象区域初始高度 */
remainArea : 32,						/* 收起后，保留的区域宽度 */
initTop : null,							/* 对象初始的top值 默认为null值情况下，如果baseline==1 则浮出对象从底部弹出*/
btnset : 3,								/* 设置功能按钮 0-无 1-有关闭功能 2-有展开缩小功能 3-有前面两个功能*/
scroll : 1,								/* 是否跟随滚动轴滚动 1-是 0-否*/
initExe : 0,							/* 初始化完毕执行的方法 0-不执行任何方法 1-执行maxIt() 2-执行minIt() 3-执行close()*/
exeDelay : 0,							/* 初始化完毕执行的方法 延迟执行 ms为单位*/
doAfterClose : null,					/* 关闭后执行 */
dockSide : 1,							/* 停靠方向 0-左边停靠  >1-右边停靠*/
departure : 0,							/* 偏离停靠边的距离 值为center时 居中*/
baseline : 0,							/* 0:上基线-viewport上边界；1:下基线-viewport下边界；2:上基线，原位置顶部之下开始随滚动轴滚动 */
isFixed : 0,							/* 是否使用position:fixed 属性*/
bias :0,								/* 偏离基线的距离 值为middle时 居中*/
expandDir : 0,							/* 展开方向 0-上下 1-左右*/
expandSpeed : 0.1,						/* 展开或隐去的速度 */
floatSpeed : 0.2,						/* 滚动跟随的速度 */
defaultShell : 0,						/* 0-无外框 1-使用默认的外框 */
shellBlank : 8,							/* 当defaultShell 生效时，此参数表示外框和内容间非展开方向上的留白 */
zIndex : 1000							/* 浮出层zindex */
};
//SidePop类 purge 函数，可根据对象id purge 对象或，全部 purge
FD.widget.SidePop.purge = function (id){
//实例化该类的purge 对象
var p = new FD.widget.SidePop('sidePop-purge','',{});
var i = p.registry.length;
while( i-- > 0 ){
if(id && p.registry[i].obj.id == id ){ //如果根据id 查找到相应对象
p.registry[i].close(); //目标对象关闭
p.close();	//purge 对象关闭
p.registry.pop(); //对象注册数组弹出 purge 对象
p.registry[i] = p.registry[p.registry.length-1]; //目标对象置换到对象注册数组尾部
p.registry.pop();//弹出目标对象
return;
}else if(!id){
p.registry[i].close(); //如果没有传入特定id，循环关闭所有对象
}
}
p.close();//purge 对象关闭
if( id && i == 0 ){
p.registry.pop(); //有传入id，但未寻获与id对应的对象，则执行 对象注册数组弹出 purge 对象
}else{
p.registry = []; //未传入id，清空对象注册数组。 还有一种情况，传入了id，并且寻找到对象，在之上 return 出去了
}
}
FD.widget.SidePop.prototype = {
registry : [],
init: function (id,cont,cfg){
this.config = FD.common.applyIf(cfg||{}, FD.widget.SidePop.defConfig);
/*************************
功能区字符串生成
*************************/
var btns = ['none','none','none'];
//根据btnset 设置功能区按钮
if(this.config.btnset == 1){
btns[2] = '';
}else if(this.config.btnset == 2){
btns[0] = '';
}else if(this.config.btnset > 2){
btns[2] = '';
btns[0] = '';
}
//浮出控制栏字符串，提供关闭、最小化、还原功能，依赖样式
var strBar = ['<div id="',id,'-bar" class="f-sidebar"><a id="',id,'-min" class="f-sidemin" style="display:',btns[0],'" href="javascript:void(0)" target="_self"></a><a id="',id,'-res" class="f-sideres" style="display:',btns[1],'" href="javascript:void(0)" target="_self"></a><a id="',id,'-close" class="f-sideclose" style="display:',btns[2],'" href="javascript:void(0)" target="_self"></a></div>'].join('');
/*************************
创建对象节点
*************************/
//如果对象id不存在，新建div，为浮出层最外层div，并设置其id
if(!(this.obj = FYG(id))){
//如果未设置初始宽（高）度，则取值100
this.config.initWidth = this.config.initWidth || 100;
this.config.initHeight = this.config.initHeight || 100;
this.config.originWidth = this.config.originWidth || this.config.initWidth;
this.config.originHeight = this.config.originHeight || this.config.initHeight;
this.obj = document.createElement('div');
this.obj.id = id;
//页面加载对象
document.body.appendChild(this.obj);
var d = this.config.defaultShell;
var strShellTop = d ? '<div class="f-sidepop"><div class="tt f-sidepop-tt"><div class="ttl"></div><div class="ttr"></div><div class="ttc">'+d+'<p></p></div><div class="ttr"></div></div><div class="f-sidepop-cont"><div class="f-sidepop-contin">' : '';
var strShellBot =  d ? '' : '</div></div></div>'
var s = d ? this.config.expandDir == 0 ? [this.config.shellBlank,this.config.remainArea] : [this.config.remainArea,this.config.shellBlank] : [0,0];
var cw = [];
cw[0] = this.config.expandDir == 1 && d ? this.config.initWidth : this.config.originWidth;
cw[1] = this.config.expandDir == 0 && d ? this.config.initHeight : this.config.originHeight;
//浮出内容字符串 strCont
//情况1：传入cont 为url地址，调用 iframe 模式
//情况2：传入cont 为html代码，调用非 iframe 模式
var strCont = cont.match(/^http:\/\//g) ?
/*  iframe 模式*/['<iframe id="',id,'-cont" src="',cont,'" allowTransparency="true" frameborder="0" scrolling="no" width="',cw[0] - s[0],'" height="',cw[1]  - s[1],'" ></iframe>'].join('') :
/*非iframe 模式*/['<div id="',id,'-cont" style="overflow:hidden;width:',cw[0] - s[0],'px;height:',cw[1] - s[1],'px;">',cont,'</div>'].join('');
//装载内容，浮出内容字符串 + 浮出控制栏字符串
this.obj.innerHTML = [strShellTop,strCont,strShellBot,strBar].join('');
}else{
if(YAHOO.lang.isString(cont) && cont){
if(cont.match(/^http:\/\//g)){
//iframe 模式
FYG(id+'-cont').src = cont;
}else{
//普通容器模式
FYG(id+'-cont').innerHTML = cont;
}
}
this.obj.style.display = 'block';
//如果未设置初始宽（高）度，则取值offsetWidth（offsetHeight）
var w =  parseInt(0 + FYD.getStyle(this.obj,'borderLeftWidth')) + parseInt(0 + FYD.getStyle(this.obj,'borderRightWidth'))
this.config.initWidth = this.config.initWidth || this.obj.offsetWidth - w;
this.config.initHeight = this.config.initHeight || this.obj.offsetHeight - w;
this.config.originWidth = this.config.originWidth || this.config.initWidth;
this.config.originHeight = this.config.originHeight || this.config.initHeight;
//为已存在的对象添加功能区（最小化、还原、关闭）
var barobj = document.createElement('span');
barobj.innerHTML = strBar;
this.obj.appendChild(barobj);
}
this.expandObj = d ? FYG(id+'-cont') : this.obj;
/*************************
对象基本属性设置
*************************/
this.obj.style.position = 'absolute';
this.obj.style.overflow = 'hidden';
this.obj.style.zIndex = this.config.zIndex;
this.obj.style.width = this.config.initWidth + 'px';
this.obj.style.height = this.config.initHeight + 'px';
this.config.departure = this.config.departure == 'center' ? ( FYD.getViewportWidth() - this.obj.offsetWidth )/2 : this.config.departure;
this.config.bias = this.config.bias == 'middle' ? ( FYD.getViewportHeight() - this.obj.offsetHeight )/2 : this.config.bias;
if(YAHOO.env.ua.ie == 6 && this.config.baseline == 0 || YAHOO.env.ua.ie == 7 && this.config.baseline == 1 || YAHOO.env.ua.opera && this.config.baseline == 0){
this.config.bias += 2
}else if(YAHOO.env.ua.ie == 6 && this.config.baseline == 1 || YAHOO.env.ua.opera && this.config.baseline == 1){
this.config.bias -= 2
}
this.obj.style.left = this.config.dockSide ? 'auto' : this.config.departure + 'px';
this.obj.style.right = this.config.dockSide ? this.config.departure + 'px' : 'auto';
/*************************
功能区按钮事件绑定
*************************/
//临时对象，方便事件绑定。以下绑定功能区按钮相关事件
var _this = this;
//关闭按钮事件绑定
FYE.on(_this.obj.id+'-close','click',function (){
_this.close();
_this.doAfterClose();
return false;
});
//最小化按钮事件绑定
FYE.on(_this.obj.id+'-min','click',function (){
_this.minIt();
return false;
});
//恢复按钮事件绑定
FYE.on(_this.obj.id+'-res','click',function (){
_this.maxIt();
return false;
});
/*************************
随滚动轴滚动的参数设定
*************************/
//设置初始状态的top 值，之前已设置过 position:absolute;
this.obj.style.top =  (this.config.initTop == null ? this.config.baseline == 0 ? 0 : FYD.getViewportHeight() + FYD.getDocumentScrollTop() : this.config.initTop) + 'px';
this.firstScroll = this.lastScroll = -this.config.bias; //firstScroll lastScroll 在 scrollWidth 方法中使用
if(this.config.baseline == 2){//如果 baseline == 2 当滚动轴滚动至对象原来位置的下方，开始有效浮动
this.obj.style.top = 0;
this.obj.style.position = 'relative';
//this is new
if(YAHOO.env.ua.ie != 6 && this.config.isFixed == 1){
this.firstLeftX = FYD.getX(this.obj);
var vhold = document.createElement('div');
this.obj.parentNode.insertBefore(vhold,this.obj);
vhold.appendChild(this.obj);
FYD.setStyle(vhold,'height',this.obj.offsetHeight + 'px');
}
///////////////////
}else if(this.config.baseline == 1){//如果 baseline == 1 基线为viewport 底部，此时bias 为距离底部的高度
this.lastScroll = this.obj.offsetHeight - FYD.getViewportHeight() -  FYD.getDocumentScrollTop();
this.firstScroll = this.lastScroll - this.config.bias;
if(YAHOO.env.ua.ie != 6 && this.config.isFixed == 1){
FYD.setStyle(this.obj,'position','fixed');
FYD.setStyle(this.obj,'top','auto');
FYD.setStyle(this.obj,'bottom',this.config.bias + 'px');
}
}
this.aTop =  FYD.getY(this.obj);
//timer控制器，在最小化、恢复原状过程中起作用
this.expandTimer = null;
//timer控制器，在滚动跟随过程中起作用
this.scrollTimer = null;
//this.expandObj 对象当前高（宽）度，在显示或隐去过程中改变，与对象高度实时保持一致
//当defaultShell 生效时，this.expandObj 指代内容对象，不包括外框。
if(this.config.expandDir == 0){ //垂直方向展开收拢
this.size = d ? this.config.initHeight - this.config.remainArea : this.config.initHeight;
}else if(this.config.expandDir == 1){//水平方向展开收拢
this.size = d ? this.config.initWidth - this.config.remainArea : this.config.initWidth;
}
//根据initExe设置执行相关方法
if(this.config.initExe == 1){
setTimeout(function (){
_this.maxIt();
},this.config.exeDelay)
}else if(this.config.initExe == 2){
setTimeout(function (){
_this.minIt();
},this.config.exeDelay)
}else if(this.config.initExe == 3){
setTimeout(function (){
if(FYD.getStyle(this.obj,'display') == 'none'){return}
_this.close();
_this.doAfterClose();
},this.config.exeDelay)
}
//根据scroll设置执行相关方法
if(this.config.scroll){
this.scrollWith();
}
this.registry.push(this) //将新对象 push 入对象注册数组，即注册新对象
},
/*
功能区功能之 关闭功能
*/
close: function (){
//清除各种timer
clearTimeout(this.expandTimer);
clearInterval(this.scrollTimer);
FYE.purgeElement(this.obj.id+'-res')
FYE.purgeElement(this.obj.id+'-min')
FYE.purgeElement(this.obj.id+'-close')
//将对象设为隐藏
FYD.setStyle(this.obj,'display','none');
var tmp;
if(tmp=FYG(this.obj.id+'-bar')){
FYG(this.obj.id+'-bar').parentNode.removeChild(tmp)
}
},
/*
关闭功能辅助，关闭后执行
*/
doAfterClose: function (){
if(YAHOO.lang.isFunction(this.config.doAfterClose)){
this.config.doAfterClose();
}
},
/*
功能区功能之 最小化功能
*/
minIt: function (){
var _this = this;
//		if(FYU.Anim){
//			var an = _this.config.expandDir ? new FYU.Anim(_this.obj,{
//				width : { from : _this.size , to : _this.config.remainArea }
//			},2*_this.config.expandSpeed) : new FYU.Anim(_this.obj,{
//				height : { from : _this.size , to : _this.config.remainArea }
//			},2*_this.config.expandSpeed)
//			an.animate();
//			an.onComplete.subscribe(function (){
//				//设置最小化、恢复等功能区按钮状态
//				FYD.setStyle(_this.obj.id+'-min','display','none');
//				FYD.setStyle(_this.obj.id+'-res','display','block');
//			});
//			an.onTween.subscribe(function (){
//				_this.size = _this.config.expandDir ? parseInt(_this.obj.style.width) : parseInt(_this.obj.style.height);
//			});
//		}else{
//最小化过程函数，递归调用自身，满足条件跳出递归
(function _minIt(){
var theRemain = _this.config.defaultShell ? 0 : _this.config.remainArea;
var condition = [_this.size <= theRemain];
//满足条件跳出递归，条件1：对象当前高度小于等于对象预留高（宽）度（仅显示标题状态）
if(condition[0]){
window.clearTimeout(_this.expandTimer);
//设置最小化、恢复等功能区按钮状态
FYD.setStyle(_this.obj.id+'-min','display','none');
FYD.setStyle(_this.obj.id+'-res','display','block');
//innerCall(0);
//跳出递归
return;
}
//计算每单位时间内移动的距离，其值等于伪速率乘以对象当前高度
var len = _this.config.expandSpeed * _this.size;
len = len < 1 ? 1 : len;
//对象当前高度数值计算，满足条件1，其值等于对象预留高（宽）度，不满足条件1，其值自减len
_this.size = _this.size - len <= theRemain ? theRemain : _this.size - len;
//设置对象高度
if( _this.config.expandDir ){
_this.expandObj.style.width = _this.size + 'px';
if( _this.config.defaultShell ){
_this.obj.style.width = _this.size + _this.config.remainArea + 'px'
}
}else{
_this.expandObj.style.height = _this.size + 'px';
if( _this.config.defaultShell ){
_this.obj.style.height = _this.size + _this.config.remainArea + 'px'
}
}
//递归调用自身
_this.expandTimer = window.setTimeout(_minIt,10);
})();
//		}
},
/*
功能区功能之 还原功能
*/
maxIt: function (){
var _this = this;
//		if(FYU.Anim){
//			var an = _this.config.expandDir ? new FYU.Anim(_this.obj,{
//				width : { from : _this.size , to : _this.config.originWidth }
//			},2*_this.config.expandSpeed) : new FYU.Anim(_this.obj,{
//				height : { from : _this.size , to : _this.config.originHeight }
//			},2*_this.config.expandSpeed);
//			an.animate();
//			an.onComplete.subscribe(function (){
//				//设置最小化、恢复等功能区按钮状态
//				FYD.setStyle(_this.obj.id+'-min','display','block');
//				FYD.setStyle(_this.obj.id+'-res','display','none');
//			});
//			an.onTween.subscribe(function (){
//				_this.size = _this.config.expandDir ? parseInt(_this.obj.style.width) : parseInt(_this.obj.style.height);
//			});
//		}else{
//最小化过程函数，递归调用自身，满足条件跳出递归
(function _maxIt(){
var theOrigin = _this.config.expandDir ?  _this.config.originWidth : _this.config.originHeight;
theOrigin -= _this.config.defaultShell ? _this.config.remainArea : 0;
var condition = [_this.size >= theOrigin]
//满足条件跳出递归，条件1：对象当前高度大于等于对象原始高度（完全显示状态）
if(condition[0]){
window.clearTimeout(_this.expandTimer);
//设置最小化、恢复等功能区按钮状态
FYD.setStyle(_this.obj.id+'-min','display','block');
FYD.setStyle(_this.obj.id+'-res','display','none');
//					FYD.setStyle(_this.obj,'visibility','hidden');
//					FYD.setStyle(_this.obj,'visibility','visible');
//跳出递归
return;
}
//计算每单位时间内移动的距离，其值等于伪速率乘以对象原始高度，为匀速
var len = _this.config.expandSpeed * theOrigin;
len = len < 1 ? 1 : len;
_this.size = _this.size + len >= theOrigin ? theOrigin : _this.size + len;
//设置对象高度
if( _this.config.expandDir ){
_this.expandObj.style.width = _this.size + 'px';
if( _this.config.defaultShell ){
_this.obj.style.width = _this.size + _this.config.remainArea + 'px'
}
}else{
_this.expandObj.style.height = _this.size + 'px';
if( _this.config.defaultShell ){
_this.obj.style.height = _this.size + _this.config.remainArea + 'px'
}
}
//递归调用自身
_this.expandTimer = window.setTimeout(_maxIt,10);
})();
//		}
},
/*
浮动对象随滚动轴滚动
*/
scrollWith : function(){
var _this = this;
//this is new
if(YAHOO.env.ua.ie != 6 && _this.config.baseline != 2  && _this.config.isFixed == 1){
FYD.setStyle(_this.obj,'position','fixed');
return;
}
//////////////
_this.scrollTimer = window.setInterval(function (){
var dscrtop = FYD.getDocumentScrollTop();
var a = _this.config.baseline;
var perlen;
var fall = _this.obj.offsetHeight - FYD.getViewportHeight();
fall  = fall < 0 ? 0 : fall;
if(a == 0){//baseline == 0 以viewport 顶部为基线
perlen = _this.config.floatSpeed*(dscrtop - _this.lastScroll - _this.aTop - fall);
}else if(a == 1){//baseline == 1  以viewport 底部为基线
perlen = _this.config.floatSpeed*(- _this.lastScroll  + _this.firstScroll + FYD.getViewportHeight() + dscrtop - _this.obj.offsetHeight - _this.aTop );
}else{//baseline == 2 特殊处理 以viewport 顶部为基线
//this is new
var tmpsp = _this.config.floatSpeed*(dscrtop - _this.aTop - _this.lastScroll - fall);
if(dscrtop - _this.aTop > 0 || (FYD.getY(_this.obj)) > _this.aTop){
if(YAHOO.env.ua.ie != 6 && _this.config.isFixed == 1){
perlen = 0;
FYD.setStyle(_this.obj,'position','fixed');
FYD.setStyle(_this.obj,'left',_this.firstLeftX + 'px');
}else{
perlen = tmpsp;
}
}else{
if(YAHOO.env.ua.ie != 6 && _this.config.isFixed == 1){
perlen = 0;
FYD.setStyle(_this.obj,'position','relative');
FYD.setStyle(_this.obj,'left',0);
}else{
perlen = 0;
}
}
//////////////
}
if( perlen > -0.2 && perlen < 0.2 ){
return
}else{
perlen = perlen>0 ? Math.ceil(perlen) : perlen=Math.floor(perlen)
}
_this.obj.style.top = parseInt(_this.obj.style.top) + perlen + "px"
if(a > 1 && parseInt(_this.obj.style.top) <= 0){//baseline == 2 特殊处理 以viewport 顶部为基线
_this.obj.style.top = 0;
_this.lastScroll = _this.firstScroll;
}else{
_this.lastScroll += perlen;
}
},10);
}
}
/**
* SidePoper 的封装，创建不同的 SidePop 对象
*/
FD.widget.SidePoper = new function() {
this.init = function(id,cont,cfg) {
return new FD.widget.SidePop(id,cont,cfg);
}
}
/*
描述：	生意经小机器人的布点，目前已经在以下4个页面布点，
http://service.china.alibaba.com/kf/index.html
http://service.china.alibaba.com/kf/selfservice.html
http://page.china.alibaba.com/aliguide/user_guide.html
http://page.china.alibaba.com/aliguide/suppliers/suppliers.html
依赖：	/fdevlib/widget/popwindow/fdev-sidepoper.js  用到了sidepoper 浮出窗口组件
*/
function robotSidePoperStart(u){
FD.widget.SidePoper.init('sidePop-robot','<a href="'+u+'" target="_blank"><img src="http://img.china.alibaba.com/news/upload/0/02_1280805964041.gif" onmouseover="this.src=\'http://img.china.alibaba.com/news/upload/0/01_1280805964031.gif\'" onmouseout="this.src=\'http://img.china.alibaba.com/news/upload/0/02_1280805964041.gif\'"/></a>', {btnset:0,dockSide:1,expandDir:0,baseline:0,bias:200,scroll:1,initWidth:150,initHeight:108});
}
FYE.onDOMReady(function (){
var p =
[
{str:'?instanceCode=ALIR00000161&scenceCode=SCEN00000183&digest=7e79529962d1c8626edd19cfcf829be5',url:'http://service.china.alibaba.com/kf/index.html'},
{str:'?instanceCode=ALIR00000161&scenceCode=SCEN00000184&digest=bdc0e570df70bb1ad7980a213b4ed451',url:'http://service.china.alibaba.com/kf/selfservice.html'},
{str:'?instanceCode=ALIR00000161&scenceCode=SCEN00000185&digest=627af130688e33e9688868c4d02449c7',url:'http://page.china.alibaba.com/aliguide/user_guide.html'},
{str:'?instanceCode=ALIR00000161&scenceCode=SCEN00000186&digest=170f314340c504e06d78c82f851c768f',url:'http://page.china.alibaba.com/aliguide/suppliers/suppliers.html'},
{str:'?instanceCode=ALIR00000161&scenceCode=SCEN00001226&digest=3898cc1a50a4201f43cfb532c90e53ac',url:'http://alitalk.alibaba.com.cn/index.html'}
];
for(var i=0,l=p.length;i<l;i++){
if(window.location.href.match(p[i].url)){
var bb=encodeURIComponent('http://portal.manjushri.alibaba.com/portal/portal/init.jspa' + p[i].str);
var cc ="http://china.alibaba.com/member/sso/sso.do?to_url="+bb+"&unlogin_url="+bb;
robotSidePoperStart(cc)
}
}
/*机器人布点二期需求，detail，list，taglist，question页面
---- begin ----*/
var localurl = window.location.href;
if(localurl.indexOf('service.china.alibaba.com/kf/detail')!=-1){
robotSidePoperStart('http://china.alibaba.com/member/sso/sso.do?to_url=http%3A%2F%2Fportal.manjushri.alibaba.com%2Fportal%2Fportal%2Finit.jspa%3FinstanceCode%3DALIR00000161&scenceCode%3DSCEN00001248&digest%3D90ac8aa456d08008b5a99745f19954cb&unlogin_url=http%3A%2F%2Fportal.manjushri.alibaba.com%2Fportal%2Fportal%2Finit.jspa%3FinstanceCode%3DALIR00000161&scenceCode%3DSCEN00001248&digest%3D90ac8aa456d08008b5a99745f19954cb ')
}else if(localurl.indexOf('service.china.alibaba.com/kf/list')!=-1 ){
robotSidePoperStart('http://china.alibaba.com/member/sso/sso.do?to_url=http%3A%2F%2Fportal.manjushri.alibaba.com%2Fportal%2Fportal%2Finit.jspa%3FinstanceCode%3DALIR00000161&scenceCode%3DSCEN00001246&digest%3D238012655d809d5626598a312136a99e&unlogin_url=http%3A%2F%2Fportal.manjushri.alibaba.com%2Fportal%2Fportal%2Finit.jspa%3FinstanceCode%3DALIR00000161&scenceCode%3DSCEN00001246&digest%3D238012655d809d5626598a312136a99e ')
}else if(localurl.indexOf('service.china.alibaba.com/kf/taglist')!=-1 ){
robotSidePoperStart('http://china.alibaba.com/member/sso/sso.do?to_url=http%3A%2F%2Fportal.manjushri.alibaba.com%2Fportal%2Fportal%2Finit.jspa%3FinstanceCode%3DALIR00000161&scenceCode%3DSCEN00001247&digest%3D2b539ab8d370a98f029b633f82e71667&unlogin_url=http%3A%2F%2Fportal.manjushri.alibaba.com%2Fportal%2Fportal%2Finit.jspa%3FinstanceCode%3DALIR00000161&scenceCode%3DSCEN00001247&digest%3D2b539ab8d370a98f029b633f82e71667 ')
}else if(localurl.indexOf('http://service.china.alibaba.com/kf/question.html')!=-1){
robotSidePoperStart('http://china.alibaba.com/member/sso/sso.do?to_url=http%3A%2F%2Fportal.manjushri.alibaba.com%2Fportal%2Fportal%2Finit.jspa%3FinstanceCode%3DALIR00000161&scenceCode%3DSCEN00001245&digest%3Dd89e1b85fca0e5167766302f49eec15c&unlogin_url=http%3A%2F%2Fportal.manjushri.alibaba.com%2Fportal%2Fportal%2Finit.jspa%3FinstanceCode%3DALIR00000161&scenceCode%3DSCEN00001245&digest%3Dd89e1b85fca0e5167766302f49eec15c ')
}
})
