var x,y,fl,al,dl,sr,bIm,fIm,pIm,bl=tg=t=pf=pfl=oi=op=sx=sy=oh=ud=0;var $O={a:function(a){return navigator.userAgent.match(a)},n:function(){return $O.a(/MSIE/)},b:function(){return($O.a(/iPod|Nintendo/))},i:function(i){return document.getElementById(i)},e:function(e){return document.createElement(e)},t:function(t){return document.createTextNode(t)},h:function(h){return h.offsetHeight},w:function(w){return w.offsetWidth},Set:function(){bIm.style.backgroundImage='none';if(pf){resizeBox(true)}if(pfl){pIm.style.visibility='visible'}if(!$O.n()){setTimeout(popAlpha,25)}},Load:function(l){pf=l;if(pIm.complete){$O.Set()}else if(pIm){pIm.onload=$O.Set}else{return}}};function creImg(){bIm=$O.e('div');bIm.className='pop';bIm.style.zindex='100';bIm.style.background='url(/img/loading_b.gif) #000 center center no-repeat';document.body.appendChild(bIm);fIm=$O.e('div');fIm.className='pop';fIm.style.zindex='150';document.body.appendChild(fIm);tg=1;try{dEs=$O.i('description');dEs.appendChild($O.t(''));bLm=dEs.lastChild}catch(e){return}setInterval(curblink,600)}function movImg(ev){if($O.n()){var d=document.documentElement?document.documentElement:document.body;x=d.scrollLeft+event.clientX;y=d.scrollTop+event.clientY}else{x=ev.pageX;y=ev.pageY}if(t){posImg()}}function posImg(){bIm.style.left=x-sx+14+'px';bIm.style.top=y-sy+14+'px';fIm.style.left=x-sx+20+'px';fIm.style.top=y-sy+20+'px'}function popImg(uri,tx,ty,opt){if(!tg||$O.b()){return}if(pfl){fIm.removeChild(pIm)}pfl=pIm=op=oi=0;clearTimeout(dl);furi=uri.substr(1);switch(uri.substr(0,1)){case'#':uri='/img/'+furi;break;case'!':uri='/img/haruhi/'+furi;break;case'?':uri='/img/thumb/'+furi;break;case'%':uri='/img/link/'+furi;break}tx=tx?tx:200;ty=ty?ty:40;if(typeof opt=='object'){sx=opt.x?opt.x*(tx+40):0;sy=opt.y?opt.y*(ty+40):0;if(typeof opt.t=='object'){opt.t.title=''}}else{sx=opt?opt*(tx+40):0;sy=0}t=1;posImg();bIm.style.width=tx+12+'px';bIm.style.height=ty+12+'px';bIm.style.visibility=fIm.style.visibility='visible';bIm.style.backgroundImage='url(/img/loading_b.gif)';if($O.n()){bIm.style.filter='alpha(opacity=60)'}else{bIm.style.opacity=fIm.style.opacity='0'}pIm=$O.e('img');pIm.src=uri;pIm.style.margin='0';pIm.style.width=tx+'px';pIm.style.height=ty+'px';pIm.style.visibility='hidden';pIm.onerror=function(){bIm.style.backgroundImage='url(/img/loading_e.png)';if(pfl){pIm.style.visibility='hidden'}};pfl=1;fIm.style.width=fIm.style.height='auto';fIm.innerHTML='';fIm.appendChild(pIm);if(!$O.n()){popAlphaBg()}$O.Load(false)}function popAlpha(){if(oi<=100){fIm.style.opacity=oi/100;oi+=10;fl=setTimeout(popAlpha,25)}}function popAlphaBg(){if(op<=60){bIm.style.opacity=op/100;op+=10;al=setTimeout(popAlphaBg,25)}else{op=100}}function delImg(){if(!tg||$O.b()){return}t=pfl=0;clearTimeout(fl);clearTimeout(al);if(op>=0&&!$O.n()){fIm.style.opacity=op/100;if(op<=60){bIm.style.opacity=op/100}op-=10;dl=setTimeout(delImg,25)}else{op=0;bIm.style.visibility=fIm.style.visibility='hidden';if(pIm){fIm.removeChild(pIm)}delete pIm;pIm=0}}function objHide(days,opt){if(!tg){return false}hide=$O.i('H'+days);try{htex=$O.i('T'+days)}catch(e){htex=0}if(opt&&opt.n&&!$O.h(hide)){if(!confirm('OK?')){return false}}if(!$O.b()){tg=0}on='&#34920;&#31034;';cl='&#38560;&#12377;';oh=ud=$O.h(hide);cb_o=cb_c=null;if(opt){if(opt.o){on=opt.o}if(opt.c){cl=opt.c}if(opt.callback){cb_o=opt.callback}if(opt.callback_close){cb_c=opt.callback_close}}if(oh){if($O.b()){hide.style.height='0';return false}objRollUp()}else{hide.style.height='auto';if($O.b()){return false}oh=$O.h(hide);ud=0;hide.style.height='0';objRollDown()}return false}function objRollUp(){if(ud>1){sc=$O.n()?2.5:3;ud-=Math.max(1,Math.min(Math.round(ud/sc),Math.round(oh/sc*2)));hide.style.height=ud+'px';setTimeout(objRollUp,20)}else{hide.style.height='0';tg=1;if(htex){htex.innerHTML=on}if(typeof cb_c=='function'){return cb_c()}}}function objRollDown(){if(ud<oh){sc=$O.n()?2.5:3;ud+=Math.max(1,Math.min(Math.round(oh/sc*2),Math.round((oh-ud)/sc)));hide.style.height=ud+'px';setTimeout(objRollDown,20)}else{hide.style.height='auto';tg=1;if(htex){htex.innerHTML=cl}if(typeof cb_o=='function'){return cb_o()}}}function openWin(ul,na,wi,hi){var ot=(wi&&hi)?'width='+wi+',height='+hi+',':'';window.open(ul,na,ot+'resizable=yes,scrollbars=yes');return false}function curblink(){if(bl){bl=bLm.nodeValue=''}else{bl=bLm.nodeValue='_'}}function onFB(el){if(!el.value){el.value=el.defaultValue;return}if(el.value==el.defaultValue){el.value=''}}window.onload=creImg;document.onmousemove=movImg;