[parchment commit] r139 - Updating dannii-testing

0 views
Skip to first unread message

codesite...@google.com

unread,
Mar 24, 2009, 12:20:20 AM3/24/09
to parc...@googlegroups.com
Author: curiousdannii
Date: Mon Mar 23 20:34:58 2009
New Revision: 139

Added:
branches/dannii-testing/build.py
- copied unchanged from r126, /trunk/build.py
branches/dannii-testing/lib/
- copied from r126, /trunk/lib/
branches/dannii-testing/lib/base2.min.js
- copied unchanged from r126, /trunk/lib/base2.min.js
branches/dannii-testing/lib/gnusto-engine.min.js
- copied, changed from r126, /trunk/lib/gnusto-engine.min.js
branches/dannii-testing/lib/gnusto-engine.pack.js
- copied unchanged from r126, /trunk/lib/gnusto-engine.pack.js
branches/dannii-testing/lib/jquery.min.js
- copied, changed from r126, /trunk/lib/jquery.min.js
branches/dannii-testing/lib/jquery.pack.js
- copied unchanged from r126, /trunk/lib/jquery.pack.js
branches/dannii-testing/parchment.full.html
- copied unchanged from r138, /trunk/parchment.full.html
branches/dannii-testing/src/lib/jquery.js
- copied unchanged from r138, /trunk/src/lib/jquery.js
branches/dannii-testing/src/parchment/ui.js
- copied unchanged from r126, /trunk/src/parchment/ui.js
branches/dannii-testing/src/plugins/
- copied from r138, /trunk/src/plugins/
branches/dannii-testing/src/plugins/jquery.hotkeys.js
- copied unchanged from r138, /trunk/src/plugins/jquery.hotkeys.js
branches/dannii-testing/src/plugins/jquery.mousewheel.js
- copied unchanged from r138, /trunk/src/plugins/jquery.mousewheel.js
branches/dannii-testing/tests/test_storew.inf
- copied unchanged from r126, /trunk/tests/test_storew.inf
branches/dannii-testing/tests/test_storew.z5
- copied unchanged from r126, /trunk/tests/test_storew.z5
branches/dannii-testing/tests/unicode.inf
- copied unchanged from r126, /trunk/tests/unicode.inf
branches/dannii-testing/tests/unicode.z5
- copied unchanged from r126, /trunk/tests/unicode.z5
branches/dannii-testing/tests/unicode.z5.js
- copied unchanged from r126, /trunk/tests/unicode.z5.js
branches/dannii-testing/yuicompressor-2.4.2.jar
- copied unchanged from r126, /trunk/yuicompressor-2.4.2.jar
Removed:
branches/dannii-testing/jquery.js
branches/dannii-testing/jquery.mousewheel.js
branches/dannii-testing/stories/test_storew.inf
branches/dannii-testing/stories/test_storew.z5
Modified:
branches/dannii-testing/console.js
branches/dannii-testing/gnusto-engine.js
branches/dannii-testing/parchment.html
branches/dannii-testing/src/lib/jquery.hotkeys.js
branches/dannii-testing/src/parchment/file.js
branches/dannii-testing/tests/test_storew.js
branches/dannii-testing/web-zui.js

Log:
Updating dannii-testing

Modified: branches/dannii-testing/console.js
==============================================================================
--- branches/dannii-testing/console.js (original)
+++ branches/dannii-testing/console.js Mon Mar 23 20:34:58 2009
@@ -69,6 +69,8 @@
} else
character = string.charAt(i).entityify();

+ if(y > this.height - 1)
+ this.resize(y + 1);
if (character != null) {
this._characters[y][x] = character;
this._styles[y][x] = style;

Modified: branches/dannii-testing/gnusto-engine.js
==============================================================================
--- branches/dannii-testing/gnusto-engine.js (original)
+++ branches/dannii-testing/gnusto-engine.js Mon Mar 23 20:34:58 2009
@@ -100,6 +100,10 @@
222:0xa1, // inverted pling
223:0xbf // inverted query
};
+var reverse_unicode_table = {};
+
+var isNotConst = /\D/;
+var temp_var = 0;

var PARENT_REC = 0;
var SIBLING_REC = 1;
@@ -109,7 +113,7 @@

// Placeholder when decoding arguments for opcodes to indicate that
// an argument needs to be popped from the stack.
-var ARG_STACK_POP = "SP";
+//var ARG_STACK_POP = "SP";

////////////////////////////////////////////////////////////////
// Effect codes, returned from run(). See the explanation below
@@ -248,13 +252,27 @@

function handleZ_jg(engine, a) {
return engine._brancher(a[0]+'>'+a[1]); }
-
+/***
function handleZ_dec_chk(engine, a) {

return 't='+a[0]+';t2=_varcode_get(t)-1;_varcode_set(t2,t);'+engine._brancher('t2<'+a[1]);
}
function handleZ_inc_chk(engine, a) {

return 't='+a[0]+';t2=_varcode_get(t)+1;_varcode_set(t2,t);'+engine._brancher('t2>'+a[1]);
}
+***/
+
+// Increment/decrement a variable and branch
+// Calls the generic function and adds a brancher to the end
+
+function handleZ_inc_chk(engine, a)
+{
+ return handleZ_incdec(engine, a[0], '+', 1) + engine._brancher('tmp_' +
temp_var + ' > ' + a[1]);
+}
+
+function handleZ_dec_chk(engine, a)
+{
+ return handleZ_incdec(engine, a[0], '-', 1) + engine._brancher('tmp_' +
temp_var + ' < ' + a[1]);
+}

function handleZ_jin(engine, a) {
return engine._brancher("_obj_in("+a[0]+','+a[1]+')');
@@ -277,9 +295,54 @@
function handleZ_clear_attr(engine, a) {
return '_clear_attr('+a[0]+','+a[1]+')';
}
+/***
function handleZ_store(engine, a) {
return "_varcode_set("+a[1]+","+a[0]+")";
}
+***/
+
+// Store a variable
+// Rather than calling _varcode_set() this function now access the
variables directly
+// a[0] is interpreted as in ZSD 4.2.2:
+// 0 = top of game stack
+// 1-15 = local variables
+// 16 up = global variables
+
+function handleZ_store(engine, a)
+{
+ if (isNotConst.test(a[0]))
+ engine.logger('Z_store', a[0]);
+
+ if (a[0] == 0)
+ return 'm_gamestack.push(' + a[1] + ')';
+ else if (a[0] < 16)
+ return 'm_locals[' + a[0] + ' - 1] = ' + a[1];
+ else
+ {
+ // If the variable is a function rather than a constant it will have to
be determined at run time
+ if (isNotConst.test(a[0]))
+ var code = 'var high = m_vars_start + (' + a[0] + ' - 16) * 2, low =
high + 1;', high = 'high', low = 'low';
+ else
+ var code = '', high = engine.m_vars_start + (a[0] - 16) * 2, low = high
+ 1;
+
+ // If we are setting a constant get the high and low bytes at compile
time
+ if (!isNotConst.test(a[1]))
+ {
+ var value = (a[1] & 0x8000 ? ~0xFFFF : 0) | a[1];
+ return code + 'm_memory[' + high + '] = ' + ((value >> 8) & 0xFF) + ';'
+
+ 'm_memory[' + low + '] = ' + (value & 0xFF);
+ }
+ else
+ {
+ var tmp = 'tmp_' + (++temp_var);
+ return code + 'var ' + tmp + ' = ' + a[1] + ';' +
+ tmp + ' = (' + tmp + ' & 0x8000 ? ~0xFFFF : 0) | ' + tmp + ';' +
+ 'm_memory[' + high + '] = (' + tmp + ' >> 8) & 0xFF;' +
+ 'm_memory[' + low + '] = ' + tmp + ' & 0xFF;';
+ }
+ }
+}
+
function handleZ_insert_obj(engine, a) {
return "_insert_obj("+a[0]+','+a[1]+")";
}
@@ -334,12 +397,62 @@
function handleZ_get_prop_len(engine, a) {
return engine._storer("_get_prop_len("+a[0]+')');
}
+/***
function handleZ_inc(engine, a) {
return "t="+a[0]+';_varcode_set(_varcode_get(t)+1, t)';
}
function handleZ_dec(engine, a) {
return "t="+a[0]+';_varcode_set(_varcode_get(t)-1, t)';
}
+***/
+
+// Increment and decrement opcodes
+// Calls the following generic function
+
+function handleZ_inc(engine, a)
+{
+ return handleZ_incdec(engine, a[0], '+');
+}
+
+function handleZ_dec(engine, a)
+{
+ return handleZ_incdec(engine, a[0], '-');
+}
+
+// Increment and decrement variables
+// A generic function used by dec, dec_chk, inc and inc_chk
+// Rather than calling _varcode_set() and _varcode_get() this function now
accesses the variables directly
+// variable is interpreted as in ZSD 4.2.2:
+// 0 = top of game stack
+// 1-15 = local variables
+// 16 up = global variables
+
+function handleZ_incdec(engine, variable, sign, varRequired)
+{
+ if (isNotConst.test(variable))
+ engine.logger('Z_incdec', variable);
+
+ var tmp = 'tmp_' + (++temp_var);
+ if (variable == 0)
+ return (varRequired ? 'var ' + tmp + ' = ' : '') + sign + sign
+ 'm_gamestack[m_gamestack.length - 1];';
+ else if (variable < 0x10)
+ return (varRequired ? 'var ' + tmp + ' = ' : '') + sign + sign
+ 'm_locals[' + variable + ' - 1];';
+ else
+ {
+ // If the variable is a function rather than a constant it will have to
be determined at run time
+ if (isNotConst.test(variable))
+ var code = 'var add = m_vars_start + (' + variable + ' - 16) * 2, ',
add = 'add';
+ else
+ var code = 'var ', add = engine.m_vars_start + (variable - 16) * 2;
+
+ // Get the value from memory and inc/dec it!
+ return code + tmp + ' = (m_memory[' + add + '] << 8) | m_memory[' + add
+ ' + 1];' +
+ tmp + ' = ((' + tmp + ' & 0x8000 ? ~0xFFFF : 0) | ' + tmp + ') ' + sign
+ ' 1;' +
+ 'm_memory[' + add + '] = (' + tmp + ' >> 8) & 0xFF;' +
+ 'm_memory[' + add + ' + 1] = ' + tmp + ' & 0xFF;';
+ }
+}
+
function handleZ_print_addr(engine, a) {
return engine._handler_zOut('_zscii_from('+a[0]+')',0);
}
@@ -484,6 +597,33 @@
return "setWord("+a[2]+",1*"+a[0]+"+2*"+a[1]+")";
}

+/***
+// Store a value in an array
+function handleZ_store_w(engine, a)
+{
+ // Calculate the address
+ if (isNotConst.test(a[0]) || isNotConst.test(a[1]))
+ var code = 'var tmp_' + (++temp_var) + ' = ' + a[0] + ' + 2 * ' + a[1]
+ ';', add = 'tmp_' + temp_var;
+ else
+ var code = '', add = a[0] + 2 * a[1];
+
+ // If we are setting a constant get the high and low bytes at compile time
+ if (!isNotConst.test(a[2]))
+ {
+ var value = (a[2] & 0x8000 ? ~0xFFFF : 0) | a[2];
+ return code + 'm_memory[' + add + '] = ' + ((value >> 8) & 0xFF) + ';' +
+ 'm_memory[' + add + ' + 1] = ' + (value & 0xFF);
+ }
+ else
+ {
+ var tmp = 'tmp_' + (++temp_var);
+ return code + 'var ' + tmp + ' = ' + a[2] + ';' +
+ tmp + ' = (' + tmp + ' & 0x8000 ? ~0xFFFF : 0) | ' + tmp + ';' +
+ 'm_memory[' + add + '] = (' + tmp + ' >> 8) & 0xFF;' +
+ 'm_memory[' + add + ' + 1] = ' + tmp + ' & 0xFF;';
+ }
+}
+***/
function handleZ_storeb(engine, a) {
return "setByte("+a[2]+",1*"+a[0]+"+1*"+a[1]+")";
}
@@ -606,9 +746,11 @@
function handleZ_push(engine, a) {
return 'm_gamestack.push('+a[0]+')';
}
-function handleZ_pull(engine, a) {
- return '_varcode_set(m_gamestack.pop(),'+a[0]+')';
- }
+function handleZ_pull(engine, a)
+{
+// return '_varcode_set(m_gamestack.pop(),'+a[0]+')';
+ return handleZ_store(engine, [a[0], 'm_gamestack.pop()']);
+}

function handleZ_split_window(engine, a) {
engine.m_compilation_running=0;
@@ -738,7 +880,7 @@
}

function handleZ_not(engine, a) {
- return engine._storer('~'+a[1]+'&0xffff');
+ return engine._storer('~'+a[0]+'&0xffff');
}

function handleZ_tokenise(engine, a) {
@@ -1509,10 +1651,10 @@
}

// Some useful debugging code:
- if (this.m_copperTrail) {
- this.logger('pc', start_pc.toString(16));
- this.logger('jit', jscode);
- }
+// if (this.m_copperTrail) {
+// this.logger('pc', start_pc.toString(16));
+// this.logger('jit', jscode);
+// }

jscode();

@@ -1916,9 +2058,20 @@
if (this.m_unicode_start > 0) { // if there is one, get the char
count-- characters beyond that point are undefined.
this.m_custom_unicode_charcount =
this.m_memory[this.m_unicode_start];
this.m_unicode_start += 1;
+ // Populate reverse lookup table
+ for(var i=0; i<this.m_custom_unicode_charcount; i++)
+ reverse_unicode_table[this.getUnsignedWord(this.m_unicode_start +
(i*2))] = i + 155;
}
}

+ if(!(this.m_unicode_start>0)) {
+ // The game doesn't provide its own set of unicode characters, so
+ // now is the time to populate the reverse_unicode_table with the
+ // default unicode characters
+ for(var i in default_unicode_translation_table)
+ reverse_unicode_table[default_unicode_translation_table[i]] = i;
+ }
+
this.m_rebound = 0;
this.m_rebound_args = [];

@@ -1978,6 +2131,8 @@
this.m_leftovers = '';
},

