var AD2={};(function(a){var slice=Array.slice||(function(){var _slice=Array.prototype.slice;return function(arr){return _slice.apply(arr,_slice.call(arguments,1))}})(),getType=function(v){var s=typeof v;if(s==='object'){if(v){if(typeof v.length==='number'){s='array'}}else{s='null'}}return s},contains=function(superset,subset){return!find(subset,function(v,k,_break){if(superset[k]!==v){return _break}})},equals=function(a,b){return contains(a,b)&&contains(b,a)},isEmpty=function(o){var empty=true;each(o,function(v,k,_break){empty=false;return _break});return empty},each=(function(){var _break={},arr_fn=function(numerable,fn,bind){for(var i=0,len=numerable.length;i<len;i++){if(fn.call(bind,numerable[i],i,_break)==_break){return i}}return-1},iterator_type={'string':function(numerable,fn,bind){return arr_fn(numerable.split(''),fn,bind)},'array':arr_fn,'number':function(numerable,fn,bind){for(var i=0;i<numerable;i++){fn.call(bind,i,i)}},'object':function(numerable,fn,bind){for(var i in numerable){if(numerable.hasOwnProperty(i)){if(fn.call(bind,numerable[i],i,_break)==_break){return i}}}return-1}},getIterator=function(o){return iterator_type[getType(o)]};return function(numerable,fn,bind){return getIterator(numerable)(numerable,fn,bind||numerable)}})(),find=function(numerable,fn,bind){var index=each(numerable,function(v,k,_break){if(fn.apply(bind,arguments)===true){return _break}});return index==-1?null:numerable[index]},filter=function(numerable,fn,bind){var valids=[];each(numerable,function(v){if(fn.apply(bind,arguments)===true){valids.push(v)}});return valids},map=function(numerable,fn,bind,is_dictionary){var results;if(is_dictionary){results={};each(numerable,function(v,k){results[k]=fn.apply(bind,arguments)})}else{results=[];each(numerable,function(){results.push(fn.apply(bind,arguments))})}return results},invoke=function(numerable,method_name,arg1,arg2,argN){var args=slice(arguments,2);each(numerable,function(v,k){v[method_name].apply(v,args)})},unlink=function(object){if(object==null){return object}if(typeof object.length=='number'&&typeof object!='string'){return map(object,unlink)}else if(typeof object=='object'){return map(object,unlink,null,true)}return object},mixdeep=function(r){if(!r){r={}}for(var i=1;i<arguments.length;i++){var s=arguments[i];if(s){for(var j in s){if(r[j]&&typeof r[j]=='object'&&typeof s[j]=='object'){mix(r[j],s[j])}else{r[j]=unlink(s[j])}}}}return r},mix=function(r){if(!r){r={}}for(var i=1;i<arguments.length;i++){var s=arguments[i];if(s){for(var j in s){r[j]=s[j]}}}return r},mixif=function(r){if(!r){r={}}for(var i=1;i<arguments.length;i++){var s=arguments[i];if(s){for(var j in s){if(r[j]===undefined){r[j]=s[j]}}}}return r},generateId=(function(){var id=1;return function(){return'auto_gen_'+id++}})(),Class={proto:(function(){var fn=function(instance,method){return this.prototype[method].apply(instance,slice(arguments,2))};return function(ctor){ctor.proto=fn}})(),create:function(proto,sp){var ctor=function(){if(this.init){this.init.apply(this,arguments)}};if(sp){var F=function(){};F.prototype=sp.prototype;ctor.prototype=new F()}var protos=slice(arguments,2);protos.unshift(ctor.prototype,proto);mix.apply(window,protos);return ctor}},getObjectToStringFn=function(assign_token,pair_separator,need_last,need_encode){var encode=need_encode?encodeURIComponent:function(k){return k};return function(o){return map(o,function(v,k){if(k!=null){return k+assign_token+encode(v)}}).join(pair_separator)+(need_last?pair_separator:'')}};mix(a,{generateId:generateId,slice:slice,getType:getType,equals:equals,isEmpty:isEmpty,each:each,map:map,find:find,filter:filter,mix:mix,mixdeep:mixdeep,mixif:mixif,buffer:function(runner,delay){var timer;return function(){if(timer){clearTimeout(timer)}var args=arguments;timer=setTimeout(function(){runner.apply(window,args)},delay||100)}},Class:Class,format:function(s,config,reserve){return s.replace(/\{([^}]*)\}/g,(typeof config=='object')?function(m,i){var ret=config[i];return ret==null&&reserve?m:ret}:config)},getObjectToStringFn:getObjectToStringFn,serializeStyles:getObjectToStringFn(':',';',true,false),serializeAttrs:getObjectToStringFn('=',' ',true,false),serializeQuery:getObjectToStringFn('=','&',false,true)})})(AD2);(function(a){var el_template='<{tag} {attrs}style="{styles}">{inner}</{tag}>',each=a.each,propertyCache={},patterns={HYPHEN:/(-[a-z])/i,ROOT_TAG:/^body|html$/i},ua=(function(){var o={ie:0,opera:0,gecko:0,webkit:0,mobile:null};var ua=navigator.userAgent,m;if((/KHTML/).test(ua)){o.webkit=1}m=ua.match(/AppleWebKit\/([^\s]*)/);if(m&&m[1]){o.webkit=parseFloat(m[1]);if(/ Mobile\//.test(ua)){o.mobile="Apple"}else{m=ua.match(/NokiaN[^\/]*/);if(m){o.mobile=m[0]}}}if(!o.webkit){m=ua.match(/Opera[\s\/]([^\s]*)/);if(m&&m[1]){o.opera=parseFloat(m[1]);m=ua.match(/Opera Mini[^;]*/);if(m){o.mobile=m[0]}}else{m=ua.match(/MSIE\s([^;]*)/);if(m&&m[1]){o.ie=parseFloat(m[1])}else{m=ua.match(/Gecko\/([^\s]*)/);if(m){o.gecko=1;m=ua.match(/rv:([^\s\)]*)/);if(m&&m[1]){o.gecko=parseFloat(m[1])}}}}}return o})();var walk=function(el,side){for(var nel=el;nel;nel=nel[side]){if(nel.nodeType==1){return nel}}},buildHTML=function(styles,attrs,tag,inner){return a.format(el_template,{tag:tag||'div',attrs:a.serializeAttrs(attrs||{}),styles:a.serializeStyles(styles),inner:inner||''})},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},getStyle=(function(){if(document.defaultView&&document.defaultView.getComputedStyle){return function(el,property){var value=null;if(property=='float'){property='cssFloat'}var computed=document.defaultView.getComputedStyle(el,'');if(computed){value=computed[toCamel(property)]}return el.style[property]||value}}else if(document.documentElement.currentStyle&&ua.ie){return function(el,property){switch(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;case'float':property='styleFloat';default:var value=el.currentStyle?el.currentStyle[property]:null;return(el.style[property]||value)}}}else{return function(el,property){return el.style[property]}}})(),setStyle=(function(){var px=/left|top|right|bottom|width|height/;var transVal=function(k,v){if(px.test(k)&&typeof v=='number'){v=v+'px'}return v};if(ua.ie){return function(el,property,val){property=toCamel(property);switch(property){case'opacity':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]=transVal(property,val)}}}else{return function(el,property,val){property=toCamel(property);if(property=='float'){property='cssFloat'}el.style[property]=transVal(property,val)}}})(),getDocumentScrollLeft=function(doc){doc=doc||document;return Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft)},getDocumentScrollTop=function(doc){doc=doc||document;return Math.max(doc.documentElement.scrollTop,doc.body.scrollTop)},getDocumentHeight=function(){var scrollHeight=(document.compatMode!='CSS1Compat')?document.body.scrollHeight:document.documentElement.scrollHeight;var h=Math.max(scrollHeight,getViewportHeight());return h},getDocumentWidth=function(){var scrollWidth=(document.compatMode!='CSS1Compat')?document.body.scrollWidth:document.documentElement.scrollWidth;var w=Math.max(scrollWidth,getViewportWidth());return w},getViewportHeight=function(){var height=self.innerHeight;var mode=document.compatMode;if((mode||ua.ie)&&!ua.opera){height=(mode=='CSS1Compat')?document.documentElement.clientHeight:document.body.clientHeight}return height},getViewportWidth=function(){var width=self.innerWidth;var mode=document.compatMode;if(mode||ua.ie){width=(mode=='CSS1Compat')?document.documentElement.clientWidth:document.body.clientWidth}return width},getXY=function(el){var pos=[el.offsetLeft,el.offsetTop];var parentNode=el.offsetParent;var accountForBody=(ua.webkit&&getStyle(el,'position')=='absolute'&&el.offsetParent==el.ownerDocument.body);if(parentNode!=el){while(parentNode){pos[0]+=parentNode.offsetLeft;pos[1]+=parentNode.offsetTop;if(!accountForBody&&ua.webkit&&getStyle(parentNode,'position')=='absolute'){accountForBody=true}parentNode=parentNode.offsetParent}}if(accountForBody){pos[0]-=el.ownerDocument.body.offsetLeft;pos[1]-=el.ownerDocument.body.offsetTop}parentNode=el.parentNode;while(parentNode.tagName&&!patterns.ROOT_TAG.test(parentNode.tagName)){if(getStyle(parentNode,'display').search(/^inline|table-row.*$/i)){pos[0]-=parentNode.scrollLeft;pos[1]-=parentNode.scrollTop}parentNode=parentNode.parentNode}return pos},$=function(id){if(typeof id=='string'){return document.getElementById(id)}return id};a.DomUtil={ua:ua,get:$,buildHTML:buildHTML,createElement:function(html){if(typeof html!='string'){html=buildHTML.apply(window,arguments)}var el=document.createElement('div');el.innerHTML=html;return el.firstChild},next:function(el){return walk(el,'nextSibling')},pre:function(el){return walk(el,'previousSibling')},children:function(el){var results=[];for(var cel=el.firstChild;cel;cel=cel.nextSibling){if(cel.nodeType==1){results.push(cel)}}return results},setStyle:function(el,k,v){el=$(el);if(typeof k=='object'){each(k,function(_v,_k){setStyle(el,_k,_v)})}else{setStyle(el,k,v)}},getStyle:function(el,k){return getStyle($(el),k)},getXY:function(el){return getXY($(el))},hide:function(el){setStyle(el,'display','none')},show:function(el){setStyle(el,'display','')},getDocumentHeight:getDocumentHeight,getDocumentWidth:getDocumentWidth,getViewportHeight:getViewportHeight,getViewportWidth:getViewportWidth,getDocumentScrollTop:getDocumentScrollTop,getDocumentScrollLeft:getDocumentScrollLeft,absolutize:function(el,zIndex,insert_to_body){el.className='absolute';a.DomUtil.setStyle(el,{position:'absolute',left:'-999px',top:'-9999px',zIndex:zIndex});if(insert_to_body){document.body.insertBefore(el,document.body.firstChild)}},align:function(anchor,brick,type){anchor=$(anchor);brick=$(brick);var sizes={},types=type.split('-'),anchorXY=getXY(anchor),x=anchorXY[0],y=anchorXY[1];each({anchor:anchor,brick:brick},function(el,name){var o=sizes[name]={};each(['Width','Height'],function(side){o[side.toLowerCase()]=el['offset'+side]})});each(types[0].split(''),function(al){switch(al){case'r':x+=sizes.anchor.width;break;case'b':y+=sizes.anchor.height;break;default:break}});each(types[1].split(''),function(al){switch(al){case'r':x-=sizes.brick.width;break;case'b':y-=sizes.brick.height;break;default:break}});brick.style.left=x+'px';brick.style.top=y+'px'}}})(AD2);(function(a){var $=a.DomUtil.get,evt=a.DomEventUtil={};if(document.addEventListener){evt.on=function(el,type,handler){$(el).addEventListener(type,handler,false);return handler};evt.un=function(el,type,handler){$(el).removeEventListener(type,handler,false)};evt.stopPropagation=function(e){e.stopPropagation()};evt.preventDefault=function(e){e.preventDefault()};evt.getTarget=function(e){return e.target}}else{evt.on=function(el,type,handler){el=$(el);var actualHandler=function(){handler.call(el,window.event)};el.attachEvent('on'+type,actualHandler);return actualHandler};evt.un=function(el,type,actualHandler){$(el).detachEvent('on'+type,actualHandler)};evt.stopPropagation=function(e){e.cancelBubble=true};evt.preventDefault=function(e){e.returnValue=false};evt.getTarget=function(e){return e.srcElement}}evt.stop=function(e){evt.stopPropagation(e);evt.preventDefault(e)}})(AD2);(function(a){a.Cookie={set:function(key,value,options){var text=key+'='+value;if(options){if(options.expires){text+="; expires="+(new Date((new Date()).getTime()+86400000*options.expires)).toGMTString()}if(options.path){text+="; path="+options.path}if(options.domain){text+="; domain="+options.domain}if(options.secure===true){text+="; secure"}}document.cookie=text},get:function(){var text=document.cookie;var cookies={};if(/[^=]+=[^=;]?(?:; [^=]+=[^=]?)?/.test(text)){var cookieParts=text.split(/;\s/g),cookieName=null,cookieValue=null,cookieNameValue=null;for(var i=0,len=cookieParts.length;i<len;i++){cookieNameValue=cookieParts[i].match(/([^=]+)=/i);if(cookieNameValue instanceof Array){cookieName=cookieNameValue[1];cookieValue=cookieParts[i].substring(cookieNameValue[1].length+1)}else{cookieName=cookieParts[i];cookieValue=cookieName}cookies[cookieName]=cookieValue}}return cookies},remove:function(k,options){options=options||{};options.expires=-1;this.set(k,"",options)}}})(AD2);(function(a){var dom=a.DomUtil,$time=Date.now||function(){return new Date().getTime()},default_config={duration:1,transition:function(p){return p},callback:function(){}};var compute=function(from,to,delta){return(to-from)*delta+from},buildFrom=function(el,from,to){a.each(to,function(v,k){if(from[k]==null){from[k]=parseInt(dom.getStyle(el,k),10)}else{dom.setStyle(el,k,from[k])}})};a.Anim=a.Class.create({init:function(el,config){this.el=dom.get(el);this.config=a.mixif(config,default_config);this.chains=[]},morph:function(o){if(this.playing){this.chains.push(o)}else{this._morph(o);this.playing=true}return this},_morph:function(o){var from=o.from||{},to=o.to,config=o.config||{};a.mixif(config,this.config);var el=this.el,duration=config.duration*1000,transition=config.transition,startTime=$time(),me=this;buildFrom(el,from,to);var trans=function(delta){a.each(to,function(value,property){dom.setStyle(el,property,compute(from[property],value,delta))})};var timer=setInterval(function(){var time=$time();if(time<startTime+duration){trans(transition((time-startTime)/duration))}else{trans(1);clearInterval(timer);me._chain()}},20)},_chain:function(){if(this.chains.length){this._morph(this.chains.shift())}else{this.playing=false;this.config.callback()}}})})(AD2);var mutex_lock,mutex_unlock;(function(){var locked=false;mutex_lock=function(){if(locked){return-1}else{locked=true;return 0}};mutex_unlock=function(){locked=false;return 0}})();(function(a){var each=a.each,Class=a.Class,dom=a.DomUtil,ua=dom.ua,buildHTML=dom.buildHTML,dic_area_display={},cookie=a.Cookie.get(),display_index=parseInt(cookie['ad_play_index'])||Math.floor(Math.random()*100),pic_VAR_LINK='adlink';a.Cookie.set('ad_play_index',display_index+1,{expires:1});var ping=function(url){(new Image()).src=url},displayInOrder=function(area_config){return function(){if(arguments.length==0){return}var creativity_config=arguments[display_index%arguments.length];dic_area_display[area_config.id]=dm.create(creativity_config['display'],{area_config:area_config,creativity_config:creativity_config})}};var renderImage=function(config,el){var styles={display:'block',cursor:'pointer',width:config.width+'px',height:config.height+'px'};var url=config.resource_url;if(getExtension(url)=='png'&&ua.ie!=0&&ua.ie<7){styles['filter']=a.format('progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'{uri}\')',url)}else{styles['background-image']=a.format('url({uri})',url)}el.innerHTML=buildHTML(styles);el.firstChild.onclick=function(){window.open(config.link_to)}};var renderpic=function(config,el){var params={quality:'high',allowscriptaccess:'always',wmode:'opaque',swliveconnect:true};if(config.params){a.mix(params,config.params)}var picvars=config.picvars||{};if(config.link_to){picvars[pic_VAR_LINK]=config.link_to}params.picvars=a.serializeQuery(picvars);var attrs={};if(ua.ie){attrs.classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000';params.movie=config.resource_url}else{params.type='application/x-shockwave-pic';attrs.data=config.resource_url}el.innerHTML=buildHTML({width:config.width+'px',height:config.height+'px'},attrs,'object',buildParams(params))};var param_template='<param name="{name}" value="{value}"></param>';var buildParams=function(o){return a.map(o,function(v,k){return a.format(param_template,{name:k,value:v})}).join('')};var getExtension=function(uri){var query_string_index=uri.indexOf('?');return uri.substring(uri.lastIndexOf('.')+1,query_string_index==-1?uri.length:query_string_index)};a.DisplayBase=Class.create({init:function(config){a.mix(this,config)},getFodder:function(origin){var fodder=this['creativity_config']['fodder'];if(!origin&&fodder.length==1){return fodder[0]}return fodder},getDisplayConfig:function(){return this['creativity_config']['display_config']},appendToPing:function(){var creativity_config=this.creativity_config;a.ping.append({loc:this.area_config.id,cid:creativity_config.cid,oid:creativity_config.oid});if(creativity_config['monitor_url']){ping(creativity_config['monitor_url'])}},render:function(){this.preRender();this.doRender()},preRender:function(){},doRender:function(){}});a.PingDisplayBase=Class.create({preRender:function(){this.appendToPing()}},a.DisplayBase);a.DisplayHelper={render:function(config,el,set_size){if(set_size){dom.setStyle(el,{width:config.width,height:config.height})}if(config.type=='image'){renderImage(config,el)}else{renderpic(config,el);if(config.cover){if(dom.getStyle(el,'position')=='static'){el.style.position='relative'}var cover=document.createElement('div');cover.className='absolute';dom.setStyle(cover,{position:'absolute',width:config.width+'px',height:config.height+'px',left:'0px',top:'0px',cursor:'pointer','background-color':'#fff',filter:'alpha(opacity=0)',opacity:0});cover.onclick=function(){window.open(config.link_to)};el.appendChild(cover)}}}};(function(){var dic_display_type_klass={};a.DisplayManager={create:function(ctor,config){if(typeof ctor=='string'){ctor=dic_display_type_klass[ctor]}if(ctor){return new ctor(config)}},reg:function(type,klass){dic_display_type_klass[type]=klass}}})();var dm=a.DisplayManager;a.area=displayInOrder;a.render=(function(){var index=0,MAX=5,rendered={};var renderDefault=function(area_id){var el=dom.get(area_id);if(!el||dom.getStyle(el,'display')=='none'){return}setTimeout(function(){(dm.create('default',{area_config:{id:ar
