jQuery(function(){$(window).resize(function(){$("#slideshow").css("top",$("#pg").position().top+2).css("left",$("#pg").width()-$("#slideshow").width()-30)}).trigger("resize")});(function(A){A.fn.addMask=function(){return this.each(function(){if(A(this).css("display")=="hidden"){return }var C="mask_"+(new Date()).getTime();var B=A(this).data("maskId",C);A('<div id="'+C+'" style="position : absolute;background-color : #fff;width : '+B.width()+"px;height : "+B.height()+"px;left : "+B.position().left+"px;top : "+B.position().top+"px;margin-top : "+B.css("margin-top")+";margin-right : "+B.css("margin-right")+";margin-bottom : "+B.css("margin-bottom")+";margin-left : "+B.css("margin-left")+';"></div>').css("opacity",0.7).insertAfter(B)})};A.fn.removeMask=function(){return this.each(function(){var C=A(this);var B=C.data("maskId");A("#"+B).remove();C.removeData("maskId")})}})(jQuery);jQuery(function(){function C(){$("#showbadcase").hide();$("#hidebadcase, #showbadcasedisabled").show();$("#c span").after('<img class="badcasemask" style="display:block;margin:-57px auto 0;cursor:pointer" src="http://img.baidu.jp/img/image/badcasemask.png" /><input type="button" value="報告する" style="display:block;position:relative;margin:auto;top:-30px;cursor:pointer;" />').parent().click(A);if($.browser.msie&&$.browser.version.substr(0,1)<7){$("#c .badcasemask").css("opacity",0.7)}$('<div id="badcasedialog" style="height:50px;top:'+($("#pg").position().top-10)+"px;left:"+($("#pg").width()-460-20)/2+'px;">皆様からのご報告は、検索エンジンの機能改善に利用させていただきます。<br />（注：この報告により、当該画像が削除されるわけではありません。利用ガイドライン違反による削除要請は、<a id="badcasepage" href="https://contact.baidu.jp/webmaster/notify/" target="_BLANK">問い合わせフォーム</a>よりご連絡ください。）</div>').appendTo(document.body);$("#infoArea, #sortLayer, #pg, #slideshow, #rs, #searchboxAreaBottom, #footer, #lbox").addMask();$(document.body).click(function(E){var D=$(E.target).attr("id");if(D=="badcasedialog"){return }B()});setTimeout(function(){$(window).resize(B)},500);return false}function B(){$("#showbadcase").show();$("#hidebadcase, #showbadcasedisabled").hide();$("#c a.imgbox").parent().unbind("click",A).find("img.badcasemask, input").remove();$("#badcasedialog").remove();$("#infoArea, #sortLayer, #pg, #slideshow, #rs, #searchboxAreaBottom, #footer, #lbox").removeMask();$(document.body).unbind("click",B);$(window).unbind("resize",B);return false}function A(){if(confirm("この画像を不適切な画像として報告しますか？")){B();var E=/&word=([^&]*)/.exec(BD_PAGE_URL_BASE)[1];var D=/&pn=(\d+)/.exec($(this).find("a").attr("href"))[1];$.getJSON("http://image.baidu.jp/i?ct=201326592&tn=baiduimagejson&rn=1&word="+E+"&pn="+D,function(F){if(!F||!F.listNum){return }var G=F.data[0];Fe.tracker.send("word="+E+"&pn="+D+"&objUrl="+encodeURIComponent(G.objUrl)+"&fromUrl="+encodeURIComponent(G.fromUrl)+"&thumbUrl="+encodeURIComponent(G.thumbUrl)+"&pageUrl="+encodeURIComponent(location.href),"http://i.baidu.jp/mon/badcase.gif?")});$(this).find("img").css("opacity",0.3)}return false}$(window).resize(function(){$("#badcase").css("top",$("#pg").position().top+30).css("left",$("#pg").width()-$("#badcase").width()-20)}).trigger("resize");$("#showbadcase").click(C);$("#hidebadcase").click(B);$("#showbadcasedisabled, #hidebadcase").hide()});(function(C){var A=["DOMMouseScroll","mousewheel"];C.event.special.mousewheel={setup:function(){if(this.addEventListener){for(var D=A.length;D;){this.addEventListener(A[--D],B,false)}}else{this.onmousewheel=B}},teardown:function(){if(this.removeEventListener){for(var D=A.length;D;){this.removeEventListener(A[--D],B,false)}}else{this.onmousewheel=null}}};C.fn.extend({mousewheel:function(D){return D?this.bind("mousewheel",D):this.trigger("mousewheel")},unmousewheel:function(D){return this.unbind("mousewheel",D)}});function B(F){var D=[].slice.call(arguments,1),G=0,E=true;F=C.event.fix(F||window.event);F.type="mousewheel";if(F.wheelDelta){G=F.wheelDelta/120}if(F.detail){G=-F.detail/3}D.unshift(F,G);return C.event.handle.apply(this,D)}})(jQuery);jQuery(function(){});jQuery(function(){var W="http://img.baidu.jp/img/image/detail/blank.gif";var L=100;var T=/word=([^&]*)/.exec(BD_PAGE_URL_BASE)[1];var r=decodeURIComponent(T).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;");var J=0;var A=[];var q=0;var i=-1;var U=4;var a=0;var M;var s;var j;var b=false;var f=0;var Y=0;var Q=false;var g=false;function n(u,v){if(u!=i+1){return }else{i+=30}$.getJSON("/i?ct=402653184&tn=baiduimagejson&rn=30&word="+T+"&z="+J+"&pn="+u,function(w){if(!w||w.length==0){return }A.length=w.listNum;var AB=w.data;for(var AA=0,z=AB.length-1;AA<z;AA++){A[AB[AA].pn]={pn:AB[AA].pn,iss:AB[AA].imgSetSign,isn:AB[AA].imgSetImgNum,thumbUrl:AB[AA].thumbUrl,width:AB[AA].width,height:AB[AA].height,images:[]}}if(AB&&AB.length>=2){i=AB[AB.length-2].pn}var y=$("#isoimages ul:last-child").data("pn")+1||0;G(y);if(v){v(u)}})}function o(){for(var z=0;z<5;z++){var u=$("#isocovers li:eq("+z+")");var v=u.find("a");var w=u.find("img");var AA=u.find("span");if(w.attr("src")==W){var y=u.data("pn");if(!A[y]){n(y,o);return }if(!A[y+1]||!A[y+2]){n(y,o)}var AC=A[y];var AB=H(AC.width,AC.height,64,64);w.attr("src",AC.thumbUrl).width(AC.width*AB).height(AC.height*AB).css("margin-left",(68-AC.width*AB)/2).css("margin-top",(68-AC.height*AB)/2);v.attr("href",'javascript:void("'+AC.iss+'")');AA.text(AC.isn+"枚")}}}function H(v,u,z,y){var AA=z/v,w=y/u;return Math.min(1,(AA<w?AA:w))}function l(v){v+="";x=v.split(".");x1=x[0];x2=x.length>1?"."+x[1]:"";var u=/(\d+)(\d{3})/;while(u.test(x1)){x1=x1.replace(u,"$1,$2")}return x1+x2}function D(){f=a-2;Y=a+4}function k(v){if(q){return }else{q=Y-f+1}for(var u=f;u<=Y;u++){(function(y,w){if(typeof A[y]=="undefined"||A[y].images.length!=0){q--;return }$.ajax({url:"/i?ct=201326592&tn=baiduimagejson&word="+T+"&iss="+A[y].iss+"&z="+w,dataType:"json",success:function(z){I(z,y,w,v)},error:d})})(u,J)}}function I(v,AA,z,AC){if(typeof A[AA]=="undefined"){return }if(z!=J){return }if(q>0){q--}if(!v||!v.data){return }var u=0;for(var y=0;y<AA;y++){u+=A[y].isn}var AB=v.data;for(var y=0,w=Math.min(A[AA].isn,AB.length-1);y<w;y++){A[AA].images[y]={pn:u+y,thumbUrl:AB[y].thumbUrl,objUrl:AB[y].objUrl,width:AB[y].width,height:AB[y].height,filesize:AB[y].filesize,title:AB[y].title.replace(/<\/?strong>/gi,""),iss:AB[y].imgSetSign}}if(AC){AC(A[AA])}if(AA==Y){for(var y=1;y<4;y++){if(typeof A[Y+y]=="undefined"){n(Y+y);break}}}}function d(){if(q>0){q--}}function G(y){for(var z=y,v=A.length;z<v;z++){var AB=A[z];if(!AB){break}var AA="<ul>";for(var w=0,u=AB.isn;w<u;w++){AA+='<li><a href="javascript:void(0)"><img src="'+W+'" /></a><span></span></li>'}AA+="</ul>";$(AA).appendTo("#isoimages").data("pn",AB.pn)}}function p(y){for(var z=0,w=y.isn;z<w;z++){if(!y.images[z]&&y.images[z-1]){$("#isoimages li:eq("+(y.images[z-1].pn+1)+")").hide();continue}var u=y.images[z];var AD=$("#isoimages li:eq("+u.pn+")");var v=H(u.width,u.height,140,140);AD.attr("title",u.title);var AA=AD.find("img");AA.width(u.width*v).height(u.height*v).css("margin-top",(140-u.height*v)/2).attr("src",u.thumbUrl).attr("alt",u.title);var AC=AD.find("span");AC.text(u.width+"x"+u.height);var AB=AD.find("a");AB.attr("href","/i?ct=503316480&tn=baiduimagedetail&word="+T+"&z="+J+"&sm=1&pn="+y.pn+"&ispn="+z+"&s="+u.filesize+"&w="+u.width+"&h="+u.height)}}function E(){$("#isoimages ul.selected").removeClass("selected");$("#isoimages ul:eq("+a+")").addClass("selected")}function c(){$("#isocovers li").each(function(){if($(this).data("pn")==a){$(this).find("a").addClass("selected")}else{$(this).find("a").removeClass("selected")}})}function R(u){if(u<=2){$("#isocoverup").hide()}else{$("#isocoverup").show()}if(u>=A.length-3){$("#isocoverdown").hide()}else{$("#isocoverdown").show()}}function C(){$("#resultBaidu").remove();$("#isocontainer").children().hide().end().append('<div id="resultBaidu"><p id="guide">検索結果をここから表示</p><div class="image_zero"><p style="margin-bottom: 0.5em;"><strong>'+r+"</strong>&nbsp;に該当する画像集は見つかりませんでした。</p><p>"+(J!=0?'<a href="###" onclick="$(\'#lbox .z li.all a\').click();return false;" >すべての絞り込み条件を削除</a>':"")+'</p><dl><dt>Baiduからのアドバイス：</dt><dd>・入力したキーワードに誤りがないか確認してください。</dd><dd>・キーワードをローマ字入力でもお試しください。（例：花→hana）</dd><dd>・複数のキーワードを使って検索した場合、キーワードの数を減らし、もう一度検索してください。</dd><dd>・ウェブ検索で&nbsp;“<a href="http://www.baidu.jp/baidu?tn=baidujp&amp;cl=3&amp;ie=utf-8&amp;word='+T+'+%E7%94%BB%E5%83%8F">'+r+" 画像</a>”&nbsp;と入力してください。 </dd></dl></div></div>")}function B(z,AA){var v=$("#isocovers");var u;z=Math.min(z,(A.length-3)-v.find("li:eq(2)").data("pn"));z=Math.max(z,2-v.find("li:eq(2)").data("pn"));if(z==0){if(AA){AA()}return }if(v.data("working")){return false}else{v.data("working",true)}var w=v.find("li:eq(2)").data("pn")+z;if(z>0){for(var y=w-z+3;y<=w+2;y++){u='<li title="'+(y+1)+'枚目"><a href="javascript:void(0)"><img src="'+W+'" alt="'+(y+1)+'枚目" width="140" height="140" /></a><span></span></li>';$(u).appendTo(v).data("pn",y)}v.height(478+90*z);v.animate({top:25-90*z,right:10},L,function(){v.find("li:lt("+z+")").remove().end().height(478).css("top",25).data("working",false);if(AA){AA()}o();R(w)})}else{if(z<0){for(var y=w-z-3;y>=w-2;y--){u='<li title="'+(y+1)+'枚目"><a href="javascript:void(0)"><img src="'+W+'" alt="'+(y+1)+'枚目" width="140" height="140" /></a><span></span></li>';$(u).prependTo(v).data("pn",y)}v.height(478+90*(-z)).css("top",25-90*(-z));v.animate({top:25,right:10},L,function(){v.find("li:gt("+4+")").remove().end().height(478).data("working",false);if(AA){AA()}o();R(w)})}}$("#isostartpn").text(Math.max(1,w-1));$("#isoendpn").text(Math.min(A.length,w+3))}function P(u,w){clearTimeout(s);if($("#isocovers").data("working")){s=setTimeout(function(){P(u,w)},100)}var v=u-$("#isocovers li:eq(2)").data("pn");B(v,w)}function m(){if(A.length>0){$("#isocovers").children().remove();for(var y=0,v=Math.min(A.length,5);y<v;y++){var AB=A[y];if(!AB){break}var u='<li title="'+(AB.pn+1)+'枚目"><a href="javascript:void(0)"><img src="'+W+'" alt="'+(AB.pn+1)+'枚目" width="140" height="140" /></a><span></span></li>';$(u).appendTo("#isocovers").data("pn",AB.pn)}o();$("#isoimages, #isocovers").show();if(A.length>5){$("#isocoverdown").show()}D();k(p);$("#isocovers li:first-child a").trigger("click");var z=$("#resultNum").html().match(/（(.*)秒）<\/p>\n?$/i)[1];$("#resultNum").show().html("<h2><strong>"+r+'</strong> の画像集検索結果</h2>&nbsp;<p><strong><span id="isostartpn"></span>～<span id="isoendpn"></span></strong>件目 / <strong id="isofmtnum"></strong>件中（'+z+"秒）</p>");var v=A.length.toString().length;var AA=(v<=3)?A.length:parseInt(A.length/Math.pow(10,v-3))*Math.pow(10,v-3);var w=(v>3?"約":"")+l(AA);$("#isostartpn").text("1");$("#isoendpn").text(Math.min(A.length,5));$("#isofmtnum").text(w)}else{$("#resultNum").hide();C()}}function V(u){setTimeout(function(){$("#isocontainer").css("margin-left",($("#lbox").width()>0?$("#lbox").width()+20:10));var w=$("#isoimages").width();var y;if(w<800){U=4;y="24%"}else{if(w<980){U=5;y="19%"}else{if(w<1140){U=6;y="16%"}else{U=7;y="14%"}}}var v=document.styleSheets[0];if(v.insertRule){v.insertRule("#isoimages li { width:"+y+"; }",v.cssRules.length)}else{if(v.addRule){v.addRule("#isoimages li","width:"+y)}}},500)}function F(){if(A.length==0){return false}if(g){return }var AB=$.browser&&$.browser.msie&&$.browser.version=="6.0";if(AB){g=true;setTimeout(function(){g=false},100)}var v=Math.ceil(($("#isoimages").scrollTop()+160*1.5)/160);var AA=0;var z=0;var y=Math.ceil(A[z].isn/U);while(AA<v){if(AA>=y){z++;y+=Math.ceil(A[z].isn/U)}AA++}if(b){var u=$("#isoimages").get(0).scrollHeight;var w=$("#isoimages").scrollTop();if(z!=a&&w>1&&w<u-480-1){return false}else{b=false}}else{a=z}E();P(a,c);clearTimeout(M);setTimeout(function(){D();k(p)},1000)}function h(w,y){var u=$("#isoimages").get(0).scrollHeight;var v=$("#isoimages").scrollTop();if(v==0&&a==1&&y>0){a=0;E();P(a,c)}if(v==u-480&&a==$("#isoimages ul:last-child").data("pn")-1&&y<0){a=$("#isoimages ul:last-child").data("pn");E();P(a,c)}}function Z(){b=true;a=$(this).parent().data("pn");P(a);var y=0;for(var v=0;v<a;v++){y+=Math.ceil(A[v].isn/U)}var w=$("#isoimages").scrollTop();var u=Math.min(Math.max((y-1)*160,0),$("#isoimages").get(0).scrollHeight-480);if(w!=u){$("#isoimages").animate({scrollTop:u},320)}else{$("#isoimages").trigger("scroll")}return false}function e(u,v){if(v<0){B(1)}else{B(-1)}return false}function S(){clearInterval(j);j=setInterval(function(){B(-1)},100);return false}function t(){clearInterval(j);return false}function X(){clearInterval(j);return false}function N(){clearInterval(j);j=setInterval(function(){B(1)},100);return false}function O(){clearInterval(j);return false}function K(){clearInterval(j);return false}$("#lbox .sm li:last-child a").click(function(){if($("#isohidden").length==1){return false}BD_PAGE_URL_BASE=BD_PAGE_URL_BASE.replace(/z=(\d+)/,"z=0").replace(/it=(\d+)/,"it=0").replace(/color=(\d+)/,"color=0").replace(/sm=\d+/,"sm=1");J=0;$("#status").find(".z, .it, .color").each(function(){if($(this).css("display")!="none"){$(this).find("a").click()}});$("#barLeft dl").hide();$('<div id="isohidden"></div>').insertBefore("#c").append($("#c, #showMoreResults, #pg, #slideshow, #rs, #badcase, #searchboxAreaBottom"));$("#lbox").css("border-right","none");$("#lbox div.narrow").find("ul.it, ul.color, div:gt(1)").hide();$("#lbox ul.z li:gt(2)").hide();$("#isohidden").before($('<div id="isocontainer"><div id="isoimages"></div><ul id="isocovers"></ul><div id="isocoverup" style="display:none;"></div><div id="isocoverdown" style="display:none;"></div></div>'));$("#isoimages").scroll(F);$("#isoimages").mousewheel(h);$("#isocovers li a").live("click",Z);$("#isocovers").mousewheel(e);$("#isocoverup").mousedown(S);$("#isocoverup").mouseup(t);$("#isocoverup").mouseout(X);$("#isocoverdown").mousedown(N);$("#isocoverdown").mouseup(O);$("#isocoverdown").mouseout(K);$("#status a").live("mousedown",function(){$("#lbox .z li.all a").click();return false});$("#isoimages").resize(V);$(window).resize(V).trigger("resize");$("#detail_op").click(V);if(Q){Q=false;return }n(0,m)});$("#lbox .sm li:first-child a").click(function(){if($("#isohidden").length==0){return false}location.href=$(this).attr("href");return false});$("#lbox .z a").click(function(){if($("#isohidden").length==0){return false}setTimeout(function(){$("#isocontainer").children().hide();$("#isoimages").scrollTop(0).children().remove();$("#isocovers").children().remove();$("#resultBaidu").remove();J=/z=(\d+)/.exec(BD_PAGE_URL_BASE)[1];A=[];q=0;i=-1;a=0;clearTimeout(s);clearTimeout(M);b=false;$(window).resize();n(0,m)},500)});if((location.hash&&/sm=1/.test(decodeURIComponent(location.hash)))||(!location.hash&&/sm=1/.test(location.search))){Q=true}});var Fe=Fe||{version:"20080809",emptyFn:function(){}};Fe.Cookie={};Fe.Cookie.get=function(B){var A,C=new RegExp("(^| )"+B+"=([^;]*)(;|$)");if(A=document.cookie.match(C)){return unescape(A[2])}return null};Fe.Cookie.config=function(B){var A=null;if(/https?:\/\/[^\/]+([^\?]+)/i.test(location.href)){A=RegExp.$1}B=B||{};B.path=(B.path||A||"/").replace(/(\/)[^\/]*$/,"$1");B.expires=B.expires||1000*60*60*24;B.domain=B.domain||document.domain||"";B.secure=B.secure||"";return B};Fe.Cookie.set=function(C,D,B){var E=Fe.Cookie.config(B);var A=new Date();if(typeof (E.expires)=="number"){A.setTime(A.getTime()+E.expires)}document.cookie=C+"="+escape(D)+";expires="+A.toGMTString()+";path="+E.path+(E.domain==""?"":("; domain="+E.domain))+(E.secure?"; secure":"")};var g_stats="";var updateFilter=function(D,F,E,C,A){var B=0;switch(D){case"BD_PAGE_URL_BASE":BD_PAGE_URL_BASE=F;break;case"pn":B=F;break;default:BD_PAGE_URL_BASE=BD_PAGE_URL_BASE.replace(new RegExp("&"+D+"=\\d+"),"&"+D+"="+F);break}if(E){return }if(!A){dhtmlHistory.add(/sm=\d+&z=\d+&it=\d+&color=\d+/.exec(BD_PAGE_URL_BASE)[0]+"&pn="+B)}updateResult(B,C);$("#c a, #relate a").each(function(){var H=$(this).attr("href").replace(/#.*$/,"");var M=["z","it","color"];for(var K=0,G=M.length;K<G;K++){var J=M[K];var I=new RegExp("&"+J+"=(\\d+)","g");var L="&"+J+"="+I.exec(BD_PAGE_URL_BASE)[1];H=H.replace(I,"")+L}$(this).attr("href",H)});if(B>0){$("#se").css("display","none")}else{$("#se").css("display","")}};var restoreFilters=function(D){var K=D?false:true;D=D||decodeURIComponent(window.location.hash).substr(1);var L=window.location.search;var A=["sm","z","it","color","pn"];for(var E=0,C=A.length;E<C;E++){var J=A[E],I="";var B=new RegExp(J+"=(\\d+)"),G=new RegExp("(&|\\?)"+J+"=(\\d+)");var F=B.exec(D),H=G.exec(L);if(J=="sm"&&(I==""||I=="0")&&$("#isohidden").length){location.reload()}I=F?F[1]:(H&&J!="pn")?H[2]:"";if(I==""){continue}if(J=="pn"){updateFilter("pn",I,false,false,true)}else{$('#lbox ul[class="'+J+'"] a[value="'+I+'"]').trigger("click",[true,K])}}};jQuery(function(){$("#detail_op").click(function(){var A={path:"/",expires:86400*1000*30};if($(this).hasClass("op_on")){$(this).removeClass("op_on").addClass("op_off");$(".switch").removeClass("on").addClass("off");$("#c").removeClass("filterOn");$("#se").removeClass("filterOn");$("#resultBaidu").removeClass("filterOn");if(Fe.Cookie.get("BDJPIMGFS")!=0){Fe.Cookie.set("BDJPIMGFS","0",A);Fe.tracker.send("fs=off","http://i.baidu.jp/mon/click.gif?")}}else{$(this).removeClass("op_off").addClass("op_on");$(".switch").removeClass("off").addClass("on");$("#c").addClass("filterOn");$("#se").addClass("filterOn");$("#resultBaidu").addClass("filterOn");if(Fe.Cookie.get("BDJPIMGFS")==0){Fe.Cookie.set("BDJPIMGFS","1",A);Fe.tracker.send("fs=on","http://i.baidu.jp/mon/click.gif?")}}if(changeLayout){changeLayout()}return false});$("#lbox a").click(function(B,D,E){if($(this).hasClass("on")){return false}if(typeof E=="undefined"){E=true}if(!D){g_stats="select_"+$(this).closest("ul").attr("class")}var C=$(this).attr("value");if(C==""){return }$(this).closest("ul").find("a").removeClass("on");$(this).addClass("on");var A=$(this).closest("ul").attr("class");if(C!="0"){$("#status ."+A+" a").text($(this).next().text()||$(this).text());$("#status ."+A).appendTo($("#status"));$("#status ."+A).css("display","inline")}else{$("#status ."+A).css("display","none")}if(A=="z"&&C<4&&E&&$("#wp_size").css("display")!="none"){$("#wp_size").slideUp();$("#wp_size").closest("li").find("a:first").removeClass("unfold")}updateFilter(A,C,D);return false});$("#status a").click(function(){g_stats="cancel_"+$(this.parentNode).attr("class");$(this.parentNode).css("display","none");var A=$(this.parentNode).attr("class");$("#lbox ."+A+" a").removeClass("on");$("#lbox ."+A+" a:first").addClass("on");if(A=="z"&&$("#wp_size").css("display")!="none"){if($("#lbox").hasClass("on")){$("#wp_size").slideUp()}else{$("#wp_size").hide()}$("#wp_size").closest("li").find("a:first").removeClass("unfold")}updateFilter(A,0);return false});$('#wallpaper a[value=""]').click(function(){if($("#wp_size").css("display")=="none"){var A=window.screen.width,B=window.screen.height;var C=5;if(B/A==10/16||B/A==9/16){C=12}else{$("#wp_size a").each(function(){if($(this).text()==A+"×"+B){C=$(this).attr("value")}})}$("#wp_size a[value="+C+"]").click()}return false});$("#wp_size a").click(function(B,C){if(!C){g_stats="select_"+$(this).closest("ul").attr("class")}$($(this).parents("ul")[1]).find("a").removeClass("on");$(this).addClass("on");$($(this).parents("li")[1]).find("a:first").addClass("unfold");var A=$(this).closest("ul").attr("class");$("#status ."+A+" a").text($(this).closest("ul").closest("li").find("a:first").text()+"（"+$(this).text()+"）");$("#status ."+A).appendTo($("#status")).css("display","inline");updateFilter(A,$(this).attr("value"),C);if($("#wp_size").css("display")=="none"){$("#wp_size").slideDown()}return false});$("#reset").click(function(){g_stats="reset_filters";var A=BD_PAGE_URL_BASE.replace(/&z=\d+/,"&z=0").replace(/&it=\d+/,"&it=0").replace(/&color=\d+/,"&color=0");updateFilter("BD_PAGE_URL_BASE",A);$("#status li").css("display","none");$("#lbox div.narrow > ul:gt(0) a").removeClass("on");$("#lbox div.narrow > ul:gt(0) > li:first-child a").addClass("on");if($("#wp_size").css("display")!="none"){$("#wp_size").slideUp();$("#wp_size").closest("li").find("a:first").removeClass("unfold")}});restoreFilters();if(Fe.Cookie.get("BDJPIMGFS")!=0){$("#detail_op").trigger("click")}if(/z=[^0]+/.test(location.href)&&$(".sm").css("display")=="none"){$.getJSON("/i?ct=201326592&tn=baiduimagejson&word="+/word=([^&]*)/.exec(BD_PAGE_URL_BASE)[1]+"&rn=1",function(A){if(!A){return }if(A.imgSetOnly=="1"){$(".sm").css("display","block").prev().css("display","block")}})}});Fe.G=function(){for(var A=[],B=arguments.length-1;B>-1;B--){var C=arguments[B];A[B]=null;if(typeof (C)=="object"&&C&&C.dom){A[B]=C.dom}else{if((typeof (C)=="object"&&C&&C.tagName)||C==window||C==document){A[B]=C}else{if(typeof (C)=="string"&&(C=document.getElementById(C))){A[B]=C}}}}return A.length<2?A[0]:A};Fe.Dom=Fe.Dom||{};Fe.Dom.getOwnerDocument=function(A){return A.nodeType==9?A:A.ownerDocument||A.document};Fe.Dom.getComputedStyle=function(B,A){var D=Fe.Dom.getOwnerDocument(B);if(D.defaultView&&D.defaultView.getComputedStyle){var C=D.defaultView.getComputedStyle(B,"");if(C){return C[A]}}return null};Fe.Dom.getCascadedStyle=function(C,B){if("opacity"==B){var A=C.style.filter;return A&&A.indexOf("opacity=")>=0?(parseFloat(A.match(/opacity=([^)]*)/)[1])/100)+"":"1"}return C.currentStyle?C.currentStyle[B]:null};Fe.Dom.getStyle=function(B,A){return Fe.Dom.getComputedStyle(B,A)||Fe.Dom.getCascadedStyle(B,A)||B.style[A]};Fe.isGecko=(navigator.userAgent.indexOf("Gecko")>-1&&navigator.userAgent.indexOf("KHTML")==-1&&/rv\:(\d+(\.\d+)?)/.test(navigator.userAgent))?RegExp.$1:0;Fe.isWebkit=(navigator.userAgent.indexOf("KHTML")>-1&&/AppleWebKit\/([^\s]*)/.test(navigator.userAgent))?RegExp.$1:0;Fe.isOpera=(window.opera&&/Opera(\s|\/)(\d+(\.\d+)?)/.test(navigator.userAgent))?RegExp.$2:0;Fe.isIE=(/MSIE (\d+(\.\d+)?)/.test(navigator.userAgent))?RegExp.$1:0;Fe.isStrict=(document.compatMode=="CSS1Compat");Fe.Dom.getOffset=function(D){var G=Fe.Dom.getOwnerDocument(D);var F=Fe.isGecko>0&&G.getBoxObjectFor&&Fe.Dom.getStyle(D,"position")=="absolute"&&(D.style.top==""||D.style.left=="");var H={left:0,top:0};var B=(Fe.isIE&&!Fe.isStrict)?(G.body):(G.documentElement);if(D==B){return H}var C=null;var E;if(D.getBoundingClientRect){E=D.getBoundingClientRect();H.left=E.left+Math.max(G.documentElement.scrollLeft,G.body.scrollLeft);H.top=E.top+Math.max(G.documentElement.scrollTop,G.body.scrollTop);H.left-=G.documentElement.clientLeft;H.top-=G.documentElement.clientTop;if(Fe.isIE&&!Fe.isStrict){H.left-=2;H.top-=2}}else{if(G.getBoxObjectFor&&!F){E=G.getBoxObjectFor(D);var A=G.getBoxObjectFor(B);H.left=E.screenX-A.screenX;H.top=E.screenY-A.screenY}else{C=D;do{H.left+=C.offsetLeft;H.top+=C.offsetTop;if(Fe.isWebkit>0&&Fe.Dom.getStyle(C,"position")=="fixed"){H.left+=G.body.scrollLeft;H.top+=G.body.scrollTop;break}C=C.offsetParent}while(C&&C!=D);if(Fe.isOpera>0||(Fe.isWebkit>0&&Fe.Dom.getStyle(D,"position")=="absolute")){H.top-=G.body.offsetTop}C=D.offsetParent;while(C&&C!=G.body){H.left-=C.scrollLeft;if(!Fe.isOpera||C.tagName!="TR"){H.top-=C.scrollTop}C=C.offsetParent}}}return H};(function(){var C={sort:{name:"sort"}};var A={relate:{name:"relate",layer:"sort",param:"rel",value:[0,1,2,3],notice:true}};for(var F in A){var M=A[F];if(!M.name||!M.param||!M.value){continue}var J=Fe.G(M.name);var L=J.getElementsByTagName("a");for(var I=0,G=L.length;I<G;I++){var B=window.location.href;B=B.replace(/&pg=\d+/g,"").replace(/&pn=\d+/,"");B=B.replace(/&sa=\d+/,"").replace(/&sf=\d+/,"").replace(/&st=\d+/,"");B=B.replace(/&prev=\d+/,"").replace(/&next=\d+/,"");B=B.replace(new RegExp("&"+M.param+"=\\d+"),"");L[I].href=B.replace(/#.*$/,"")+"&"+M.param+"="+M.value[I];if(M.radio){var D;try{D=document.createElement('<input type="radio"'+(L[I].checked?' checked="checked"':"")+" />")}catch(H){D=document.createElement("input");D.type="radio";if(L[I].getAttribute("checked")){D.checked="checked"}}D.setAttribute("href",L[I].href);D.onclick=function(){window.location.href=this.getAttribute("href")};L[I].parentNode.insertBefore(D,L[I])}}}for(var F in C){var M=C[F];if(!M.name){continue}Fe.G(M.name+"Button").onclick=E}function E(N){var X=N||window.event;var V=X.target||X.srcElement;var O=(V.id.match(/(\w+)Button/)||V.parentNode.id.match(/(\w+)Button/)||V.parentNode.parentNode.id.match(/(\w+)Button/))[1];var T=Fe.G(O+"Layer");var U=false;for(var R in C){var Y=C[R];if(!Y.name){continue}if(Fe.G(Y.name+"Layer").style.visibility!="hidden"){K(Y.name);if(Y.name==O){U=true}}}if(U){return }var S=Fe.G(O+"Button");var Q=Fe.Dom.getOffset(S);var W=Q.top;var P=Q.left;T.style.top=W+17+"px";T.style.left=P+"px";T.style.visibility="visible";document.body.onclick=function(){K(O)};if(X.stopPropagation){X.stopPropagation()}else{X.cancelBubble=true}}function K(N){var O=Fe.G(N+"Layer");O.style.visibility="hidden";document.body.onclick=""}})();Fe.G=function(){for(var A=[],B=arguments.length-1;B>-1;B--){var C=arguments[B];A[B]=null;if(typeof (C)=="object"&&C&&C.dom){A[B]=C.dom}else{if((typeof (C)=="object"&&C&&C.tagName)||C==window||C==document){A[B]=C}else{if(typeof (C)=="string"&&(C=document.getElementById(C))){A[B]=C}}}}return A.length<2?A[0]:A};Fe.on=function(C,B,A){if(!(C=Fe.G(C))){return C}B=B.replace(/^on/,"");if(C.attachEvent){C[B+A]=function(){A.call(C,window.event)};C.attachEvent("on"+B,C[B+A])}else{C.addEventListener(B,A,false)}return C};Fe.tracker=function(H,E){if(!H||!E){return false}if(typeof E.host!="function"){return false}if(typeof E.param!="function"){return false}function D(I){var J=E.host(I);var K=E.param(I);Fe.tracker.send(K,J)}var G,A=E.event||"click",C=E.delay||100;for(var F=0,B=H.length;F<B;F++){G=H[F];if(G&&G.nodeName=="A"){Fe.on(G,A,function(J){var K=(this.target=="")&&(this.href.charAt(0)!="#");if(K){if(J.preventDefault){J.preventDefault()}else{window.event.returnValue=false}}Fe.tracker.send(E.param(this),E.host(this));if(K){var I=this;setTimeout(function(){if(Fe.isIE){var M=null;var L=document.getElementsByTagName("A");if(L&&L.length>0){M=L[0]}else{M=document.body.appendChild(document.createElement("A"));M.style.display="none"}M.href=I.href;M.click()}else{window.location.href=I.href}},C)}})}else{Fe.on(G,A,function(){Fe.tracker.send(E.param(this),E.host(this))})}}};Fe.tracker.trackerHost=typeof TRACKER_HOST=="string"?TRACKER_HOST:null;Fe.tracker.setTrackerHost=function(A){this.trackerHost=A};Fe.tracker.stamp=function(){return Math.floor(Math.random()*2147483648).toString(36)+(Math.floor(Math.random()*2147483648)^(new Date).getTime()).toString(36)};Fe.tracker.send=function(C,A){var D=A||Fe.tracker.trackerHost;if(!D){throw new Error("no tracker host found.")}if(D.indexOf("?")==-1){D+="?"}var B=D;if(typeof C=="string"){B+=C+"&.stamp="+Fe.tracker.stamp()}else{var G=[];for(var F in C){G.push(F+"="+(C[F]))}if(false!==C.hasstamp){G.push(".stamp="+Fe.tracker.stamp())}B+=G.join("&")}var H="tracker_image_"+new Date().getTime();var E=new Image();window[H]=E;E.onload=E.onerror=function(){try{window[H]=null;delete window[H]}catch(I){}};E.src=B;E=null};Fe.Ajax=function(B){this.url="";this.data="";this.async=true;this.duration=-1;this._istimeout=false;this.username="";this.password="";this.method="GET";if(typeof B=="object"&&B){for(var A in B){this[A]=B[A]}}if(typeof Fe.Ajax.duration=="number"&&Fe.Ajax.duration>0&&this.duration==-1){this.duration=Fe.Ajax.duration}};(function(){function A(E){return typeof E=="function"}Fe.Ajax.prototype.request=function(E,K){var I=this,G=C(),L=G.xhr;G.active=true;I.url=E;if(typeof K=="string"&&K){I.data=K}if(A(I.onexecute)){I.onexecute(L)}try{if(!I.username){L.open(I.method,I.url,I.async)}else{L.open(I.method,I.url,I.async,I.username,I.password)}if(I.async){L.onreadystatechange=H}if(I.method.toUpperCase()=="POST"){L.setRequestHeader("Content-Type","application/x-www-form-urlencoded")}I.beginTime=new Date().getTime();if(I.duration>0){J()}L.send(I.data)}catch(F){if(A(I.onerror)){I.onerror(F)}else{if(A(Fe.Ajax.onerror)){Fe.Ajax.onerror(F)}}}if(!I.async){H()}function H(){if(L.readyState==4){try{L.status}catch(M){if(A(I.ondisconnect)){I.ondisconnect(L)}G.active=false;return }I.duration=-1;if(!I._istimeout){if(A(I["on"+L.status])){I["on"+L.status](L)}if(L.status==200&&L.statusText.toLowerCase()=="ok"){if(A(I.onsuccess)){I.onsuccess(L)}}else{if(A(I.onfailure)){I.onfailure(L)}else{if(A(Fe.Ajax.onfailure)){Fe.Ajax.onfailure(L)}}}}G.active=false;L.onreadystatechange=function(){}}}function J(){if(I.duration==-1){return }if(new Date().getTime()-I.beginTime>I.duration){I.duration=-1;I._istimeout=true;G.active=false;try{L.abort()}catch(M){}if(A(I.ontimeout)){I.ontimeout(L)}else{if(A(Fe.Ajax.ontimeout)){Fe.Ajax.ontimeout(L)}}}setTimeout(function(){J()},10)}};var D=[];function C(){var G=D;for(var F=null,E=0;E<G.length;E++){F=G[E];if(!F.active){break}}if(E>=G.length){F={active:false,xhr:B()};G[G.length]=F}return F}function B(){if(window.XMLHttpRequest){return new XMLHttpRequest()}else{if(window.ActiveXObject){var G=["MSXML2.XMLHttp.6.0","MSXML2.XMLHttp.3.0","MSXML2.XMLHttp.5.0","MSXML2.XMLHttp.4.0","Msxml2.XMLHTTP","MSXML.XMLHttp","Microsoft.XMLHTTP"];for(var F=0;G[F];F++){try{return new ActiveXObject(G[F])}catch(E){}}throw new Error("Your browser do not support XMLHttp")}}}})();Fe.String={};Fe.String.parseQuery=function(){var A={};return function(E,D){var C,B;if(!(C=A[D])){C=A[D]=new RegExp("(^|&|\\?|#)"+D+"=([^&]*)(&|$)","i")}if(B=E.match(C)){return B[2]}return null}}();Fe.Ajax.sio=function(D,H){if(!D||typeof D!="string"){throw new Error("invalid url parameter!")}var G=document.createElement("SCRIPT");var F=Fe.String.parseQuery(D,"callback");if(F===null){var C=false;G.onreadystatechange=G.onload=function(){if(C){return false}if(typeof G.readyState==="undefined"||G.readyState=="loaded"||G.readyState=="complete"){C=true;try{H()}finally{if(G.parentNode){G.parentNode.removeChild(G)}G.onreadystatechange=null;G.onload=null;G=null}}}}else{var B="CB"+Math.floor(Math.random()*2147483648).toString(36);D=D.replace(/(&|\?)callback=([^&]*)(&|$)/,"$1callback="+B+"$3");window[B]=function(){try{var I=(H||window[F]);I.apply(null,arguments)}finally{if(G.parentNode){G.parentNode.removeChild(G)}G=null;window[B]=null}}}G.src=D;G.type="text/javascript";var E=document.getElementsByTagName("HEAD")[0];if(!E){var A=document.getElementsByTagName("body")[0];E=document.createElement("head");A.parentNode.insertBefore(E,A)}E.insertBefore(G,E.firstChild)};Fe.safeSearch={};Fe.safeSearch.link=null;Fe.safeSearch.status="";Fe.safeSearch.set=function(C,A){var B={path:"/",domain:".baidu.jp",expires:86400*1000*30};if("off"==A){if(!confirm("セーフサーチを「オフ（無効）」に設定すると、検索された結果に未成年者には好ましくない成人向けコンテンツが表示される場合があります。")){return false}Fe.Cookie.set("BDJPIMGAF","0",B);C.innerHTML="オフ";C.onclick=function(){return Fe.safeSearch.set(this,"on")}}else{Fe.Cookie.set("BDJPIMGAF","1",B);C.innerHTML="オン";C.onclick=function(){return Fe.safeSearch.set(this,"off")}}Fe.tracker.send("af="+A,"http://i.baidu.jp/mon/click.gif?");if(/sm=0/.test(BD_PAGE_URL_BASE)){updateResult(0)}else{$("#lbox .z a.on").click()}return false};function SetPreferencesCallback(A){if(A&&A.error_code==0){if(Fe.safeSearch.status=="on"){Fe.safeSearch.link.innerHTML="オン";Fe.safeSearch.link.onclick=function(){return Fe.safeSearch.setPassport(this,"off")}}else{Fe.safeSearch.link.innerHTML="オフ";Fe.safeSearch.link.onclick=function(){return Fe.safeSearch.setPassport(this,"on")}}if(/sm=0/.test(BD_PAGE_URL_BASE)){updateResult(0)}else{$("#lbox .z a.on").click()}}else{Fe.tracker.send({af:"set-passport-failed"},"http://i.baidu.jp/mon/click.gif?");alert("server response error, please try again later")}}Fe.safeSearch.setPassport=function(E,A){if("off"==A){if(!confirm("セーフサーチを「オフ（無効）」に設定すると、検索された結果に未成年者には好ましくない成人向けコンテンツが表示される場合があります。")){return false}}Fe.safeSearch.link=E;Fe.safeSearch.status=A;var C=BD_STOKEN;var D=("off"==A)?"0":"1";var B="http://passport.baidu.jp/api/?preferences&method=set&callback=SetPreferencesCallback&im_pep="+D+"&bdstoken="+C+"&.stamp="+Fe.tracker.stamp();Fe.Ajax.sio(B);return false};Fe.namespace=function(){var A=arguments,E=null,C,B,D;for(C=0;C<A.length;C=C+1){D=A[C].split(".");E=Fe;for(B=(D[0]=="Fe")?1:0;B<D.length;B=B+1){E[D[B]]=E[D[B]]||{};E=E[D[B]]}}return E};Fe.ns=Fe.namespace;Fe.trim=function(A){return A.replace(/(^[\s\t\xa0\u3000]+)|([\u3000\xa0\s\t]+$)/g,"")};Fe.Adv=function(F,C,E){var B=F.href,G=Fe.trim(C.value),E=E?E:"query";if(G.length<=0){return }G=encodeURIComponent(G);if(E[0]=="/"){var A=/https?:\/\/([^\/\?#]+)/;if(A.test(F.href)){var D=RegExp.$1;F.href="http://"+D+E+"="+G}}else{if(B.indexOf(E+"=")!=-1){F.href=B.replace(new RegExp(E+"=[^&$]*"),E+"="+G)}else{var H=((B.indexOf("?")==-1)?"?":"&")+E+"="+G;F.href=B+H}}};Fe.ns("Fe.JP.I");Fe.JP.I.q=function(E,D,C){var B=new Image();B.src="http://i.baidu.jp/mon/click.gif?word="+encodeURIComponent(document.f1.word.value)+"&tab="+C+"&rnd="+new Date().getTime();var A=document.f1.word;Fe.Adv(E,A,D)};
