(function(){try{document.execCommand("BackgroundImageCache",false,true)}catch(e){}var isIE=(navigator.userAgent.indexOf("MSIE")!=-1)&&!window.opera;var isWebKit=(navigator.userAgent.indexOf("AppleWebKit/")>-1);var isOpera=(typeof window.opera!=="undefined")?true:false;function getElementPosition(elm){if(!elm){return null}var absTop=elm.offsetTop;var absLeft=elm.offsetLeft;var offsetWidth=elm.offsetWidth;var offsetHeight=elm.offsetHeight;while(elm=elm.offsetParent){absTop+=elm.offsetTop;absLeft+=elm.offsetLeft}return{top:absTop,left:absLeft,offsetWidth:offsetWidth,offsetHeight:offsetHeight}}function $(id){return document.getElementById(id)}function $C(tagName){return document.createElement(tagName)}if(!isIE){function __attachEvent(type,handler){type=type.replace(/^on/,"");this.addEventListener(type,handler,false)}window.attachEvent=document.attachEvent=HTMLElement.prototype.attachEvent=__attachEvent;function __detachEvent(type,handler){type=type.replace(/^on/,"");this.removeEventListener(type,handler,false)}window.detachEvent=document.detachEvent=HTMLElement.prototype.detachEvent=__detachEvent}Function.prototype.bind=function(){var __m=this,object=arguments[0],args=new Array();for(var i=1;i<arguments.length;i++){args.push(arguments[i])}return function(){return __m.apply(object,args)}};Function.prototype.delegate=function(context){var __m=this;return function(){__m.apply(context,arguments)}};if(!Object.prototype.toJSONString){Array.prototype.toJSONString=function(w){var a=[],i,l=this.length,v;for(i=0;i<l;i+=1){v=this[i];switch(typeof v){case"object":if(v){if(typeof v.toJSONString==="function"){a.push(v.toJSONString(w))}}else{a.push("null")}break;case"string":case"number":case"boolean":a.push(v.toJSONString())}}return"["+a.join(",")+"]"};Boolean.prototype.toJSONString=function(){return String(this)};Date.prototype.toJSONString=function(){function f(n){return n<10?"0"+n:n}return'"'+this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+'Z"'};Number.prototype.toJSONString=function(){return isFinite(this)?String(this):"null"};Object.prototype.toJSONString=function(w){var a=[],k,i,v;if(w){for(i=0;i<w.length;i+=1){k=w[i];if(typeof k==="string"){v=this[k];switch(typeof v){case"object":if(v){if(typeof v.toJSONString==="function"){a.push(k.toJSONString()+":"+v.toJSONString(w))}}else{a.push(k.toJSONString()+":null")}break;case"string":case"number":case"boolean":a.push(k.toJSONString()+":"+v.toJSONString())}}}}else{for(k in this){if(typeof k==="string"&&Object.prototype.hasOwnProperty.apply(this,[k])){v=this[k];switch(typeof v){case"object":if(v){if(typeof v.toJSONString==="function"){a.push(k.toJSONString()+":"+v.toJSONString())}}else{a.push(k.toJSONString()+":null")}break;case"string":case"number":case"boolean":a.push(k.toJSONString()+":"+v.toJSONString())}}}}return"{"+a.join(",")+"}"};(function(s){var m={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};s.parseJSON=function(filter){var j;function walk(k,v){var i;if(v&&typeof v==="object"){for(i in v){if(Object.prototype.hasOwnProperty.apply(v,[i])){v[i]=walk(i,v[i])}}}return filter(k,v)}if(/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/.test(this.replace(/\\./g,"@").replace(/"[^"\\\n\r]*"/g,""))){j=eval("("+this+")");return typeof filter==="function"?walk("",j):j}throw new SyntaxError("parseJSON")};s.toJSONString=function(){if(/["\\\x00-\x1f]/.test(this)){return'"'+this.replace(/[\x00-\x1f\\"]/g,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)})+'"'}return'"'+this+'"'}})(String.prototype)}window.dhtmlHistory={isIE:false,isOpera:false,isSafari:false,isKonquerer:false,isGecko:false,isSupported:false,create:function(options){var that=this;window.historyStorage.setup(options);if(options&&options.baseTitle){if(options.baseTitle.indexOf("@@@")<0&&historyStorage.debugMode){throw new Error("Programmer error: options.baseTitle must contain the replacement parameter '@@@' to be useful.")}this.baseTitle=options.baseTitle}var UA=navigator.userAgent.toLowerCase();var platform=navigator.platform.toLowerCase();var vendor=navigator.vendor||"";if(vendor==="KDE"){this.isKonqueror=true;this.isSupported=false}else{if(typeof window.opera!=="undefined"){this.isOpera=true;this.isSupported=true}else{if(typeof document.all!=="undefined"){this.isIE=true;this.isSupported=true}else{if(vendor.indexOf("Apple Computer, Inc.")>-1){this.isSafari=true;this.isSupported=(platform.indexOf("mac")>-1)}else{if(UA.indexOf("gecko")!=-1){this.isGecko=true;this.isSupported=true}}}}}if(this.isSafari){this.createSafari()}else{if(this.isOpera){this.createOpera()}}var initialHash=this.getCurrentLocation();this.currentLocation=initialHash;if(this.isIE){if(options&&options.blankURL){var u=options.blankURL;this.blankURL=(u.indexOf("?")!=u.length-1?u+"?":u)}this.createIE(initialHash)}var unloadHandler=function(){that.firstLoad=null};this.addEventListener(window,"unload",unloadHandler);if(this.isIE){this.ignoreLocationChange=true}else{if(!historyStorage.hasKey(this.PAGELOADEDSTRING)){this.ignoreLocationChange=true;this.firstLoad=true;historyStorage.put(this.PAGELOADEDSTRING,true)}else{this.ignoreLocationChange=false;this.firstLoad=false;this.fireOnNewListener=true}}var locationHandler=function(){that.checkLocation()};setInterval(locationHandler,100)},initialize:function(listener){this.originalTitle=document.title;if(this.isIE){if(!historyStorage.hasKey(this.PAGELOADEDSTRING)){this.fireOnNewListener=false;this.firstLoad=true;historyStorage.put(this.PAGELOADEDSTRING,true)}else{this.fireOnNewListener=true;this.firstLoad=false}}if(listener){this.addListener(listener)}},addListener:function(listener){this.listener=listener;if(this.fireOnNewListener){this.fireHistoryEvent(this.currentLocation);this.fireOnNewListener=false}},changeTitle:function(historyData){var winTitle=(historyData&&historyData.newTitle?this.baseTitle.replace("@@@",historyData.newTitle):this.originalTitle);if(document.title==winTitle){return }document.title=winTitle;if(this.isIE){this.iframe.contentWindow.document.title=winTitle}if(!this.isIE&&!this.isOpera){var hash=decodeURIComponent(document.location.hash);if(hash!=""){var encodedHash=encodeURIComponent(this.removeHash(hash));document.location.hash=encodedHash}else{}}},add:function(newLocation,historyData){var that=this;var encodedLocation=encodeURIComponent(this.removeHash(newLocation));if(this.isSafari){historyStorage.put(newLocation,historyData);this.currentLocation=encodedLocation;window.location.hash=encodedLocation;this.putSafariState(encodedLocation);this.changeTitle(historyData)}else{var addImpl=function(){if(that.currentWaitTime>0){that.currentWaitTime=that.currentWaitTime-that.waitTime}if(document.getElementById(encodedLocation)&&that.debugMode){var e="Exception: History locations can not have the same value as _any_ IDs that might be in the document, due to a bug in IE; please ask the developer to choose a history location that does not match any HTML IDs in this document. The following ID is already taken and cannot be a location: "+newLocation;throw new Error(e)}historyStorage.put(newLocation,historyData);that.ignoreLocationChange=true;that.ieAtomicLocationChange=true;that.currentLocation=encodedLocation;window.location.hash=encodedLocation;if(that.isIE){that.iframe.src=that.blankURL+encodedLocation}that.ieAtomicLocationChange=false;that.changeTitle(historyData)};window.setTimeout(addImpl,this.currentWaitTime);this.currentWaitTime=this.currentWaitTime+this.waitTime}},isFirstLoad:function(){return this.firstLoad},getVersion:function(){return this.VERSIONNUMBER},PAGELOADEDSTRING:"DhtmlHistory_pageLoaded",VERSIONNUMBER:"0.8",baseTitle:"@@@",originalTitle:null,blankURL:"blank.html?",listener:null,waitTime:200,currentWaitTime:0,currentLocation:null,iframe:null,safariHistoryStartPoint:null,safariStack:null,safariLength:null,ignoreLocationChange:null,fireOnNewListener:null,firstLoad:null,ieAtomicLocationChange:null,addEventListener:function(o,e,l){if(o.addEventListener){o.addEventListener(e,l,false)}else{if(o.attachEvent){o.attachEvent("on"+e,function(){l(window.event)})}}},createIE:function(initialHash){this.waitTime=400;var styles=(historyStorage.debugMode?"width: 800px;height:80px;border:1px solid black;":historyStorage.hideStyles);var iframeID="rshHistoryFrame";var iframeHTML='<iframe frameborder="0" id="'+iframeID+'" style="'+styles+'" src="'+this.blankURL+initialHash+'"></iframe>';document.write(iframeHTML);this.iframe=document.getElementById(iframeID)},createOpera:function(){this.waitTime=400;var imgHTML='<img src="javascript:location.href=\'javascript:dhtmlHistory.checkLocation();\';" style="'+historyStorage.hideStyles+'" />';document.write(imgHTML)},createSafari:function(){var formID="rshSafariForm";var stackID="rshSafariStack";var lengthID="rshSafariLength";var formStyles=historyStorage.debugMode?historyStorage.showStyles:historyStorage.hideStyles;var stackStyles=(historyStorage.debugMode?"width: 800px;height:80px;border:1px solid black;":historyStorage.hideStyles);var lengthStyles=(historyStorage.debugMode?"width:800px;height:20px;border:1px solid black;margin:0;padding:0;":historyStorage.hideStyles);var safariHTML='<form id="'+formID+'" style="'+formStyles+'"><textarea style="'+stackStyles+'" id="'+stackID+'">[]</textarea><input type="text" style="'+lengthStyles+'" id="'+lengthID+'" value=""/></form>';document.write(safariHTML);this.safariStack=document.getElementById(stackID);this.safariLength=document.getElementById(lengthID);if(!historyStorage.hasKey(this.PAGELOADEDSTRING)){this.safariHistoryStartPoint=history.length;this.safariLength.value=this.safariHistoryStartPoint}else{this.safariHistoryStartPoint=this.safariLength.value}},getCurrentLocation:function(){var r=(this.isSafari?this.getSafariState():this.getCurrentHash());return r},getCurrentHash:function(){var r=window.location.href;var i=r.indexOf("#");return(i>=0?r.substr(i+1):"")},getSafariStack:function(){var r=this.safariStack.value;return historyStorage.fromJSON(r)},getSafariState:function(){var stack=this.getSafariStack();var state=stack[history.length-this.safariHistoryStartPoint-1];return state},putSafariState:function(newLocation){var stack=this.getSafariStack();stack[history.length-this.safariHistoryStartPoint]=newLocation;this.safariStack.value=historyStorage.toJSON(stack)},fireHistoryEvent:function(newHash){var decodedHash=decodeURIComponent(newHash);var historyData=historyStorage.get(decodedHash);this.changeTitle(historyData);this.listener.call(null,decodedHash,historyData)},checkLocation:function(){if(!this.isIE&&this.ignoreLocationChange){this.ignoreLocationChange=false;return }if(!this.isIE&&this.ieAtomicLocationChange){return }var hash=this.getCurrentLocation();if(hash==this.currentLocation){return }this.ieAtomicLocationChange=true;if(this.isIE&&this.getIframeHash()!=hash){this.iframe.src=this.blankURL+hash}else{if(this.isIE){return }}this.currentLocation=hash;this.ieAtomicLocationChange=false;this.fireHistoryEvent(hash)},getIframeHash:function(){var doc=this.iframe.contentWindow.document;var hash=String(doc.location.search);if(hash.length==1&&hash.charAt(0)=="?"){hash=""}else{if(hash.length>=2&&hash.charAt(0)=="?"){hash=hash.substring(1)}}return hash},removeHash:function(hashValue){var r;if(hashValue===null||hashValue===undefined){r=null}else{if(hashValue===""){r=""}else{if(hashValue.length==1&&hashValue.charAt(0)=="#"){r=""}else{if(hashValue.length>1&&hashValue.charAt(0)=="#"){r=hashValue.substring(1)}else{r=hashValue}}}}return r},iframeLoaded:function(newLocation){if(this.ignoreLocationChange){this.ignoreLocationChange=false;return }var hash=String(newLocation.search);if(hash.length==1&&hash.charAt(0)=="?"){hash=""}else{if(hash.length>=2&&hash.charAt(0)=="?"){hash=hash.substring(1)}}window.location.hash=hash;this.fireHistoryEvent(hash)}};window.historyStorage={setup:function(options){if(typeof options!=="undefined"){if(options.debugMode){this.debugMode=options.debugMode}if(options.toJSON){this.toJSON=options.toJSON}if(options.fromJSON){this.fromJSON=options.fromJSON}}var formID="rshStorageForm";var textareaID="rshStorageField";var formStyles=this.debugMode?historyStorage.showStyles:historyStorage.hideStyles;var textareaStyles=(historyStorage.debugMode?"width: 800px;height:80px;border:1px solid black;":historyStorage.hideStyles);var textareaHTML='<form id="'+formID+'" style="'+formStyles+'"><textarea id="'+textareaID+'" style="'+textareaStyles+'"></textarea></form>';document.write(textareaHTML);this.storageField=document.getElementById(textareaID);if(typeof window.opera!=="undefined"){this.storageField.focus()}},put:function(key,value){var encodedKey=encodeURIComponent(key);this.assertValidKey(encodedKey);if(this.hasKey(key)){this.remove(key)}this.storageHash[encodedKey]=value;this.saveHashTable()},get:function(key){var encodedKey=encodeURIComponent(key);this.assertValidKey(encodedKey);this.loadHashTable();var value=this.storageHash[encodedKey];if(value===undefined){value=null}return value},remove:function(key){var encodedKey=encodeURIComponent(key);this.assertValidKey(encodedKey);this.loadHashTable();delete this.storageHash[encodedKey];this.saveHashTable()},reset:function(){this.storageField.value="";this.storageHash={}},hasKey:function(key){var encodedKey=encodeURIComponent(key);this.assertValidKey(encodedKey);this.loadHashTable();return(typeof this.storageHash[encodedKey]!=="undefined")},isValidKey:function(key){return(typeof key==="string")},showStyles:"border:0;margin:0;padding:0;",hideStyles:"left:-1000px;top:-1000px;width:1px;height:1px;border:0;position:absolute;",debugMode:false,storageHash:{},hashLoaded:false,storageField:null,assertValidKey:function(key){var isValid=this.isValidKey(key);if(!isValid&&this.debugMode){throw new Error("Please provide a valid key for window.historyStorage. Invalid key = "+key+".")}},loadHashTable:function(){if(!this.hashLoaded){var serializedHashTable=this.storageField.value;if(serializedHashTable!==""&&serializedHashTable!==null){this.storageHash=this.fromJSON(serializedHashTable);this.hashLoaded=true}}},saveHashTable:function(){this.loadHashTable();var serializedHashTable=this.toJSON(this.storageHash);this.storageField.value=serializedHashTable},toJSON:function(o){return o.toJSONString()},fromJSON:function(s){return s.parseJSON()}};var URLParams=(function(){var params=null;function init(){params={};var paramSlices=location.search.replace("?","").split("&");var nParams=paramSlices.length;var temp;for(var i=0;i<nParams;i++){temp=paramSlices[i].split("=");params[temp[0]]=temp[1]}}return{getAll:function(){if(!params){init()}return params},get:function(key){if(!params){init()}return params[key]}}})();var EventDispatcher=(function(){var queues={};function addEventListener(eventType,handler){var queueName="__q_"+eventType;if(!queues[queueName]){queues[queueName]=[]}switch(typeof handler){case"object":if(typeof handler.handleEvent!="function"){throw new Error("Invalid event handler: no event handling function handleEvent() defined.")}break;case"function":break;default:throw new Error("Invalid event handler: type of given handler is not supported.")}queues[queueName].push(handler)}function removeEventListener(eventType,handler){if(typeof eventType=="undefined"){return }if(typeof handler=="undefined"){return }var queueName="__q_"+eventType;var q=queues[queueName];if(q==null){return }var nQueue=q.length;for(var i=0;i<nQueue;i++){if(q[i]==handler){q.splice(i,1);return }}}function dispatchEvent(eventObject,errorHandler){if(arguments.length==0){return }if(typeof eventObject.type=="undefined"){throw new Error("Invalid event.")}var eventType=eventObject.type;var queueName="__q_"+eventType;var q=queues[queueName];if(q==null){return }var nQueue=q.length;for(var i=0;i<nQueue;i++){try{if(typeof q[i]=="function"){q[i](eventObject)}else{if(typeof q[i]=="object"){q[i].handleEvent(eventObject)}else{throw new Error("Unsupport handler type in event queue. Maybe a bug, please contact author<liuyuanchen@baidu.com>.")}}}catch(err){if(typeof errorHandler=="function"){errorHandler(err)}}}}return{initialize:function(obj){if(typeof obj!="object"){throw new Error("Invalid event dispatching target.")}obj.addEventListener=addEventListener;obj.removeEventListener=removeEventListener;obj.dispatchEvent=dispatchEvent;return obj}}})();var RecycleBin=function(){this.Init.apply(this,arguments)};RecycleBin.prototype={_id:"",_bin:null,Init:function(id){if(!id){id=new Date().getTime()}this._id="recycle_bin_"+id},_initialize:function(){this._bin=document.getElementById(this._id);if(!!this._bin){return }this._bin=document.createElement("DIV");this._bin.id=this._id;this._bin.style.display="none";document.body.appendChild(this._bin)},recycle:function(obj){if(!obj){return }if(!obj.parentNode){return }if(this._bin==null){this._initialize()}obj=obj.parentNode.removeChild(obj);this._bin.appendChild(obj);obj=null},empty:function(){if(this._bin==null){this._initialize();return }this._bin.innerHTML="";try{CollectGarbage()}catch(e){}}};function _zoom(w,h){if(!(this.complete||(this.width>0&&this.height>0))){return false}if((this.width>w)||(this.height>h)){var rw=Math.floor(h*this.width/this.height);var rh=Math.floor(w*this.height/this.width);if((this.width/this.height)>(w/h)){this.style.width=w+"px";this.style.height=rh+"px"}else{this.style.width=rw+"px";this.style.height=h+"px"}}return true}function _forceZoom(w,h,w1,h1){if((w1>w)||(h1>h)){var rw=Math.floor(h*w1/h1);var rh=Math.floor(w*h1/w1);if((w1/h1)>(w/h)){this.style.width=w+"px";this.style.height=rh+"px"}else{this.style.width=rw+"px";this.style.height=h+"px"}}else{this.style.width=w1+"px";this.style.height=h1+"px"}}function newImage(){var img=new Image();img.zoom=_zoom;img.forceZoom=_forceZoom;return img}var STATISTICS={_url:"http://i.baidu.jp/mon/",_flags:{deadLink:"dl.gif",albumPage:"pt.gif",slideShow:"ppt.gif"},set:function(statKey,value){var img=new Image();img.style.display="none";value=value.replace(/</g,"%3C").replace(/>/g,"%3E");if(statKey=="deadLink"){value=value.replace(/ct=\d*&?/g,"")}img.src=this._url+this._flags[statKey]+"?"+value+"&rnd="+new Date().getTime()}};var DataManager=(function(){function createXhrObject(){try{return new ActiveXObject("MSXML2.XMLHTTP.3.0")}catch(e){try{return new XMLHttpRequest()}catch(e){return null}}}function regulatePn(pn){pn=parseInt(pn);pn=pn?pn:0;pn=(pn<0)?0:pn;return(pn>=(BD_LIST_NUM-1)&&BD_LIST_NUM>0)?(BD_LIST_NUM-1):pn}function getDataSlice(startPn,len){if(startPn<0){startPn=0}return data.slice(startPn,startPn+len)}function getImageSize(w,h){if((w>140)||(h>120)){var rw=Math.floor(120*w/h);var rh=Math.floor(140*h/w);if((w/h)>(140/120)){return[140,rh]}else{return[rw,120]}}return[w,h]}function autoResizeImg(img){var m=getImageSize(img.width,img.height);if((m[0]>0)&&(m[1]>0)){img.style.width=m[0]+"px";img.style.height=m[1]+"px"}}function addData(img){if(img.pn==null){return }if(data[img.pn]!=null){return }data[img.pn]=img}function xhrCallback(pn,num,callback){if(xhr.readyState!=4){return }try{var jsonObj=xhr.responseText.parseJSON();var images=jsonObj.data;images.pop()}catch(e){return }BD_LIST_NUM=jsonObj.listNum;BD_DISP_NUM=jsonObj.dispNum;data[BD_LIST_NUM-1]=null;var nImages=images.length;var imgElm=null;for(var i=0;i<nImages;i++){images[i].url=BD_PAGE_URL_BASE.replace(/201326592/,"503316480")+"&tn=baiduimagedetail&cl="+(URLParams.get("cl")?URLParams.get("cl"):"0")+"&pn="+images[i].pn+"&rn=1&ln=2000&di="+images[i].di+"&s="+images[i].filesize+"&w="+images[i].width+"&h="+images[i].height+(images[i].imgSetSign=="0,1"?"":"&iss="+images[i].imgSetSign)+(images[i].imgSetSign=="0,1"?"":"&isn="+images[i].imgSetImgNum);addData(images[i])}var dataTemp=[];for(var i=0;i<nImages;i++){if(num<0){if(data[pn-i]){dataTemp.push(data[pn-i])}}else{if(data[pn+i]){dataTemp.push(data[pn+i])}}}callback(dataTemp,pn,num);o=null;callback=null}function load(pn,num,callback){var MAX_NUM=30;delete xhr;xhr=null;xhr=createXhrObject();xhr.onreadystatechange=(function(pn,num,cb){return function(){xhrCallback(pn,num,cb)}})(pn,num,callback);var startPn=pn;if(num<0){startPn=pn-MAX_NUM+1;startPn=(startPn<0)?0:startPn}urlBase=BD_PAGE_URL_BASE+"&tn=baiduimagejson";var url=urlBase+"&pn="+startPn+"&rn="+MAX_NUM;var cl=URLParams.get("cl")?URLParams.get("cl"):"0";url+="&cl="+cl;if(URLParams.get("tn")=="baiduimagealbum"){url+="&fm=album"}else{if($("slideMask").style.display!="none"){url+="&fm=ppt"}}url+="&.stamp="+(new Date()).getTime();xhr.open("GET",url,true);xhr.send(null)}function prefetch(startPn){var MAX_NUM=30;var MAX_LIST_NUM=3*7;var slice=getDataSlice(startPn,MAX_LIST_NUM);for(var i=0,nSlice=slice.length;i<nSlice;i++){if(slice[i]==null){load(startPn+i,MAX_NUM,function(){});return }}}var data=[];var urlBase=BD_PAGE_URL_BASE+"&tn=baiduimagejson";var curPn=0;var xhr=createXhrObject();try{xhr.overrideMimeType("text/html; charset=UTF-8")}catch(e){}data[BD_LIST_NUM-1]=null;curPn=regulatePn(URLParams.get("pn"));return{getCurPn:function(){return curPn},setCurPn:function(pn){curPn=regulatePn(pn)},addData:function(img){addData(img)},requestData:function(startPn,num,callback){var MAX_LIST_NUM=3*7;var start=startPn;if(num<0){start=startPn+num+1}var slice=getDataSlice(start,MAX_LIST_NUM);if(slice.length==0&&window.opera){load(startPn,num,callback);return }for(var i=0,nSilce=slice.length;i<nSilce;i++){if(slice[i]==null){load(start,num,function(imgs,startPn,num){callback(imgs);prefetch(startPn+num)});return }}callback(slice);prefetch(startPn+num);callback=null},getImgData:function(pn){return data[pn]},prefetch:function(startPn){prefetch(startPn)},cleanData:function(){data=[];if(BD_LIST_NUM<1){BD_LIST_NUM=1}data[BD_LIST_NUM-1]=null}}})();var SlideShowRecycleBin=new RecycleBin("side_show");var SlideShowBarController=(function(){var stopTimer=null;function start(){window.clearTimeout(stopTimer);$("slideBtn_play").style.display="none";$("slideBtn_pause").style.display="inline";o.dispatchEvent({type:"SlideShowStartPlay"});var str="";switch(URLParams.get("tn")){case"baiduimage":str="&tn=baiduimage&fm=list";break;case"baiduimagealbum":str="&tn=baiduimagealbum&fm=album";break;default:str="&tn=baiduimage&fm=list";break}STATISTICS.set("slideShow","word="+URLParams.get("word")+"&pn="+DataManager.getCurPn()+str)}function _stop(){window.clearTimeout(stopTimer);$("slideBtn_play").style.display="inline";$("slideBtn_pause").style.display="none";o.dispatchEvent({type:"SlideShowStopPlay"})}function resume(){window.clearTimeout(stopTimer);$("slideBtn_play").style.display="none";$("slideBtn_pause").style.display="inline";o.dispatchEvent({type:"SlideShowResumePlay"})}function pause(){window.clearTimeout(stopTimer);$("slideBtn_play").style.display="inline";$("slideBtn_pause").style.display="none";o.dispatchEvent({type:"SlideShowPausePlay"})}function incrementInterval(){o.dispatchEvent({type:"SlideShowIncrementInterval"})}function decrementInterval(){o.dispatchEvent({type:"SlideShowDecrementInterval"})}function gotoNext(){window.clearTimeout(stopTimer);o.dispatchEvent({type:"SlideShowGotoNext"})}function gotoPrev(){window.clearTimeout(stopTimer);$("slideBtn_play").style.display="inline";$("slideBtn_pause").style.display="none";o.dispatchEvent({type:"SlideShowGotoPrev"})}function changeIntervalDisplay(interval){$("slideTime").innerHTML=interval+" \u79d2"}function launchStopTimer(){window.clearTimeout(stopTimer);stopTimer=window.setTimeout(_stop,30000)}var o=EventDispatcher.initialize({start:start,stop:_stop,init:function(){$("slideBtn_prev").onclick=gotoPrev;$("slideBtn_next").onclick=gotoNext;$("slideBtn_play").onclick=resume;$("slideBtn_pause").onclick=pause;$("slideBtn_less").onclick=decrementInterval;$("slideBtn_more").onclick=incrementInterval;$("slideStart").attachEvent("onclick",start);$("slideStop").onclick=function(){window.dhtmlHistory.add("slideoff");_stop()}},handleEvent:function(evt){switch(evt.type){case"SlideShowIntervalChanged":changeIntervalDisplay(evt.interval);break;case"SlideShowReachEnd":launchStopTimer();break;default:return }}});return o})();var SlideShowMaskController=(function(){function ignoreKeyPress(){var evt=arguments[0];if((evt.keyCode>=33)&&(evt.keyCode<=40)){evt.preventDefault()}}return EventDispatcher.initialize({show:function(){var ch=document.documentElement.clientHeight;$("slideStart").style.display="none";$("slide").style.display="";$("slide").style.height=ch+"px";$("slideMask").style.display="";$("slideMask").style.height=ch+"px";$("slideStop").focus();this.dispatchEvent({type:"SlideShowMaskReady"});this.adjust();if(isIE){document.styleSheets[0].addRule("html","overflow:hidden",0)}else{document.body.style.overflow="hidden";document.attachEvent("onkeydown",ignoreKeyPress)}document.onmousewheel=function(){return false}},hide:function(){$("slide").style.display="none";$("slideMask").style.display="none";$("slideStart").style.display="";if(isIE){var s=document.styleSheets[0];s.removeRule(0);s.addRule("html","overflow:auto;clip:auto;",0);s.removeRule(0);document.body.style.overflow="visible"}else{document.body.style.overflow="visible";document.detachEvent("keydown",ignoreKeyPress)}document.onmousewheel=null},adjust:function(){window.scrollTo(0,0);var h=isOpera?(document.body.clientHeight-20):document.documentElement.clientHeight;var w=document.body.offsetWidth;$("slideMask").style.height=h+"px";$("slideMask").style.width=w+"px";$("slide").style.height=h+"px";$("slide").style.width=w+"px";$("slideDetailContainer").style.height=(h-92)+"px"},handleEvent:function(evt){switch(evt.type){case"SlideShowStartPlay":document.body.style.overflow="hidden";document.getElementsByName("f1")[0].className="";this.show();break;case"SlideShowStopPlay":document.body.style.overflow="auto";document.getElementsByName("f1")[0].className="enable-suggestion";this.hide();break;case"SlideShowImageChanged":this.adjust();break;default:return }}})})();var SlideShowImageController=(function(){var LOAD_TIMEOUT=10;var interval=3;var switchTimer=0;var loadMonitor=0;var pause=false;var img=null;var thumb=null;function incrementInterval(){interval++;if(interval>30){interval=30}}function decrementInterval(){interval--;if(interval<1){interval=1}}function getViewRectangle(){return{w:(document.body.offsetWidth-40),h:((isOpera?(document.body.clientHeight-20):document.documentElement.clientHeight)-92)}}function getZoomSize(w,h){var m=getViewRectangle();if((w<=0)||(h<=0)){return m}if((w>m.w)||(h>m.h)){var rw=Math.floor(m.h*w/h);var rh=Math.floor(m.w*h/w);if((w/h)>(m.w/m.h)){return{w:m.w,h:rh}}else{return{w:rw,h:m.h}}}else{return{w:w,h:h}}}function requestData(){var pn=DataManager.getCurPn();DataManager.requestData(pn+1,1,showImage)}function onImageLoad(ok){var pn=DataManager.getCurPn();thumb.onload=thumb.onerror=null;img.onload=null;img.onerror=null;if(!ok){img.src=thumb.src}var m=getViewRectangle();img.zoom(m.w,m.h);thumb.style.display="none";img.style.display="inline";try{img.parentNode.style.margin="0 auto"}catch(e){}if($("slideMask").style.display=="none"){return }if(pause){return }if(pn>=(BD_LIST_NUM-1)){o.dispatchEvent({type:"SlideShowReachEnd"});return }window.clearTimeout(loadMonitor);switchTimer=window.setTimeout(requestData,interval*1000);LoadingAnimController.hide()}function cancelLoad(){if(img.complete){return }if($("slideMask").style.display=="none"){return }if(pause){return }thumb.onload=null;thumb.onerror=null;img.onload=null;img.onerror=null;window.clearTimeout(switchTimer);window.clearTimeout(loadMonitor);thumb.style.display="";img.style.display="none";if($("slideMask").style.display=="none"){return }if(pause){return }var pn=DataManager.getCurPn();if(pn>=(BD_LIST_NUM-1)){o.dispatchEvent({type:"SlideShowReachEnd"});return }requestData()}function onThumbLoad(){var m=getViewRectangle();thumb.zoom(m.w,m.h)}function showImage(data){if(data.length==0){return }var d=data[0];var m=getViewRectangle(d.width,d.height);var oldPn=DataManager.getCurPn();DataManager.setCurPn(d.pn);var c=$("slideDetail");var t=null;while(c.getElementsByTagName("img").length>0){t=c.getElementsByTagName("img")[0];t.onclick=t.onload=t.onerror=null;SlideShowRecycleBin.recycle(t);t=null}SlideShowRecycleBin.empty();c.innerHTML="";var link=$C("A");var zs=getZoomSize(d.width,d.height);with(link){href=d.url;target="_blank";style.display="block";style.width=zs.w+"px";style.margin="0 auto"}c.appendChild(link);thumb=newImage();thumb.src=d.thumbUrl;thumb.id="slideThumb"+new Date().getTime();if((d.width>0)&&(d.height>0)){thumb.forceZoom(m.w,m.h,d.width,d.height);thumb.onload=onThumbLoad}link.appendChild(thumb);LoadingAnimController.show($("slideDetailContainer"));img=newImage();img.id="slideDetail"+new Date().getTime();img.style.display="none";if((d.width>0)&&(d.height>0)){img.forceZoom(m.w,m.h,d.width,d.height)}img.onload=function(){onImageLoad(true)};img.onerror=(function(objUrl,url,ukeys){url=url.replace(/^\/i\?/,"");return function(){STATISTICS.set("deadLink","url="+objUrl+"&&cont="+ukeys+"&&link="+url);onImageLoad(false);LoadingAnimController.hide()}})(d.objUrl,d.url,d.ukeys);img.src=d.objUrl;link.appendChild(img);STATISTICS.set("slideShow","word="+URLParams.get("word")+"&pn="+DataManager.getCurPn()+"&fm=slideshow");loadMonitor=window.setTimeout(cancelLoad,LOAD_TIMEOUT*1000);o.dispatchEvent({type:"SlideShowImageChanged",oldPn:oldPn,newPn:d.pn})}function gotoNext(){img.onload=img.onerror=null;clearTimeout(loadMonitor);clearTimeout(switchTimer);requestData()}function gotoPrev(){img.onload=img.onerror=null;window.clearTimeout(loadMonitor);window.clearTimeout(switchTimer);pause=true;var pn=DataManager.getCurPn();DataManager.requestData(pn-1,-1,showImage)}function start(){pause=false;var pn=DataManager.getCurPn();DataManager.requestData(pn,1,showImage)}function stop(){pause=true;window.clearTimeout(switchTimer);window.clearTimeout(loadMonitor)}var o=EventDispatcher.initialize({handleEvent:function(evt){switch(evt.type){case"SlideShowMaskReady":case"SlideShowResumePlay":start();break;case"SlideShowStopPlay":case"SlideShowPausePlay":stop();break;case"SlideShowGotoNext":gotoNext();break;case"SlideShowGotoPrev":gotoPrev();break;case"SlideShowIncrementInterval":incrementInterval();this.dispatchEvent({type:"SlideShowIntervalChanged",interval:interval});break;case"SlideShowDecrementInterval":decrementInterval();this.dispatchEvent({type:"SlideShowIntervalChanged",interval:interval});break;default:return }}});return o})();var LoadingAnimController={_tid:0,_calcAbsCenter:function(elm){var pos=getElementPosition(elm);var absTop=pos.top+parseInt(pos.offsetHeight/2)-16;var absLeft=pos.left+parseInt(pos.offsetWidth/2)-16;return{top:absTop,left:absLeft}},_stopHiding:function(){window.clearTimeout(this._tid)},hide:function(){clearTimeout(this._tid);LoadingAnimRecycleBin.recycle(document.getElementById("loading"));LoadingAnimRecycleBin.empty()},show:function(elm){if(!elm){return }if($("loading")){this._stopHiding();this.hide()}var absCenter=this._calcAbsCenter(elm);var o=$C("DIV");o.id="loading";o.className="loading";o.style.top=absCenter.top+"px";o.style.left=absCenter.left+"px";document.body.appendChild(o);this._tid=window.setTimeout(this.hide,2000)}};var LoadingAnimRecycleBin=new RecycleBin("loading_anim");var PageController=(function(){var pageStartPn=0;var pageEndPn=0;var tpl;function init(){pageStartPn=DataManager.getCurPn();tpl='<div><dl><dd><a class="#CLASS#" href="#DETAIL_URL#" title="#FROM_PAGE_TITLE#"><img src="#THUMB_URL#" style="margin-top:#THUMB_MARGIN_TOP#px;" alt="#FROM_PAGE_TITLE#"></a><span>#IMG_INFO#</span></dd></dl></div>'}function getPageInfo(){var m=getMatrix();var pageSize=m[0]*m[1];var nImgs=$("c")?$("c").getElementsByTagName("dl").length:pageSize;var maxPages=Math.ceil(BD_LIST_NUM/pageSize);var pn=DataManager.getCurPn();pageStartPn=DataManager.getCurPn();var curPage=0;if(pn==0){curPage=1}else{if(pn>=(BD_LIST_NUM-1)){curPage=maxPages}else{curPage=Math.ceil((pn+1)/pageSize)}}return{pageSize:pageSize,totalPages:maxPages,curPage:curPage,pageActualSize:nImgs,isFirstPage:(curPage==1)?true:false,isLastPage:(curPage>=maxPages)?true:false,startPn:(curPage-1)*pageSize,endPn:pageStartPn+pageSize-1}}function getMatrix(){var w=document.getElementById("c")?document.getElementById("c").clientWidth:window.innerWidth||document.documentElement.clientWidth;var h=window.innerHeight||document.documentElement.clientHeight;var rows=cols=0;if(w<825){cols=4}else{if(w<990){cols=5}else{if(w<1155){cols=6}else{cols=7}}}if(h<445){rows=1}else{if(h<590){rows=2}else{rows=3}}return[rows,cols]}function cancelClusterCheck(){var pageInfo=getPageInfo();var cl=parseInt(URLParams.get("cl"));cl=isNaN(cl)?2:cl;if(cl&&(pageInfo.curPage==pageInfo.totalPages)&&(BD_LIST_NUM<2000)&&(BD_LIST_NUM<BD_DISP_NUM)){return true}return false}function getPageLinks(){var pageInfo=getPageInfo();var pn=DataManager.getCurPn();if(pageInfo.isFirstPage&&pageInfo.isLastPage){return""}var startPage=Math.min(pageInfo.totalPages-10,pageInfo.curPage-6);startPage=Math.max(0,startPage);var endPage=Math.max(10,pageInfo.curPage+4);endPage=Math.min(endPage,pageInfo.totalPages);var s="";var rnStr=URLParams.get("rn")?("&rn="+URLParams.get("rn")):"";var clusterStr=URLParams.get("cl")?("&cl="+URLParams.get("cl")):"";for(var i=startPage;i<endPage;i++){if((i+1)==pageInfo.curPage){s+="<span"+(i<10?' class="lt10"':"")+">"+pageInfo.curPage+"</span>";continue}s+="<a"+(i<10?' class="lt10"':"")+' href="'+BD_PAGE_URL_BASE+rnStr+"&tn=baiduimage&pg="+(i+1)+"&pn="+(i*pageInfo.pageSize)+clusterStr+'">'+(i+1)+"</a>"}s='<a class="pr'+(pageInfo.curPage==1?" hidden":"")+'" href="'+(pageInfo.curPage==1?"###":BD_PAGE_URL_BASE+rnStr+"&tn=baiduimage&pg="+(pageInfo.curPage-1)+"&pn="+((pageInfo.curPage-2)*pageInfo.pageSize)+clusterStr+"&prev=1")+'"><b>&lt;</b><u>\u524d\u3078</u></a>'+s;s+='<a class="nx'+(pageInfo.curPage==pageInfo.totalPages?" hidden":"")+'" href="'+(pageInfo.curPage==pageInfo.totalPages?"###":BD_PAGE_URL_BASE+rnStr+"&tn=baiduimage&pg="+(pageInfo.curPage+1)+"&pn="+(pageInfo.curPage*pageInfo.pageSize)+clusterStr+"&next=1")+'"><u>\u6b21\u3078</u><b>&gt;</b></a>';if(!/&rel=0/.test(window.location.href)){s=s.replace(/&rel=0/g,"")}if(!/&z=0/.test(window.location.href)){s=s.replace(/&z=0/g,"")}if(!/&color=0/.test(window.location.href)){s=s.replace(/&color=0/g,"")}if(!/&it=0/.test(window.location.href)){s=s.replace(/&it=0/g,"")}return s}function renderPage(imgs){logPageRendering();var t=null;while($("c").getElementsByTagName("img").length>0){t=$("c").getElementsByTagName("img")[0];ListPageRecycleBin.recycle(t);t=null}ListPageRecycleBin.empty();$("c").innerHTML="";var contents=[];var itemTpl="";for(var i=0,nImgs=imgs.length;i<nImgs;i++){itemTpl=tpl;itemTpl=itemTpl.replace(/#CLASS#/g,imgs[i].imgSetSign=="0,1"?"imgbox":"imgbox imgset");itemTpl=itemTpl.replace(/#DETAIL_URL#/g,imgs[i].url);itemTpl=itemTpl.replace(/#THUMB_URL#/g,imgs[i].thumbUrl);itemTpl=itemTpl.replace(/#IMG_TYPE#/g,imgs[i].type);itemTpl=itemTpl.replace(/#IMG_SIZE#/g,imgs[i].filesize);itemTpl=itemTpl.replace(/#OBJ_URL#/g,imgs[i].objUrl);itemTpl=itemTpl.replace(/#FROM_URL#/g,imgs[i].fromUrl);itemTpl=itemTpl.replace(/#FROM_PAGE_TITLE#/g,imgs[i].title.replace(/<strong>/g,"").replace(/<\/strong>/g,""));itemTpl=itemTpl.replace(/#JN#/g,imgs[i].jn);itemTpl=itemTpl.replace(/#IMG_INFO#/g,(imgs[i].width+"x"+imgs[i].height)+(imgs[i].imgSetImgNum?"&nbsp;&nbsp;"+imgs[i].imgSetImgNum+"\u679a":"")+(/[\?&]lm=-1(&|$)/.test(location.search)?"":'<span class="'+imgs[i].type+'">&nbsp;</span>'));var LARGE_THUMB_SIZE=140;var thumbWidth=imgs[i].width,thumbHeight=imgs[i].height,thumbMarginTop;var xRatio=LARGE_THUMB_SIZE/imgs[i].width;var yRatio=LARGE_THUMB_SIZE/imgs[i].height;var minRatio=Math.min(xRatio,yRatio);if(minRatio<1){thumbWidth*=minRatio;thumbHeight*=minRatio}thumbMarginTop=(LARGE_THUMB_SIZE-thumbHeight)/2;itemTpl=itemTpl.replace(/#THUMB_MARGIN_TOP#/g,thumbMarginTop);contents.push(itemTpl)}$("c").innerHTML=contents.join("");window.updateImgSetBg();rebuildLinks();arrangeItems();resetPn();if(typeof ZoomOutHandler!="undefined"){ZoomOutHandler.zoomOut()}if(typeof MarginTopHandler!="undefined"){MarginTopHandler.setMarginTop()}if(typeof ZLayerHandler!="undefined"){ZLayerHandler.addEvents()}if(imgs.length==0){document.getElementById("slideshow").style.display="none";document.getElementById("badcase").style.display="none"}else{document.getElementById("slideshow").style.display="block";document.getElementById("badcase").style.display="block"}if(imgs.length==0){var elmNoResult=document.createElement("div");elmNoResult.id="resultBaidu";$("c").parentNode.insertBefore(elmNoResult,$("c"));$("c").style.display="none";elmNoResult.className=/op_on/.test($("detail_op").className)?"filterOn":"";var queryWordEnc=/word=([^&]*)/.exec(BD_PAGE_URL_BASE)[1];var queryWordExt=decodeURIComponent(queryWordEnc).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;");var resetUrlBase=BD_PAGE_URL_BASE.replace(/&z=\d+/,"&z=0").replace(/&it=\d+/,"&it=0").replace(/&color=\d+/,"&color=0");var resetEnabled=(resetUrlBase!=BD_PAGE_URL_BASE)?true:false;$("resultBaidu").innerHTML='<p id="guide">\u691c\u7d22\u7d50\u679c\u3092\u3053\u3053\u304b\u3089\u8868\u793a</p><div class="image_zero"><p style="margin-bottom: 0.5em;"><strong>'+queryWordExt+"</strong>&nbsp;\u306b\u8a72\u5f53\u3059\u308b\u753b\u50cf\u306f\u898b\u3064\u304b\u308a\u307e\u305b\u3093\u3067\u3057\u305f\u3002</p><p>"+(resetEnabled?'<a href="###" onclick="Fe.G(\'reset\').click();return false;" >\u3059\u3079\u3066\u306e\u7d5e\u308a\u8fbc\u307f\u6761\u4ef6\u3092\u524a\u9664</a>':"")+'</p><dl><dt>Baidu\u304b\u3089\u306e\u30a2\u30c9\u30d0\u30a4\u30b9\uff1a</dt><dd>\u30fb\u5165\u529b\u3057\u305f\u30ad\u30fc\u30ef\u30fc\u30c9\u306b\u8aa4\u308a\u304c\u306a\u3044\u304b\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002</dd><dd>\u30fb\u30ad\u30fc\u30ef\u30fc\u30c9\u3092\u30ed\u30fc\u30de\u5b57\u5165\u529b\u3067\u3082\u304a\u8a66\u3057\u304f\u3060\u3055\u3044\u3002\uff08\u4f8b\uff1a\u82b1\u2192hana\uff09</dd><dd>\u30fb\u8907\u6570\u306e\u30ad\u30fc\u30ef\u30fc\u30c9\u3092\u4f7f\u3063\u3066\u691c\u7d22\u3057\u305f\u5834\u5408\u3001\u30ad\u30fc\u30ef\u30fc\u30c9\u306e\u6570\u3092\u6e1b\u3089\u3057\u3001\u3082\u3046\u4e00\u5ea6\u691c\u7d22\u3057\u3066\u304f\u3060\u3055\u3044\u3002</dd><dd>\u30fb\u30a6\u30a7\u30d6\u691c\u7d22\u3067&nbsp;\u201c<a href="http://www.baidu.jp/baidu?tn=baidujp&amp;cl=3&amp;ie=utf-8&amp;word='+queryWordEnc+'+%E7%94%BB%E5%83%8F">'+queryWordExt+" \u753b\u50cf</a>\u201d&nbsp;\u3068\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002 </dd></dl></div>"}}function arrangeItems(){var containerStyle=isIE?document.styleSheets[1].rules.item(0).style:document.styleSheets[1].cssRules.item(0).style;var itemStyle=isIE?document.styleSheets[1].rules.item(1).style:document.styleSheets[1].cssRules.item(1).style;var linkStyle=isIE?document.styleSheets[1].rules.item(2).style:document.styleSheets[1].cssRules.item(2).style;var imgStyle=isIE?document.styleSheets[1].rules.item(3).style:document.styleSheets[1].cssRules.item(3).style;var m=getMatrix();var columns=m[1];itemStyle.width=(100/columns-0.1).toFixed(1)+"%";if(!$("c")){containerStyle.height=(parseInt(itemStyle.height)*columns)+"px";return }var rows=Math.min(Math.ceil($("c").getElementsByTagName("dl").length/columns),m[0]);containerStyle.height=(parseInt(itemStyle.height)*rows)+"px";var pageSize=m[0]*m[1];var imgs=$("c").getElementsByTagName("dl");var nImgs=imgs.length;var wrapper=null;for(var i=0;i<nImgs;i++){wrapper=imgs[i].parentNode;if((wrapper.style.width.length==0)&&(wrapper.style.display.length==0)){continue}wrapper.style.width=itemStyle.width;wrapper.style.display=""}if(nImgs<pageSize){var fullRows=Math.floor(nImgs/m[1]);var mod=nImgs%m[1];var w=(100/mod-0.1).toFixed(1)+"%";for(var i=fullRows*m[1];i<nImgs;i++){imgs[i].parentNode.style.width=w}}else{for(var i=pageSize;i<nImgs;i++){imgs[i].parentNode.style.display="none"}}if(cancelClusterCheck()&&$("showMoreResults")){$("showMoreResults").style.display=""}else{$("showMoreResults").style.display="none"}}function rebuildLinks(){if(!$("pg")){return }$("pg").innerHTML=getPageLinks();addClickHandlersToPg()}function addClickHandlersToPg(){var a=$("pg").getElementsByTagName("a");for(var i=0,l=a.length;i<l;i++){a[i].onclick=function(){g_stats="pg";var prevOrNext=this.href.match(/(&(prev|next)=1)/);g_stats+=prevOrNext?prevOrNext[1]:"";var elemToScroll=jQuery.browser.webkit?document.body:document.documentElement;if(elemToScroll.scrollTop>72){jQuery(elemToScroll).animate({scrollTop:72},"fast")}var pn=this.href.match(/&pn=(\d+)/)[1];updateFilter("pn",pn,false,true);return false}}}function resetPn(){if(!$("startpn")){return }var pageInfo=getPageInfo();$("startpn").innerHTML=DataManager.getCurPn()+1;if(pageInfo.curPage!=pageInfo.totalPages){$("endpn").innerHTML=Math.min(pageInfo.endPn+1,BD_LIST_NUM*1)}else{$("endpn").innerHTML=Math.min(parseInt($("startpn").innerHTML)-1+pageInfo.pageActualSize,BD_LIST_NUM*1)}function addCommas(nStr){nStr+="";x=nStr.split(".");x1=x[0];x2=x.length>1?"."+x[1]:"";var rgx=/(\d+)(\d{3})/;while(rgx.test(x1)){x1=x1.replace(rgx,"$1,$2")}return x1+x2}var l=BD_DISP_NUM.toString().length;var n=(l<=3)?BD_DISP_NUM:parseInt(BD_DISP_NUM/Math.pow(10,l-3))*Math.pow(10,l-3);$("fmtnum").innerHTML=(l>3?"\u7d04":"")+addCommas(n)}function sendStatsRequest(type,url){var stamp=(new Date()).getTime();var id=type+"_image_"+stamp;var image=new Image();window[id]=image;image.onload=image.onerror=function(){try{window[id]=null;delete window[id]}catch(e){}};image.src=url+(/\?/.test(url)?"&":"?")+".stamp="+stamp;image=null}function logPageRendering(){if(g_stats==""){return }var url=window.location.search;var filters=["z","it","color"];for(var i=0,l=filters.length;i<l;i++){var key=filters[i];var reFilter=new RegExp("(&|\\?)"+key+"=(\\d+)","g");var filter="&"+key+"="+reFilter.exec(BD_PAGE_URL_BASE)[2];url=url.replace(reFilter,"")+filter}url=url.replace(/(&|\?)pn=\d+/,"")+"&pn="+DataManager.getCurPn();url=url.replace(/(&|\?)pg=\d+/,"")+"&pg="+getPageInfo().curPage;url+="&stats="+g_stats;g_stats="";sendStatsRequest("logPageRendering",url);sendStatsRequest("pv","http://i.baidu.jp/mon/pv.gif")}return{init:init,getMatrix:getMatrix,arrangeItems:arrangeItems,rebuildLinks:rebuildLinks,resetPn:resetPn,renderPage:renderPage,autoStep:function(oldPn,newPn){var m=getMatrix();pageEndPn=pageStartPn+m[0]*m[1]-1;if((newPn<=pageEndPn)&&(newPn>=pageStartPn)){return }var pageSize=m[0]*m[1];if(newPn>oldPn){DataManager.requestData(pageEndPn+1,21,renderPage);pageStartPn=newPn;pageEndPn=newPn+pageSize-1}else{DataManager.requestData(pageStartPn-1,-pageSize,renderPage);pageStartPn=newPn-pageSize+1;pageEndPn=newPn}if(document.getElementById("se")){document.getElementById("se").style.display="none"}},updateResult:function(pn,isCacheable){var noResult=$("resultBaidu");if(noResult){noResult.parentNode.removeChild(noResult)}$("c").style.display="";var m=getMatrix();var num=m[0]*m[1];pn=parseInt(pn);if(!isCacheable){DataManager.cleanData()}DataManager.setCurPn(pn);DataManager.requestData(pn,num,function(imgs){PageController.renderPage(imgs);$("resultNum").style.visibility=BD_LIST_NUM>0?"visible":"hidden";$("c").style.visibility="visible";$("pg").style.visibility="visible"})},handleEvent:function(evt){switch(evt.type){case"SlideShowImageChanged":this.autoStep(evt.oldPn,evt.newPn);break;default:return }}}})();var ListPageRecycleBin=new RecycleBin("list_page");function changeLayout(){PageController.arrangeItems();PageController.rebuildLinks();PageController.resetPn();if(!/pn=\d+/.test(decodeURIComponent(window.location.hash))){if(!$("resultNum")){return }$("resultNum").style.visibility=BD_LIST_NUM>0?"visible":"hidden";$("c").style.visibility="visible";$("pg").style.visibility="visible"}}function adjustSlideShow(){if($("slideMask").style.display=="none"){return }SlideShowMaskController.adjust()}window.changeLayout=changeLayout;window.addData=function(o){DataManager.addData(o)};window.updateResult=function(pn,isCacheable){PageController.updateResult(pn,isCacheable)};window.main=function(){window.attachEvent("onresize",changeLayout);window.attachEvent("onresize",adjustSlideShow);window.attachEvent("onload",changeLayout);var BC=SlideShowBarController;var MC=SlideShowMaskController;var IC=SlideShowImageController;var PC=PageController;BC.init();BC.addEventListener("SlideShowStartPlay",MC);BC.addEventListener("SlideShowStopPlay",IC);BC.addEventListener("SlideShowStopPlay",MC);BC.addEventListener("SlideShowPausePlay",IC);BC.addEventListener("SlideShowResumePlay",IC);BC.addEventListener("SlideShowIncrementInterval",IC);BC.addEventListener("SlideShowDecrementInterval",IC);BC.addEventListener("SlideShowGotoNext",IC);BC.addEventListener("SlideShowGotoPrev",IC);MC.addEventListener("SlideShowMaskReady",IC);IC.addEventListener("SlideShowImageChanged",MC);IC.addEventListener("SlideShowIntervalChanged",BC);IC.addEventListener("SlideShowReachEnd",BC);PC.init();IC.addEventListener("SlideShowImageChanged",PC);PC.arrangeItems();PC.rebuildLinks();$("slideStart").attachEvent("onclick",function(){window.dhtmlHistory.add("slideon")});function historyChange(newLocation,historyData){newLocation=!newLocation?"":newLocation;if(newLocation.replace(/#/g,"")!=window.location.hash.replace(/#/g,"")){newLocation=window.location.hash.replace(/#/g,"")}switch(newLocation){case"slideon":BC.start();break;case"slideoff":BC.stop();break;default:if(typeof restoreFilters=="undefined"||typeof updateResult=="undefined"){return }var search=window.location.search;var hash=decodeURIComponent(window.location.hash).substr(1);var z=/(&|\?)z=(\d+)/.exec(search);var it=/(&|\?)it=(\d+)/.exec(search);var color=/(&|\?)color=(\d+)/.exec(search);restoreFilters("z="+(z?z[2]:0)+"&it="+(it?it[2]:0)+"&color="+(color?color[2]:0));if(!/z=\d+&it=\d+&color=\d+&pn=\d+/.test(hash)){var pn=/(&|\?)pn=(\d+)/.exec(search);updateResult(pn?pn[2]:0)}else{restoreFilters()}break}}if(window.location.hash=="#slideon"){BC.start()}dhtmlHistory.initialize();dhtmlHistory.addListener(historyChange);changeLayout();if(isIE){setInterval(CollectGarbage,10000)}if(window.location.hash==""){var m=PageController.getMatrix();var curPn=DataManager.getCurPn();DataManager.prefetch(curPn+m[0]*m[1])}}})();
