/**
* @(#)Rtoaster.js
* Copyright (c) 2006-2016 BrainPad, Inc. All right reserved.
* @version 2.0.0
* @see Rtoaster web site
*/
if(typeof Rtoaster==="undefined"){var Rtoaster={host:"rt.rtoaster.jp",path:"/",timeout:2000,callback:void 0};(function(S,W){var A="object",B="string",C="load",D=W.document,E=[],F="function",G="charAt",H=[],I="indexOf",J="style",K="script",L=W.location,M="toLowerCase",N="length",O="lastIndexOf",P=L.protocol,Q="substring",R="visibility",T={F:0},U=/*@cc_on!@*/0||D.documentMode?2048:8192,V=void 0,X=!1,Y=typeof decodeURIComponent===F?decodeURIComponent:unescape,Z=typeof encodeURIComponent===F?encodeURIComponent:escape,_A=function(k,e,m,c){(c=W.console)&&c.error&&c.error("["+k+"] "+e.name+": "+e.message+(_B(m)?"":"\n"+m))},_B=function(s){return!s||!s[N]||s==="null"||s==="undefined"},_C=function(){return D.cookie.split("; ")},_D=function(s){return _B(s)?"":Y(s)},_E=function(s){return _B(s)?"":Z(s)},_F=function(e,i,o){for(i=E[N]-1;i>=0;i--)if((o=E[i]).E===e)return o},_G=function(k){if(!_B(k)){var a=_C(),m=_E(k)+"=",i=a[N]-1,c,b,e;for(;i>=0;i--)if(!(c=a[i])[I](m)){b=m[N],e=c[N];if(c[G](b)==='"')b++;if(c[G](e-1)==='"')e--;return _D(c[Q](b,e))}}return""},_H=function(e){return D.getElementById(e)},_I=setTimeout,_J=function(a,d){d=d||"\n";var r="",i=0,n=a[N],s;for(;i=0;i--){f=l[i],o=f[0];try{o.detachEvent(f[1],f[2])}catch(_){}f[0]=f[2]=V}T.O=V})}e="on"+e;t.attachEvent(e,c);T.O[T.O[N]]=[t,e,c]}},_R=function(a,b,i,n,k,v){if(!T.F)S.track();if(T.F===1){T.F=2;for(i=0,n=a[N];i=0;i--)if(!(o=c[i])[I]("_rt."))a=_J([a,_D(o)]);if(b)a=_J([a,T.N]);f(s);f(p);return _L("t/?a="+T.A+"&l="+T.L+"&r="+_E(D.referrer)+"&m="+T.M+"&p="+_E(a)+"&i="+T.I)}},_U=function(v){if(!_B(v))_S({"key":"_rt.sid","value":v,"domain":T.R,"path":"/"})},_V=function(s,t){t=typeof s;return t===B||t==="number"||t==="boolean"},_W=function(e,f,i,n){if(f=T.S[e]){for(i=0,n=f[N];i"+e+":"+i,_)}}}if(f=S.callback)try{f(e)}catch(_){_A("callback->"+e,_)}},_X=function(t,c){if(_B(c))return 1;var d="content->"+t.id,e=function(v){if(_B(v))return"";var b=[D.open,D.close,D.clear,D.write,D.writeln],q="",f=function(a,k,m){for(k=0,m=a[N];k")i=l+1;else{r=c[I]("-->",l);if(r===-1)break;i=r+3}else{r=c[I](">",l);if(r===-1)break;i=r+1}continue}r=c[I](">",l);if(r===-1)break;i=r+1;if(r-l<6||(!w(p=c[G](l+6))&&p!==">")||c[Q](l,l+6)[M]()!==K)continue;n=c[Q](l+6,r),l=0;while((l=n[I]("=",l))!==-1){p=n[G](++l);if((p==='"'||p==="'")&&(r=n[I](p,++l))!==-1){if(w(n[G](l-6))&&n[Q](l-5,l-2)[M]()==="src"){s=g(n[Q](l,r));break}l=r+1}}r=i;while((l=c[I]("",r))!==-1&&(r=c[I](">",l+2))!==-1){if(c[Q](l+2,r)[M]()===K)break;r++}if(r===-1)break;y=r+1;if(!s){while(w(c[G](i)))i++;r=l,l=i;if(c[G](i)==="<"&&c[G](++i)==="!"){while(!j(c[G](++i)));l=i+1}s=c[Q](l,r)}c=c[Q](0,x)+e(s)+c[Q](y),i=x}if(!_B(c))try{t.innerHTML=c;_W(t.id);return 1}catch(_){_A(d,_,c)}},_Y=function(){if(T.X){clearTimeout(T.X);T.X=V}},_Z=function(t,i,e,o,c){if(T.F!==4){if(!t){_Y();T.F=4;for(i=H[N]-1;i>=0;i--){o=H[i],c=o.E&&_H(o.E);if(c&&(e=c.parentNode)){e.removeChild(c);e[J][R]=o.V;c=V}else if(o.P&&(e=_H(o.P)))e[J][R]=o.V}H=[]}else if((e=_H(t)))e[J].display="block";e=V;_W(t)}};S.getParameter=function(p){var q=L.search,l,r;if(_B(p))return q;l=q[I](p);if(l>0&&(l===1||q[G](l-1)==="&")&&q[G](l+=p[N])==="="){r=q[I]("&",++l);return _D(r===-1?q[Q](l):q[Q](l,r))}};S.init=function(a,m){if(_B(m))m=_M();T.A=_E(a),T.F=0,T.I=Math.random(),T.L=_E(L.href),T.M=_E(m),T.S={},T.C=T.E=T.P=V};S.hide=function(t){if(T.F<3){var h=H[N],e,i,o;if(t)e=_H(t);else if(!_N()){i="rt:c"+h;D.write('');if(o=_H(i))e=o.parentNode}if(e){H[h]={"E":i,"P":e.id,"V":e[J][R]};e[J][R]="hidden";if(!h)_O(W,C,function(){if(!T.F||T.F<2)_Z()});e=V}}};S.item=function(p){if(p){var a,s="item",e="_code=",t=typeof p,i,n,v;if(t===B)T.N=T.P=s+e+p;else if(t===A){if(p instanceof Array){for(i=0,n=p[N];i0){for(i=0;i=0)p="pf="+l;if(f(u)>=0)p=_J([p,"pt="+u]);T.E=p};S.recommend=function(){_R(arguments,0)};S.recommendNow=function(){_R(arguments,1)};S.click=function(e){if(!_B(e)){var o=_F(e);if(o&&o.T){_U(o.S);return!0}}return X};S.listen=function(e,f){if(T.S&&!_B(e)&&typeof f===F){var a=T.S[e];if(a)a[a[N]]=f;else T.S[e]=[f]}};S.observe=function(f,e){e=e||C;if(e===C&&_N())_I(f,10);else _O(W,e,f)};S.show=function(p){if(T.F===3&&p&&!_B(p.element)){var o=_F(p.element),t=_H(p.element);if(!o)o={"E":p.element},E[E[N]]=o;if(!T.R){_Y();T.R=p.domain}o.S=p.sid,o.T=p.event;if(t&&_X(t,p.content)&&o.T){var m="mousedown",k="keydown",f=function(e){e=e||W.event;if(!e)return;switch(e.type){case k:if(e.keyCode!=13)return;case m:_U(o.S)}};_O(t,m,f);_O(t,k,f)}t=V}};S.flush=_Z;S.Cookie={get:_G,set:_S,remove:function(p){p=p||{};p.expires=new Date(0).toUTCString();_S(p)}};S.History={remove:function(){var a=arguments;_T(V,{"_rt.rh":a[N]===0?"*":_J(a,"\t")},0)}}})(Rtoaster,window)}