+// Inlined some of these functions...
+
getByte: function ge_getbyte(address) {
if (address<0) { address &= 0xFFFF; }
return this.m_memory[address];
@@ -1990,8 +2145,10 @@

getWord: function ge_getWord(address) {
if (address<0) { address &= 0xFFFF; }
- return this._unsigned2signed((this.m_memory[address]<<8)|
- this.m_memory[address+1]);
+// return this._unsigned2signed((this.m_memory[address]<<8)|
+// this.m_memory[address+1]);
+ var value = (this.m_memory[address] << 8) | this.m_memory[address + 1];
+ return ((value & 0x8000) ? ~0xFFFF : 0) | value;
},

_unsigned2signed: function ge_unsigned2signed(value) {
@@ -2008,14 +2165,16 @@
},

setWord: function ge_setWord(value, address) {
- if (address<0) { address &= 0xFFFF; }
- this.setByte((value>>8) & 0xFF, address);
- this.setByte((value) & 0xFF, address+1);
+ if (address<0) { address &= 0xFFFF; }
+// this.setByte((value>>8) & 0xFF, address);
+ this.m_memory[address] = (value >> 8) & 0xFF;
+// this.setByte((value) & 0xFF, address+1);
+ this.m_memory[address + 1] = (value) & 0xFF;
},

// Inelegant function to load parameters according to a VAR byte (or
word).
_handle_variable_parameters: function ge_handle_var_parameters(args,
types, bytecount) {
- var argcursor = 0;
+ var argcursor = 0, code = '', varcode;

if (bytecount==1) {
types = (types<<8) | 0xFF;
@@ -2024,16 +2183,19 @@
while (1) {
var current = types & 0xC000;
if (current==0xC000) {
- return;
+ return code;
} else if (current==0x0000) {
args[argcursor++] = this.getWord(this.m_pc);
this.m_pc+=2;
} else if (current==0x4000) {
args[argcursor++] = this.m_memory[this.m_pc++];
} else if (current==0x8000) {
- args[argcursor++] =
this._code_for_varcode(this.m_memory[this.m_pc++]);
- } else {
- gnusto_error(171); // impossible
+// args[argcursor++] =
this._code_for_varcode(this.m_memory[this.m_pc++]);
+ varcode = this._code_for_varcode(this.m_memory[this.m_pc++]);
+ code += varcode[0];
+ args[argcursor++] = varcode[1];
+// } else {
+// gnusto_error(171); // impossible
}

types = (types << 2) | 0x3;
@@ -2047,11 +2209,11 @@
_compile: function ge_compile() {

this.m_compilation_running = 1;
- code = '';
- var starting_pc = this.m_pc;
+ var code = '', starting_pc = this.m_pc, varcode;

// Counter for naming any temporary variables that we create.
- var temp_var_counter = 0;
+// var temp_var_counter = 0;
+ temp_var = 0;

do {
// List of arguments to the opcode.
@@ -2060,7 +2222,9 @@
this_instr_pc = this.m_pc;

// Add the touch (see bug 4687). This lets us track progress simply.
- code = code + '_touch('+this.m_pc+');';
+// touch() has a huge overhead and without tracing there's no need for
it. Whether this replacement is even useful is a good question...
+// code = code + '_touch('+this.m_pc+');';
+// code = code + 'm_pc = ' + this.m_pc + ';';

// So here we go...
// what's the opcode?
@@ -2074,9 +2238,7 @@
} else if (instr==190) { // Extended opcode.

instr = 1000+this.m_memory[this.m_pc++];
- this._handle_variable_parameters(args,
- this.m_memory[this.m_pc++],
- 1);
+ code += this._handle_variable_parameters(args,
this.m_memory[this.m_pc++], 1);

} else if (instr & 0x80) {
if (instr & 0x40) { // Variable params
@@ -2090,56 +2252,64 @@
// We get more of them!
var types = this.getUnsignedWord(this.m_pc);
this.m_pc += 2;
- this._handle_variable_parameters(args, types, 2);
+ code += this._handle_variable_parameters(args, types, 2);
} else
- this._handle_variable_parameters(args,
- this.m_memory[this.m_pc++],
- 1);
+ code += this._handle_variable_parameters(args,
this.m_memory[this.m_pc++], 1);

} else { // Short. All 1-OPs except for one 0-OP.

- switch(instr & 0x30) {
- case 0x00:
- args[0] = this.getWord(this.m_pc);
- this.m_pc+=2;
- instr = (instr & 0x0F) | 0x80;
- break;
-
- case 0x10:
- args[0] = this.m_memory[this.m_pc++];
- instr = (instr & 0x0F) | 0x80;
- break;
-
- case 0x20:
- args[0] =
- this._code_for_varcode(this.m_memory[this.m_pc++]);
- instr = (instr & 0x0F) | 0x80;
- break;
-
- case 0x30:
- // 0-OP. We don't need to get parameters, but we
- // *do* need to translate the opcode.
- instr = (instr & 0x0F) | 0xB0;
- break;
- }
+ switch(instr & 0x30) {
+ case 0x00:
+ args[0] = this.getWord(this.m_pc);
+ this.m_pc+=2;
+ instr = (instr & 0x0F) | 0x80;
+ break;
+
+ case 0x10:
+ args[0] = this.m_memory[this.m_pc++];
+ instr = (instr & 0x0F) | 0x80;
+ break;
+
+ case 0x20:
+// args[0] = this._code_for_varcode(this.m_memory[this.m_pc++]);
+ varcode = this._code_for_varcode(this.m_memory[this.m_pc++]);
+ code += varcode[0];
+ args[0] = varcode[1];
+ instr = (instr & 0x0F) | 0x80;
+ break;
+
+ case 0x30:
+ // 0-OP. We don't need to get parameters, but we
+ // *do* need to translate the opcode.
+ instr = (instr & 0x0F) | 0xB0;
+ break;
+ }
}
} else { // Long

if (instr & 0x40)
- args[0] =
- this._code_for_varcode(this.m_memory[this.m_pc++]);
+ {
+// args[0] = this._code_for_varcode(this.m_memory[this.m_pc++]);
+ varcode = this._code_for_varcode(this.m_memory[this.m_pc++]);
+ code += varcode[0];
+ args[0] = varcode[1];
+ }
else
args[0] = this.m_memory[this.m_pc++];

if (instr & 0x20)
- args[1] =
- this._code_for_varcode(this.m_memory[this.m_pc++]);
+ {
+// args[1] = this._code_for_varcode(this.m_memory[this.m_pc++]);
+ varcode = this._code_for_varcode(this.m_memory[this.m_pc++]);
+ code += varcode[0];
+ args[1] = varcode[1];
+ }
else
args[1] = this.m_memory[this.m_pc++];

instr &= 0x1F;
}
-
+/***
// We need to ensure that arguments are popped from the
// stack in the right order, regardless of the order in
// which code in JITspace uses them; so here we figure out
@@ -2154,7 +2324,7 @@
code += "var " + temp_var_name + " = m_gamestack.pop();";
args[i] = temp_var_name;
}
-
+***/
if (this.m_handlers[instr]) {

code = code + this.m_handlers[instr](this, args)+';';
@@ -2185,9 +2355,13 @@
code = code + 'm_pc='+this.m_pc;
}

- // Name the function after the starting position, to make life
- // easier for Venkman.
- return 'function J'+starting_pc.toString(16)+'(){'+code+'}';
+ // Code optimisations
+ // Don't push() and pop(), just set variables directly
+ code = code.replace(/m_gamestack\.push\(([^;]+)\);var tmp_(\d+) =
m_gamestack\.pop\(\);/, 'var tmp_$2 = $1;');
+
+ // Name the function after the starting position, to make life
+ // easier for Venkman.
+ return 'function JIT_' + starting_pc.toString(16) + '_' + starting_pc
+ '(){' + code + '}';
},

_param_count: function ge_param_count() {
@@ -2251,7 +2425,7 @@
},

_zscii_char_to_ascii: function ge_zscii_char_to_ascii(zscii_code) {
- if (zscii_code<0 || zscii_code>1023) {
+ if (zscii_code < 0) {
gnusto_error(702, zscii_code); // illegal zscii code
}

@@ -2287,6 +2461,33 @@
return String.fromCharCode(result);
},

+ _ascii_code_to_zscii_code: function ge_ascii_char_to_zscii(ascii_code) {
+ if ((ascii_code>=32 && ascii_code<=126) || ascii_code==0) {
+ // Most common case - keep it as fast as possible
+ return ascii_code;
+ }
+
+ var result;
+
+ if (ascii_code < 0) {
+ gnusto_error(702, 'Illegal unicode character:' + ascii_code); //
illegal ascii code
+ } else if (ascii_code==13 || ascii_code==10) {
+ result = 10;
+ } else if ((ascii_code>=32 && ascii_code<=126) || ascii_code==0) {
+ result = ascii_code;
+ } else {
+ // Must be among extra characters.
+ result = reverse_unicode_table[ascii_code];
+ if(!result) {
+ // gnusto_error(703, 'No ZSCII equivalent found for this unicode
character code: ' + ascii_code); // unknown ascii code
+ // Let's translate it into '*' for now. Should we raise an error
instead?
+ result = '*'.charCodeAt(0);
+ }
+ }
+
+ return result;
+ },
+
_random_number: function ge_random_number(arg) {

if (arg==0) {
@@ -2665,32 +2866,31 @@

var max_chars;
var result;
+ var storage;

if (this.m_version <= 4) {

- // In z1-z4, the array is null-terminated.
+ // In z1-z4, the array is null-terminated.

- max_chars = this.m_memory[text_buffer]+1;
- result = entered.substring(0,max_chars).toLowerCase();
-
- for (var i=0;i<result.length;i++) {
- this.setByte(result.charCodeAt(i), text_buffer + 1 + i);
- }
-
- this.setByte(0, text_buffer + 1 + result.length);
+ max_chars = this.m_memory[text_buffer]+1;
+ result = entered.substring(0,max_chars).toLowerCase();
+ storage = text_buffer + 1;
+ this.setByte(0, text_buffer + 1 + result.length);

} else {

- // In z5-z8, the array starts with a size byte.
+ // In z5-z8, the array starts with a size byte.

- max_chars = this.m_memory[text_buffer];
- result = entered.substring(0,max_chars);
+ max_chars = this.m_memory[text_buffer];
+ result = entered.substring(0,max_chars).toLowerCase();
+ storage = text_buffer + 2;
+ this.setByte(result.length, text_buffer + 1);

- this.setByte(result.length, text_buffer + 1);
+ }

- for (var i=0;i<result.length;i++) {
- this.setByte(result.charCodeAt(i), text_buffer + 2 + i);
- }
+ // Turn into ZSCII and store in text buffer
+ for (var i=0;i<result.length;i++) {
+ this.setByte(this._ascii_code_to_zscii_code(result.charCodeAt(i)),
storage + i);
}

if (parse_buffer!=0 || this.m_version<5) {
@@ -3380,7 +3580,7 @@

if (b==0) break;

- source = source + this._zscii_char_to_ascii(b);
+ source = source + String.fromCharCode(b);
zscii_text++;
length--;
}
@@ -3428,42 +3628,84 @@
}
}

- // Need to handle other alphabets. At present we only
- // handle alphabetic characters (A0).
- // Also need to handle ten-bit characters.
- // FIXME: Are the above still true?
-
- var cursor = 0;
-
- while (cursor<str.length && result.length<6) {
- var ch = str.charCodeAt(cursor++);
-
- if (ch>=65 && ch<=90) { // A to Z
- // These are NOT mapped to A1. ZSD3.7
- // explicitly forbids use of upper case
- // during encoding.
- emit(ch-59);
- } else if (ch>=97 && ch<=122) { // a to z
- emit(ch-91);
- } else {
- var z2 = this.m_zalphabet[2].indexOf(String.fromCharCode(ch));
+ // Huge thanks to fredrik.ramsberg for fixing the following section!

- if (z2!=-1) {
- if (this.getByte(0)>2) {
- emit(5); // shift to weird stuff
- } else { emit(3);} //use a shift as 5 is shift_lock in z1-2
+ var ch, cursor = 0, z2;

- emit(z2+6);
- } else {
- if (this.getByte(0)>2) {
- emit(5);
- } else { emit(3);} //use a shift as 5 is shift_lock in z1-2
- emit(6);
- emit(ch >> 5);
- emit(ch & 0x1F);
- }
+ while (cursor < str.length && result.length < dictionary_entry_length)
+ {
+ ch = str.charCodeAt(cursor++);
+
+ // Downcase any uppercase characters
+ if (ch >= 65 && ch <= 90)
+ ch += 32;
+ else if (ch > 154)
+ {
+ if(this.m_unicode_start == 0)
+ {
+ // It's an extended character AND the game uses the regular
+ // unicode translation table, so we know how to downcase.
+ if ((ch >= 158 && ch <= 160) || (ch >= 167 && ch <= 168) || (ch >=
208 && ch <= 210))
+ ch -= 3;
+ else if (ch >= 175 && ch <= 180)
+ ch -= 6;
+ else if ((ch >= 186 && ch <= 190) || (ch >= 196 && ch <= 200))
+ ch -= 5;
+ else if (ch == 217 || ch == 218)
+ ch -= 2;
+ else if (ch == 202 || ch == 204 || ch == 212 || ch == 214 || ch ==
221)
+ ch -= 1;
+ }
+ else
+ {
+ // For extended characters using custom unicode translation table,
+ // rely on JavaScripts downcasing function
+ var cnew =
this._ascii_code_to_zscii_code(this._zscii_char_to_ascii(ch).toLowerCase().charCodeAt(0));
+ if(cnew > 0 && cnew <= 251 && cnew != '*'.charCodeAt(0))
+ ch = cnew;
+ }
+ }
+
+ // Convert ch to unicode, since alphabet tables are in unicode.
+ var ch_uni =
String.fromCharCode(this._zscii_char_to_ascii(ch).charCodeAt(0));
+
+ z2 = this.m_zalphabet[0].indexOf(ch_uni);
+ if (z2 != -1)
+ // ch was found in alphabet A0: Just output position + 6
+ emit(z2 + 6);
+ else
+ {
+ z2=this.m_zalphabet[1].indexOf(ch_uni);
+ if (z2 != -1)
+ {
+ // ch was found in alphabet A1. Output a shift character and ch + 6
+ if (this.getByte(0) > 2)
+ emit(4); // shift to A1
+ else
+ emit(2); // shift is positioned differently in z1-2
+ emit(z2 + 6);
+ } else {
+ z2 = this.m_zalphabet[2].indexOf(ch_uni);
+ if (z2 != -1)
+ {
+ // ch was found in alphabet A2. Output a shift character and ch + 6
+ if (this.getByte(0) > 2)
+ emit(5); // shift to A2
+ else
+ emit(3); // shift is positioned differently in in z1-2
+ emit(z2 + 6);
+ } else {
+ if (this.getByte(0) > 2)
+ emit(5);
+ else
+ emit(3); //shift is positioned differently in z1-2
+ emit(6);
+ emit(ch >> 5);
+ emit(ch & 0x1F);
}
+ }
}
+ }

while (result.length<dictionary_entry_length) {
emit(5);
@@ -3517,9 +3759,10 @@
var current = this.m_streamthrees[0];
var address = this.m_streamthrees[0][1];

- for (var i=0; i<text.length; i++) {
- this.setByte(text.charCodeAt(i), address++);
- }
+ // Argument "text" is in Unicode. For storage in Z-machine memory, we
+ // need to convert it to ZSCII
+ for (var i = 0; i < text.length; i++)
+ this.setByte(this._ascii_code_to_zscii_code(text.charCodeAt(i)),
address++);

this.m_streamthrees[0][1] = address;
} else {
@@ -3579,9 +3822,13 @@
////////////////////////////////////////////////////////////////
//
// code_for_varcode
- //
- // should one day be replaced by varcode_[sg]et, probably.
- //
+ // Generates code to access variable operands
+ // variable is interpreted as in ZSD 4.2.2:
+ // 0 = top of game stack
+ // 1-15 = local variables
+ // 16 up = global variables
+
+/***
_code_for_varcode: function ge_code_for_varcode(varcode) {
if (varcode==0) {
return ARG_STACK_POP;
@@ -3592,6 +3839,27 @@
}

gnusto_error(170, 'code_for_varcode'); // impossible
+ },
+***/
+
+ _code_for_varcode: function ge_code_for_varcode(variable) {
+ var code = '', arg;
+ if (variable == 0)
+ {
+ code = 'var tmp_' + (++temp_var) + ' = m_gamestack.pop();';
+ arg = 'tmp_' + temp_var;
+ }
+ else if (variable < 0x10)
+ arg = 'm_locals[' + (variable - 1) + ']';
+ else
+ {
+ var high = this.m_vars_start + (variable - 16) * 2, low = high + 1;
+ var tmp = 'tmp_' + (++temp_var);
+ code = 'var ' + tmp + ' = (m_memory[' + high + '] << 8) | m_memory[' +
low + '];' +
+ tmp + ' = (' + tmp + ' & 0x8000 ? ~0xFFFF : 0) | ' + tmp + ';';
+ arg = tmp;
+ }
+ return [code, arg];
},

////////////////////////////////////////////////////////////////

Copied: branches/dannii-testing/lib/gnusto-engine.min.js (from r126,
/trunk/lib/gnusto-engine.min.js)
==============================================================================
--- /trunk/lib/gnusto-engine.min.js (original)
+++ branches/dannii-testing/lib/gnusto-engine.min.js Mon Mar 23 20:34:58
2009
@@ -1 +1 @@
-var CVS_VERSION="$Date: 2005/04/26 01:50:32 $";var
ENGINE_DESCRIPTION="Gnusto's interactive fiction engine";var
default_unicode_translation_table={155:228,156:246,157:252,158:196,159:214,160:220,161:223,162:187,163:171,164:235,165:239,166:255,167:203,168:207,169:225,170:233,171:237,172:243,173:250,174:253,175:193,176:201,177:205,178:211,179:218,180:221,181:224,182:232,183:236,184:242,185:249,186:192,187:200,188:204,189:210,190:217,191:226,192:234,193:238,194:244,195:251,196:194,197:202,198:206,199:212,200:219,201:229,202:197,203:248,204:216,205:227,206:241,207:245,208:195,209:209,210:213,211:230,212:198,213:231,214:199,215:254,216:240,217:222,218:208,219:163,220:339,221:338,222:161,223:191};var
reverse_unicode_table={};var PARENT_REC=0;var SIBLING_REC=1;var
CHILD_REC=2;var CALLED_FROM_INTERRUPT=0;var ARG_STACK_POP="SP";var
GNUSTO_EFFECT_INPUT='"RS"';var GNUSTO_EFFECT_INPUT_CHAR='"RC"';var
GNUSTO_EFFECT_SAVE='"DS"';var GNUSTO_EFFECT_RESTORE='"DR"';var
GNUSTO_EFFECT_QUIT='"QU"';var GNUSTO_EFFECT_RESTART='"NU"';var
GNUSTO_EFFECT_WIMP_OUT='"WO"';var GNUSTO_EFFECT_BREAKPOINT='"BP"';var
GNUSTO_EFFECT_FLAGS_CHANGED='"XC"';var GNUSTO_EFFECT_PIRACY='"CP"';var
GNUSTO_EFFECT_STYLE='"SS"';var GNUSTO_EFFECT_SOUND='"FX"';var
GNUSTO_EFFECT_SPLITWINDOW='"TW"';var GNUSTO_EFFECT_SETWINDOW='"SW"';var
GNUSTO_EFFECT_ERASEWINDOW='"YW"';var GNUSTO_EFFECT_ERASELINE='"YL"';var
GNUSTO_EFFECT_SETCURSOR='"SC"';var GNUSTO_EFFECT_SETBUFFERMODE='"SB"';var
GNUSTO_EFFECT_SETINPUTSTREAM='"SI"';var GNUSTO_EFFECT_GETCURSOR='"GC"';var
GNUSTO_EFFECT_PRINTTABLE='"PT"';function
handleZ_je(d,b){if(b.length<2){return""}else{if(b.length==2){return
d._brancher(b[0]+"=="+b[1])}else{var e="";for(var
c=1;c<b.length;c++){if(c!=1){e=e+"|
|"}e=e+"t=="+b[c]}return"t="+b[0]+";"+d._brancher(e)}}}function
handleZ_jl(c,b){return c._brancher(b[0]+"<"+b[1])}function
handleZ_jg(c,b){return c._brancher(b[0]+">"+b[1])}function
handleZ_dec_chk(c,b){return"t="+b[0]+";t2=_varcode_get(t)-1;_varcode_set(t2,t);"+c._brancher("t2<"+b[1])}function
handleZ_inc_chk(c,b){return"t="+b[0]+";t2=_varcode_get(t)+1;_varcode_set(t2,t);"+c._brancher("t2>"+b[1])}function
handleZ_jin(c,b){return c._brancher("_obj_in("+b[0]+","+b[1]+")")}function
handleZ_test(c,b){return"t="+b[1]+";"+c._brancher("("+b[0]+"&t)==t")}function
handleZ_or(c,b){return c._storer("("+b[0]+"|"+b[1]+")&0xffff")}function
handleZ_and(c,b){return c._storer(b[0]+"&"+b[1]+"&0xffff")}function
handleZ_test_attr(c,b){return
c._brancher("_test_attr("+b[0]+","+b[1]+")")}function
handleZ_set_attr(c,b){return"_set_attr("+b[0]+","+b[1]+")"}function
handleZ_clear_attr(c,b){return"_clear_attr("+b[0]+","+b[1]+")"}function
handleZ_store(c,b){return"_varcode_set("+b[1]+","+b[0]+")"}function
handleZ_insert_obj(c,b){return"_insert_obj("+b[0]+","+b[1]+")"}function
handleZ_loadw(c,b){return
c._storer("getWord((1*"+b[0]+"+2*"+b[1]+")&0xFFFF)")}function
handleZ_loadb(c,b){return
c._storer("m_memory[0xFFFF&(1*"+b[0]+"+1*"+b[1]+")]")}function
handleZ_get_prop(c,b){return
c._storer("_get_prop("+b[0]+","+b[1]+")")}function
handleZ_get_prop_addr(c,b){return
c._storer("_get_prop_addr("+b[0]+","+b[1]+")")}function
handleZ_get_next_prop(c,b){return
c._storer("_get_next_prop("+b[0]+","+b[1]+")")}function
handleZ_add(c,b){return c._storer(b[0]+"*1+"+b[1]+"*1")}function
handleZ_sub(c,b){return c._storer(b[0]+"-"+b[1])}function
handleZ_mul(c,b){return c._storer(b[0]+"*"+b[1])}function
handleZ_div(c,b){return
c._storer("_trunc_divide("+b[0]+","+b[1]+")")}function
handleZ_mod(c,b){return c._storer(b[0]+"%"+b[1])}function
handleZ_set_colour(c,b){return"m_pc="+c.m_pc+";m_effects=["+GNUSTO_EFFECT_STYLE+",-1,"+b[0]+","+b[1]+"];return"}function
handleZ_throw(c,b){c.m_compilation_running=0;return"_throw_stack_frame("+b[0]+");return"}function
handleZ_jz(c,b){return c._brancher(b[0]+"==0")}function
handleZ_get_sibling(c,b){return"t=_get_sibling("+b[0]+");"+c._storer("t")+";"+c._brancher("t")}function
handleZ_get_child(c,b){return"t=_get_child("+b[0]+");"+c._storer("t")+";"+c._brancher("t")}function
handleZ_get_parent(c,b){return c._storer("_get_parent("+b[0]+")")}function
handleZ_get_prop_len(c,b){return
c._storer("_get_prop_len("+b[0]+")")}function
handleZ_inc(c,b){return"t="+b[0]+";_varcode_set(_varcode_get(t)+1,
t)"}function
handleZ_dec(c,b){return"t="+b[0]+";_varcode_set(_varcode_get(t)-1,
t)"}function handleZ_print_addr(c,b){return
c._handler_zOut("_zscii_from("+b[0]+")",0)}function
handleZ_remove_obj(c,b){return"_remove_obj("+b[0]+","+b[1]+")"}function
handleZ_print_obj(c,b){return
c._handler_zOut("_name_of_object("+b[0]+")",0)}function
handleZ_ret(c,b){c.m_compilation_running=0;return"_func_return("+b[0]+");return"}function
handleZ_jump(c,b){c.m_compilation_running=0;if(b[0]&32768){b[0]=(~65535)|
b[0]}var d=(b[0]+c.m_pc)-2;return"m_pc="+d+";return"}function
handleZ_print_paddr(c,b){return
c._handler_zOut("_zscii_from("+c.m_pc_translate_for_string(b[0])+")",0)}function
handleZ_load(c,b){return c._storer("_varcode_get("+b[0]+")")}function
handleZ_rtrue(c,b){c.m_compilation_running=0;return"_func_return(1);return"}function
handleZ_rfalse(c,b){c.m_compilation_running=0;return"_func_return(0);return"}function
handleZ_print(c,b){return c._handler_print("",0)}function
handleZ_print_ret(c,b){c.m_compilation_running=0;return
c._handler_print("\n",1)+";_func_return(1);return"}function
handleZ_nop(c,b){return""}function
handleZ_restart(c,b){c.m_compilation_running=0;return"m_effects=["+GNUSTO_EFFECT_RESTART+"];return"}function
handleZ_ret_popped(c,b){c.m_compilation_running=0;return"_func_return(m_gamestack.pop());return"}function
handleZ_catch(c,b){return c._storer("call_stack.length")}function
handleZ_pop(c,b){return"m_gamestack.pop()"}function
handleZ_quit(c,b){c.m_compilation_running=0;return"m_effects=["+GNUSTO_EFFECT_QUIT+"];return"}function
handleZ_new_line(c,b){return c._handler_zOut("'\\n'",0)}function
handleZ_show_status(c,b){c._handler_zOut("");return""}function
handleZ_verify(c,b){return c._brancher("_verify()")}function
handleZ_illegal_extended(c,b){gnusto_error(199)}function
handleZ_piracy(c,b){c.m_compilation_running=0;var
d="m_rebound=function(){"+c._brancher("(!m_answers[0])")+"};";return"m_pc="+c.m_pc+";"+d+"m_effects=["+GNUSTO_EFFECT_PIRACY+"];return"}function
handleZ_call_1n(c,b){return c._generate_gosub(b[0],"",0)}function
handleZ_call_1s(c,b){return c._generate_gosub(b[0],"",1)}function
handleZ_call_2n(c,b){return c._generate_gosub(b[0],b[1],0)}function
handleZ_call_2s(c,b){return c._generate_gosub(b[0],b[1],1)}function
handleZ_call_vn(c,b){return c._generate_gosub(b[0],b.slice(1),0)}function
handleZ_call_vs(c,b){return c._generate_gosub(b[0],b.slice(1),1)}function
handleZ_store_w(c,b){return"setWord("+b[2]+",1*"+b[0]+"+2*"+b[1]+")"}function
handleZ_storeb(c,b){return"setByte("+b[2]+",1*"+b[0]+"+1*"+b[1]+")"}function
handleZ_putprop(c,b){return"_put_prop("+b[0]+","+b[1]+","+b[2]+")"}function
handleZ_read(f,i){var g;var b;f.m_compilation_running=0;var
h="_aread(m_answers[0],m_rebound_args[1],m_rebound_args[2],m_answers[1])";var
j;var
d;if(f.m_version>=5){h=f._storer(h)}if(f.m_version>=5){j="m_memory[0xFFFF&a0+1]";d="m_memory[0xFFFF&a0]"}else{j="0";d="m_memory[0xFFFF&a0]+1"}if(i[2]&&i[3]&&(f.m_version>=4)){g=i[2];b=f.m_pc_translate_for_routine(i[3])}else{g="0";b="0"}var
c="m_rebound=function(){var
t=1*m_answers[0];if(t<0){_func_interrupt(m_rebound_args[0],onISRReturn_for_read);}else{"+h+";}};";var
e="m_rebound_args=["+b+",a0,"+i[1]+",];";return"var
a0=eval("+i[0]+");m_pc="+f.m_pc+";"+e+c+"m_effects=["+GNUSTO_EFFECT_INPUT+","+g+","+j+","+d+",_terminating_characters()];return"}function
handleZ_print_char(c,b){return
c._handler_zOut("_zscii_char_to_ascii("+b[0]+")",0)}function
handleZ_print_num(c,b){return c._handler_zOut(b[0],0)}function
handleZ_random(c,b){return c._storer("_random_number("+b[0]+")")}function
handleZ_push(c,b){return"m_gamestack.push("+b[0]+")"}function
handleZ_pull(c,b){return"_varcode_set(m_gamestack.pop(),"+b[0]+")"}function
handleZ_split_window(c,b){c.m_compilation_running=0;return"m_pc="+c.m_pc+";m_effects=["+GNUSTO_EFFECT_SPLITWINDOW+","+b[0]+"];return"}function
handleZ_set_window(c,b){c.m_compilation_running=0;return"m_pc="+c.m_pc+";m_effects=["+GNUSTO_EFFECT_SETWINDOW+","+b[0]+"];return"}function
handleZ_erase_window(c,b){c.m_compilation_running=0;return"m_pc="+c.m_pc+";m_effects=["+GNUSTO_EFFECT_ERASEWINDOW+","+b[0]+"];return"}function
handleZ_erase_line(c,b){c.m_compilation_running=0;return"m_pc="+c.m_pc+";m_effects=["+GNUSTO_EFFECT_ERASELINE+","+b[0]+"];return"}function
handleZ_set_cursor(c,b){c.m_compilation_running=0;return"m_pc="+c.m_pc+";m_effects=["+GNUSTO_EFFECT_SETCURSOR+","+b[0]+","+b[1]+"];return"}function
handleZ_get_cursor(c,b){c.m_compilation_running=0;return"m_pc="+c.m_pc+";m_effects=["+GNUSTO_EFFECT_GETCURSOR+","+b[0]+"];return"}function
handleZ_set_text_style(c,b){c.m_compilation_running=0;return"m_pc="+c.m_pc+";m_effects=["+GNUSTO_EFFECT_STYLE+","+b[0]+",0,0];return"}function
handleZ_buffer_mode(c,b){c.m_compilation_running=0;return"m_pc="+c.m_pc+";m_effects=["+GNUSTO_EFFECT_SETBUFFERMODE+","+b[0]+"];return"}function
handleZ_output_stream(c,b){return"_set_output_stream("+b[0]+","+b[1]+")"}function
handleZ_input_stream(c,b){c.m_compilation_running=0;return"m_pc="+c.m_pc+";m_effects=["+GNUSTO_EFFECT_SETINPUTSTREAM+","+b[0]+"];return"}function
handleZ_sound_effect(c,b){c.m_compilation_running=0;while(b.length<5){b.push(0)}return"m_pc="+c.m_pc+";m_effects=["+GNUSTO_EFFECT_SOUND+","+b[0]+","+b[1]+","+b[2]+","+b[3]+","+b[4]+"];return"}function
handleZ_read_char(e,c){var f;var d;var
b;e.m_compilation_running=0;if(c[1]&&c[2]&&(e.m_version>=4)){f=c[1];d="m_rebound_args=["+e.m_pc_translate_for_routine(c[2])+"];";b="m_rebound=function(){var
t=1*m_answers[0];if(t<0){_func_interrupt(m_rebound_args[0],onISRReturn_for_read_char);}else{"+e._storer("t")+"}};"}else{f="0";d="";b="m_rebound=function(){"+e._storer("1*m_answers[0]")+"};"}return"m_pc="+e.m_pc+";"+d+b+"m_effects=["+GNUSTO_EFFECT_INPUT_CHAR+","+f+"];return"}function
handleZ_scan_table(c,b){if(b.length==4){return"t=_scan_table("+b[0]+","+b[1]+"&0xFFFF,"+b[2]+"&0xFFFF,"+b[3]+");"+c._storer("t")+";"+c._brancher("t")}else{return"t=_scan_table("+b[0]+","+b[1]+"&0xFFFF,"+b[2]+"&0xFFFF,"+130+");"+c._storer("t")+";"+c._brancher("t")}}function
handleZ_not(c,b){return c._storer("~"+b[0]+"&0xffff")}function
handleZ_tokenise(c,b){return"_tokenise(("+b[0]+")&0xFFFF,("+b[1]+")&0xFFFF,"+b[2]+","+b[3]+")"}function
handleZ_encode_text(c,b){return"_encode_text("+b[0]+","+b[1]+","+b[2]+","+b[3]+")"}function
handleZ_copy_table(c,b){return"_copy_table("+b[0]+","+b[1]+","+b[2]+")"}function
handleZ_print_table(c,b){if(b.length<3){b.push(1)}if(b.length<4){b.push(0)}return"m_pc="+c.m_pc+";m_effects=_print_table("+b[0]+","+b[1]+","+b[2]+","+b[3]+");return"}function
handleZ_check_arg_count(c,b){return
c._brancher(b[0]+"<=_param_count()")}function
handleZ_saveV123(c,b){c.m_compilation_running=0;var
d="m_rebound=function(){"+c._brancher("m_answers[0]")+"};";return"m_state_to_save=_saveable_state(1);m_pc="+c.m_pc+";"+d+";m_effects=["+GNUSTO_EFFECT_SAVE+"];return"}function
handleZ_saveV45678(c,b){c.m_compilation_running=0;var
d="m_rebound=function()
{ "+c._storer("m_answers[0]")+"};";return"m_state_to_save=_saveable_state("+(c.m_version==4?"1":"3")+");m_pc="+c.m_pc+";"+d+";m_effects=["+GNUSTO_EFFECT_SAVE+"];return"}function
handleZ_restoreV123(c,b){c.m_compilation_running=0;c._brancher("");return"m_pc="+c.m_pc+";m_effects=["+GNUSTO_EFFECT_RESTORE+"];return"}function
handleZ_restoreV45678(c,b){c.m_compilation_running=0;var
d="m_rebound=function() { var t=m_answers[0]; if
(t==0){"+c._storer("t")+"}};";return"m_pc="+c.m_pc+";"+d+"m_effects=["+GNUSTO_EFFECT_RESTORE+"];return"}function
handleZ_log_shift(c,b){return
c._storer("_log_shift("+b[0]+","+b[1]+")")}function
handleZ_art_shift(c,b){return
c._storer("_art_shift("+b[0]+","+b[1]+")")}function
handleZ_set_font(c,b){return c._storer("("+b[0]+"<2?1:0)")}function
handleZ_save_undo(c,b){return c._storer("_save_undo(3)")}function
handleZ_restore_undo(c,b){return"if(_restore_undo(3))return;"+c._storer("0")}function
handleZ_print_unicode(c,b){return
c._handler_zOut("String.fromCharCode("+b[0]+")",0)}function
handleZ_check_unicode(c,b){return c._storer("3")}var
handlers_v578={1:handleZ_je,2:handleZ_jl,3:handleZ_jg,4:handleZ_dec_chk,5:handleZ_inc_chk,6:handleZ_jin,7:handleZ_test,8:handleZ_or,9:handleZ_and,10:handleZ_test_attr,11:handleZ_set_attr,12:handleZ_clear_attr,13:handleZ_store,14:handleZ_insert_obj,15:handleZ_loadw,16:handleZ_loadb,17:handleZ_get_prop,18:handleZ_get_prop_addr,19:handleZ_get_next_prop,20:handleZ_add,21:handleZ_sub,22:handleZ_mul,23:handleZ_div,24:handleZ_mod,25:handleZ_call_2s,26:handleZ_call_2n,27:handleZ_set_colour,28:handleZ_throw,128:handleZ_jz,129:handleZ_get_sibling,130:handleZ_get_child,131:handleZ_get_parent,132:handleZ_get_prop_len,133:handleZ_inc,134:handleZ_dec,135:handleZ_print_addr,136:handleZ_call_1s,137:handleZ_remove_obj,138:handleZ_print_obj,139:handleZ_ret,140:handleZ_jump,141:handleZ_print_paddr,142:handleZ_load,143:handleZ_call_1n,176:handleZ_rtrue,177:handleZ_rfalse,178:handleZ_print,179:handleZ_print_ret,180:handleZ_nop,183:handleZ_restart,184:handleZ_ret_popped,185:handleZ_catch,186:handleZ_quit,187:handleZ_new_line,189:handleZ_verify,190:handleZ_illegal_extended,191:handleZ_piracy,224:handleZ_call_vs,225:handleZ_store_w,226:handleZ_storeb,227:handleZ_putprop,228:handleZ_read,229:handleZ_print_char,230:handleZ_print_num,231:handleZ_random,232:handleZ_push,233:handleZ_pull,234:handleZ_split_window,235:handleZ_set_window,236:handleZ_call_vs,237:handleZ_erase_window,238:handleZ_erase_line,239:handleZ_set_cursor,240:handleZ_get_cursor,241:handleZ_set_text_style,242:handleZ_buffer_mode,243:handleZ_output_stream,244:handleZ_input_stream,245:handleZ_sound_effect,246:handleZ_read_char,247:handleZ_scan_table,248:handleZ_not,249:handleZ_call_vn,250:handleZ_call_vn,251:handleZ_tokenise,252:handleZ_encode_text,253:handleZ_copy_table,254:handleZ_print_table,255:handleZ_check_arg_count,1000:handleZ_saveV45678,1001:handleZ_restoreV45678,1002:handleZ_log_shift,1003:handleZ_art_shift,1004:handleZ_set_font,1009:handleZ_save_undo,1010:handleZ_restore_undo,1011:handleZ_print_unicode,1012:handleZ_check_unicode};var
handlers_fixups={1:{25:0,26:0,27:0,28:0,136:0,143:handleZ_not,181:handleZ_saveV123,182:handleZ_restoreV123,185:handleZ_pop,188:handleZ_show_status,190:0,191:0,236:0,237:0,238:0,239:0,240:0,241:0,242:0,246:0,247:0,248:0,249:0,250:0,251:0,252:0,253:0,254:0,255:0},2:{25:0,26:0,27:0,28:0,136:0,143:handleZ_not,181:handleZ_saveV123,182:handleZ_restoreV123,185:handleZ_pop,188:handleZ_show_status,190:0,191:0,236:0,237:0,238:0,239:0,240:0,241:0,242:0,246:0,247:0,248:0,249:0,250:0,251:0,252:0,253:0,254:0,255:0},3:{25:0,26:0,27:0,28:0,136:0,143:handleZ_not,181:handleZ_saveV123,182:handleZ_restoreV123,185:handleZ_pop,188:handleZ_show_status,190:0,191:0,236:0,237:0,238:0,239:0,240:0,241:0,242:0,246:0,247:0,248:0,249:0,250:0,251:0,252:0,253:0,254:0,255:0},4:{26:0,27:0,28:0,143:handleZ_not,181:handleZ_saveV45678,182:handleZ_restoreV45678,185:handleZ_pop,190:0,191:0,248:0,249:0,250:0,251:0,252:0,253:0,254:0,255:0},5:"",6:undefined,7:"",8:""};function
pc_translate_v123(a){return"(("+a+")&0xFFFF)*2"}function
pc_translate_v45(a){return"(("+a+")&0xFFFF)*4"}function
pc_translate_v67R(a){return"(("+a+")&0xFFFF)*4+"+this.m_routine_start}function
pc_translate_v67S(a){return"(("+a+")&0xFFFF)*4+"+this.m_string_start}function
pc_translate_v8(a){return"(("+a+")&0xFFFF)*8"}function
gnusto_error(b){message="Component: engine\n";for(var
a=1;a<arguments.length;a++){if(arguments[a]&&arguments[a].toString){message+="\nDetail: "+arguments[a].toString()}}throw
new FatalError(message)}function
onISRReturn_for_read_char(b,a){if(a){b.engine.m_answers[0]=0;b.rebound()}else{b.engine.m_effects=b.effects;b.engine.m_rebound=b.rebound;b.engine.m_rebound_args=b.rebound_args}}function
onISRReturn_for_read(b,a){var
c=b.engine;if(a){c.m_answers[0]=0;c.m_answers[1]="";b.rebound()}else{c.m_effects=b.effects;c.m_rebound=b.rebound;c.m_rebound_args=b.rebound_args}}function
GnustoEngine(a){if(a){this.logger=function(d,c){a("gnusto-engine: "+d+": "+c)}}else{this.logger=function(){}}}GnustoEngine.prototype={loadStory:function
ge_loadStory(a){this.m_memory=a;this._initial_setup()},loadSavedGame:function
ge_loadSavedGame(memLen,mem,mem_is_compressed,stacksLen,stacks,pc){function
decodeStackInt(offset,length){var result=stacks[offset++];for(var
i=1;i<length;i++){result=(result<<8)|stacks[offset++]}return
result}if(mem_is_compressed){var temp=[];var cursor_compressed=0;var
cursor_original=0;while(cursor_compressed<mem.length){if(cursor_original>=this.m_original_memory.length){gnusto_error(999,"overshoot
in decompression")}var
candidate=mem[cursor_compressed++];if(candidate==0){var
run_length=mem[cursor_compressed++]+1;temp=temp.concat(this.m_original_memory.slice(cursor_original,cursor_original+run_length));cursor_original+=run_length}else{temp.push(candidate^this.m_original_memory[cursor_original++])}}mem=temp}this.m_call_stack=[];this.m_gamestack=[];this.m_locals_stack=[];this.m_locals=[];this.m_result_targets=[];var
evals_count=0;evals_count=decodeStackInt(7,1);this.m_gamestack_callbreaks=[];var
callbreaks_top=evals_count;var cursor=8;for(var
m=0;m<evals_count;m++){this.m_gamestack.push(decodeStackInt(cursor,2));cursor+=2}while(cursor<stacksLen){this.m_call_stack.push(decodeStackInt(cursor,3));cursor+=3;var
flags=stacks[cursor++];var
varcode=stacks[cursor++];if(flags&16){varcode=-1}var
locals_count=flags&15;this.m_locals_stack.unshift(locals_count);this.m_result_targets.push(varcode);var
logArgs=stacks[cursor++]+1;var
argCount=0;while(logArgs>1){logArgs>>=1;argCount++}this.m_param_counts.unshift(argCount);evals_count=decodeStackInt(cursor,2);cursor+=2;callbreaks_top+=evals_count;this.m_gamestack_callbreaks.push(callbreaks_top);var
locals_temp=[];for(var
k=0;k<locals_count;k++){locals_temp.push(decodeStackInt(cursor,2));cursor+=2}this.m_locals=locals_temp.concat(this.m_locals);for(var
m=0;m<evals_count;m++){this.m_gamestack.push(decodeStackInt(cursor,2));cursor+=2}}for(var
n=0;n<16;n++){this.m_locals.push(0)}this.m_memory=mem.concat(this.m_memory.slice(mem.length));if(this.m_version<=3){this.m_pc=pc;eval("var
t=new
Function('with(this){'+_brancher('1')+'}');t.call(this);")}else{this._varcode_set(2,this.m_memory[pc]);this.m_pc=pc+1}},resetStory:function
ge_resetStory(){this.m_memory=this.m_original_memory.slice();this._initial_setup()},version:function
ge_version(){gnusto_error(101,"'version' not
implemented")},signature:function
ge_signature(){gnusto_error(101,"'signature' not
implemented")},cvsVersion:function ge_cvsVersion(){return
CVS_VERSION.substring(7,26)},setGoldenTrail:function
ge_setGoldenTrail(a){if(a){this.m_goldenTrail=1}else{this.m_goldenTrail=0}},setCopperTrail:function
ge_setCopperTrail(a){if(a){this.m_copperTrail=1}else{this.m_copperTrail=0}},effect:function
ge_effect(a){return this.m_effects[a]},answer:function
ge_answer(b,a){this.m_answers[b]=a},run:function ge_run(){var
start_pc=0;var turns=0;var jscode;var
turns_limit=this.m_single_step?1:10000;if(this.m_rebound){this.m_rebound();this.m_rebound=0;this.m_rebound_args=[]}this.m_effects=[];while(this.m_effects.length==0){if(turns++>=turns_limit){this.m_effects=["WO"];return
1}start_pc=this.m_pc;if(this.m_jit[start_pc]){jscode=this.m_jit[start_pc]}else{jscode=eval("with
(this)
{dummy="+this._compile()+"}");if(start_pc>=this.m_stat_start){this.m_jit[start_pc]=jscode}}if(this.m_copperTrail){this.logger("pc",start_pc.toString(16));this.logger("jit",jscode)}jscode()}},walk:function
ge_walk(a){gnusto_error(101,"'walk' not
implemented")},setRandomSeed:function
ge_setRandomSeed(a){if(a>0){this._random_number(-a)}else{this._random_number(a)}},saveGame:function
ge_saveGame(){function c(A,k){var j=[];j.length=k;for(var
m=0;m<k;m++){j[(k-m)-1]=A&255;A>>=8}return j}var d=this.m_state_to_save;var
f=[70,79,82,77];var p=[67,77,101,109];var b=[85,77,101,109];var
l=[83,116,107,115];var
t=[73,70,90,83,73,70,104,100,0,0,0,13,d.m_memory[2],d.m_memory[3],d.m_memory[18],d.m_memory[19],d.m_memory[20],d.m_memory[21],d.m_memory[22],d.m_memory[23],d.m_memory[28],d.m_memory[29],(d.m_pc>>16)&255,(d.m_pc>>8)&255,(d.m_pc)&255,0];if(this.m_compress_save_files){var
n=[];var o=0;for(var
v=0;v<this.m_stat_start;v++){if(d.m_memory[v]==this.m_original_memory[v]){o++;if(o==256){n.push(0);n.push(255);o=0}}else{if(o!=0){n.push(0);n.push(o-1);o=0}n.push(d.m_memory[v]^this.m_original_memory[v])}}if(o!=0){n.push(0);n.push(o-1)}t=t.concat(p);t=t.concat(c(n.length,4));t=t.concat(n);if((n.length%2)!=0){t.push(0)}}else{t=t.concat(b);t=t.concat(c(this.m_stat_start,4));t=t.concat(this.m_memory.slice(0,this.m_stat_start));if((this.m_stat_start%2)!=0){t.push(0)}}var
w=[0,0,0,0,0,0];w=w.concat(c(this.m_gamestack_callbreaks[0],2));var
y=this.m_locals.length-16;var a=0;for(var
r=0;r<this.m_gamestack_callbreaks[0];r++){w=w.concat(c(this.m_gamestack[a++],2))}for(var
u=0;u<this.m_call_stack.length;u++){w=w.concat(c(this.m_call_stack[u],3));var
q=this.m_locals_stack[this.m_locals_stack.length-(u+1)];var e=q;var
z=this.m_result_targets[u];var
x=this.m_param_counts[this.m_param_counts.length-(u+1)];var
g=this.m_gamestack_callbreaks[u]-a;if(z==-1){z=0;e|
=16}w=w.concat([e,z,(1<<x)-1,(g>>8)&255,(g)&255]);y-=q;for(var
s=0;s<q;s++){w=w.concat(c(this.m_locals[y+s],2))}for(var
r=0;r<g;r++){w=w.concat(c(this.m_gamestack[a++],2))}}t=t.concat(l);t=t.concat(c(w.length,4));t=t.concat(w);var
h=f;h=h.concat(c(t.length,4));h=h.concat(t);this.m_quetzal_image=h;return
this.m_quetzal_image.length},saveGameData:function ge_saveGameData(b,a){var
c=this.m_quetzal_image;this.m_quetzal_image=0;return
c},architecture:function ge_architecture(){return"none"},piracy:function
ge_piracy(){return -1},tandy:function ge_tandy(){return -1},status:function
ge_status(){return"this is the status, hurrah!"},getStatusLine:function
ge_getStatusLine(d){var g=this.getUnsignedWord(this.m_vars_start);var
f=this.getUnsignedWord(this.m_property_list_addr_start+(this.m_object_size*g));var
b=this._zscii_from(f+1);if(b.length>d){b=b.substring(0,d-3);var e="...";var
h=""}else{if((this.m_version>3)&&((this.getByte(1)&2)==2)){var
a=this.getUnsignedWord(this.m_vars_start+2);var
c=this.getUnsignedWord(this.m_vars_start+4);if(c<10){var
e=a+":0"+c}else{var e=a+":"+c}}else{var
e="Score: "+this.getUnsignedWord(this.m_vars_start+2)+"
Moves: "+this.getUnsignedWord(this.m_vars_start+4)}if((b.length+e.length+1)>d){e="
S:"+this.getUnsignedWord(this.m_vars_start+2)+"
M:"+this.getUnsignedWord(this.m_vars_start+4);if((b.length+e.length+1)>d){e=" "+this.getUnsignedWord(this.m_vars_start+2)+"/"+this.getUnsignedWord(this.m_vars_start+4)}if((b.length+e.length+1)>d){e=""}}var
h="";while((b.length+e.length+h.length)<d){h+=" "}}return
b+h+e},_initial_setup:function
ge_initial_setup(){this.m_jit=[];this.m_compilation_running=0;this.m_gamestack=[];this.m_gamestack_callbreaks=[];this.m_call_stack=[];this.m_locals=[];this.m_locals_stack=[];this.m_param_counts=[];this.m_result_targets=[];this.m_goldenTrail=0;this.m_copperTrail=0;this.m_version=this.m_memory[0];this.m_himem=this.getUnsignedWord(4);this.m_pc=this.getUnsignedWord(6);this.m_dict_start=this.getUnsignedWord(8);this.m_objs_start=this.getUnsignedWord(10);this.m_vars_start=this.getUnsignedWord(12);this.m_stat_start=this.getUnsignedWord(14);this.m_abbr_start=this.getUnsignedWord(24);if(this.m_version>=4){this.m_alpha_start=this.getUnsignedWord(52);this.m_object_tree_start=this.m_objs_start+112;this.m_property_list_addr_start=this.m_object_tree_start+12;this.m_object_size=14}else{this.m_alpha_start=0;this.m_object_tree_start=this.m_objs_start+53;this.m_property_list_addr_start=this.m_object_tree_start+7;this.m_object_size=9}this.m_hext_start=this.getUnsignedWord(54);this.m_original_memory=this.m_memory.slice();if(this.m_version<=3){this.m_pc_translate_for_routine=pc_translate_v123;this.m_pc_translate_for_string=pc_translate_v123}else{if(this.m_version<=5){this.m_pc_translate_for_routine=pc_translate_v45;this.m_pc_translate_for_string=pc_translate_v45}else{if(this.m_version<=7){this.m_routine_start=this.getUnsignedWord(40)*8;this.m_string_start=this.getUnsignedWord(42)*8;this.m_pc_translate_for_routine=pc_translate_v67R;this.m_pc_translate_for_string=pc_translate_v67S}else{if(this.m_version==8){this.m_pc_translate_for_routine=pc_translate_v8;this.m_pc_translate_for_string=pc_translate_v8}else{gnusto_error(170,"impossible:
unknown z-version got this far")}}}}if(!(this.m_version in
handlers_fixups)){gnusto_error(311,"unknown z-machine version")}var
f=handlers_fixups[this.m_version];switch(typeof(f)){case"undefined":gnusto_error(101,"z-machine
version not
implemented");break;case"string":this.m_handlers=handlers_v578;break;case"object":this.m_handlers={};for(var
c in handlers_v578){this.m_handlers[c]=handlers_v578[c]}for(var g in
f){if((typeof f[g])=="function"){this.m_handlers[g]=f[g]}else{delete
this.m_handlers[g]}}break;default:gnusto_error(170,"impossible: weird stuff
in fixups
table")}this.m_separator_count=this.m_memory[this.m_dict_start];for(var
h=0;h<this.m_separator_count;h++){this.m_separators[h]=this._zscii_char_to_ascii(this.m_memory[this.m_dict_start+h+1])}if(this.m_hext_start>0){this.m_unicode_start=this.getUnsignedWord(this.m_hext_start+6);if(this.m_unicode_start>0){this.m_custom_unicode_charcount=this.m_memory[this.m_unicode_start];this.m_unicode_start+=1;for(var
h=0;h<this.m_custom_unicode_charcount;h++){reverse_unicode_table[this.getUnsignedWord(this.m_unicode_start+(h*2))]=h+155}}}if(!(this.m_unicode_start>0)){for(var
h in
default_unicode_translation_table){reverse_unicode_table[default_unicode_translation_table[h]]=h}}this.m_rebound=0;this.m_rebound_args=[];this.m_output_to_console=1;this.m_streamthrees=[];this.m_output_to_script=0;this.m_console_buffer="";this.m_transcript_buffer="";this.m_zalphabet[0]="abcdefghijklmnopqrstuvwxyz";this.m_zalphabet[1]="ABCDEFGHIJKLMNOPQRSTUVWXYZ";if(this.m_version==1){this.m_zalphabet[2]="T0123456789.,!?_#'\"/\\<-:()"}else{this.m_zalphabet[2]="T\n0123456789.,!?_#'\"/\\-:()"}var
e;var j;if(this.m_alpha_start>0){for(var a=0;a<3;a++){var b="";for(var
d=0;d<26;d++){j=this.m_memory[this.m_alpha_start+(a*26)+d];if((j>=155)&&(j<=251)){if(this.m_unicode_start==0){b+=String.fromCharCode(default_unicode_translation_table[j])}else{if((j-154)<=this.m_custom_unicode_charcount){b+=String.fromCharCode(this.getUnsignedWord(this.m_unicode_start+((j-155)*2)))}else{b+=" "}}}else{e=String.fromCharCode(j);if(e=="^"){e="\n"}b+=e}}this.m_zalphabet[a]=b}}for(var
h=0;h<16;h++){this.m_locals[h]=0}this.m_printing_header_bits=0;this.m_leftovers=""},getByte:function
ge_getbyte(a){if(a<0){a&=65535}return this.m_memory[a]},setByte:function
ge_setByte(b,a){if(a<0){a&=65535}this.m_memory[a]=b},getWord:function
ge_getWord(a){if(a<0){a&=65535}var b=(this.m_memory[a]<<8)|
this.m_memory[a+1];return((b&32768)?~65535:0)|b},_unsigned2signed:function
ge_unsigned2signed(a){return((a&32768)?~65535:0)|
a},_signed2unsigned:function ge_signed2unsigned(a){return
a&65535},getUnsignedWord:function
ge_getUnsignedWord(a){if(a<0){a&=65535}return(this.m_memory[a]<<8)|
this.m_memory[a+1]},setWord:function
ge_setWord(b,a){if(a<0){a&=65535}this.m_memory[a]=(b>>8)&255;this.m_memory[a+1]=(b)&255},_handle_variable_parameters:function
ge_handle_var_parameters(c,d,a){var b=0;if(a==1){d=(d<<8)|255}while(1){var
e=d&49152;if(e==49152){return}else{if(e==0){c[b++]=this.getWord(this.m_pc);this.m_pc+=2}else{if(e==16384){c[b++]=this.m_memory[this.m_pc++]}else{if(e==32768){c[b++]=this._code_for_varcode(this.m_memory[this.m_pc++])}else{gnusto_error(171)}}}}d=(d<<2)|
3}},_compile:function ge_compile(){this.m_compilation_running=1;var
h="",g=this.m_pc,f=0;do{var c=[];this_instr_pc=this.m_pc;h=h+"m_pc
= "+this.m_pc+";";var
b=this.m_memory[this.m_pc++];if(b==0){gnusto_error(201)}else{if(b==190){b=1000+this.m_memory[this.m_pc++];this._handle_variable_parameters(c,this.m_memory[this.m_pc++],1)}else{if(b&128){if(b&64){if(!(b&32)){b&=31}if(b==250|
|b==236){var
e=this.getUnsignedWord(this.m_pc);this.m_pc+=2;this._handle_variable_parameters(c,e,2)}else{this._handle_variable_parameters(c,this.m_memory[this.m_pc++],1)}}else{switch(b&48){case
0:c[0]=this.getWord(this.m_pc);this.m_pc+=2;b=(b&15)|128;break;case
16:c[0]=this.m_memory[this.m_pc++];b=(b&15)|128;break;case
32:c[0]=this._code_for_varcode(this.m_memory[this.m_pc++]);b=(b&15)|
128;break;case 48:b=(b&15)|
176;break}}}else{if(b&64){c[0]=this._code_for_varcode(this.m_memory[this.m_pc++])}else{c[0]=this.m_memory[this.m_pc++]}if(b&32){c[1]=this._code_for_varcode(this.m_memory[this.m_pc++])}else{c[1]=this.m_memory[this.m_pc++]}b&=31}}}for(var
d=0;d<c.length;d++){if(c[d]==ARG_STACK_POP){var a="tmp_"+f++;h+="var "+a+"
=
m_gamestack.pop();";c[d]=a}}if(this.m_handlers[b]){h=h+this.m_handlers[b](this,c)+";"}else{if(b>=1128&&b<=1255&&"special_instruction_EXT"+(b-1000)
in
this){h=h+this["special_instruction_EXT"+(b-1000)](c)+";"}else{gnusto_error(200,this.m_pc.toString(16))}}}while(this.m_compilation_running);if(this.m_single_step|
|this.m_debug_mode){h=h+"m_pc="+this.m_pc}return"function
J"+g.toString(16)+"(){"+h+"}"},_param_count:function
ge_param_count(){return this.m_param_counts[0]},_set_output_stream:function
ge_set_output_stream(c,a){if(c==0){}else{if(c==1){this.m_output_to_console=1}else{if(c==2){this.m_memory[17]|
=1}else{if(c==3){if(this.m_streamthrees.length>15){gnusto_error(202)}this.m_streamthrees.unshift([a,a+2])}else{if(c==4){this.m_output_to_script=1}else{if(c==-1){this.m_output_to_console=0}else{if(c==-2){this.m_memory[17]&=~1}else{if(c==-3){if(this.m_streamthrees.length<1){gnusto_error(203)}var
b=this.m_streamthrees.shift();this.setWord((b[1]-b[0])-2,b[0])}else{if(c==-4){this.m_output_to_script=0}else{gnusto_error(204,c)}}}}}}}}}},_trunc_divide:function
ge_trunc_divide(c,b){var a;if(b==0){gnusto_error(701);return
0}a=c/b;if(a>0){return Math.floor(a)}else{return
Math.ceil(a)}},_zscii_char_to_ascii:function
ge_zscii_char_to_ascii(b){if(b<0){gnusto_error(702,b)}var a;if(b==13||
b==10){a=10}else{if((b>=32&&b<=126)||
b==0){a=b}else{if(b>=155&&b<=251){if(this.m_unicode_start==0){return
String.fromCharCode(default_unicode_translation_table[b])}else{if((b-154)<=this.m_custom_unicode_charcount){return
String.fromCharCode(this.getUnsignedWord(this.m_unicode_start+((b-155)*2)))}else{gnusto_error(703,b)}}}else{return"*"}}}return
String.fromCharCode(a)},_ascii_code_to_zscii_code:function
ge_ascii_char_to_zscii(b){if((b>=32&&b<=126)||b==0){return b}var
a;if(b<0){gnusto_error(702,"Illegal unicode character:"+b)}else{if(b==13||
b==10){a=10}else{if((b>=32&&b<=126)||
b==0){a=b}else{a=reverse_unicode_table[b];if(!a){a="*".charCodeAt(0)}}}}return
a},_random_number:function
ge_random_number(a){if(a==0){this.m_random_use_seed=this.m_random_use_sequence=0;return
0}else{if(a<-999){this.m_random_state=Math.abs(a);this.m_random_use_seed=1;this.m_random_use_sequence=0;return
0}else{if(a<0){this.m_random_sequence_max=Math.abs(a)-1;this.m_random_state=0;this.m_random_use_seed=0;this.m_random_use_sequence=1;return
0}else{if(this.m_random_use_seed){this.m_random_state--;return
1+(Math.round(Math.abs(Math.tan(this.m_random_state))*8.71*a)%a)}else{if(this.m_random_use_sequence){var
b=this.m_random_state;this.m_random_state=this.m_random_state+1;if(this.m_random_state>this.m_random_sequence_max){this.m_random_state=0}return
1+(b%a)}else{return
1+Math.round((a-1)*Math.random())}}}}}gnusto_error(170,"random")},_func_gosub:function
ge_gosub(h,d,a,f){this.m_call_stack.push(a);this.m_pc=h;var
g=this.m_memory[this.m_pc++];if(this.m_version<5){var b=[];for(var
e=0;e<g;e++){if(e<d.length){b.push(d[e])}else{b.push(this.getWord(this.m_pc))}this.m_pc+=2}this.m_locals=b.concat(this.m_locals)}else{for(var
c=g;c>0;c--){if(c<=d.length){this.m_locals.unshift(d[c-1])}else{this.m_locals.unshift(0)}}}this.m_locals_stack.unshift(g);this.m_param_counts.unshift(d.length);this.m_result_targets.push(f);this.m_gamestack_callbreaks.push(this.m_gamestack.length);if(h==0){this._func_return(0)}},_func_interrupt:function
ge_interrupt(b,a){this.m_interrupt_information.push({on_return:a,rebound:this.m_rebound,rebound_args:this.m_rebound_args,engine:this,pc:this.m_pc,effects:this.m_effects});this._func_gosub(b,[],CALLED_FROM_INTERRUPT,-1)},_tokenise:function
ge_tokenise(q,h,j,d){var c=0;var e=h+2;var
t=h+1;if(isNaN(j)){j=0}if(isNaN(d)){d=0}function l(D,u,w){function
v(M,O,i){var K=0;var N,L;while(1){if(K==O.length){return
0}N=M.m_memory[i+K];L=O.charCodeAt(K);if(N==L){K++}else{if(N<L){return
-1}else{return 1}}}}var B=D.m_memory[w+D.m_separator_count+1];var
H=D.getWord(w+D.m_separator_count+2);var
z=D.m_dict_start+D.m_separator_count+4;var I=1;if(H<0){I=0;H=-H}var
E=u;u=D._into_zscii(u);if(I){var C=0,x=H-1;var G;var A;var
J;while(1){G=C+Math.round((x-C)/2);A=z+G*B;J=v(D,u,A);if(J<0){if(C==x){return
0}C=G+1}else{if(J>0){if(C==x){return 0}x=G-1}else{return A}}if(C>x){return
0}}}else{for(var y=0;y<H;y++){var F=z+y*B;if(v(D,u,F)==0){return F}}}return
0}function s(v,x,w,u){var
i=l(v,w,x);if(!(d&&i==0)){v.setWord(i,e);e+=2;v.setByte(w.length,e++);v.setByte(u,e++)}else{e+=4}c++;return
1}var f=this.m_memory[q];var
o="";if(j==0){j=this.m_dict_start}if(this.m_version<=4){f++;var
r=q+1;while(1){var
k=this.m_memory[r++];if(k==0){break}o+=String.fromCharCode(k)}}else{for(var
p=0;p<this.m_memory[q+1];p++){o+=String.fromCharCode(this.m_memory[q+2+p])}}var
m=[];var n="";var g=0;var b;if(this.m_version<=4){b=1}else{b=2}for(var
a=0;a<o.length;a++){if(o.charAt(a)==" "){if(n!=""){m[g]=n;s(this,j,m[g],(a-m[g].length)+b);g++;n=""}}else{if(this._is_separator(o.charAt(a))){if(n!=""){m[g]=n;s(this,j,m[g],(a-m[g].length)+b);g++}m[g]=o.charAt(a);s(this,j,m[g],a+b);g++;n=""}else{n+=o.charAt(a)}}}if(n!=""){m[g]=n;s(this,j,m[g],(a-m[g].length)+b)}this.setByte(c,t)},_aread:function
ge_aread(g,e,c,d){e&=65535;c&=65535;var f;var a;var
h;if(this.m_version<=4){f=this.m_memory[e]+1;a=d.substring(0,f).toLowerCase();h=e+1;this.setByte(0,e+1+a.length)}else{f=this.m_memory[e];a=d.substring(0,f).toLowerCase();h=e+2;this.setByte(a.length,e+1)}for(var
b=0;b<a.length;b++){this.setByte(this._ascii_code_to_zscii_code(a.charCodeAt(b)),h+b)}if(c!=0|
|this.m_version<5){this._tokenise(e,c,0,0)}if(g==13){return 10}else{return
g}},_terminating_characters:function
ge_terminating_characters(){if(this.m_version<5){return"\r"}else{var
b=this.getWord(46);var a="\r";while(1){var
c=this.m_memory[b++];if(c==0){break}else{if((c>=129&&c<=154)||
(c>=252)){a+=String.fromCharCode(c)}}}return a}},_func_return:function
ge_func_return(c){for(var
b=this.m_locals_stack.shift();b>0;b--){this.m_locals.shift()}this.m_param_counts.shift();this.m_pc=this.m_call_stack.pop();this.m_gamestack.length=this.m_gamestack_callbreaks.pop();var
d=this.m_result_targets.pop();if(d!=-1&&c!=null){this._varcode_set(c,d)}if(this.m_pc==CALLED_FROM_INTERRUPT){var
a=this.m_interrupt_information.pop();this.m_pc=a.pc;a.on_return(a,c)}},_throw_stack_frame:function
throw_stack_frame(a){if(a>this.m_call_stack.length||
a<1){gnusto_error(207,a)}while(this.m_call_stack.length>a-1){this._func_return(null)}},_get_prop_addr:function
ge_get_prop_addr(b,c){if(b==0){return 0}var
a=this._property_search(b,c,-1);if(a[2]){return a[0]}else{return
0}},_get_prop_len:function
ge_get_prop_len(a){a&=65535;if(this.m_version<4){return
1+(this.m_memory[a-1]>>5)}else{var
b=this.m_memory[a-1];if(b&128){b=b&63;if(b==0){return 64}else{return
b}}else{if(b&64){return 2}else{return
1}}}gnusto_error(170,"get_prop_len")},_get_next_prop:function
ge_get_next_prop(b,c){if(b==0){return 0}var
a=this._property_search(b,-1,c);if(a[2]){return a[3]}else{if(a[4]){return
0}else{gnusto_error(205,c)}}gnusto_error(173)},_get_prop:function
ge_get_prop(b,c){if(b==0){return 0}var
a=this._property_search(b,c,-1);if(a[1]==2){return
this.getWord(a[0])}else{if(a[1]==1){return this.m_memory[a[0]]}else{return
this.getWord(a[0])}}gnusto_error(174)},_property_search:function
ge_property_search(b,e,c){var
f=this.getUnsignedWord(this.m_property_list_addr_start+b*this.m_object_size);f=f+this.m_memory[f]*2+1;var
d=0;while(1){var a=1;var
g=this.m_memory[f++];if(this.m_version<4){a=(g>>5)+1;g=g&31}else{if(g&128){a=this.m_memory[f++]&63;if(a==0){a=64}}else{if(g&64){a=2}}g=g&63}if(g==e|
|
d==c){return[f,a,1,g,0]}else{if(g<e){if(e>0){return[this.m_objs_start+(e-1)*2,2,0,e,0]}else{return[-1,-1,0,e,d==e]}}}f+=a;d=g}gnusto_error(175)},_set_attr:function
ge_set_attr(b,d){if(b==0){return}var
a=this.m_object_tree_start+b*this.m_object_size+(d>>3);var
c=this.m_memory[a];this.setByte(c|(128>>(d%8)),a)},_clear_attr:function
ge_clear_attr(b,d){if(b==0){return}var
a=this.m_object_tree_start+b*this.m_object_size+(d>>3);var
c=this.m_memory[a];this.setByte(c&~(128>>(d%8)),a)},_test_attr:function
ge_test_attr(a,b){if(a==0){return
0}if((this.m_memory[this.m_object_tree_start+a*this.m_object_size+(b>>3)]&(128>>(b%8)))){return
1}else{return 0}},_put_prop:function put_prop(b,d,c){if(b==0){return}var
a=this._property_search(b,d,-1);if(!a[2]){gnusto_error(704)}if(a[1]==1){this.setByte(c&255,a[0])}else{if(a[1]==2){this.setWord(c&65535,a[0])}else{gnusto_error(705)}}},_get_older_sibling:function
ge_get_older_sibling(a){if(a==0){return 0}var
b=this._get_child(this._get_parent(a));if(a==b){return
0}while(b){next_along=this._get_sibling(b);if(next_along==a){return
b}b=next_along}return 0},_insert_obj:function ge_insert_obj(a,d){var
e=this._get_parent(a);var b=this._get_older_sibling(a);var
c=this._get_sibling(a);if(e&&this._get_child(e)==a){this._set_child(e,c)}if(b){this._set_sibling(b,c)}this._set_parent(a,d);if(d){this._set_sibling(a,this._get_child(d));this._set_child(d,a)}},_remove_obj:function
ge_remove_obj(a,b){this._insert_obj(a,0)},_get_family:function
ge_get_family(b,a){if(b==0){return 0}if(this.m_version<4){return
this.m_memory[this.m_object_tree_start+4+a+b*this.m_object_size]}else{return
this.getUnsignedWord(this.m_object_tree_start+6+a*2+b*this.m_object_size)}gnusto_error(170,"get_family")},_get_parent:function
ge_get_parent(a){return this._get_family(a,PARENT_REC)},_get_child:function
ge_get_child(a){return this._get_family(a,CHILD_REC)},_get_sibling:function
ge_get_sibling(a){return
this._get_family(a,SIBLING_REC)},_set_family:function
ge_set_family(c,b,a){if(this.m_version<4){this.setByte(b,this.m_object_tree_start+4+a+c*this.m_object_size)}else{this.setWord(b,this.m_object_tree_start+6+a*2+c*this.m_object_size)}},_set_parent:function
ge_set_parent(b,a){this._set_family(b,a,PARENT_REC)},_set_child:function
ge_set_child(b,a){this._set_family(b,a,CHILD_REC)},_set_sibling:function
ge_set_sibling(b,a){this._set_family(b,a,SIBLING_REC)},_obj_in:function
ge_obj_in(b,a){return this._get_parent(b)==a},_copy_table:function
ge_copy_table(e,a,c){if(a==0){for(var
b=0;b<c;b++){this.setByte(0,b+e)}}else{var
d=0;if(c<0){c=-c;d=1}else{if(e>a){d=1}else{d=0}}if(d){for(var
b=0;b<c;b++){this.setByte(this.m_memory[e+b],a+b)}}else{for(var
b=c-1;b>=0;b--){this.setByte(this.m_memory[e+b],a+b)}}}},_scan_table:function
ge_scan_table(g,a,f,d){var e=d&127;var b=((d&128)==128);var
c=a+(f*e);if(b){while(a<c){if(((this.m_memory[65535&a]&255)==((g>>8)&255))&&((this.m_memory[65535&a+1]&255)==(g&255))){return
a}a+=e}}else{while(a<c){if((this.m_memory[65535&a]&255)==(g&65535)){return
a}a+=e}}return 0},_print_table:function ge_print_table(d,a,f,e){var
i=[];for(var b=0;b<f;b++){var h="";for(var
c=0;c<a;c++){if(d<0){d&=65535}h=h+this._zscii_char_to_ascii(this.m_memory[d++])}i.push(h);d+=e}var
g=["PT",i.length];g=g.concat(i);return g},_zscii_from:function
ge_zscii_from(l,m,d){if(l in this.m_jit){if(d){return
this.m_jit[l]}else{return this.m_jit[l][0]}}var n="";var g=1;var o=l;var
f=0;var h=f;var k=-2;var i=0;if(!m){m=65535}var c=l+m;while(g){var
a=this.getUnsignedWord(l);l+=2;g=((a&32768)==0)&&l<c;for(var
e=2;e>=0;e--){var
b=((a>>(e*5))&31);if(i){n=n+this._zscii_from(this.getUnsignedWord((32*(i-1)+b)*2+this.m_abbr_start)*2);i=0;h=f}else{if(k==-2){if(b>5){if(h==2&&b==6){k=-1}else{n=n+this.m_zalphabet[h].charAt(b-6);h=f}}else{if(b==0){n=n+" ";h=f}else{if(b<4){if(this.getByte(0)>2){i=b}else{if(b==2){h+=1;if(h>2){h=0}}else{if(b==3){h-=1;if(h<0){h=2}}else{if(this.getByte(0)==2){i=1}else{n=n+"\n";h=f}}}}}else{if(this.getByte(0)>2){h=b-3}else{if(b==4){f+=1;if(f>2){f=0}}else{f-=1;if(f<0){f=2}}h=f}}}}}else{if(k==-1){k=b}else{n=n+this._zscii_char_to_ascii((k<<5)+b);k=-2;h=f}}}}}if(o>=this.m_stat_start){this.m_jit[o]=[n,l]}if(d){return[n,l]}else{return
n}},_encode_text:function ge_encode_text(k,d,j,h){k=(k+j)&65535;var
a="";while(d>0){var
g=this.m_memory[k];if(g==0){break}a=a+String.fromCharCode(g);k++;d--}var
l=this._into_zscii(a);for(var e=0;e<l.length;e++){var
f=l[e].charCodeAt(0);this.setByte(f,h++)}},_into_zscii:function
ge_into_zscii(f){var j="";var d=[];var
e;if(this.m_version<4){e=4}else{e=6}function
h(l){d.push(l);if(d.length==3){var k=(d[0]<<10|d[1]<<5|
d[2]);if(j.length==e-2){k|
=32768}j=j+String.fromCharCode(k>>8)+String.fromCharCode(k&255);d=[]}}var
a,i=0,c;while(i<f.length&&j.length<e){a=f.charCodeAt(i++);if(a>=65&&a<=90){a+=32}else{if(a>154){if(this.m_unicode_start==0){if((a>=158&&a<=160)|
|(a>=167&&a<=168)||
(a>=208&&a<=210)){a-=3}else{if(a>=175&&a<=180){a-=6}else{if((a>=186&&a<=190)|
|(a>=196&&a<=200)){a-=5}else{if(a==217||a==218){a-=2}else{if(a==202||a==204|
|a==212||a==214||a==221){a-=1}}}}}}else{var
g=this._ascii_code_to_zscii_code(this._zscii_char_to_ascii(a).toLowerCase().charCodeAt(0));if(g>0&&g<=251&&g!="*".charCodeAt(0)){a=g}}}}var
b=String.fromCharCode(this._zscii_char_to_ascii(a).charCodeAt(0));c=this.m_zalphabet[0].indexOf(b);if(c!=-1){h(c+6)}else{c=this.m_zalphabet[1].indexOf(b);if(c!=-1){if(this.getByte(0)>2){h(4)}else{h(2)}h(c+6)}else{c=this.m_zalphabet[2].indexOf(b);if(c!=-1){if(this.getByte(0)>2){h(5)}else{h(3)}h(c+6)}else{if(this.getByte(0)>2){h(5)}else{h(3)}h(6);h(a>>5);h(a&31)}}}}while(j.length<e){h(5)}return
j.substring(0,e)},_name_of_object:function
ge_name_of_object(a){if(a==0){return"<void>"}else{var
b=this.m_property_list_addr_start+a*this.m_object_size;return
this._zscii_from(this.getUnsignedWord(b)+1)}},_print_leftovers:function
ge_print_leftovers(){this._zOut(this.m_leftovers);this.m_leftovers=""},_zOut:function
ge_zOut(f){if(this.m_streamthrees.length){var d=this.m_streamthrees[0];var
a=this.m_streamthrees[0][1];for(var
b=0;b<f.length;b++){this.setByte(this._ascii_code_to_zscii_code(f.charCodeAt(b)),a++)}this.m_streamthrees[0][1]=a}else{var
c=this.m_memory[17]&3;var
e=c!=this.m_printing_header_bits;effect_parameters=this.m_printing_header_bits;this.m_printing_header_bits=c;if(e){this.m_leftovers=f;this.m_rebound=this._print_leftovers;return
1}else{if(this.m_output_to_console){this.m_console_buffer=this.m_console_buffer+f}if(c&1){this.m_transcript_buffer=this.m_transcript_buffer+f}}}return
0},consoleText:function ge_console_text(){var
a=this.m_console_buffer.replace("\x00","","g");this.m_console_buffer="";return
a},_transcript_text:function ge_transcript_text(){var
a=this.m_transcript_buffer.replace("\x00","","g");this.m_transcript_buffer="";return
a},_is_separator:function ge_IsSeparator(b){for(var
a=0;a<this.m_separator_count;a++){if(b==this.m_separators[a]){return
1}}return 0},_code_for_varcode:function
ge_code_for_varcode(a){if(a==0){return
ARG_STACK_POP}else{if(a<16){return"m_locals["+(a-1)+"]"}else{return"getWord("+(this.m_vars_start+(a-16)*2)+")"}}gnusto_error(170,"code_for_varcode")},_varcode_get:function
ge_varcode_get(a){if(a==0){return
this.m_gamestack.pop()}else{if(a<16){return
this.m_locals[(a-1)]}else{return
this.getWord(this.m_vars_start+(a-16)*2)}}gnusto_error(170,"varcode_get")},_varcode_set:function
ge_varcode_set(b,a){if(a==0){this.m_gamestack.push(b)}else{if(a<16){this.m_locals[a-1]=b}else{this.setWord(b,this.m_vars_start+(a-16)*2)}}},_brancher:function
ge_brancher(e){var b=1;var a=this.m_memory[this.m_pc++];var
c=a&63;if(a&128){b=0}if(!(a&64)){c=(c<<8)|
this.m_memory[this.m_pc++];if(c&8192){c=(~8191)|(c&8191)}}var
d=e;if(b){d="if(!("+d+"))"}else{d="if("+d+")"}if(c==0){return
d+"{_func_return(0);return;}"}if(c==1){return
d+"{_func_return(1);return;}"}c=(this.m_pc+c)-2;return
d+"{m_pc="+(c)+";return;}"},_storer:function ge_storer(b){var
a=this.m_memory[this.m_pc++];if(b.substring&&b.substring(0,11)=="_func_gosub"){this.m_compilation_running=0;if(b.substring(b.length-4)!=",-1)"){gnusto_error(100,b)}return
b.substring(0,b.length-3)+a+")"}else{if(a==0){return"m_gamestack.push("+b+")"}else{if(a<16){return"m_locals["+(a-1)+"]="+b}else{return"setWord("+b+","+(this.m_vars_start+(a-16)*2)+")"}}}gnusto_error(170,"storer")},_generate_gosub:function
call_vn(d,c,b){this.m_compilation_running=0;var
a=-1;if(b){a=this.m_memory[this.m_pc++]}return"_func_gosub("+this.m_pc_translate_for_routine(d)+",["+c.toString()+"],"+this.m_pc+","+a+")"},_handler_zOut:function
ge_handler_zOut(b,a){var
c;if(a){c="_func_return(1)"}else{c="m_pc=0x"+this.m_pc.toString(16)}return"if(_zOut("+b+")){"+c+";m_effects=["+GNUSTO_EFFECT_FLAGS_CHANGED+"];return
1}"},_handler_print:function ge_handler_print(c,a){var
d=this._zscii_from(this.m_pc,65535,1);var
b=d[0];if(c){b=b+c}b=b.quote();this.m_pc=d[1];return
this._handler_zOut(b,a)},_log_shift:function
ge_log_shift(b,a){if(a<0){return(b>>>(-1*a))&32767}else{return(b<<a)&32767}},_art_shift:function
ge_art_shift(b,a){if(a<0){return(b>>(-1*a))&32767}else{return(b<<a)&32767}},_touch:function
ge_touch(a){if(this.m_goldenTrail){this.logger("pc",a.toString(16))}this.m_pc=a},_save_undo:function
ge_save_undo(a){this.m_undo=this._saveable_state(a);return
1},_restore_undo:function ge_restore_undo(){if(typeof
this.m_undo!="object"){return
0}this.m_call_stack=this.m_undo.m_call_stack;this.m_locals=this.m_undo.m_locals;this.m_locals_stack=this.m_undo.m_locals_stack;this.m_param_counts=this.m_undo.m_param_counts;this.m_result_targets=this.m_undo.m_result_targets;this.m_gamestack=this.m_undo.m_gamestack;this.m_gamestack_callbreaks=this.m_undo.m_gamestack_callbreaks;var
a=this.m_undo.m_memory;this.m_memory=a.concat(this.m_memory.slice(a.length));this._varcode_set(2,this.m_memory[this.m_undo.m_pc]);this.m_pc=this.m_undo.m_pc+1;this.m_undo=0;return
1},_saveable_state:function ge_saveable_state(b){var
a={m_memory:this.m_memory.slice(0,this.m_stat_start),m_pc:this.m_pc+b,m_call_stack:this.m_call_stack.slice(),m_locals:this.m_locals.slice(),m_locals_stack:this.m_locals_stack.slice(),m_param_counts:this.m_param_counts.slice(),m_result_targets:this.m_result_targets.slice(),m_gamestack:this.m_gamestack.slice(),m_gamestack_callbreaks:this.m_gamestack_callbreaks.slice()};return
a},_verify:function ge_verify(){var c=0;var
b=(this.m_original_memory[28]<<8|this.m_original_memory[29]);for(var
a=64;a<this.m_original_memory.length;a++){c+=this.m_original_memory[a]}return(c&65535)==b},m_local_game_file:0,m_memory:[],m_handlers:0,m_jit:[],m_goldenTrail:0,m_copperTrail:0,m_compilation_running:0,m_gamestack:0,m_gamestack_callbreaks:[],m_himem:0,m_pc:0,m_this_instr_pc:0,m_dict_start:0,m_objs_start:0,m_vars_start:0,m_stat_start:0,m_abbr_start:0,m_hext_start:0,m_alpha_start:0,m_zalphabet:[],m_string_start:0,m_routine_start:0,m_unicode_start:0,m_custom_unicode_charcount:0,m_separator_count:0,m_separators:[],m_version:0,m_call_stack:[],m_locals:[],m_locals_stack:0,m_param_counts:0,m_result_targets:[],m_rebound:0,m_rebound_args:[],m_output_to_console:0,m_streamthrees:[],m_output_to_script:0,m_single_step:0,m_debug_mode:0,m_parser_debugging:0,m_breakpoints:{},m_console_buffer:"",m_transcript_buffer:"",m_effects:[],m_answers:[],m_random_state:0,m_random_use_seed:0,m_random_use_sequence:0,m_random_sequence_max:0,m_printing_header_bits:0,m_leftovers:"",m_pc_translate_for_routine:pc_translate_v45,m_pc_translate_for_string:pc_translate_v45,m_undo:0,m_state_to_save:0,m_quetzal_image:0,m_original_memory:[],m_compress_save_files:1,m_object_tree_start:0,m_property_list_addr_start:0,m_object_size:14,m_interrupt_information:[]};
\ No newline at end of file
+var CVS_VERSION="$Date: 2005/04/26 01:50:32 $";var
ENGINE_DESCRIPTION="Gnusto's interactive fiction engine";var
default_unicode_translation_table={155:228,156:246,157:252,158:196,159:214,160:220,161:223,162:187,163:171,164:235,165:239,166:255,167:203,168:207,169:225,170:233,171:237,172:243,173:250,174:253,175:193,176:201,177:205,178:211,179:218,180:221,181:224,182:232,183:236,184:242,185:249,186:192,187:200,188:204,189:210,190:217,191:226,192:234,193:238,194:244,195:251,196:194,197:202,198:206,199:212,200:219,201:229,202:197,203:248,204:216,205:227,206:241,207:245,208:195,209:209,210:213,211:230,212:198,213:231,214:199,215:254,216:240,217:222,218:208,219:163,220:339,221:338,222:161,223:191};var
reverse_unicode_table={};var isNotConst=/\D/;var temp_var=0;var
PARENT_REC=0;var SIBLING_REC=1;var CHILD_REC=2;var
CALLED_FROM_INTERRUPT=0;var GNUSTO_EFFECT_INPUT='"RS"';var
GNUSTO_EFFECT_INPUT_CHAR='"RC"';var GNUSTO_EFFECT_SAVE='"DS"';var
GNUSTO_EFFECT_RESTORE='"DR"';var GNUSTO_EFFECT_QUIT='"QU"';var
GNUSTO_EFFECT_RESTART='"NU"';var GNUSTO_EFFECT_WIMP_OUT='"WO"';var
GNUSTO_EFFECT_BREAKPOINT='"BP"';var GNUSTO_EFFECT_FLAGS_CHANGED='"XC"';var
GNUSTO_EFFECT_PIRACY='"CP"';var GNUSTO_EFFECT_STYLE='"SS"';var
GNUSTO_EFFECT_SOUND='"FX"';var GNUSTO_EFFECT_SPLITWINDOW='"TW"';var
GNUSTO_EFFECT_SETWINDOW='"SW"';var GNUSTO_EFFECT_ERASEWINDOW='"YW"';var
GNUSTO_EFFECT_ERASELINE='"YL"';var GNUSTO_EFFECT_SETCURSOR='"SC"';var
GNUSTO_EFFECT_SETBUFFERMODE='"SB"';var
GNUSTO_EFFECT_SETINPUTSTREAM='"SI"';var GNUSTO_EFFECT_GETCURSOR='"GC"';var
GNUSTO_EFFECT_PRINTTABLE='"PT"';function
handleZ_je(d,b){if(b.length<2){return""}else{if(b.length==2){return
d._brancher(b[0]+"=="+b[1])}else{var e="";for(var
c=1;c<b.length;c++){if(c!=1){e=e+"|
|"}e=e+"t=="+b[c]}return"t="+b[0]+";"+d._brancher(e)}}}function
handleZ_jl(c,b){return c._brancher(b[0]+"<"+b[1])}function
handleZ_jg(c,b){return c._brancher(b[0]+">"+b[1])}function
handleZ_inc_chk(c,b){return
handleZ_incdec(c,b[0],"+",1)+c._brancher("tmp_"+temp_var+"
> "+b[1])}function handleZ_dec_chk(c,b){return
handleZ_incdec(c,b[0],"-",1)+c._brancher("tmp_"+temp_var+"
< "+b[1])}function handleZ_jin(c,b){return
c._brancher("_obj_in("+b[0]+","+b[1]+")")}function
handleZ_test(c,b){return"t="+b[1]+";"+c._brancher("("+b[0]+"&t)==t")}function
handleZ_or(c,b){return c._storer("("+b[0]+"|"+b[1]+")&0xffff")}function
handleZ_and(c,b){return c._storer(b[0]+"&"+b[1]+"&0xffff")}function
handleZ_test_attr(c,b){return
c._brancher("_test_attr("+b[0]+","+b[1]+")")}function
handleZ_set_attr(c,b){return"_set_attr("+b[0]+","+b[1]+")"}function
handleZ_clear_attr(c,b){return"_clear_attr("+b[0]+","+b[1]+")"}function
handleZ_store(e,c){if(isNotConst.test(c[0])){e.logger("Z_store",c[0])}if(c[0]==0){return"m_gamestack.push("+c[1]+")"}else{if(c[0]<16){return"m_locals["+c[0]+"
- 1] = "+c[1]}else{if(isNotConst.test(c[0])){var f="var high = m_vars_start
+ ("+c[0]+" - 16) * 2, low = high + 1;",h="high",b="low"}else{var
f="",h=e.m_vars_start+(c[0]-16)*2,b=h+1}if(!isNotConst.test(c[1])){var
g=(c[1]&32768?~65535:0)|c[1];return f+"m_memory["+h+"]
= "+((g>>8)&255)+";m_memory["+b+"] = "+(g&255)}else{var
d="tmp_"+(++temp_var);return f+"var "+d+" = "+c[1]+";"+d+" = ("+d+" &
0x8000 ? ~0xFFFF : 0) | "+d+";m_memory["+h+"] = ("+d+" >> 8) &
0xFF;m_memory["+b+"] = "+d+" & 0xFF;"}}}}function
handleZ_insert_obj(c,b){return"_insert_obj("+b[0]+","+b[1]+")"}function
handleZ_loadw(c,b){return
c._storer("getWord((1*"+b[0]+"+2*"+b[1]+")&0xFFFF)")}function
handleZ_loadb(c,b){return
c._storer("m_memory[0xFFFF&(1*"+b[0]+"+1*"+b[1]+")]")}function
handleZ_get_prop(c,b){return
c._storer("_get_prop("+b[0]+","+b[1]+")")}function
handleZ_get_prop_addr(c,b){return
c._storer("_get_prop_addr("+b[0]+","+b[1]+")")}function
handleZ_get_next_prop(c,b){return
c._storer("_get_next_prop("+b[0]+","+b[1]+")")}function
handleZ_add(c,b){return c._storer(b[0]+"*1+"+b[1]+"*1")}function
handleZ_sub(c,b){return c._storer(b[0]+"-"+b[1])}function
handleZ_mul(c,b){return c._storer(b[0]+"*"+b[1])}function
handleZ_div(c,b){return
c._storer("_trunc_divide("+b[0]+","+b[1]+")")}function
handleZ_mod(c,b){return c._storer(b[0]+"%"+b[1])}function
handleZ_set_colour(c,b){return"m_pc="+c.m_pc+";m_effects=["+GNUSTO_EFFECT_STYLE+",-1,"+b[0]+","+b[1]+"];return"}function
handleZ_throw(c,b){c.m_compilation_running=0;return"_throw_stack_frame("+b[0]+");return"}function
handleZ_jz(c,b){return c._brancher(b[0]+"==0")}function
handleZ_get_sibling(c,b){return"t=_get_sibling("+b[0]+");"+c._storer("t")+";"+c._brancher("t")}function
handleZ_get_child(c,b){return"t=_get_child("+b[0]+");"+c._storer("t")+";"+c._brancher("t")}function
handleZ_get_parent(c,b){return c._storer("_get_parent("+b[0]+")")}function
handleZ_get_prop_len(c,b){return
c._storer("_get_prop_len("+b[0]+")")}function handleZ_inc(c,b){return
handleZ_incdec(c,b[0],"+")}function handleZ_dec(c,b){return
handleZ_incdec(c,b[0],"-")}function
handleZ_incdec(d,b,a,g){if(isNotConst.test(b)){d.logger("Z_incdec",b)}var
c="tmp_"+(++temp_var);if(b==0){return(g?"var "+c+"
= ":"")+a+a+"m_gamestack[m_gamestack.length -
1];"}else{if(b<16){return(g?"var "+c+" = ":"")+a+a+"m_locals["+b+" -
1];"}else{if(isNotConst.test(b)){var e="var add = m_vars_start + ("+b+" -
16) * 2, ",f="add"}else{var e="var ",f=d.m_vars_start+(b-16)*2}return e+c+"
= (m_memory["+f+"] << 8) | m_memory["+f+" + 1];"+c+" = (("+c+" & 0x8000 ?
~0xFFFF : 0) | "+c+") "+a+" 1;m_memory["+f+"] = ("+c+" >> 8) &
0xFF;m_memory["+f+" + 1] = "+c+" & 0xFF;"}}}function
handleZ_print_addr(c,b){return
c._handler_zOut("_zscii_from("+b[0]+")",0)}function
handleZ_remove_obj(c,b){return"_remove_obj("+b[0]+","+b[1]+")"}function
handleZ_print_obj(c,b){return
c._handler_zOut("_name_of_object("+b[0]+")",0)}function
handleZ_ret(c,b){c.m_compilation_running=0;return"_func_return("+b[0]+");return"}function
handleZ_jump(c,b){c.m_compilation_running=0;if(b[0]&32768){b[0]=(~65535)|
b[0]}var d=(b[0]+c.m_pc)-2;return"m_pc="+d+";return"}function
handleZ_print_paddr(c,b){return
c._handler_zOut("_zscii_from("+c.m_pc_translate_for_string(b[0])+")",0)}function
handleZ_load(c,b){return c._storer("_varcode_get("+b[0]+")")}function
handleZ_rtrue(c,b){c.m_compilation_running=0;return"_func_return(1);return"}function
handleZ_rfalse(c,b){c.m_compilation_running=0;return"_func_return(0);return"}function
handleZ_print(c,b){return c._handler_print("",0)}function
handleZ_print_ret(c,b){c.m_compilation_running=0;return
c._handler_print("\n",1)+";_func_return(1);return"}function
handleZ_nop(c,b){return""}function
handleZ_restart(c,b){c.m_compilation_running=0;return"m_effects=["+GNUSTO_EFFECT_RESTART+"];return"}function
handleZ_ret_popped(c,b){c.m_compilation_running=0;return"_func_return(m_gamestack.pop());return"}function
handleZ_catch(c,b){return c._storer("call_stack.length")}function
handleZ_pop(c,b){return"m_gamestack.pop()"}function
handleZ_quit(c,b){c.m_compilation_running=0;return"m_effects=["+GNUSTO_EFFECT_QUIT+"];return"}function
handleZ_new_line(c,b){return c._handler_zOut("'\\n'",0)}function
handleZ_show_status(c,b){c._handler_zOut("");return""}function
handleZ_verify(c,b){return c._brancher("_verify()")}function
handleZ_illegal_extended(c,b){gnusto_error(199)}function
handleZ_piracy(c,b){c.m_compilation_running=0;var
d="m_rebound=function(){"+c._brancher("(!m_answers[0])")+"};";return"m_pc="+c.m_pc+";"+d+"m_effects=["+GNUSTO_EFFECT_PIRACY+"];return"}function
handleZ_call_1n(c,b){return c._generate_gosub(b[0],"",0)}function
handleZ_call_1s(c,b){return c._generate_gosub(b[0],"",1)}function
handleZ_call_2n(c,b){return c._generate_gosub(b[0],b[1],0)}function
handleZ_call_2s(c,b){return c._generate_gosub(b[0],b[1],1)}function
handleZ_call_vn(c,b){return c._generate_gosub(b[0],b.slice(1),0)}function
handleZ_call_vs(c,b){return c._generate_gosub(b[0],b.slice(1),1)}function
handleZ_store_w(c,b){return"setWord("+b[2]+",1*"+b[0]+"+2*"+b[1]+")"}function
handleZ_storeb(c,b){return"setByte("+b[2]+",1*"+b[0]+"+1*"+b[1]+")"}function
handleZ_putprop(c,b){return"_put_prop("+b[0]+","+b[1]+","+b[2]+")"}function
handleZ_read(f,i){var g;var b;f.m_compilation_running=0;var
h="_aread(m_answers[0],m_rebound_args[1],m_rebound_args[2],m_answers[1])";var
j;var
d;if(f.m_version>=5){h=f._storer(h)}if(f.m_version>=5){j="m_memory[0xFFFF&a0+1]";d="m_memory[0xFFFF&a0]"}else{j="0";d="m_memory[0xFFFF&a0]+1"}if(i[2]&&i[3]&&(f.m_version>=4)){g=i[2];b=f.m_pc_translate_for_routine(i[3])}else{g="0";b="0"}var
c="m_rebound=function(){var
t=1*m_answers[0];if(t<0){_func_interrupt(m_rebound_args[0],onISRReturn_for_read);}else{"+h+";}};";var
e="m_rebound_args=["+b+",a0,"+i[1]+",];";return"var
a0=eval("+i[0]+");m_pc="+f.m_pc+";"+e+c+"m_effects=["+GNUSTO_EFFECT_INPUT+","+g+","+j+","+d+",_terminating_characters()];return"}function
handleZ_print_char(c,b){return
c._handler_zOut("_zscii_char_to_ascii("+b[0]+")",0)}function
handleZ_print_num(c,b){return c._handler_zOut(b[0],0)}function
handleZ_random(c,b){return c._storer("_random_number("+b[0]+")")}function
handleZ_push(c,b){return"m_gamestack.push("+b[0]+")"}function
handleZ_pull(c,b){return
handleZ_store(c,[b[0],"m_gamestack.pop()"])}function
handleZ_split_window(c,b){c.m_compilation_running=0;return"m_pc="+c.m_pc+";m_effects=["+GNUSTO_EFFECT_SPLITWINDOW+","+b[0]+"];return"}function
handleZ_set_window(c,b){c.m_compilation_running=0;return"m_pc="+c.m_pc+";m_effects=["+GNUSTO_EFFECT_SETWINDOW+","+b[0]+"];return"}function
handleZ_erase_window(c,b){c.m_compilation_running=0;return"m_pc="+c.m_pc+";m_effects=["+GNUSTO_EFFECT_ERASEWINDOW+","+b[0]+"];return"}function
handleZ_erase_line(c,b){c.m_compilation_running=0;return"m_pc="+c.m_pc+";m_effects=["+GNUSTO_EFFECT_ERASELINE+","+b[0]+"];return"}function
handleZ_set_cursor(c,b){c.m_compilation_running=0;return"m_pc="+c.m_pc+";m_effects=["+GNUSTO_EFFECT_SETCURSOR+","+b[0]+","+b[1]+"];return"}function
handleZ_get_cursor(c,b){c.m_compilation_running=0;return"m_pc="+c.m_pc+";m_effects=["+GNUSTO_EFFECT_GETCURSOR+","+b[0]+"];return"}function
handleZ_set_text_style(c,b){c.m_compilation_running=0;return"m_pc="+c.m_pc+";m_effects=["+GNUSTO_EFFECT_STYLE+","+b[0]+",0,0];return"}function
handleZ_buffer_mode(c,b){c.m_compilation_running=0;return"m_pc="+c.m_pc+";m_effects=["+GNUSTO_EFFECT_SETBUFFERMODE+","+b[0]+"];return"}function
handleZ_output_stream(c,b){return"_set_output_stream("+b[0]+","+b[1]+")"}function
handleZ_input_stream(c,b){c.m_compilation_running=0;return"m_pc="+c.m_pc+";m_effects=["+GNUSTO_EFFECT_SETINPUTSTREAM+","+b[0]+"];return"}function
handleZ_sound_effect(c,b){c.m_compilation_running=0;while(b.length<5){b.push(0)}return"m_pc="+c.m_pc+";m_effects=["+GNUSTO_EFFECT_SOUND+","+b[0]+","+b[1]+","+b[2]+","+b[3]+","+b[4]+"];return"}function
handleZ_read_char(e,c){var f;var d;var
b;e.m_compilation_running=0;if(c[1]&&c[2]&&(e.m_version>=4)){f=c[1];d="m_rebound_args=["+e.m_pc_translate_for_routine(c[2])+"];";b="m_rebound=function(){var
t=1*m_answers[0];if(t<0){_func_interrupt(m_rebound_args[0],onISRReturn_for_read_char);}else{"+e._storer("t")+"}};"}else{f="0";d="";b="m_rebound=function(){"+e._storer("1*m_answers[0]")+"};"}return"m_pc="+e.m_pc+";"+d+b+"m_effects=["+GNUSTO_EFFECT_INPUT_CHAR+","+f+"];return"}function
handleZ_scan_table(c,b){if(b.length==4){return"t=_scan_table("+b[0]+","+b[1]+"&0xFFFF,"+b[2]+"&0xFFFF,"+b[3]+");"+c._storer("t")+";"+c._brancher("t")}else{return"t=_scan_table("+b[0]+","+b[1]+"&0xFFFF,"+b[2]+"&0xFFFF,"+130+");"+c._storer("t")+";"+c._brancher("t")}}function
handleZ_not(c,b){return c._storer("~"+b[0]+"&0xffff")}function
handleZ_tokenise(c,b){return"_tokenise(("+b[0]+")&0xFFFF,("+b[1]+")&0xFFFF,"+b[2]+","+b[3]+")"}function
handleZ_encode_text(c,b){return"_encode_text("+b[0]+","+b[1]+","+b[2]+","+b[3]+")"}function
handleZ_copy_table(c,b){return"_copy_table("+b[0]+","+b[1]+","+b[2]+")"}function
handleZ_print_table(c,b){if(b.length<3){b.push(1)}if(b.length<4){b.push(0)}return"m_pc="+c.m_pc+";m_effects=_print_table("+b[0]+","+b[1]+","+b[2]+","+b[3]+");return"}function
handleZ_check_arg_count(c,b){return
c._brancher(b[0]+"<=_param_count()")}function
handleZ_saveV123(c,b){c.m_compilation_running=0;var
d="m_rebound=function(){"+c._brancher("m_answers[0]")+"};";return"m_state_to_save=_saveable_state(1);m_pc="+c.m_pc+";"+d+";m_effects=["+GNUSTO_EFFECT_SAVE+"];return"}function
handleZ_saveV45678(c,b){c.m_compilation_running=0;var
d="m_rebound=function()
{ "+c._storer("m_answers[0]")+"};";return"m_state_to_save=_saveable_state("+(c.m_version==4?"1":"3")+");m_pc="+c.m_pc+";"+d+";m_effects=["+GNUSTO_EFFECT_SAVE+"];return"}function
handleZ_restoreV123(c,b){c.m_compilation_running=0;c._brancher("");return"m_pc="+c.m_pc+";m_effects=["+GNUSTO_EFFECT_RESTORE+"];return"}function
handleZ_restoreV45678(c,b){c.m_compilation_running=0;var
d="m_rebound=function() { var t=m_answers[0]; if
(t==0){"+c._storer("t")+"}};";return"m_pc="+c.m_pc+";"+d+"m_effects=["+GNUSTO_EFFECT_RESTORE+"];return"}function
handleZ_log_shift(c,b){return
c._storer("_log_shift("+b[0]+","+b[1]+")")}function
handleZ_art_shift(c,b){return
c._storer("_art_shift("+b[0]+","+b[1]+")")}function
handleZ_set_font(c,b){return c._storer("("+b[0]+"<2?1:0)")}function
handleZ_save_undo(c,b){return c._storer("_save_undo(3)")}function
handleZ_restore_undo(c,b){return"if(_restore_undo(3))return;"+c._storer("0")}function
handleZ_print_unicode(c,b){return
c._handler_zOut("String.fromCharCode("+b[0]+")",0)}function
handleZ_check_unicode(c,b){return c._storer("3")}var
handlers_v578={1:handleZ_je,2:handleZ_jl,3:handleZ_jg,4:handleZ_dec_chk,5:handleZ_inc_chk,6:handleZ_jin,7:handleZ_test,8:handleZ_or,9:handleZ_and,10:handleZ_test_attr,11:handleZ_set_attr,12:handleZ_clear_attr,13:handleZ_store,14:handleZ_insert_obj,15:handleZ_loadw,16:handleZ_loadb,17:handleZ_get_prop,18:handleZ_get_prop_addr,19:handleZ_get_next_prop,20:handleZ_add,21:handleZ_sub,22:handleZ_mul,23:handleZ_div,24:handleZ_mod,25:handleZ_call_2s,26:handleZ_call_2n,27:handleZ_set_colour,28:handleZ_throw,128:handleZ_jz,129:handleZ_get_sibling,130:handleZ_get_child,131:handleZ_get_parent,132:handleZ_get_prop_len,133:handleZ_inc,134:handleZ_dec,135:handleZ_print_addr,136:handleZ_call_1s,137:handleZ_remove_obj,138:handleZ_print_obj,139:handleZ_ret,140:handleZ_jump,141:handleZ_print_paddr,142:handleZ_load,143:handleZ_call_1n,176:handleZ_rtrue,177:handleZ_rfalse,178:handleZ_print,179:handleZ_print_ret,180:handleZ_nop,183:handleZ_restart,184:handleZ_ret_popped,185:handleZ_catch,186:handleZ_quit,187:handleZ_new_line,189:handleZ_verify,190:handleZ_illegal_extended,191:handleZ_piracy,224:handleZ_call_vs,225:handleZ_store_w,226:handleZ_storeb,227:handleZ_putprop,228:handleZ_read,229:handleZ_print_char,230:handleZ_print_num,231:handleZ_random,232:handleZ_push,233:handleZ_pull,234:handleZ_split_window,235:handleZ_set_window,236:handleZ_call_vs,237:handleZ_erase_window,238:handleZ_erase_line,239:handleZ_set_cursor,240:handleZ_get_cursor,241:handleZ_set_text_style,242:handleZ_buffer_mode,243:handleZ_output_stream,244:handleZ_input_stream,245:handleZ_sound_effect,246:handleZ_read_char,247:handleZ_scan_table,248:handleZ_not,249:handleZ_call_vn,250:handleZ_call_vn,251:handleZ_tokenise,252:handleZ_encode_text,253:handleZ_copy_table,254:handleZ_print_table,255:handleZ_check_arg_count,1000:handleZ_saveV45678,1001:handleZ_restoreV45678,1002:handleZ_log_shift,1003:handleZ_art_shift,1004:handleZ_set_font,1009:handleZ_save_undo,1010:handleZ_restore_undo,1011:handleZ_print_unicode,1012:handleZ_check_unicode};var
handlers_fixups={1:{25:0,26:0,27:0,28:0,136:0,143:handleZ_not,181:handleZ_saveV123,182:handleZ_restoreV123,185:handleZ_pop,188:handleZ_show_status,190:0,191:0,236:0,237:0,238:0,239:0,240:0,241:0,242:0,246:0,247:0,248:0,249:0,250:0,251:0,252:0,253:0,254:0,255:0},2:{25:0,26:0,27:0,28:0,136:0,143:handleZ_not,181:handleZ_saveV123,182:handleZ_restoreV123,185:handleZ_pop,188:handleZ_show_status,190:0,191:0,236:0,237:0,238:0,239:0,240:0,241:0,242:0,246:0,247:0,248:0,249:0,250:0,251:0,252:0,253:0,254:0,255:0},3:{25:0,26:0,27:0,28:0,136:0,143:handleZ_not,181:handleZ_saveV123,182:handleZ_restoreV123,185:handleZ_pop,188:handleZ_show_status,190:0,191:0,236:0,237:0,238:0,239:0,240:0,241:0,242:0,246:0,247:0,248:0,249:0,250:0,251:0,252:0,253:0,254:0,255:0},4:{26:0,27:0,28:0,143:handleZ_not,181:handleZ_saveV45678,182:handleZ_restoreV45678,185:handleZ_pop,190:0,191:0,248:0,249:0,250:0,251:0,252:0,253:0,254:0,255:0},5:"",6:undefined,7:"",8:""};function
pc_translate_v123(a){return"(("+a+")&0xFFFF)*2"}function
pc_translate_v45(a){return"(("+a+")&0xFFFF)*4"}function
pc_translate_v67R(a){return"(("+a+")&0xFFFF)*4+"+this.m_routine_start}function
pc_translate_v67S(a){return"(("+a+")&0xFFFF)*4+"+this.m_string_start}function
pc_translate_v8(a){return"(("+a+")&0xFFFF)*8"}function
gnusto_error(b){message="Component: engine\n";for(var
a=1;a<arguments.length;a++){if(arguments[a]&&arguments[a].toString){message+="\nDetail: "+arguments[a].toString()}}throw
new FatalError(message)}function
onISRReturn_for_read_char(b,a){if(a){b.engine.m_answers[0]=0;b.rebound()}else{b.engine.m_effects=b.effects;b.engine.m_rebound=b.rebound;b.engine.m_rebound_args=b.rebound_args}}function
onISRReturn_for_read(b,a){var
c=b.engine;if(a){c.m_answers[0]=0;c.m_answers[1]="";b.rebound()}else{c.m_effects=b.effects;c.m_rebound=b.rebound;c.m_rebound_args=b.rebound_args}}function
GnustoEngine(a){if(a){this.logger=function(d,c){a("gnusto-engine: "+d+": "+c)}}else{this.logger=function(){}}}GnustoEngine.prototype={loadStory:function
ge_loadStory(a){this.m_memory=a;this._initial_setup()},loadSavedGame:function
ge_loadSavedGame(memLen,mem,mem_is_compressed,stacksLen,stacks,pc){function
decodeStackInt(offset,length){var result=stacks[offset++];for(var
i=1;i<length;i++){result=(result<<8)|stacks[offset++]}return
result}if(mem_is_compressed){var temp=[];var cursor_compressed=0;var
cursor_original=0;while(cursor_compressed<mem.length){if(cursor_original>=this.m_original_memory.length){gnusto_error(999,"overshoot
in decompression")}var
candidate=mem[cursor_compressed++];if(candidate==0){var
run_length=mem[cursor_compressed++]+1;temp=temp.concat(this.m_original_memory.slice(cursor_original,cursor_original+run_length));cursor_original+=run_length}else{temp.push(candidate^this.m_original_memory[cursor_original++])}}mem=temp}this.m_call_stack=[];this.m_gamestack=[];this.m_locals_stack=[];this.m_locals=[];this.m_result_targets=[];var
evals_count=0;evals_count=decodeStackInt(7,1);this.m_gamestack_callbreaks=[];var
callbreaks_top=evals_count;var cursor=8;for(var
m=0;m<evals_count;m++){this.m_gamestack.push(decodeStackInt(cursor,2));cursor+=2}while(cursor<stacksLen){this.m_call_stack.push(decodeStackInt(cursor,3));cursor+=3;var
flags=stacks[cursor++];var
varcode=stacks[cursor++];if(flags&16){varcode=-1}var
locals_count=flags&15;this.m_locals_stack.unshift(locals_count);this.m_result_targets.push(varcode);var
logArgs=stacks[cursor++]+1;var
argCount=0;while(logArgs>1){logArgs>>=1;argCount++}this.m_param_counts.unshift(argCount);evals_count=decodeStackInt(cursor,2);cursor+=2;callbreaks_top+=evals_count;this.m_gamestack_callbreaks.push(callbreaks_top);var
locals_temp=[];for(var
k=0;k<locals_count;k++){locals_temp.push(decodeStackInt(cursor,2));cursor+=2}this.m_locals=locals_temp.concat(this.m_locals);for(var
m=0;m<evals_count;m++){this.m_gamestack.push(decodeStackInt(cursor,2));cursor+=2}}for(var
n=0;n<16;n++){this.m_locals.push(0)}this.m_memory=mem.concat(this.m_memory.slice(mem.length));if(this.m_version<=3){this.m_pc=pc;eval("var
t=new
Function('with(this){'+_brancher('1')+'}');t.call(this);")}else{this._varcode_set(2,this.m_memory[pc]);this.m_pc=pc+1}},resetStory:function
ge_resetStory(){this.m_memory=this.m_original_memory.slice();this._initial_setup()},version:function
ge_version(){gnusto_error(101,"'version' not
implemented")},signature:function
ge_signature(){gnusto_error(101,"'signature' not
implemented")},cvsVersion:function ge_cvsVersion(){return
CVS_VERSION.substring(7,26)},setGoldenTrail:function
ge_setGoldenTrail(a){if(a){this.m_goldenTrail=1}else{this.m_goldenTrail=0}},setCopperTrail:function
ge_setCopperTrail(a){if(a){this.m_copperTrail=1}else{this.m_copperTrail=0}},effect:function
ge_effect(a){return this.m_effects[a]},answer:function
ge_answer(b,a){this.m_answers[b]=a},run:function ge_run(){var
start_pc=0;var turns=0;var jscode;var
turns_limit=this.m_single_step?1:10000;if(this.m_rebound){this.m_rebound();this.m_rebound=0;this.m_rebound_args=[]}this.m_effects=[];while(this.m_effects.length==0){if(turns++>=turns_limit){this.m_effects=["WO"];return
1}start_pc=this.m_pc;if(this.m_jit[start_pc]){jscode=this.m_jit[start_pc]}else{jscode=eval("with
(this)
{dummy="+this._compile()+"}");if(start_pc>=this.m_stat_start){this.m_jit[start_pc]=jscode}}jscode()}},walk:function
ge_walk(a){gnusto_error(101,"'walk' not
implemented")},setRandomSeed:function
ge_setRandomSeed(a){if(a>0){this._random_number(-a)}else{this._random_number(a)}},saveGame:function
ge_saveGame(){function c(A,k){var j=[];j.length=k;for(var
m=0;m<k;m++){j[(k-m)-1]=A&255;A>>=8}return j}var d=this.m_state_to_save;var
f=[70,79,82,77];var p=[67,77,101,109];var b=[85,77,101,109];var
l=[83,116,107,115];var
t=[73,70,90,83,73,70,104,100,0,0,0,13,d.m_memory[2],d.m_memory[3],d.m_memory[18],d.m_memory[19],d.m_memory[20],d.m_memory[21],d.m_memory[22],d.m_memory[23],d.m_memory[28],d.m_memory[29],(d.m_pc>>16)&255,(d.m_pc>>8)&255,(d.m_pc)&255,0];if(this.m_compress_save_files){var
n=[];var o=0;for(var
v=0;v<this.m_stat_start;v++){if(d.m_memory[v]==this.m_original_memory[v]){o++;if(o==256){n.push(0);n.push(255);o=0}}else{if(o!=0){n.push(0);n.push(o-1);o=0}n.push(d.m_memory[v]^this.m_original_memory[v])}}if(o!=0){n.push(0);n.push(o-1)}t=t.concat(p);t=t.concat(c(n.length,4));t=t.concat(n);if((n.length%2)!=0){t.push(0)}}else{t=t.concat(b);t=t.concat(c(this.m_stat_start,4));t=t.concat(this.m_memory.slice(0,this.m_stat_start));if((this.m_stat_start%2)!=0){t.push(0)}}var
w=[0,0,0,0,0,0];w=w.concat(c(this.m_gamestack_callbreaks[0],2));var
y=this.m_locals.length-16;var a=0;for(var
r=0;r<this.m_gamestack_callbreaks[0];r++){w=w.concat(c(this.m_gamestack[a++],2))}for(var
u=0;u<this.m_call_stack.length;u++){w=w.concat(c(this.m_call_stack[u],3));var
q=this.m_locals_stack[this.m_locals_stack.length-(u+1)];var e=q;var
z=this.m_result_targets[u];var
x=this.m_param_counts[this.m_param_counts.length-(u+1)];var
g=this.m_gamestack_callbreaks[u]-a;if(z==-1){z=0;e|
=16}w=w.concat([e,z,(1<<x)-1,(g>>8)&255,(g)&255]);y-=q;for(var
s=0;s<q;s++){w=w.concat(c(this.m_locals[y+s],2))}for(var
r=0;r<g;r++){w=w.concat(c(this.m_gamestack[a++],2))}}t=t.concat(l);t=t.concat(c(w.length,4));t=t.concat(w);var
h=f;h=h.concat(c(t.length,4));h=h.concat(t);this.m_quetzal_image=h;return
this.m_quetzal_image.length},saveGameData:function ge_saveGameData(b,a){var
c=this.m_quetzal_image;this.m_quetzal_image=0;return
c},architecture:function ge_architecture(){return"none"},piracy:function
ge_piracy(){return -1},tandy:function ge_tandy(){return -1},status:function
ge_status(){return"this is the status, hurrah!"},getStatusLine:function
ge_getStatusLine(d){var g=this.getUnsignedWord(this.m_vars_start);var
f=this.getUnsignedWord(this.m_property_list_addr_start+(this.m_object_size*g));var
b=this._zscii_from(f+1);if(b.length>d){b=b.substring(0,d-3);var e="...";var
h=""}else{if((this.m_version>3)&&((this.getByte(1)&2)==2)){var
a=this.getUnsignedWord(this.m_vars_start+2);var
c=this.getUnsignedWord(this.m_vars_start+4);if(c<10){var
e=a+":0"+c}else{var e=a+":"+c}}else{var
e="Score: "+this.getUnsignedWord(this.m_vars_start+2)+"
Moves: "+this.getUnsignedWord(this.m_vars_start+4)}if((b.length+e.length+1)>d){e="
S:"+this.getUnsignedWord(this.m_vars_start+2)+"
M:"+this.getUnsignedWord(this.m_vars_start+4);if((b.length+e.length+1)>d){e=" "+this.getUnsignedWord(this.m_vars_start+2)+"/"+this.getUnsignedWord(this.m_vars_start+4)}if((b.length+e.length+1)>d){e=""}}var
h="";while((b.length+e.length+h.length)<d){h+=" "}}return
b+h+e},_initial_setup:function
ge_initial_setup(){this.m_jit=[];this.m_compilation_running=0;this.m_gamestack=[];this.m_gamestack_callbreaks=[];this.m_call_stack=[];this.m_locals=[];this.m_locals_stack=[];this.m_param_counts=[];this.m_result_targets=[];this.m_goldenTrail=0;this.m_copperTrail=0;this.m_version=this.m_memory[0];this.m_himem=this.getUnsignedWord(4);this.m_pc=this.getUnsignedWord(6);this.m_dict_start=this.getUnsignedWord(8);this.m_objs_start=this.getUnsignedWord(10);this.m_vars_start=this.getUnsignedWord(12);this.m_stat_start=this.getUnsignedWord(14);this.m_abbr_start=this.getUnsignedWord(24);if(this.m_version>=4){this.m_alpha_start=this.getUnsignedWord(52);this.m_object_tree_start=this.m_objs_start+112;this.m_property_list_addr_start=this.m_object_tree_start+12;this.m_object_size=14}else{this.m_alpha_start=0;this.m_object_tree_start=this.m_objs_start+53;this.m_property_list_addr_start=this.m_object_tree_start+7;this.m_object_size=9}this.m_hext_start=this.getUnsignedWord(54);this.m_original_memory=this.m_memory.slice();if(this.m_version<=3){this.m_pc_translate_for_routine=pc_translate_v123;this.m_pc_translate_for_string=pc_translate_v123}else{if(this.m_version<=5){this.m_pc_translate_for_routine=pc_translate_v45;this.m_pc_translate_for_string=pc_translate_v45}else{if(this.m_version<=7){this.m_routine_start=this.getUnsignedWord(40)*8;this.m_string_start=this.getUnsignedWord(42)*8;this.m_pc_translate_for_routine=pc_translate_v67R;this.m_pc_translate_for_string=pc_translate_v67S}else{if(this.m_version==8){this.m_pc_translate_for_routine=pc_translate_v8;this.m_pc_translate_for_string=pc_translate_v8}else{gnusto_error(170,"impossible:
unknown z-version got this far")}}}}if(!(this.m_version in
handlers_fixups)){gnusto_error(311,"unknown z-machine version")}var
f=handlers_fixups[this.m_version];switch(typeof(f)){case"undefined":gnusto_error(101,"z-machine
version not
implemented");break;case"string":this.m_handlers=handlers_v578;break;case"object":this.m_handlers={};for(var
c in handlers_v578){this.m_handlers[c]=handlers_v578[c]}for(var g in
f){if((typeof f[g])=="function"){this.m_handlers[g]=f[g]}else{delete
this.m_handlers[g]}}break;default:gnusto_error(170,"impossible: weird stuff
in fixups
table")}this.m_separator_count=this.m_memory[this.m_dict_start];for(var
h=0;h<this.m_separator_count;h++){this.m_separators[h]=this._zscii_char_to_ascii(this.m_memory[this.m_dict_start+h+1])}if(this.m_hext_start>0){this.m_unicode_start=this.getUnsignedWord(this.m_hext_start+6);if(this.m_unicode_start>0){this.m_custom_unicode_charcount=this.m_memory[this.m_unicode_start];this.m_unicode_start+=1;for(var
h=0;h<this.m_custom_unicode_charcount;h++){reverse_unicode_table[this.getUnsignedWord(this.m_unicode_start+(h*2))]=h+155}}}if(!(this.m_unicode_start>0)){for(var
h in
default_unicode_translation_table){reverse_unicode_table[default_unicode_translation_table[h]]=h}}this.m_rebound=0;this.m_rebound_args=[];this.m_output_to_console=1;this.m_streamthrees=[];this.m_output_to_script=0;this.m_console_buffer="";this.m_transcript_buffer="";this.m_zalphabet[0]="abcdefghijklmnopqrstuvwxyz";this.m_zalphabet[1]="ABCDEFGHIJKLMNOPQRSTUVWXYZ";if(this.m_version==1){this.m_zalphabet[2]="T0123456789.,!?_#'\"/\\<-:()"}else{this.m_zalphabet[2]="T\n0123456789.,!?_#'\"/\\-:()"}var
e;var j;if(this.m_alpha_start>0){for(var a=0;a<3;a++){var b="";for(var
d=0;d<26;d++){j=this.m_memory[this.m_alpha_start+(a*26)+d];if((j>=155)&&(j<=251)){if(this.m_unicode_start==0){b+=String.fromCharCode(default_unicode_translation_table[j])}else{if((j-154)<=this.m_custom_unicode_charcount){b+=String.fromCharCode(this.getUnsignedWord(this.m_unicode_start+((j-155)*2)))}else{b+=" "}}}else{e=String.fromCharCode(j);if(e=="^"){e="\n"}b+=e}}this.m_zalphabet[a]=b}}for(var
h=0;h<16;h++){this.m_locals[h]=0}this.m_printing_header_bits=0;this.m_leftovers=""},getByte:function
ge_getbyte(a){if(a<0){a&=65535}return this.m_memory[a]},setByte:function
ge_setByte(b,a){if(a<0){a&=65535}this.m_memory[a]=b},getWord:function
ge_getWord(a){if(a<0){a&=65535}var b=(this.m_memory[a]<<8)|
this.m_memory[a+1];return((b&32768)?~65535:0)|b},_unsigned2signed:function
ge_unsigned2signed(a){return((a&32768)?~65535:0)|
a},_signed2unsigned:function ge_signed2unsigned(a){return
a&65535},getUnsignedWord:function
ge_getUnsignedWord(a){if(a<0){a&=65535}return(this.m_memory[a]<<8)|
this.m_memory[a+1]},setWord:function
ge_setWord(b,a){if(a<0){a&=65535}this.m_memory[a]=(b>>8)&255;this.m_memory[a+1]=(b)&255},_handle_variable_parameters:function
ge_handle_var_parameters(c,d,a){var b=0,f="",e;if(a==1){d=(d<<8)|
255}while(1){var g=d&49152;if(g==49152){return
f}else{if(g==0){c[b++]=this.getWord(this.m_pc);this.m_pc+=2}else{if(g==16384){c[b++]=this.m_memory[this.m_pc++]}else{if(g==32768){e=this._code_for_varcode(this.m_memory[this.m_pc++]);f+=e[0];c[b++]=e[1]}}}}d=(d<<2)|
3}},_compile:function ge_compile(){this.m_compilation_running=1;var
f="",e=this.m_pc,d;temp_var=0;do{var b=[];this_instr_pc=this.m_pc;var
a=this.m_memory[this.m_pc++];if(a==0){gnusto_error(201)}else{if(a==190){a=1000+this.m_memory[this.m_pc++];f+=this._handle_variable_parameters(b,this.m_memory[this.m_pc++],1)}else{if(a&128){if(a&64){if(!(a&32)){a&=31}if(a==250|
|a==236){var
c=this.getUnsignedWord(this.m_pc);this.m_pc+=2;f+=this._handle_variable_parameters(b,c,2)}else{f+=this._handle_variable_parameters(b,this.m_memory[this.m_pc++],1)}}else{switch(a&48){case
0:b[0]=this.getWord(this.m_pc);this.m_pc+=2;a=(a&15)|128;break;case
16:b[0]=this.m_memory[this.m_pc++];a=(a&15)|128;break;case
32:d=this._code_for_varcode(this.m_memory[this.m_pc++]);f+=d[0];b[0]=d[1];a=(a&15)|
128;break;case 48:a=(a&15)|
176;break}}}else{if(a&64){d=this._code_for_varcode(this.m_memory[this.m_pc++]);f+=d[0];b[0]=d[1]}else{b[0]=this.m_memory[this.m_pc++]}if(a&32){d=this._code_for_varcode(this.m_memory[this.m_pc++]);f+=d[0];b[1]=d[1]}else{b[1]=this.m_memory[this.m_pc++]}a&=31}}}if(this.m_handlers[a]){f=f+this.m_handlers[a](this,b)+";"}else{if(a>=1128&&a<=1255&&"special_instruction_EXT"+(a-1000)
in
this){f=f+this["special_instruction_EXT"+(a-1000)](b)+";"}else{gnusto_error(200,this.m_pc.toString(16))}}}while(this.m_compilation_running);if(this.m_single_step|
|
this.m_debug_mode){f=f+"m_pc="+this.m_pc}f=f.replace(/m_gamestack\.push\(([^;]+)\);var
tmp_(\d+) = m_gamestack\.pop\(\);/,"var tmp_$2 = $1;");return"function
JIT_"+e.toString(16)+"_"+e+"(){"+f+"}"},_param_count:function
ge_param_count(){return this.m_param_counts[0]},_set_output_stream:function
ge_set_output_stream(c,a){if(c==0){}else{if(c==1){this.m_output_to_console=1}else{if(c==2){this.m_memory[17]|
=1}else{if(c==3){if(this.m_streamthrees.length>15){gnusto_error(202)}this.m_streamthrees.unshift([a,a+2])}else{if(c==4){this.m_output_to_script=1}else{if(c==-1){this.m_output_to_console=0}else{if(c==-2){this.m_memory[17]&=~1}else{if(c==-3){if(this.m_streamthrees.length<1){gnusto_error(203)}var
b=this.m_streamthrees.shift();this.setWord((b[1]-b[0])-2,b[0])}else{if(c==-4){this.m_output_to_script=0}else{gnusto_error(204,c)}}}}}}}}}},_trunc_divide:function
ge_trunc_divide(c,b){var a;if(b==0){gnusto_error(701);return
0}a=c/b;if(a>0){return Math.floor(a)}else{return
Math.ceil(a)}},_zscii_char_to_ascii:function
ge_zscii_char_to_ascii(b){if(b<0){gnusto_error(702,b)}var a;if(b==13||
b==10){a=10}else{if((b>=32&&b<=126)||
b==0){a=b}else{if(b>=155&&b<=251){if(this.m_unicode_start==0){return
String.fromCharCode(default_unicode_translation_table[b])}else{if((b-154)<=this.m_custom_unicode_charcount){return
String.fromCharCode(this.getUnsignedWord(this.m_unicode_start+((b-155)*2)))}else{gnusto_error(703,b)}}}else{return"*"}}}return
String.fromCharCode(a)},_ascii_code_to_zscii_code:function
ge_ascii_char_to_zscii(b){if((b>=32&&b<=126)||b==0){return b}var
a;if(b<0){gnusto_error(702,"Illegal unicode character:"+b)}else{if(b==13||
b==10){a=10}else{if((b>=32&&b<=126)||
b==0){a=b}else{a=reverse_unicode_table[b];if(!a){a="*".charCodeAt(0)}}}}return
a},_random_number:function
ge_random_number(a){if(a==0){this.m_random_use_seed=this.m_random_use_sequence=0;return
0}else{if(a<-999){this.m_random_state=Math.abs(a);this.m_random_use_seed=1;this.m_random_use_sequence=0;return
0}else{if(a<0){this.m_random_sequence_max=Math.abs(a)-1;this.m_random_state=0;this.m_random_use_seed=0;this.m_random_use_sequence=1;return
0}else{if(this.m_random_use_seed){this.m_random_state--;return
1+(Math.round(Math.abs(Math.tan(this.m_random_state))*8.71*a)%a)}else{if(this.m_random_use_sequence){var
b=this.m_random_state;this.m_random_state=this.m_random_state+1;if(this.m_random_state>this.m_random_sequence_max){this.m_random_state=0}return
1+(b%a)}else{return
1+Math.round((a-1)*Math.random())}}}}}gnusto_error(170,"random")},_func_gosub:function
ge_gosub(h,d,a,f){this.m_call_stack.push(a);this.m_pc=h;var
g=this.m_memory[this.m_pc++];if(this.m_version<5){var b=[];for(var
e=0;e<g;e++){if(e<d.length){b.push(d[e])}else{b.push(this.getWord(this.m_pc))}this.m_pc+=2}this.m_locals=b.concat(this.m_locals)}else{for(var
c=g;c>0;c--){if(c<=d.length){this.m_locals.unshift(d[c-1])}else{this.m_locals.unshift(0)}}}this.m_locals_stack.unshift(g);this.m_param_counts.unshift(d.length);this.m_result_targets.push(f);this.m_gamestack_callbreaks.push(this.m_gamestack.length);if(h==0){this._func_return(0)}},_func_interrupt:function
ge_interrupt(b,a){this.m_interrupt_information.push({on_return:a,rebound:this.m_rebound,rebound_args:this.m_rebound_args,engine:this,pc:this.m_pc,effects:this.m_effects});this._func_gosub(b,[],CALLED_FROM_INTERRUPT,-1)},_tokenise:function
ge_tokenise(q,h,j,d){var c=0;var e=h+2;var
t=h+1;if(isNaN(j)){j=0}if(isNaN(d)){d=0}function l(D,u,w){function
v(M,O,i){var K=0;var N,L;while(1){if(K==O.length){return
0}N=M.m_memory[i+K];L=O.charCodeAt(K);if(N==L){K++}else{if(N<L){return
-1}else{return 1}}}}var B=D.m_memory[w+D.m_separator_count+1];var
H=D.getWord(w+D.m_separator_count+2);var
z=D.m_dict_start+D.m_separator_count+4;var I=1;if(H<0){I=0;H=-H}var
E=u;u=D._into_zscii(u);if(I){var C=0,x=H-1;var G;var A;var
J;while(1){G=C+Math.round((x-C)/2);A=z+G*B;J=v(D,u,A);if(J<0){if(C==x){return
0}C=G+1}else{if(J>0){if(C==x){return 0}x=G-1}else{return A}}if(C>x){return
0}}}else{for(var y=0;y<H;y++){var F=z+y*B;if(v(D,u,F)==0){return F}}}return
0}function s(v,x,w,u){var
i=l(v,w,x);if(!(d&&i==0)){v.setWord(i,e);e+=2;v.setByte(w.length,e++);v.setByte(u,e++)}else{e+=4}c++;return
1}var f=this.m_memory[q];var
o="";if(j==0){j=this.m_dict_start}if(this.m_version<=4){f++;var
r=q+1;while(1){var
k=this.m_memory[r++];if(k==0){break}o+=String.fromCharCode(k)}}else{for(var
p=0;p<this.m_memory[q+1];p++){o+=String.fromCharCode(this.m_memory[q+2+p])}}var
m=[];var n="";var g=0;var b;if(this.m_version<=4){b=1}else{b=2}for(var
a=0;a<o.length;a++){if(o.charAt(a)==" "){if(n!=""){m[g]=n;s(this,j,m[g],(a-m[g].length)+b);g++;n=""}}else{if(this._is_separator(o.charAt(a))){if(n!=""){m[g]=n;s(this,j,m[g],(a-m[g].length)+b);g++}m[g]=o.charAt(a);s(this,j,m[g],a+b);g++;n=""}else{n+=o.charAt(a)}}}if(n!=""){m[g]=n;s(this,j,m[g],(a-m[g].length)+b)}this.setByte(c,t)},_aread:function
ge_aread(g,e,c,d){e&=65535;c&=65535;var f;var a;var
h;if(this.m_version<=4){f=this.m_memory[e]+1;a=d.substring(0,f).toLowerCase();h=e+1;this.setByte(0,e+1+a.length)}else{f=this.m_memory[e];a=d.substring(0,f).toLowerCase();h=e+2;this.setByte(a.length,e+1)}for(var
b=0;b<a.length;b++){this.setByte(this._ascii_code_to_zscii_code(a.charCodeAt(b)),h+b)}if(c!=0|
|this.m_version<5){this._tokenise(e,c,0,0)}if(g==13){return 10}else{return
g}},_terminating_characters:function
ge_terminating_characters(){if(this.m_version<5){return"\r"}else{var
b=this.getWord(46);var a="\r";while(1){var
c=this.m_memory[b++];if(c==0){break}else{if((c>=129&&c<=154)||
(c>=252)){a+=String.fromCharCode(c)}}}return a}},_func_return:function
ge_func_return(c){for(var
b=this.m_locals_stack.shift();b>0;b--){this.m_locals.shift()}this.m_param_counts.shift();this.m_pc=this.m_call_stack.pop();this.m_gamestack.length=this.m_gamestack_callbreaks.pop();var
d=this.m_result_targets.pop();if(d!=-1&&c!=null){this._varcode_set(c,d)}if(this.m_pc==CALLED_FROM_INTERRUPT){var
a=this.m_interrupt_information.pop();this.m_pc=a.pc;a.on_return(a,c)}},_throw_stack_frame:function
throw_stack_frame(a){if(a>this.m_call_stack.length||
a<1){gnusto_error(207,a)}while(this.m_call_stack.length>a-1){this._func_return(null)}},_get_prop_addr:function
ge_get_prop_addr(b,c){if(b==0){return 0}var
a=this._property_search(b,c,-1);if(a[2]){return a[0]}else{return
0}},_get_prop_len:function
ge_get_prop_len(a){a&=65535;if(this.m_version<4){return
1+(this.m_memory[a-1]>>5)}else{var
b=this.m_memory[a-1];if(b&128){b=b&63;if(b==0){return 64}else{return
b}}else{if(b&64){return 2}else{return
1}}}gnusto_error(170,"get_prop_len")},_get_next_prop:function
ge_get_next_prop(b,c){if(b==0){return 0}var
a=this._property_search(b,-1,c);if(a[2]){return a[3]}else{if(a[4]){return
0}else{gnusto_error(205,c)}}gnusto_error(173)},_get_prop:function
ge_get_prop(b,c){if(b==0){return 0}var
a=this._property_search(b,c,-1);if(a[1]==2){return
this.getWord(a[0])}else{if(a[1]==1){return this.m_memory[a[0]]}else{return
this.getWord(a[0])}}gnusto_error(174)},_property_search:function
ge_property_search(b,e,c){var
f=this.getUnsignedWord(this.m_property_list_addr_start+b*this.m_object_size);f=f+this.m_memory[f]*2+1;var
d=0;while(1){var a=1;var
g=this.m_memory[f++];if(this.m_version<4){a=(g>>5)+1;g=g&31}else{if(g&128){a=this.m_memory[f++]&63;if(a==0){a=64}}else{if(g&64){a=2}}g=g&63}if(g==e|
|
d==c){return[f,a,1,g,0]}else{if(g<e){if(e>0){return[this.m_objs_start+(e-1)*2,2,0,e,0]}else{return[-1,-1,0,e,d==e]}}}f+=a;d=g}gnusto_error(175)},_set_attr:function
ge_set_attr(b,d){if(b==0){return}var
a=this.m_object_tree_start+b*this.m_object_size+(d>>3);var
c=this.m_memory[a];this.setByte(c|(128>>(d%8)),a)},_clear_attr:function
ge_clear_attr(b,d){if(b==0){return}var
a=this.m_object_tree_start+b*this.m_object_size+(d>>3);var
c=this.m_memory[a];this.setByte(c&~(128>>(d%8)),a)},_test_attr:function
ge_test_attr(a,b){if(a==0){return
0}if((this.m_memory[this.m_object_tree_start+a*this.m_object_size+(b>>3)]&(128>>(b%8)))){return
1}else{return 0}},_put_prop:function put_prop(b,d,c){if(b==0){return}var
a=this._property_search(b,d,-1);if(!a[2]){gnusto_error(704)}if(a[1]==1){this.setByte(c&255,a[0])}else{if(a[1]==2){this.setWord(c&65535,a[0])}else{gnusto_error(705)}}},_get_older_sibling:function
ge_get_older_sibling(a){if(a==0){return 0}var
b=this._get_child(this._get_parent(a));if(a==b){return
0}while(b){next_along=this._get_sibling(b);if(next_along==a){return
b}b=next_along}return 0},_insert_obj:function ge_insert_obj(a,d){var
e=this._get_parent(a);var b=this._get_older_sibling(a);var
c=this._get_sibling(a);if(e&&this._get_child(e)==a){this._set_child(e,c)}if(b){this._set_sibling(b,c)}this._set_parent(a,d);if(d){this._set_sibling(a,this._get_child(d));this._set_child(d,a)}},_remove_obj:function
ge_remove_obj(a,b){this._insert_obj(a,0)},_get_family:function
ge_get_family(b,a){if(b==0){return 0}if(this.m_version<4){return
this.m_memory[this.m_object_tree_start+4+a+b*this.m_object_size]}else{return
this.getUnsignedWord(this.m_object_tree_start+6+a*2+b*this.m_object_size)}gnusto_error(170,"get_family")},_get_parent:function
ge_get_parent(a){return this._get_family(a,PARENT_REC)},_get_child:function
ge_get_child(a){return this._get_family(a,CHILD_REC)},_get_sibling:function
ge_get_sibling(a){return
this._get_family(a,SIBLING_REC)},_set_family:function
ge_set_family(c,b,a){if(this.m_version<4){this.setByte(b,this.m_object_tree_start+4+a+c*this.m_object_size)}else{this.setWord(b,this.m_object_tree_start+6+a*2+c*this.m_object_size)}},_set_parent:function
ge_set_parent(b,a){this._set_family(b,a,PARENT_REC)},_set_child:function
ge_set_child(b,a){this._set_family(b,a,CHILD_REC)},_set_sibling:function
ge_set_sibling(b,a){this._set_family(b,a,SIBLING_REC)},_obj_in:function
ge_obj_in(b,a){return this._get_parent(b)==a},_copy_table:function
ge_copy_table(e,a,c){if(a==0){for(var
b=0;b<c;b++){this.setByte(0,b+e)}}else{var
d=0;if(c<0){c=-c;d=1}else{if(e>a){d=1}else{d=0}}if(d){for(var
b=0;b<c;b++){this.setByte(this.m_memory[e+b],a+b)}}else{for(var
b=c-1;b>=0;b--){this.setByte(this.m_memory[e+b],a+b)}}}},_scan_table:function
ge_scan_table(g,a,f,d){var e=d&127;var b=((d&128)==128);var
c=a+(f*e);if(b){while(a<c){if(((this.m_memory[65535&a]&255)==((g>>8)&255))&&((this.m_memory[65535&a+1]&255)==(g&255))){return
a}a+=e}}else{while(a<c){if((this.m_memory[65535&a]&255)==(g&65535)){return
a}a+=e}}return 0},_print_table:function ge_print_table(d,a,f,e){var
i=[];for(var b=0;b<f;b++){var h="";for(var
c=0;c<a;c++){if(d<0){d&=65535}h=h+this._zscii_char_to_ascii(this.m_memory[d++])}i.push(h);d+=e}var
g=["PT",i.length];g=g.concat(i);return g},_zscii_from:function
ge_zscii_from(l,m,d){if(l in this.m_jit){if(d){return
this.m_jit[l]}else{return this.m_jit[l][0]}}var n="";var g=1;var o=l;var
f=0;var h=f;var k=-2;var i=0;if(!m){m=65535}var c=l+m;while(g){var
a=this.getUnsignedWord(l);l+=2;g=((a&32768)==0)&&l<c;for(var
e=2;e>=0;e--){var
b=((a>>(e*5))&31);if(i){n=n+this._zscii_from(this.getUnsignedWord((32*(i-1)+b)*2+this.m_abbr_start)*2);i=0;h=f}else{if(k==-2){if(b>5){if(h==2&&b==6){k=-1}else{n=n+this.m_zalphabet[h].charAt(b-6);h=f}}else{if(b==0){n=n+" ";h=f}else{if(b<4){if(this.getByte(0)>2){i=b}else{if(b==2){h+=1;if(h>2){h=0}}else{if(b==3){h-=1;if(h<0){h=2}}else{if(this.getByte(0)==2){i=1}else{n=n+"\n";h=f}}}}}else{if(this.getByte(0)>2){h=b-3}else{if(b==4){f+=1;if(f>2){f=0}}else{f-=1;if(f<0){f=2}}h=f}}}}}else{if(k==-1){k=b}else{n=n+this._zscii_char_to_ascii((k<<5)+b);k=-2;h=f}}}}}if(o>=this.m_stat_start){this.m_jit[o]=[n,l]}if(d){return[n,l]}else{return
n}},_encode_text:function ge_encode_text(k,d,j,h){k=(k+j)&65535;var
a="";while(d>0){var
g=this.m_memory[k];if(g==0){break}a=a+String.fromCharCode(g);k++;d--}var
l=this._into_zscii(a);for(var e=0;e<l.length;e++){var
f=l[e].charCodeAt(0);this.setByte(f,h++)}},_into_zscii:function
ge_into_zscii(f){var j="";var d=[];var
e;if(this.m_version<4){e=4}else{e=6}function
h(l){d.push(l);if(d.length==3){var k=(d[0]<<10|d[1]<<5|
d[2]);if(j.length==e-2){k|
=32768}j=j+String.fromCharCode(k>>8)+String.fromCharCode(k&255);d=[]}}var
a,i=0,c;while(i<f.length&&j.length<e){a=f.charCodeAt(i++);if(a>=65&&a<=90){a+=32}else{if(a>154){if(this.m_unicode_start==0){if((a>=158&&a<=160)|
|(a>=167&&a<=168)||
(a>=208&&a<=210)){a-=3}else{if(a>=175&&a<=180){a-=6}else{if((a>=186&&a<=190)|
|(a>=196&&a<=200)){a-=5}else{if(a==217||a==218){a-=2}else{if(a==202||a==204|
|a==212||a==214||a==221){a-=1}}}}}}else{var
g=this._ascii_code_to_zscii_code(this._zscii_char_to_ascii(a).toLowerCase().charCodeAt(0));if(g>0&&g<=251&&g!="*".charCodeAt(0)){a=g}}}}var
b=String.fromCharCode(this._zscii_char_to_ascii(a).charCodeAt(0));c=this.m_zalphabet[0].indexOf(b);if(c!=-1){h(c+6)}else{c=this.m_zalphabet[1].indexOf(b);if(c!=-1){if(this.getByte(0)>2){h(4)}else{h(2)}h(c+6)}else{c=this.m_zalphabet[2].indexOf(b);if(c!=-1){if(this.getByte(0)>2){h(5)}else{h(3)}h(c+6)}else{if(this.getByte(0)>2){h(5)}else{h(3)}h(6);h(a>>5);h(a&31)}}}}while(j.length<e){h(5)}return
j.substring(0,e)},_name_of_object:function
ge_name_of_object(a){if(a==0){return"<void>"}else{var
b=this.m_property_list_addr_start+a*this.m_object_size;return
this._zscii_from(this.getUnsignedWord(b)+1)}},_print_leftovers:function
ge_print_leftovers(){this._zOut(this.m_leftovers);this.m_leftovers=""},_zOut:function
ge_zOut(f){if(this.m_streamthrees.length){var d=this.m_streamthrees[0];var
a=this.m_streamthrees[0][1];for(var
b=0;b<f.length;b++){this.setByte(this._ascii_code_to_zscii_code(f.charCodeAt(b)),a++)}this.m_streamthrees[0][1]=a}else{var
c=this.m_memory[17]&3;var
e=c!=this.m_printing_header_bits;effect_parameters=this.m_printing_header_bits;this.m_printing_header_bits=c;if(e){this.m_leftovers=f;this.m_rebound=this._print_leftovers;return
1}else{if(this.m_output_to_console){this.m_console_buffer=this.m_console_buffer+f}if(c&1){this.m_transcript_buffer=this.m_transcript_buffer+f}}}return
0},consoleText:function ge_console_text(){var
a=this.m_console_buffer.replace("\x00","","g");this.m_console_buffer="";return
a},_transcript_text:function ge_transcript_text(){var
a=this.m_transcript_buffer.replace("\x00","","g");this.m_transcript_buffer="";return
a},_is_separator:function ge_IsSeparator(b){for(var
a=0;a<this.m_separator_count;a++){if(b==this.m_separators[a]){return
1}}return 0},_code_for_varcode:function ge_code_for_varcode(c){var
e="",b;if(c==0){e="var tmp_"+(++temp_var)+" =
m_gamestack.pop();";b="tmp_"+temp_var}else{if(c<16){b="m_locals["+(c-1)+"]"}else{var
f=this.m_vars_start+(c-16)*2,a=f+1;var d="tmp_"+(++temp_var);e="var "+d+" =
(m_memory["+f+"] << 8) | m_memory["+a+"];"+d+" = ("+d+" & 0x8000 ?
~0xFFFF : 0) | "+d+";";b=d}}return[e,b]},_varcode_get:function
ge_varcode_get(a){if(a==0){return
this.m_gamestack.pop()}else{if(a<16){return
this.m_locals[(a-1)]}else{return
this.getWord(this.m_vars_start+(a-16)*2)}}gnusto_error(170,"varcode_get")},_varcode_set:function
ge_varcode_set(b,a){if(a==0){this.m_gamestack.push(b)}else{if(a<16){this.m_locals[a-1]=b}else{this.setWord(b,this.m_vars_start+(a-16)*2)}}},_brancher:function
ge_brancher(e){var b=1;var a=this.m_memory[this.m_pc++];var
c=a&63;if(a&128){b=0}if(!(a&64)){c=(c<<8)|
this.m_memory[this.m_pc++];if(c&8192){c=(~8191)|(c&8191)}}var
d=e;if(b){d="if(!("+d+"))"}else{d="if("+d+")"}if(c==0){return
d+"{_func_return(0);return;}"}if(c==1){return
d+"{_func_return(1);return;}"}c=(this.m_pc+c)-2;return
d+"{m_pc="+(c)+";return;}"},_storer:function ge_storer(b){var
a=this.m_memory[this.m_pc++];if(b.substring&&b.substring(0,11)=="_func_gosub"){this.m_compilation_running=0;if(b.substring(b.length-4)!=",-1)"){gnusto_error(100,b)}return
b.substring(0,b.length-3)+a+")"}else{if(a==0){return"m_gamestack.push("+b+")"}else{if(a<16){return"m_locals["+(a-1)+"]="+b}else{return"setWord("+b+","+(this.m_vars_start+(a-16)*2)+")"}}}gnusto_error(170,"storer")},_generate_gosub:function
call_vn(d,c,b){this.m_compilation_running=0;var
a=-1;if(b){a=this.m_memory[this.m_pc++]}return"_func_gosub("+this.m_pc_translate_for_routine(d)+",["+c.toString()+"],"+this.m_pc+","+a+")"},_handler_zOut:function
ge_handler_zOut(b,a){var
c;if(a){c="_func_return(1)"}else{c="m_pc=0x"+this.m_pc.toString(16)}return"if(_zOut("+b+")){"+c+";m_effects=["+GNUSTO_EFFECT_FLAGS_CHANGED+"];return
1}"},_handler_print:function ge_handler_print(c,a){var
d=this._zscii_from(this.m_pc,65535,1);var
b=d[0];if(c){b=b+c}b=b.quote();this.m_pc=d[1];return
this._handler_zOut(b,a)},_log_shift:function
ge_log_shift(b,a){if(a<0){return(b>>>(-1*a))&32767}else{return(b<<a)&32767}},_art_shift:function
ge_art_shift(b,a){if(a<0){return(b>>(-1*a))&32767}else{return(b<<a)&32767}},_touch:function
ge_touch(a){if(this.m_goldenTrail){this.logger("pc",a.toString(16))}this.m_pc=a},_save_undo:function
ge_save_undo(a){this.m_undo=this._saveable_state(a);return
1},_restore_undo:function ge_restore_undo(){if(typeof
this.m_undo!="object"){return
0}this.m_call_stack=this.m_undo.m_call_stack;this.m_locals=this.m_undo.m_locals;this.m_locals_stack=this.m_undo.m_locals_stack;this.m_param_counts=this.m_undo.m_param_counts;this.m_result_targets=this.m_undo.m_result_targets;this.m_gamestack=this.m_undo.m_gamestack;this.m_gamestack_callbreaks=this.m_undo.m_gamestack_callbreaks;var
a=this.m_undo.m_memory;this.m_memory=a.concat(this.m_memory.slice(a.length));this._varcode_set(2,this.m_memory[this.m_undo.m_pc]);this.m_pc=this.m_undo.m_pc+1;this.m_undo=0;return
1},_saveable_state:function ge_saveable_state(b){var
a={m_memory:this.m_memory.slice(0,this.m_stat_start),m_pc:this.m_pc+b,m_call_stack:this.m_call_stack.slice(),m_locals:this.m_locals.slice(),m_locals_stack:this.m_locals_stack.slice(),m_param_counts:this.m_param_counts.slice(),m_result_targets:this.m_result_targets.slice(),m_gamestack:this.m_gamestack.slice(),m_gamestack_callbreaks:this.m_gamestack_callbreaks.slice()};return
a},_verify:function ge_verify(){var c=0;var
b=(this.m_original_memory[28]<<8|this.m_original_memory[29]);for(var
a=64;a<this.m_original_memory.length;a++){c+=this.m_original_memory[a]}return(c&65535)==b},m_local_game_file:0,m_memory:[],m_handlers:0,m_jit:[],m_goldenTrail:0,m_copperTrail:0,m_compilation_running:0,m_gamestack:0,m_gamestack_callbreaks:[],m_himem:0,m_pc:0,m_this_instr_pc:0,m_dict_start:0,m_objs_start:0,m_vars_start:0,m_stat_start:0,m_abbr_start:0,m_hext_start:0,m_alpha_start:0,m_zalphabet:[],m_string_start:0,m_routine_start:0,m_unicode_start:0,m_custom_unicode_charcount:0,m_separator_count:0,m_separators:[],m_version:0,m_call_stack:[],m_locals:[],m_locals_stack:0,m_param_counts:0,m_result_targets:[],m_rebound:0,m_rebound_args:[],m_output_to_console:0,m_streamthrees:[],m_output_to_script:0,m_single_step:0,m_debug_mode:0,m_parser_debugging:0,m_breakpoints:{},m_console_buffer:"",m_transcript_buffer:"",m_effects:[],m_answers:[],m_random_state:0,m_random_use_seed:0,m_random_use_sequence:0,m_random_sequence_max:0,m_printing_header_bits:0,m_leftovers:"",m_pc_translate_for_routine:pc_translate_v45,m_pc_translate_for_string:pc_translate_v45,m_undo:0,m_state_to_save:0,m_quetzal_image:0,m_original_memory:[],m_compress_save_files:1,m_object_tree_start:0,m_property_list_addr_start:0,m_object_size:14,m_interrupt_information:[]};
\ No newline at end of file

Copied: branches/dannii-testing/lib/jquery.min.js (from r126,
/trunk/lib/jquery.min.js)
==============================================================================
--- /trunk/lib/jquery.min.js (original)
+++ branches/dannii-testing/lib/jquery.min.js Mon Mar 23 20:34:58 2009
@@ -1,19 +1,19 @@
/*
- * jQuery JavaScript Library v1.3.1
+ * jQuery JavaScript Library v1.3.2
* http://jquery.com/
*
* Copyright (c) 2009 John Resig
* Dual licensed under the MIT and GPL licenses.
* http://docs.jquery.com/License
*
- * Date: 2009-01-21 20:42:16 -0500 (Wed, 21 Jan 2009)
- * Revision: 6158
+ * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009)
+ * Revision: 6246
*/
-(function(){var
l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new
o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|
^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||
document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return
this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]|
|!H)){if(G[1]){E=o.clean([G[1]],H)}else{var
I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var
F=o(I||[]);F.context=document;F.selector=E;return F}}else{return
o(H).find(E)}}else{if(o.isFunction(E)){return
o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return
this.setArray(o.makeArray(E))},selector:"",jquery:"1.3.1",size:function(){return
this.length},get:function(E){return
E===g?o.makeArray(this):this[E]},pushStack:function(F,H,E){var
G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return
G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return
this},each:function(F,E){return o.each(this,F,E)},index:function(E){return
o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof
F==="string"){if(H===g){return this[0]&&o[G|
|"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in
E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"|
|E=="height")&&parseFloat(F)<0){F=g}return
this.attr(E,F,"curCSS")},text:function(F){if(typeof
F!=="object"&&F!=null){return
this.empty().append((this[0]&&this[0].ownerDocument||
document).createTextNode(F))}var E="";o.each(F||
this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return
E},wrapAll:function(E){if(this[0]){var
F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var
G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return
this},wrapInner:function(E){return
this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return
this.each(function(){o(this).wrapAll(E)})},append:function(){return
this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return
this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return
this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return
this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return
this.prevObject||
o([])},push:[].push,find:function(E){if(this.length===1&&!/,/.test(E)){var
G=this.pushStack([],"find",E);G.length=0;o.find(E,this[0],G);return
G}else{var F=o.map(this,function(H){return o.find(E,H)});return
this.pushStack(/[^+>]
[^+>]/.test(E)?o.unique(F):F,"find",E)}},clone:function(F){var
E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var
I=this.cloneNode(true),H=document.createElement("div");H.appendChild(I);return
o.clean([H.innerHTML])[0]}else{return this.cloneNode(true)}});var
G=E.find("*").andSelf().each(function(){if(this[h]!==g){this[h]=null}});if(F===true){this.find("*").andSelf().each(function(I){if(this.nodeType==3){return}var
H=o.data(this,"events");for(var K in H){for(var J in
H[K]){o.event.add(G[I],K,H[K][J],H[K][J].data)}}})}return
E},filter:function(E){return
this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return
E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return
F.nodeType===1})),"filter",E)},closest:function(E){var
F=o.expr.match.POS.test(E)?o(E):null;return this.map(function(){var
G=this;while(G&&G.ownerDocument){if(F?F.index(G)>-1:o(G).is(E)){return
G}G=G.parentNode}})},not:function(E){if(typeof
E==="string"){if(f.test(E)){return
this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var
F=E.length&&E[E.length-1]!==g&&!E.nodeType;return
this.filter(function(){return
F?o.inArray(this,E)<0:this!=E})},add:function(E){return
this.pushStack(o.unique(o.merge(this.get(),typeof
E==="string"?o(E):o.makeArray(E))))},is:function(E){return !!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return !!E&&this.is("."+E)},val:function(K){if(K===g){var
E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||
{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var
I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return
null}for(var F=H?I:0,J=H?I+1:M.length;F<J;F++){var
G=M[F];if(G.selected){K=o(G).val();if(H){return K}L.push(K)}}return
L}return(E.value||"").replace(/\r/g,"")}return g}if(typeof
K==="number"){K+=""}return
this.each(function(){if(this.nodeType!=1){return}if(o.isArray(K)&&/radio|
checkbox/.test(this.type)){this.checked=(o.inArray(this.value,K)>=0||
o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var
N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0|
|
o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return
E===g?(this[0]?this[0].innerHTML:null):this.empty().append(E)},replaceWith:function(E){return
this.after(E).remove()},eq:function(E){return
this.slice(E,+E+1)},slice:function(){return
this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return
this.pushStack(o.map(this,function(G,F){return
E.call(G,F,G)}))},andSelf:function(){return
this.add(this.prevObject)},domManip:function(K,N,M){if(this[0]){var
J=(this[0].ownerDocument||
this[0]).createDocumentFragment(),G=o.clean(K,(this[0].ownerDocument||
this[0]),J),I=J.firstChild,E=this.length>1?J.cloneNode(true):J;if(I){for(var
H=0,F=this.length;H<F;H++){M.call(L(this[H],I),H>0?E.cloneNode(true):J)}}if(G){o.each(G,z)}}return
this;function L(O,P){return
N&&o.nodeName(O,"table")&&o.nodeName(P,"tr")?(O.getElementsByTagName("tbody")[0]|
|
O.appendChild(O.ownerDocument.createElement("tbody"))):O}}};o.fn.init.prototype=o.fn;function
z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text|
|F.textContent||F.innerHTML|
|"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return +new
Date}o.extend=o.fn.extend=function(){var J=arguments[0]||
{},H=1,I=arguments.length,E=false,G;if(typeof
J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof
J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H<I;H++){if((G=arguments[H])!=null){for(var
F in G){var K=J[F],L=G[F];if(J===L){continue}if(E&&L&&typeof
L==="object"&&!L.nodeType){J[F]=o.extend(E,K||
(L.length!=null?[]:{}),L)}else{if(L!==g){J[F]=L}}}}}return J};var
b=/z-?index|font-?weight|opacity|zoom|line-?height/i,q=document.defaultView|
|
{},s=Object.prototype.toString;o.extend({noConflict:function(E){l.$=p;if(E){l.jQuery=y}return
o},isFunction:function(E){return s.call(E)==="[object
Function]"},isArray:function(E){return s.call(E)==="[object
Array]"},isXMLDoc:function(E){return
E.nodeType===9&&E.documentElement.nodeName!=="HTML"|
|!!E.ownerDocument&&o.isXMLDoc(E.ownerDocument)},globalEval:function(G){G=o.trim(G);if(G){var
F=document.getElementsByTagName("head")[0]||
document.documentElement,E=document.createElement("script");E.type="text/javascript";if(o.support.scriptEval){E.appendChild(document.createTextNode(G))}else{E.text=G}F.insertBefore(E,F.firstChild);F.removeChild(E)}},nodeName:function(F,E){return
F.nodeName&&F.nodeName.toUpperCase()==E.toUpperCase()},each:function(G,K,F){var
E,H=0,I=G.length;if(F){if(I===g){for(E in
G){if(K.apply(G[E],F)===false){break}}}else{for(;H<I;){if(K.apply(G[H++],F)===false){break}}}}else{if(I===g){for(E
in G){if(K.call(G[E],E,G[E])===false){break}}}else{for(var
J=G[0];H<I&&K.call(J,H,J)!==false;J=G[++H]){}}}return
G},prop:function(H,I,G,F,E){if(o.isFunction(I)){I=I.call(H,F)}return typeof
I==="number"&&G=="curCSS"&&!b.test(E)?I+"px":I},className:{add:function(E,F){o.each((F|
|"").split(/\s+/),function(G,H){if(E.nodeType==1&&!o.className.has(E.className,H)){E.className+=(E.className?" ":"")+H}})},remove:function(E,F){if(E.nodeType==1){E.className=F!==g?o.grep(E.className.split(/\s+/),function(G){return !o.className.has(F,G)}).join(" "):""}},has:function(F,E){return
F&&o.inArray(E,(F.className||
F).toString().split(/\s+/))>-1}},swap:function(H,G,I){var E={};for(var F in
G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in
G){H.style[F]=E[F]}},css:function(G,E,I){if(E=="width"||E=="height"){var
K,F={position:"absolute",visibility:"hidden",display:"block"},J=E=="width"?["Left","Right"]:["Top","Bottom"];function
H(){K=E=="width"?G.offsetWidth:G.offsetHeight;var
M=0,L=0;o.each(J,function(){M+=parseFloat(o.curCSS(G,"padding"+this,true))||
0;L+=parseFloat(o.curCSS(G,"border"+this+"Width",true))||
0});K-=Math.round(M+L)}if(o(G).is(":visible")){H()}else{o.swap(G,F,H)}return
Math.max(0,K)}return o.curCSS(G,E,I)},curCSS:function(I,F,G){var
L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return
L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var
M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var
J=F.replace(/\-(\w)/g,function(N,O){return
O.toUpperCase()});L=I.currentStyle[F]||
I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var
H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L|
|0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return
L},clean:function(F,K,I){K=K||document;if(typeof
K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||
document}if(!I&&F.length===1&&typeof F[0]==="string"){var
H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var
G=[],E=[],L=K.createElement("div");o.each(F,function(P,R){if(typeof
R==="number"){R+=""}if(!R){return}if(typeof
R==="string"){R=R.replace(/(<(\w+)[^>]*?)\/>/g,function(T,U,S){return
S.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|
embed)$/i)?T:U+"></"+S+">"});var O=o.trim(R).toLowerCase();var
Q=!O.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]|
|!O.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||O.match(/^<(thead|
tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]|
|!O.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||
(!O.indexOf("<td")|
|!O.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]|
|!O.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]|
|!o.support.htmlSerialize&&[1,"div<div>","</div>"]||
[0,"",""];L.innerHTML=Q[1]+R+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var
N=!O.indexOf("<table")&&O.indexOf("<tbody")<0?L.firstChild&&L.firstChild.childNodes:Q[1]=="<table>"&&O.indexOf("<tbody")<0?L.childNodes:[];for(var
M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(R)){L.insertBefore(K.createTextNode(R.match(/^\s*/)[0]),L.firstChild)}R=o.makeArray(L.childNodes)}if(R.nodeType){G.push(R)}else{G=o.merge(G,R)}});if(I){for(var
J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||
G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return
E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||
J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||
G;if(J.tagName){var F=/href|src|
style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G
in
J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type
property can't be
changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return
J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var
I=J.getAttributeNode("tabIndex");return
I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|
textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g}return
J[G]}if(!o.support.style&&H&&G=="style"){return
o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var
E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return
E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter|
|"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return
J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return
N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E|
|"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var
E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||
o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return
E},inArray:function(G,H){for(var
E=0,F=H.length;E<F;E++){if(H[E]===G){return E}}return
-1},merge:function(H,E){var
F=0,G,I=H.length;if(!o.support.getAll){while((G=E[F++])!=null){if(G.nodeType!=8){H[I++]=G}}}else{while((G=E[F++])!=null){H[I++]=G}}return
H},unique:function(K){var F=[],E={};try{for(var G=0,H=K.length;G<H;G++){var
J=o.data(K[G]);if(!E[J]){E[J]=true;F.push(K[G])}}}catch(I){F=K}return
F},grep:function(F,J,E){var G=[];for(var
H=0,I=F.length;H<I;H++){if(!E!=!J(F[H],H)){G.push(F[H])}}return
G},map:function(E,J){var F=[];for(var G=0,H=E.length;G<H;G++){var
I=J(E[G],G);if(I!=null){F[F.length]=I}}return F.concat.apply([],F)}});var
C=navigator.userAgent.toLowerCase();o.browser={version:(C.match(/.+(?:rv|it|
ra|ie)[\/: ]([\d.]+)/)||
[0,"0"])[1],safari:/webkit/.test(C),opera:/opera/.test(C),msie:/msie/.test(C)&&!/opera/.test(C),mozilla:/mozilla/.test(C)&&!/(compatible|
webkit)/.test(C)};o.each({parent:function(E){return
E.parentNode},parents:function(E){return
o.dir(E,"parentNode")},next:function(E){return
o.nth(E,2,"nextSibling")},prev:function(E){return
o.nth(E,2,"previousSibling")},nextAll:function(E){return
o.dir(E,"nextSibling")},prevAll:function(E){return
o.dir(E,"previousSibling")},siblings:function(E){return
o.sibling(E.parentNode.firstChild,E)},children:function(E){return
o.sibling(E.firstChild)},contents:function(E){return
o.nodeName(E,"iframe")?E.contentDocument||
E.contentWindow.document:o.makeArray(E.childNodes)}},function(E,F){o.fn[E]=function(G){var
H=o.map(this,F);if(G&&typeof G=="string"){H=o.multiFilter(G,H)}return
this.pushStack(o.unique(H),E,G)}});o.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(E,F){o.fn[E]=function(){var
G=arguments;return this.each(function(){for(var
H=0,I=G.length;H<I;H++){o(G[H])[F](this)}})}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof
E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E|
|
o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){o(">*",this).remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return
this.each(F,arguments)}});function j(E,F){return
E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var
h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var
H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return
E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var
H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in
o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete
F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete
o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var
G=o.data(F,E);if(!G||
o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return
G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||
G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var
H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var
F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return
F===g&&H[1]?this.data(H[0]):F}else{return
this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return
this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof
E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return
this.each(function(){var
G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return
this.each(function(){o.dequeue(this,E)})}});
+(function(){var
l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new
o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|
^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||
document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return
this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]|
|!H)){if(G[1]){E=o.clean([G[1]],H)}else{var
I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var
F=o(I||[]);F.context=document;F.selector=E;return F}}else{return
o(H).find(E)}}else{if(o.isFunction(E)){return
o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return
this.setArray(o.isArray(E)?E:o.makeArray(E))},selector:"",jquery:"1.3.2",size:function(){return
this.length},get:function(E){return
E===g?Array.prototype.slice.call(this):this[E]},pushStack:function(F,H,E){var
G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return
G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return
this},each:function(F,E){return o.each(this,F,E)},index:function(E){return
o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof
F==="string"){if(H===g){return this[0]&&o[G|
|"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in
E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"|
|E=="height")&&parseFloat(F)<0){F=g}return
this.attr(E,F,"curCSS")},text:function(F){if(typeof
F!=="object"&&F!=null){return
this.empty().append((this[0]&&this[0].ownerDocument||
document).createTextNode(F))}var E="";o.each(F||
this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return
E},wrapAll:function(E){if(this[0]){var
F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var
G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return
this},wrapInner:function(E){return
this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return
this.each(function(){o(this).wrapAll(E)})},append:function(){return
this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return
this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return
this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return
this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return
this.prevObject||
o([])},push:[].push,sort:[].sort,splice:[].splice,find:function(E){if(this.length===1){var
F=this.pushStack([],"find",E);F.length=0;o.find(E,this[0],F);return
F}else{return this.pushStack(o.unique(o.map(this,function(G){return
o.find(E,G)})),"find",E)}},clone:function(G){var
E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var
I=this.outerHTML;if(!I){var
J=this.ownerDocument.createElement("div");J.appendChild(this.cloneNode(true));I=J.innerHTML}return
o.clean([I.replace(/ jQuery\d+="(?:\d+|
null)"/g,"").replace(/^\s*/,"")])[0]}else{return
this.cloneNode(true)}});if(G===true){var
H=this.find("*").andSelf(),F=0;E.find("*").andSelf().each(function(){if(this.nodeName!==H[F].nodeName){return}var
I=o.data(H[F],"events");for(var K in I){for(var J in
I[K]){o.event.add(this,K,I[K][J],I[K][J].data)}}F++})}return
E},filter:function(E){return
this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return
E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return
F.nodeType===1})),"filter",E)},closest:function(E){var
G=o.expr.match.POS.test(E)?o(E):null,F=0;return this.map(function(){var
H=this;while(H&&H.ownerDocument){if(G?G.index(H)>-1:o(H).is(E)){o.data(H,"closest",F);return
H}H=H.parentNode;F++}})},not:function(E){if(typeof
E==="string"){if(f.test(E)){return
this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var
F=E.length&&E[E.length-1]!==g&&!E.nodeType;return
this.filter(function(){return
F?o.inArray(this,E)<0:this!=E})},add:function(E){return
this.pushStack(o.unique(o.merge(this.get(),typeof
E==="string"?o(E):o.makeArray(E))))},is:function(E){return !!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return !!E&&this.is("."+E)},val:function(K){if(K===g){var
E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||
{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var
I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return
null}for(var F=H?I:0,J=H?I+1:M.length;F<J;F++){var
G=M[F];if(G.selected){K=o(G).val();if(H){return K}L.push(K)}}return
L}return(E.value||"").replace(/\r/g,"")}return g}if(typeof
K==="number"){K+=""}return
this.each(function(){if(this.nodeType!=1){return}if(o.isArray(K)&&/radio|
checkbox/.test(this.type)){this.checked=(o.inArray(this.value,K)>=0||
o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var
N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0|
|
o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return
E===g?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|
null)"/g,""):null):this.empty().append(E)},replaceWith:function(E){return
this.after(E).remove()},eq:function(E){return
this.slice(E,+E+1)},slice:function(){return
this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return
this.pushStack(o.map(this,function(G,F){return
E.call(G,F,G)}))},andSelf:function(){return
this.add(this.prevObject)},domManip:function(J,M,L){if(this[0]){var
I=(this[0].ownerDocument||
this[0]).createDocumentFragment(),F=o.clean(J,(this[0].ownerDocument||
this[0]),I),H=I.firstChild;if(H){for(var
G=0,E=this.length;G<E;G++){L.call(K(this[G],H),this.length>1||
G>0?I.cloneNode(true):I)}}if(F){o.each(F,z)}}return this;function
K(N,O){return
M&&o.nodeName(N,"table")&&o.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]|
|
N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};o.fn.init.prototype=o.fn;function
z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text|
|F.textContent||F.innerHTML|
|"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return +new
Date}o.extend=o.fn.extend=function(){var J=arguments[0]||
{},H=1,I=arguments.length,E=false,G;if(typeof
J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof
J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H<I;H++){if((G=arguments[H])!=null){for(var
F in G){var K=J[F],L=G[F];if(J===L){continue}if(E&&L&&typeof
L==="object"&&!L.nodeType){J[F]=o.extend(E,K||
(L.length!=null?[]:{}),L)}else{if(L!==g){J[F]=L}}}}}return J};var
b=/z-?index|font-?weight|opacity|zoom|line-?height/i,q=document.defaultView|
|
{},s=Object.prototype.toString;o.extend({noConflict:function(E){l.$=p;if(E){l.jQuery=y}return
o},isFunction:function(E){return s.call(E)==="[object
Function]"},isArray:function(E){return s.call(E)==="[object
Array]"},isXMLDoc:function(E){return
E.nodeType===9&&E.documentElement.nodeName!=="HTML"|
|!!E.ownerDocument&&o.isXMLDoc(E.ownerDocument)},globalEval:function(G){if(G&&/\S/.test(G)){var
F=document.getElementsByTagName("head")[0]||
document.documentElement,E=document.createElement("script");E.type="text/javascript";if(o.support.scriptEval){E.appendChild(document.createTextNode(G))}else{E.text=G}F.insertBefore(E,F.firstChild);F.removeChild(E)}},nodeName:function(F,E){return
F.nodeName&&F.nodeName.toUpperCase()==E.toUpperCase()},each:function(G,K,F){var
E,H=0,I=G.length;if(F){if(I===g){for(E in
G){if(K.apply(G[E],F)===false){break}}}else{for(;H<I;){if(K.apply(G[H++],F)===false){break}}}}else{if(I===g){for(E
in G){if(K.call(G[E],E,G[E])===false){break}}}else{for(var
J=G[0];H<I&&K.call(J,H,J)!==false;J=G[++H]){}}}return
G},prop:function(H,I,G,F,E){if(o.isFunction(I)){I=I.call(H,F)}return typeof
I==="number"&&G=="curCSS"&&!b.test(E)?I+"px":I},className:{add:function(E,F){o.each((F|
|"").split(/\s+/),function(G,H){if(E.nodeType==1&&!o.className.has(E.className,H)){E.className+=(E.className?" ":"")+H}})},remove:function(E,F){if(E.nodeType==1){E.className=F!==g?o.grep(E.className.split(/\s+/),function(G){return !o.className.has(F,G)}).join(" "):""}},has:function(F,E){return
F&&o.inArray(E,(F.className||
F).toString().split(/\s+/))>-1}},swap:function(H,G,I){var E={};for(var F in
G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in
G){H.style[F]=E[F]}},css:function(H,F,J,E){if(F=="width"||F=="height"){var
L,G={position:"absolute",visibility:"hidden",display:"block"},K=F=="width"?["Left","Right"]:["Top","Bottom"];function
I(){L=F=="width"?H.offsetWidth:H.offsetHeight;if(E==="border"){return}o.each(K,function(){if(!E){L-=parseFloat(o.curCSS(H,"padding"+this,true))|
|0}if(E==="margin"){L+=parseFloat(o.curCSS(H,"margin"+this,true))||
0}else{L-=parseFloat(o.curCSS(H,"border"+this+"Width",true))||
0}})}if(H.offsetWidth!==0){I()}else{o.swap(H,G,I)}return
Math.max(0,Math.round(L))}return
o.curCSS(H,F,J)},curCSS:function(I,F,G){var
L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return
L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var
M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var
J=F.replace(/\-(\w)/g,function(N,O){return
O.toUpperCase()});L=I.currentStyle[F]||
I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var
H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L|
|0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return
L},clean:function(F,K,I){K=K||document;if(typeof
K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||
document}if(!I&&F.length===1&&typeof F[0]==="string"){var
H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var
G=[],E=[],L=K.createElement("div");o.each(F,function(P,S){if(typeof
S==="number"){S+=""}if(!S){return}if(typeof
S==="string"){S=S.replace(/(<(\w+)[^>]*?)\/>/g,function(U,V,T){return
T.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|
embed)$/i)?U:V+"></"+T+">"});var
O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var
Q=!O.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]|
|!O.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||O.match(/^<(thead|
tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]|
|!O.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||
(!O.indexOf("<td")|
|!O.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]|
|!O.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]|
|!o.support.htmlSerialize&&[1,"div<div>","</div>"]||
[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var
R=/<tbody/i.test(S),N=!O.indexOf("<table")&&!R?L.firstChild&&L.firstChild.childNodes:Q[1]=="<table>"&&!R?L.childNodes:[];for(var
M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(S)){L.insertBefore(K.createTextNode(S.match(/^\s*/)[0]),L.firstChild)}S=o.makeArray(L.childNodes)}if(S.nodeType){G.push(S)}else{G=o.merge(G,S)}});if(I){for(var
J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||
G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return
E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||
J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||
G;if(J.tagName){var F=/href|src|
style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G
in
J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type
property can't be
changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return
J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var
I=J.getAttributeNode("tabIndex");return
I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|
textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g}return
J[G]}if(!o.support.style&&H&&G=="style"){return
o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var
E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return
E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter|
|"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return
J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return
N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E|
|"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var
E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||
o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return
E},inArray:function(G,H){for(var
E=0,F=H.length;E<F;E++){if(H[E]===G){return E}}return
-1},merge:function(H,E){var
F=0,G,I=H.length;if(!o.support.getAll){while((G=E[F++])!=null){if(G.nodeType!=8){H[I++]=G}}}else{while((G=E[F++])!=null){H[I++]=G}}return
H},unique:function(K){var F=[],E={};try{for(var G=0,H=K.length;G<H;G++){var
J=o.data(K[G]);if(!E[J]){E[J]=true;F.push(K[G])}}}catch(I){F=K}return
F},grep:function(F,J,E){var G=[];for(var
H=0,I=F.length;H<I;H++){if(!E!=!J(F[H],H)){G.push(F[H])}}return
G},map:function(E,J){var F=[];for(var G=0,H=E.length;G<H;G++){var
I=J(E[G],G);if(I!=null){F[F.length]=I}}return F.concat.apply([],F)}});var
C=navigator.userAgent.toLowerCase();o.browser={version:(C.match(/.+(?:rv|it|
ra|ie)[\/: ]([\d.]+)/)||
[0,"0"])[1],safari:/webkit/.test(C),opera:/opera/.test(C),msie:/msie/.test(C)&&!/opera/.test(C),mozilla:/mozilla/.test(C)&&!/(compatible|
webkit)/.test(C)};o.each({parent:function(E){return
E.parentNode},parents:function(E){return
o.dir(E,"parentNode")},next:function(E){return
o.nth(E,2,"nextSibling")},prev:function(E){return
o.nth(E,2,"previousSibling")},nextAll:function(E){return
o.dir(E,"nextSibling")},prevAll:function(E){return
o.dir(E,"previousSibling")},siblings:function(E){return
o.sibling(E.parentNode.firstChild,E)},children:function(E){return
o.sibling(E.firstChild)},contents:function(E){return
o.nodeName(E,"iframe")?E.contentDocument||
E.contentWindow.document:o.makeArray(E.childNodes)}},function(E,F){o.fn[E]=function(G){var
H=o.map(this,F);if(G&&typeof G=="string"){H=o.multiFilter(G,H)}return
this.pushStack(o.unique(H),E,G)}});o.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(E,F){o.fn[E]=function(G){var
J=[],L=o(G);for(var K=0,H=L.length;K<H;K++){var
I=(K>0?this.clone(true):this).get();o.fn[F].apply(o(L[K]),I);J=J.concat(I)}return
this.pushStack(J,E,G)}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof
E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E|
|
o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){o(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return
this.each(F,arguments)}});function j(E,F){return
E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var
h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var
H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return
E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var
H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in
o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete
F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete
o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var
G=o.data(F,E);if(!G||
o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return
G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||
G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var
H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var
F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return
F===g&&H[1]?this.data(H[0]):F}else{return
this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return
this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof
E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return
this.each(function(){var
G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return
this.each(function(){o.dequeue(this,E)})}});
/*
* Sizzle CSS Selector Engine - v0.9.3
* Copyright 2009, The Dojo Foundation
* Released under the MIT, BSD, and GPL Licenses.
* More information: http://sizzlejs.com/
*/
-(function(){var Q=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|
['"][^'"]+['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[]+)+|
[>+~])(\s*,\s*)?/g,K=0,G=Object.prototype.toString;var
F=function(X,T,aa,ab){aa=aa||[];T=T||
document;if(T.nodeType!==1&&T.nodeType!==9){return[]}if(!X||typeof
X!=="string"){return aa}var
Y=[],V,ae,ah,S,ac,U,W=true;Q.lastIndex=0;while((V=Q.exec(X))!==null){Y.push(V[1]);if(V[2]){U=RegExp.rightContext;break}}if(Y.length>1&&L.exec(X)){if(Y.length===2&&H.relative[Y[0]]){ae=I(Y[0]+Y[1],T)}else{ae=H.relative[Y[0]]?[T]:F(Y.shift(),T);while(Y.length){X=Y.shift();if(H.relative[X]){X+=Y.shift()}ae=I(X,ae)}}}else{var
ad=ab?{expr:Y.pop(),set:E(ab)}:F.find(Y.pop(),Y.length===1&&T.parentNode?T.parentNode:T,P(T));ae=F.filter(ad.expr,ad.set);if(Y.length>0){ah=E(ae)}else{W=false}while(Y.length){var
ag=Y.pop(),af=ag;if(!H.relative[ag]){ag=""}else{af=Y.pop()}if(af==null){af=T}H.relative[ag](ah,af,P(T))}}if(!ah){ah=ae}if(!ah){throw"Syntax
error, unrecognized expression: "+(ag||X)}if(G.call(ah)==="[object
Array]"){if(!W){aa.push.apply(aa,ah)}else{if(T.nodeType===1){for(var
Z=0;ah[Z]!=null;Z++){if(ah[Z]&&(ah[Z]===true||
ah[Z].nodeType===1&&J(T,ah[Z]))){aa.push(ae[Z])}}}else{for(var
Z=0;ah[Z]!=null;Z++){if(ah[Z]&&ah[Z].nodeType===1){aa.push(ae[Z])}}}}}else{E(ah,aa)}if(U){F(U,T,aa,ab)}return
aa};F.matches=function(S,T){return
F(S,null,null,T)};F.find=function(Z,S,aa){var Y,W;if(!Z){return[]}for(var
V=0,U=H.order.length;V<U;V++){var
X=H.order[V],W;if((W=H.match[X].exec(Z))){var
T=RegExp.leftContext;if(T.substr(T.length-1)!=="\\"){W[1]=(W[1]|
|"").replace(/\\/g,"");Y=H.find[X](W,S,aa);if(Y!=null){Z=Z.replace(H.match[X],"");break}}}}if(!Y){Y=S.getElementsByTagName("*")}return{set:Y,expr:Z}};F.filter=function(ab,aa,ae,V){var
U=ab,ag=[],Y=aa,X,S;while(ab&&aa.length){for(var Z in
H.filter){if((X=H.match[Z].exec(ab))!=null){var
T=H.filter[Z],af,ad;S=false;if(Y==ag){ag=[]}if(H.preFilter[Z]){X=H.preFilter[Z](X,Y,ae,ag,V);if(!X){S=af=true}else{if(X===true){continue}}}if(X){for(var
W=0;(ad=Y[W])!=null;W++){if(ad){af=T(ad,X,W,Y);var
ac=V^!!af;if(ae&&af!=null){if(ac){S=true}else{Y[W]=false}}else{if(ac){ag.push(ad);S=true}}}}}if(af!==g){if(!ae){Y=ag}ab=ab.replace(H.match[Z],"");if(!S){return[]}break}}}ab=ab.replace(/\s*,\s*/,"");if(ab==U){if(S==null){throw"Syntax
error, unrecognized expression: "+ab}else{break}}U=ab}return Y};var
H=F.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|
\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|
\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|
\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|
\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|
\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|
[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|
odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|
\\.)+)(?:\((['"]*)((?:\([^\)]+\)|
[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(S){return
S.getAttribute("href")}},relative:{"+":function(W,T){for(var
U=0,S=W.length;U<S;U++){var V=W[U];if(V){var
X=V.previousSibling;while(X&&X.nodeType!==1){X=X.previousSibling}W[U]=typeof
T==="string"?X||false:X===T}}if(typeof
T==="string"){F.filter(T,W,true)}},">":function(X,T,Y){if(typeof
T==="string"&&!/\W/.test(T)){T=Y?T:T.toUpperCase();for(var
U=0,S=X.length;U<S;U++){var W=X[U];if(W){var
V=W.parentNode;X[U]=V.nodeName===T?V:false}}}else{for(var
U=0,S=X.length;U<S;U++){var W=X[U];if(W){X[U]=typeof
T==="string"?W.parentNode:W.parentNode===T}}if(typeof
T==="string"){F.filter(T,X,true)}}},"":function(V,T,X){var
U="done"+(K++),S=R;if(!T.match(/\W/)){var
W=T=X?T:T.toUpperCase();S=O}S("parentNode",T,U,V,W,X)},"~":function(V,T,X){var
U="done"+(K++),S=R;if(typeof T==="string"&&!T.match(/\W/)){var
W=T=X?T:T.toUpperCase();S=O}S("previousSibling",T,U,V,W,X)}},find:{ID:function(T,U,V){if(typeof
U.getElementById!=="undefined"&&!V){var S=U.getElementById(T[1]);return
S?[S]:[]}},NAME:function(S,T,U){if(typeof
T.getElementsByName!=="undefined"&&!U){return
T.getElementsByName(S[1])}},TAG:function(S,T){return
T.getElementsByTagName(S[1])}},preFilter:{CLASS:function(V,T,U,S,Y){V=" "+V[1].replace(/\\/g,"")+" ";var
X;for(var
W=0;(X=T[W])!=null;W++){if(X){if(Y^(" "+X.className+" ").indexOf(V)>=0){if(!U){S.push(X)}}else{if(U){T[W]=false}}}}return
false},ID:function(S){return
S[1].replace(/\\/g,"")},TAG:function(T,S){for(var
U=0;S[U]===false;U++){}return
S[U]&&P(S[U])?T[1]:T[1].toUpperCase()},CHILD:function(S){if(S[1]=="nth"){var
T=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(S[2]=="even"&&"2n"||S[2]=="odd"&&"2n+1"|
|!/\D/.test(S[2])&&"0n+"+S[2]||S[2]);S[2]=(T[1]+(T[2]||
1))-0;S[3]=T[3]-0}S[0]="done"+(K++);return S},ATTR:function(T){var
S=T[1].replace(/\\/g,"");if(H.attrMap[S]){T[1]=H.attrMap[S]}if(T[2]==="~="){T[4]=" "+T[4]+" "}return
T},PSEUDO:function(W,T,U,S,X){if(W[1]==="not"){if(W[3].match(Q).length>1){W[3]=F(W[3],null,null,T)}else{var
V=F.filter(W[3],T,U,true^X);if(!U){S.push.apply(S,V)}return
false}}else{if(H.match.POS.test(W[0])){return true}}return
W},POS:function(S){S.unshift(true);return
S}},filters:{enabled:function(S){return
S.disabled===false&&S.type!=="hidden"},disabled:function(S){return
S.disabled===true},checked:function(S){return
S.checked===true},selected:function(S){S.parentNode.selectedIndex;return
S.selected===true},parent:function(S){return !!S.firstChild},empty:function(S){return !S.firstChild},has:function(U,T,S){return !!F(S[3],U).length},header:function(S){return/h\d/i.test(S.nodeName)},text:function(S){return"text"===S.type},radio:function(S){return"radio"===S.type},checkbox:function(S){return"checkbox"===S.type},file:function(S){return"file"===S.type},password:function(S){return"password"===S.type},submit:function(S){return"submit"===S.type},image:function(S){return"image"===S.type},reset:function(S){return"reset"===S.type},button:function(S){return"button"===S.type|
|S.nodeName.toUpperCase()==="BUTTON"},input:function(S){return/input|select|
textarea|button/i.test(S.nodeName)}},setFilters:{first:function(T,S){return
S===0},last:function(U,T,S,V){return
T===V.length-1},even:function(T,S){return S%2===0},odd:function(T,S){return
S%2===1},lt:function(U,T,S){return T<S[3]-0},gt:function(U,T,S){return
T>S[3]-0},nth:function(U,T,S){return S[3]-0==T},eq:function(U,T,S){return
S[3]-0==T}},filter:{CHILD:function(S,V){var Y=V[1],Z=S.parentNode;var
X=V[0];if(Z&&(!Z[X]||!S.nodeIndex)){var W=1;for(var
T=Z.firstChild;T;T=T.nextSibling){if(T.nodeType==1){T.nodeIndex=W++}}Z[X]=W-1}if(Y=="first"){return
S.nodeIndex==1}else{if(Y=="last"){return
S.nodeIndex==Z[X]}else{if(Y=="only"){return Z[X]==1}else{if(Y=="nth"){var
ab=false,U=V[2],aa=V[3];if(U==1&&aa==0){return
true}if(U==0){if(S.nodeIndex==aa){ab=true}}else{if((S.nodeIndex-aa)%U==0&&(S.nodeIndex-aa)/U>=0){ab=true}}return
ab}}}}},PSEUDO:function(Y,U,V,Z){var T=U[1],W=H.filters[T];if(W){return
W(Y,V,U,Z)}else{if(T==="contains"){return(Y.textContent||Y.innerText|
|"").indexOf(U[3])>=0}else{if(T==="not"){var X=U[3];for(var
V=0,S=X.length;V<S;V++){if(X[V]===Y){return false}}return
true}}}},ID:function(T,S){return
T.nodeType===1&&T.getAttribute("id")===S},TAG:function(T,S){return(S==="*"&&T.nodeType===1)|
|T.nodeName===S},CLASS:function(T,S){return
S.test(T.className)},ATTR:function(W,U){var
S=H.attrHandle[U[1]]?H.attrHandle[U[1]](W):W[U[1]]||
W.getAttribute(U[1]),X=S+"",V=U[2],T=U[4];return
S==null?V==="!=":V==="="?X===T:V==="*="?X.indexOf(T)>=0:V==="~="?(" "+X+" ").indexOf(T)>=0:!U[4]?S:V==="!="?X!=T:V==="^="?X.indexOf(T)===0:V==="$="?X.substr(X.length-T.length)===T:V==="|
="?X===T||X.substr(0,T.length+1)===T+"-":false},POS:function(W,T,U,X){var
S=T[2],V=H.setFilters[S];if(V){return V(W,U,T,X)}}}};var
L=H.match.POS;for(var N in
H.match){H.match[N]=RegExp(H.match[N].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var
E=function(T,S){T=Array.prototype.slice.call(T);if(S){S.push.apply(S,T);return
S}return
T};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(M){E=function(W,V){var
T=V||[];if(G.call(W)==="[object
Array]"){Array.prototype.push.apply(T,W)}else{if(typeof
W.length==="number"){for(var
U=0,S=W.length;U<S;U++){T.push(W[U])}}else{for(var
U=0;W[U];U++){T.push(W[U])}}}return T}}(function(){var
T=document.createElement("form"),U="script"+(new
Date).getTime();T.innerHTML="<input name='"+U+"'/>";var
S=document.documentElement;S.insertBefore(T,S.firstChild);if(!!document.getElementById(U)){H.find.ID=function(W,X,Y){if(typeof
X.getElementById!=="undefined"&&!Y){var V=X.getElementById(W[1]);return
V?V.id===W[1]||typeof
V.getAttributeNode!=="undefined"&&V.getAttributeNode("id").nodeValue===W[1]?[V]:g:[]}};H.filter.ID=function(X,V){var
W=typeof X.getAttributeNode!=="undefined"&&X.getAttributeNode("id");return
X.nodeType===1&&W&&W.nodeValue===V}}S.removeChild(T)})();(function(){var
S=document.createElement("div");S.appendChild(document.createComment(""));if(S.getElementsByTagName("*").length>0){H.find.TAG=function(T,X){var
W=X.getElementsByTagName(T[1]);if(T[1]==="*"){var V=[];for(var
U=0;W[U];U++){if(W[U].nodeType===1){V.push(W[U])}}W=V}return
W}}S.innerHTML="<a
href='#'></a>";if(S.firstChild&&S.firstChild.getAttribute("href")!=="#"){H.attrHandle.href=function(T){return
T.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var
S=F,T=document.createElement("div");T.innerHTML="<p
class='TEST'></p>";if(T.querySelectorAll&&T.querySelectorAll(".TEST").length===0){return}F=function(X,W,U,V){W=W|
|document;if(!V&&W.nodeType===9&&!P(W)){try{return
E(W.querySelectorAll(X),U)}catch(Y){}}return
S(X,W,U,V)};F.find=S.find;F.filter=S.filter;F.selectors=S.selectors;F.matches=S.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){H.order.splice(1,0,"CLASS");H.find.CLASS=function(S,T){return
T.getElementsByClassName(S[1])}}function O(T,Z,Y,ac,aa,ab){for(var
W=0,U=ac.length;W<U;W++){var S=ac[W];if(S){S=S[T];var
X=false;while(S&&S.nodeType){var
V=S[Y];if(V){X=ac[V];break}if(S.nodeType===1&&!ab){S[Y]=W}if(S.nodeName===Z){X=S;break}S=S[T]}ac[W]=X}}}function
R(T,Y,X,ab,Z,aa){for(var V=0,U=ab.length;V<U;V++){var
S=ab[V];if(S){S=S[T];var
W=false;while(S&&S.nodeType){if(S[X]){W=ab[S[X]];break}if(S.nodeType===1){if(!aa){S[X]=V}if(typeof
Y!=="string"){if(S===Y){W=true;break}}else{if(F.filter(Y,[S]).length>0){W=S;break}}}S=S[T]}ab[V]=W}}}var
J=document.compareDocumentPosition?function(T,S){return
T.compareDocumentPosition(S)&16}:function(T,S){return
T!==S&&(T.contains?T.contains(S):true)};var P=function(S){return
S.nodeType===9&&S.documentElement.nodeName!=="HTML"|
|!!S.ownerDocument&&P(S.ownerDocument)};var I=function(S,Z){var
V=[],W="",X,U=Z.nodeType?[Z]:Z;while((X=H.match.PSEUDO.exec(S))){W+=X[0];S=S.replace(H.match.PSEUDO,"")}S=H.relative[S]?S+"*":S;for(var
Y=0,T=U.length;Y<T;Y++){F(S,U[Y],V)}return
F.filter(W,V)};o.find=F;o.filter=F.filter;o.expr=F.selectors;o.expr[":"]=o.expr.filters;F.selectors.filters.hidden=function(S){return"hidden"===S.type|
|o.css(S,"display")==="none"||
o.css(S,"visibility")==="hidden"};F.selectors.filters.visible=function(S){return"hidden"!==S.type&&o.css(S,"display")!=="none"&&o.css(S,"visibility")!=="hidden"};F.selectors.filters.animated=function(S){return
o.grep(o.timers,function(T){return
S===T.elem}).length};o.multiFilter=function(U,S,T){if(T){U=":not("+U+")"}return
F.matches(U,S)};o.dir=function(U,T){var
S=[],V=U[T];while(V&&V!=document){if(V.nodeType==1){S.push(V)}V=V[T]}return
S};o.nth=function(W,S,U,V){S=S||1;var
T=0;for(;W;W=W[U]){if(W.nodeType==1&&++T==S){break}}return
W};o.sibling=function(U,T){var
S=[];for(;U;U=U.nextSibling){if(U.nodeType==1&&U!=T){S.push(U)}}return
S};return;l.Sizzle=F})();o.event={add:function(I,F,H,K){if(I.nodeType==3||
I.nodeType==8){return}if(I.setInterval&&I!=l){I=l}if(!H.guid){H.guid=this.guid++}if(K!==g){var
G=H;H=this.proxy(G);H.data=K}var E=o.data(I,"events")||
o.data(I,"events",{}),J=o.data(I,"handle")||
o.data(I,"handle",function(){return typeof
o!=="undefined"&&!o.event.triggered?o.event.handle.apply(arguments.callee.elem,arguments):g});J.elem=I;o.each(F.split(/\s+/),function(M,N){var
O=N.split(".");N=O.shift();H.type=O.slice().sort().join(".");var
L=E[N];if(o.event.specialAll[N]){o.event.specialAll[N].setup.call(I,K,O)}if(!L){L=E[N]={};if(!o.event.special[N]|
|
o.event.special[N].setup.call(I,K,O)===false){if(I.addEventListener){I.addEventListener(N,J,false)}else{if(I.attachEvent){I.attachEvent("on"+N,J)}}}}L[H.guid]=H;o.event.global[N]=true});I=null},guid:1,global:{},remove:function(K,H,J){if(K.nodeType==3|
|K.nodeType==8){return}var G=o.data(K,"events"),F,E;if(G){if(H===g||(typeof
H==="string"&&H.charAt(0)==".")){for(var I in G){this.remove(K,I+(H|
|""))}}else{if(H.type){J=H.handler;H=H.type}o.each(H.split(/\s+/),function(M,O){var
Q=O.split(".");O=Q.shift();var N=RegExp("(^|
\\.)"+Q.slice().sort().join(".*\\.")+"(\\.|$)");if(G[O]){if(J){delete
G[O][J.guid]}else{for(var P in G[O]){if(N.test(G[O][P].type)){delete
G[O][P]}}}if(o.event.specialAll[O]){o.event.specialAll[O].teardown.call(K,Q)}for(F
in G[O]){break}if(!F){if(!o.event.special[O]||
o.event.special[O].teardown.call(K,Q)===false){if(K.removeEventListener){K.removeEventListener(O,o.data(K,"handle"),false)}else{if(K.detachEvent){K.detachEvent("on"+O,o.data(K,"handle"))}}}F=null;delete
G[O]}}})}for(F in G){break}if(!F){var
L=o.data(K,"handle");if(L){L.elem=null}o.removeData(K,"events");o.removeData(K,"handle")}}},trigger:function(I,K,H,E){var
G=I.type||I;if(!E){I=typeof
I==="object"?I[h]?I:o.extend(o.Event(G),I):o.Event(G);if(G.indexOf("!")>=0){I.type=G=G.slice(0,-1);I.exclusive=true}if(!H){I.stopPropagation();if(this.global[G]){o.each(o.cache,function(){if(this.events&&this.events[G]){o.event.trigger(I,K,this.handle.elem)}})}}if(!H|
|H.nodeType==3||H.nodeType==8){return
g}I.result=g;I.target=H;K=o.makeArray(K);K.unshift(I)}I.currentTarget=H;var
J=o.data(H,"handle");if(J){J.apply(H,K)}if((!H[G]||
(o.nodeName(H,"a")&&G=="click"))&&H["on"+G]&&H["on"+G].apply(H,K)===false){I.result=false}if(!E&&H[G]&&!I.isDefaultPrevented()&&!(o.nodeName(H,"a")&&G=="click")){this.triggered=true;try{H[G]()}catch(L){}}this.triggered=false;if(!I.isPropagationStopped()){var
F=H.parentNode||
H.ownerDocument;if(F){o.event.trigger(I,K,F,true)}}},handle:function(K){var
J,E;K=arguments[0]=o.event.fix(K||l.event);var
L=K.type.split(".");K.type=L.shift();J=!L.length&&!K.exclusive;var
I=RegExp("(^|\\.)"+L.slice().sort().join(".*\\.")+"(\\.|
$)");E=(o.data(this,"events")||{})[K.type];for(var G in E){var H=E[G];if(J||
I.test(H.type)){K.handler=H;K.data=H.data;var
F=H.apply(this,arguments);if(F!==g){K.result=F;if(F===false){K.preventDefault();K.stopPropagation()}}if(K.isImmediatePropagationStopped()){break}}}},props:"altKey
attrChange attrName bubbles button cancelable charCode clientX clientY
ctrlKey currentTarget data detail eventPhase fromElement handler keyCode
metaKey newValue originalTarget pageX pageY prevValue relatedNode
relatedTarget screenX screenY shiftKey srcElement target toElement view
wheelDelta which".split(" "),fix:function(H){if(H[h]){return H}var
F=H;H=o.Event(F);for(var
G=this.props.length,J;G;){J=this.props[--G];H[J]=F[J]}if(!H.target){H.target=H.srcElement|
|
document}if(H.target.nodeType==3){H.target=H.target.parentNode}if(!H.relatedTarget&&H.fromElement){H.relatedTarget=H.fromElement==H.target?H.toElement:H.fromElement}if(H.pageX==null&&H.clientX!=null){var
I=document.documentElement,E=document.body;H.pageX=H.clientX+(I&&I.scrollLeft|
|E&&E.scrollLeft||0)-(I.clientLeft||0);H.pageY=H.clientY+(I&&I.scrollTop||
E&&E.scrollTop||0)-(I.clientTop||0)}if(!H.which&&((H.charCode||
H.charCode===0)?H.charCode:H.keyCode)){H.which=H.charCode||
H.keyCode}if(!H.metaKey&&H.ctrlKey){H.metaKey=H.ctrlKey}if(!H.which&&H.button){H.which=(H.button&1?1:(H.button&2?3:(H.button&4?2:0)))}return
H},proxy:function(F,E){E=E||function(){return
F.apply(this,arguments)};E.guid=F.guid=F.guid||E.guid||this.guid++;return
E},special:{ready:{setup:B,teardown:function(){}}},specialAll:{live:{setup:function(E,F){o.event.add(this,F[0],c)},teardown:function(G){if(G.length){var
E=0,F=RegExp("(^|\\.)"+G[0]+"(\\.|$)");o.each((o.data(this,"events").live||
{}),function(){if(F.test(this.type)){E++}});if(E<1){o.event.remove(this,G[0],c)}}}}}};o.Event=function(E){if(!this.preventDefault){return
new
o.Event(E)}if(E&&E.type){this.originalEvent=E;this.type=E.type}else{this.type=E}this.timeStamp=e();this[h]=true};function
k(){return false}function u(){return
true}o.Event.prototype={preventDefault:function(){this.isDefaultPrevented=u;var
E=this.originalEvent;if(!E){return}if(E.preventDefault){E.preventDefault()}E.returnValue=false},stopPropagation:function(){this.isPropagationStopped=u;var
E=this.originalEvent;if(!E){return}if(E.stopPropagation){E.stopPropagation()}E.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var
a=function(F){var
E=F.relatedTarget;while(E&&E!=this){try{E=E.parentNode}catch(G){E=this}}if(E!=this){F.type=F.data;o.event.handle.apply(this,arguments)}};o.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(F,E){o.event.special[E]={setup:function(){o.event.add(this,F,a,E)},teardown:function(){o.event.remove(this,F,a)}}});o.fn.extend({bind:function(F,G,E){return
F=="unload"?this.one(F,G,E):this.each(function(){o.event.add(this,F,E||
G,E&&G)})},one:function(G,H,F){var E=o.event.proxy(F||
H,function(I){o(this).unbind(I,E);return(F||
H).apply(this,arguments)});return
this.each(function(){o.event.add(this,G,E,F&&H)})},unbind:function(F,E){return
this.each(function(){o.event.remove(this,F,E)})},trigger:function(E,F){return
this.each(function(){o.event.trigger(E,F,this)})},triggerHandler:function(E,G){if(this[0]){var
F=o.Event(E);F.preventDefault();F.stopPropagation();o.event.trigger(F,G,this[0]);return
F.result}},toggle:function(G){var
E=arguments,F=1;while(F<E.length){o.event.proxy(G,E[F++])}return
this.click(o.event.proxy(G,function(H){this.lastToggle=(this.lastToggle||
0)%F;H.preventDefault();return E[this.lastToggle++].apply(this,arguments)||
false}))},hover:function(E,F){return
this.mouseenter(E).mouseleave(F)},ready:function(E){B();if(o.isReady){E.call(document,o)}else{o.readyList.push(E)}return
this},live:function(G,F){var
E=o.event.proxy(F);E.guid+=this.selector+G;o(document).bind(i(G,this.selector),this.selector,E);return
this},die:function(F,E){o(document).unbind(i(F,this.selector),E?{guid:E.guid+this.selector+F}:null);return
this}});function c(H){var E=RegExp("(^|\\.)"+H.type+"(\\.|
$)"),G=true,F=[];o.each(o.data(this,"events").live||
[],function(I,J){if(E.test(J.type)){var
K=o(H.target).closest(J.data)[0];if(K){F.push({elem:K,fn:J})}}});o.each(F,function(){if(this.fn.call(this.elem,H,this.fn.data)===false){G=false}});return
G}function i(F,E){return["live",F,E.replace(/\./g,"`").replace(/
/g,"|")].join(".")}o.extend({isReady:false,readyList:[],ready:function(){if(!o.isReady){o.isReady=true;if(o.readyList){o.each(o.readyList,function(){this.call(document,o)});o.readyList=null}o(document).triggerHandler("ready")}}});var
x=false;function
B(){if(x){return}x=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);o.ready()},false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);o.ready()}});if(document.documentElement.doScroll&&typeof
l.frameElement==="undefined"){(function(){if(o.isReady){return}try{document.documentElement.doScroll("left")}catch(E){setTimeout(arguments.callee,0);return}o.ready()})()}}}o.event.add(l,"load",o.ready)}o.each(("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,change,select,submit,keydown,keypress,keyup,error").split(","),function(F,E){o.fn[E]=function(G){return
G?this.bind(E,G):this.trigger(E)}});o(l).bind("unload",function(){for(var E
in
o.cache){if(E!=1&&o.cache[E].handle){o.event.remove(o.cache[E].handle.elem)}}});(function(){o.support={};var
F=document.documentElement,G=document.createElement("script"),K=document.createElement("div"),J="script"+(new
Date).getTime();K.style.display="none";K.innerHTML='
<link/><table></table><a href="/a"
style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';var
H=K.getElementsByTagName("*"),E=K.getElementsByTagName("a")[0];if(!H|
|!H.length|
|!E){return}o.support={leadingWhitespace:K.firstChild.nodeType==3,tbody:!K.getElementsByTagName("tbody").length,objectAll:!!K.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!K.getElementsByTagName("link").length,style:/red/.test(E.getAttribute("style")),hrefNormalized:E.getAttribute("href")==="/a",opacity:E.style.opacity==="0.5",cssFloat:!!E.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};G.type="text/javascript";try{G.appendChild(document.createTextNode("window."+J+"=1;"))}catch(I){}F.insertBefore(G,F.firstChild);if(l[J]){o.support.scriptEval=true;delete
l[J]}F.removeChild(G);if(K.attachEvent&&K.fireEvent){K.attachEvent("onclick",function(){o.support.noCloneEvent=false;K.detachEvent("onclick",arguments.callee)});K.cloneNode(true).fireEvent("onclick")}o(function(){var
L=document.createElement("div");L.style.width="1px";L.style.paddingLeft="1px";document.body.appendChild(L);o.boxModel=o.support.boxModel=L.offsetWidth===2;document.body.removeChild(L)})})();var
w=o.support.cssFloat?"cssFloat":"styleFloat";o.props={"for":"htmlFor","class":"className","float":w,cssFloat:w,styleFloat:w,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};o.fn.extend({_load:o.fn.load,load:function(G,J,K){if(typeof
G!=="string"){return this._load(G)}var I=G.indexOf(" ");if(I>=0){var
E=G.slice(I,G.length);G=G.slice(0,I)}var
H="GET";if(J){if(o.isFunction(J)){K=J;J=null}else{if(typeof
J==="object"){J=o.param(J);H="POST"}}}var
F=this;o.ajax({url:G,type:H,dataType:"html",data:J,complete:function(M,L){if(L=="success"|
|
L=="notmodified"){F.html(E?o("<div/>").append(M.responseText.replace(/<script(.|
\s)*?\/script>/g,"")).find(E):M.responseText)}if(K){F.each(K,[M.responseText,L,M])}}});return
this},serialize:function(){return
o.param(this.serializeArray())},serializeArray:function(){return
this.map(function(){return
this.elements?o.makeArray(this.elements):this}).filter(function(){return
this.name&&!this.disabled&&(this.checked||/select|
textarea/i.test(this.nodeName)||/text|hidden|
password/i.test(this.type))}).map(function(E,F){var G=o(this).val();return
G==null?null:o.isArray(G)?o.map(G,function(I,H){return{name:F.name,value:I}}):{name:F.name,value:G}}).get()}});o.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(E,F){o.fn[F]=function(G){return
this.bind(F,G)}});var
r=e();o.extend({get:function(E,G,H,F){if(o.isFunction(G)){H=G;G=null}return
o.ajax({type:"GET",url:E,data:G,success:H,dataType:F})},getScript:function(E,F){return
o.get(E,null,F,"script")},getJSON:function(E,F,G){return
o.get(E,F,G,"json")},post:function(E,G,H,F){if(o.isFunction(G)){H=G;G={}}return
o.ajax({type:"POST",url:E,data:G,success:H,dataType:F})},ajaxSetup:function(E){o.extend(o.ajaxSettings,E)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return
l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new
XMLHttpRequest()},accepts:{xml:"application/xml,
text/xml",html:"text/html",script:"text/javascript,
application/javascript",json:"application/json,
text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(M){M=o.extend(true,M,o.extend(true,{},o.ajaxSettings,M));var
W,F=/=\?(&|$)/g,R,V,G=M.type.toUpperCase();if(M.data&&M.processData&&typeof
M.data!=="string"){M.data=o.param(M.data)}if(M.dataType=="jsonp"){if(G=="GET"){if(!M.url.match(F)){M.url+=(M.url.match(/\?/)?"&":"?")+(M.jsonp|
|"callback")+"=?"}}else{if(!M.data|
|!M.data.match(F)){M.data=(M.data?M.data+"&":"")+(M.jsonp|
|"callback")+"=?"}}M.dataType="json"}if(M.dataType=="json"&&(M.data&&M.data.match(F)|
|
M.url.match(F))){W="jsonp"+r++;if(M.data){M.data=(M.data+"").replace(F,"="+W+"$1")}M.url=M.url.replace(F,"="+W+"$1");M.dataType="script";l[W]=function(X){V=X;I();L();l[W]=g;try{delete
l[W]}catch(Y){}if(H){H.removeChild(T)}}}if(M.dataType=="script"&&M.cache==null){M.cache=false}if(M.cache===false&&G=="GET"){var
E=e();var U=M.url.replace(/(\?|&)_=.*?(&|
$)/,"$1_="+E+"$2");M.url=U+((U==M.url)?(M.url.match(/\?/)?"&":"?")+"_="+E:"")}if(M.data&&G=="GET"){M.url+=(M.url.match(/\?/)?"&":"?")+M.data;M.data=null}if(M.global&&!o.active++){o.event.trigger("ajaxStart")}var
Q=/^(\w+:)?\/\/([^\/?#]+)/.exec(M.url);if(M.dataType=="script"&&G=="GET"&&Q&&(Q[1]&&Q[1]!=location.protocol|
|Q[2]!=location.host)){var H=document.getElementsByTagName("head")[0];var
T=document.createElement("script");T.src=M.url;if(M.scriptCharset){T.charset=M.scriptCharset}if(!W){var
O=false;T.onload=T.onreadystatechange=function(){if(!O&&(!this.readyState||
this.readyState=="loaded"||
this.readyState=="complete")){O=true;I();L();H.removeChild(T)}}}H.appendChild(T);return
g}var K=false;var
J=M.xhr();if(M.username){J.open(G,M.url,M.async,M.username,M.password)}else{J.open(G,M.url,M.async)}try{if(M.data){J.setRequestHeader("Content-Type",M.contentType)}if(M.ifModified){J.setRequestHeader("If-Modified-Since",o.lastModified[M.url]|
|"Thu, 01 Jan 1970 00:00:00
GMT")}J.setRequestHeader("X-Requested-With","XMLHttpRequest");J.setRequestHeader("Accept",M.dataType&&M.accepts[M.dataType]?M.accepts[M.dataType]+",
*/*":M.accepts._default)}catch(S){}if(M.beforeSend&&M.beforeSend(J,M)===false){if(M.global&&!--o.active){o.event.trigger("ajaxStop")}J.abort();return
false}if(M.global){o.event.trigger("ajaxSend",[J,M])}var
N=function(X){if(J.readyState==0){if(P){clearInterval(P);P=null;if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}}else{if(!K&&J&&(J.readyState==4|
|
X=="timeout")){K=true;if(P){clearInterval(P);P=null}R=X=="timeout"?"timeout":!o.httpSuccess(J)?"error":M.ifModified&&o.httpNotModified(J,M.url)?"notmodified":"success";if(R=="success"){try{V=o.httpData(J,M.dataType,M)}catch(Z){R="parsererror"}}if(R=="success"){var
Y;try{Y=J.getResponseHeader("Last-Modified")}catch(Z){}if(M.ifModified&&Y){o.lastModified[M.url]=Y}if(!W){I()}}else{o.handleError(M,J,R)}L();if(X){J.abort()}if(M.async){J=null}}}};if(M.async){var
P=setInterval(N,13);if(M.timeout>0){setTimeout(function(){if(J&&!K){N("timeout")}},M.timeout)}}try{J.send(M.data)}catch(S){o.handleError(M,J,null,S)}if(!M.async){N()}function
I(){if(M.success){M.success(V,R)}if(M.global){o.event.trigger("ajaxSuccess",[J,M])}}function
L(){if(M.complete){M.complete(J,R)}if(M.global){o.event.trigger("ajaxComplete",[J,M])}if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}return
J},handleError:function(F,H,E,G){if(F.error){F.error(H,E,G)}if(F.global){o.event.trigger("ajaxError",[H,F,G])}},active:0,httpSuccess:function(F){try{return !F.status&&location.protocol=="file:"|
|(F.status>=200&&F.status<300)||F.status==304||
F.status==1223}catch(E){}return
false},httpNotModified:function(G,E){try{var
H=G.getResponseHeader("Last-Modified");return G.status==304||
H==o.lastModified[E]}catch(F){}return false},httpData:function(J,H,G){var
F=J.getResponseHeader("content-type"),E=H=="xml"|
|!H&&F&&F.indexOf("xml")>=0,I=E?J.responseXML:J.responseText;if(E&&I.documentElement.tagName=="parsererror"){throw"parsererror"}if(G&&G.dataFilter){I=G.dataFilter(I,H)}if(typeof
I==="string"){if(H=="script"){o.globalEval(I)}if(H=="json"){I=l["eval"]("("+I+")")}}return
I},param:function(E){var G=[];function
H(I,J){G[G.length]=encodeURIComponent(I)+"="+encodeURIComponent(J)}if(o.isArray(E)|
|E.jquery){o.each(E,function(){H(this.name,this.value)})}else{for(var F in
E){if(o.isArray(E[F])){o.each(E[F],function(){H(F,this)})}else{H(F,o.isFunction(E[F])?E[F]():E[F])}}}return
G.join("&").replace(/%20/g,"+")}});var
m={},n,d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function
t(F,E){var
G={};o.each(d.concat.apply([],d.slice(0,E)),function(){G[this]=F});return
G}o.fn.extend({show:function(J,L){if(J){return
this.animate(t("show",3),J,L)}else{for(var H=0,F=this.length;H<F;H++){var
E=o.data(this[H],"olddisplay");this[H].style.display=E|
|"";if(o.css(this[H],"display")==="none"){var
G=this[H].tagName,K;if(m[G]){K=m[G]}else{var I=o("<"+G+"
/>").appendTo("body");K=I.css("display");if(K==="none"){K="block"}I.remove();m[G]=K}this[H].style.display=o.data(this[H],"olddisplay",K)}}return
this}},hide:function(H,I){if(H){return
this.animate(t("hide",3),H,I)}else{for(var G=0,F=this.length;G<F;G++){var
E=o.data(this[G],"olddisplay");if(!E&&E!=="none"){o.data(this[G],"olddisplay",o.css(this[G],"display"))}this[G].style.display="none"}return
this}},_toggle:o.fn.toggle,toggle:function(G,F){var E=typeof
G==="boolean";return
o.isFunction(G)&&o.isFunction(F)?this._toggle.apply(this,arguments):G==null|
|E?this.each(function(){var
H=E?G:o(this).is(":hidden");o(this)[H?"show":"hide"]()}):this.animate(t("toggle",3),G,F)},fadeTo:function(E,G,F){return
this.animate({opacity:G},E,F)},animate:function(I,F,H,G){var
E=o.speed(F,H,G);return this[E.queue===false?"each":"queue"](function(){var
K=o.extend({},E),M,L=this.nodeType==1&&o(this).is(":hidden"),J=this;for(M
in I){if(I[M]=="hide"&&L||I[M]=="show"&&!L){return
K.complete.call(this)}if((M=="height"||
M=="width")&&this.style){K.display=o.css(this,"display");K.overflow=this.style.overflow}}if(K.overflow!=null){this.style.overflow="hidden"}K.curAnim=o.extend({},I);o.each(I,function(O,S){var
R=new o.fx(J,K,O);if(/toggle|show|
hide/.test(S)){R[S=="toggle"?L?"show":"hide":S](I)}else{var
Q=S.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),T=R.cur(true)||0;if(Q){var
N=parseFloat(Q[2]),P=Q[3]||"px";if(P!="px"){J.style[O]=(N||1)+P;T=((N||
1)/R.cur(true))*T;J.style[O]=T+P}if(Q[1]){N=((Q[1]=="-="?-1:1)*N)+T}R.custom(T,N,P)}else{R.custom(T,S,"")}}});return
true})},stop:function(F,E){var
G=o.timers;if(F){this.queue([])}this.each(function(){for(var
H=G.length-1;H>=0;H--){if(G[H].elem==this){if(E){G[H](true)}G.splice(H,1)}}});if(!E){this.dequeue()}return
this}});o.each({slideDown:t("show",1),slideUp:t("hide",1),slideToggle:t("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(E,F){o.fn[E]=function(G,H){return
this.animate(F,G,H)}});o.extend({speed:function(G,H,F){var E=typeof
G==="object"?G:{complete:F||!F&&H||
o.isFunction(G)&&G,duration:G,easing:F&&H||
H&&!o.isFunction(H)&&H};E.duration=o.fx.off?0:typeof
E.duration==="number"?E.duration:o.fx.speeds[E.duration]||
o.fx.speeds._default;E.old=E.complete;E.complete=function(){if(E.queue!==false){o(this).dequeue()}if(o.isFunction(E.old)){E.old.call(this)}};return
E},easing:{linear:function(G,H,E,F){return
E+F*G},swing:function(G,H,E,F){return((-Math.cos(G*Math.PI)/2)+0.5)*F+E}},timers:[],fx:function(F,E,G){this.options=E;this.elem=F;this.prop=G;if(!E.orig){E.orig={}}}});o.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(o.fx.step[this.prop]|
|o.fx.step._default)(this);if((this.prop=="height"||
this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(F){if(this.elem[this.prop]!=null&&(!this.elem.style|
|this.elem.style[this.prop]==null)){return this.elem[this.prop]}var
E=parseFloat(o.css(this.elem,this.prop,F));return
E&&E>-10000?E:parseFloat(o.curCSS(this.elem,this.prop))||
0},custom:function(I,H,G){this.startTime=e();this.start=I;this.end=H;this.unit=G|
|this.unit||"px";this.now=this.start;this.pos=this.state=0;var
E=this;function F(J){return
E.step(J)}F.elem=this.elem;if(F()&&o.timers.push(F)==1){n=setInterval(function(){var
K=o.timers;for(var
J=0;J<K.length;J++){if(!K[J]()){K.splice(J--,1)}}if(!K.length){clearInterval(n)}},13)}},show:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.show=true;this.custom(this.prop=="width"|
|
this.prop=="height"?1:0,this.cur());o(this.elem).show()},hide:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(H){var
G=e();if(H||
G>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var
E=true;for(var F in
this.options.curAnim){if(this.options.curAnim[F]!==true){E=false}}if(E){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(o.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){o(this.elem).hide()}if(this.options.hide|
|this.options.show){for(var I in
this.options.curAnim){o.attr(this.elem.style,I,this.options.orig[I])}}this.options.complete.call(this.elem)}return
false}else{var
J=G-this.startTime;this.state=J/this.options.duration;this.pos=o.easing[this.options.easing|
|
(o.easing.swing?"swing":"linear")](this.state,J,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return
true}};o.extend(o.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(E){o.attr(E.elem.style,"opacity",E.now)},_default:function(E){if(E.elem.style&&E.elem.style[E.prop]!=null){E.elem.style[E.prop]=E.now+E.unit}else{E.elem[E.prop]=E.now}}}});if(document.documentElement.getBoundingClientRect){o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return
o.offset.bodyOffset(this[0])}var
G=this[0].getBoundingClientRect(),J=this[0].ownerDocument,F=J.body,E=J.documentElement,L=E.clientTop|
|F.clientTop||0,K=E.clientLeft||F.clientLeft||0,I=G.top+(self.pageYOffset||
o.boxModel&&E.scrollTop||F.scrollTop)-L,H=G.left+(self.pageXOffset||
o.boxModel&&E.scrollLeft||
F.scrollLeft)-K;return{top:I,left:H}}}else{o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return
o.offset.bodyOffset(this[0])}o.offset.initialized||
o.offset.initialize();var
J=this[0],G=J.offsetParent,F=J,O=J.ownerDocument,M,H=O.documentElement,K=O.body,L=O.defaultView,E=L.getComputedStyle(J,null),N=J.offsetTop,I=J.offsetLeft;while((J=J.parentNode)&&J!==K&&J!==H){M=L.getComputedStyle(J,null);N-=J.scrollTop,I-=J.scrollLeft;if(J===G){N+=J.offsetTop,I+=J.offsetLeft;if(o.offset.doesNotAddBorder&&!(o.offset.doesAddBorderForTableAndCells&&/^t(able|
d|h)$/i.test(J.tagName))){N+=parseInt(M.borderTopWidth,10)||
0,I+=parseInt(M.borderLeftWidth,10)||
0}F=G,G=J.offsetParent}if(o.offset.subtractsBorderForOverflowNotVisible&&M.overflow!=="visible"){N+=parseInt(M.borderTopWidth,10)|
|0,I+=parseInt(M.borderLeftWidth,10)||0}E=M}if(E.position==="relative"||
E.position==="static"){N+=K.offsetTop,I+=K.offsetLeft}if(E.position==="fixed"){N+=Math.max(H.scrollTop,K.scrollTop),I+=Math.max(H.scrollLeft,K.scrollLeft)}return{top:N,left:I}}}o.offset={initialize:function(){if(this.initialized){return}var
L=document.body,F=document.createElement("div"),H,G,N,I,M,E,J=L.style.marginTop,K='<div
style="position:absolute;top:0;left:0;margin:0;border:5px solid
#000;padding:0;width:1px;height:1px;"><div></div></div><table
style="position:absolute;top:0;left:0;margin:0;border:5px solid
#000;padding:0;width:1px;height:1px;" cellpadding="0"
cellspacing="0"><tr><td></td></tr></table>';M={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(E
in
M){F.style[E]=M[E]}F.innerHTML=K;L.insertBefore(F,L.firstChild);H=F.firstChild,G=H.firstChild,I=H.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(G.offsetTop!==5);this.doesAddBorderForTableAndCells=(I.offsetTop===5);H.style.overflow="hidden",H.style.position="relative";this.subtractsBorderForOverflowNotVisible=(G.offsetTop===-5);L.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(L.offsetTop===0);L.style.marginTop=J;L.removeChild(F);this.initialized=true},bodyOffset:function(E){o.offset.initialized|
|o.offset.initialize();var
G=E.offsetTop,F=E.offsetLeft;if(o.offset.doesNotIncludeMarginInBodyOffset){G+=parseInt(o.curCSS(E,"marginTop",true),10)|
|0,F+=parseInt(o.curCSS(E,"marginLeft",true),10)||
0}return{top:G,left:F}}};o.fn.extend({position:function(){var
I=0,H=0,F;if(this[0]){var G=this.offsetParent(),J=this.offset(),E=/^body|
html$/i.test(G[0].tagName)?{top:0,left:0}:G.offset();J.top-=j(this,"marginTop");J.left-=j(this,"marginLeft");E.top+=j(G,"borderTopWidth");E.left+=j(G,"borderLeftWidth");F={top:J.top-E.top,left:J.left-E.left}}return
F},offsetParent:function(){var E=this[0].offsetParent||
document.body;while(E&&(!/^body|
html$/i.test(E.tagName)&&o.css(E,"position")=="static")){E=E.offsetParent}return
o(E)}});o.each(["Left","Top"],function(F,E){var
G="scroll"+E;o.fn[G]=function(H){if(!this[0]){return null}return
H!==g?this.each(function(){this==l||
this==document?l.scrollTo(!F?H:o(l).scrollLeft(),F?H:o(l).scrollTop()):this[G]=H}):this[0]==l|
|this[0]==document?self[F?"pageYOffset":"pageXOffset"]||
o.boxModel&&document.documentElement[G]||
document.body[G]:this[0][G]}});o.each(["Height","Width"],function(H,F){var
E=H?"Left":"Top",G=H?"Right":"Bottom";o.fn["inner"+F]=function(){return
this[F.toLowerCase()]()+j(this,"padding"+E)+j(this,"padding"+G)};o.fn["outer"+F]=function(J){return
this["inner"+F]()+j(this,"border"+E+"Width")+j(this,"border"+G+"Width")+(J?j(this,"margin"+E)+j(this,"margin"+G):0)};var
I=F.toLowerCase();o.fn[I]=function(J){return
this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+F]|
|
document.body["client"+F]:this[0]==document?Math.max(document.documentElement["client"+F],document.body["scroll"+F],document.documentElement["scroll"+F],document.body["offset"+F],document.documentElement["offset"+F]):J===g?(this.length?o.css(this[0],I):null):this.css(I,typeof
J==="string"?J:J+"px")}})})();
\ No newline at end of file
+(function(){var R=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|
['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|
[>+~])(\s*,\s*)?/g,L=0,H=Object.prototype.toString;var
F=function(Y,U,ab,ac){ab=ab||[];U=U||
document;if(U.nodeType!==1&&U.nodeType!==9){return[]}if(!Y||typeof
Y!=="string"){return ab}var
Z=[],W,af,ai,T,ad,V,X=true;R.lastIndex=0;while((W=R.exec(Y))!==null){Z.push(W[1]);if(W[2]){V=RegExp.rightContext;break}}if(Z.length>1&&M.exec(Y)){if(Z.length===2&&I.relative[Z[0]]){af=J(Z[0]+Z[1],U)}else{af=I.relative[Z[0]]?[U]:F(Z.shift(),U);while(Z.length){Y=Z.shift();if(I.relative[Y]){Y+=Z.shift()}af=J(Y,af)}}}else{var
ae=ac?{expr:Z.pop(),set:E(ac)}:F.find(Z.pop(),Z.length===1&&U.parentNode?U.parentNode:U,Q(U));af=F.filter(ae.expr,ae.set);if(Z.length>0){ai=E(af)}else{X=false}while(Z.length){var
ah=Z.pop(),ag=ah;if(!I.relative[ah]){ah=""}else{ag=Z.pop()}if(ag==null){ag=U}I.relative[ah](ai,ag,Q(U))}}if(!ai){ai=af}if(!ai){throw"Syntax
error, unrecognized expression: "+(ah||Y)}if(H.call(ai)==="[object
Array]"){if(!X){ab.push.apply(ab,ai)}else{if(U.nodeType===1){for(var
aa=0;ai[aa]!=null;aa++){if(ai[aa]&&(ai[aa]===true||
ai[aa].nodeType===1&&K(U,ai[aa]))){ab.push(af[aa])}}}else{for(var
aa=0;ai[aa]!=null;aa++){if(ai[aa]&&ai[aa].nodeType===1){ab.push(af[aa])}}}}}else{E(ai,ab)}if(V){F(V,U,ab,ac);if(G){hasDuplicate=false;ab.sort(G);if(hasDuplicate){for(var
aa=1;aa<ab.length;aa++){if(ab[aa]===ab[aa-1]){ab.splice(aa--,1)}}}}}return
ab};F.matches=function(T,U){return
F(T,null,null,U)};F.find=function(aa,T,ab){var Z,X;if(!aa){return[]}for(var
W=0,V=I.order.length;W<V;W++){var
Y=I.order[W],X;if((X=I.match[Y].exec(aa))){var
U=RegExp.leftContext;if(U.substr(U.length-1)!=="\\"){X[1]=(X[1]|
|"").replace(/\\/g,"");Z=I.find[Y](X,T,ab);if(Z!=null){aa=aa.replace(I.match[Y],"");break}}}}if(!Z){Z=T.getElementsByTagName("*")}return{set:Z,expr:aa}};F.filter=function(ad,ac,ag,W){var
V=ad,ai=[],aa=ac,Y,T,Z=ac&&ac[0]&&Q(ac[0]);while(ad&&ac.length){for(var ab
in I.filter){if((Y=I.match[ab].exec(ad))!=null){var
U=I.filter[ab],ah,af;T=false;if(aa==ai){ai=[]}if(I.preFilter[ab]){Y=I.preFilter[ab](Y,aa,ag,ai,W,Z);if(!Y){T=ah=true}else{if(Y===true){continue}}}if(Y){for(var
X=0;(af=aa[X])!=null;X++){if(af){ah=U(af,Y,X,aa);var
ae=W^!!ah;if(ag&&ah!=null){if(ae){T=true}else{aa[X]=false}}else{if(ae){ai.push(af);T=true}}}}}if(ah!==g){if(!ag){aa=ai}ad=ad.replace(I.match[ab],"");if(!T){return[]}break}}}if(ad==V){if(T==null){throw"Syntax
error, unrecognized expression: "+ad}else{break}}V=ad}return aa};var
I=F.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|
\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|
\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|
\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|
\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|
\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|
[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|
odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|
\\.)+)(?:\((['"]*)((?:\([^\)]+\)|
[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(T){return
T.getAttribute("href")}},relative:{"+":function(aa,T,Z){var X=typeof
T==="string",ab=X&&!/\W/.test(T),Y=X&&!ab;if(ab&&!Z){T=T.toUpperCase()}for(var
W=0,V=aa.length,U;W<V;W++){if((U=aa[W])){while((U=U.previousSibling)&&U.nodeType!==1){}aa[W]=Y|
|U&&U.nodeName===T?U||
false:U===T}}if(Y){F.filter(T,aa,true)}},">":function(Z,U,aa){var X=typeof
U==="string";if(X&&!/\W/.test(U)){U=aa?U:U.toUpperCase();for(var
V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){var
W=Y.parentNode;Z[V]=W.nodeName===U?W:false}}}else{for(var
V=0,T=Z.length;V<T;V++){var
Y=Z[V];if(Y){Z[V]=X?Y.parentNode:Y.parentNode===U}}if(X){F.filter(U,Z,true)}}},"":function(W,U,Y){var
V=L++,T=S;if(!U.match(/\W/)){var
X=U=Y?U:U.toUpperCase();T=P}T("parentNode",U,V,W,X,Y)},"~":function(W,U,Y){var
V=L++,T=S;if(typeof U==="string"&&!U.match(/\W/)){var
X=U=Y?U:U.toUpperCase();T=P}T("previousSibling",U,V,W,X,Y)}},find:{ID:function(U,V,W){if(typeof
V.getElementById!=="undefined"&&!W){var T=V.getElementById(U[1]);return
T?[T]:[]}},NAME:function(V,Y,Z){if(typeof
Y.getElementsByName!=="undefined"){var
U=[],X=Y.getElementsByName(V[1]);for(var
W=0,T=X.length;W<T;W++){if(X[W].getAttribute("name")===V[1]){U.push(X[W])}}return
U.length===0?null:U}},TAG:function(T,U){return
U.getElementsByTagName(T[1])}},preFilter:{CLASS:function(W,U,V,T,Z,aa){W=" "+W[1].replace(/\\/g,"")+" ";if(aa){return
W}for(var
X=0,Y;(Y=U[X])!=null;X++){if(Y){if(Z^(Y.className&&(" "+Y.className+" ").indexOf(W)>=0)){if(!V){T.push(Y)}}else{if(V){U[X]=false}}}}return
false},ID:function(T){return
T[1].replace(/\\/g,"")},TAG:function(U,T){for(var
V=0;T[V]===false;V++){}return
T[V]&&Q(T[V])?U[1]:U[1].toUpperCase()},CHILD:function(T){if(T[1]=="nth"){var
U=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(T[2]=="even"&&"2n"||T[2]=="odd"&&"2n+1"|
|!/\D/.test(T[2])&&"0n+"+T[2]||T[2]);T[2]=(U[1]+(U[2]||
1))-0;T[3]=U[3]-0}T[0]=L++;return T},ATTR:function(X,U,V,T,Y,Z){var
W=X[1].replace(/\\/g,"");if(!Z&&I.attrMap[W]){X[1]=I.attrMap[W]}if(X[2]==="~="){X[4]=" "+X[4]+" "}return
X},PSEUDO:function(X,U,V,T,Y){if(X[1]==="not"){if(X[3].match(R).length>1||
/^\w/.test(X[3])){X[3]=F(X[3],null,null,U)}else{var
W=F.filter(X[3],U,V,true^Y);if(!V){T.push.apply(T,W)}return
false}}else{if(I.match.POS.test(X[0])||I.match.CHILD.test(X[0])){return
true}}return X},POS:function(T){T.unshift(true);return
T}},filters:{enabled:function(T){return
T.disabled===false&&T.type!=="hidden"},disabled:function(T){return
T.disabled===true},checked:function(T){return
T.checked===true},selected:function(T){T.parentNode.selectedIndex;return
T.selected===true},parent:function(T){return !!T.firstChild},empty:function(T){return !T.firstChild},has:function(V,U,T){return !!F(T[3],V).length},header:function(T){return/h\d/i.test(T.nodeName)},text:function(T){return"text"===T.type},radio:function(T){return"radio"===T.type},checkbox:function(T){return"checkbox"===T.type},file:function(T){return"file"===T.type},password:function(T){return"password"===T.type},submit:function(T){return"submit"===T.type},image:function(T){return"image"===T.type},reset:function(T){return"reset"===T.type},button:function(T){return"button"===T.type|
|T.nodeName.toUpperCase()==="BUTTON"},input:function(T){return/input|select|
textarea|button/i.test(T.nodeName)}},setFilters:{first:function(U,T){return
T===0},last:function(V,U,T,W){return
U===W.length-1},even:function(U,T){return T%2===0},odd:function(U,T){return
T%2===1},lt:function(V,U,T){return U<T[3]-0},gt:function(V,U,T){return
U>T[3]-0},nth:function(V,U,T){return T[3]-0==U},eq:function(V,U,T){return
T[3]-0==U}},filter:{PSEUDO:function(Z,V,W,aa){var U=V[1],X=I.

==============================================================================
Diff truncated at 200k characters
Reply all
Reply to author
Forward
0 new messages