]> 4ch.mooo.com Git - test.git/blob - data/js/script.js
f2ac1b56e9d7b0dc0825525d497021b04dbdeeaf
[test.git] / data / js / script.js
1 //----eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('8 V=14;8 K=0;8 G=[];8 15=[[2h,24,20],[1R,1I,1F],[1A,2t,4]];8 11=[[29,23,22,1Z,1X,1Q],[1L,1H,1G,1E,1C,1z]];h $g(i){t o.2g(i)}h 2c(){8 N=I(\'1q\'),E=I(\'21\'),x;5((x=$g(\'H\'))){x.k=N}5((x=$g(\'1T\'))){x.k=E}}h 1P(){8 P=I(\'1K\'),d=o,1g=d.A.u;v(8 i=0;i<1g;i++){5(d.A[i].1a){d.A[i].1a.k=P}}}h I(a){8 b,z,w=0,y=0,F;b=\' \'+o.17+\';\';8 c=b.u;2q(w<c){y=b.Z(\';\',w);z=b.10(w+1,y);F=z.Z(\'=\');5(z.10(0,F)==a){t 2i(z.10(F+1,y-w-1))}w=y+1}t\'\'}h 1s(a,b){8 c=12 2f();c.2d(c.2b()+2a*7);o.17=a+\'=\'+1w(b)+\'; 26=\'+c.25()}h c(){8 a,j,J,Y;1p{5(!$g(\'1n\')){t R}a=$g(\'1n\').k;5(!a&&!$g(\'Q\').k){X(W[0]);t 14}5(a){J=0;Y=1m.u;v(j=0;j<Y;j++){5(a.1Y(a.u-3,3).1W()==1m[j]){J=1;1U}}5(!J){X(W[1]);t 14}}D(\'Q\');D(\'H\');D(\'1S\');5(1k.1O){o.A[0].1N.k=a}o.A[0].1M.1J=R}18(e){}5($g(\'H\').k){1s(\'1q\',$g(\'H\').k)}}h 1b(){5(!o.1f){t}8 a,U=o.1f(\'a\');8 b=U.u;v(8 i=0;i<b;i++){a=U[i];5(a.T(\'1e\')){5(a.T(\'1d\')==\'1i\'){a.1c=\'1i\'}5(a.T(\'1d\')==\'1h\'){a.1c=\'1h\'}}}}h 1D(){$g("1j").m=\'\';$g("19").m=\'\';$g("B").m=\'C\';$g("C").m=\'B\'}h 1B(){$g("1j").m=\'1V\';$g("19").m=\'B\';$g("B").m=\'B\';$g("C").m=\'C\'}h 1l(a){1p{$g(\'Q\').1y()}18(e){}$g(\'Q\').k+=\'>>1x.\'+a+"\\r\\n"}h S(a,b){8 c=$g(\'r\'+a);5(c){5(b){c.m=c.m.16(\' 1o\',\'\')}2s{5(K){S(K,R)}K=a;c.m+=\' 1o\'}}}h D(a){8 b=$g(a);8 c=1w(b.k).2r();8 d=/%2p(6[2n]|7[0-1v-f]|2l)[0-1v-f]/;5(c.13(d)!==2j){X(W[2]);1r(b)}}h 1r(a){8 b=a.k,i=0,p=0;8 c=15.u,s;v(i=0;i<c;i++){s=15[i];v(p=0;p<=s[2];p++){b=b.16(12 M(O.L(s[0]+p),\'g\'),O.L(s[1]+p))}}c=11[0].2e;v(i=0;i<c;i++){s=11;b=b.16(12 M(O.L(s[0][i]),\'g\'),O.L(s[1][i]))}a.k=b}h 2k(a){5(1u a==\'h\'){G.2m(a)}}h 1t(){5(V){t}8 i,l=G.u,f;V=R;1b();v(i=0;i<l;i++){f=G[i];5(1u f==\'h\'){f()}}8 a=2o.1e;5(a.Z(\'?28=\')){5(a.13(/#[27]([0-9]+)$/)){S(M.$1)}5(a.13(/#q([0-9]+)$/)){1l(M.$1)}}}1k.2u=1t;',62,155,'|||||if|||var|||||||||function|||value||className||document||||Tbl|return|length|for|xx1|obj|xx2|tmp2|forms|hide|show|check_sakura||xx3|arrPresetFunc|fname|getCookie|ext_allowed|previous_replyhlno|fromCharCode|RegExp||String||fcom|true|replyhl|getAttribute|anchors|preset_sensor|msgs|alert|ext_length|indexOf|substring|arrSakuraTblsp|new|match|false|arrSakuraTbl|replace|cookie|catch|postform_tbl|pwd|fixalllinks|target|rel|href|getElementsByTagName|forms_length|_blank|_top|postform|window|quote|ext|fupfile|replyhl|try|namec|replace_sakura|setCookie|preset|typeof|9a|escape|No|focus|14446|63486|hideform|12445|showform|12542|85|12541|12540|12449|disabled|pwdc|12293|sendbtn|upfile_path|clipboardData|l2|63213|63306|fsub|femail|break|hide_btn|toUpperCase|63212|substr|63211|82|emailc|63210|63219|12353|toGMTString|expires|rq|res|63216|86400000|getTime|l1|setTime|legnth|Date|getElementById|63223|unescape|null|hookPresetFunction|80|push|ef|location|uf|while|toLowerCase|else|12535|onload'.split('|'),0,{}))
2 /* Pixmicat! r4 functions ^ */
3
4 var previous_replyhlno=0,arrPresetFunc=[],arrSakuraTbl=[[63223,12353,82],[63306,12449,85],[63486,12535,4]],arrSakuraTblsp=[[63216,63219,63210,63211,63212,63213],[12293,12540,12541,12542,12445,14446]];function $g(a){return document.getElementById(a)}function getCookie(a){var d,b,e=0,g=0,f;d=" "+document.cookie+";";for(var h=d.length;e<h;){g=d.indexOf(";",e);b=d.substring(e+1,g);f=b.indexOf("=");if(b.substring(0,f)===a)return window.unescape(b.substring(f+1,g-e-1));e=g+1}return""}
5 function setCookie(a,d){var b=new Date;b.setTime(b.getTime()+6048E5);document.cookie=a+"="+window.escape(d)+"; expires="+b.toGMTString()}
6 function replace_sakura(a){var d=a.value,b=0,e=0,g=arrSakuraTbl.length,f;for(b=0;b<g;b++){f=arrSakuraTbl[b];for(e=0;e<=f[2];e++)d=d.replace(new RegExp(String.fromCharCode(f[0]+e),"g"),String.fromCharCode(f[1]+e))}g=arrSakuraTblsp[0].legnth;for(b=0;b<g;b++){f=arrSakuraTblsp;d=d.replace(new RegExp(String.fromCharCode(f[0][b]),"g"),String.fromCharCode(f[1][b]))}a.value=d}
7 function check_sakura(a){a=$g(a);if(window.escape(a.value).toLowerCase().match(/%uf(6[ef]|7[0-9a-f]|80)[0-9a-f]/)!==null){alert(msgs[2]);replace_sakura(a)}}function l1(){var a=getCookie("namec"),d=getCookie("emailc"),b;if(b=$g("fname"))b.value=a;if(b=$g("femail"))b.value=d}function l2(){for(var a=getCookie("pwdc"),d=document,b=d.forms.length,e=0;e<b;e++)if(d.forms[e].pwd)d.forms[e].pwd.value=a}
8 function c(){var a,d,b,e;try{if(!$g("fupfile"))return true;a=$g("fupfile").value;if(!a&&!$g("fcom").value){alert(msgs[0]);return false}if(a){b=0;e=ext.length;for(d=0;d<e;d++)if(a.substr(a.length-3,3).toUpperCase()===ext[d]){b=1;break}if(!b){alert(msgs[1]);return false}}check_sakura("fcom");check_sakura("fname");check_sakura("fsub");if(window.clipboardData)document.forms[0].upfile_path.value=a;document.forms[0].sendbtn.disabled=true}catch(g){}$g("fname").value&&setCookie("namec",$g("fname").value)}
9 function fixalllinks(){if(document.getElementsByTagName)for(var a,d=document.getElementsByTagName("a"),b=d.length,e=0;e<b;e++){a=d[e];if(a.getAttribute("href")){if(a.getAttribute("rel")==="_top")a.target="_top";if(a.getAttribute("rel")==="_blank")a.target="_blank"}}}function showform(){$g("postform").className="";$g("postform_tbl").className="";$g("hide").className="show";$g("show").className="hide"}
10 function hideform(){$g("postform").className="hide_btn reply";$g("postform_tbl").className="hide";$g("hide").className="hide";$g("show").className="show"}function quote(a){try{$g("fcom").focus();$g("fcom").value+=">>No."+a+"\r\n"}catch(d){}}function replyhl(a,d){var b=$g("r"+a);if(b)if(d)b.className=b.className.replace(" reply_hl","");else{previous_replyhlno&&replyhl(previous_replyhlno,true);previous_replyhlno=a;b.className+=" reply_hl"}}
11 function hookPresetFunction(a){typeof a==="function"&&arrPresetFunc.push(a)}function preset(){var a,d=arrPresetFunc.length,b;fixalllinks();for(a=0;a<d;a++){b=arrPresetFunc[a];typeof b==="function"&&b()}a=location.href;if(a.indexOf("?res=")){a.match(/#[rq]([0-9]+)$/)&&replyhl(RegExp.$1,false);a.match(/#q([0-9]+)$/)&&quote(RegExp.$1)}};
12
13 /* Pixmicat! r5 functions ^ */
14
15 /* Futaba / Wakaba / Yotsubanome Functions */
16 /*
17 // Hide postform in thread index
18 set_cookie ('toggle_upform', 0, 365);
19
20 // Hide Staff password field
21 set_cookie ('toggle_spform', 0, 365);
22 */
23 function toggle (button, area)
24 {
25         if (get_cookie ('toggle_' + area) == 1)
26         { set_cookie ('toggle_' + area, 0, 365); }
27         else
28         { set_cookie ('toggle_' + area, 1, 365); }
29
30         showstate (button, area);
31
32         return;
33 }
34
35 //function showstate (button, area)
36 function showstate (button)
37 {
38         var tag = document.getElementById (button);
39 //      var tags = document.getElementsByName ('toggle');
40
41 //      for (go = 0; go < tags.length; go ++)
42 //      {
43 //              var tag = tags[go];
44
45                 if (!tag) { return; }
46                 if (!tag.getAttribute ('rel') ) { return; }
47
48                 var rel = tag.getAttribute ('rel').split (',');
49
50                 var relc        = rel.length;
51                 var area        = rel[0];
52
53                 if (relc > 1)
54                 {
55                         var show        = rel[1];
56                         var hide        = rel[2];
57                 }
58
59                 tag.onclick = function () { toggle (button, area); }
60
61                 var tog = document.getElementById (area);
62
63                 if (get_cookie ('toggle_' + area) == 1)
64                 {
65                         tog.style.display       = '';
66                         if (relc > 1) { tag.innerHTML   = hide; }
67                 }
68                 else
69                 {
70                         tog.style.display       = 'none';
71                         if (relc > 1) { tag.innerHTML   = show; }
72                 }
73 //      }
74
75         return;
76 }
77
78
79 function replace_all (str, from, to)
80 {
81         var idx = str.indexOf (from);
82
83         while (idx > -1 )
84         {
85                 str = str.replace (from, to);
86                 idx = str.indexOf (from);
87         }
88         return str;
89 }
90
91 function highlight (post)
92 {
93         var cello       = document.getElementsByTagName ('blockquote');
94         var cells       = document.getElementsByTagName ('td');
95         var reply       = document.getElementById ('post' + post);
96
97         for (var i = 0; i < cello.length; i ++)
98         {
99                 if (cello[i].className == 'replyhl')
100                 { cello[i].className    = 'threadpost'; }
101         }
102
103         for (var i = 0; i < cells.length; i ++)
104         {
105                 if (cells[i].className == 'replyhl')
106                 { cells[i].className    = 'reply'; }
107         }
108
109         if (reply)
110         {
111                 reply.className = 'replyhl';
112                 var match       = /^([^#r]*)/.exec (document.location.toString () );
113                 document.location       = match[1] + '#r' + post;
114         }
115 }
116
117 function size_textarea (id, rows) { document.getElementById(id).com.setAttribute('rows', rows); }
118
119 function get_password (name)
120 {
121         var pass        = get_cookie (name);
122         if (pass) { return pass; }
123
124         var chars       = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
125         var pass        = '';
126
127         for (var i = 0; i < 8; i ++)
128         {
129                 var rnd = Math.floor (Math.random () * chars.length);
130                 pass    += chars.substring (rnd, rnd + 1);
131         }
132
133         return (pass);
134 }
135
136 function get_cookie (name)
137 {
138         with (document.cookie)
139         {
140                 var reg = new RegExp ('(^|;\\s+)' + name + '=(.*?)(;|$)');
141                 var hit = reg.exec (document.cookie);
142
143                 if (hit && hit.length > 2)
144                 { return unescape (replace_all (hit[2], '+', '%20') ); }
145                 else return '';
146         }
147 }
148
149 function set_cookie (name, value, days)
150 {
151         if (days)
152         {
153                 var date        = new Date ();
154                 date.setTime (date.getTime () + (days * 24 * 60 * 60 * 1000) );
155                 var expires     = '; expires=' + date.toGMTString ();
156         }
157         else expires    = '';
158
159         document.cookie = name + '=' + value + expires + '; path=/';
160 }
161
162 function set_stylesheet (styletitle, norefresh)
163 {
164         set_cookie ('yo_style', styletitle, 365);
165
166         var links       = document.getElementsByTagName ('link');
167         var found       = false;
168
169         for (var i = 0; i < links.length; i ++)
170         {
171                 var rel = links[i].getAttribute ('rel');
172                 var ttl = links[i].getAttribute ('title');
173
174                 if (rel.indexOf ('style') != -1 && ttl)
175                 {
176                         links[i].disabled       = true; // IE needs this to work. IE needs to die.
177
178                         if (styletitle == ttl)
179                         {
180                                 links[i].disabled       = false;
181                                 found   = true;
182                         }
183                 }
184         }
185
186         if (!found) set_preferred_stylesheet ();
187 }
188
189 function set_preferred_stylesheet ()
190 {
191         var links       = document.getElementsByTagName ('link');
192
193         for (var i = 0; i < links.length; i ++)
194         {
195                 var rel = links[i].getAttribute ('rel');
196                 var ttl = links[i].getAttribute ('title');
197
198                 if (rel.indexOf ('style') != -1 && ttl)
199                 { links[i].disabled     = (rel.indexOf ('alt') != -1); }
200         }
201 }
202
203 function get_active_stylesheet ()
204 {
205         var links       = document.getElementsByTagName ('link');
206
207         for (var i = 0; i < links.length; i ++)
208         {
209                 var rel = links[i].getAttribute ('rel');
210                 var ttl = links[i].getAttribute ('title');
211
212                 if (rel.indexOf ('style') != -1 && ttl && !links[i].disabled)
213                 { return ttl; }
214         }
215         return null;
216 }
217
218 function get_preferred_stylesheet ()
219 {
220         var links       = document.getElementsByTagName ('link');
221
222         for (var i=0;i<links.length;i++)
223         {
224                 var rel = links[i].getAttribute ('rel');
225                 var ttl = links[i].getAttribute ('title');
226
227                 if (rel.indexOf ('style') != -1 && rel.indexOf ('alt') == -1 && ttl)
228                 { return ttl; }
229         }
230         return null;
231 }
232
233
234 // Fill postform / delform fields
235 function set_inputs (id)
236 {
237         if (document.getElementById (id) )
238         {
239                 with (document.getElementById (id) )
240                 {
241                         if (document.getElementById ('name') && !name.value)
242                         { name.value    = get_cookie ('namec'); }
243                         if (document.getElementById ('email') && !email.value)
244                         { link.value    = get_cookie ('emailc'); }
245                         if (document.getElementById ('pwd') && !pwd.value)
246                         { pwd.value     = get_password ('pwdc'); }
247                         if (document.getElementById ('noko') && get_cookie ('yo_noko') == 1)
248                         { noko.options[1].selected = true; }
249                 }
250         }
251 }
252
253 function set_delpass (id)
254 {
255         if (document.getElementById (id) )
256         {
257                 with (document.getElementById (id) )
258                 {
259                         if (document.getElementById ('pwd') )
260                         { pwd.value     = get_cookie ('pwdc'); }
261                 }
262         }
263 }
264
265
266 window.onunload = function (e)
267 {
268         if (style_cookie)
269         {
270                 var title       = get_active_stylesheet ();
271                 set_cookie (style_cookie, title, 365);
272         }
273 }
274
275 window.onload   = function (e)
276 {
277         var match;
278
279         if (match       = /#q([0-9]+)/.exec (document.location.toString () ) )
280         if (!document.forms.postform.com.value)
281         quote (match[1]);
282
283         if (match       = /#r([0-9]+)/.exec (document.location.toString () ) )
284         highlight (match[1]);
285
286         set_inputs ('postform');
287         set_delpass ('delform');
288 }
289
290
291 if (style_cookie)
292 {
293         var cookie      = get_cookie (style_cookie);
294         var title       = cookie ? cookie : get_preferred_stylesheet ();
295         set_stylesheet (title);
296 }
297
298 function reppop(url) {
299 day = new Date();
300 id = day.getTime();
301 window.open(url, id, 'toolbar=0,scrollbars=0,location=0,status=1,menubar=0,resizable=1,width=512,height=128');
302 return false;   
303 }