-
Notifications
You must be signed in to change notification settings - Fork 3
/
mac.js
152 lines (152 loc) · 68.5 KB
/
mac.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
var m,aa,ba;function ca(){var a=da.port.width(),b=da.port.height();ba=p([4,4,a-8,b-8],255,25,["Click to continue"]);ba.b.addClass("ctc");a=da;for(b=0;b<a.i.length;b++)a.i[b].hide();da.add(ba);q=!0}function ea(a,b,c){var d=fa(s("CNTL",128));d.o=c;c=d.b.position();d.b.css("left",c.left+a+"px");d.b.css("top",c.top+b+"px");return d}
function ga(a){for(var b="",c=0;c<a.length;c++)switch(a.charCodeAt(c)){case 13:b+="<br />";break;case 63368:b+="à";break;case 63374:b+="é";break;case 63401:b+="©";break;case 63433:b+="...";break;case 63441:b+="—";break;default:b+=a.charAt(c)}return b}function ha(){return u?ia[u-1]:3E3}
function ja(a,b){var c={top:0,left:0,width:0,height:0},d;if(d=ka(2*a+1)){c.width=d.width;c.height=d.height;if(la(c,b,c))a:{for(var e=c.top;e<c.top+c.height;e++)for(var g=e*d.q,k,h=c.left;h<c.left+c.width;h++)if(k=d.data[g+(h>>3)]&1<<7-(h&7)){c=!0;break a}c=!1}else c=!1;return c}return(d=ka(2*a))?(c.width=d.width,c.height=d.height,la(c,b,c)):!1}
function ma(a){var b={top:0,left:0,width:0,height:0},c=na(a),d=0;c&&c.a&&(d=oa(c.a.children,a));if(d){d--;var e=c.a.children[d];if(0==e.width||0==e.height)a=pa(a,c,!0),c.a.children[d].top=a.top,c.a.children[d].left=a.left,c.a.children[d].width=a.width,c.a.children[d].height=a.height;b.top=c.a.children[d].top;b.left=c.a.children[d].left;b.width=c.a.children[d].width;b.height=c.a.children[d].height}else(c=ka(2*a))?(b.top=1*v(a,2),b.left=1*v(a,1),b.width=c.width,b.height=c.height):(c=ka(2*a+1))?(b.top=
v(a,2),b.left=v(a,1),b.width=c.width,b.height=c.height):(b.top=0,b.left=0,b.width=0,b.height=0);return b}function qa(a){var b=ka(2*a);a=ka(2*a+1);var c=b.width,d=b.height;a&&(c<a.width&&(c=a.width),d<a.height&&(d=a.height));var e=$(document.createElement("canvas"));e.addClass("proxy");e.attr("width",c);e.attr("height",d);desktop.append(e);a?ra(a,e,0,0):sa(e,0);ta(b,e,0,0);return e};function ua(a){for(var b=0,c=0,d=0;4>d;d++)b|="APPL".charCodeAt(d)<<24-8*d,c|=a.charCodeAt(d)<<24-8*d;for(d in w)if(w[d].type==b&&w[d].qa==c)return y.seek((w[d].na+va)*wa,y.set),new xa(z(y,w[d].X))}function ya(a){for(var b in w)if(w[b].name==a){if(0==w[b].Z)break;y.seek((w[b].ra+va)*wa,y.set);return new xa(z(y,w[b].Z))}}function za(a){for(var b in w)if(w[b].name==a){if(0==w[b].X)break;y.seek((w[b].na+va)*wa,y.set);return new xa(z(y,w[b].X))}}var w=[],y=void 0,wa,va,Aa;
function Ba(a,b){var c=a+512*b;y.seek(c+8,y.set);var d=A(y);A(y);var e=B(y);switch(d){case 0:for(d=0;d<e;d++){y.seek(c+512-2*(d+1),y.set);var g=B(y);y.seek(c+g,y.set);var k=A(y);y.seek(c+g+k+1,y.set);g=C(y);Ba(a,g)}break;case 255:for(d=0;d<e;d++)if(y.seek(c+512-2*(d+1),y.set),g=B(y),g=c+g,y.seek(g,y.set),k=A(y),0!=k){k++;k&1&&k++;A(y);var h=C(y),f=A(y),f=z(y,f);y.seek(g+k,y.set);switch(B(y)){case 512:h={parent:h,name:f},y.seek(g+k+4,y.set),h.type=C(y),h.qa=C(y),y.seek(g+k+20,y.set),f=C(y),y.seek(2,
y.j),h.Z=C(y),y.seek(6,y.j),h.X=C(y),y.seek(g+k+74,y.set),h.ra=B(y),y.seek(g+k+86,y.set),h.na=B(y),w[f]=h}}break;default:fatal("Bad HFS Node")}};var Ca=[],Da=!1;function Ea(a,b,c){this.width=a;this.height=b;this.q=c;this.H=a;this.G=b;this.data=Array(b*c)}
Ea.prototype.m=function(a,b,c){if(0!=this.width&&0!=this.height){var d=a.get(0).getContext("2d"),e=this.width,g=this.height,k=0,h=0;0>b&&(k=-b,b=0);0>c&&(h=-c,c=0);e+b>=a.width()&&(e=a.width()-b);g+c>=a.height()&&(g=a.height()-c);if(0!=e&&0!=g){a=d.getImageData(b,c,e,g);for(var f=h;f<g;f++)for(var l=f*this.q,n=(f-h)*a.width*4,r,t=k;t<e;t++)r=(r=this.data[l+(t>>3)]&1<<7-(t&7))?0:255,a.data[n++]=r,a.data[n++]=r,a.data[n++]=r,a.data[n++]=255;d.putImageData(a,b,c)}}};
function ra(a,b,c,d){if(0!=a.width&&0!=a.height){var e=b.get(0).getContext("2d"),g=a.width,k=a.height,h=0,f=0;0>c&&(h=-c,c=0);0>d&&(f=-d,d=0);g+c>=b.width()&&(g=b.width()-c);k+d>=b.height()&&(k=b.height()-d);if(0!=g&&0!=k){b=e.getImageData(c,d,g,k);for(var l=f;l<k;l++)for(var n=l*a.q,r=(l-f)*b.width*4,t,x=h;x<g;x++)(t=a.data[n+(x>>3)]&1<<7-(x&7))?(b.data[r++]=255,b.data[r++]=255,b.data[r++]=255,b.data[r++]=255):r+=4;e.putImageData(b,c,d)}}}
function ta(a,b,c,d){if(0!=a.width&&0!=a.height){var e=b.get(0).getContext("2d"),g=a.width,k=a.height,h=0,f=0;0>c&&(h=-c,c=0);0>d&&(f=-d,d=0);g+c>=b.width()&&(g=b.width()-c);k+d>=b.height()&&(k=b.height()-d);if(0!=g&&0!=k){b=e.getImageData(c,d,g,k);for(var l=f;l<k;l++)for(var n=l*a.q,r=(l-f)*b.width*4,t,x=h;x<g;x++)(t=a.data[n+(x>>3)]&1<<7-(x&7))?(b.data[r++]^=255,b.data[r++]^=255,b.data[r++]^=255,b.data[r++]=255):r+=4;e.putImageData(b,c,d)}}}
Ea.prototype.W=function(a,b){return 0!=(this.data[b*this.q+(a>>3)]&1<<7-(a&7))};function Fa(a,b,c,d,e,g){a=a.get(0).getContext("2d");for(var k=a.getImageData(b,c,d,e),h=0;h<e;h++)for(var f=h*k.width*4,l=g?0:255,n=0;n<d;n++)k.data[f++]=l,k.data[f++]=l,k.data[f++]=l,k.data[f++]=255;a.putImageData(k,b,c)}
function Ga(a){var b=new Ea(512,302,64),c=Array(72);a.seek(512,a.set);for(var d=0,e=0;e<b.G;e++){for(var g=0;72>g;){var k=A(a);if(128!=k)if(k&128)for(var k=k^255,k=k+2,h=A(a),f=0;f<k;f++)c[g++]=h;else for(k++,f=0;f<k;f++)c[g++]=A(a)}for(f=0;64>f;f++)b.data[d++]=c[f]}return b}function Ha(){var a=Ia(131),b=za(a),c;if(void 0!=b){var b=Ja(b),d=s("PPIC",0);void 0!=d&&(c=Ka(d));delete La[b];La.splice(b,1)}void 0==c&&(c=Ga(ya(a)));return c};function Ja(a){La.push(a);return La.length-1}function s(a,b){for(var c=a.charCodeAt(0)<<24|a.charCodeAt(1)<<16|a.charCodeAt(2)<<8|a.charCodeAt(3),d=La.length-1;0<=d;d--){var e=La[d];e.seek(0,e.set);var g=C(e),k=C(e);e.seek(k+24,e.set);k+=B(e);e.seek(k,e.set);for(var h=B(e)+1,f=0;f<h;f++){if(C(e)==c){c=B(e)+1;e.seek(k+B(e),e.set);for(f=0;f<c;f++){if(B(e)==b)return e.seek(2,e.j),g+=C(e)&16777215,e.seek(g,e.set),g=C(e),new xa(z(e,g));e.seek(10,e.j)}return}e.seek(4,e.j)}}}
function Ia(a){a=s("STR ",a);if(void 0==a)return"";var b=A(a);return z(a,b)}function Ma(a,b){if(0==b)return"";var c=s("STR#",a);if(void 0==c)return"";var d=B(c);if(b>d)return"";for(;;){b--;if(0==b)return d=A(c),z(c,d);d=A(c);c.seek(d,c.j)}}function fa(a){var b=B(a),c=B(a),d=B(a)-b,e=B(a)-c;B(a);A(a);A(a);B(a);B(a);var g=B(a),k=C(a),h=A(a),f="";0!=h&&(f=z(a,h));a=[];h=0;switch(g>>4){case 0:h=10;a=[f];break;case 128:h=25,a=[f]}return p([c,b,e,d],k,h,a)}var La=[];function Na(a){var b=B(a);a.seek(12,a.j);var c=A(a),d="";0!=c&&(d=z(a,c));1==c&&(d="");D={id:b};D.b=$(document.createElement("div"));""==d?D.b.addClass("apple"):D.b.html(d);D.b.data("refCon",D);D.b.mousedown(function(a){if(q)return!1;Oa(a);return!1});D.p=$(document.createElement("table"));D.p.addClass("menu");D.body=$(document.createElement("tbody"));D.p.append(D.body);D.items=[];d.match(/(Edit)|(Font)/i)||Pa.append(D.b);E.push(D);for(c=0;;){var e=A(a);if(0==e)break;d="";0!=e&&(d=ga(z(a,e)));A(a);
e=A(a);A(a);A(a);e=0!=e?String.fromCharCode(e):"";Qa(d,b<<8|c,e);c++}};var Ra=1,Sa=18,Ta=18,Ua=2,Va=15,Wa=15,Xa=15,Ya=15,Za=2,$a=0,ab=["All rights reserved.<br />Programming by Sean Kasun<br />Original Development Team: Todd Squires, Craig Erickson, Kurt Nelson, Steven Hays, Terry Schulenburg, Darin Adler, Jay Zipnick, Waldemar Horwat, Mark Waterman","All rights reserved.<br />Programming by Sean Kasun<br />Original Development Team: Jay Zipnick, Billy Wolfe, Terry Schulenburg, Mark Waterman, Darin Adler, Dave Marsh, Todd Squires, Tod Zipnick, Steven Hays, Waldemar Horwat, Craig Erickson",
"^0 is a registered trademark of Zojoi LLC. All rights reserved.<br />Programming by Sean Kasun<br />Original Development Team: Dave Marsh, Karl Roelofs, Terry Schulenburg, Dave Feldman, Jay Zipnick, Todd Squires, Darin Adler, Tod Zipnick, Waldemar Horwat, Steven Hays","All rights reserved.<br />Programming by Sean Kasun<br />Original Development Team: Darin Adler, Mitch Adler, Fred Allen, Brian Baker, Ed Dluzen, David Feldman, Steven Hays, Jay Zipnick, Julia Ulano, David Marsh, Karl Roelofs, Paul Snively, Todd Squires, Tod Zipnick, Waldemar Horwat, Michael Manning"];
function bb(){var a=s(Ma(129,1),0),b=A(a);z(a,b);a=eb(146,46,220,210);b="© 2014 Zojoi LLC.<br />"+ab[RELEASE-1];a.add(p([75,180,70,18],1,10,["Ok"]));a.add(p([20,10,180,80],3,15,[b]));a.param([fullGameName]);a.getItem(3).b.css("text-align","center");return a}function fb(){var a=eb(146,96,220,120);a.add(p([75,90,70,18],1,10,["Ok"]));a.add(p([55,55,110,14],2,24,[0,0,100]));a.add(p([20,25,180,20],3,15,["Sound Volume"]));a.getItem(3).b.css("text-align","center");return a}
function gb(a){a=ga(Ma(128,[8,9,7][a]));var b=hb(s("ALRT",131));b.param([a]);return b}function ib(){var a=eb(82,71,348,200);a.add(p([256,138,80,18],1,10,["Open"]));a.add(p([256,163,80,18],2,10,["Cancel"]));a.add(p([12,39,218,146],3,23,[]));return a}function jb(){var a=eb(104,79,304,184);a.add(p([218,132,70,18],1,10,["Save"]));a.add(p([218,158,70,18],2,10,["Cancel"]));a.add(p([14,136,183,16],5,15,["Save as:"]));a.add(p([17,157,177,16],3,17,[""]));a.add(p([14,29,183,98],4,23,[]));return a}
function kb(){for(var a=F.left,b=F.top,c=0;c<F.Q;c++)a+=F.ya,b+=F.za,388<=b&&(b=F.top),628<=a&&(a=F.left);F.Q++;a=lb("zoomDoc",!0,!0,!0,!0,a,b,F.width,F.height);a.kind=14;return a}function mb(){var a=s("GNRL",129);B(a);var b=B(a),c=B(a),d=B(a),e=B(a)-c,a=B(a)-d,c=p([d,c,a,e],5,17,[""]);c.b.css("text-align","center");c.b.css("font-size",b+"px");c.b.css("line-height",e+"px");return c}
function nb(a){var b=B(a),c=B(a),d=B(a)-b,e=B(a)-c,g="",k=!1;switch(B(a)){case 0:g="document";break;case 1:g="dBox";break;case 2:g="plainDBox";break;case 3:g="altDBox";break;case 4:g="noGrowDoc";break;case 5:g="movableDBox";break;case 8:g="zoomDoc";k=!0;break;case 12:g="zoomNoGrow";k=!0;break;case 16:g="rDoc16";break;case 18:g="rDoc4";break;case 20:g="rDoc6";break;case 22:g="rDoc10"}B(a);var h=0!=B(a);C(a);var f=A(a),l="";1!=f&&(l=ga(z(a,f)));a=lb(g,h,k,!1,!1,c,b,e,d);ob(a,l);return a}
function hb(a){var b=B(a),c=B(a),d=B(a)-b,e=B(a)-c,g=B(a);a=eb(c,b,e,d);for(var g=s("DITL",g),k=B(g)+1,h=0;h<k;h++){C(g);var b=B(g),c=B(g),d=B(g)-b,e=B(g)-c,f=A(g),l=A(g),n="";0<l&&(n=ga(z(g,l)));l&1&&A(g);switch(f&127){case 4:a.add(p([c,b,e,d],h+1,10,[n]));break;case 8:a.add(p([c,b,e,d],h+1,15,[n]));break;case 16:a.add(p([c,b,e,d],h+1,17,[n]));break;default:fatal("Unknown DITL:"+(f&127))}}return a}
function pb(a){var b=B(a),c=B(a),d=B(a)-b,e=B(a)-c,g="",k=!1;switch(B(a)){case 0:g="document";break;case 1:g="dBox";break;case 2:g="plainDBox";break;case 3:g="altDBox";break;case 4:g="noGrowDoc";break;case 5:g="movableDBox";break;case 8:g="zoomDoc";k=!0;break;case 12:g="zoomNoGrow";k=!0;break;case 16:g="rDoc16";break;case 18:g="rDoc4";break;case 20:g="rDoc6";break;case 22:g="rDoc10"}A(a);A(a);var h=0!=A(a);A(a);C(a);var f=B(a),l=A(a),n="";1!=l&&(n=ga(z(a,l)));a=s("DITL",f);k=lb(g,h,k,!1,!1,c,b,e,
d);ob(k,n);k.kind=2;h=B(a)+1;for(f=0;f<h;f++)switch(C(a),b=B(a),c=B(a),d=B(a)-b,e=B(a)-c,g=A(a),l=A(a),n="",0<l&&(n=ga(z(a,l))),l&1&&A(a),g&127){case 4:k.add(p([c,b,e,d],f+1,10,[n]));break;case 8:k.add(p([c,b,e,d],f+1,15,[n]));break;case 16:k.add(p([c,b,e,d],f+1,17,[n]));break;default:fatal("Unknown DITL:"+(g&127))}return k};function qb(a){var b=rb(4,a);a=new xa(b);var c=void 0;switch(b.charCodeAt(5)&255){case 16:var d=[];a.seek(408,a.set);for(var e=0;16>e;e++)d[e]=A(a);var g=2*C(a);B(a);for(var e=22100*C(a)/65536|0,k=new sb(g,e),h,e=0;e<g;e++)h=e&1?h>>4:A(a),k.data[e]=d[h&15];c=k;break;case 18:a.seek(12,a.set);d=B(a);a.seek(52,a.set);h=B(a)+52;a.seek(h,a.set);g=C(a)-6;B(a);e=22100*C(a)/65536|0;e=new sb(g*d,e);k=0;b=a.seek(226,a.set)+226;for(c=0;c<d;c++){a.seek(b+2*c,a.set);var f=B(a);a.seek(h+10,a.set);for(var l=0;l<
g;l++){var n=A(a);n&128?(n-=128,n*=f,n=n>>8&255,n&128&&(n=127),n+=128):(n=(n^255)+1,n-=128,n*=f,n=n>>8&255,n&128&&(n=127),n+=128,n=(n^255)+1);e.data[k++]=n}}c=e;break;case 24:d=[];a.seek(594,a.set);for(e=0;16>e;e++)d[e]=A(a);h=2*C(a);B(a);e=22100*C(a)/65536|0;k=new sb(h,e);for(e=0;e<h;e++)g=e&1?g>>4:A(a),k.data[e]=d[g&15];c=k;break;case 26:d=[];a.seek(544,a.set);for(g=0;16>g;g++)d[g]=A(a);h=C(a);B(a);g=22100*C(a)/65536|0;k=new sb(h,g);for(g=0;g<h;g++)e=g&1?e>>4:A(a),k.data[g]=d[e&15];c=k;break;case 68:a.seek(94,
a.set);d=C(a);h=22100*C(a)/65536|0;h=new sb(d,h);for(g=0;g<d;g++)h.data[g]=A(a);c=h;break;case 120:d=[];a.seek(186,a.set);for(g=0;16>g;g++)d[g]=A(a);C(a);h=C(a);g=22100*C(a)/65536|0;e=new sb(h,g);for(g=0;g<h;g++)k=g&1?k<<4:A(a),e.data[g]=d[k>>4&15];c=e;break;case 126:h=[];a.seek(194,a.set);for(e=0;16>e;e++)h[e]=A(a);C(a);g=C(a);e=22100*C(a)/65536|0;k=new sb(g,e);b=128;for(e=0;e<g;e++)d=e&1?d<<4:A(a),b+=h[d>>4&15],k.data[e]=b&255;c=k}if(void 0==c)return 0;tb&&!ub&&c.play();return c.time()};function xa(a){this.set=0;this.j=1;this.end=2;this.data=a;this.length=a.length;this.l=this.h=0}function A(a){return a.data.charCodeAt(a.h++)&255}function B(a){var b=(a.data.charCodeAt(a.h++)&255)<<8;return b|=a.data.charCodeAt(a.h++)&255}function vb(a){var b=(a.data.charCodeAt(a.h++)&255)<<16,b=b|(a.data.charCodeAt(a.h++)&255)<<8;return b|=a.data.charCodeAt(a.h++)&255}
function C(a){var b=(a.data.charCodeAt(a.h++)&255)<<24,b=b|(a.data.charCodeAt(a.h++)&255)<<16,b=b|(a.data.charCodeAt(a.h++)&255)<<8;return b|=a.data.charCodeAt(a.h++)&255}function wb(a){var b=(a.data.charCodeAt(a.h)&255)<<24,b=b|(a.data.charCodeAt(a.h+1)&255)<<16,b=b|(a.data.charCodeAt(a.h+2)&255)<<8;return b|=a.data.charCodeAt(a.h+3)&255}xa.prototype.seek=function(a,b){switch(b){case this.j:a+=this.h;break;case this.end:a+=this.length}this.h=a};
function z(a,b){var c=a.h;a.h+=b;return a.data.substring(c,a.h)}xa.prototype.f=function(a){var b=wb(this),b=b>>>32-this.l-a;this.l+=a;this.l&16&&(this.l&=15,this.h+=2);return b&(1<<a)-1};function xb(){if(void 0!=y){G=0;for(var a,b=1;void 0==a&&5>b;b++)a=ua("MCV"+b);for(b=1;void 0==a&&5>b;b++)a=ua("MCv"+b);Ja(a);aa.remove();delete aa;a=Ma(129,2);b=za(a);void 0!=b?(b=Ja(b),a=Ka(s("PPIC",0)),delete La[b],La.splice(b,1)):a=Ga(ya(a));yb=lb("plainDBox",!1,!1,!1,!1,0,0,512,342);yb.show();a.m(yb.port,0,0);for(a=0;5>a;a++){var c=Ma(129,a+4),b=a,c=ya(c),d={Ca:0,fa:!1};c.seek(0,c.set);var e=c.length,g=C(c),k=void 0;if(g&2147483648){g&=2147483647;d.fa=!0;c.seek(g,c.set);d.M=B(c);for(var e=Array(16),
k=Array(16),h=0;15>h;h++)e[h]=B(c);for(h=0;16>h;h++)k[h]=A(c);d.ka=Array(d.M);d.ga=Array(d.M);for(var f=0,l=void 0,h=0;h<d.M;h++){if(0==(h&63)){c.seek(g+6*(h>>6)+48,c.set);var n=vb(c),l=vb(c),f=n&7;c.seek(g+(n>>3),c.set)}d.ka[h]=l;n=C(c)>>>16-f&65535;c.seek(-4,c.j);var r;for(r=0;16>r&&!(e[r]>n);r++);n=k[r];f+=n&15;f&16&&(f&=15,c.seek(2,c.j));n>>=4;r=0;n&&(r=wb(c),n--,r=0==n?0:r>>>32-n-f,r&=(1<<n)-1,r|=1<<n,f+=n,f&16&&(f&=15,c.seek(2,c.j)),l+=r);d.ga[h]=r}k=g-4}else k=e-=4,d.va=g,d.M=e/g|0;c.seek(4,
c.set);d.data=z(c,k);zb[b]=d}a=s("GNRL",128);Ab=B(a);Bb=B(a);Cb=B(a);Db=B(a);Eb=B(a);B(a);F={};F.top=B(a);F.left=B(a);F.height=B(a);F.width=B(a);F.za=B(a);F.ya=B(a);F.Q=0;B(a);B(a);Fb=Array(Db);for(b=0;b<Db;b++)Fb[b]=A(a);Gb=Array(Db);for(b=0;b<Db;b++)Gb[b]=B(a);Hb=Array(Db);for(b=0;b<Db;b++)Hb[b]=A(a);ia=Array(Cb);for(b=0;b<Cb;b++)ia[b]=A(a);Jb=Array(Cb);for(b=0;b<Cb;b++)Jb[b]=A(a);Mb=[];Nb();H=[];I=[];Ob=[];Pb=[];J=Array(2*Ab);b=s("GNRL",131);if(void 0!=b){c={};c.length=B(b);B(b);c.ia=Array(c.length);
for(a=0;a<c.length-1;a++)c.ia[a]=B(b);c.ha=Array(c.length);for(a=0;a<c.length;a++)c.ha[a]=A(b);c.oa=Array(c.length);for(a=0;a<c.length;a++)c.oa[a]=A(b);void 0!=c&&(Qb=c,Rb=!1)}da=nb(s("WIND",128));da.kind=9;da.addClass("commands");for(a=0;a<Cb;a++)Jb[a]&&da.add(fa(s("CNTL",129+a)));L=nb(s("WIND",129));L.kind=10;Sb=nb(s("WIND",130));Sb.kind=11;M=$(document.createElement("div"));M.addClass("textEdit");a=Sb;b=M;c=a.port.attr("width");d=a.port.attr("height");a.port.remove();b.css("top","0px");b.css("left",
"0px");b.css("width",c+"px");b.css("height",d+"px");a.port=b;a.e.append(b);Sb.B=!0;Tb(Sb);Ub=nb(s("WIND",131));Ub.kind=12;Ub.a={id:0,x:0,y:0,children:[{id:1,top:0,left:0,width:0,height:0}]};N=nb(s("WIND",132));N.kind=13;N.addClass("exits");Pa=$(document.createElement("div"));Pa.addClass("menubar");for(a=128;133>=a;a++)Na(s("MENU",a));D=E[0];Qa("More Games...",2305,"");D=E[0];Qa("Adjust Volume...",2304,"");D=E[0];Qa("Help",2307,"");var t;try{t="localStorage"in window&&null!==window.localStorage}catch(x){t=
!1}t?(Vb(33026),Vb(33027),Vb(33028)):(Wb(33026),Wb(33027),Wb(33028));tb?Vb(2304):Wb(2304);ob(Sb,Ma(128,1));if(1<gameparts.length)Xb=gameparts[1],t=window.JSON.parse(window.localStorage.getItem(Xb).toString()),Yb=t.gamedata,Zb=t.globals,M.html(t.text),ob(Sb,Xb);else{t=ya(Ia(133));Yb=Array(Eb);Zb=Array(Bb);for(a=0;a<Eb;a++)for(Yb[a]=Array(Ab),b=0;b<Ab;b++)Yb[a][b]=B(t);for(a=0;a<Bb;a++)Zb[a]=B(t)}$b();""==Xb&&(O=!0,u=1,P.push(v(1,0)));setTimeout(ac,500)}else setTimeout(xb,10)}
function $b(){for(var a,b,c=0;c<2*Ab;c++)J[c]=0;for(c=Ab-1;c;c--)a=Yb[0][c],(b=J[2*a])&&(J[2*c+1]=b),J[2*a]=c}function bc(){for(var a=[],b=0;b<Q.length;b++)10!=Q[b].kind&&14!=Q[b].kind||a.push(Q[b]);for(b in a)cc(a[b]);F.Q=0;I=[];Ob=[];Pb=[];Mb=[]}var J;function ac(){dc(yb);delete yb;desktop.append(Pa);da.show();Ub.show();R(Ub);N.show();Sb.show();L.show();G=1;ec=M.get(0).scrollHeight;M.scrollTop(ec-ec%15);fc(v(1,0),6,1);gc=!1;S()};var G=0,gc=!1,ec=0,H,P,u=void 0,O=!1,hc,ic,ia,Jb,Mb,I,Ob,Pb,yb,jc,L,da,Sb,Ub,N,M,Ab,Bb,Cb,Db,Eb,Hb,Gb,Fb,F,Yb,Zb,kc,T,U,Xb="";function lc(){}var mc=!1,nc=!1,oc=!1,q=!1,V=void 0;function S(){if(4==G)window.location="index.html";else{mc||pc(!1);if(O||mc){mc=!1;if(qc()){q=mc=!0;return}q=!1;if(pc(!0))return;rc()}2!=G&&3!=G||sc();tc()}}
function qc(){if(nc)return nc=!1,uc(!1)?nc=!0:!1;if(oc){oc=!1;if(uc(!1))return oc=!0;if(pc(!0))return!0}for(;P.length;){var a=P.shift();if((0==G||1==G)&&vc(a)){if(wc(u,a))return oc=!0;if(pc(!0))return!0}}if(1==u)gc=!1;else if((0==G||1==G)&&wc(3,u))return nc=!0;return!1}
function vc(a){if(!xc(a)||2<=ha()&&0<T&&!xc(T))return!1;if(5!=u)return!0;if(0!=v(a,3)||0!=v(a,4)||0!=v(a,5))return!1;if(v(1,0)!=T)return!0;var b={top:0,left:0,width:L.port.width(),height:L.port.height()};b.top-=1*v(a,2)+1*U.d;b.left-=1*v(a,1)+1*U.c;return ja(a,b)}function xc(a){for(var b=v(1,0);0!=a&&1!=a&&a!=b;)a=v(a,0);return a}function pc(a){yc();var b=zc();Ac(a)&&(b=!0);return b}
function sc(){if(2==G){Bc();var a=Ha();jc=nb(s("WIND",133));jc.show();a.m(jc.port,0,0);Cc();G=4}else if(3==G){rc();var b=hb(s("ALRT",134));b.show(function(a){dc(b);switch(a){case 1:Dc();break;case 3:G=4;S();break;case 4:Ec()}})}}
function Cc(){var a=document.createElement("link");a.type="text/css";a.rel="stylesheet";a.href="print.css";a.media="print";$("head").append(a);a=pb(s("DLOG",135));q=!0;var b=mb();jc.add(b);b.b.focus();a.show(function(a){switch(a){case 1:b.b.blur();window.print();break;case 2:S()}})}
function yc(){for(;I.length;){for(var a,b=0,c=0;c<I.length;c++)I[c].id>b&&(b=I[c].id,a=c);b=I.splice(a,1)[0];switch(b.id){case 2:Fc(b.val);break;case 3:Gc(b.val);break;case 4:Hc(b.val);break;case 7:a:{var c=b.val,d=!1,b=c.b,e=Mb.indexOf(b);-1!=e&&Mb.splice(e,1);if(1==b)c.parent!=v(b,0)&&I.push({id:12}),c.ja==v(b,3)&&c.ea==v(b,4)||R(na(b));else if(c.parent!=v(b,0)||c.x!=1*v(b,1)||c.y!=1*v(b,2)){if(e=Ic(c.parent))d=e,void 0!=d.a&&(e=oa(d.a.children,b),0!=e&&(d.a.children.splice(e-1,1),d.a.s=!0,R(d))),
d=!0;if(e=na(b)){d=e;if(void 0!=d.a){e=void 0;for(e=0;e<d.a.children.length&&b>d.a.children[e].id;e++);if(e==d.a.children.length||b!=d.a.children[e].id)d.a.children.splice(e,0,{id:b,top:0,left:0,width:0,height:0}),d.a.s=!0,R(d)}d=!0}}else c.ja==v(b,3)&&c.ea==v(b,4)||R(na(b));v(b,8)&&(d||c.hidden!=v(b,11)||c.ta!=v(b,9)||c.ua!=v(b,10))&&Jc(b);c=Ic(b);d=b;for(e=v(1,0);d!=e&&0!=d&&v(d,6);)d=v(d,0);if(d==e){if(c)break a;I.push({id:3,val:b})}else{if(!c)break a;I.push({id:4,val:b})}b=Kc(b,!0);for(e=0;e<
b.length;e++)Lc(b[e])}break;case 8:b=b.val;d=Ic(b.P);(c=e=Ic(b.O))||(c=d);c&&(d=W(b.O),ob(c,d),Mc(b.O,c),c.a.s=!0,R(c));break;case 12:fc(L.a.id,6,0);fc(v(1,0),6,1);break;case 13:for(;H.length;)Nc(H.pop());break;case 14:Oc(b.val)}}}function Fc(a){a&&(a=Ic(a))&&Pc(a)}
function Gc(a){if(!Ic(a))if(a==v(1,0)){Mc(a,L);R(L);Qc();var b=W(a);ob(L,b.substr(0,1).toUpperCase()+b.substr(1))}else{var c={c:1*v(a,1),d:1*v(a,2)};Rc(na(a),c);Sc(c);var b=W(a),d=kb();ob(d,b);Mc(a,d);d.a.s=!0;var e=$(document.createElement("div"));e.addClass("zoom");desktop.append(e);e.css("top",c.d+"px");e.css("left",c.c+"px");e.css("width","0px");e.css("height","0px");e.animate({top:d.top+"px",left:d.left+"px",width:d.width+"px",height:d.height+"px"},500,"swing",function(){e.remove();d.show();
R(d)})}}function Hc(a){var b=cc(Ic(a));if(void 0!=b&&(a=na(b.b),void 0!=a)){var c=$(document.createElement("div"));c.addClass("zoom");desktop.append(c);c.css("top",b.top+"px");c.css("left",b.left+"px");c.css("width",b.width+"px");c.css("height",b.height+"px");b={c:1*v(b.b,1),d:1*v(b.b,2)};Rc(a,b);Sc(b);c.animate({top:b.d+"px",left:b.c+"px",width:"0px",height:"0px"},500,"swing",function(){c.remove();F.Q--})}}
function Nc(a){var b=N.find(a);b&&(-1!=H.indexOf(a)?b.select():b.J());a==v(1,0)&&(-1!=H.indexOf(a)?N.addClass("selected"):N.removeClass("selected"));R(na(a))}function Oc(a){desktop.append(V);var b={c:1*v(a,1),d:1*v(a,2)};Rc(na(a),b);Sc(b);V.animate({top:b.d+"px",left:b.c+"px"},300,"swing",function(){V.remove()})}
function zc(){if(M.get(0).scrollHeight==M.innerHeight()){var a=M.clone();a.css("height","");a.css("visibility","hidden");$("body").append(a);ec=a.innerHeight();a.remove();delete a}for(;Pb.length;)switch(a=Pb.splice(0,1)[0],a.id){case 1:M.append(a.val);gc=!0;break;case 2:M.append("<br/>");gc=!0;break;case 3:Tc=a.val[1],Uc=a.val[0],M.append(W(a.val[2])),gc=!0}return Vc()}
function Vc(){var a=M.get(0).scrollHeight,b=M.innerHeight();M.scrollTop(ec-ec%15);ec=M.scrollTop()+b+15;Wc(Sb,{left:0,right:0,top:0,bottom:a});return ec<a?(ca(),!0):!1}function Ac(a){for(var b=0;Ob.length;){var c=Ob.splice(0,1)[0];switch(c.id){case 1:qb(c.val);break;case 2:b=qb(c.val)}}return a&&b?(setTimeout(S,1E3*b),!0):!1}
function fc(a,b,c){if(0==b){var d=c,e=Yb[0][a];if(d!=a){for(var g=2*e,e=J[g];e!=a;)g=2*e+1,e=J[g];J[g]=J[2*e+1];g=2*d;for(e=J[g];e&&e<=a;)g=2*e+1,e=J[g];J[2*a+1]=e;J[g]=a}}12>b&&Lc(a);d=Fb[b];c<<=Hb[b];c&=Gb[b];Yb[d][a]=c|Yb[d][a]&~Gb[b];gc=!0}function v(a,b){var c,d=Fb[b];if(d&128){var e=rb(0,a);if(0==e.length)return 0;d&=127;c=(e.charCodeAt(2*d)&255)<<8;c|=e.charCodeAt(2*d+1)&255}else c=Yb[d][a];c&=Gb[b];return Xc(c>>Hb[b])}
function R(a){if(void 0!=a&&void 0!=a.a&&(a==Ub||1==v(a.a.id,6))){if(a==L){var b=ka(2*a.a.id);void 0!=b&&b.m(L.port,0,0)}else sa(a.port,$a);for(b=0;b<a.a.children.length;b++){var c=pa(a.a.children[b].id,a,0);a.a.children[b].top=c.top;a.a.children[b].left=c.left;a.a.children[b].width=c.width;a.a.children[b].height=c.height}if(14==a.kind&&a.a.s){b={top:0,left:0,right:0,bottom:0};a.a.s=!1;for(c=0;c<a.a.children.length;c++){var d=a.a.children[c];b.right==b.left||b.bottom==b.top?(b.top=d.top,b.left=d.left,
b.bottom=d.top+d.height,b.right=d.left+d.width):(b.top=Math.min(b.top,d.top),b.left=Math.min(b.left,d.left),b.bottom=Math.max(b.bottom,d.top+d.height),b.right=Math.max(b.right,d.left+d.width))}b.right==b.left||b.bottom==b.top?(b.top=a.a.y,b.left=a.a.x,b.bottom=a.a.y,b.right=a.a.x):(b.left>a.a.x&&(b.left=a.a.x),b.right<a.a.x&&(b.right=a.a.x),b.top>a.a.y&&(b.top=a.a.y),b.bottom<a.a.y&&(b.bottom=a.a.y));Wc(a,b)}}}function Yc(a){a=da.find(a);a!=kc&&(kc&&kc.J(),(kc=a)&&a.select())}
function Zc(a){var b=X[0].C;Uc=X[0].target;Tc=b;var c=pb(s("DLOG",132));c.param([W(a)]);c.getItem(3).b.keypress(function(a){return 13==a.which?(c.getItem(1).b.mousedown(),!1):!0});c.show(function(a){$c=c.getItem(3).b.val();1==a?X[0].state.push(65535):X[0].state.push(0);dc(c);S()})}
function ad(a){switch(a){case 256:bd();break;case 32768:bd();break;case 33024:cd();break;case 33026:dd();break;case 33027:lc=function(){};ed();break;case 33028:lc=function(){};fd();break;case 33030:gd();break;case 2304:hd();break;case 2305:window.cefQuery({request:"moregames"});break;case 2306:G=2;S();break;case 2307:window.open(helpURL);break;case 33280:break;case 33282:break;case 33283:break;case 33284:break;case 33285:break;case 33536:id();break;case 33537:jd();break;default:fatal("Unknown menuitem: "+
a.toString(16))}}window.menuSelect=ad;function kd(a,b){var c=a.e;if(2==c.kind)c.sa(a.o);else if(c==N)q||ld(a.o,N,b,!1);else if(255==a.o)da.remove(ba),md(da),delete ba,Vc()||S();else if(!q){kc&&a!=kc&&kc.J();u=a.o;Yc(u);switch(ha()){case 0:O=!0;break;case 1:O=0!=P.length;break;case 2:0<T&&(O=!0)}S()}}
function ld(a,b,c,d){b==N&&(b=L);if(c.shiftKey)if(a)-1!=P.indexOf(a)?nd(a):od(a),S();else if(14==b.kind)pd(b,c,d);else{if(0==P.length||b!=na(P[0]))-1!=P.indexOf(b.a.id)?nd(b.a.id):od(b.a.id);S()}else if(u&&P.length&&1<ha())a?qd(a):qd(b.a.id),S();else if(a||(rd(),14==b.kind?pd(b,c,d):a=b.a.id),a){var e;300>=c.timeStamp-hc&&c.target==ic?(hc=0,ic=void 0,e=!0):e=!1;e?(-1==P.indexOf(a)&&rd(),od(a),sd(a,b,c,d)):(-1==P.indexOf(a)&&rd(),od(a),td(a,b,c,d))}}
function pd(a,b,c){var d,e,g,k,h={c:a.a.x,d:a.a.y};Rc(a,h);Sc(h);d=h.c;e=h.d;g=h.c+a.port.width();k=h.d+a.port.height();var f=$(document.createElement("div"));f.addClass("lasso");desktop.append(f);var l={c:Math.floor(b.pageX/pageZoom),d:Math.floor(b.pageY/pageZoom)};Sc(l);f.css("top",l.d+"px");f.css("left",l.c+"px");f.css("width","0px");f.css("height","0px");$(document).mousemove(function(a){var b={c:Math.floor(a.pageX/pageZoom),d:Math.floor(a.pageY/pageZoom)};Sc(b);a=Math.max(Math.min(l.c,b.c),d);
var c=Math.max(Math.min(l.d,b.d),e),h=Math.min(Math.max(l.c,b.c),g),b=Math.min(Math.max(l.d,b.d),k);f.css("top",c+"px");f.css("left",a+"px");f.css("width",h-a+"px");f.css("height",b-c+"px")});$(document).mouseup(function(h){$(document).unbind("mousemove");$(document).unbind("mouseup");h={c:Math.floor(h.pageX/pageZoom),d:Math.floor(h.pageY/pageZoom)};Sc(h);var r=Math.max(Math.min(l.c,h.c),d),t=Math.max(Math.min(l.d,h.d),e),x=Math.min(Math.max(l.c,h.c),g),Ib=Math.min(Math.max(l.d,h.d),k);f.remove();
h={c:r,d:t};var cb=desktop.offset();h.d+=cb.top;h.c+=cb.left;ud(a,h);t={top:h.d,left:h.c,width:x-r,height:Ib-t};r=[];for(x=0;x<a.a.children.length;x++){var K=a.a.children[x].id;v(K,4)||(t.left=h.c-1*v(K,1),t.top=h.d-1*v(K,2),ja(K,t)&&r.push(K))}if(b.shiftKey){if(0==r.length){if(0==P.length||a!=na(P[0]))-1!=P.indexOf(a.a.id)?nd(a.a.id):od(a.a.id)}else for(;r.length;)K=r.shift(),-1!=P.indexOf(K)?nd(K):od(K);S()}else{if(0==r.length)K=a.a.id;else for(;r.length;)K=r.shift(),od(K);ld(K,a,b,c)}})}
function sd(a,b,c,d){var e=Math.floor(c.pageX/pageZoom),g=Math.floor(c.pageY/pageZoom),k={c:0,d:0},h=!1;V=void 0;d&&$(document).mousemove(function(c){if(void 0==V){if(7>=Math.abs(Math.floor(c.pageX/pageZoom)-e)+Math.abs(Math.floor(c.pageY/pageZoom)-g))return!1;h=!0;V=qa(a);var d=oa(b.a.children,a);d&&(d--,k.c=b.a.children[d].left,k.d=b.a.children[d].top);Rc(b,k);Sc(k);V.css("top",k.d+"px");V.css("left",k.c+"px")}d=V.position();V.css("top",d.top+(Math.floor(c.pageY/pageZoom)-g)+"px");V.css("left",
d.left+(Math.floor(c.pageX/pageZoom)-e)+"px");e=Math.floor(c.pageX/pageZoom);g=Math.floor(c.pageY/pageZoom);return!1});$(document).mouseup(function(c){var e;d&&($(document).unbind("mousemove"),V&&(e=V.position(),V.remove()));$(document).unbind("mouseup");h&&(U.c=e.left,U.d=e.top,c=vd(Math.floor(c.pageX/pageZoom),Math.floor(c.pageY/pageZoom)),T=c.id,U.c-=k.c,U.d-=k.d,c.e!=b&&(Rc(b,U),c.e&&ud(c.e,U)),U.c=Math.round(U.c/1),U.d=Math.round(U.d/1),u=5,Yc(5),O=!0);O||(qd(a),u||(u=4,Yc(4),O=!0));S()})}
function td(a,b,c,d){var e=Math.floor(c.pageX/pageZoom),g=Math.floor(c.pageY/pageZoom),k={c:0,d:0},h=!1;V=void 0;d&&$(document).mousemove(function(c){if(void 0==V){if(7>=Math.abs(Math.floor(c.pageX/pageZoom)-e)+Math.abs(Math.floor(c.pageY/pageZoom)-g))return!1;h=!0;V=qa(a);var d=oa(b.a.children,a);d&&(d--,k.c=b.a.children[d].left,k.d=b.a.children[d].top);Rc(b,k);Sc(k);V.css("top",k.d+"px");V.css("left",k.c+"px")}d=V.position();V.css("top",d.top+(Math.floor(c.pageY/pageZoom)-g)+"px");V.css("left",
d.left+(Math.floor(c.pageX/pageZoom)-e)+"px");e=Math.floor(c.pageX/pageZoom);g=Math.floor(c.pageY/pageZoom);return!1});$(document).mouseup(function(a){hc=a.timeStamp;ic=a.target;var c;d&&($(document).unbind("mousemove"),V&&(c=V.position(),V.remove()));$(document).unbind("mouseup");h&&(U.c=c.left,U.d=c.top,a=vd(Math.floor(a.pageX/pageZoom),Math.floor(a.pageY/pageZoom)),T=a.id,U.c-=k.c,U.d-=k.d,a.e!=b&&(Rc(b,U),a.e&&ud(a.e,U)),U.c=Math.round(U.c/1),U.d=Math.round(U.d/1),u=5,Yc(5),O=!0);1==ha()&&(O=
!0);S()})}function rd(){for(;P.length;)nd(P.shift())}function od(a){P.length&&na(a)!=na(P[0])&&rd();-1==P.indexOf(a)&&P.push(a);-1==H.indexOf(a)&&(H.push(a),Nc(a))}function nd(a){var b=P.indexOf(a);-1!=b&&P.splice(b,1);-1!=(b=H.indexOf(a))&&(H.splice(b,1),Nc(a))}function qd(a){if(a!=T){var b;0<T&&-1!=(b=H.indexOf(T))&&-1==P.indexOf(T)&&(H.splice(b,1),Nc(T));T=a;-1==H.indexOf(T)&&(H.push(T),Nc(T));O=!0}}
function pa(a,b,c){var d=1*v(a,1),e=1*v(a,2),g=v(a,3);if(c||!g||!v(a,4)){var k=1;g||c?k=0:-1!=H.indexOf(a)&&(k=2);c=d-b.a.x;var e=e-b.a.y,d=b.port,g={top:0,left:0,width:0,height:0},h;if(h=ka(2*a+1))switch(g={top:e,left:c,width:h.width,height:h.height},k){case 1:ra(h,d,c,e);break;case 2:var f=h,l=c,n=e;if(0!=f.width&&0!=f.height){var r=d.get(0).getContext("2d"),t=f.width,x=f.height,Ib=0,cb=0;0>l&&(Ib=-l,l=0);0>n&&(cb=-n,n=0);t+l>=d.width()&&(t=d.width()-l);x+n>=d.height()&&(x=d.height()-n);if(0!=t&&
0!=x){for(var K=r.getImageData(l,n,t,x),Kb=cb;Kb<x;Kb++)for(var ke=Kb*f.q,db=(Kb-cb)*K.width*4,le,Lb=Ib;Lb<t;Lb++)(le=f.data[ke+(Lb>>3)]&1<<7-(Lb&7))?(K.data[db++]=0,K.data[db++]=0,K.data[db++]=0,K.data[db++]=255):db+=4;r.putImageData(K,l,n)}}}else if(h=ka(2*a))switch(g={top:e,left:c,width:h.width,height:h.height},k){case 1:Fa(d,c,e,h.width,h.height,0);break;case 2:Fa(d,c,e,h.width,h.height,1)}0<k&&(h=ka(2*a))&&ta(h,d,c,e);a=g;a.top+=b.a.y;a.left+=b.a.x;return a}return{top:0,left:0,width:0,height:0}}
function Qc(){for(var a=N,b=0;b<a.i.length;b++)a.i[b].b.remove();a.i=[];a=Kc(v(1,0),!0);for(b=0;b<a.length;b++)Jc(a[b])}function Jc(a){if(v(a,8)){var b=N.find(a);b&&N.remove(b);v(a,11)||v(a,0)!=v(1,0)||N.add(ea(v(a,9),v(a,10),a))}}function bd(){var a=bb();q=!0;a.show(function(){dc(a);q=!1})}
function hd(){var a=fb(),b=wd();null==b&&(b=50);xd(a.getItem(2),b);q=!0;a.show(function(){var b=a.getItem(2).value,d=new Date;d.setTime(d.getTime()+31536E6);document.cookie="webventure_volume="+escape(b)+"; expires="+d.toGMTString()+"; path=/";dc(a);q=!1})}function cd(){if(gc){var a=gb(0);q=!0;a.show(function(b){dc(a);switch(b){case 1:lc=cd;ed();break;case 3:Dc();break;case 2:q=!1}})}else Dc()}
function Dc(){Xb="";for(var a=ya(Ia(133)),b=0;b<Eb;b++)for(var c=0;c<Ab;c++)Yb[b][c]=B(a);for(b=0;b<Bb;b++)Zb[b]=B(a);bc();$b();ob(Sb,Ma(128,1));M.html("");u=1;P=[v(1,0)];G=1;fc(v(1,0),6,1);oc=nc=mc=gc=!1;X=[];O=!0;S()}function dd(){if(gc){var a=gb(1);q=!0;a.show(function(b){dc(a);switch(b){case 1:lc=dd;ed();break;case 3:Ec();break;case 2:q=!1}})}else Ec()}
function Ec(){var a=ib();q=!0;for(var b=a.getItem(3),c=void 0,d=0;d<window.localStorage.length;d++){var e=window.localStorage.key(d);if(null!=e&&window.JSON.parse(window.localStorage.getItem(e).toString()).game==gamename){var g=$(document.createElement("div"));g.addClass("listitem");g.mousedown(function(){return!1});g.click(function(a){c&&c.removeClass("active");c=$(a.target);c.addClass("active")});g.dblclick(function(){a.getItem(1).b.mousedown()});g.text(e.toString());b.b.append(g)}}a.show(function(b){switch(b){case 1:if(void 0==
c)break;Xb=c.text();dc(a);q=!1;b=window.JSON.parse(window.localStorage.getItem(Xb).toString());Yb=b.gamedata;Zb=b.globals;bc();$b();ob(Sb,Xb);M.html(b.text);ec=M.get(0).scrollHeight;M.scrollTop(ec);G=1;oc=nc=mc=!1;P=[];u=0;X=[];fc(v(1,0),6,1);gc=!1;S();break;case 2:dc(a),q=!1}})}function ed(){""==Xb?fd():(window.localStorage.setItem(Xb,window.JSON.stringify({game:gamename,gamedata:Yb,globals:Zb,text:M.html()})),ob(Sb,Xb),gc=!1,lc())}
function fd(){var a=jb();q=!0;a.getItem(3).b.keypress(function(b){return 13==b.which?(a.getItem(1).b.mousedown(),!1):!0});for(var b=a.getItem(4),c=void 0,d=0;d<window.localStorage.length;d++){var e=window.localStorage.key(d);if(null!=e&&window.JSON.parse(window.localStorage.getItem(e).toString()).game==gamename){var g=$(document.createElement("div"));g.addClass("listitem");g.mousedown(function(){return!1});g.click(function(b){c&&c.removeClass("active");c=$(b.target);c.addClass("active");a.getItem(3).b.val(c.text())});
g.dblclick(function(){a.getItem(1).b.mousedown()});g.text(e.toString());b.b.append(g)}}a.show(function(b){switch(b){case 1:Xb=a.getItem(3).b.val();dc(a);q=!1;ed();break;case 2:dc(a),q=!1,lc()}})}function gd(){if(gc){var a=gb(2);q=!0;a.show(function(b){dc(a);switch(b){case 1:lc=gd;ed();break;case 3:G=4;S();break;case 2:q=!1}})}else G=4,S()}
function wd(){for(var a=document.cookie.split(";"),b=0;b<a.length;b++){for(var c=a[b];" "==c.charAt(0);)c=c.substring(1,c.length);if(0==c.indexOf("webventure_volume="))return unescape(c.substring(18,c.length))}return null}function Nb(){u=0;kc=void 0;P=[];T=0;U={c:0,d:0};$c="";O=!1;hc=0}function Lc(a){if(-1==Mb.indexOf(a)){Mb.push(a);var b={b:a};b.parent=v(a,0);b.x=1*v(a,1);b.y=1*v(a,2);b.ta=v(a,9);b.ua=v(a,10);b.hidden=v(a,11);b.ja=v(a,3);b.ea=v(a,4);I.push({id:7,val:b})}}
function yd(a){a&128&&(a=-((a^255)+1));return a}function Xc(a){a&32768&&(a=-((a^65535)+1));return a}function Ic(a){switch(a){case 65532:return N;case 65533:return Ub;case 65534:return Sb;case 65535:return da}a:{for(var b=0;b<Q.length;b++)if((10==Q[b].kind||14==Q[b].kind)&&void 0!=Q[b].a&&Q[b].a.id==a){a=Q[b];break a}a=void 0}return a}function Kc(a,b){for(var c=[],d=J[2*a];d;)c.push(d),b||(c=c.concat(Kc(d,!1))),d=J[2*d+1];return c}
function oa(a,b){var c;for(c=0;c<a.length&&a[c].id!=b;c++);return c==a.length?0:c+1}function na(a){return 1==a?Ub:(a=v(a,0))?Ic(a):void 0}function Mc(a,b){var c=Kc(a,!0);b.a={id:a,x:0,y:0,s:!1,children:[]};for(var d=32767,e=32767,g=0;g<c.length;g++)if(1!=c[g]){var k={id:c[g],top:0,left:0,width:0,height:0};if(b!=L){var h=1*v(c[g],1),f=1*v(c[g],2);d>h&&(d=h);e>f&&(e=f)}b.a.children.push(k)}32767!=d&&(b.a.x=d);32767!=e&&(b.a.y=e);b!=L&&(b.a.s=!0)}
function rc(){for(void 0!=kc&&kc.J();H.length;)Nc(H.pop());Nb()}
function vd(a,b){var c;a:if(c=desktop.offset(),b>=c.top&&b<c.top+19&&a>=c.left&&a<c.left+desktop.width())c={id:1,e:void 0};else{for(c=0;c<Q.length;c++){var d=Q[c].W(a,b);if(void 0!=d){c=d;break a}}c={id:0,e:void 0}}d=0;void 0!=c.e&&(d=c.e.kind);if(3!=c.id||14!=d&&10!=d)switch(d){case 9:c.id=-1;break;case 11:c.id=-2;break;case 12:c.id=-3;break;case 13:c.id=-4;break;default:switch(c.id){case 0:c.id=-5;break;case 1:c.id=-6;break;case 2:c.id=-7;break;case 3:c.id=-8;break;case 4:c.id=-9;break;case 5:c.id=
-10;break;case 6:c.id=-11;break;default:c.id=-12}}else c.id=c.e.a.id;return c}function Sc(a){var b=desktop.offset();a.d-=b.top;a.c-=b.left}function tc(){14==Q[0].kind?(Vb(33536),Vb(33537)):(Wb(33536),Wb(33537));Wb(33280);Wb(33282);Wb(33283);Wb(33284);Wb(33285)}function zd(){return{width:8,items:[]}}function Ad(a,b,c){a.width+=8+c[b].width;a.items.push(b)}function Bd(a,b,c){var d=a.items[b];a.width-=8+c[d].width;a.items.splice(b,1);return d}
function Cd(a,b,c,d){for(var e=b?32767:-32768,g=!0,k=-1,h=0;h<a.items.length;h++){var f=a.items[h],l=c[f].top+c[f].height>d.top+d.height||c[f].top>d.top;b&&(l=!l);g&&l&&(g=!1,e=b?32767:-32768);if(g||l)if(f=c[f].width/2|0,l=!1,l=b?e>=f:e<=f)k=h,e=f}return Bd(a,k,c)}
function id(){var a=Q[0],b={};b.top=a.a.y;b.left=a.a.x;b.width=a.port.width();b.height=a.port.height();for(var c=a.a.children,d=[],e=zd(),g=zd(),k=zd(),h=zd(),f=c.length-1;0<=f;f--){var l=c[f];l.top+l.height>b.top+b.height||l.top<b.top?Ad(g,f,c):16+l.width>b.width?Ad(g,f,c):Ad(e,f,c)}for(var n=b.top+8;e.items.length||g.items.length;){for(var r=32767,t=-1,x=0,f=e.items.length-1;0<=f;f--)l=e.items[f],c[l].top<r&&(r=c[l].top,x=c[l].height,t=f);if(-1!=t){Ad(k,Bd(e,t,c),c);do for(t=!0,f=e.items.length-
1;0<=f;f--)l=e.items[f],c[l].top<r+x&&(x<c[l].height&&(t=!1,x=c[l].height),Ad(k,Bd(e,f,c),c));while(!t)}for(;k.items.length&&k.width>b.width;)Ad(e,Cd(k,!1,c,b),c);x=0;for(f=k.items.length-1;0<=f;f--)l=k.items[f],x<c[l].height&&(x=c[l].height);for(;g.items.length&&k.width<b.width;)f=Cd(g,!0,c,b),e.items.length&&c[f].height>x?Ad(h,f,c):k.width+8+c[f].width<=b.width?(x<c[f].height&&(x=c[f].height),Ad(k,f,c)):Ad(h,f,c);for(;h.items.length;)Ad(g,Bd(h,0,c),c);!k.items.length&&g.items.length&&(f=Bd(g,0,
c),x<c[f].height&&(x=c[f].height),Ad(k,f,c));for(l=b.left+8;k.items.length;)f=Cd(k,!0,c,b),d.push({id:c[f].id,left:l,top:n+(x-c[f].height)/2|0}),l+=c[f].width+8;n+=x+8}Dd(d,a)}function jd(){var a=Q[0],b,c,d,e;b=a.a.y;c=a.a.x;d=a.port.width();e=a.port.height();for(var g=a.a.children,k=[],h=0;h<g.length;h++){var f=e-g[h].height;0>f&&(f=0);var l=(Math.random()*f|0)+b,f=d-g[h].width;0>f&&(f=0);k.push({id:g[h].id,left:(Math.random()*f|0)+c,top:l})}Dd(k,a)}
function Dd(a,b){for(var c=0;c<a.length;c++){var d=ma(a[c].id);if(d.top!=a[c].top||d.left!=a[c].left)fc(a[c].id,1,Math.round(a[c].left/1)),fc(a[c].id,2,Math.round(a[c].top/1))}b.a.s=!0;R(b)};function ka(a){a=rb(3,a);return 2>a.length?void 0:2==a.length?ka((a.charCodeAt(0)&255)<<8|a.charCodeAt(1)&255):Ka(new xa(a))}function sa(a,b){0!=a.width()&&Fa(a,0,0,a.width(),a.height(),b)}function la(a,b,c){var d=b.top,e=b.left,g=e+b.width;b=d+b.height;d<a.top&&(d=a.top);e<a.left&&(e=a.left);b>a.top+a.height&&(b=a.top+a.height);g>a.left+a.width&&(g=a.left+a.width);if(g<=e||b<=d)d=b=e=g=0;c.top=d;c.left=e;c.width=g-e;c.height=b-d;return 0!=c.height}
function Ka(a){var b=a.f(3),c,d;Da&&a.f(2);d=a.f(1)?a.f(10):a.f(6);if((c=a.f(1)?a.f(10):a.f(6))&&d){c=new Ea(c,d,c+15>>3&65534);switch(b){case 0:b=c.H>>4;d=c.H&15;for(var e,g=0,k=0;k<c.G;k++){for(var h=0;h<b;h++)e=wb(a),a.seek(2,a.j),e>>>=16-a.l,c.data[g++]=e>>8&255,c.data[g++]=e&255;d&&(e=a.f(d),e<<=16-d,c.data[g++]=e>>8&255,c.data[g++]=e&255)}break;case 1:Ed(Fd,Gd,Hd,c,a);break;case 2:Ed(Id,Jd,Kd,c,a);break;case 3:b=Array(17);for(g=0;255!=(d=Ld[g++]);){for(e=a.f(d);255!=(d=Ld[g++]);)b[Ld[g++]]=
e%d,e=e/d|0;b[Ld[g++]]=e}b[16]=0;for(e=16;0<e;e--)for(d=e;16>=d;d++)b[d]>=b[e-1]&&b[d]++;for(e=16;0<=e;e--)if(16==b[e]){b[e]=255;break}g=Array(17);k=Array(17);d=a.f(2)+1;for(e=h=0;15>e;e++){if(e)for(;!a.f(1);)d++;k[e]=d;g[e]=h;h+=1<<16-d}for(g[15]=h;h&1<<16-d;)d++;g[16]=h|1<<16-d;k[15]=d;k[16]=d;Ed(g,k,b,c,a)}return c}}
var Fd=[0,8192,16384,20480,24576,28672,32768,36864,40960,45056,49152,53248,55296,57344,59392,61440,63488],Gd=[3,3,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5],Hd=[0,15,3,5,6,7,8,9,10,12,255,1,2,4,11,13,14],Id=[0,16384,32768,49152,51200,53248,55296,57344,59392,61440,62464,62976,63488,64E3,64512,65024,65280],Jd=[2,2,2,5,5,5,5,5,5,6,7,7,7,7,7,8,8],Kd=[255,0,15,1,3,7,14,12,8,6,2,4,9,13,11,10,5],Ld=[8,15,2,255,0,4,255,1,7,9,8,255,3,4,255,4,10,7,10,11,6,255,5,6,6,11,255,7,3,255,9,4,3,14,255,12,2,255,13,1,255,15,255];
function Ed(a,b,c,d,e){var g;Y=Z=0;g=d.H&3?e.f(5):e.f(4)<<1;var k=0,h=d.H&15;h&&(h>>=2,k=h&1,h=2-(h>>1));for(var f=0,l=0;l<d.G;l++){for(var n=0;n<d.H>>3;n++){var r=Md(a,b,c,e)<<4;d.data[f++]=Md(a,b,c,e)|r}k&&(d.data[f]=Md(a,b,c,e)<<4);f+=h}if(n=d.H&3)for(var f=d.q-h,t=0,l=h=0;l<d.G;l++)g&1?(t<n&&(r=Md(a,b,c,e)<<4,h|=r>>>t,t+=4),t-=n,r=h,h<<=n,h&=255):(r=e.f(n),r<<=8-n),k&&(r>>>=4),d.data[f]|=r&255,f+=d.q;if(g&8)for(l=f=0;l<d.G;l++)if(r=0,g&2)for(n=0;n<d.q;n++)d.data[f]^=r,r=d.data[f++];else for(n=
0;n<d.q;n++)h=d.data[f]^r,h^=h>>>4&15,d.data[f++]=h,r=h<<4&255;if(g&4)for(a=4*d.q,g&2&&(a*=2),f=0,g=a,b=0;b<d.G*d.q-a;b++)d.data[g++]^=d.data[f++]}var Z=0,Y=0;function Md(a,b,c,d){if(Z)return Z--,Y=Y<<8&65280|Y>>8,Y&255;var e=wb(d),e=e>>>16-d.l,e=e&65535,g;for(g=0;16>g&&!(a[g+1]>e);g++);d.l+=b[g];d.l&16&&(d.l&=15,d.seek(2,d.j));a=c[g];if(255==a)return d.f(1)||(Y&=255,Y|=Y<<8),Z=d.f(3),3>Z&&(Z<<=4,Z|=d.f(4),8>Z&&(Z<<=8,Z|=d.f(8))),Z-=2,Y=Y<<8&65280|Y>>8,Y&255;Y<<=8;Y|=a;Y&=65535;return a};function Qa(a,b,c){var d={id:b},e=$(document.createElement("tr"));if("-"==a[0]){var g=$(document.createElement("td"));g.attr("colspan","2");g.addClass("divider");g.append(document.createElement("hr"))}else e.addClass("menuitem"),g=$(document.createElement("td")),g.html(ga(a)),e.append(g),g=$(document.createElement("td")),""!=c&&(g.addClass("shortcut"),Nd.push({key:c,id:b}),g.text(c));e.append(g);d.b=e;d.enabled=!0;d.enabled||d.b.addClass("disabled");D.body.append(d.b);D.items.push(d)}
function Od(a){for(var b=0;b<E.length;b++)for(var c=0;c<E[b].items.length;c++)if(E[b].items[c].id==a)return E[b].items[c]}function Vb(a){if(a=Od(a))a.enabled=!0,a.b.removeClass("disabled")}function Wb(a){if(a=Od(a))a.enabled=!1,a.b.addClass("disabled")}
function Oa(a){for(var b=$(a.target);void 0==b.data("refCon");)b=b.parent();b.addClass("active");var c=b.data("refCon");desktop.append(c.p);a=b.position();c.p.css("top",a.top+19+"px");c.p.css("left",a.left+"px");var d=-1;$(document).mousemove(function(a){var g=Pa.offset();if(Math.floor(a.pageX/pageZoom)>=g.left&&Math.floor(a.pageY/pageZoom)>g.top&&Math.floor(a.pageX/pageZoom)<g.left+Pa.width()&&Math.floor(a.pageY/pageZoom)<g.top+Pa.height()){for(var k=0;k<E.length;k++)if(g=E[k].b.offset(),Math.floor(a.pageX/
pageZoom)>=g.left&&Math.floor(a.pageX/pageZoom)<g.left+E[k].b.outerWidth()){c.p.remove();b.removeClass("active");b=E[k].b;b.addClass("active");c=b.data("refCon");desktop.append(c.p);g=b.position();c.p.css("top",g.top+19+"px");c.p.css("left",g.left+"px");break}for(k=0;k<c.items.length;k++)c.items[k].b.removeClass("active");d=-1}else if(g=c.p.offset(),Math.floor(a.pageX/pageZoom)>=g.left&&Math.floor(a.pageY/pageZoom)>=g.top&&Math.floor(a.pageX/pageZoom)<g.left+c.p.outerWidth()&&Math.floor(a.pageY/pageZoom)<
g.top+c.p.outerHeight())for(k=0;k<c.items.length;k++){var h=c.items[k].b;h.hasClass("menuitem")&&c.items[k].enabled&&(g=h.offset(),Math.floor(a.pageY/pageZoom)>=g.top&&Math.floor(a.pageY/pageZoom)<g.top+h.outerHeight()?(d=k,h.addClass("active")):h.removeClass("active"))}else{for(k=0;k<c.items.length;k++)c.items[k].b.removeClass("active");d=-1}});$(document).mouseup(function(){$(document).unbind("mousemove");$(document).unbind("mouseup");c.p.remove();b.removeClass("active");-1!=d&&(c.items[d].b.removeClass("active"),
ad(c.items[d].id))})}var Pa,E=[],Nd=[],D=void 0;$("body").keydown(function(a){if("text"==a.target.type||!a.altKey||q)return!0;for(var b=0;b<Nd.length;b++)if(Nd[b].key.charCodeAt(0)==a.which){a=Nd[b].id;for(b=0;b<E.length;b++)for(var c=0;c<E[b].items.length;c++)E[b].items[c].id==a&&E[b].items[c].enabled&&Pd(E[b],a);return!1}return!0});function Pd(a,b){a.b.addClass("active");setTimeout(function(){a.b.removeClass("active");ad(b)},200)};function Qd(a,b,c,d,e,g,k,h,f){var l=this;this.I=void 0;this.i=[];this.V=c;this.U=b;this.B=d;this.F=e;this.e=$(document.createElement("div"));this.e.addClass(a);if("document"==a||"info"==a||"noGrowDoc"==a||"zoomDoc"==a||"rDoc4"==a)b="<span></span>",this.title=$(document.createElement("div")),this.title.addClass("title"),this.title.mousedown(function(a){q||Rd(Math.floor(a.pageX/pageZoom),Math.floor(a.pageY/pageZoom),l);return!1}),this.U&&(b='<div class="close"></div>'+b),this.V&&(b+='<div class="resize"></div>'),
this.title.html(b),this.U&&(b=this.title.children("div.close"),b.mousedown(function(){return!1}),b.click(function(){q||(14==l.kind&&(rd(),od(l.a.id),u=2,Yc(2),O=!0),S());return!1})),this.V&&(b=this.title.children("div.resize"),b.mousedown(function(){return!1}),b.click(function(){if(!q){var a=l.e.position(),a={x:a.left,y:a.top};a.Aa=l.e.width();a.c=l.e.height();void 0!=l.I?(l.e.css("left",l.I.x+"px"),l.e.css("top",l.I.y+"px"),l.resize(l.I.Aa,l.I.c)):(l.e.css("left","0px"),l.e.css("top","19px"),l.resize(desktop.width(),
desktop.height()-19));l.I=a}return!1})),this.e.append(this.title);this.port=$(document.createElement("canvas"));this.port.mousedown(function(a){if(!q)switch(Pc(l),l.kind){case 9:Rd(Math.floor(a.pageX/pageZoom),Math.floor(a.pageY/pageZoom),l);break;case 10:case 14:var b=Sd(Math.floor(a.pageX/pageZoom),Math.floor(a.pageY/pageZoom),l),c=!1;b&&!v(b,3)&&(c=!0);ld(b,l,a,c);break;case 12:b=Sd(Math.floor(a.pageX/pageZoom),Math.floor(a.pageY/pageZoom),l);1==b?ld(b,l,a,!1):Rd(Math.floor(a.pageX/pageZoom),Math.floor(a.pageY/
pageZoom),l);break;case 13:ld(v(1,0),l,a,!1)}return!1});this.port.attr("width",h);this.port.attr("height",f);this.e.append(this.port);this.top=k;this.height=f;this.left=g;this.width=h;"document"==a||"noGrowDoc"==a||"zoomDoc"==a||"rDoc4"==a?(this.top-=Sa+Ra,this.height+=Sa,this.left-=Ra):"info"==a?(this.top-=Ta+Ra,this.height+=Ta,this.left-=Ra):"alert"==a?(this.top-=2*Ua,this.left-=2*Ua,this.width+=Ua,this.height+=Ua):(this.top-=Ra,this.left-=Ra);this.B&&(this.width+=Va);this.F&&(this.height+=Wa);
this.e.css("top",this.top+"px");this.e.css("left",this.left+"px");this.e.css("width",this.width+"px");this.e.css("height",this.height+"px");desktop.append(this.e);(this.B||this.F)&&Tb(this)}m=Qd.prototype;m.show=function(a){this.sa=a;this.e.show();md(this)};m.hide=function(){this.e.hide()};
function ob(a,b){if(void 0!=a.title){var c=a.title.children("span");c.html("");if(""==b)c.hide();else{var d="none"==a.e.css("display");a.e.show();c.css({position:"absolute",visibility:"hidden",display:"block"});var e=a.port.width();a.U&&(e-=30);a.V&&(e-=30);for(var g=0;g<b.length;g++)if(c.append(b.substring(g,g+1)),c.width()>e){c.html(b.substring(0,g-1));break}c.css({position:"",visibility:"",display:""});d&&a.e.hide()}}}m.addClass=function(a){this.e.addClass(a)};m.removeClass=function(a){this.e.removeClass(a)};
m.add=function(a){var b=this.port.position().top,c=parseInt(a.b.css("top"),10);a.b.css("top",c+b+"px");this.e.append(a.b);a.e=this;this.i.push(a);"none"!=this.e.css("display")&&a.m()};m.remove=function(a){var b=this.i.indexOf(a);-1!=b&&this.i.splice(b,1);a.b.remove()};m.find=function(a){for(var b=0;b<this.i.length;b++)if(this.i[b].o==a)return this.i[b]};function md(a){for(var b=0;b<a.i.length;b++)255!=a.i[b].o&&a.i[b].show()}m.close=function(){this.e.remove()};
function ud(a,b){var c=a.port.offset();b.c-=Math.floor(c.left)+1;b.d-=Math.floor(c.top)+2;a.a&&(b.c+=a.a.x,b.d+=a.a.y)}function Rc(a,b){var c=a.port.offset();b.c+=Math.floor(c.left)+1;b.d+=Math.floor(c.top)+2;a.a&&(b.c-=a.a.x,b.d-=a.a.y)}
function Tb(a){if(a.F){a.t=$(document.createElement("div"));a.t.addClass("hscroll");a.t.css("top",a.height-Wa+"px");a.t.css("width",a.width-15+"px");a.t.mousedown(function(b){Pc(a);var d=a.n.offset().left;Math.floor(b.pageX/pageZoom)<d?Td(a,-20,0):Td(a,20,0);return!1});var b=$(document.createElement("div"));b.addClass("leftarrow");b.mousedown(function(){Td(a,-5,0);return!1});a.t.append(b);a.N=$(document.createElement("div"));a.N.addClass("rightarrow");a.N.css("left",a.width-Xa-15+"px");a.N.mousedown(function(){Td(a,
5,0);return!1});a.t.append(a.N);a.n=$(document.createElement("div"));a.n.addClass("slider");a.n.mousedown(function(b){Ud(a,Math.floor(b.pageX/pageZoom),!0);return!1});a.t.append(a.n);a.e.append(a.t)}a.B&&(a.u=$(document.createElement("div")),a.u.addClass("vscroll"),a.u.css("left",a.width-Va+"px"),a.u.css("height",a.height-15-Sa+"px"),a.u.mousedown(function(b){Pc(a);var d=a.g.offset().top;Math.floor(b.pageY/pageZoom)<d?Td(a,0,-20):Td(a,0,20);return!1}),b=$(document.createElement("div")),b.addClass("uparrow"),
b.mousedown(function(){Td(a,0,-5);return!1}),a.u.append(b),a.K=$(document.createElement("div")),a.K.addClass("downarrow"),a.K.css("top",a.height-15-15-Sa+"px"),a.K.mousedown(function(){Td(a,0,5);return!1}),a.u.append(a.K),a.g=$(document.createElement("div")),a.g.addClass("slider"),a.g.mousedown(function(b){Ud(a,Math.floor(b.pageY/pageZoom),!1);return!1}),a.u.append(a.g),a.e.append(a.u));a.D=$(document.createElement("div"));a.D.addClass("grow");a.D.css("top",a.height-15+"px");a.D.css("left",a.width-
15+"px");a.D.mousedown(function(b){if(q)return!1;Pc(a);var d=$(document.createElement("div"));d.addClass("resizeProxy");desktop.append(d);var e=a.e.position();d.css("top",e.top+"px");d.css("left",e.left+"px");var g=a.e.width(),k=a.e.height();d.css("width",g+"px");d.css("height",k+"px");var h=Math.floor(b.pageX/pageZoom),f=Math.floor(b.pageY/pageZoom);$(document).mousemove(function(a){var b=g+(Math.floor(a.pageX/pageZoom)-h),c=k+(Math.floor(a.pageY/pageZoom)-f);100<b&&(g=b,d.css("width",g+"px"),h=
Math.floor(a.pageX/pageZoom));100<c&&(k=c,d.css("height",k+"px"),f=Math.floor(a.pageY/pageZoom))});$(document).mouseup(function(){$(document).unbind("mousemove");$(document).unbind("mouseup");d.remove();a.resize(g,k)});return!1});a.e.append(a.D)}
m.resize=function(a,b){var c=this.width-this.port.width(),d=this.height-this.port.height();this.width=a;this.height=b;this.e.css("width",a+"px");this.e.css("height",b+"px");this.F&&(this.t.css("top",b-Wa+"px"),this.t.css("width",a-15+"px"),this.N.css("left",a-Xa-15+"px"));this.B&&(this.u.css("left",a-Va+"px"),this.u.css("height",b-15-Sa+"px"),this.K.css("top",b-15-15-Sa+"px"));this.D.css("top",b-15+"px");this.D.css("left",a-15+"px");this.a?(this.port.attr("width",a-c),this.port.attr("height",b-d),
this.a.s=!0,R(this)):(this.port.css("width",a-c),this.port.css("height",b-d),ec=this.port.get(0).scrollHeight,Vc())};
function Wc(a,b){if(11==a.kind)a.g.data("min",b.top),a.g.data("max",b.bottom),Vd(a);else{b.left>a.a.x&&(a.a.x=b.left);b.right<a.a.x+Math.floor(a.port.width())&&(b.right=a.a.x+Math.floor(a.port.width()));b.top>a.a.y&&(a.a.y=b.top);b.bottom<a.a.y+Math.floor(a.port.height())&&(b.bottom=a.a.y+Math.floor(a.port.height()));a.F&&(a.n.data("min",b.left),a.n.data("max",b.right));a.B&&(a.g.data("min",b.top),a.g.data("max",b.bottom));if(a.F){var c=a.n.data("min"),d=a.n.data("max");if(c<d){var e=a.a.x-c,g=a.port.width(),
e=e*(a.port.width()-Ya-Xa)/(d-c)|0,c=g*(a.port.width()-Ya-Xa-Za)/(d-c)|0;a.n.css("left",e+Ya+"px");a.n.css("width",c+"px")}else a.n.css("left",Ya+"px"),a.n.css("width",a.port.width()-Ya-Xa+"px")}a.B&&(c=a.g.data("min"),d=a.g.data("max"),c<d?(e=a.a.y-c,g=a.port.height(),e=e*(a.port.height()-15-15)/(d-c)|0,c=g*(a.port.height()-15-15-2)/(d-c)|0,a.g.css("top",e+15+"px"),a.g.css("height",c+"px")):(a.g.css("top","15px"),a.g.css("height",a.port.height()-15-15+"px")))}}
function Vd(a){var b=a.port.scrollTop(),c=a.g.data("min"),d=a.g.data("max");if(c<d){var e=b-c,b=b+a.port.height(),e=e*(a.height-Sa-15-15-15)/(d-c)|0,c=b*(a.height-Sa-15-15-15-2)/(d-c)|0;a.g.css("top",e+15+"px");a.g.css("height",c-e+"px")}else a.g.css("top","15px"),a.g.css("height",a.height-15-Sa-15+"px")}
m.W=function(a,b){var c=this.e.offset();if(a>=c.left&&a<c.left+this.e.width()&&b>=c.top&&b<c.top+this.e.height())return c=this.port.offset(),a>=c.left&&a<c.left+this.port.width()&&b>=c.top&&b<c.top+this.port.height()?{id:3,e:this}:{id:4,e:this}};
function Wd(){for(var a=L,b=a.port.get(0).getContext("2d"),c=a.port.width(),a=a.port.height(),c=b.getImageData(0,0,c,a),a=0;a<c.height;a++)for(var d=a*c.width*4,e=0;e<c.width;e++)c.data[d++]^=255,c.data[d++]^=255,c.data[d++]^=255,c.data[d++]=255;b.putImageData(c,0,0)}m.param=function(a){for(var b=0;b<this.i.length;b++)if(this.i[b].S){var c=this.i[b].S(),d;do if(d=c.indexOf("^"),0<=d){var e=c.substr(0,d),e=e+a[parseInt(c.substr(d+1,1),10)],e=e+c.substr(d+2);this.i[b].R(e);c=e}while(0<=d)}};
m.getItem=function(a){for(var b=0;b<this.i.length;b++)if(this.i[b].o==a)return this.i[b]};
function Td(a,b,c){if(11==a.kind){a.port.scrollTop(a.port.scrollTop()+c);Vd(a);var d=setTimeout(function(){Td(a,b,c)},50)}else{a.a.x+=b;a.a.y+=c;if(a.F){var e=a.n.data("min"),g=a.n.data("max");a.a.x<e&&(a.a.x=e);a.a.x>g-Math.floor(a.port.width())&&(a.a.x=g-Math.floor(a.port.width()))}a.B&&(e=a.g.data("min"),g=a.g.data("max"),a.a.y<e&&(a.a.y=e),a.a.y>g-Math.floor(a.port.height())&&(a.a.y=g-Math.floor(a.port.height())));a.a.s=!0;R(a);d=setTimeout(function(){Td(a,b,c)},50)}$(document).mouseup(function(){$(document).unbind("mouseup");
clearTimeout(d)})}
function Ud(a,b,c){if(11==a.kind)Xd(a,b);else{var d=b;$(document).mousemove(function(b){if(c){a.a.x+=Math.floor(b.pageX/pageZoom)-d;d=Math.floor(b.pageX/pageZoom);b=a.n.data("min");var g=a.n.data("max");a.a.x<b&&(a.a.x=b);a.a.x>g-Math.floor(a.port.width())&&(a.a.x=g-Math.floor(a.port.width()))}else a.a.y+=Math.floor(b.pageY/pageZoom)-d,d=Math.floor(b.pageY/pageZoom),b=a.g.data("min"),g=a.g.data("max"),a.a.y<b&&(a.a.y=b),a.a.y>g-Math.floor(a.port.height())&&(a.a.y=g-Math.floor(a.port.height()));a.a.s=
!0;R(a)});$(document).mouseup(function(){$(document).unbind("mouseup");$(document).unbind("mousemove")})}}function Xd(a,b){var c=b;$(document).mousemove(function(b){var e=a.g.data("min"),g=a.g.data("max"),e=(Math.floor(b.pageY/pageZoom)-c)*(g-e)/(a.height-Sa-15-15-15)|0;c=Math.floor(b.pageY/pageZoom);a.port.scrollTop(a.port.scrollTop()+e);Vd(a)});$(document).mouseup(function(){$(document).unbind("mouseup");$(document).unbind("mousemove")})}
function Bc(){for(var a=[],b=0;b<Q.length;b++)14==Q[b].kind?a.push(Q[b]):Q[b].hide();for(b in a)cc(a[b])}function dc(a){for(var b=0;b<Q.length;b++)if(Q[b]==a){a.close();Q.splice(b,1);break}Q.length&&Pc(Q[0])}function cc(a){if(void 0!=a){var b=a.a.id;if(10==a.kind)a.a={},ob(a,"");else{var c={d:0,c:0},d={d:a.port.height(),c:a.port.width()};Rc(a,c);Rc(a,d);a.a={};dc(a);return{b:b,top:c.d,left:c.c,width:d.c-c.c,height:d.d-c.d}}}}
function Pc(a){if(Q[0]==a)a.e.addClass("active");else{void 0!=Q[0]&&Q[0].e.removeClass("active");for(var b=0;b<Q.length;b++)Q[b]==a&&Q.splice(b,1);Q.unshift(a);a.e.addClass("active");tc()}}function lb(a,b,c,d,e,g,k,h,f){a=new Qd(a,b,c,d,e,g,k,h,f);a.hide();Pc(a);return a}function eb(a,b,c,d){a=new Qd("alert",!1,!1,!1,!1,a,b,c,d);a.kind=2;a.hide();Pc(a);return a}var Q=[];
function Rd(a,b,c){var d=a,e=b;Pc(c);$(document).mousemove(function(a){var b=c.e.position();c.e.css("top",b.top+(Math.floor(a.pageY/pageZoom)-e)+"px");c.e.css("left",b.left+(Math.floor(a.pageX/pageZoom)-d)+"px");d=Math.floor(a.pageX/pageZoom);e=Math.floor(a.pageY/pageZoom)});$(document).mouseup(function(a){$(document).unbind("mousemove");$(document).unbind("mouseup");var b=c.e.position();c.e.css("top",b.top+(Math.floor(a.pageY/pageZoom)-e)+"px");c.e.css("left",b.left+(Math.floor(a.pageX/pageZoom)-
d)+"px")})}function Sd(a,b,c){a={c:a,d:b};var d=0;b=c.a.children.length;for(ud(c,a);0<b&&0==d;){b--;var d=a,e=c.a.children[b],g=0;if(!v(e.id,4)&&d.c>=e.left&&d.d>=e.top&&d.c<e.left+e.width&d.d<e.top+e.height){var k=void 0;(k=ka(2*e.id+1))?k.W(d.c-e.left,d.d-e.top)&&(g=e.id):g=e.id}d=g}return d};function wc(a,b){var c=U;X.unshift({Y:a,C:b,target:T,la:c.c,ma:c.d,state:new Yd,k:[],A:[]});return uc(!0)}function uc(a){for(;X.length;)if(Zd(a))return!0;return!1}var X=[];function Yd(){this.stack=Array(128);this.v=128}Yd.prototype.push=function(a){this.stack[--this.v]=$d(a)};Yd.prototype.pop=function(){return this.stack[this.v++]};function ae(a,b){return a.stack[a.v+b]}Yd.prototype.clear=function(){this.v=128};Yd.prototype.size=function(){return 128-this.v};
function $d(a){0>a&&(a=(-a^65535)+1);return a&65535}function Zd(a){var b=!1,c=X[0];if(c.da||a){c.da=!1;if(b=a?be(0):ce())return c.da=!0;b=!0;c.aa=0;a=v(1,0);a=[a].concat(Kc(a,!1));c.family=a}if(c.ca||b)for(c.ca=!1,a=c.aa;a<c.family.length;a++){if(b=b?be(c.family[a]):ce())return c.ca=!0,c.aa=a,!0;b=!0}var d;if(c.T&&(c.T=!1,ce()))return c.T=!0;do{for(a=b=0;a<c.k.length;a++)b<c.k[a].r&&(b=c.k[a].r,d=a);if(b&&(c.k[d].r=0,be(c.k[d].ba)))return c.T=!0}while(b);X.shift();return!1}
function be(a){var b;return(b=rb(1,a))?(X[0].A[0]=new xa(b),X[0].Ba=a,de()):!1}function ce(){var a=de();if(a)return a;X[0].A.shift();return X[0].A.length?ce():!1}var ee;
function de(){var a,b,c,d,e,g,k,h;d=X[0].A[0];for(var f=X[0].state;!(d.h>=d.length);)if(a=A(d),a&128)switch(a){case 128:b=f.pop();c=f.pop();f.push(v(b,c));break;case 129:b=f.pop();c=f.pop();a=Xc(f.pop());fc(b,c,a);break;case 130:b=f.pop();c=f.pop();a=0!=f.pop();f.push(fe(b,c,a));break;case 131:f.push(X[0].Y);break;case 132:f.push(X[0].C);break;case 133:f.push(X[0].target);break;case 134:f.push(X[0].la);break;case 135:f.push(X[0].ma);break;case 136:f.push(A(d));break;case 137:f.push(B(d));break;case 138:c=
f.pop();f.push(Zb[c]);break;case 139:c=f.pop();a=Xc(f.pop());Zb[c]=a;gc=!0;break;case 140:a=f.pop();f.push(Math.round((a-1)*Math.random()));break;case 141:a=ae(f,0);f.push(a);break;case 142:c=f.pop();for(b=c-1;c--;)a=ae(f,b),f.push(a);break;case 143:b=f.pop();h=f.pop();f.push(b);f.push(h);break;case 144:c=f.pop();h=ae(f,c);b=ae(f,0);f.stack[f.v+c]=$d(b);f.stack[f.v+0]=$d(h);break;case 145:f.pop();break;case 146:a=ae(f,1);f.push(a);break;case 147:c=f.pop();a=ae(f,c);f.push(a);break;case 148:h=f.pop();
b=f.pop();a=f.pop();f.push(h);f.push(a);f.push(b);break;case 149:k=Xc(f.pop());c=Xc(f.pop());k%=c;0>k&&(k+=c);e=g=0;for(a=1;a<c;a++)e+=k,e>=c&&(e-=c),e==g?(g++,e=g):(h=ae(f,g),b=ae(f,e),f.stack[f.v+g]=$d(b),f.stack[f.v+e]=$d(h));break;case 150:f.clear();break;case 151:f.push(f.size());break;case 152:b=f.pop();h=f.pop();f.push(h+b);break;case 153:b=f.pop();h=f.pop();f.push(h-b);break;case 154:b=f.pop();h=f.pop();f.push(h*b);break;case 155:b=f.pop();h=f.pop();f.push(h/b|0);break;case 156:b=f.pop();
h=f.pop();f.push(h%b);break;case 157:b=f.pop();h=f.pop();f.push(h%b);f.push(h/b|0);break;case 158:a=Xc(f.pop());0>a&&(a=-a);f.push(a);break;case 159:a=-Xc(f.pop());f.push(a);break;case 160:b=f.pop();h=f.pop();f.push(h&b);break;case 161:b=f.pop();h=f.pop();f.push(h|b);break;case 162:b=f.pop();h=f.pop();f.push(h^b);break;case 163:a=f.pop();f.push(a^65535);break;case 164:b=f.pop();h=f.pop();f.push(h&&b?65535:0);break;case 165:b=f.pop();h=f.pop();f.push(h||b?65535:0);break;case 166:b=f.pop();h=f.pop();
f.push(!h!=!b?65535:0);break;case 167:a=f.pop();f.push(0==a?65535:0);break;case 168:b=f.pop();h=f.pop();f.push(h>b?65535:0);break;case 169:b=f.pop();h=f.pop();f.push(h<b?65535:0);break;case 170:b=Xc(f.pop());h=Xc(f.pop());f.push(h>b?65535:0);break;case 171:b=Xc(f.pop());h=Xc(f.pop());f.push(h<b?65535:0);break;case 172:b=f.pop();h=f.pop();f.push(h==b?65535:0);break;case 173:b=W(f.pop());h=W(f.pop());f.push(h==b?1:0);break;case 174:b=W(f.pop());a=W(f.pop());f.push(-1!=a.toLowerCase().indexOf(b.toLowerCase())?
1:0);break;case 175:b=W(f.pop());a=W(f.pop());b=new RegExp("\\b"+b+"\\b","i");f.push(b.test(a)?65535:0);break;case 176:a=Xc(B(d));d.seek(a,d.j);break;case 177:a=yd(A(d));d.seek(a,d.j);break;case 178:a=Xc(B(d));b=f.pop();0!=b&&d.seek(a,d.j);break;case 179:a=yd(A(d));b=f.pop();0!=b&&d.seek(a,d.j);break;case 180:a=Xc(B(d));b=f.pop();0==b&&d.seek(a,d.j);break;case 181:a=yd(A(d));b=f.pop();0==b&&d.seek(a,d.j);break;case 182:a=f.pop();b=f.pop();X[0].k.push({r:a,ba:b});break;case 183:b=f.pop();for(a=0;a<
X[0].k.length;a++)X[0].k[a].ba==b&&(X[0].k[a].r=0);break;case 184:b=f.pop();for(a=0;a<X[0].k.length;a++)X[0].k[a].r<=b&&(X[0].k[a].r=0);break;case 185:c=f.pop();for(a=0;a<X[0].k.length;a++)X[0].k[a].r>=c&&(X[0].k[a].r=0);break;case 186:b=f.pop();c=f.pop();for(a=0;a<X[0].k.length;a++)X[0].k[a].r>=c&&X[0].k[a].r<=b&&(X[0].k[a].r=0);break;case 187:a={state:new Yd,k:[],A:[void 0]};a.Y=f.pop();a.C=f.pop();a.target=f.pop();a.la=f.pop();a.ma=f.pop();X.unshift(a);if(Zd(!0))return!0;break;case 188:a=f.pop();
X[0].A.unshift(void 0);if(be(a))return!0;X[0].A.shift();d=X[0].A[0];break;case 189:b=f.pop();I.push({id:2,val:b});break;case 190:a={};a.P=f.pop();a.O=f.pop();I.push({id:8,val:a});fc(a.O,6,v(a.P,6));fc(a.P,6,0);b=Kc(a.P,!0);for(c=0;c<b.length;c++)fc(b[c],0,a.O);break;case 191:I.push({id:14,val:X[0].C});break;case 192:I.push({id:13});break;case 193:a=f.pop();Pb.push({id:3,val:[X[0].target,X[0].C,a]});break;case 194:Pb.push({id:2});break;case 195:a=f.pop();Pb.push({id:3,val:[X[0].target,X[0].C,a]});
Pb.push({id:2});break;case 196:a=f.pop();Pb.push({id:2});Pb.push({id:3,val:[X[0].target,X[0].C,a]});Pb.push({id:2});break;case 197:a=f.pop();Pb.push({id:1,val:a});break;case 198:f.push(2);break;case 199:b=f.pop();Ob.push({id:1,val:b});break;case 200:b=f.pop();Ob.push({id:2,val:b});break;case 201:Ob.push({id:3});break;case 202:a=new Date;f.push(a.getFullYear());f.push(a.getMonth()+1);f.push(a.getDate());f.push(a.getHours());f.push(a.getMinutes());f.push(a.getSeconds());break;case 203:a=new Date;f.push(a.getDay()+
1);break;case 204:a=0!=f.pop();b=f.pop();b=Kc(b,a);for(a=0;a<b.length;a++)f.push(b[a]);f.push(b.length);break;case 205:a=0!=f.pop();b=f.pop();b=Kc(b,a);f.push(b.length);break;case 206:f.push(86);break;case 207:f.push(RELEASE);break;case 208:f.push(1);break;case 209:b=f.pop();a=ma(b);f.push(Math.round(a.width/1));f.push(Math.round(a.height/1));break;case 210:b=f.pop();h=f.pop();f.push(ge(b,h));break;case 211:a=b=f.pop();b=[];c=Kc(v(a,0),1);for(h=0;h<c.length;h++)a<c[h]&&40<=ge(c[h],a)&&b.push(c[h]);
for(;b.length;)fc(b.pop(),0,a);break;case 212:b=f.pop();a=Kc(b,1);b=v(b,0);for(c=0;c<a.length;c++)fc(a[c],0,b);break;case 213:return d=f.pop(),Zc(d),!0;case 214:Yc(f.pop());break;case 215:G=3;break;case 216:G=2;break;case 217:return d=f.pop(),setTimeout(S,d/60*1E3),!0;case 218:return pc(!1),ca(),!0;case 219:yc();break;case 220:if(Ac(!0))return!0;break;case 221:if(zc())return!0;break;case 222:if(pc(!0))return!0;break;case 223:return d=f.pop(),Wd(),setTimeout(he,d/60*1E3),!0;case 224:f.pop();break;
case 225:f.pop();break;case 226:b=f.pop();h=f.pop();h*=b;a=f.pop();h/=a;f.push(h|0);break;case 227:b=f.pop();a=void 0;if(a=v(1,0)==b?L:Ic(b))Fc(b),yc(),R(a);break;case 228:f.push(0);break;case 229:break;case 230:f.push(ee);break;case 231:c=f.pop();b=1;for(a=ee=0;a<c;a++)ee+=b,ee^=b,b^=ee,ee^=b;break;default:fatal("Unknown function:"+a.toString(16))}else f.push(a);return!1}function he(){Wd();S()}function fe(a,b,c){var d=0;a=Kc(a,c);for(c=0;c<a.length;c++)d+=v(a[c],b);return d}
function ge(a,b){if(v(a,0)!=v(b,0))return 0;var c=ma(a),d=ma(b);return la(d,c,d)?d.width*d.height*100/(c.width*c.height)|0:0};function p(a,b,c,d){switch(c&255){case 2:return new ie(a,b,d);case 10:return new je(a,b,d);case 15:return new me(a,b,d);case 17:return new ne(a,b,d);case 22:return new oe(a,b,d);case 23:return new pe(a,b);case 24:return new qe(a,b,d);case 25:return new re(a,b,d);default:fatal("Unknown control:"+c.toString(16))}}
function ie(a,b,c){var d=this,e=$(document.createElement("canvas"));e.addClass("cbutton");e.css("left",a[0]+"px");e.css("top",a[1]+"px");e.attr("width",a[2]);e.attr("height",a[3]);e.mousedown(function(a){kd(d,a);return!1});this.b=e;this.o=b;this.selected=!1;this.pa=c[0];this.f=c[1];this.wa=c[2]}m=ie.prototype;m.hide=function(){this.b.hide()};m.show=function(){this.b.show();this.m()};
m.m=function(){var a=this.b.get(0).getContext("2d"),b=this.b.width(),c=this.b.height(),d=a.getImageData(0,0,b,c),e=this.selected?this.wa:this.f;if(e)for(var g=0;g<c;g++)for(var k=(g>>1)*this.pa,h=g*d.width*4,f,l=0;l<b;l++)f=e.charCodeAt(k+(l>>2)),f=3*(f>>(l&2?0:4)&15),d.data[h++]=Ca[f++],d.data[h++]=Ca[f++],d.data[h++]=Ca[f++],d.data[h++]=255;else for(g=0;g<c;g++)for(h=g*d.width*4,l=0;l<b;l++){f=this.selected?0:255;if(2>g||4>l||g>c-3||l>b-5)f=0;d.data[h++]=f;d.data[h++]=f;d.data[h++]=f;d.data[h++]=
255}a.putImageData(d,0,0)};m.select=function(){this.selected=!0;this.m()};m.J=function(){this.selected=!1;this.m()};function je(a,b,c){var d=this,e=$(document.createElement("div"));e.addClass("button");e.css("left",a[0]+"px");e.css("top",a[1]+"px");e.css("width",a[2]+"px");e.css("height",a[3]+"px");e.css("line-height",a[3]+"px");e.html(c[0]);e.mousedown(function(a){kd(d,a);return!1});this.b=e;this.o=b}je.prototype.hide=function(){this.b.hide()};je.prototype.show=function(){this.b.show()};
je.prototype.m=function(){};function me(a,b,c){this.b=$(document.createElement("div"));this.b.addClass("textblock");this.b.css("left",a[0]+"px");this.b.css("top",a[1]+"px");this.b.css("width",a[2]+"px");this.b.css("height",a[3]+"px");this.o=b;this.R(c[0])}m=me.prototype;m.S=function(){return this.b.html()};m.R=function(a){this.b.html(a)};m.hide=function(){this.b.hide()};m.show=function(){this.b.show()};m.m=function(){};
function ne(a,b,c){var d=$(document.createElement("input"));d.addClass("textinput");d.css("left",a[0]+"px");d.css("top",a[1]+"px");d.css("width",a[2]+"px");d.css("height",a[3]+"px");d.val(c[0]);d.mousedown(function(){d.focus();return!1});this.b=d;this.o=b}ne.prototype.hide=function(){this.b.hide()};ne.prototype.show=function(){this.b.show();this.b.focus()};ne.prototype.m=function(){};
function oe(a,b,c){this.b=$(document.createElement("div"));this.b.addClass("textblock");this.b.css("left",a[0]+"px");this.b.css("top",a[1]+"px");this.b.css("width",a[2]+"px");this.b.css("height",a[3]+"px");this.o=b;this.R(c[0])}m=oe.prototype;m.hide=function(){this.b.hide()};m.show=function(){this.b.show()};m.m=function(){};m.S=function(){return this.b.html()};
m.R=function(a){for(var b="",c=0;c<a.length;c++)1==a.charCodeAt(c)?(74==a.charCodeAt(c+1)&&this.b.css("text-align","center"),c+=2):b=13==a.charCodeAt(c)?b+"<br />":b+a.charAt(c);this.b.html(b)};function pe(a,b){this.b=$(document.createElement("div"));this.b.addClass("list");this.b.css("left",a[0]+"px");this.b.css("top",a[1]+"px");this.b.css("width",a[2]+"px");this.b.css("height",a[3]+"px");this.o=b}pe.prototype.hide=function(){this.b.hide()};pe.prototype.show=function(){this.b.show()};
pe.prototype.m=function(){};
function qe(a,b,c){var d=this;this.value=parseInt(c[0],10);this.o=b;this.min=parseInt(c[1],10);this.max=parseInt(c[2],10);this.width=a[2];b=$(document.createElement("div"));b.addClass("hscroll");b.css("left",a[0]+"px");b.css("top",a[1]+"px");b.css("width",a[2]+"px");b.css("height",a[3]+"px");this.b=b;c=$(document.createElement("div"));c.addClass("leftarrow");c.css("top","0px");c.css("left","0px");b.append(c);var e=$(document.createElement("div"));e.addClass("rightarrow");e.css("top","0px");e.css("left",
a[2]-Xa+"px");b.append(e);var g=$(document.createElement("div"));g.addClass("slider");g.css("top","0px");g.css("left","50px");g.css("width","20px");b.append(g);this.xa=g;b.mousedown(function(a){var b=g.offset().left;Math.floor(a.pageX/pageZoom)<b?se(d,-20):se(d,20);return!1});c.mousedown(function(){se(d,-5);return!1});e.mousedown(function(){se(d,5);return!1});g.mousedown(function(a){te(d,Math.floor(a.pageX/pageZoom));return!1})}qe.prototype.hide=function(){this.b.hide()};
qe.prototype.show=function(){this.b.show();this.m()};qe.prototype.m=function(){this.xa.css("left",(this.value*(this.width-Ya-Xa-20-Za)/(this.max-this.min)|0)+Ya+"px")};function xd(a,b){a.value=parseInt(b,10);a.m()}function se(a,b){a.value+=b;a.value<a.min&&(a.value=a.min);a.value>a.max&&(a.value=a.max);a.m();var c=setTimeout(function(){se(a,b)},50);$(document).mouseup(function(){$(document).unbind("mouseup");clearTimeout(c)})}
function te(a,b){var c=b;$(document).mousemove(function(b){var e=(Math.floor(b.pageX/pageZoom)-c)*(a.max-a.min)/(a.width-Ya-Xa-20-Za)|0;c=Math.floor(b.pageX/pageZoom);a.value+=e;a.value<a.min&&(a.value=a.min);a.value>a.max&&(a.value=a.max);a.m()});$(document).mouseup(function(){$(document).unbind("mouseup");$(document).unbind("mousemove")})}
function re(a,b,c){var d=this,e=$(document.createElement("div"));e.addClass("sbutton");e.css("left",a[0]+"px");e.css("top",a[1]+"px");e.css("width",a[2]-2+"px");e.css("height",a[3]-2+"px");e.html(c[0]);e.mousedown(function(a){kd(d,a);return!1});this.b=e;this.o=b}m=re.prototype;m.hide=function(){this.b.hide()};m.show=function(){this.b.show()};m.select=function(){this.b.addClass("active")};m.J=function(){this.b.removeClass("active")};m.m=function(){};var Rb=!0,Qb=void 0,$c="",Tc=void 0,Uc=void 0;
function W(a){if(Rb){if(a&32768)a=$c;else{a=new xa(rb(2,a));for(var b=!1,c="",d=B(a);d--;){var e=a.f(5);if(0<e&&27>e)e|=64,b&&(e|=32),b=!0,c+=String.fromCharCode(e);else switch(e){case 0:c+=" ";break;case 27:c+=b?".":",";b=!0;break;case 28:c+=b?"'":'"';b=!0;break;case 29:b=a.f(16);b&32768?(b^=65535,b=ue(b)):b=W(b);b&&(c+=b);b=!0;break;case 30:c+=String.fromCharCode(a.f(8));b=!0;break;case 31:b=!b}}a=ga(c)}return a}if(a&32768)return $c;a=new xa(rb(2,a));d="";for(c=a.f(1)?a.f(15):a.f(7);c--;){b=wb(a);
b>>=16-a.l;b&=65535;for(e=0;e<Qb.length-1&&!(b<Qb.ia[e]);e++);a.l+=Qb.ha[e];a.l&16&&(a.l&=15,a.seek(2,a.j));b=Qb.oa[e];1==b&&(b=a.f(7));2!=b?d+=String.fromCharCode(b):(a.f(1)?(b=a.f(15),b=W(b)):(b=a.f(8),b=ue(b)),b&&(d+=b))}return ga(d)}function ue(a){var b,c;b=a&8?Uc:Tc;if(1==(a&3))b=v(b,7),c=Ma(132,(b>>4&3)+1);else switch(c=W(b),a&3){case 2:c=ve(0,b)+c;break;case 3:c=ve(2,b)+c}c.length&&a&4&&(c=c.substr(0,1).toUpperCase()+c.substr(1));return c}
function ve(a,b){var c=v(b,7)>>a&3;return c?Ma(131,c):""};function rb(a,b){if(b>=zb[a].M)return"";var c,d;zb[a].fa?(c=zb[a].ga[b],d=zb[a].ka[b]):(c=zb[a].va,d=b*c);return c?zb[a].data.substring(d,d+c):""}var zb=[];var tb=!1,ub=!1;try{var we=document.createElement("audio").canPlayType("audio/wav"),tb=""!=we&&"no"!=we}catch(xe){}function sb(a,b){this.data=Array(a);this.w=a;this.L=b}sb.prototype.time=function(){return this.w/this.L};sb.prototype.play=function(){var a=$(document.createElement("audio"));$(document.body).append(a);a.attr("src","data:audio/x-wav;base64,"+ye(this));var b=wd();null==b&&(b=50);a.attr("volume",b/100);a.bind("ended",function(){a.remove()});a.get(0).play()};
function ye(a){var b=Array(44+a.w);b[0]=82;b[1]=73;b[2]=70;b[3]=70;var c=36+a.w;b[4]=c&255;b[5]=c>>8&255;b[6]=c>>16&255;b[7]=c>>24&255;b[8]=87;b[9]=65;b[10]=86;b[11]=69;b[12]=102;b[13]=109;b[14]=116;b[15]=32;b[16]=16;b[17]=0;b[18]=0;b[19]=0;b[20]=1;b[21]=0;b[22]=1;b[23]=0;b[24]=a.L&255;b[25]=a.L>>8&255;b[26]=a.L>>16&255;b[27]=a.L>>24&255;b[28]=b[24];b[29]=b[25];b[30]=b[26];b[31]=b[27];b[32]=1;b[33]=0;b[34]=8;b[35]=0;b[36]=100;b[37]=97;b[38]=116;b[39]=97;b[40]=a.w&255;b[41]=a.w>>8&255;b[42]=a.w>>16&
255;b[43]=a.w>>24&255;for(c=0;c<a.w;c++)b[44+c]=a.data[c];a="";var d,e,g,k=0;do d=b[k++],e=b[k++],g=b[k++],c=d>>2,d=(d&3)<<4,void 0==e?e=g=64:void 0==g?(d|=e>>4,e=(e&15)<<2,g=64):(d|=e>>4,e=(e&15)<<2|g>>6,g&=63),a+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(c)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(d)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(e)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(g);
while(k<b.length);return a};var ze=document.createElement("link");ze.type="text/css";ze.rel="stylesheet";ze.href="mac.css";$("head").append(ze);aa=$(document.createElement("img"));aa.attr("src","images/mac/start.png");aa.css("width","100%");aa.css("height","100%");desktop.append(aa);
$.ajax({url:gamename,beforeSend:function(a){a.overrideMimeType("text/html; charset=x-user-defined")},complete:function(a){y=new xa(a.responseText);y.seek(1044,y.set);wa=C(y);y.seek(1052,y.set);va=B(y);y.seek(1174,y.set);Aa=B(y);a=(Aa+va)*wa;y.seek(a+wa-2,y.set);var b=B(y);y.seek(a+b+2,y.set);b=C(y);Ba(a,b)}});setTimeout(xb,10);