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',render=a.DisplayHelper.render,doNothing=function(){},getFlashInvoker=function(container){var o=container.getElementsByTagName('object');if(o.length){var flash=o[0];return function(method){try{flash[method]()}catch(e){}}}else{return doNothing}},getReg=function(superclass){var _reg=function(o,type){if(typeof o=='function'){o=o()}a.DisplayManager.reg(type,a.Class.create(o,superclass))};return function(type,o){if(arguments.length==1){each(type,_reg)}else{_reg(o,type)}}},regPing=getReg(a.PingDisplayBase),regNoPing=getReg(a.DisplayBase),observeWindow=function(observer,buffer,run_it){if(buffer){observer=a.buffer(observer,buffer)}evt.on(window,'scroll',observer);evt.on(window,'resize',observer);if(run_it){observer()}},createAbsoluteElement=function(zIndex){var el=document.createElement('div');el.style.position='absolute';el.className='absolute';if(zIndex){el.style.zIndex=zIndex}document.body.insertBefore(el,document.body.firstChild);return el},enter_mutex=function(fn,delay){setTimeout(function(){if(mutex_lock()==0){fn()}else{setTimeout(arguments.callee,500)}},(delay||0)*1000)};regNoPing({'default':{doRender:function(){render(this.getFodder(),$(this.area_config.id))}},'popup':{doRender:function(){var c=this['creativity_config'],display_config=c.display_config,area_id=this.area_config.id,fodder=this.getFodder();if(display_config.focus_back&&/tencenttraveler|myie|maxthon|opera/i.test(navigator.userAgent)){return}setTimeout(function(){var popup_window=window.open('http://www.hiao.com/a.html?'+a.serializeQuery(a.mix({loc:area_id,oid:c.oid,cid:c.cid},fodder)),'_blank',a.getObjectToStringFn('=',',',false,false)({menubar:'no',left:0,top:0,width:fodder.width,height:fodder.height}));if(popup_window&&display_config.focus_back){popup_window.blur();window.focus()}},display_config.delay*1000)}}});regPing({'banner':{doRender:function(){render(this.getFodder(),$(this.area_config.id))}},'float_fullscreen':{doRender:function(){var el=dom.get(this.area_config.id),fodder=this.getFodder(),display_config=this.getDisplayConfig(),closed=false;var close=function(){if(!closed){dom.hide(el);mutex_unlock();closed=true}};enter_mutex(function(){var _el=document.createElement('div');render(fodder,_el,true);var close_button_panel=dom.createElement(a.format(close_button_html,{width:fodder.width,height:close_button_height,close_button_url:close_button_url}));evt.on(close_button_panel.firstChild,'click',close);el.appendChild(close_button_panel);el.appendChild(_el);dom.show(el);setTimeout(close,display_config.duration*1000)},display_config.delay)}},'raw_fullscreen':{doRender:function(){var container=dom.get(this.area_config.id),fodder=this.getFodder(),display_config=this.getDisplayConfig();enter_mutex(function(){render(fodder,container);dom.show(container);setTimeout(function(){dom.hide(container);mutex_unlock()},display_config.duration*1000)},display_config.delay)}},'float':function(){var delegate=function(fn,arg2){return function(arg1){return fn(arg1,arg2)}},leftCalculator={left:function(el_width,margin){return dom.getDocumentScrollLeft()+margin},right:function(el_width,margin){return dom.getViewportWidth()+dom.getDocumentScrollLeft()-el_width-margin}},topCalculator={top:function(el_height,margin){return dom.getDocumentScrollTop()+margin},middle:function(el_height,margin){return(dom.getViewportHeight()-el_height)/2+dom.getDocumentScrollTop()},bottom:function(el_height,margin){return dom.getViewportHeight()+dom.getDocumentScrollTop()-el_height-margin}},renderFloat=function(edges,display_config,fodder,close){var fodder_height=fodder.height,fodder_width=fodder.width,direction=edges[0],position=edges[1],cl=delegate(leftCalculator[direction],display_config.margin_h),ct=delegate(topCalculator[position],display_config.margin_v),el=createAbsoluteElement(100),page_content_width=display_config.page_content_width,getPosition=function(){return{left:cl(fodder_width),top:ct(fodder_height)}},anim=new a.Anim(el,{duration:1,transition:function(p){return Math.pow(p,.4)}});if(display_config.close_button!='none'){fodder_height+=close_button_height;var _el=document.createElement('div');render(fodder,_el,true);var close_button_panel=dom.createElement(a.format(close_button_html,{width:fodder_width,height:close_button_height,close_button_url:close_button_url}));evt.on(close_button_panel.firstChild,'click',close);if(display_config.close_button=='bottom'){el.appendChild(_el);el.appendChild(close_button_panel)}else if(display_config.close_button=='top'){el.appendChild(close_button_panel);el.appendChild(_el)}}else{render(fodder,el)}var widthIsValid=function(){if((dom.getViewportWidth()-page_content_width)/2dy+fodder_height){from.top=dom.getDocumentScrollTop()+dom.getViewportHeight();config.duration=.3}}else if(position=='top'){if(sy0)}},100,true)}}},'fullscreen':function(){var replay_button_width=48,replay_button_height=19,replay_button_offsetY=-8,replay_button_config={position:'absolute',width:replay_button_width+'px',height:replay_button_height+'px',display:'none','background-image':'url(http://www.hiao.com/gb/images/9703.files/hiao_replay.gif)',cursor:'pointer'},close_button_config={position:'absolute',width:'19px',height:'19px',right:'7px',top:'7px','background-image':'url(http://www.hiao.com/gb/images/9703.files/hiao_close.gif)',cursor:'pointer'},back_proxy_config={'z-index':999,left:'-9999px',position:'absolute',border:'2px solid #ccc',opacity:.5,filter:'alpha(opacity=50)'};return{doRender:function(){var container=dom.get(this.area_config.id),fodder=this.getFodder(),display_config=this.getDisplayConfig(),show_duration=display_config.show_duration,hide_duration=display_config.hide_duration,close_button=dom.createElement(close_button_config,{'class':'absolute'}),replay_button=dom.createElement(replay_button_config,{'class':'absolute'}),close_timer;dom.setStyle(container,{overflow:'hidden',height:0,position:'relative',display:'block'});var fodder_width=fodder.width,fodder_height=fodder.height,back_proxy=dom.createElement(back_proxy_config);render(fodder,container);var invokeFlash=getFlashInvoker(container);var morphProxy=(function(){var anim_proxy=new a.Anim(back_proxy,{callback:function(){dom.setStyle(back_proxy,{left:-9999})}});return function(show){dom.setStyle(replay_button,{display:''});var f_xy=dom.getXY(container),t_xy=dom.getXY(replay_button);dom.setStyle(replay_button,{display:'none'});var arr=[{left:f_xy[0],top:f_xy[1],width:fodder_width-4,height:fodder_height-4},{left:t_xy[0],top:t_xy[1],width:replay_button_width-4,height:replay_button_height-4}];if(!show){anim_proxy.morph({from:arr[0],to:arr[1],config:{duration:hide_duration}})}else{anim_proxy.morph({from:arr[1],to:arr[0],config:{duration:show_duration}})}}})();var hide=(function(){var anim_hide=new a.Anim(container,{duration:hide_duration,callback:function(){dom.setStyle(replay_button,{display:'block'});mutex_unlock()}});return function(){clearTimeout(close_timer);morphProxy(false);invokeFlash('StopPlay');anim_hide.morph({to:{height:0}})}})();var show=(function(){var anim_show=new a.Anim(container,{duration:show_duration,callback:function(){invokeFlash('Play');close_timer=setTimeout(hide,display_config.duration*1000)}});return function(){clearTimeout(close_timer);dom.setStyle(replay_button,{display:'none'});morphProxy(true);invokeFlash('Rewind');anim_show.morph({to:{height:fodder_height}})}})();evt.on(close_button,'click',hide);evt.on(replay_button,'click',function(){_show(false)});container.appendChild(close_button);document.body.insertBefore(replay_button,document.body.firstChild);document.body.insertBefore(back_proxy,document.body.firstChild);observeWindow(function(){var xy=dom.getXY(container);dom.setStyle(replay_button,{left:xy[0]+fodder_width-3,top:xy[1]+replay_button_offsetY})},0,true);var _show=function(retry){if(retry){enter_mutex(show,0)}else{if(mutex_lock()==0){show()}}};setTimeout(function(){_show(true)},display_config.delay*1000)}}}})})(AD2);(function(a){var convertor={'string':function(value){return value},'bool':function(value){if(value.toLowerCase()=='false'){return false}return true},'number':function(value){return value-0}};a.getQueryData=function(mapping){var c={},idx=location.href.indexOf('?');if(idx!=-1){a.each(location.href.substring(idx+1).split('&'),function(pair){pair=pair.split('=');if(pair[1]!=null){c[pair[0]]=decodeURIComponent(pair[1])}})}if(mapping){a.each(mapping,function(type,key){if(c[key]!=null){c[key]=convertor[type](c[key])}})}return c}})(AD2); (function(){var a=AD2, dom = a.DomUtil,evt=a.DomEventUtil; a.area({id:"nuploc_350"})({display:"fullscreen",display_config:{delay:2,duration:10,show_duration:.5,hide_duration:.6}, fodder:[{type: 'image',resource_url: 'http://up.hiao.com/Files/20100729/2010072916241969857.jpg', link_to: 'http://house.qingdaonews.com/content/2010-07/27/content_8439567.htm', width: 950, height: 250,cover: false}]}); a.render('nuploc_350'); a.ping.flush();})();