/* * Simple JavaScript Inheritance * http://ejohn.org/blog/simple-javascript-inheritance/ * * By John Resig * Released into the public domain? * * Inspired by base2 and Prototype */ (function(){var a=false,b=/xyz/.test(function(){xyz})?/\b_super\b/:/.*/;this.Class=function(){};Class.extend=function(g){var f=this.prototype;a=true;var e=new this();a=false;for(var d in g){e[d]=typeof g[d]=="function"&&typeof f[d]=="function"&&b.test(g[d])?(function(h,i){return function(){var k=this._super;this._super=f[h];var j=i.apply(this,arguments);this._super=k;return j}})(d,g[d]):g[d]}function c(){if(!a&&this.init){this.init.apply(this,arguments)}}c.prototype=e;c.constructor=c;c.extend=arguments.callee;return c}})(); /* * Interchange File Format library * * Copyright (c) 2003-2009 The Gnusto Contributors * Licenced under the GPL v2 * http://github.com/curiousdannii/gnusto */ (function(){function c(i,j){return i[j]<<24|i[j+1]<<16|i[j+2]<<8|i[j+3]}function d(i){return[(i>>24)&255,(i>>16)&255,(i>>8)&255,i&255]}function f(j,k){var i=String.fromCharCode;return i(j[k])+i(j[k+1])+i(j[k+2])+i(j[k+3])}function h(i){return[i.charCodeAt(0),i.charCodeAt(1),i.charCodeAt(2),i.charCodeAt(3)]}var b="FORM",g=Class.extend({init:function a(m){this.type="";this.chunks=[];if(m){if(f(m,0)!=b){throw new Error("Not an IFF file")}this.type=f(m,8);var k=12,j=m.length;while(kj){throw new Error("IFF: Chunk out of range")}this.chunks.push({type:f(m,k),offset:k,data:m.slice(k+8,k+8+n)});k+=8+n;if(n%2){k++}}}},write:function e(){var n=h(this.type);for(var o=0,k=this.chunks.length;o","/":"?","\\":"|"},newTrigger:function(e,d,f){var c={};c[e]={};c[e][d]={cb:f,disableInInput:false};return c}};if(b.browser.mozilla){a.specialKeys=b.extend(a.specialKeys,{96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9"})}b.fn.find=function(c){this.query=c;return b.fn.__find__.apply(this,arguments)};b.fn.unbind=function(h,e,g){if(b.isFunction(e)){g=e;e=null}if(e&&typeof e==="string"){var f=((this.prevObject&&this.prevObject.query)||(this[0].id&&this[0].id)||this[0]).toString();var d=h.split(" ");for(var c=0;c/g,">")};String.prototype.quote=function(){var e,b,a=this.length,d='"';for(b=0;b=" "){if(e==="\\"||e==='"'){d+="\\"}d+=e}else{switch(e){case"\b":d+="\\b";break;case"\f":d+="\\f";break;case"\n":d+="\\n";break;case"\r":d+="\\r";break;case"\t":d+="\\t";break;default:e=e.charCodeAt();d+="\\u00"+Math.floor(e/16).toString(16)+(e%16).toString(16)}}}return d+'"'};String.prototype.supplant=function(a){return this.replace(/{([^{}]*)}/g,function(d,c){var e=a[c];return typeof e==="string"||typeof e==="number"?e:d})};String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")};function FatalError(a){this.message=a;this.traceback=this._makeTraceback(arguments.callee);this.onError(this)}FatalError.prototype={onError:function(a){},_makeTraceback:function(a){var d="";var c=0;var b=100;while(a!=null&&c>4);n=((u&15)<<4)+(t>>2);m=((t&3)<<6)+s;o.push(r,n,m)}if(s==64){o.pop()}if(t==64){o.pop()}return o},h=function(q,o){var o=o||"",r,n,m,v,u,t,s,p=0,k=q.length;while(p>2;u=((r&3)<<4)+(n>>4);t=((n&15)<<2)+(m>>6);s=m&63;o+=(f.charAt(v)+f.charAt(u)+f.charAt(t)+f.charAt(s))}if(isNaN(n)){o=o.slice(0,-2)+"=="}else{if(isNaN(m)){o=o.slice(0,-1)+"="}}return o}}var j=IFF.extend({init:function g(r,m){this.title=m;if(r[0]<9){this.filetype="ok story naked zcode";this._super();this.chunks.push({type:"ZCOD",data:r});this.zcode=r}else{if(IFF.text_from(r,0)=="FORM"){this._super(r);if(this.type=="IFRS"){this.images=[];this.resources=[];for(var p=0,k=this.chunks.length;p>16)&255,(i>>8)&255,i&255);this.chunks=[{type:d,data:h},{type:(this.compressed?a:b),data:this.memory},{type:g,data:this.stacks}];return this._super()}})})();