var YAO=function(){var D=document,OA="[object Array]",FC="[object Function]",OP=Object.prototype,nt="nodeType",listeners=[],webkitKeymap={63232:38,63233:40,63234:37,63235:39,63276:33,63277:34,25:9},patterns={HYPHEN:/(-[a-z])/i,ROOT_TAG:/body|html/i},lastError=null;return{isArray:function(obj){return OP.toString.apply(obj)===OA},isString:function(s){return typeof s==="string"},isBoolean:function(b){return typeof b==="boolean"},isFunction:function(func){return OP.toString.apply(func)===FC},isNull:function(obj){return obj===null},isNumber:function(num){return typeof num==="number"&&isFinite(num)},isObject:function(str){return(str&&(typeof str==="object"||this.isFunction(str)))||false},isUndefined:function(obj){return typeof obj==="undefined"},hasOwnProperty:function(obj,prper){if(OP.hasOwnProperty){return obj.hasOwnProperty(prper)}return !this.isUndefined(obj[prper])&&obj.constructor.prototype[prper]!==obj[prper]},isMobile:function(mobile){return/^(13|15|18)\d{9}$/.test(YAO.trim(mobile))},isName:function(name){return/^[\w\u4e00-\u9fa5]{1}[\w\u4e00-\u9fa5 \.]{0,19}$/.test(YAO.trim(name))},keys:function(obj){var b=[];for(var p in obj){b.push(p)}return b},values:function(obj){var a=[];for(var p in obj){a.push(obj[p])}return a},isXMLDoc:function(obj){return obj.documentElement&&!obj.body||obj.tagName&&obj.ownerDocument&&!obj.ownerDocument.body},formatNumber:function(b,e){e=e||"";b+="";var d=b.split(".");var a=d[0];var c=d.length>1?"."+d[1]:"";var f=/(\d+)(\d{3})/;while(f.test(a)){a=a.replace(f,"$1,$2")}return e+a+c},unformatNumber:function(a){return a.replace(/([^0-9\.\-])/g,"")*1},stringBuffer:function(){var a=[];for(var i=0;i<arguments.length;++i){a.push(arguments[i])}return a.join("")},trim:function(str){try{return str.replace(/^\s+|\s+$/g,"")}catch(a){return str}},stripTags:function(str){return str.replace(/<\/?[^>]+>/gi,"")},stripScripts:function(str){return str.replace(/<script[^>]*>([\\S\\s]*?)<\/script>/g,"")},isJSON:function(obj){obj=obj.replace(/\\./g,"@").replace(/"[^"\\\n\r]*"/g,"");return(/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(obj)},encodeHTML:function(str){return str.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},decodeHTML:function(str){return str.replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">")},toCamel:function(property){if(!patterns.HYPHEN.test(property)){return property}if(propertyCache[property]){return propertyCache[property]}var converted=property;while(patterns.HYPHEN.exec(converted)){converted=converted.replace(RegExp.$1,RegExp.$1.substr(1).toUpperCase())}propertyCache[property]=converted;return converted},Cookie:{set:function(g,c,f,b){var e=new Date();var a=new Date();if(f==null||f==0){f=1}a.setTime(e.getTime()+3600000*24*f);D.cookie=g+"="+encodeURI(c)+";expires="+a.toGMTString()+";domain="+b+"; path=/"},get:function(e){var b=D.cookie;var d=e+"=";var c=b.indexOf("; "+d);if(c==-1){c=b.indexOf(d);if(c!=0){return null}}else{c+=2}var a=D.cookie.indexOf(";",c);if(a==-1){a=b.length}return decodeURI(b.substring(c+d.length,a))},clear:function(b,a){if(this.get(b)){D.cookie=b+"="+((domain)?"; domain="+a:"")+"; expires=Thu, 01-Jan-70 00:00:01 GMT"}}},ua:function(){var C={ie:0,opera:0,gecko:0,webkit:0,mobile:null,air:0,caja:0},B=navigator.userAgent,A;if((/KHTML/).test(B)){C.webkit=1}A=B.match(/AppleWebKit\/([^\s]*)/);if(A&&A[1]){C.webkit=parseFloat(A[1]);if(/ Mobile\//.test(B)){C.mobile="Apple"}else{A=B.match(/NokiaN[^\/]*/);if(A){C.mobile=A[0]}}A=B.match(/AdobeAIR\/([^\s]*)/);if(A){C.air=A[0]}}if(!C.webkit){A=B.match(/Opera[\s\/]([^\s]*)/);if(A&&A[1]){C.opera=parseFloat(A[1]);A=B.match(/Opera Mini[^;]*/);if(A){C.mobile=A[0]}}else{A=B.match(/MSIE\s([^;]*)/);if(A&&A[1]){C.ie=parseFloat(A[1])}else{A=B.match(/Gecko\/([^\s]*)/);if(A){C.gecko=1;A=B.match(/rv:([^\s\)]*)/);if(A&&A[1]){C.gecko=parseFloat(A[1])}}}}}A=B.match(/Caja\/([^\s]*)/);if(A&&A[1]){C.caja=parseFloat(A[1])}return C}(),extend:function(subClass,superClass,override){if(!superClass||!subClass){throw new Error("extend failed, please check that all dependencies are included.")}var F=function(){};F.prototype=superClass.prototype;subClass.prototype=new F();subClass.prototype.constructor=subClass;subClass.superclass=superClass.prototype;if(superClass.prototype.constructor==Object.prototype.constructor){superClass.prototype.constructor=superClass}if(override){for(var p in override){subClass.prototype[p]=override[p]}}},augmentProto:function(sub,sup){if(!sub||!sup){throw new Error("augment failed, please check that all dependencies are included.")}var d=sub.prototype,g=sup.prototype,b=arguments,c,h;if(b[2]){for(c=2;c<b.length;c+=1){d[b[c]]=g[b[c]]}}else{for(h in g){if(!d[h]){d[h]=g[h]}}}},augmentObject:function(e,d){if(!d||!e){throw new Error("augment failed, please check that all dependencies are included.")}var b=arguments,c,f;if(b[2]){if(YAO.isString(b[2])){e[b[2]]=d[b[2]]}else{for(c=0;c<b[2].length;c+=1){e[b[2][c]]=d[b[2][c]]}}}else{for(f in d){e[f]=d[f]}}return e},clone:function(d,f){var e=function(){},b,c=arguments;e.prototype=d;b=new e;if(f){for(p in f){b[p]=f[p]}}return b},addListener:function(el,sType,fn,obj,overrideContext,bCapture){var oEl=null,context=null,wrappedFn=null;if(YAO.isString(el)){oEl=YAO.getEl(el);el=oEl}if(!el||!fn||!fn.call){return false}context=el;if(overrideContext){if(overrideContext===true){context=obj}else{context=overrideContext}}wrappedFn=function(e){return fn.call(context,YAO.getEvent(e,el),obj)};try{try{el.addEventListener(sType,wrappedFn,bCapture)}catch(e){try{el.attachEvent("on"+sType,wrappedFn)}catch(e){el["on"+sType]=wrappedFn}}}catch(e){lastError=e;this.removeListener(el,sType,wrappedFn,bCapture);return false}if("unload"!=sType){listeners[listeners.length]=[el,sType,fn,wrappedFn,bCapture]}return true},removeListener:function(el,sType,fn,bCapture){try{if(window.removeEventListener){return function(el,sType,fn,bCapture){el.removeEventListener(sType,fn,(bCapture))}}else{if(window.detachEvent){return function(el,sType,fn){el.detachEvent("on"+sType,fn)}}else{return function(){}}}}catch(e){lastError=e;return false}return true},on:function(el,sType,fn,obj,overrideContext){var oEl=obj||el,scope=overrideContext||this;return YAO.addListener(el,sType,fn,oEl,scope,false)},stopEvent:function(evt){this.stopPropagation(evt);this.preventDefault(evt)},stopPropagation:function(evt){if(evt.stopPropagation){evt.stopPropagation()}else{evt.cancelBubble=true}},preventDefault:function(evt){if(evt.preventDefault){evt.preventDefault()}else{evt.returnValue=false}},getEvent:function(e,boundEl){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},getCharCode:function(ev){var code=ev.keyCode||ev.charCode||0;if(YAO.ua.webkit&&(code in webkitKeymap)){code=webkitKeymap[code]}return code},_unload:function(e){var j,l;if(listeners){for(j=listeners.length-1;j>-1;j--){l=listeners[j];if(l){YAO.removeListener(l[0],l[1],l[3],l[4])}}l=null}YAO.removeListener(window,"unload",YAO._unload)},getEl:function(elem){var elemID,E,m,i,k,length,len;if(elem){if(elem[nt]||elem.item){return elem}if(YAO.isString(elem)){elemID=elem;elem=D.getElementById(elem);if(elem&&elem.id===elemID){return elem}else{if(elem&&elem.all){elem=null;E=D.all[elemID];for(i=0,len=E.length;i<len;i+=1){if(E[i].id===elemID){return E[i]}}}}return elem}else{if(elem.DOM_EVENTS){elem=elem.get("element")}else{if(YAO.isArray(elem)){m=[];for(k=0,length=elem.length;k<length;k+=1){m[m.length]=YAO.getEl(elem[k])}return m}}}}return null},hasClass:function(elem,className){var has=new RegExp("(?:^|\\s+)"+className+"(?:\\s+|$)");return has.test(elem.className)},addClass:function(elem,className){if(YAO.hasClass(elem,className)){return}elem.className=[elem.className,className].join(" ")},removeClass:function(elem,className){var replace=new RegExp("(?:^|\\s+)"+className+"(?:\\s+|$)","g");if(!YAO.hasClass(elem,className)){return}var o=elem.className;elem.className=o.replace(replace," ");if(YAO.hasClass(elem,className)){YAO.removeClass(elem,className)}},replaceClass:function(elem,newClass,oldClass){if(newClass===oldClass){return false}var has=new RegExp("(?:^|\\s+)"+newClass+"(?:\\s+|$)","g");if(!YAO.hasClass(elem,newClass)){YAO.addClass(elem,oldClass);return}elem.className=elem.className.replace(has," "+oldClass+" ");if(YAO.hasClass(elem,newClass)){YAO.replaceClass(elem,newClass,oldClass)}},getElByClassName:function(className,tag,rootId){var elems=[],i,tempCnt=YAO.getEl(rootId).getElementsByTagName(tag),len=tempCnt.length;for(i=0;i<len;++i){if(YAO.hasClass(tempCnt[i],className)){elems.push(tempCnt[i])}}if(elems.length<1){return false}else{return elems}},getStyle:function(el,property){if(document.defaultView&&document.defaultView.getComputedStyle){var value=null;if(property=="float"){property="cssFloat"}var computed=document.defaultView.getComputedStyle(el,"");if(computed){value=computed[YAO.toCamel(property)]}return el.style[property]||value}else{if(document.documentElement.currentStyle&&YAO.ua.ie){switch(YAO.toCamel(property)){case"opacity":var val=100;try{val=el.filters["DXImageTransform.Microsoft.Alpha"].opacity}catch(e){try{val=el.filters("alpha").opacity}catch(e){}}return val/100;break;case"float":property="styleFloat";default:var value=el.currentStyle?el.currentStyle[property]:null;return(el.style[property]||value)}}else{return el.style[property]}}},setStyle:function(el,property,val){if(YAO.ua.ie){switch(property){case"opacity":if(YAO.isString(el.style.filter)){el.style.filter="alpha(opacity="+val*100+")";if(!el.currentStyle||!el.currentStyle.hasLayout){el.style.zoom=1}}break;case"float":property="styleFloat";default:el.style[property]=val}}else{if(property=="float"){property="cssFloat"}el.style[property]=val}},setStyles:function(el,propertys){for(var p in propertys){YAO.setStyle(el,p,propertys[p])}return el},getElementsBy:function(method,tag,root){tag=tag||"*";var m=[];if(root){root=YAO.getEl(root);if(!root){return m}}else{root=document}var oElem=root.getElementsByTagName(tag);if(!oElem.length&&(tag==="*"&&root.all)){oElem=root.all}for(var n=0,j=oElem.length;n<j;++n){if(method(oElem[n])){m[m.length]=oElem[n]}}return m},getDocumentWidth:function(){var k=YAO.getScrollWidth();var j=Math.max(k,YAO.getViewportWidth());return j},getDocumentHeight:function(){var k=YAO.getScrollHeight();var j=Math.max(k,YAO.getViewportHeight());return j},getScrollWidth:function(){var j=(D.compatMode=="CSS1Compat")?D.body.scrollWidth:D.Element.scrollWidth;return j},getScrollHeight:function(){var j=(D.compatMode=="CSS1Compat")?D.body.scrollHeight:D.documentElement.scrollHeight;return j},getXScroll:function(){var j=self.pageXOffset||D.documentElement.scrollLeft||D.body.scrollLeft;return j},getYScroll:function(){var j=self.pageYOffset||D.documentElement.scrollTop||D.body.scrollTop;return j},getViewportWidth:function(){var j=self.innerWidth;var k=D.compatMode;if(k||YAO.ua.ie){j=(k=="CSS1Compat")?D.documentElement.clientWidth:D.body.clientWidth}return j},getViewportHeight:function(){var j=self.innerHeight;var k=D.compatMode;if((k||YAO.ua.ie)&&!YAO.ua.opera){j=(k=="CSS1Compat")?D.documentElement.clientHeight:D.body.clientHeight}return j},removeChildren:function(j){if(!(prent=YAO.getEl(j))){return false}while(j.firstChild){j.firstChild.parentNode.removeChild(j.firstChild)}return j},prependChild:function(k,j){if(!(k=YAO.getEl(k))||!(j=YAO.getEl(j))){return false}if(k.firstChild){k.insertBefore(j,k.firstChild)}else{k.appendChild(j)}return k},insertAfter:function(l,j){var k=j.parentNode;if(k.lastChild==j){k.appendChild(l)}else{k.insertBefore(l,j.nextSibling)}},setOpacity:function(el,val){YAO.setStyle(el,"opacity",val)},Builder:{nidx:0,NODEMAP:{AREA:"map",CAPTION:"table",COL:"table",COLGROUP:"table",LEGEND:"fieldset",OPTGROUP:"select",OPTION:"select",PARAM:"object",TBODY:"table",TD:"table",TFOOT:"table",TH:"table",THEAD:"table",TR:"table"},ATTR_MAP:{"className":"class","htmlFor":"for","readOnly":"readonly","maxLength":"maxlength","cellSpacing":"cellspacing"},EMPTY_TAG:/^(?:BR|FRAME|HR|IMG|INPUT|LINK|META|RANGE|SPACER|WBR|AREA|PARAM|COL)$/i,linkNode:function(url,cssId,charset){var c=charset||"utf-8",link=null;var head=D.getElementsByTagName("head")[0];link=this.Node("link",{"id":cssId||("link-"+(YAO.Builder.nidx++)),"type":"text/css","charset":c,"rel":"stylesheet","href":url});head.appendChild(link);return link},scriptNode:function(url,scriptId,win,charset){var d=win||document.body;var c=charset||"utf-8";return d.appendChild(this.Node("script",{"id":scriptId||("script-"+(YAO.Builder.nidx++)),"type":"text/javascript","charset":c,"src":url}))},Node:function(tag,attr,children){tag=tag.toUpperCase();var parentTag=YAO.Builder.NODEMAP[tag]||"div";var parentElement=D.createElement(parentTag);var elem=null;try{if(this.EMPTY_TAG.test(tag)){}else{parentElement.innerHTML="<"+tag+"></"+tag+">"}}catch(e){}elem=parentElement.firstChild;if(elem&&(elem.tagName.toUpperCase()!=tag)){elem=elem.getElementsByTagName(tag)[0]}if(!elem){if(YAO.isString(tag)){elem=D.createElement(tag)}}if(!elem){return}else{if(attr){this.Attributes(elem,attr)}if(children){this.Child(elem,children)}return elem}},Attributes:function(elem,attr){var attrName="",i;for(i in attr){if(attr[i]&&YAO.hasOwnProperty(attr,i)){attrName=i in YAO.Builder.ATTR_MAP?YAO.Builder.ATTR_MAP[i]:i;if(attrName==="class"){elem.className=attr[i]}else{elem.setAttribute(attrName,attr[i])}}}return elem},Child:function(parent,child){if(child.tagName){parent.appendChild(child);return false}if(YAO.isArray(child)){var i,length=child.length;for(i=0;i<length;i+=1){if(child[i].tagName){parent.appendChild(child[i])}else{if(YAO.isString(child[i])){parent.appendChild(D.createTextNode(child[i]))}}}}else{if(YAO.isString(child)){parent.appendChild(D.createTextNode(child))}}}},batch:function(el,method,o,override){var id=el;el=YAO.getEl(el);var scope=(override)?o:window;if(!el||el.tagName||!el.length){if(!el){return false}return method.call(scope,el,o)}var collection=[];for(var i=0,len=el.length;i<len;++i){if(!el[i]){id=el[i]}collection[collection.length]=method.call(scope,el[i],o)}return collection},fadeUp:function(elem){if(elem){var level=0,fade=function(){var timer=null;level+=0.05;if(timer){clearTimeout(timer);timer=null}if(level>1){YAO.setOpacity(elem,1);return false}else{YAO.setOpacity(elem,level)}timer=setTimeout(fade,50)};fade()}},zebra:function(){var j,length=arguments.length;for(j=0;j<length;++j){(function(config){var root=YAO.getEl(config.rootTag)||(config.root||null),rows=root.getElementsByTagName(config.rowTag)||(config.rows||null),i,len=rows.length,lastClass=[];if(root&&rows&&len>1){for(var i=0;i<len;++i){rows[i].className=i%2===0?"even":"odd";lastClass[i]=rows[i].className;YAO.on(rows[i],"mouseover",function(index){return function(){YAO.replaceClass(this,lastClass[index],"hover")}}(i),rows[i],true);YAO.on(rows[i],"mouseout",function(index){return function(){YAO.replaceClass(this,"hover",lastClass[index])}}(i),rows[i],true)}}else{return false}})(arguments[j])}},moveElement:function(element,finalX,finalY,speed){var elem=YAO.isString(element)?YAO.getEl(element):element,style=null;if(elem){if(elem.movement){clearTimeout(elem.movement)}if(!elem.style.left){elem.style.left="0"}if(!elem.style.top){elem.style.top="0"}var xpos=parseInt(elem.style.left);var ypos=parseInt(elem.style.top);if(xpos==finalX&&ypos==finalY){return true}if(xpos<finalX){var dist=Math.ceil((finalX-xpos)/10);xpos=xpos+dist}if(xpos>finalX){var dist=Math.ceil((xpos-finalX)/10);xpos=xpos-dist}if(ypos<finalY){var dist=Math.ceil((finalY-ypos)/10);ypos=ypos+dist}if(ypos>finalY){var dist=Math.ceil((ypos-finalY)/10);ypos=ypos-dist}elem.style.left=xpos+"px";elem.style.top=ypos+"px";elem.movement=setTimeout(function(){YAO.moveElement(element,finalX,finalY,speed)},speed)}},ajax:function(config){var oXhr,method=config.method?config.method.toUpperCase():"GET",url=config.url||"",fn=config.fn||null,postData=config.data||null,elem=config.id?YAO.getEl(config.id):(config.element||null),load=config.loadFn?config.loadFn:(config.loading||"正在获取数据，请稍后...");if(!url){return}if(window.XMLHttpRequest){oXhr=new XMLHttpRequest()}else{if(window.ActiveXObject){oXhr=new ActiveXObject("Microsoft.XMLHTTP")}}if(oXhr){try{oXhr.open(method,url,true);oXhr.onreadystatechange=function(){if(oXhr.readyState!==4){return false}if(oXhr.readyState==4){if(oXhr.status==200||location.href.indexOf("http")===-1){if(fn){fn.success(oXhr)}else{elem.innerHTML=oXhr.responseText}}else{if(fn){fn.failure(oXhr.status)}else{if(YAO.isFunction(load)){load()}else{elem.innerHTML=load}}}}};oXhr.setRequestHeader("X-Requested-With","XMLHttpRequest");if(postData){oXhr.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8")}oXhr.send(postData)}catch(e){throw new Error(e);return false}}else{throw new Error("Your browser does not support XMLHTTP.");return false}},JSON:function(){function f(n){return n<10?"0"+n:n}Date.prototype.toJSON=function(){return this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z"};var m={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};function stringify(value,whitelist){var a,i,k,l,r=/["\\\x00-\x1f\x7f-\x9f]/g,v;switch(typeof value){case"string":return r.test(value)?'"'+value.replace(r,function(a){var c=m[a];if(c){return c}c=a.charCodeAt();return"\\u00"+Math.floor(c/16).toString(16)+(c%16).toString(16)})+'"':'"'+value+'"';case"number":return isFinite(value)?String(value):"null";case"boolean":case"null":return String(value);case"object":if(!value){return"null"}if(typeof value.toJSON==="function"){return stringify(value.toJSON())}a=[];if(typeof value.length==="number"&&!(value.propertyIsEnumerable("length"))){l=value.length;for(i=0;i<l;i+=1){a.push(stringify(value[i],whitelist)||"null")}return"["+a.join(",")+"]"}if(whitelist){l=whitelist.length;for(i=0;i<l;i+=1){k=whitelist[i];if(typeof k==="string"){v=stringify(value[k],whitelist);if(v){a.push(stringify(k)+":"+v)}}}}else{for(k in value){if(typeof k==="string"){v=stringify(value[k],whitelist);if(v){a.push(stringify(k)+":"+v)}}}}return"{"+a.join(",")+"}"}}return{stringify:stringify,parse:function(text,filter){var j;function walk(k,v){var i,n;if(v&&typeof v==="object"){for(i in v){if(OP.hasOwnProperty.apply(v,[i])){n=walk(i,v[i]);if(n!==undefined){v[i]=n}else{delete v[i]}}}}return filter(k,v)}if(/^[\],:{}\s]*$/.test(text.replace(/\\./g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){j=eval("("+text+")");return typeof filter==="function"?walk("",j):j}throw new SyntaxError("parseJSON")}}}(),YTabs:function(){var j,len=arguments.length,Tabs=[];for(j=0;j<len;++j){Tabs[j]=new YAO.singleTab(arguments[j])}return Tabs},scrollNews:function(S,SI,RT,CT){var SN=new YAO.scrollVertical(S,SI,RT,CT);SN.speed=4000;SN.isPause=true;var TM=setTimeout(function(){if(TM){clearTimeout(TM)}SN.isPause=false},2000);YAO.on(SN.scrollArea,"mouseover",function(){SN.isPause=true});YAO.on(SN.scrollArea,"mouseout",function(){SN.isPause=false})}};YAO.on(window,"unload",YAO._unload)}();YAO.singleTab=function(A){this.tabRoot=YAO.isString(A.tabRoot)?YAO.getEl(A.tabRoot):(A.tabRoot||null);this.tabs=YAO.isString(A.tabs)?this.tabRoot.getElementsByTagName(A.tabs):(A.tabs||null);this.contents=YAO.isString(A.contents)?this.tabRoot.getElementsByTagName(A.contents):(A.contents||null);if(!this.tabs||!this.contents){return false}this.length=this.tabs.length||0;this.defaultIndex=A.defaultIndex||0;this.lastIndex=this.defaultIndex;this.lastTab=this.tabs[this.lastIndex]||null;this.lastContent=this.contents[this.lastIndex]||null;this.evtName=A.evt||"mouseover";this.defaultClass=A.defaultClass||this.CURRENT_TAB_CLASS;this.previousClass=A.previousClass||"";this.hideAll=A.hideAll||false;this.auto=A.auto||false;this.autoSpeed=A.autoSpeed||6000;this.fadeUp=A.fadeUp||false;this.scroll=A.scroll||false;this.scrollId=A.scrollId||null;this.scrollSpeed=A.scrollSpeed||5;this.direction=A.direction||"V";this.activeTag=A.activeTag||"IMG";this.stepHeight=A.stepHeight||0;this.stepWidth=A.stepWidth||0;this.ajax=A.ajax||false;this.ajaxDefaultInfo=this.contents.innerHTML;this.aPath=A.aPath||"";this.init()};YAO.singleTab.prototype.timer=null;YAO.singleTab.prototype.isPause=false;YAO.singleTab.prototype.CURRENT_TAB_CLASS="current";YAO.singleTab.prototype.init=function(){var B,A=this;if(this.tabs&&this.contents){if(this.auto){this.timer=setTimeout(function(){A.autoChange()},A.autoSpeed)}if(!this.hideAll){YAO.addClass(this.lastTab,this.defaultClass);if(!this.ajax&&!this.scroll){if(this.lastContent){this.lastContent.style.display="block"}}if(this.ajax){this.ajaxTab(this.lastTab)}if(this.scroll){this.scrollCnt((this.lastContent||this.contents),this.defaultIndex)}}else{YAO.removeClass(this.lastTab,this.defaultClass)}for(B=0;B<this.length;++B){if(B!==this.defaultIndex){YAO.removeClass(this.tabs[B],this.CURRENT_TAB_CLASS);if(!this.ajax&&!this.scroll){this.contents[B].style.display="none"}}YAO.on(this.tabs[B],this.evtName,function(C){return function(F){var E=null,D=(this.tabs[C]===this.tabs[this.defaultIndex])?this.defaultClass:this.CURRENT_TAB_CLASS;if(!YAO.hasClass(this.tabs[C],D)){var G=(this.ajax||(this.scroll&&(this.stepHeight||this.stepWidth)))?this.contents:(this.contents[C]||null);this.setCurrent(G,C);this.lastIndex=C}if(this.auto){this.isPause=true}E=F||window.event;YAO.stopEvent(E)}}(B),this.tabs[B],A);YAO.on(this.tabs[B],"mouseout",function(C){return function(){var D=this.tabs[C];if(this.hideAll&&this.evtName==="mouseover"){if(this.lastTab===D){YAO.removeClass(D,(YAO.hasClass(D,A.defaultClass)?this.defaultClass:this.CURRENT_TAB_CLASS))}if(this.previousClassTab){YAO.removeClass(this.previousClassTab,this.previousClass)}if(!this.scroll&&!this.ajax){this.contents[C].style.display="none"}}else{if(this.auto){this.isPause=false}}}}(B),this.tabs[B],A)}}};YAO.singleTab.prototype.autoChange=function(){var A=this;if(!this.isPause){var C=null,B=null;if(this.timer){clearTimeout(this.timer);this.timer=null}this.lastIndex=this.lastIndex+1;if(this.lastIndex===this.length){this.lastIndex=0}C=this.ajax?this.contents:(this.contents[this.lastIndex]||null);this.setCurrent(C,this.lastIndex);this.timer=setTimeout(function(){A.autoChange()},this.autoSpeed)}else{this.timer=setTimeout(function(){A.autoChange()},this.autoSpeed);return false}};YAO.singleTab.prototype.setCurrent=function(A,C){var B=null;curTab=this.tabs[C];YAO.removeClass(this.lastTab,(YAO.hasClass(this.lastTab,this.defaultClass)?this.defaultClass:this.CURRENT_TAB_CLASS));if(curTab===this.tabs[this.defaultIndex]){YAO.addClass(curTab,this.defaultClass)}else{YAO.addClass(curTab,this.CURRENT_TAB_CLASS)}if(this.previousClass){if(this.previousClassTab){YAO.removeClass(this.previousClassTab,this.previousClass)}if(C!==0){YAO.addClass(this.tabs[C-1],this.previousClass);if((C-1)===this.defaultIndex){YAO.removeClass(this.tabs[C-1],this.defaultClass)}this.previousClassTab=(this.tabs[C-1])}}if(!this.scroll&&!this.ajax){if(this.lastContent){this.lastContent.style.display="none"}if(A){A.style.display="block"}}if(this.fadeUp){B=(A.tagName.toUpperCase()==="IMG")?A:A.getElementsByTagName("img")[0];if(this.lastContent!==A){YAO.fadeUp(B)}}else{if(this.scroll){this.scrollCnt(A,C)}}if(!this.ajax){this.lastContent=A}else{if(this.ajax){this.ajaxTab(curTab)}}this.lastTab=curTab};YAO.singleTab.prototype.scrollCnt=function(D,F){var E=null,A=0,B=0,G=0,C=0;if(this.activeTag){E=(D.tagName.toUpperCase()===this.activeTag)?D:D.getElementsByTagName(this.activeTag)[0]}if(this.direction==="V"){A=E?E.offsetHeight:this.stepHeight;C=-(F*A)}else{B=E?E.offsetWidth:this.stepWidth;G=-(F*B)}YAO.moveElement(this.scrollId,G,C,this.scrollSpeed)};YAO.singleTab.prototype.ajaxTab=function(A){var C="",D=null,E=this.contents,B=this.aPath.split("/");D=(A.tagName.toUpperCase()==="A")?A:A.getElementsByTagName("a")[0];C=B[0]+"/"+D.rel+B[1]+B[2]+D.rel;if(A===this.tabs[this.defaultIndex]){E.innerHTML=this.ajaxDefaultInfo}else{YAO.ajax({url:C,element:E,load:E.innerHTML})}};YAO.scrollVertical=function(I,F,A,E){var B=document;if(YAO.isString(I)){this.scrollArea=B.getElementById(I)}else{this.scrollArea==I}if(YAO.isString(F)){this.scrollMsg=B.getElementById(F)}else{this.scrollMsg=F}var G=this.scrollMsg;var H=this.scrollArea;if(!A){var A="li"}this.unitHeight=G.getElementsByTagName(A)[0].offsetHeight;this.msgHeight=this.unitHeight*G.getElementsByTagName(A).length;G.style.position="absolute";G.style.top="0";G.style.left="0";var C=B.createElement(E||"div");C.id=H.id+"_copymsgid";C.innerHTML=G.innerHTML;C.style.height=this.msgHeight+"px";H.appendChild(C);C.style.position="absolute";C.style.left="0";C.style.top=this.msgHeight+"px";this.copyMsg=C;this.play(this)};YAO.scrollVertical.prototype.scrollArea=null;YAO.scrollVertical.prototype.scrollMsg=null;YAO.scrollVertical.prototype.unitHeight=0;YAO.scrollVertical.prototype.msgHeight=0;YAO.scrollVertical.prototype.copyMsg=null;YAO.scrollVertical.prototype.scrollValue=0;YAO.scrollVertical.prototype.scrollHeight=0;YAO.scrollVertical.prototype.isStop=true;YAO.scrollVertical.prototype.isPause=false;YAO.scrollVertical.prototype.scrollTimer=null;YAO.scrollVertical.prototype.speed=2000;YAO.scrollVertical.prototype.play=function(B){var E=B.scrollMsg,F=B.copyMsg,A=B.scrollArea,D=B.msgHeight,G=function(){if(navigator.userAgent.toLowerCase().match(/mozilla/)){return 1}},C=function(){if(B.scrollTimer){clearTimeout(B.scrollTimer)}if(B.isPause){B.scrollTimer=setTimeout(C,50);return}if(D-B.scrollValue<=0){B.scrollValue=0}else{B.scrollValue+=1;B.scrollHeight+=1}if(G){A.scrollTop=B.scrollValue}else{E.style.top=-1*B.scrollValue+"px";F.style.top=(D-B.scrollValue)+"px"}if(B.scrollHeight%A.offsetHeight==0){B.scrollTimer=setTimeout(C,B.speed)}else{B.scrollTimer=setTimeout(C,50)}};C()};YAO.chkAll=function(A){this.chkAllItem=YAO.isString(A.chkAllItem)?YAO.getEl(A.chkAllItem):(A.chkAllItem||null);this.list=YAO.isString(A.list)?YAO.getEl(A.list):(A.list||null);this.items=YAO.isString(A.items)?this.list.getElementsByTagName(A.items):(A.items||null);if(!this.chkAllItem||!this.list||!this.items){return false}this.length=this.items.length;this.itemsNumPerPage=A.itemsNumPerPage||this.length;this.pages=Math.ceil(this.length/this.itemsNumPerPage);this.curPage=(this.itemsNumPerPage!==this.length&&A.curPage)?A.curPage:0;this.init()};YAO.chkAll.prototype.chkNum=0;YAO.chkAll.prototype.CHKED_ROW_CLASS="chked";YAO.chkAll.prototype.init=function(){if(this.chkAllItem&&this.items){var B,A=this;for(B=0;B<this.length;++B){YAO.on(this.items[B],"click",function(){A.chgItemBg.call(A,this)},this.items[B],true)}YAO.on(this.chkAllItem,"click",function(){A.all.call(A)},this.chkAllItem,true)}};YAO.chkAll.prototype.all=function(){var C,A=this.curPage*this.itemsNumPerPage,B=(this.length<A+this.itemsNumPerPage)?this.length:(A+this.itemsNumPerPage);for(C=A;C<B;++C){this.items[C].checked=this.chkAllItem.checked;this.chgItemBg(this.items[C])}};YAO.chkAll.prototype.chgItemBg=function(D){var C,B=D.parentNode,A=(this.length<((this.curPage+1)*this.itemsNumPerPage))?(this.length-(this.curPage*this.itemsNumPerPage)):this.itemsNumPerPage;if(D.checked){YAO.addClass(B,this.CHKED_ROW_CLASS);this.chkNum+=1;if(this.chkNum>=A){this.chkNum=A;this.chkAllItem.checked=true}}else{YAO.removeClass(B,this.CHKED_ROW_CLASS);if(this.chkAllItem.checked){this.chkAllItem.checked=false}this.chkNum-=1;if(this.chkNum<0){this.chkNum=0}}};YAO.Carousel=function(A){this.btnPrevious=YAO.isString(A.btnPrevious)?YAO.getEl(A.btnPrevious):(A.btnPrevious||null);this.lnkBtnPrevious=this.btnPrevious.getElementsByTagName("a")[0]||null;this.Container=YAO.isString(A.Container)?YAO.getEl(A.Container):(A.Container||null);this.Scroller=YAO.isString(A.Scroller)?YAO.getEl(A.Scroller):(A.Scroller||null);this.btnNext=YAO.isString(A.btnNext)?YAO.getEl(A.btnNext):(A.btnNext||null);this.lnkBtnNext=this.btnNext.getElementsByTagName("a")[0]||null;this.items=YAO.isString(A.items)?this.Container.getElementsByTagName(A.items):(A.items||null);if(!this.btnPrevious||!this.lnkBtnPrevious||!this.Container||!this.Scroller||!this.btnNext||!this.lnkBtnNext||!this.items){return false}this.length=this.items.length;this.itemWidth=this.items[0].offsetWidth;this.itemHeight=this.items[0].offsetHeight;this.scrollerWidth=this.itemWidth*this.length;this.scrollHeight=this.itemHeight*this.length;this.derection=A.derection||"H";this.stepHeight=A.stepHeight||this.itemHeight;this.stepWidth=A.stepWidth||this.itemWidth;this.groups=this.derection==="H"?Math.ceil(this.scrollerWidth/this.stepWidth):Math.ceil(this.scrollHeight/this.stepHeight);this.maxMovedNum=this.derection==="H"?(this.groups-(this.Container.offsetWidth/this.stepWidth)):(this.groups-(this.Container.offsetHeight/this.stepHeight));this.scrollSpeed=A.speed||50;this.init()};YAO.Carousel.prototype.movedNum=0;YAO.Carousel.prototype.LNK_BTNS_DISABLED_CLASS="dis";YAO.Carousel.prototype.init=function(){var A=this;if(this.derection==="H"){this.Scroller.style.width=this.scrollerWidth+"px"}else{this.Scroller.style.height=this.scrollerHeight+"px"}this.Container.style.overflow="hidden";if(this.lnkBtnNext&&this.movedNum===this.maxMovedNum){YAO.addClass(this.lnkBtnNext,this.LNK_BTNS_DISABLED_CLASS)}if(this.lnkBtnPrevious&&this.movedNum===0){YAO.addClass(this.lnkBtnPrevious,this.LNK_BTNS_DISABLED_CLASS)}YAO.on(this.btnPrevious,"click",this.scrollPrevious,this.btnPrevious,A);YAO.on(this.btnNext,"click",this.scrollNext,this.btnNext,A)};YAO.Carousel.prototype.scrollPrevious=function(B){var A=B||window.event;if(this.movedNum>0){this.movedNum-=1;if(this.lnkBtnNext&&YAO.hasClass(this.lnkBtnNext,this.LNK_BTNS_DISABLED_CLASS)){YAO.removeClass(this.lnkBtnNext,this.LNK_BTNS_DISABLED_CLASS)}if(this.movedNum<=0){this.movedNum=0;if(this.lnkBtnPrevious){YAO.addClass(this.lnkBtnPrevious,this.LNK_BTNS_DISABLED_CLASS)}}this.scroll(this.movedNum)}YAO.stopEvent(A)};YAO.Carousel.prototype.scrollNext=function(B){var A=B||window.event;if(this.movedNum<this.maxMovedNum){this.movedNum+=1;if(this.lnkBtnPrevious&&YAO.hasClass(this.lnkBtnPrevious,this.LNK_BTNS_DISABLED_CLASS)){YAO.removeClass(this.lnkBtnPrevious,this.LNK_BTNS_DISABLED_CLASS)}if(this.movedNum>=this.maxMovedNum){this.movedNum=this.maxMovedNum;if(this.lnkBtnNext){YAO.addClass(this.lnkBtnNext,this.LNK_BTNS_DISABLED_CLASS)}}this.scroll(this.movedNum)}YAO.stopEvent(A)};YAO.Carousel.prototype.scroll=function(B){var C=0,A=0;if(this.derection==="H"){if(this.stepWidth){C=-(this.stepWidth*B)}else{C=-(this.itemWidth*B)}}else{if(this.stepHeight){A=-(this.stepHeight*B)}else{A=-(this.itemHeight*B)}}YAO.moveElement(this.Scroller,C,A,this.scrollSpeed)};YAO.YAlbum=function(){var A=this;this.oCarousel=new YAO.Carousel({btnPrevious:A.CARSOUEL_BTN_PREVIOUS,Container:A.CARSOUEL_CONTAINER,Scroller:A.CARSOUEL_SCROLLER,btnNext:A.CARSOUEL_BTN_NEXT,items:A.CARSOUEL_ITEM_TAG,stepWidth:A.CARSOUEL_STEP_WIDTH})||null;this.oSamples=this.oCarousel.Scroller.getElementsByTagName("a")||null;this.length=this.oSamples.length||0;this.lastSample=this.oSamples[0]||null;this.photoContainer=YAO.getEl(this.PHOTO_CONTAINER_ID)||null;this.photo=YAO.getEl(this.PHOTO_ID)||null;this.photoIntro=YAO.getEl(this.PHOTO_INTRO_ID)||null;this.sIntro=this.photo.alt||"";this.init()};YAO.YAlbum.prototype.lastIndex=0;YAO.YAlbum.prototype.isLoading=false;YAO.YAlbum.prototype.lastPhotoHeight=0;YAO.YAlbum.prototype.loadShardow=null;YAO.YAlbum.prototype.loadImg=null;YAO.YAlbum.prototype.CARSOUEL_BTN_PREVIOUS=YAO.getEl("carousel_btn_lastgroup");YAO.YAlbum.prototype.CARSOUEL_CONTAINER=YAO.getEl("carousel_container");YAO.YAlbum.prototype.CARSOUEL_SCROLLER=YAO.getEl("samples_list");YAO.YAlbum.prototype.CARSOUEL_BTN_NEXT=YAO.getEl("carousel_btn_nextgroup");YAO.YAlbum.prototype.CARSOUEL_ITEM_TAG="li";YAO.YAlbum.prototype.CARSOUEL_STEP_WIDTH=672;YAO.YAlbum.prototype.PHOTO_MAX_WIDTH=800;YAO.YAlbum.prototype.PHOTO_CONTAINER_ID="carousel_photo_container";YAO.YAlbum.prototype.PHOTO_ID="carousel_photo";YAO.YAlbum.prototype.PHOTO_INTRO_ID="carousel_photo_intro";YAO.YAlbum.prototype.BTN_NEXT_ID="carousel_next_photo";YAO.YAlbum.prototype.BTN_NEXT_CLASS="next";YAO.YAlbum.prototype.BTN_PREVIOUS_ID="carousel_previous_photo";YAO.YAlbum.prototype.BTN_PREVIOUS_CLASS="previous";YAO.YAlbum.prototype.BTN_DISABLED_CLASS="dis";YAO.YAlbum.prototype.IMG_BTN_PREVIOUS="url(img/last-photo.gif)";YAO.YAlbum.prototype.IMG_BTN_NEXT="url(img/next-photo.gif)";YAO.YAlbum.prototype.SHARDOW_ID="carousel_photo_shardow";YAO.YAlbum.prototype.LOAD_IMG_PATH="img/loading.gif";YAO.YAlbum.prototype.LOAD_IMG_ID="carousel_photo_loading";YAO.YAlbum.prototype.init=function(){var A=this,B;YAO.addClass(this.lastSample,"current");this.btnPrevious=YAO.Builder.Node("a",{href:A.oSamples[A.lastIndex].href,id:A.BTN_PREVIOUS_ID,className:A.BTN_PREVIOUS_CLASS,title:"上一张"},"上一张");this.photoContainer.appendChild(this.btnPrevious);this.btnNext=YAO.Builder.Node("a",{href:A.oSamples[A.lastIndex+1].href,id:A.BTN_NEXT_ID,className:A.BTN_NEXT_CLASS,title:"下一张"},"下一张");this.photoContainer.appendChild(this.btnNext);this.load(this.photo.src);YAO.on(this.btnPrevious,"click",function(D){var C=D||window.event;this.Previous();YAO.stopEvent(C)},this.btnPrevious,A);YAO.on(this.btnNext,"click",function(D){var C=D||window.event;this.Next();YAO.stopEvent(C)},this.btnNext,A);for(B=0;B<this.length;++B){YAO.on(this.oSamples[B],"click",function(C){return function(E){var D=E||window.event,F=this.oSamples[C];if(this.lastSample!==F&&!this.isLoading){this.lastIndex=C;this.btnsEnabled();this.chgPhoto()}YAO.stopEvent(D)}}(B),this.oSamples[B],A)}};YAO.YAlbum.prototype.btnsEnabled=function(){if(this.lastIndex!==0&&YAO.hasClass(this.btnPrevious,this.BTN_DISABLED_CLASS)){YAO.removeClass(this.btnPrevious,this.BTN_DISABLED_CLASS);if(YAO.ua.ie){this.btnPrevious.style.backgroundImage=this.IMG_BTN_PREVIOUS}this.btnPrevious.href=this.oSamples[this.lastIndex-1]}else{if(this.lastIndex===0){YAO.addClass(this.btnPrevious,this.BTN_DISABLED_CLASS);if(YAO.ua.ie){this.btnPrevious.style.backgroundImage="none"}this.btnPrevious.href=this.oSamples[this.lastIndex]}}if(this.lastIndex!==(this.length-1)&&YAO.hasClass(this.btnNext,this.BTN_DISABLED_CLASS)){YAO.removeClass(this.btnNext,this.BTN_DISABLED_CLASS);if(YAO.ua.ie){this.btnNext.style.backgroundImage=this.IMG_BTN_NEXT}this.btnNext.href=this.oSamples[this.lastIndex+1]}else{if(this.lastIndex===(this.length-1)){YAO.addClass(this.btnNext,this.BTN_DISABLED_CLASS);if(YAO.ua.ie){this.btnNext.style.backgroundImage="none"}this.btnNext.href=this.oSamples[this.lastIndex]}}};YAO.YAlbum.prototype.load=function(C){var B=new Image(),A=document.createDocumentFragment();B.src=C;if(B.complete){this.resize(B)}else{this.isLoading=true;this.loadShardow=YAO.Builder.Node("div",{id:this.SHARDOW_ID});this.loadImg=YAO.Builder.Node("img",{src:this.LOAD_IMG_PATH,id:this.LOAD_IMG_ID});A.appendChild(this.loadShardow);if(YAO.ua.ie){this.loadShardow.style.height=this.lastPhotoHeight?this.lastPhotoHeight+"px":this.photoContainer.offsetHeight+"px"}A.appendChild(this.loadImg);this.photoContainer.appendChild(A);YAO.on(B,"load",function(){this.resize(B)},B,this)}};YAO.YAlbum.prototype.resize=function(D){var A=this;var C=D.width;var B=D.height;var E=C/B;if(C>this.PHOTO_MAX_WIDTH){C=this.PHOTO_MAX_WIDTH;B=C/E}if(YAO.ua.ie){this.lastPhotoHeight=B;YAO.setStyles(this.btnPrevious,{height:B+"px",backgroundImage:A.IMG_BTN_PREVIOUS});YAO.setStyles(this.btnNext,{height:B+"px",backgroundImage:A.IMG_BTN_NEXT})}if(this.lastIndex===0){YAO.addClass(this.btnPrevious,this.BTN_DISABLED_CLASS);if(YAO.ua.ie){this.btnPrevious.style.backgroundImage="none"}}if(this.lastIndex===(this.length-1)){YAO.addClass(this.btnNext,this.BTN_DISABLED_CLASS);if(YAO.ua.ie){this.btnNext.style.backgroundImage="none"}}this.photoIntro.innerHTML=this.sIntro;YAO.setStyle(this.photoContainer,"width",(C+"px"));YAO.setStyles(this.photo,{width:C+"px",height:B+"px"});if(this.loadImg&&this.loadShardow){this.isLoading=false;this.photoContainer.removeChild(this.loadImg);this.loadImg=null;this.photoContainer.removeChild(this.loadShardow);this.loadShardow=null}};YAO.YAlbum.prototype.Previous=function(){if(this.lastIndex!==0){this.lastIndex-=1;if(YAO.hasClass(this.btnNext,this.BTN_DISABLED_CLASS)){YAO.removeClass(this.btnNext,this.BTN_DISABLED_CLASS)}if(this.lastIndex>=1){this.btnPrevious.href=this.oSamples[this.lastIndex-1].href}if(this.lastIndex<0){this.lastIndex=0;YAO.addClass(this.btnPrevious,this.BTN_DISABLED_CLASS);this.btnPrevious.href=this.oSamples[this.lastIndex].href}this.btnNext.href=this.oSamples[this.lastIndex+1].href;this.chgPhoto()}};YAO.YAlbum.prototype.Next=function(){if(this.lastIndex<(this.length-1)){this.lastIndex+=1;if(YAO.hasClass(this.btnPrevious,this.BTN_DISABLED_CLASS)){YAO.removeClass(this.btnPrevious,this.BTN_DISABLED_CLASS)}if(this.lastIndex<=(this.length-2)){this.btnNext.href=this.oSamples[this.lastIndex+1].href}if(this.lastIndex>(this.length-1)){this.lastIndex=(this.length-1);YAO.addClass(this.btnNext,this.BTN_DISABLED_CLASS);this.btnNext.href=this.oSamples[this.lastIndex].href}this.btnPrevious.href=this.oSamples[this.lastIndex-1].href;this.chgPhoto()}};YAO.YAlbum.prototype.chgPhoto=function(){var A="";this.sIntro=this.oSamples[this.lastIndex].title;A=this.oSamples[this.lastIndex].href;YAO.removeClass(this.lastSample,"current");YAO.addClass(this.oSamples[this.lastIndex],"current");this.lastSample=this.oSamples[this.lastIndex];this.photo.src=A;this.load(A);this.scroll()};YAO.YAlbum.prototype.scroll=function(){var A=Math.ceil(((this.lastIndex+1)*this.oCarousel.itemWidth)/this.oCarousel.stepWidth)-1;if(A!=this.oCarousel.movedNum){this.oCarousel.scroll(A);this.oCarousel.movedNum=A;if(this.oCarousel.movedNum!==0&&YAO.hasClass(this.oCarousel.lnkBtnPrevious,this.BTN_DISABLED_CLASS)){YAO.removeClass(this.oCarousel.lnkBtnPrevious,this.BTN_DISABLED_CLASS)}else{if(this.oCarousel.movedNum===0){YAO.addClass(this.oCarousel.lnkBtnPrevious,this.BTN_DISABLED_CLASS)}}if(this.oCarousel.movedNum!==this.oCarousel.maxMovedNum&&YAO.hasClass(this.oCarousel.lnkBtnNext,this.BTN_DISABLED_CLASS)){YAO.removeClass(this.oCarousel.lnkBtnNext,this.BTN_DISABLED_CLASS)}else{if(this.oCarousel.movedNum===this.oCarousel.maxMovedNum){YAO.addClass(this.oCarousel.lnkBtnNext,this.BTN_DISABLED_CLASS)}}}};
