/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  */
/*  Utf8 class: encode / decode between multi-byte Unicode characters and UTF-8 multiple          */
/*              single-byte character encoding (c) Chris Veness 2002-2009                         */
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  */

var Utf8 = {};  // Utf8 namespace

/**
 * Encode multi-byte Unicode string into utf-8 multiple single-byte characters 
 * (BMP / basic multilingual plane only)
 *
 * Chars in range U+0080 - U+07FF are encoded in 2 chars, U+0800 - U+FFFF in 3 chars
 *
 * @param {String} strUni Unicode string to be encoded as UTF-8
 * @returns {String} encoded string
 */
Utf8.encode = function(strUni) {
  // use regular expressions & String.replace callback function for better efficiency 
  // than procedural approaches
  var strUtf = strUni.replace(
      /[\u0080-\u07ff]/g,  // U+0080 - U+07FF => 2 bytes 110yyyyy, 10zzzzzz
      function(c) { 
        var cc = c.charCodeAt(0);
        return String.fromCharCode(0xc0 | cc>>6, 0x80 | cc&0x3f); }
    );
  strUtf = strUtf.replace(
      /[\u0800-\uffff]/g,  // U+0800 - U+FFFF => 3 bytes 1110xxxx, 10yyyyyy, 10zzzzzz
      function(c) { 
        var cc = c.charCodeAt(0); 
        return String.fromCharCode(0xe0 | cc>>12, 0x80 | cc>>6&0x3F, 0x80 | cc&0x3f); }
    );
  return strUtf;
}

/**
 * Decode utf-8 encoded string back into multi-byte Unicode characters
 *
 * @param {String} strUtf UTF-8 string to be decoded back to Unicode
 * @returns {String} decoded string
 */
Utf8.decode = function(strUtf) {
  var strUni = strUtf.replace(
      /[\u00c0-\u00df][\u0080-\u00bf]/g,                 // 2-byte chars
      function(c) {  // (note parentheses for precence)
        var cc = (c.charCodeAt(0)&0x1f)<<6 | c.charCodeAt(1)&0x3f;
        return String.fromCharCode(cc); }
    );
  strUni = strUni.replace(
      /[\u00e0-\u00ef][\u0080-\u00bf][\u0080-\u00bf]/g,  // 3-byte chars
      function(c) {  // (note parentheses for precence)
        var cc = ((c.charCodeAt(0)&0x0f)<<12) | ((c.charCodeAt(1)&0x3f)<<6) | ( c.charCodeAt(2)&0x3f); 
        return String.fromCharCode(cc); }
    );
  return strUni;
}

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  *//* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  */
/*  Base64 class: Base 64 encoding / decoding (c) Chris Veness 2002-2009                          */
/*    note: depends on Utf8 class                                                                 */
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  */

var Base64 = {};  // Base64 namespace

Base64.code = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";

/**
 * Encode string into Base64, as defined by RFC 4648 [http://tools.ietf.org/html/rfc4648]
 * (instance method extending String object). As per RFC 4648, no newlines are added.
 *
 * @param {String} str The string to be encoded as base-64
 * @param {Boolean} [utf8encode=false] Flag to indicate whether str is Unicode string to be encoded 
 *   to UTF8 before conversion to base64; otherwise string is assumed to be 8-bit characters
 * @returns {String} Base64-encoded string
 */ 
Base64.encode = function(str, utf8encode) {  // http://tools.ietf.org/html/rfc4648
  utf8encode =  (typeof utf8encode == 'undefined') ? false : utf8encode;
  var o1, o2, o3, bits, h1, h2, h3, h4, e=[], pad = '', c, plain, coded;
  var b64 = Base64.code;
   
  plain = utf8encode ? str.encodeUTF8() : str;
  
  c = plain.length % 3;  // pad string to length of multiple of 3
  if (c > 0) { while (c++ < 3) { pad += '='; plain += '\0'; } }
  // note: doing padding here saves us doing special-case packing for trailing 1 or 2 chars
   
  for (c=0; c<plain.length; c+=3) {  // pack three octets into four hexets
    o1 = plain.charCodeAt(c);
    o2 = plain.charCodeAt(c+1);
    o3 = plain.charCodeAt(c+2);
      
    bits = o1<<16 | o2<<8 | o3;
      
    h1 = bits>>18 & 0x3f;
    h2 = bits>>12 & 0x3f;
    h3 = bits>>6 & 0x3f;
    h4 = bits & 0x3f;

    // use hextets to index into code string
    e[c/3] = b64.charAt(h1) + b64.charAt(h2) + b64.charAt(h3) + b64.charAt(h4);
  }
  coded = e.join('');  // join() is far faster than repeated string concatenation in IE
  
  // replace 'A's from padded nulls with '='s
  coded = coded.slice(0, coded.length-pad.length) + pad;
   
  return coded;
}

/**
 * Decode string from Base64, as defined by RFC 4648 [http://tools.ietf.org/html/rfc4648]
 * (instance method extending String object). As per RFC 4648, newlines are not catered for.
 *
 * @param {String} str The string to be decoded from base-64
 * @param {Boolean} [utf8decode=false] Flag to indicate whether str is Unicode string to be decoded 
 *   from UTF8 after conversion from base64
 * @returns {String} decoded string
 */ 
Base64.decode = function(str, utf8decode) {
  utf8decode =  (typeof utf8decode == 'undefined') ? false : utf8decode;
  var o1, o2, o3, h1, h2, h3, h4, bits, d=[], plain, coded;
  var b64 = Base64.code;

  coded = utf8decode ? str.decodeUTF8() : str;
  
  
  for (var c=0; c<coded.length; c+=4) {  // unpack four hexets into three octets
    h1 = b64.indexOf(coded.charAt(c));
    h2 = b64.indexOf(coded.charAt(c+1));
    h3 = b64.indexOf(coded.charAt(c+2));
    h4 = b64.indexOf(coded.charAt(c+3));
      
    bits = h1<<18 | h2<<12 | h3<<6 | h4;
      
    o1 = bits>>>16 & 0xff;
    o2 = bits>>>8 & 0xff;
    o3 = bits & 0xff;
    
    d[c/4] = String.fromCharCode(o1, o2, o3);
    // check for padding
    if (h4 == 0x40) d[c/4] = String.fromCharCode(o1, o2);
    if (h3 == 0x40) d[c/4] = String.fromCharCode(o1);
  }
  plain = d.join('');  // join() is far faster than repeated string concatenation in IE
   
  return utf8decode ? plain.decodeUTF8() : plain; 
}

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  *//* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  */
/*  AES implementation in JavaScript (c) Chris Veness 2005-2010                                   */
/*   - see http://csrc.nist.gov/publications/PubsFIPS.html#197                                    */
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  */

var Aes = {};  // Aes namespace

/**
 * AES Cipher function: encrypt 'input' state with Rijndael algorithm
 *   applies Nr rounds (10/12/14) using key schedule w for 'add round key' stage
 *
 * @param {Number[]} input 16-byte (128-bit) input state array
 * @param {Number[][]} w   Key schedule as 2D byte-array (Nr+1 x Nb bytes)
 * @returns {Number[]}     Encrypted output state array
 */
Aes.Cipher = function(input, w) {    // main Cipher function [§5.1]
  var Nb = 4;               // block size (in words): no of columns in state (fixed at 4 for AES)
  var Nr = w.length/Nb - 1; // no of rounds: 10/12/14 for 128/192/256-bit keys

  var state = [[],[],[],[]];  // initialise 4xNb byte-array 'state' with input [§3.4]
  for (var i=0; i<4*Nb; i++) state[i%4][Math.floor(i/4)] = input[i];

  state = Aes.AddRoundKey(state, w, 0, Nb);

  for (var round=1; round<Nr; round++) {
    state = Aes.SubBytes(state, Nb);
    state = Aes.ShiftRows(state, Nb);
    state = Aes.MixColumns(state, Nb);
    state = Aes.AddRoundKey(state, w, round, Nb);
  }

  state = Aes.SubBytes(state, Nb);
  state = Aes.ShiftRows(state, Nb);
  state = Aes.AddRoundKey(state, w, Nr, Nb);

  var output = new Array(4*Nb);  // convert state to 1-d array before returning [§3.4]
  for (var i=0; i<4*Nb; i++) output[i] = state[i%4][Math.floor(i/4)];
  return output;
}

/**
 * Perform Key Expansion to generate a Key Schedule
 *
 * @param {Number[]} key Key as 16/24/32-byte array
 * @returns {Number[][]} Expanded key schedule as 2D byte-array (Nr+1 x Nb bytes)
 */
Aes.KeyExpansion = function(key) {  // generate Key Schedule (byte-array Nr+1 x Nb) from Key [§5.2]
  var Nb = 4;            // block size (in words): no of columns in state (fixed at 4 for AES)
  var Nk = key.length/4  // key length (in words): 4/6/8 for 128/192/256-bit keys
  var Nr = Nk + 6;       // no of rounds: 10/12/14 for 128/192/256-bit keys

  var w = new Array(Nb*(Nr+1));
  var temp = new Array(4);

  for (var i=0; i<Nk; i++) {
    var r = [key[4*i], key[4*i+1], key[4*i+2], key[4*i+3]];
    w[i] = r;
  }

  for (var i=Nk; i<(Nb*(Nr+1)); i++) {
    w[i] = new Array(4);
    for (var t=0; t<4; t++) temp[t] = w[i-1][t];
    if (i % Nk == 0) {
      temp = Aes.SubWord(Aes.RotWord(temp));
      for (var t=0; t<4; t++) temp[t] ^= Aes.Rcon[i/Nk][t];
    } else if (Nk > 6 && i%Nk == 4) {
      temp = Aes.SubWord(temp);
    }
    for (var t=0; t<4; t++) w[i][t] = w[i-Nk][t] ^ temp[t];
  }

  return w;
}

/*
 * ---- remaining routines are private, not called externally ----
 */
 
Aes.SubBytes = function(s, Nb) {    // apply SBox to state S [§5.1.1]
  for (var r=0; r<4; r++) {
    for (var c=0; c<Nb; c++) s[r][c] = Aes.Sbox[s[r][c]];
  }
  return s;
}

Aes.ShiftRows = function(s, Nb) {    // shift row r of state S left by r bytes [§5.1.2]
  var t = new Array(4);
  for (var r=1; r<4; r++) {
    for (var c=0; c<4; c++) t[c] = s[r][(c+r)%Nb];  // shift into temp copy
    for (var c=0; c<4; c++) s[r][c] = t[c];         // and copy back
  }          // note that this will work for Nb=4,5,6, but not 7,8 (always 4 for AES):
  return s;  // see asmaes.sourceforge.net/rijndael/rijndaelImplementation.pdf
}

Aes.MixColumns = function(s, Nb) {   // combine bytes of each col of state S [§5.1.3]
  for (var c=0; c<4; c++) {
    var a = new Array(4);  // 'a' is a copy of the current column from 's'
    var b = new Array(4);  // 'b' is a•{02} in GF(2^8)
    for (var i=0; i<4; i++) {
      a[i] = s[i][c];
      b[i] = s[i][c]&0x80 ? s[i][c]<<1 ^ 0x011b : s[i][c]<<1;
    }
    // a[n] ^ b[n] is a•{03} in GF(2^8)
    s[0][c] = b[0] ^ a[1] ^ b[1] ^ a[2] ^ a[3]; // 2*a0 + 3*a1 + a2 + a3
    s[1][c] = a[0] ^ b[1] ^ a[2] ^ b[2] ^ a[3]; // a0 * 2*a1 + 3*a2 + a3
    s[2][c] = a[0] ^ a[1] ^ b[2] ^ a[3] ^ b[3]; // a0 + a1 + 2*a2 + 3*a3
    s[3][c] = a[0] ^ b[0] ^ a[1] ^ a[2] ^ b[3]; // 3*a0 + a1 + a2 + 2*a3
  }
  return s;
}

Aes.AddRoundKey = function(state, w, rnd, Nb) {  // xor Round Key into state S [§5.1.4]
  for (var r=0; r<4; r++) {
    for (var c=0; c<Nb; c++) state[r][c] ^= w[rnd*4+c][r];
  }
  return state;
}

Aes.SubWord = function(w) {    // apply SBox to 4-byte word w
  for (var i=0; i<4; i++) w[i] = Aes.Sbox[w[i]];
  return w;
}

Aes.RotWord = function(w) {    // rotate 4-byte word w left by one byte
  var tmp = w[0];
  for (var i=0; i<3; i++) w[i] = w[i+1];
  w[3] = tmp;
  return w;
}

// Sbox is pre-computed multiplicative inverse in GF(2^8) used in SubBytes and KeyExpansion [§5.1.1]
Aes.Sbox =  [0x63,0x7c,0x77,0x7b,0xf2,0x6b,0x6f,0xc5,0x30,0x01,0x67,0x2b,0xfe,0xd7,0xab,0x76,
             0xca,0x82,0xc9,0x7d,0xfa,0x59,0x47,0xf0,0xad,0xd4,0xa2,0xaf,0x9c,0xa4,0x72,0xc0,
             0xb7,0xfd,0x93,0x26,0x36,0x3f,0xf7,0xcc,0x34,0xa5,0xe5,0xf1,0x71,0xd8,0x31,0x15,
             0x04,0xc7,0x23,0xc3,0x18,0x96,0x05,0x9a,0x07,0x12,0x80,0xe2,0xeb,0x27,0xb2,0x75,
             0x09,0x83,0x2c,0x1a,0x1b,0x6e,0x5a,0xa0,0x52,0x3b,0xd6,0xb3,0x29,0xe3,0x2f,0x84,
             0x53,0xd1,0x00,0xed,0x20,0xfc,0xb1,0x5b,0x6a,0xcb,0xbe,0x39,0x4a,0x4c,0x58,0xcf,
             0xd0,0xef,0xaa,0xfb,0x43,0x4d,0x33,0x85,0x45,0xf9,0x02,0x7f,0x50,0x3c,0x9f,0xa8,
             0x51,0xa3,0x40,0x8f,0x92,0x9d,0x38,0xf5,0xbc,0xb6,0xda,0x21,0x10,0xff,0xf3,0xd2,
             0xcd,0x0c,0x13,0xec,0x5f,0x97,0x44,0x17,0xc4,0xa7,0x7e,0x3d,0x64,0x5d,0x19,0x73,
             0x60,0x81,0x4f,0xdc,0x22,0x2a,0x90,0x88,0x46,0xee,0xb8,0x14,0xde,0x5e,0x0b,0xdb,
             0xe0,0x32,0x3a,0x0a,0x49,0x06,0x24,0x5c,0xc2,0xd3,0xac,0x62,0x91,0x95,0xe4,0x79,
             0xe7,0xc8,0x37,0x6d,0x8d,0xd5,0x4e,0xa9,0x6c,0x56,0xf4,0xea,0x65,0x7a,0xae,0x08,
             0xba,0x78,0x25,0x2e,0x1c,0xa6,0xb4,0xc6,0xe8,0xdd,0x74,0x1f,0x4b,0xbd,0x8b,0x8a,
             0x70,0x3e,0xb5,0x66,0x48,0x03,0xf6,0x0e,0x61,0x35,0x57,0xb9,0x86,0xc1,0x1d,0x9e,
             0xe1,0xf8,0x98,0x11,0x69,0xd9,0x8e,0x94,0x9b,0x1e,0x87,0xe9,0xce,0x55,0x28,0xdf,
             0x8c,0xa1,0x89,0x0d,0xbf,0xe6,0x42,0x68,0x41,0x99,0x2d,0x0f,0xb0,0x54,0xbb,0x16];

// Rcon is Round Constant used for the Key Expansion [1st col is 2^(r-1) in GF(2^8)] [§5.2]
Aes.Rcon = [ [0x00, 0x00, 0x00, 0x00],
             [0x01, 0x00, 0x00, 0x00],
             [0x02, 0x00, 0x00, 0x00],
             [0x04, 0x00, 0x00, 0x00],
             [0x08, 0x00, 0x00, 0x00],
             [0x10, 0x00, 0x00, 0x00],
             [0x20, 0x00, 0x00, 0x00],
             [0x40, 0x00, 0x00, 0x00],
             [0x80, 0x00, 0x00, 0x00],
             [0x1b, 0x00, 0x00, 0x00],
             [0x36, 0x00, 0x00, 0x00] ]; 

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  *//* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  */
/*  AES Counter-mode implementation in JavaScript (c) Chris Veness 2005-2009                      */
/*   - see http://csrc.nist.gov/publications/nistpubs/800-38a/sp800-38a.pdf                       */
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  */

var AesCtr = {};  // AesCtr namespace

/** 
 * Encrypt a text using AES encryption in Counter mode of operation
 *
 * Unicode multi-byte character safe
 *
 * @param {String} plaintext Source text to be encrypted
 * @param {String} password  The password to use to generate a key
 * @param {Number} nBits     Number of bits to be used in the key (128, 192, or 256)
 * @returns {string}         Encrypted text
 */
AesCtr.encrypt = function(plaintext, password, nBits) {
  var blockSize = 16;  // block size fixed at 16 bytes / 128 bits (Nb=4) for AES
  if (!(nBits==128 || nBits==192 || nBits==256)) return '';  // standard allows 128/192/256 bit keys
  plaintext = Utf8.encode(plaintext);
  password = Utf8.encode(password);
  //var t = new Date();  // timer
	
  // use AES itself to encrypt password to get cipher key (using plain password as source for key 
  // expansion) - gives us well encrypted key
  var nBytes = nBits/8;  // no bytes in key
  var pwBytes = new Array(nBytes);
  for (var i=0; i<nBytes; i++) {
    pwBytes[i] = isNaN(password.charCodeAt(i)) ? 0 : password.charCodeAt(i);
  }
  var key = Aes.Cipher(pwBytes, Aes.KeyExpansion(pwBytes));  // gives us 16-byte key
  key = key.concat(key.slice(0, nBytes-16));  // expand key to 16/24/32 bytes long

  // initialise counter block (NIST SP800-38A §B.2): millisecond time-stamp for nonce in 1st 8 bytes,
  // block counter in 2nd 8 bytes
  var counterBlock = new Array(blockSize);
  var nonce = (new Date()).getTime();  // timestamp: milliseconds since 1-Jan-1970
  var nonceSec = Math.floor(nonce/1000);
  var nonceMs = nonce%1000;
  // encode nonce with seconds in 1st 4 bytes, and (repeated) ms part filling 2nd 4 bytes
  for (var i=0; i<4; i++) counterBlock[i] = (nonceSec >>> i*8) & 0xff;
  for (var i=0; i<4; i++) counterBlock[i+4] = nonceMs & 0xff; 
  // and convert it to a string to go on the front of the ciphertext
  var ctrTxt = '';
  for (var i=0; i<8; i++) ctrTxt += String.fromCharCode(counterBlock[i]);

  // generate key schedule - an expansion of the key into distinct Key Rounds for each round
  var keySchedule = Aes.KeyExpansion(key);
  
  var blockCount = Math.ceil(plaintext.length/blockSize);
  var ciphertxt = new Array(blockCount);  // ciphertext as array of strings
  
  for (var b=0; b<blockCount; b++) {
    // set counter (block #) in last 8 bytes of counter block (leaving nonce in 1st 8 bytes)
    // done in two stages for 32-bit ops: using two words allows us to go past 2^32 blocks (68GB)
    for (var c=0; c<4; c++) counterBlock[15-c] = (b >>> c*8) & 0xff;
    for (var c=0; c<4; c++) counterBlock[15-c-4] = (b/0x100000000 >>> c*8)

    var cipherCntr = Aes.Cipher(counterBlock, keySchedule);  // -- encrypt counter block --
    
    // block size is reduced on final block
    var blockLength = b<blockCount-1 ? blockSize : (plaintext.length-1)%blockSize+1;
    var cipherChar = new Array(blockLength);
    
    for (var i=0; i<blockLength; i++) {  // -- xor plaintext with ciphered counter char-by-char --
      cipherChar[i] = cipherCntr[i] ^ plaintext.charCodeAt(b*blockSize+i);
      cipherChar[i] = String.fromCharCode(cipherChar[i]);
    }
    ciphertxt[b] = cipherChar.join(''); 
  }

  // Array.join is more efficient than repeated string concatenation in IE
  var ciphertext = ctrTxt + ciphertxt.join('');
  ciphertext = Base64.encode(ciphertext);  // encode in base64
  
  //alert((new Date()) - t);
  return ciphertext;
}

/** 
 * Decrypt a text encrypted by AES in counter mode of operation
 *
 * @param {String} ciphertext Source text to be encrypted
 * @param {String} password   The password to use to generate a key
 * @param {Number} nBits      Number of bits to be used in the key (128, 192, or 256)
 * @returns {String}          Decrypted text
 */
AesCtr.decrypt = function(ciphertext, password, nBits) {
  var blockSize = 16;  // block size fixed at 16 bytes / 128 bits (Nb=4) for AES
  if (!(nBits==128 || nBits==192 || nBits==256)) return '';  // standard allows 128/192/256 bit keys
  ciphertext = Base64.decode(ciphertext);
  password = Utf8.encode(password);
  //var t = new Date();  // timer
  
  // use AES to encrypt password (mirroring encrypt routine)
  var nBytes = nBits/8;  // no bytes in key
  var pwBytes = new Array(nBytes);
  for (var i=0; i<nBytes; i++) {
    pwBytes[i] = isNaN(password.charCodeAt(i)) ? 0 : password.charCodeAt(i);
  }
  var key = Aes.Cipher(pwBytes, Aes.KeyExpansion(pwBytes));
  key = key.concat(key.slice(0, nBytes-16));  // expand key to 16/24/32 bytes long

  // recover nonce from 1st 8 bytes of ciphertext
  var counterBlock = new Array(8);
  ctrTxt = ciphertext.slice(0, 8);
  for (var i=0; i<8; i++) counterBlock[i] = ctrTxt.charCodeAt(i);
  
  // generate key schedule
  var keySchedule = Aes.KeyExpansion(key);

  // separate ciphertext into blocks (skipping past initial 8 bytes)
  var nBlocks = Math.ceil((ciphertext.length-8) / blockSize);
  var ct = new Array(nBlocks);
  for (var b=0; b<nBlocks; b++) ct[b] = ciphertext.slice(8+b*blockSize, 8+b*blockSize+blockSize);
  ciphertext = ct;  // ciphertext is now array of block-length strings

  // plaintext will get generated block-by-block into array of block-length strings
  var plaintxt = new Array(ciphertext.length);

  for (var b=0; b<nBlocks; b++) {
    // set counter (block #) in last 8 bytes of counter block (leaving nonce in 1st 8 bytes)
    for (var c=0; c<4; c++) counterBlock[15-c] = ((b) >>> c*8) & 0xff;
    for (var c=0; c<4; c++) counterBlock[15-c-4] = (((b+1)/0x100000000-1) >>> c*8) & 0xff;

    var cipherCntr = Aes.Cipher(counterBlock, keySchedule);  // encrypt counter block

    var plaintxtByte = new Array(ciphertext[b].length);
    for (var i=0; i<ciphertext[b].length; i++) {
      // -- xor plaintxt with ciphered counter byte-by-byte --
      plaintxtByte[i] = cipherCntr[i] ^ ciphertext[b].charCodeAt(i);
      plaintxtByte[i] = String.fromCharCode(plaintxtByte[i]);
    }
    plaintxt[b] = plaintxtByte.join('');
  }

  // join array of blocks into single plaintext string
  var plaintext = plaintxt.join('');
  plaintext = Utf8.decode(plaintext);  // decode from UTF8 back to Unicode multi-byte chars
  
  //alert((new Date()) - t);
  return plaintext;
}

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  */
var browser = function ()
{
}

browser.get = function ()
{
	var s  = window.location.search;
	var res = new Object;
	if (s != "") s = s.substr(1);	// remove leading '?'
	while (s != "")
	{
		var in_key = true;
		var key = "";
		var value = "";
		while (s != "" && s.substr (0,1) != "&")
		{
			var c = s.substr(0,1);
			s = s.substr(1);
			if (in_key)
			{
				if (c == "=")
					in_key = false;
				else
					key += c;
			}
			else
			{
				value += c;
			}
		}
		value = value.replace ("+", " ");
		value = decodeURIComponent(value);
		res[key] = decodeURIComponent(value);
		if (s.substr(0,1) == "&") s = s.substr(1);
	}
	return res;
}

browser.server = function ()
{
	var res = new Object;
	res.REQUEST_URI = window.location.href;
	res.HTTP_HOST = window.location.hostname;
	return res;
}

browser.cookie = function ()
{
	var res = new Object;
	var pairs = document.cookie.split (";");
	for (var i = 0; i < pairs.length; i++)
	{
		var pair = pairs[i].split("=");
		res[pair[0]] = unescape (pair[1]);
	}
	return res;
}

browser.reload = function (del_args, add_args)
{
	var args = browser.get();
	var res = "";
	for (var key in args)
	{
		found = false;
		for (var j in del_args)
			if (del_args[j] == key)
				found = true;
		if (!found)
		{
			if (res.length) res += "&";
			res += key + "=" + (encodeURIComponent (args[key]).replace (" ","+"));
		}
	}
	for (var key in add_args)
	{
		if (res.length) res += "&";
		res += key + "=" + (encodeURIComponent (add_args[key]).replace (" ","+"));
	}
	window.location = "?"+res;
}

browser.redirect = function (url)
{
	window.location = url;
}

browser.scroll_left = function ()
{
	return $(window).scrollLeft();
//	if (document.body && (document.body.scrollLeft || document.body.scrollTop))
//		return document.body.scrollLeft;
//	else if (document.documentElement && (document.documentElement.scrollLeft || document.documentElement.scrollTop))
//		return document.documentElement.scrollLeft;
//	return 0;
}

browser.scroll_top = function ()
{
	return $(window).scrollTop();
//	if (document.body && (document.body.scrollLeft || document.body.scrollTop))
//		return document.body.scrollTop;
//	else if (document.documentElement && (document.documentElement.scrollLeft || document.documentElement.scrollTop))
//		return document.documentElement.scrollTop;
//	return 0;
}

browser.window_width = function ()
{
	if (typeof (window.innerWidth) == 'number')
		return window.innerWidth;
	else
		return document.documentElement.clientWidth;
}

browser.window_height = function ()
{
	if (typeof (window.innerWidth) == 'number')
		return window.innerHeight;
	else
		return document.documentElement.clientHeight;
}

browser.document_height = function ()
{
	return Math.max (
		Math.max (document.body.scrollHeight, document.documentElement.scrollHeight),
		Math.max (document.body.offsetHeight, document.documentElement.offsetHeight),
		Math.max (document.body.clientHeight, document.documentElement.clientHeight));
}

browser.set_alpha = function (el, val)
{
	if (val < 0) val = 0;
	if (val > 100) val = 100;
	if (document.all)
	{
		el.style.MsFilter = "\"progid:DXImageTransform.Microsoft.Alpha(Opacity="+val+")\"";
		el.style.filter = "alpha(opacity="+val+")";
	}
	else
	{
		if (val == 100)
		{
			el.style.MozOpacity = "1.00";
			el.style.opacity = "1.00";
		}
		else
		{
			if (val < 10) val = "0"+val;
			el.style.MozOpacity = "0."+val;
			el.style.opacity = "0."+val;
		}
	}
}

function beginDrag (elementToDrag, event, onlyY, parent)
{
	if (!event) event = window.event;
	var deltaX = event.clientX - parseInt (elementToDrag.style.left);
	var deltaY = event.clientY - parseInt (elementToDrag.style.top);
	var old_movehandler;
	var old_uphandler;
	var old_onselectstart;

	function retfalse ()
	{
		return false;
	}

	if (document.addEventListener)
	{
		document.addEventListener ("mousemove", moveHandler, true);
		document.addEventListener ("mouseup", upHandler, true);
	}
	else if (document.attachEvent)
	{
		document.attachEvent ("onmousemove", moveHandler);
		document.attachEvent ("onmouseup", upHandler);
		old_onselectstart = document.onselectstart;
		document.onselectstart = retfalse;
	}
	else
	{
		old_movehandler = document.onmousemove;
		old_uphandler = document.onmouseup;
		document.onmousemove = moveHandler;
		document.onmouseup = upHandler;
	}

	if (event.stopPropagation)
	{
		event.stopPropagation();
		event.preventDefault();
	}
	else event.cancelBubble = true;

	function moveHandler (e)
	{
		if (!e) e = window.event;
		if (!onlyY)
			elementToDrag.style.left = (e.clientX - deltaX) + "px";
		elementToDrag.style.top = (e.clientY - deltaY) + "px";
		if (e.stopPropagation) e.stopPropagation();
		else e.cancelBubble = true;
		if (parent)
		{
			parent.move_action();
//			deltaX = event.clientX - parseInt (elementToDrag.style.left);
			deltaY = e.clientY - parseInt (elementToDrag.style.top);
		}
	}

	function upHandler (e)
	{
		if (!e) e = window.event;
		if (document.removeEventListener)
		{
			document.removeEventListener ("mouseup", upHandler, true);
			document.removeEventListener ("mousemove", moveHandler, true);
		}
		else if (document.detachEvent)
		{
			document.detachEvent ("onmouseup", upHandler);
			document.detachEvent ("onmousemove", moveHandler);
			document.onselectstart = old_onselectstart;
		}
		else
		{
			document.onmouseup = old_uphandler;
			document.onmousemove = old_movehandler;
		}
		if (e.stopPropagation) e.stopPropagation();
		else e.cancelBubble = true;

		if (parent)
		{
			parent.release_action ();
			parent = null;
		}
	}
}
/*
*	Upload files to the server using HTML 5 Drag and drop the folders on your local computer
*
*	Tested on:
*	Mozilla Firefox 3.6.12
*	Google Chrome 7.0.517.41
*	Safari 5.0.2
*	WebKit r70732
*
*	The current version does not work on:
*	Opera 10.63 
*	Opera 11 alpha
*	IE 6+
*/

function weeby_uploader(place, status, targetPHP, show) {
	
	// Upload image files
	upload = function(file) {
	
		// Firefox 3.6, Chrome 6, WebKit
		if(window.FileReader) { 
				
			// Once the process of reading file
			this.loadEnd = function() {
				bin = reader.result;				
				xhr = new XMLHttpRequest();
				xhr.open('POST', targetPHP+'&up=true', true);
				var boundary = 'xxxxxxxxx';
	 			var body = '--' + boundary + "\r\n";  
				body += "Content-Disposition: form-data; name='upload'; filename='" + file.name + "'\r\n";  
				body += "Content-Type: application/octet-stream\r\n\r\n";  
				body += bin + "\r\n";  
				body += '--' + boundary + '--';      
				xhr.setRequestHeader('content-type', 'multipart/form-data; boundary=' + boundary);
				// Firefox 3.6 provides a feature sendAsBinary ()
				if(xhr.sendAsBinary != null) { 
					xhr.sendAsBinary(body); 
				// Chrome 7 sends data but you must use the base64_decode on the PHP side
				} else {
					xhr.open('POST', targetPHP+'&up=true&base64=true', true);
					xhr.setRequestHeader('UP-FILENAME', file.name);
					xhr.setRequestHeader('UP-SIZE', file.size);
					xhr.setRequestHeader('UP-TYPE', file.type);
					xhr.send(window.btoa(bin));
				}
				if (show) {
					var newFile  = document.createElement('div');
					newFile.innerHTML = 'Loaded : '+file.name+' size '+file.size+' B';
					document.getElementById(show).appendChild(newFile);				
				}
				if (status) {
					document.getElementById(status).innerHTML = 'Loaded : 100%<br/>Next file ...';
				}
			}
				
			// Loading errors
			this.loadError = function(event) {
				switch(event.target.error.code) {
					case event.target.error.NOT_FOUND_ERR:
						document.getElementById(status).innerHTML = 'File not found!';
					break;
					case event.target.error.NOT_READABLE_ERR:
						document.getElementById(status).innerHTML = 'File not readable!';
					break;
					case event.target.error.ABORT_ERR:
					break; 
					default:
						document.getElementById(status).innerHTML = 'Read error.';
				}	
			}
		
			// Reading Progress
			this.loadProgress = function(event) {
				if (event.lengthComputable) {
					var percentage = Math.round((event.loaded * 100) / event.total);
					document.getElementById(status).innerHTML = 'Loaded : '+percentage+'%';
				}				
			}
				
			// Preview images
			this.previewNow = function(event) {		
				bin = preview.result;
				var img = document.createElement("img"); 
				img.className = 'addedIMG';
			    img.file = file;   
			    img.src = bin;
				document.getElementById(show).appendChild(img);
			}

			reader = new FileReader();
			// Firefox 3.6, WebKit
			if(reader.addEventListener) { 
				reader.addEventListener('loadend', this.loadEnd, false);
				if (status != null) 
				{
					reader.addEventListener('error', this.loadError, false);
					reader.addEventListener('progress', this.loadProgress, false);
				}
		
			// Chrome 7
			} else { 
				reader.onloadend = this.loadEnd;
				if (status != null) 
				{
					reader.onerror = this.loadError;
					reader.onprogress = this.loadProgress;
				}
			}
			var preview = new FileReader();
			// Firefox 3.6, WebKit
			if(preview.addEventListener) { 
				preview.addEventListener('loadend', this.previewNow, false);
			// Chrome 7	
			} else { 
				preview.onloadend = this.previewNow;
			}
		
			// The function that starts reading the file as a binary string
		     	reader.readAsBinaryString(file);
	     
		    	// Preview uploaded files
		    	if (show) {
			     	preview.readAsDataURL(file);
		 	}
		
  		// Safari 5 does not support FileReader
		} else {
			xhr = new XMLHttpRequest();
			xhr.open('POST', targetPHP+'&up=true', true);
			xhr.setRequestHeader('UP-FILENAME', file.name);
			xhr.setRequestHeader('UP-SIZE', file.size);
			xhr.setRequestHeader('UP-TYPE', file.type);
			xhr.send(file); 
			
			if (status) {
				document.getElementById(status).innerHTML = 'Loaded : 100%';
			}
			if (show) {
				var newFile  = document.createElement('div');
				newFile.innerHTML = 'Loaded : '+file.name+' size '+file.size+' B';
				document.getElementById(show).appendChild(newFile);
			}	
		}				
	}

	// Function drop file
	this.drop = function(event) {
		event.preventDefault();
	 	var dt = event.dataTransfer;
	 	var files = dt.files;
	 	for (var i = 0; i<files.length; i++) {
			var file = files[i];
			upload(file);
	 	}
	}
	
	// The inclusion of the event listeners (DragOver and drop)

	this.uploadPlace =  document.getElementById(place);
	this.uploadPlace.addEventListener("dragover", function(event) {
		event.stopPropagation(); 
		event.preventDefault();
	}, true);
	this.uploadPlace.addEventListener("drop", this.drop, false); 

}

	
/*
  DOM Ranges for Internet Explorer (m2)
  
  Copyright (c) 2009 Tim Cameron Ryan
  Released under the MIT/X License
 */
 
/*
  Range reference:
    http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html
    http://mxr.mozilla.org/mozilla-central/source/content/base/src/nsRange.cpp
    https://developer.mozilla.org/En/DOM:Range
  Selection reference:
    http://trac.webkit.org/browser/trunk/WebCore/page/DOMSelection.cpp
  TextRange reference:
    http://msdn.microsoft.com/en-us/library/ms535872.aspx
  Other links:
    http://jorgenhorstink.nl/test/javascript/range/range.js
    http://jorgenhorstink.nl/2006/07/05/dom-range-implementation-in-ecmascript-completed/
    http://dylanschiemann.com/articles/dom2Range/dom2RangeExamples.html
*/

//[TODO] better exception support

if (document.createRange == undefined)
(function () {	// sandbox

/*
  DOM functions
 */

var DOMUtils = {
	findChildPosition: function (node) {
		for (var i = 0; node = node.previousSibling; i++)
			continue;
		return i;
	},
	isDataNode: function (node) {
		return node && node.nodeValue !== null && node.data !== null;
	},
	isAncestorOf: function (parent, node) {
		return !DOMUtils.isDataNode(parent) &&
		    (parent.contains(DOMUtils.isDataNode(node) ? node.parentNode : node) ||		    
		    node.parentNode == parent);
	},
	isAncestorOrSelf: function (root, node) {
		return DOMUtils.isAncestorOf(root, node) || root == node;
	},
	findClosestAncestor: function (root, node) {
		if (DOMUtils.isAncestorOf(root, node))
			while (node && node.parentNode != root)
				node = node.parentNode;
		return node;
	},
	getNodeLength: function (node) {
		return DOMUtils.isDataNode(node) ? node.length : node.childNodes.length;
	},
	splitDataNode: function (node, offset) {
		if (!DOMUtils.isDataNode(node))
			return false;
		var newNode = node.cloneNode(false);
		node.deleteData(offset, node.length);
		newNode.deleteData(0, offset);
		node.parentNode.insertBefore(newNode, node.nextSibling);
	}
};

/*
  Text Range utilities
  functions to simplify text range manipulation in ie
 */

var TextRangeUtils = {
	convertToDOMRange: function (textRange, document) {
		function adoptBoundary(domRange, textRange, bStart) {
			// iterate backwards through parent element to find anchor location
			var cursorNode = document.createElement('a'), cursor = textRange.duplicate();
			cursor.collapse(bStart);
			var parent = cursor.parentElement();
			do {
				parent.insertBefore(cursorNode, cursorNode.previousSibling);
				cursor.moveToElementText(cursorNode);
			} while (cursor.compareEndPoints(bStart ? 'StartToStart' : 'StartToEnd', textRange) > 0 && cursorNode.previousSibling);

			// when we exceed or meet the cursor, we've found the node
			if (cursor.compareEndPoints(bStart ? 'StartToStart' : 'StartToEnd', textRange) == -1 && cursorNode.nextSibling) {
				// data node
				cursor.setEndPoint(bStart ? 'EndToStart' : 'EndToEnd', textRange);
				domRange[bStart ? 'setStart' : 'setEnd'](cursorNode.nextSibling, cursor.text.length);
			} else {
				// element
				domRange[bStart ? 'setStartBefore' : 'setEndBefore'](cursorNode);
			}
			cursorNode.parentNode.removeChild(cursorNode);
		}
	
		// return a DOM range
		var domRange = new DOMRange(document);
		adoptBoundary(domRange, textRange, true);
		adoptBoundary(domRange, textRange, false);
		return domRange;
	},

	convertFromDOMRange: function (domRange) {
		function adoptEndPoint(textRange, domRange, bStart) {
			// find anchor node and offset
			var container = domRange[bStart ? 'startContainer' : 'endContainer'];
			var offset = domRange[bStart ? 'startOffset' : 'endOffset'], textOffset = 0;
//			debugout ("container = "+container+", offset = "+offset);
//			var anchorNode = DOMUtils.isDataNode(container) ? container : container.childNodes[offset];
//			var anchorParent = DOMUtils.isDataNode(container) ? container.parentNode : container;
			// visible data nodes need a text offset
			if (container.nodeType == 3 || container.nodeType == 4)
				textOffset = offset;

			// create a cursor element node to position range (since we can't select text nodes)
			var cursorNode = domRange._document.createElement('a');

//			anchorParent.insertBefore(cursorNode, anchorNode);
			if (DOMUtils.isDataNode(container))
			{
				container.parentNode.insertBefore (cursorNode, container);
			}	
			else
			{
				if (offset == container.childNodes.length)
					container.appendChild (cursorNode);
				else
					container.insertBefore (cursorNode, container.childNodes[offset]);
			}
			var cursor = domRange._document.body.createTextRange();
			cursor.moveToElementText(cursorNode);
			cursorNode.parentNode.removeChild(cursorNode);

			// move range
			textRange.setEndPoint(bStart ? 'StartToStart' : 'EndToStart', cursor);
			textRange[bStart ? 'moveStart' : 'moveEnd']('character', textOffset);
		}
		
		// return an IE text range
		var textRange = domRange._document.body.createTextRange();
		adoptEndPoint(textRange, domRange, true);
		adoptEndPoint(textRange, domRange, false);
		return textRange;
	}
};

/*
  DOM Range
 */
 
function DOMRange(document) {
	// save document parameter
	this._document = document;
	
	// initialize range
//[TODO] this should be located at document[0], document[0]
	this.startContainer = this.endContainer = document.body;
	this.endOffset = DOMUtils.getNodeLength(document.body);
}
DOMRange.START_TO_START = 0;
DOMRange.START_TO_END = 1;
DOMRange.END_TO_END = 2;
DOMRange.END_TO_START = 3;

DOMRange.prototype = {
	// public properties
	startContainer: null,
	startOffset: 0,
	endContainer: null,
	endOffset: 0,
	commonAncestorContainer: null,
	collapsed: false,
	// private properties
	_document: null,
	
	// private methods
	_refreshProperties: function () {
		// collapsed attribute
		this.collapsed = (this.startContainer == this.endContainer && this.startOffset == this.endOffset);
		// find common ancestor
		var node = this.startContainer;
		while (node && node != this.endContainer && !DOMUtils.isAncestorOf(node, this.endContainer))
			node = node.parentNode;
		this.commonAncestorContainer = node;
	},
	
	// range methods
//[TODO] collapse if start is after end, end is before start
	setStart: function(container, offset) {
		this.startContainer = container;
		this.startOffset = offset;
		this._refreshProperties();
	},
	setEnd: function(container, offset) {
		this.endContainer = container;
		this.endOffset = offset;
		this._refreshProperties();
	},
	setStartBefore: function (refNode) {
		// set start to beore this node
		this.setStart(refNode.parentNode, DOMUtils.findChildPosition(refNode));
	},
	setStartAfter: function (refNode) {
		// select next sibling
		this.setStart(refNode.parentNode, DOMUtils.findChildPosition(refNode) + 1);
	},
	setEndBefore: function (refNode) {
		// set end to beore this node
		this.setEnd(refNode.parentNode, DOMUtils.findChildPosition(refNode));
	},
	setEndAfter: function (refNode) {
		// select next sibling
		this.setEnd(refNode.parentNode, DOMUtils.findChildPosition(refNode) + 1);
	},
	selectNode: function (refNode) {
		this.setStartBefore(refNode);
		this.setEndAfter(refNode);
	},
	selectNodeContents: function (refNode) {
		this.setStart(refNode, 0);
		this.setEnd(refNode, DOMUtils.getNodeLength(refNode));
	},
	collapse: function (toStart) {
		if (toStart)
			this.setEnd(this.startContainer, this.startOffset);
		else
			this.setStart(this.endContainer, this.endOffset);
	},

	// editing methods
	cloneContents: function () {
		// clone subtree
		return (function cloneSubtree(iterator) {
			for (var node, frag = document.createDocumentFragment(); node = iterator.next(); ) {
				node = node.cloneNode(!iterator.hasPartialSubtree());
				if (iterator.hasPartialSubtree())
					node.appendChild(cloneSubtree(iterator.getSubtreeIterator()));
				frag.appendChild(node);
			}
			return frag;
		})(new RangeIterator(this));
	},
	extractContents: function () {
		// cache range and move anchor points
		var range = this.cloneRange();
		if (this.startContainer != this.commonAncestorContainer)
			this.setStartAfter(DOMUtils.findClosestAncestor(this.commonAncestorContainer, this.startContainer));
		this.collapse(true);
		// extract range
		return (function extractSubtree(iterator) {
			for (var node, frag = document.createDocumentFragment(); node = iterator.next(); ) {
				iterator.hasPartialSubtree() ? node = node.cloneNode(false) : iterator.remove();
				if (iterator.hasPartialSubtree())
					node.appendChild(extractSubtree(iterator.getSubtreeIterator()));
				frag.appendChild(node);
			}
			return frag;
		})(new RangeIterator(range));
	},
	deleteContents: function () {
		// cache range and move anchor points
		var range = this.cloneRange();
		if (this.startContainer != this.commonAncestorContainer)
			this.setStartAfter(DOMUtils.findClosestAncestor(this.commonAncestorContainer, this.startContainer));
		this.collapse(true);
		// delete range
		(function deleteSubtree(iterator) {
			while (iterator.next())
				iterator.hasPartialSubtree() ? deleteSubtree(iterator.getSubtreeIterator()) : iterator.remove();
		})(new RangeIterator(range));
	},
	insertNode: function (newNode) {
		// set original anchor and insert node
		if (DOMUtils.isDataNode(this.startContainer)) {
			DOMUtils.splitDataNode(this.startContainer, this.startOffset);
			this.startContainer.parentNode.insertBefore(newNode, this.startContainer.nextSibling);
		} else {
			this.startContainer.insertBefore(newNode, this.startContainer.childNodes[this.startOffset]);
		}
		// resync start anchor
		this.setStart(this.startContainer, this.startOffset);
	},
	surroundContents: function (newNode) {
		// extract and surround contents
		var content = this.extractContents();
		this.insertNode(newNode);
		newNode.appendChild(content);
		this.selectNode(newNode);
	},

	// other methods
	compareBoundaryPoints: function (how, sourceRange) {

		function calc_sourceIndex (node, offset)
		{
			if (node.nodeType == 1)
			{
				var res;
				if (offset == 0)
				{
					res = node.sourceIndex;
				}
				else if (offset == node.childNodes.length)
				{
					if (node.childNodes[node.childNodes.length-1].nodeType == 3)
						res = calc_sourceIndex (node.childNodes[offset-1], node.childNodes[offset-1].length); // last child is a text node
					else
						res = calc_sourceIndex (node.childNodes[offset-1], node.childNodes[offset-1].childNodes.length); // last child is a structure node
				}
				else
					res = calc_sourceIndex (node.childNodes[offset], 0);
//				debugout ("calc_sourceIndex("+node.tagName+","+offset+") children="+node.childNodes.length+" ="+res);
				return res;
			}
			else if (node.nodeType == 3)
			{
				var prevcount = 0;
				var n;
				for (n = node; n !== null && n.nodeType == 3; n = n.previousSibling)
					prevcount++;

				if (n === null) n = node.parentNode;
				var baseIndex = n.sourceIndex;

				var res = baseIndex + (0.0 + prevcount) / 1000 + (0.0 + offset) / 1000000;
//				debugout ("calc_sourceIndex("+node.nodeValue+","+offset+") = "+res);
				return res;
			}
			else
			{
				throw "No idea what to do!";
			}
		}

		// get anchors
		var containerA, offsetA, containerB, offsetB;
		switch (how) {
		    case DOMRange.START_TO_START:
		    case DOMRange.START_TO_END:
			containerA = this.startContainer;
			offsetA = this.startOffset;
			break;
		    case DOMRange.END_TO_END:
		    case DOMRange.END_TO_START:
			containerA = this.endContainer;
			offsetA = this.endOffset;
			break;
		}
		switch (how) {
		    case DOMRange.START_TO_START:
		    case DOMRange.END_TO_START:
			containerB = sourceRange.startContainer;
			offsetB = sourceRange.startOffset;
			break;
		    case DOMRange.START_TO_END:
		    case DOMRange.END_TO_END:
			containerB = sourceRange.endContainer;
			offsetB = sourceRange.endOffset;
			break;
		}
		var asi = calc_sourceIndex(containerA, offsetA);
		var bsi = calc_sourceIndex(containerB, offsetB);
//		debugout ("compare "+asi+" with "+bsi);
		return asi < bsi ? -1 : (asi == bsi ? 0 : 1);
//		return containerA.sourceIndex < containerB.sourceIndex ? -1 :
//		    containerA.sourceIndex == containerB.sourceIndex ?
//		        offsetA < offsetB ? -1 : offsetA == offsetB ? 0 : 1
//		        : 1;
	},
	cloneRange: function () {
		// return cloned range
		var range = new DOMRange(this._document);
		range.setStart(this.startContainer, this.startOffset);
		range.setEnd(this.endContainer, this.endOffset);
		return range;
	},
	detach: function () {
//[TODO] Releases Range from use to improve performance. 
	},
	toString: function () {
		return TextRangeUtils.convertFromDOMRange(this).text;
	},
	createContextualFragment: function (tagString) {
		// parse the tag string in a context node
		var content = (DOMUtils.isDataNode(this.startContainer) ? this.startContainer.parentNode : this.startContainer).cloneNode(false);
		content.innerHTML = tagString;
		// return a document fragment from the created node
		for (var fragment = this._document.createDocumentFragment(); content.firstChild; )
			fragment.appendChild(content.firstChild);
		return fragment;
	}
};

/*
  Range iterator
 */

function RangeIterator(range) {
	this.range = range;
	if (range.collapsed)
		return;

//[TODO] ensure this works
	// get anchors
	var root = range.commonAncestorContainer;
	this._next = range.startContainer == root && !DOMUtils.isDataNode(range.startContainer) ?
	    range.startContainer.childNodes[range.startOffset] :
	    DOMUtils.findClosestAncestor(root, range.startContainer);
	this._end = range.endContainer == root && !DOMUtils.isDataNode(range.endContainer) ?
	    range.endContainer.childNodes[range.endOffset] :
	    DOMUtils.findClosestAncestor(root, range.endContainer).nextSibling;
}

RangeIterator.prototype = {
	// public properties
	range: null,
	// private properties
	_current: null,
	_next: null,
	_end: null,

	// public methods
	hasNext: function () {
		return !!this._next;
	},
	next: function () {
		// move to next node
		var current = this._current = this._next;
		this._next = this._current && this._current.nextSibling != this._end ?
		    this._current.nextSibling : null;

		// check for partial text nodes
		if (DOMUtils.isDataNode(this._current)) {
			if (this.range.endContainer == this._current)
				(current = current.cloneNode(true)).deleteData(this.range.endOffset, current.length - this.range.endOffset);
			if (this.range.startContainer == this._current)
				(current = current.cloneNode(true)).deleteData(0, this.range.startOffset);
		}
		return current;
	},
	remove: function () {
		// check for partial text nodes
		if (DOMUtils.isDataNode(this._current) &&
		    (this.range.startContainer == this._current || this.range.endContainer == this._current)) {
			var start = this.range.startContainer == this._current ? this.range.startOffset : 0;
			var end = this.range.endContainer == this._current ? this.range.endOffset : this._current.length;
			this._current.deleteData(start, end - start);
		} else
			this._current.parentNode.removeChild(this._current);
	},
	hasPartialSubtree: function () {
		// check if this node be partially selected
		return !DOMUtils.isDataNode(this._current) &&
		    (DOMUtils.isAncestorOrSelf(this._current, this.range.startContainer) ||
		        DOMUtils.isAncestorOrSelf(this._current, this.range.endContainer));
	},
	getSubtreeIterator: function () {
		// create a new range
		var subRange = new DOMRange(this.range._document);
		subRange.selectNodeContents(this._current);
		// handle anchor points
		if (DOMUtils.isAncestorOrSelf(this._current, this.range.startContainer))
			subRange.setStart(this.range.startContainer, this.range.startOffset);
		if (DOMUtils.isAncestorOrSelf(this._current, this.range.endContainer))
			subRange.setEnd(this.range.endContainer, this.range.endOffset);
		// return iterator
		return new RangeIterator(subRange);
	}
};

/*
  DOM Selection
 */
 
//[NOTE] This is a very shallow implementation of the Selection object, based on Webkit's
// implementation and without redundant features. Complete selection manipulation is still
// possible with just removeAllRanges/addRange/getRangeAt.

function DOMSelection(document) {
	// save document parameter
	this._document = document;
	
	// add DOM selection handler
	var selection = this;
	document.attachEvent('onselectionchange', function () { selection._selectionChangeHandler(); });
}

DOMSelection.prototype = {
	// public properties
	rangeCount: 0,
	// private properties
	_document: null,
	
	// private methods
	_selectionChangeHandler: function () {
		// check if there exists a range
		this.rangeCount = this._selectionExists(this._document.selection.createRange()) ? 1 : 0;
	},
	_selectionExists: function (textRange) {
		// checks if a created text range exists or is an editable cursor
		return (textRange.compareEndPoints !== undefined && textRange.compareEndPoints('StartToEnd', textRange) != 0) ||
			(textRange.parentElement !== undefined && textRange.parentElement().isContentEditable);
	},
	
	// public methods
	addRange: function (range) {
		// add range or combine with existing range
		var selection = this._document.selection.createRange(), textRange = TextRangeUtils.convertFromDOMRange(range);
		if (!this._selectionExists(selection))
		{
			// select range
			textRange.select();
		}
		else
		{
			// only modify range if it intersects with current range
			if (textRange.compareEndPoints('StartToStart', selection) == -1)
				if (textRange.compareEndPoints('StartToEnd', selection) > -1 &&
				    textRange.compareEndPoints('EndToEnd', selection) == -1)
					selection.setEndPoint('StartToStart', textRange);
			else
				if (textRange.compareEndPoints('EndToStart', selection) < 1 &&
				    textRange.compareEndPoints('EndToEnd', selection) > -1)
					selection.setEndPoint('EndToEnd', textRange);
			selection.select();
		}
	},
	removeAllRanges: function () {
		// remove all ranges
		this._document.selection.empty();
	},
	getRangeAt: function (index) {
		// return any existing selection, or a cursor position in content editable mode
		var textRange = this._document.selection.createRange();
		if (this._selectionExists(textRange))
			return TextRangeUtils.convertToDOMRange(textRange, this._document);
		return null;
	},
	toString: function () {
		// get selection text
		return this._document.selection.createRange().text;
	}
};

/*
  scripting hooks
 */

document.createRange = function () {
	return new DOMRange(document);
};

var selection = new DOMSelection(document);
window.getSelection = function () {
	return selection;
};

//[TODO] expose DOMRange/DOMSelection to window.?

})();
/*!
 * jQuery JavaScript Library v1.4.2
 * http://jquery.com/
 *
 * Copyright 2010, John Resig
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * Includes Sizzle.js
 * http://sizzlejs.com/
 * Copyright 2010, The Dojo Foundation
 * Released under the MIT, BSD, and GPL Licenses.
 *
 * Date: Sat Feb 13 22:33:48 2010 -0500
 */
(function(A,w){function ma(){if(!c.isReady){try{s.documentElement.doScroll("left")}catch(a){setTimeout(ma,1);return}c.ready()}}function Qa(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function X(a,b,d,f,e,j){var i=a.length;if(typeof b==="object"){for(var o in b)X(a,o,b[o],f,e,d);return a}if(d!==w){f=!j&&f&&c.isFunction(d);for(o=0;o<i;o++)e(a[o],b,f?d.call(a[o],o,e(a[o],b)):d,j);return a}return i?
e(a[0],b):w}function J(){return(new Date).getTime()}function Y(){return false}function Z(){return true}function na(a,b,d){d[0].type=a;return c.event.handle.apply(b,d)}function oa(a){var b,d=[],f=[],e=arguments,j,i,o,k,n,r;i=c.data(this,"events");if(!(a.liveFired===this||!i||!i.live||a.button&&a.type==="click")){a.liveFired=this;var u=i.live.slice(0);for(k=0;k<u.length;k++){i=u[k];i.origType.replace(O,"")===a.type?f.push(i.selector):u.splice(k--,1)}j=c(a.target).closest(f,a.currentTarget);n=0;for(r=
j.length;n<r;n++)for(k=0;k<u.length;k++){i=u[k];if(j[n].selector===i.selector){o=j[n].elem;f=null;if(i.preType==="mouseenter"||i.preType==="mouseleave")f=c(a.relatedTarget).closest(i.selector)[0];if(!f||f!==o)d.push({elem:o,handleObj:i})}}n=0;for(r=d.length;n<r;n++){j=d[n];a.currentTarget=j.elem;a.data=j.handleObj.data;a.handleObj=j.handleObj;if(j.handleObj.origHandler.apply(j.elem,e)===false){b=false;break}}return b}}function pa(a,b){return"live."+(a&&a!=="*"?a+".":"")+b.replace(/\./g,"`").replace(/ /g,
"&")}function qa(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function ra(a,b){var d=0;b.each(function(){if(this.nodeName===(a[d]&&a[d].nodeName)){var f=c.data(a[d++]),e=c.data(this,f);if(f=f&&f.events){delete e.handle;e.events={};for(var j in f)for(var i in f[j])c.event.add(this,j,f[j][i],f[j][i].data)}}})}function sa(a,b,d){var f,e,j;b=b&&b[0]?b[0].ownerDocument||b[0]:s;if(a.length===1&&typeof a[0]==="string"&&a[0].length<512&&b===s&&!ta.test(a[0])&&(c.support.checkClone||!ua.test(a[0]))){e=
true;if(j=c.fragments[a[0]])if(j!==1)f=j}if(!f){f=b.createDocumentFragment();c.clean(a,b,f,d)}if(e)c.fragments[a[0]]=j?f:1;return{fragment:f,cacheable:e}}function K(a,b){var d={};c.each(va.concat.apply([],va.slice(0,b)),function(){d[this]=a});return d}function wa(a){return"scrollTo"in a&&a.document?a:a.nodeType===9?a.defaultView||a.parentWindow:false}var c=function(a,b){return new c.fn.init(a,b)},Ra=A.jQuery,Sa=A.$,s=A.document,T,Ta=/^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,Ua=/^.[^:#\[\.,]*$/,Va=/\S/,
Wa=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,Xa=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,P=navigator.userAgent,xa=false,Q=[],L,$=Object.prototype.toString,aa=Object.prototype.hasOwnProperty,ba=Array.prototype.push,R=Array.prototype.slice,ya=Array.prototype.indexOf;c.fn=c.prototype={init:function(a,b){var d,f;if(!a)return this;if(a.nodeType){this.context=this[0]=a;this.length=1;return this}if(a==="body"&&!b){this.context=s;this[0]=s.body;this.selector="body";this.length=1;return this}if(typeof a==="string")if((d=Ta.exec(a))&&
(d[1]||!b))if(d[1]){f=b?b.ownerDocument||b:s;if(a=Xa.exec(a))if(c.isPlainObject(b)){a=[s.createElement(a[1])];c.fn.attr.call(a,b,true)}else a=[f.createElement(a[1])];else{a=sa([d[1]],[f]);a=(a.cacheable?a.fragment.cloneNode(true):a.fragment).childNodes}return c.merge(this,a)}else{if(b=s.getElementById(d[2])){if(b.id!==d[2])return T.find(a);this.length=1;this[0]=b}this.context=s;this.selector=a;return this}else if(!b&&/^\w+$/.test(a)){this.selector=a;this.context=s;a=s.getElementsByTagName(a);return c.merge(this,
a)}else return!b||b.jquery?(b||T).find(a):c(b).find(a);else if(c.isFunction(a))return T.ready(a);if(a.selector!==w){this.selector=a.selector;this.context=a.context}return c.makeArray(a,this)},selector:"",jquery:"1.4.2",length:0,size:function(){return this.length},toArray:function(){return R.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this.slice(a)[0]:this[a]},pushStack:function(a,b,d){var f=c();c.isArray(a)?ba.apply(f,a):c.merge(f,a);f.prevObject=this;f.context=this.context;if(b===
"find")f.selector=this.selector+(this.selector?" ":"")+d;else if(b)f.selector=this.selector+"."+b+"("+d+")";return f},each:function(a,b){return c.each(this,a,b)},ready:function(a){c.bindReady();if(c.isReady)a.call(s,c);else Q&&Q.push(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(R.apply(this,arguments),"slice",R.call(arguments).join(","))},map:function(a){return this.pushStack(c.map(this,
function(b,d){return a.call(b,d,b)}))},end:function(){return this.prevObject||c(null)},push:ba,sort:[].sort,splice:[].splice};c.fn.init.prototype=c.fn;c.extend=c.fn.extend=function(){var a=arguments[0]||{},b=1,d=arguments.length,f=false,e,j,i,o;if(typeof a==="boolean"){f=a;a=arguments[1]||{};b=2}if(typeof a!=="object"&&!c.isFunction(a))a={};if(d===b){a=this;--b}for(;b<d;b++)if((e=arguments[b])!=null)for(j in e){i=a[j];o=e[j];if(a!==o)if(f&&o&&(c.isPlainObject(o)||c.isArray(o))){i=i&&(c.isPlainObject(i)||
c.isArray(i))?i:c.isArray(o)?[]:{};a[j]=c.extend(f,i,o)}else if(o!==w)a[j]=o}return a};c.extend({noConflict:function(a){A.$=Sa;if(a)A.jQuery=Ra;return c},isReady:false,ready:function(){if(!c.isReady){if(!s.body)return setTimeout(c.ready,13);c.isReady=true;if(Q){for(var a,b=0;a=Q[b++];)a.call(s,c);Q=null}c.fn.triggerHandler&&c(s).triggerHandler("ready")}},bindReady:function(){if(!xa){xa=true;if(s.readyState==="complete")return c.ready();if(s.addEventListener){s.addEventListener("DOMContentLoaded",
L,false);A.addEventListener("load",c.ready,false)}else if(s.attachEvent){s.attachEvent("onreadystatechange",L);A.attachEvent("onload",c.ready);var a=false;try{a=A.frameElement==null}catch(b){}s.documentElement.doScroll&&a&&ma()}}},isFunction:function(a){return $.call(a)==="[object Function]"},isArray:function(a){return $.call(a)==="[object Array]"},isPlainObject:function(a){if(!a||$.call(a)!=="[object Object]"||a.nodeType||a.setInterval)return false;if(a.constructor&&!aa.call(a,"constructor")&&!aa.call(a.constructor.prototype,
"isPrototypeOf"))return false;var b;for(b in a);return b===w||aa.call(a,b)},isEmptyObject:function(a){for(var b in a)return false;return true},error:function(a){throw a;},parseJSON:function(a){if(typeof a!=="string"||!a)return null;a=c.trim(a);if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return A.JSON&&A.JSON.parse?A.JSON.parse(a):(new Function("return "+
a))();else c.error("Invalid JSON: "+a)},noop:function(){},globalEval:function(a){if(a&&Va.test(a)){var b=s.getElementsByTagName("head")[0]||s.documentElement,d=s.createElement("script");d.type="text/javascript";if(c.support.scriptEval)d.appendChild(s.createTextNode(a));else d.text=a;b.insertBefore(d,b.firstChild);b.removeChild(d)}},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,b,d){var f,e=0,j=a.length,i=j===w||c.isFunction(a);if(d)if(i)for(f in a){if(b.apply(a[f],
d)===false)break}else for(;e<j;){if(b.apply(a[e++],d)===false)break}else if(i)for(f in a){if(b.call(a[f],f,a[f])===false)break}else for(d=a[0];e<j&&b.call(d,e,d)!==false;d=a[++e]);return a},trim:function(a){return(a||"").replace(Wa,"")},makeArray:function(a,b){b=b||[];if(a!=null)a.length==null||typeof a==="string"||c.isFunction(a)||typeof a!=="function"&&a.setInterval?ba.call(b,a):c.merge(b,a);return b},inArray:function(a,b){if(b.indexOf)return b.indexOf(a);for(var d=0,f=b.length;d<f;d++)if(b[d]===
a)return d;return-1},merge:function(a,b){var d=a.length,f=0;if(typeof b.length==="number")for(var e=b.length;f<e;f++)a[d++]=b[f];else for(;b[f]!==w;)a[d++]=b[f++];a.length=d;return a},grep:function(a,b,d){for(var f=[],e=0,j=a.length;e<j;e++)!d!==!b(a[e],e)&&f.push(a[e]);return f},map:function(a,b,d){for(var f=[],e,j=0,i=a.length;j<i;j++){e=b(a[j],j,d);if(e!=null)f[f.length]=e}return f.concat.apply([],f)},guid:1,proxy:function(a,b,d){if(arguments.length===2)if(typeof b==="string"){d=a;a=d[b];b=w}else if(b&&
!c.isFunction(b)){d=b;b=w}if(!b&&a)b=function(){return a.apply(d||this,arguments)};if(a)b.guid=a.guid=a.guid||b.guid||c.guid++;return b},uaMatch:function(a){a=a.toLowerCase();a=/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version)?[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||!/compatible/.test(a)&&/(mozilla)(?:.*? rv:([\w.]+))?/.exec(a)||[];return{browser:a[1]||"",version:a[2]||"0"}},browser:{}});P=c.uaMatch(P);if(P.browser){c.browser[P.browser]=true;c.browser.version=P.version}if(c.browser.webkit)c.browser.safari=
true;if(ya)c.inArray=function(a,b){return ya.call(b,a)};T=c(s);if(s.addEventListener)L=function(){s.removeEventListener("DOMContentLoaded",L,false);c.ready()};else if(s.attachEvent)L=function(){if(s.readyState==="complete"){s.detachEvent("onreadystatechange",L);c.ready()}};(function(){c.support={};var a=s.documentElement,b=s.createElement("script"),d=s.createElement("div"),f="script"+J();d.style.display="none";d.innerHTML="   <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
var e=d.getElementsByTagName("*"),j=d.getElementsByTagName("a")[0];if(!(!e||!e.length||!j)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(j.getAttribute("style")),hrefNormalized:j.getAttribute("href")==="/a",opacity:/^0.55$/.test(j.style.opacity),cssFloat:!!j.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:s.createElement("select").appendChild(s.createElement("option")).selected,
parentNode:d.removeChild(d.appendChild(s.createElement("div"))).parentNode===null,deleteExpando:true,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null};b.type="text/javascript";try{b.appendChild(s.createTextNode("window."+f+"=1;"))}catch(i){}a.insertBefore(b,a.firstChild);if(A[f]){c.support.scriptEval=true;delete A[f]}try{delete b.test}catch(o){c.support.deleteExpando=false}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function k(){c.support.noCloneEvent=
false;d.detachEvent("onclick",k)});d.cloneNode(true).fireEvent("onclick")}d=s.createElement("div");d.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";a=s.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var k=s.createElement("div");k.style.width=k.style.paddingLeft="1px";s.body.appendChild(k);c.boxModel=c.support.boxModel=k.offsetWidth===2;s.body.removeChild(k).style.display="none"});a=function(k){var n=
s.createElement("div");k="on"+k;var r=k in n;if(!r){n.setAttribute(k,"return;");r=typeof n[k]==="function"}return r};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=e=j=null}})();c.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var G="jQuery"+J(),Ya=0,za={};c.extend({cache:{},expando:G,noData:{embed:true,object:true,
applet:true},data:function(a,b,d){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var f=a[G],e=c.cache;if(!f&&typeof b==="string"&&d===w)return null;f||(f=++Ya);if(typeof b==="object"){a[G]=f;e[f]=c.extend(true,{},b)}else if(!e[f]){a[G]=f;e[f]={}}a=e[f];if(d!==w)a[b]=d;return typeof b==="string"?a[b]:a}},removeData:function(a,b){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var d=a[G],f=c.cache,e=f[d];if(b){if(e){delete e[b];c.isEmptyObject(e)&&c.removeData(a)}}else{if(c.support.deleteExpando)delete a[c.expando];
else a.removeAttribute&&a.removeAttribute(c.expando);delete f[d]}}}});c.fn.extend({data:function(a,b){if(typeof a==="undefined"&&this.length)return c.data(this[0]);else if(typeof a==="object")return this.each(function(){c.data(this,a)});var d=a.split(".");d[1]=d[1]?"."+d[1]:"";if(b===w){var f=this.triggerHandler("getData"+d[1]+"!",[d[0]]);if(f===w&&this.length)f=c.data(this[0],a);return f===w&&d[1]?this.data(d[0]):f}else return this.trigger("setData"+d[1]+"!",[d[0],b]).each(function(){c.data(this,
a,b)})},removeData:function(a){return this.each(function(){c.removeData(this,a)})}});c.extend({queue:function(a,b,d){if(a){b=(b||"fx")+"queue";var f=c.data(a,b);if(!d)return f||[];if(!f||c.isArray(d))f=c.data(a,b,c.makeArray(d));else f.push(d);return f}},dequeue:function(a,b){b=b||"fx";var d=c.queue(a,b),f=d.shift();if(f==="inprogress")f=d.shift();if(f){b==="fx"&&d.unshift("inprogress");f.call(a,function(){c.dequeue(a,b)})}}});c.fn.extend({queue:function(a,b){if(typeof a!=="string"){b=a;a="fx"}if(b===
w)return c.queue(this[0],a);return this.each(function(){var d=c.queue(this,a,b);a==="fx"&&d[0]!=="inprogress"&&c.dequeue(this,a)})},dequeue:function(a){return this.each(function(){c.dequeue(this,a)})},delay:function(a,b){a=c.fx?c.fx.speeds[a]||a:a;b=b||"fx";return this.queue(b,function(){var d=this;setTimeout(function(){c.dequeue(d,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var Aa=/[\n\t]/g,ca=/\s+/,Za=/\r/g,$a=/href|src|style/,ab=/(button|input)/i,bb=/(button|input|object|select|textarea)/i,
cb=/^(a|area)$/i,Ba=/radio|checkbox/;c.fn.extend({attr:function(a,b){return X(this,a,b,true,c.attr)},removeAttr:function(a){return this.each(function(){c.attr(this,a,"");this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(c.isFunction(a))return this.each(function(n){var r=c(this);r.addClass(a.call(this,n,r.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(ca),d=0,f=this.length;d<f;d++){var e=this[d];if(e.nodeType===1)if(e.className){for(var j=" "+e.className+" ",
i=e.className,o=0,k=b.length;o<k;o++)if(j.indexOf(" "+b[o]+" ")<0)i+=" "+b[o];e.className=c.trim(i)}else e.className=a}return this},removeClass:function(a){if(c.isFunction(a))return this.each(function(k){var n=c(this);n.removeClass(a.call(this,k,n.attr("class")))});if(a&&typeof a==="string"||a===w)for(var b=(a||"").split(ca),d=0,f=this.length;d<f;d++){var e=this[d];if(e.nodeType===1&&e.className)if(a){for(var j=(" "+e.className+" ").replace(Aa," "),i=0,o=b.length;i<o;i++)j=j.replace(" "+b[i]+" ",
" ");e.className=c.trim(j)}else e.className=""}return this},toggleClass:function(a,b){var d=typeof a,f=typeof b==="boolean";if(c.isFunction(a))return this.each(function(e){var j=c(this);j.toggleClass(a.call(this,e,j.attr("class"),b),b)});return this.each(function(){if(d==="string")for(var e,j=0,i=c(this),o=b,k=a.split(ca);e=k[j++];){o=f?o:!i.hasClass(e);i[o?"addClass":"removeClass"](e)}else if(d==="undefined"||d==="boolean"){this.className&&c.data(this,"__className__",this.className);this.className=
this.className||a===false?"":c.data(this,"__className__")||""}})},hasClass:function(a){a=" "+a+" ";for(var b=0,d=this.length;b<d;b++)if((" "+this[b].className+" ").replace(Aa," ").indexOf(a)>-1)return true;return false},val:function(a){if(a===w){var b=this[0];if(b){if(c.nodeName(b,"option"))return(b.attributes.value||{}).specified?b.value:b.text;if(c.nodeName(b,"select")){var d=b.selectedIndex,f=[],e=b.options;b=b.type==="select-one";if(d<0)return null;var j=b?d:0;for(d=b?d+1:e.length;j<d;j++){var i=
e[j];if(i.selected){a=c(i).val();if(b)return a;f.push(a)}}return f}if(Ba.test(b.type)&&!c.support.checkOn)return b.getAttribute("value")===null?"on":b.value;return(b.value||"").replace(Za,"")}return w}var o=c.isFunction(a);return this.each(function(k){var n=c(this),r=a;if(this.nodeType===1){if(o)r=a.call(this,k,n.val());if(typeof r==="number")r+="";if(c.isArray(r)&&Ba.test(this.type))this.checked=c.inArray(n.val(),r)>=0;else if(c.nodeName(this,"select")){var u=c.makeArray(r);c("option",this).each(function(){this.selected=
c.inArray(c(this).val(),u)>=0});if(!u.length)this.selectedIndex=-1}else this.value=r}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(a,b,d,f){if(!a||a.nodeType===3||a.nodeType===8)return w;if(f&&b in c.attrFn)return c(a)[b](d);f=a.nodeType!==1||!c.isXMLDoc(a);var e=d!==w;b=f&&c.props[b]||b;if(a.nodeType===1){var j=$a.test(b);if(b in a&&f&&!j){if(e){b==="type"&&ab.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed");
a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&&b.specified?b.value:bb.test(a.nodeName)||cb.test(a.nodeName)&&a.href?0:w;return a[b]}if(!c.support.style&&f&&b==="style"){if(e)a.style.cssText=""+d;return a.style.cssText}e&&a.setAttribute(b,""+d);a=!c.support.hrefNormalized&&f&&j?a.getAttribute(b,2):a.getAttribute(b);return a===null?w:a}return c.style(a,b,d)}});var O=/\.(.*)$/,db=function(a){return a.replace(/[^\w\s\.\|`]/g,
function(b){return"\\"+b})};c.event={add:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){if(a.setInterval&&a!==A&&!a.frameElement)a=A;var e,j;if(d.handler){e=d;d=e.handler}if(!d.guid)d.guid=c.guid++;if(j=c.data(a)){var i=j.events=j.events||{},o=j.handle;if(!o)j.handle=o=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(o.elem,arguments):w};o.elem=a;b=b.split(" ");for(var k,n=0,r;k=b[n++];){j=e?c.extend({},e):{handler:d,data:f};if(k.indexOf(".")>-1){r=k.split(".");
k=r.shift();j.namespace=r.slice(0).sort().join(".")}else{r=[];j.namespace=""}j.type=k;j.guid=d.guid;var u=i[k],z=c.event.special[k]||{};if(!u){u=i[k]=[];if(!z.setup||z.setup.call(a,f,r,o)===false)if(a.addEventListener)a.addEventListener(k,o,false);else a.attachEvent&&a.attachEvent("on"+k,o)}if(z.add){z.add.call(a,j);if(!j.handler.guid)j.handler.guid=d.guid}u.push(j);c.event.global[k]=true}a=null}}},global:{},remove:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){var e,j=0,i,o,k,n,r,u,z=c.data(a),
C=z&&z.events;if(z&&C){if(b&&b.type){d=b.handler;b=b.type}if(!b||typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(e in C)c.event.remove(a,e+b)}else{for(b=b.split(" ");e=b[j++];){n=e;i=e.indexOf(".")<0;o=[];if(!i){o=e.split(".");e=o.shift();k=new RegExp("(^|\\.)"+c.map(o.slice(0).sort(),db).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(r=C[e])if(d){n=c.event.special[e]||{};for(B=f||0;B<r.length;B++){u=r[B];if(d.guid===u.guid){if(i||k.test(u.namespace)){f==null&&r.splice(B--,1);n.remove&&n.remove.call(a,u)}if(f!=
null)break}}if(r.length===0||f!=null&&r.length===1){if(!n.teardown||n.teardown.call(a,o)===false)Ca(a,e,z.handle);delete C[e]}}else for(var B=0;B<r.length;B++){u=r[B];if(i||k.test(u.namespace)){c.event.remove(a,n,u.handler,B);r.splice(B--,1)}}}if(c.isEmptyObject(C)){if(b=z.handle)b.elem=null;delete z.events;delete z.handle;c.isEmptyObject(z)&&c.removeData(a)}}}}},trigger:function(a,b,d,f){var e=a.type||a;if(!f){a=typeof a==="object"?a[G]?a:c.extend(c.Event(e),a):c.Event(e);if(e.indexOf("!")>=0){a.type=
e=e.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();c.event.global[e]&&c.each(c.cache,function(){this.events&&this.events[e]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType===8)return w;a.result=w;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(f=c.data(d,"handle"))&&f.apply(d,b);f=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+e]&&d["on"+e].apply(d,b)===false)a.result=false}catch(j){}if(!a.isPropagationStopped()&&
f)c.event.trigger(a,b,f,true);else if(!a.isDefaultPrevented()){f=a.target;var i,o=c.nodeName(f,"a")&&e==="click",k=c.event.special[e]||{};if((!k._default||k._default.call(d,a)===false)&&!o&&!(f&&f.nodeName&&c.noData[f.nodeName.toLowerCase()])){try{if(f[e]){if(i=f["on"+e])f["on"+e]=null;c.event.triggered=true;f[e]()}}catch(n){}if(i)f["on"+e]=i;c.event.triggered=false}}},handle:function(a){var b,d,f,e;a=arguments[0]=c.event.fix(a||A.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive;
if(!b){d=a.type.split(".");a.type=d.shift();f=new RegExp("(^|\\.)"+d.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)")}e=c.data(this,"events");d=e[a.type];if(e&&d){d=d.slice(0);e=0;for(var j=d.length;e<j;e++){var i=d[e];if(b||f.test(i.namespace)){a.handler=i.handler;a.data=i.data;a.handleObj=i;i=i.handler.apply(this,arguments);if(i!==w){a.result=i;if(i===false){a.preventDefault();a.stopPropagation()}}if(a.isImmediatePropagationStopped())break}}}return a.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
fix:function(a){if(a[G])return a;var b=a;a=c.Event(b);for(var d=this.props.length,f;d;){f=this.props[--d];a[f]=b[f]}if(!a.target)a.target=a.srcElement||s;if(a.target.nodeType===3)a.target=a.target.parentNode;if(!a.relatedTarget&&a.fromElement)a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement;if(a.pageX==null&&a.clientX!=null){b=s.documentElement;d=s.body;a.pageX=a.clientX+(b&&b.scrollLeft||d&&d.scrollLeft||0)-(b&&b.clientLeft||d&&d.clientLeft||0);a.pageY=a.clientY+(b&&b.scrollTop||
d&&d.scrollTop||0)-(b&&b.clientTop||d&&d.clientTop||0)}if(!a.which&&(a.charCode||a.charCode===0?a.charCode:a.keyCode))a.which=a.charCode||a.keyCode;if(!a.metaKey&&a.ctrlKey)a.metaKey=a.ctrlKey;if(!a.which&&a.button!==w)a.which=a.button&1?1:a.button&2?3:a.button&4?2:0;return a},guid:1E8,proxy:c.proxy,special:{ready:{setup:c.bindReady,teardown:c.noop},live:{add:function(a){c.event.add(this,a.origType,c.extend({},a,{handler:oa}))},remove:function(a){var b=true,d=a.origType.replace(O,"");c.each(c.data(this,
"events").live||[],function(){if(d===this.origType.replace(O,""))return b=false});b&&c.event.remove(this,a.origType,oa)}},beforeunload:{setup:function(a,b,d){if(this.setInterval)this.onbeforeunload=d;return false},teardown:function(a,b){if(this.onbeforeunload===b)this.onbeforeunload=null}}}};var Ca=s.removeEventListener?function(a,b,d){a.removeEventListener(b,d,false)}:function(a,b,d){a.detachEvent("on"+b,d)};c.Event=function(a){if(!this.preventDefault)return new c.Event(a);if(a&&a.type){this.originalEvent=
a;this.type=a.type}else this.type=a;this.timeStamp=J();this[G]=true};c.Event.prototype={preventDefault:function(){this.isDefaultPrevented=Z;var a=this.originalEvent;if(a){a.preventDefault&&a.preventDefault();a.returnValue=false}},stopPropagation:function(){this.isPropagationStopped=Z;var a=this.originalEvent;if(a){a.stopPropagation&&a.stopPropagation();a.cancelBubble=true}},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=Z;this.stopPropagation()},isDefaultPrevented:Y,isPropagationStopped:Y,
isImmediatePropagationStopped:Y};var Da=function(a){var b=a.relatedTarget;try{for(;b&&b!==this;)b=b.parentNode;if(b!==this){a.type=a.data;c.event.handle.apply(this,arguments)}}catch(d){}},Ea=function(a){a.type=a.data;c.event.handle.apply(this,arguments)};c.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){c.event.special[a]={setup:function(d){c.event.add(this,b,d&&d.selector?Ea:Da,a)},teardown:function(d){c.event.remove(this,b,d&&d.selector?Ea:Da)}}});if(!c.support.submitBubbles)c.event.special.submit=
{setup:function(){if(this.nodeName.toLowerCase()!=="form"){c.event.add(this,"click.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="submit"||d==="image")&&c(b).closest("form").length)return na("submit",this,arguments)});c.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="text"||d==="password")&&c(b).closest("form").length&&a.keyCode===13)return na("submit",this,arguments)})}else return false},teardown:function(){c.event.remove(this,".specialSubmit")}};
if(!c.support.changeBubbles){var da=/textarea|input|select/i,ea,Fa=function(a){var b=a.type,d=a.value;if(b==="radio"||b==="checkbox")d=a.checked;else if(b==="select-multiple")d=a.selectedIndex>-1?c.map(a.options,function(f){return f.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},fa=function(a,b){var d=a.target,f,e;if(!(!da.test(d.nodeName)||d.readOnly)){f=c.data(d,"_change_data");e=Fa(d);if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data",
e);if(!(f===w||e===f))if(f!=null||e){a.type="change";return c.event.trigger(a,b,d)}}};c.event.special.change={filters:{focusout:fa,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return fa.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return fa.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a,
"_change_data",Fa(a))}},setup:function(){if(this.type==="file")return false;for(var a in ea)c.event.add(this,a+".specialChange",ea[a]);return da.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return da.test(this.nodeName)}};ea=c.event.special.change.filters}s.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(f){f=c.event.fix(f);f.type=b;return c.event.handle.call(this,f)}c.event.special[b]={setup:function(){this.addEventListener(a,
d,true)},teardown:function(){this.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,f,e){if(typeof d==="object"){for(var j in d)this[b](j,f,d[j],e);return this}if(c.isFunction(f)){e=f;f=w}var i=b==="one"?c.proxy(e,function(k){c(this).unbind(k,i);return e.apply(this,arguments)}):e;if(d==="unload"&&b!=="one")this.one(d,f,e);else{j=0;for(var o=this.length;j<o;j++)c.event.add(this[j],d,i,f)}return this}});c.fn.extend({unbind:function(a,b){if(typeof a==="object"&&
!a.preventDefault)for(var d in a)this.unbind(d,a[d]);else{d=0;for(var f=this.length;d<f;d++)c.event.remove(this[d],a,b)}return this},delegate:function(a,b,d,f){return this.live(b,d,f,a)},undelegate:function(a,b,d){return arguments.length===0?this.unbind("live"):this.die(b,null,d,a)},trigger:function(a,b){return this.each(function(){c.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0]){a=c.Event(a);a.preventDefault();a.stopPropagation();c.event.trigger(a,b,this[0]);return a.result}},
toggle:function(a){for(var b=arguments,d=1;d<b.length;)c.proxy(a,b[d++]);return this.click(c.proxy(a,function(f){var e=(c.data(this,"lastToggle"+a.guid)||0)%d;c.data(this,"lastToggle"+a.guid,e+1);f.preventDefault();return b[e].apply(this,arguments)||false}))},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var Ga={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};c.each(["live","die"],function(a,b){c.fn[b]=function(d,f,e,j){var i,o=0,k,n,r=j||this.selector,
u=j?this:c(this.context);if(c.isFunction(f)){e=f;f=w}for(d=(d||"").split(" ");(i=d[o++])!=null;){j=O.exec(i);k="";if(j){k=j[0];i=i.replace(O,"")}if(i==="hover")d.push("mouseenter"+k,"mouseleave"+k);else{n=i;if(i==="focus"||i==="blur"){d.push(Ga[i]+k);i+=k}else i=(Ga[i]||i)+k;b==="live"?u.each(function(){c.event.add(this,pa(i,r),{data:f,selector:r,handler:e,origType:i,origHandler:e,preType:n})}):u.unbind(pa(i,r),e)}}return this}});c.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),
function(a,b){c.fn[b]=function(d){return d?this.bind(b,d):this.trigger(b)};if(c.attrFn)c.attrFn[b]=true});A.attachEvent&&!A.addEventListener&&A.attachEvent("onunload",function(){for(var a in c.cache)if(c.cache[a].handle)try{c.event.remove(c.cache[a].handle.elem)}catch(b){}});(function(){function a(g){for(var h="",l,m=0;g[m];m++){l=g[m];if(l.nodeType===3||l.nodeType===4)h+=l.nodeValue;else if(l.nodeType!==8)h+=a(l.childNodes)}return h}function b(g,h,l,m,q,p){q=0;for(var v=m.length;q<v;q++){var t=m[q];
if(t){t=t[g];for(var y=false;t;){if(t.sizcache===l){y=m[t.sizset];break}if(t.nodeType===1&&!p){t.sizcache=l;t.sizset=q}if(t.nodeName.toLowerCase()===h){y=t;break}t=t[g]}m[q]=y}}}function d(g,h,l,m,q,p){q=0;for(var v=m.length;q<v;q++){var t=m[q];if(t){t=t[g];for(var y=false;t;){if(t.sizcache===l){y=m[t.sizset];break}if(t.nodeType===1){if(!p){t.sizcache=l;t.sizset=q}if(typeof h!=="string"){if(t===h){y=true;break}}else if(k.filter(h,[t]).length>0){y=t;break}}t=t[g]}m[q]=y}}}var f=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
e=0,j=Object.prototype.toString,i=false,o=true;[0,0].sort(function(){o=false;return 0});var k=function(g,h,l,m){l=l||[];var q=h=h||s;if(h.nodeType!==1&&h.nodeType!==9)return[];if(!g||typeof g!=="string")return l;for(var p=[],v,t,y,S,H=true,M=x(h),I=g;(f.exec(""),v=f.exec(I))!==null;){I=v[3];p.push(v[1]);if(v[2]){S=v[3];break}}if(p.length>1&&r.exec(g))if(p.length===2&&n.relative[p[0]])t=ga(p[0]+p[1],h);else for(t=n.relative[p[0]]?[h]:k(p.shift(),h);p.length;){g=p.shift();if(n.relative[g])g+=p.shift();
t=ga(g,t)}else{if(!m&&p.length>1&&h.nodeType===9&&!M&&n.match.ID.test(p[0])&&!n.match.ID.test(p[p.length-1])){v=k.find(p.shift(),h,M);h=v.expr?k.filter(v.expr,v.set)[0]:v.set[0]}if(h){v=m?{expr:p.pop(),set:z(m)}:k.find(p.pop(),p.length===1&&(p[0]==="~"||p[0]==="+")&&h.parentNode?h.parentNode:h,M);t=v.expr?k.filter(v.expr,v.set):v.set;if(p.length>0)y=z(t);else H=false;for(;p.length;){var D=p.pop();v=D;if(n.relative[D])v=p.pop();else D="";if(v==null)v=h;n.relative[D](y,v,M)}}else y=[]}y||(y=t);y||k.error(D||
g);if(j.call(y)==="[object Array]")if(H)if(h&&h.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&E(h,y[g])))l.push(t[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&l.push(t[g]);else l.push.apply(l,y);else z(y,l);if(S){k(S,q,l,m);k.uniqueSort(l)}return l};k.uniqueSort=function(g){if(B){i=o;g.sort(B);if(i)for(var h=1;h<g.length;h++)g[h]===g[h-1]&&g.splice(h--,1)}return g};k.matches=function(g,h){return k(g,null,null,h)};k.find=function(g,h,l){var m,q;if(!g)return[];
for(var p=0,v=n.order.length;p<v;p++){var t=n.order[p];if(q=n.leftMatch[t].exec(g)){var y=q[1];q.splice(1,1);if(y.substr(y.length-1)!=="\\"){q[1]=(q[1]||"").replace(/\\/g,"");m=n.find[t](q,h,l);if(m!=null){g=g.replace(n.match[t],"");break}}}}m||(m=h.getElementsByTagName("*"));return{set:m,expr:g}};k.filter=function(g,h,l,m){for(var q=g,p=[],v=h,t,y,S=h&&h[0]&&x(h[0]);g&&h.length;){for(var H in n.filter)if((t=n.leftMatch[H].exec(g))!=null&&t[2]){var M=n.filter[H],I,D;D=t[1];y=false;t.splice(1,1);if(D.substr(D.length-
1)!=="\\"){if(v===p)p=[];if(n.preFilter[H])if(t=n.preFilter[H](t,v,l,p,m,S)){if(t===true)continue}else y=I=true;if(t)for(var U=0;(D=v[U])!=null;U++)if(D){I=M(D,t,U,v);var Ha=m^!!I;if(l&&I!=null)if(Ha)y=true;else v[U]=false;else if(Ha){p.push(D);y=true}}if(I!==w){l||(v=p);g=g.replace(n.match[H],"");if(!y)return[];break}}}if(g===q)if(y==null)k.error(g);else break;q=g}return v};k.error=function(g){throw"Syntax error, unrecognized expression: "+g;};var n=k.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\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(g){return g.getAttribute("href")}},
relative:{"+":function(g,h){var l=typeof h==="string",m=l&&!/\W/.test(h);l=l&&!m;if(m)h=h.toLowerCase();m=0;for(var q=g.length,p;m<q;m++)if(p=g[m]){for(;(p=p.previousSibling)&&p.nodeType!==1;);g[m]=l||p&&p.nodeName.toLowerCase()===h?p||false:p===h}l&&k.filter(h,g,true)},">":function(g,h){var l=typeof h==="string";if(l&&!/\W/.test(h)){h=h.toLowerCase();for(var m=0,q=g.length;m<q;m++){var p=g[m];if(p){l=p.parentNode;g[m]=l.nodeName.toLowerCase()===h?l:false}}}else{m=0;for(q=g.length;m<q;m++)if(p=g[m])g[m]=
l?p.parentNode:p.parentNode===h;l&&k.filter(h,g,true)}},"":function(g,h,l){var m=e++,q=d;if(typeof h==="string"&&!/\W/.test(h)){var p=h=h.toLowerCase();q=b}q("parentNode",h,m,g,p,l)},"~":function(g,h,l){var m=e++,q=d;if(typeof h==="string"&&!/\W/.test(h)){var p=h=h.toLowerCase();q=b}q("previousSibling",h,m,g,p,l)}},find:{ID:function(g,h,l){if(typeof h.getElementById!=="undefined"&&!l)return(g=h.getElementById(g[1]))?[g]:[]},NAME:function(g,h){if(typeof h.getElementsByName!=="undefined"){var l=[];
h=h.getElementsByName(g[1]);for(var m=0,q=h.length;m<q;m++)h[m].getAttribute("name")===g[1]&&l.push(h[m]);return l.length===0?null:l}},TAG:function(g,h){return h.getElementsByTagName(g[1])}},preFilter:{CLASS:function(g,h,l,m,q,p){g=" "+g[1].replace(/\\/g,"")+" ";if(p)return g;p=0;for(var v;(v=h[p])!=null;p++)if(v)if(q^(v.className&&(" "+v.className+" ").replace(/[\t\n]/g," ").indexOf(g)>=0))l||m.push(v);else if(l)h[p]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()},
CHILD:function(g){if(g[1]==="nth"){var h=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=h[1]+(h[2]||1)-0;g[3]=h[3]-0}g[0]=e++;return g},ATTR:function(g,h,l,m,q,p){h=g[1].replace(/\\/g,"");if(!p&&n.attrMap[h])g[1]=n.attrMap[h];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,h,l,m,q){if(g[1]==="not")if((f.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=k(g[3],null,null,h);else{g=k.filter(g[3],h,l,true^q);l||m.push.apply(m,
g);return false}else if(n.match.POS.test(g[0])||n.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled===true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,h,l){return!!k(l[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)},
text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"===g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}},
setFilters:{first:function(g,h){return h===0},last:function(g,h,l,m){return h===m.length-1},even:function(g,h){return h%2===0},odd:function(g,h){return h%2===1},lt:function(g,h,l){return h<l[3]-0},gt:function(g,h,l){return h>l[3]-0},nth:function(g,h,l){return l[3]-0===h},eq:function(g,h,l){return l[3]-0===h}},filter:{PSEUDO:function(g,h,l,m){var q=h[1],p=n.filters[q];if(p)return p(g,l,h,m);else if(q==="contains")return(g.textContent||g.innerText||a([g])||"").indexOf(h[3])>=0;else if(q==="not"){h=
h[3];l=0;for(m=h.length;l<m;l++)if(h[l]===g)return false;return true}else k.error("Syntax error, unrecognized expression: "+q)},CHILD:function(g,h){var l=h[1],m=g;switch(l){case "only":case "first":for(;m=m.previousSibling;)if(m.nodeType===1)return false;if(l==="first")return true;m=g;case "last":for(;m=m.nextSibling;)if(m.nodeType===1)return false;return true;case "nth":l=h[2];var q=h[3];if(l===1&&q===0)return true;h=h[0];var p=g.parentNode;if(p&&(p.sizcache!==h||!g.nodeIndex)){var v=0;for(m=p.firstChild;m;m=
m.nextSibling)if(m.nodeType===1)m.nodeIndex=++v;p.sizcache=h}g=g.nodeIndex-q;return l===0?g===0:g%l===0&&g/l>=0}},ID:function(g,h){return g.nodeType===1&&g.getAttribute("id")===h},TAG:function(g,h){return h==="*"&&g.nodeType===1||g.nodeName.toLowerCase()===h},CLASS:function(g,h){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(h)>-1},ATTR:function(g,h){var l=h[1];g=n.attrHandle[l]?n.attrHandle[l](g):g[l]!=null?g[l]:g.getAttribute(l);l=g+"";var m=h[2];h=h[4];return g==null?m==="!=":m===
"="?l===h:m==="*="?l.indexOf(h)>=0:m==="~="?(" "+l+" ").indexOf(h)>=0:!h?l&&g!==false:m==="!="?l!==h:m==="^="?l.indexOf(h)===0:m==="$="?l.substr(l.length-h.length)===h:m==="|="?l===h||l.substr(0,h.length+1)===h+"-":false},POS:function(g,h,l,m){var q=n.setFilters[h[2]];if(q)return q(g,l,h,m)}}},r=n.match.POS;for(var u in n.match){n.match[u]=new RegExp(n.match[u].source+/(?![^\[]*\])(?![^\(]*\))/.source);n.leftMatch[u]=new RegExp(/(^(?:.|\r|\n)*?)/.source+n.match[u].source.replace(/\\(\d+)/g,function(g,
h){return"\\"+(h-0+1)}))}var z=function(g,h){g=Array.prototype.slice.call(g,0);if(h){h.push.apply(h,g);return h}return g};try{Array.prototype.slice.call(s.documentElement.childNodes,0)}catch(C){z=function(g,h){h=h||[];if(j.call(g)==="[object Array]")Array.prototype.push.apply(h,g);else if(typeof g.length==="number")for(var l=0,m=g.length;l<m;l++)h.push(g[l]);else for(l=0;g[l];l++)h.push(g[l]);return h}}var B;if(s.documentElement.compareDocumentPosition)B=function(g,h){if(!g.compareDocumentPosition||
!h.compareDocumentPosition){if(g==h)i=true;return g.compareDocumentPosition?-1:1}g=g.compareDocumentPosition(h)&4?-1:g===h?0:1;if(g===0)i=true;return g};else if("sourceIndex"in s.documentElement)B=function(g,h){if(!g.sourceIndex||!h.sourceIndex){if(g==h)i=true;return g.sourceIndex?-1:1}g=g.sourceIndex-h.sourceIndex;if(g===0)i=true;return g};else if(s.createRange)B=function(g,h){if(!g.ownerDocument||!h.ownerDocument){if(g==h)i=true;return g.ownerDocument?-1:1}var l=g.ownerDocument.createRange(),m=
h.ownerDocument.createRange();l.setStart(g,0);l.setEnd(g,0);m.setStart(h,0);m.setEnd(h,0);g=l.compareBoundaryPoints(Range.START_TO_END,m);if(g===0)i=true;return g};(function(){var g=s.createElement("div"),h="script"+(new Date).getTime();g.innerHTML="<a name='"+h+"'/>";var l=s.documentElement;l.insertBefore(g,l.firstChild);if(s.getElementById(h)){n.find.ID=function(m,q,p){if(typeof q.getElementById!=="undefined"&&!p)return(q=q.getElementById(m[1]))?q.id===m[1]||typeof q.getAttributeNode!=="undefined"&&
q.getAttributeNode("id").nodeValue===m[1]?[q]:w:[]};n.filter.ID=function(m,q){var p=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&p&&p.nodeValue===q}}l.removeChild(g);l=g=null})();(function(){var g=s.createElement("div");g.appendChild(s.createComment(""));if(g.getElementsByTagName("*").length>0)n.find.TAG=function(h,l){l=l.getElementsByTagName(h[1]);if(h[1]==="*"){h=[];for(var m=0;l[m];m++)l[m].nodeType===1&&h.push(l[m]);l=h}return l};g.innerHTML="<a href='#'></a>";
if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")n.attrHandle.href=function(h){return h.getAttribute("href",2)};g=null})();s.querySelectorAll&&function(){var g=k,h=s.createElement("div");h.innerHTML="<p class='TEST'></p>";if(!(h.querySelectorAll&&h.querySelectorAll(".TEST").length===0)){k=function(m,q,p,v){q=q||s;if(!v&&q.nodeType===9&&!x(q))try{return z(q.querySelectorAll(m),p)}catch(t){}return g(m,q,p,v)};for(var l in g)k[l]=g[l];h=null}}();
(function(){var g=s.createElement("div");g.innerHTML="<div class='test e'></div><div class='test'></div>";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){n.order.splice(1,0,"CLASS");n.find.CLASS=function(h,l,m){if(typeof l.getElementsByClassName!=="undefined"&&!m)return l.getElementsByClassName(h[1])};g=null}}})();var E=s.compareDocumentPosition?function(g,h){return!!(g.compareDocumentPosition(h)&16)}:
function(g,h){return g!==h&&(g.contains?g.contains(h):true)},x=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false},ga=function(g,h){var l=[],m="",q;for(h=h.nodeType?[h]:h;q=n.match.PSEUDO.exec(g);){m+=q[0];g=g.replace(n.match.PSEUDO,"")}g=n.relative[g]?g+"*":g;q=0;for(var p=h.length;q<p;q++)k(g,h[q],l);return k.filter(m,l)};c.find=k;c.expr=k.selectors;c.expr[":"]=c.expr.filters;c.unique=k.uniqueSort;c.text=a;c.isXMLDoc=x;c.contains=E})();var eb=/Until$/,fb=/^(?:parents|prevUntil|prevAll)/,
gb=/,/;R=Array.prototype.slice;var Ia=function(a,b,d){if(c.isFunction(b))return c.grep(a,function(e,j){return!!b.call(e,j,e)===d});else if(b.nodeType)return c.grep(a,function(e){return e===b===d});else if(typeof b==="string"){var f=c.grep(a,function(e){return e.nodeType===1});if(Ua.test(b))return c.filter(b,f,!d);else b=c.filter(b,f)}return c.grep(a,function(e){return c.inArray(e,b)>=0===d})};c.fn.extend({find:function(a){for(var b=this.pushStack("","find",a),d=0,f=0,e=this.length;f<e;f++){d=b.length;
c.find(a,this[f],b);if(f>0)for(var j=d;j<b.length;j++)for(var i=0;i<d;i++)if(b[i]===b[j]){b.splice(j--,1);break}}return b},has:function(a){var b=c(a);return this.filter(function(){for(var d=0,f=b.length;d<f;d++)if(c.contains(this,b[d]))return true})},not:function(a){return this.pushStack(Ia(this,a,false),"not",a)},filter:function(a){return this.pushStack(Ia(this,a,true),"filter",a)},is:function(a){return!!a&&c.filter(a,this).length>0},closest:function(a,b){if(c.isArray(a)){var d=[],f=this[0],e,j=
{},i;if(f&&a.length){e=0;for(var o=a.length;e<o;e++){i=a[e];j[i]||(j[i]=c.expr.match.POS.test(i)?c(i,b||this.context):i)}for(;f&&f.ownerDocument&&f!==b;){for(i in j){e=j[i];if(e.jquery?e.index(f)>-1:c(f).is(e)){d.push({selector:i,elem:f});delete j[i]}}f=f.parentNode}}return d}var k=c.expr.match.POS.test(a)?c(a,b||this.context):null;return this.map(function(n,r){for(;r&&r.ownerDocument&&r!==b;){if(k?k.index(r)>-1:c(r).is(a))return r;r=r.parentNode}return null})},index:function(a){if(!a||typeof a===
"string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){a=typeof a==="string"?c(a,b||this.context):c.makeArray(a);b=c.merge(this.get(),a);return this.pushStack(qa(a[0])||qa(b[0])?b:c.unique(b))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode",
d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a,2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")?
a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a,b){c.fn[a]=function(d,f){var e=c.map(this,b,d);eb.test(a)||(f=d);if(f&&typeof f==="string")e=c.filter(f,e);e=this.length>1?c.unique(e):e;if((this.length>1||gb.test(f))&&fb.test(a))e=e.reverse();return this.pushStack(e,a,R.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return c.find.matches(a,b)},dir:function(a,b,d){var f=[];for(a=a[b];a&&a.nodeType!==9&&(d===w||a.nodeType!==1||!c(a).is(d));){a.nodeType===
1&&f.push(a);a=a[b]}return f},nth:function(a,b,d){b=b||1;for(var f=0;a;a=a[d])if(a.nodeType===1&&++f===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var Ja=/ jQuery\d+="(?:\d+|null)"/g,V=/^\s+/,Ka=/(<([\w:]+)[^>]*?)\/>/g,hb=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,La=/<([\w:]+)/,ib=/<tbody/i,jb=/<|&#?\w+;/,ta=/<script|<object|<embed|<option|<style/i,ua=/checked\s*(?:[^=]|=\s*.checked.)/i,Ma=function(a,b,d){return hb.test(d)?
a:b+"></"+d+">"},F={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};F.optgroup=F.option;F.tbody=F.tfoot=F.colgroup=F.caption=F.thead;F.th=F.td;if(!c.support.htmlSerialize)F._default=[1,"div<div>","</div>"];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d=
c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==w)return this.empty().append((this[0]&&this[0].ownerDocument||s).createTextNode(a));return c.text(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this},
wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})},
prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,
this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},remove:function(a,b){for(var d=0,f;(f=this[d])!=null;d++)if(!a||c.filter(a,[f]).length){if(!b&&f.nodeType===1){c.cleanData(f.getElementsByTagName("*"));c.cleanData([f])}f.parentNode&&f.parentNode.removeChild(f)}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild);
return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,f=this.ownerDocument;if(!d){d=f.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(Ja,"").replace(/=([^="'>\s]+\/)>/g,'="$1">').replace(V,"")],f)[0]}else return this.cloneNode(true)});if(a===true){ra(this,b);ra(this.find("*"),b.find("*"))}return b},html:function(a){if(a===w)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Ja,
""):null;else if(typeof a==="string"&&!ta.test(a)&&(c.support.leadingWhitespace||!V.test(a))&&!F[(La.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Ka,Ma);try{for(var b=0,d=this.length;b<d;b++)if(this[b].nodeType===1){c.cleanData(this[b].getElementsByTagName("*"));this[b].innerHTML=a}}catch(f){this.empty().append(a)}}else c.isFunction(a)?this.each(function(e){var j=c(this),i=j.html();j.empty().append(function(){return a.call(this,e,i)})}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&
this[0].parentNode){if(c.isFunction(a))return this.each(function(b){var d=c(this),f=d.html();d.replaceWith(a.call(this,b,f))});if(typeof a!=="string")a=c(a).detach();return this.each(function(){var b=this.nextSibling,d=this.parentNode;c(this).remove();b?c(b).before(a):c(d).append(a)})}else return this.pushStack(c(c.isFunction(a)?a():a),"replaceWith",a)},detach:function(a){return this.remove(a,true)},domManip:function(a,b,d){function f(u){return c.nodeName(u,"table")?u.getElementsByTagName("tbody")[0]||
u.appendChild(u.ownerDocument.createElement("tbody")):u}var e,j,i=a[0],o=[],k;if(!c.support.checkClone&&arguments.length===3&&typeof i==="string"&&ua.test(i))return this.each(function(){c(this).domManip(a,b,d,true)});if(c.isFunction(i))return this.each(function(u){var z=c(this);a[0]=i.call(this,u,b?z.html():w);z.domManip(a,b,d)});if(this[0]){e=i&&i.parentNode;e=c.support.parentNode&&e&&e.nodeType===11&&e.childNodes.length===this.length?{fragment:e}:sa(a,this,o);k=e.fragment;if(j=k.childNodes.length===
1?(k=k.firstChild):k.firstChild){b=b&&c.nodeName(j,"tr");for(var n=0,r=this.length;n<r;n++)d.call(b?f(this[n],j):this[n],n>0||e.cacheable||this.length>1?k.cloneNode(true):k)}o.length&&c.each(o,Qa)}return this}});c.fragments={};c.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var f=[];d=c(d);var e=this.length===1&&this[0].parentNode;if(e&&e.nodeType===11&&e.childNodes.length===1&&d.length===1){d[b](this[0]);
return this}else{e=0;for(var j=d.length;e<j;e++){var i=(e>0?this.clone(true):this).get();c.fn[b].apply(c(d[e]),i);f=f.concat(i)}return this.pushStack(f,a,d.selector)}}});c.extend({clean:function(a,b,d,f){b=b||s;if(typeof b.createElement==="undefined")b=b.ownerDocument||b[0]&&b[0].ownerDocument||s;for(var e=[],j=0,i;(i=a[j])!=null;j++){if(typeof i==="number")i+="";if(i){if(typeof i==="string"&&!jb.test(i))i=b.createTextNode(i);else if(typeof i==="string"){i=i.replace(Ka,Ma);var o=(La.exec(i)||["",
""])[1].toLowerCase(),k=F[o]||F._default,n=k[0],r=b.createElement("div");for(r.innerHTML=k[1]+i+k[2];n--;)r=r.lastChild;if(!c.support.tbody){n=ib.test(i);o=o==="table"&&!n?r.firstChild&&r.firstChild.childNodes:k[1]==="<table>"&&!n?r.childNodes:[];for(k=o.length-1;k>=0;--k)c.nodeName(o[k],"tbody")&&!o[k].childNodes.length&&o[k].parentNode.removeChild(o[k])}!c.support.leadingWhitespace&&V.test(i)&&r.insertBefore(b.createTextNode(V.exec(i)[0]),r.firstChild);i=r.childNodes}if(i.nodeType)e.push(i);else e=
c.merge(e,i)}}if(d)for(j=0;e[j];j++)if(f&&c.nodeName(e[j],"script")&&(!e[j].type||e[j].type.toLowerCase()==="text/javascript"))f.push(e[j].parentNode?e[j].parentNode.removeChild(e[j]):e[j]);else{e[j].nodeType===1&&e.splice.apply(e,[j+1,0].concat(c.makeArray(e[j].getElementsByTagName("script"))));d.appendChild(e[j])}return e},cleanData:function(a){for(var b,d,f=c.cache,e=c.event.special,j=c.support.deleteExpando,i=0,o;(o=a[i])!=null;i++)if(d=o[c.expando]){b=f[d];if(b.events)for(var k in b.events)e[k]?
c.event.remove(o,k):Ca(o,k,b.handle);if(j)delete o[c.expando];else o.removeAttribute&&o.removeAttribute(c.expando);delete f[d]}}});var kb=/z-?index|font-?weight|opacity|zoom|line-?height/i,Na=/alpha\([^)]*\)/,Oa=/opacity=([^)]*)/,ha=/float/i,ia=/-([a-z])/ig,lb=/([A-Z])/g,mb=/^-?\d+(?:px)?$/i,nb=/^-?\d/,ob={position:"absolute",visibility:"hidden",display:"block"},pb=["Left","Right"],qb=["Top","Bottom"],rb=s.defaultView&&s.defaultView.getComputedStyle,Pa=c.support.cssFloat?"cssFloat":"styleFloat",ja=
function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){return X(this,a,b,true,function(d,f,e){if(e===w)return c.curCSS(d,f);if(typeof e==="number"&&!kb.test(f))e+="px";c.style(d,f,e)})};c.extend({style:function(a,b,d){if(!a||a.nodeType===3||a.nodeType===8)return w;if((b==="width"||b==="height")&&parseFloat(d)<0)d=w;var f=a.style||a,e=d!==w;if(!c.support.opacity&&b==="opacity"){if(e){f.zoom=1;b=parseInt(d,10)+""==="NaN"?"":"alpha(opacity="+d*100+")";a=f.filter||c.curCSS(a,"filter")||"";f.filter=
Na.test(a)?a.replace(Na,b):b}return f.filter&&f.filter.indexOf("opacity=")>=0?parseFloat(Oa.exec(f.filter)[1])/100+"":""}if(ha.test(b))b=Pa;b=b.replace(ia,ja);if(e)f[b]=d;return f[b]},css:function(a,b,d,f){if(b==="width"||b==="height"){var e,j=b==="width"?pb:qb;function i(){e=b==="width"?a.offsetWidth:a.offsetHeight;f!=="border"&&c.each(j,function(){f||(e-=parseFloat(c.curCSS(a,"padding"+this,true))||0);if(f==="margin")e+=parseFloat(c.curCSS(a,"margin"+this,true))||0;else e-=parseFloat(c.curCSS(a,
"border"+this+"Width",true))||0})}a.offsetWidth!==0?i():c.swap(a,ob,i);return Math.max(0,Math.round(e))}return c.curCSS(a,b,d)},curCSS:function(a,b,d){var f,e=a.style;if(!c.support.opacity&&b==="opacity"&&a.currentStyle){f=Oa.test(a.currentStyle.filter||"")?parseFloat(RegExp.$1)/100+"":"";return f===""?"1":f}if(ha.test(b))b=Pa;if(!d&&e&&e[b])f=e[b];else if(rb){if(ha.test(b))b="float";b=b.replace(lb,"-$1").toLowerCase();e=a.ownerDocument.defaultView;if(!e)return null;if(a=e.getComputedStyle(a,null))f=
a.getPropertyValue(b);if(b==="opacity"&&f==="")f="1"}else if(a.currentStyle){d=b.replace(ia,ja);f=a.currentStyle[b]||a.currentStyle[d];if(!mb.test(f)&&nb.test(f)){b=e.left;var j=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;e.left=d==="fontSize"?"1em":f||0;f=e.pixelLeft+"px";e.left=b;a.runtimeStyle.left=j}}return f},swap:function(a,b,d){var f={};for(var e in b){f[e]=a.style[e];a.style[e]=b[e]}d.call(a);for(e in b)a.style[e]=f[e]}});if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b=
a.offsetWidth,d=a.offsetHeight,f=a.nodeName.toLowerCase()==="tr";return b===0&&d===0&&!f?true:b>0&&d>0&&!f?false:c.curCSS(a,"display")==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var sb=J(),tb=/<script(.|\s)*?\/script>/gi,ub=/select|textarea/i,vb=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,N=/=\?(&|$)/,ka=/\?/,wb=/(\?|&)_=.*?(&|$)/,xb=/^(\w+:)?\/\/([^\/?#]+)/,yb=/%20/g,zb=c.fn.load;c.fn.extend({load:function(a,b,d){if(typeof a!==
"string")return zb.call(this,a);else if(!this.length)return this;var f=a.indexOf(" ");if(f>=0){var e=a.slice(f,a.length);a=a.slice(0,f)}f="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b==="object"){b=c.param(b,c.ajaxSettings.traditional);f="POST"}var j=this;c.ajax({url:a,type:f,dataType:"html",data:b,complete:function(i,o){if(o==="success"||o==="notmodified")j.html(e?c("<div />").append(i.responseText.replace(tb,"")).find(e):i.responseText);d&&j.each(d,[i.responseText,o,i])}});return this},
serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||ub.test(this.nodeName)||vb.test(this.type))}).map(function(a,b){a=c(this).val();return a==null?null:c.isArray(a)?c.map(a,function(d){return{name:b.name,value:d}}):{name:b.name,value:a}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),
function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});c.extend({get:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:f})},getScript:function(a,b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:f})},ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href,
global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:A.XMLHttpRequest&&(A.location.protocol!=="file:"||!A.ActiveXObject)?function(){return new A.XMLHttpRequest}:function(){try{return new A.ActiveXObject("Microsoft.XMLHTTP")}catch(a){}},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},etag:{},ajax:function(a){function b(){e.success&&
e.success.call(k,o,i,x);e.global&&f("ajaxSuccess",[x,e])}function d(){e.complete&&e.complete.call(k,x,i);e.global&&f("ajaxComplete",[x,e]);e.global&&!--c.active&&c.event.trigger("ajaxStop")}function f(q,p){(e.context?c(e.context):c.event).trigger(q,p)}var e=c.extend(true,{},c.ajaxSettings,a),j,i,o,k=a&&a.context||e,n=e.type.toUpperCase();if(e.data&&e.processData&&typeof e.data!=="string")e.data=c.param(e.data,e.traditional);if(e.dataType==="jsonp"){if(n==="GET")N.test(e.url)||(e.url+=(ka.test(e.url)?
"&":"?")+(e.jsonp||"callback")+"=?");else if(!e.data||!N.test(e.data))e.data=(e.data?e.data+"&":"")+(e.jsonp||"callback")+"=?";e.dataType="json"}if(e.dataType==="json"&&(e.data&&N.test(e.data)||N.test(e.url))){j=e.jsonpCallback||"jsonp"+sb++;if(e.data)e.data=(e.data+"").replace(N,"="+j+"$1");e.url=e.url.replace(N,"="+j+"$1");e.dataType="script";A[j]=A[j]||function(q){o=q;b();d();A[j]=w;try{delete A[j]}catch(p){}z&&z.removeChild(C)}}if(e.dataType==="script"&&e.cache===null)e.cache=false;if(e.cache===
false&&n==="GET"){var r=J(),u=e.url.replace(wb,"$1_="+r+"$2");e.url=u+(u===e.url?(ka.test(e.url)?"&":"?")+"_="+r:"")}if(e.data&&n==="GET")e.url+=(ka.test(e.url)?"&":"?")+e.data;e.global&&!c.active++&&c.event.trigger("ajaxStart");r=(r=xb.exec(e.url))&&(r[1]&&r[1]!==location.protocol||r[2]!==location.host);if(e.dataType==="script"&&n==="GET"&&r){var z=s.getElementsByTagName("head")[0]||s.documentElement,C=s.createElement("script");C.src=e.url;if(e.scriptCharset)C.charset=e.scriptCharset;if(!j){var B=
false;C.onload=C.onreadystatechange=function(){if(!B&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){B=true;b();d();C.onload=C.onreadystatechange=null;z&&C.parentNode&&z.removeChild(C)}}}z.insertBefore(C,z.firstChild);return w}var E=false,x=e.xhr();if(x){e.username?x.open(n,e.url,e.async,e.username,e.password):x.open(n,e.url,e.async);try{if(e.data||a&&a.contentType)x.setRequestHeader("Content-Type",e.contentType);if(e.ifModified){c.lastModified[e.url]&&x.setRequestHeader("If-Modified-Since",
c.lastModified[e.url]);c.etag[e.url]&&x.setRequestHeader("If-None-Match",c.etag[e.url])}r||x.setRequestHeader("X-Requested-With","XMLHttpRequest");x.setRequestHeader("Accept",e.dataType&&e.accepts[e.dataType]?e.accepts[e.dataType]+", */*":e.accepts._default)}catch(ga){}if(e.beforeSend&&e.beforeSend.call(k,x,e)===false){e.global&&!--c.active&&c.event.trigger("ajaxStop");x.abort();return false}e.global&&f("ajaxSend",[x,e]);var g=x.onreadystatechange=function(q){if(!x||x.readyState===0||q==="abort"){E||
d();E=true;if(x)x.onreadystatechange=c.noop}else if(!E&&x&&(x.readyState===4||q==="timeout")){E=true;x.onreadystatechange=c.noop;i=q==="timeout"?"timeout":!c.httpSuccess(x)?"error":e.ifModified&&c.httpNotModified(x,e.url)?"notmodified":"success";var p;if(i==="success")try{o=c.httpData(x,e.dataType,e)}catch(v){i="parsererror";p=v}if(i==="success"||i==="notmodified")j||b();else c.handleError(e,x,i,p);d();q==="timeout"&&x.abort();if(e.async)x=null}};try{var h=x.abort;x.abort=function(){x&&h.call(x);
g("abort")}}catch(l){}e.async&&e.timeout>0&&setTimeout(function(){x&&!E&&g("timeout")},e.timeout);try{x.send(n==="POST"||n==="PUT"||n==="DELETE"?e.data:null)}catch(m){c.handleError(e,x,null,m);d()}e.async||g();return x}},handleError:function(a,b,d,f){if(a.error)a.error.call(a.context||a,b,d,f);if(a.global)(a.context?c(a.context):c.event).trigger("ajaxError",[b,a,f])},active:0,httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status===
1223||a.status===0}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"),f=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(f)c.etag[b]=f;return a.status===304||a.status===0},httpData:function(a,b,d){var f=a.getResponseHeader("content-type")||"",e=b==="xml"||!b&&f.indexOf("xml")>=0;a=e?a.responseXML:a.responseText;e&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b===
"json"||!b&&f.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&f.indexOf("javascript")>=0)c.globalEval(a);return a},param:function(a,b){function d(i,o){if(c.isArray(o))c.each(o,function(k,n){b||/\[\]$/.test(i)?f(i,n):d(i+"["+(typeof n==="object"||c.isArray(n)?k:"")+"]",n)});else!b&&o!=null&&typeof o==="object"?c.each(o,function(k,n){d(i+"["+k+"]",n)}):f(i,o)}function f(i,o){o=c.isFunction(o)?o():o;e[e.length]=encodeURIComponent(i)+"="+encodeURIComponent(o)}var e=[];if(b===w)b=c.ajaxSettings.traditional;
if(c.isArray(a)||a.jquery)c.each(a,function(){f(this.name,this.value)});else for(var j in a)d(j,a[j]);return e.join("&").replace(yb,"+")}});var la={},Ab=/toggle|show|hide/,Bb=/^([+-]=)?([\d+-.]+)(.*)$/,W,va=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b){if(a||a===0)return this.animate(K("show",3),a,b);else{a=0;for(b=this.length;a<b;a++){var d=c.data(this[a],"olddisplay");
this[a].style.display=d||"";if(c.css(this[a],"display")==="none"){d=this[a].nodeName;var f;if(la[d])f=la[d];else{var e=c("<"+d+" />").appendTo("body");f=e.css("display");if(f==="none")f="block";e.remove();la[d]=f}c.data(this[a],"olddisplay",f)}}a=0;for(b=this.length;a<b;a++)this[a].style.display=c.data(this[a],"olddisplay")||"";return this}},hide:function(a,b){if(a||a===0)return this.animate(K("hide",3),a,b);else{a=0;for(b=this.length;a<b;a++){var d=c.data(this[a],"olddisplay");!d&&d!=="none"&&c.data(this[a],
"olddisplay",c.css(this[a],"display"))}a=0;for(b=this.length;a<b;a++)this[a].style.display="none";return this}},_toggle:c.fn.toggle,toggle:function(a,b){var d=typeof a==="boolean";if(c.isFunction(a)&&c.isFunction(b))this._toggle.apply(this,arguments);else a==null||d?this.each(function(){var f=d?a:c(this).is(":hidden");c(this)[f?"show":"hide"]()}):this.animate(K("toggle",3),a,b);return this},fadeTo:function(a,b,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,d)},
animate:function(a,b,d,f){var e=c.speed(b,d,f);if(c.isEmptyObject(a))return this.each(e.complete);return this[e.queue===false?"each":"queue"](function(){var j=c.extend({},e),i,o=this.nodeType===1&&c(this).is(":hidden"),k=this;for(i in a){var n=i.replace(ia,ja);if(i!==n){a[n]=a[i];delete a[i];i=n}if(a[i]==="hide"&&o||a[i]==="show"&&!o)return j.complete.call(this);if((i==="height"||i==="width")&&this.style){j.display=c.css(this,"display");j.overflow=this.style.overflow}if(c.isArray(a[i])){(j.specialEasing=
j.specialEasing||{})[i]=a[i][1];a[i]=a[i][0]}}if(j.overflow!=null)this.style.overflow="hidden";j.curAnim=c.extend({},a);c.each(a,function(r,u){var z=new c.fx(k,j,r);if(Ab.test(u))z[u==="toggle"?o?"show":"hide":u](a);else{var C=Bb.exec(u),B=z.cur(true)||0;if(C){u=parseFloat(C[2]);var E=C[3]||"px";if(E!=="px"){k.style[r]=(u||1)+E;B=(u||1)/z.cur(true)*B;k.style[r]=B+E}if(C[1])u=(C[1]==="-="?-1:1)*u+B;z.custom(B,u,E)}else z.custom(B,u,"")}});return true})},stop:function(a,b){var d=c.timers;a&&this.queue([]);
this.each(function(){for(var f=d.length-1;f>=0;f--)if(d[f].elem===this){b&&d[f](true);d.splice(f,1)}});b||this.dequeue();return this}});c.each({slideDown:K("show",1),slideUp:K("hide",1),slideToggle:K("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(a,b){c.fn[a]=function(d,f){return this.animate(b,d,f)}});c.extend({speed:function(a,b,d){var f=a&&typeof a==="object"?a:{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};f.duration=c.fx.off?0:typeof f.duration===
"number"?f.duration:c.fx.speeds[f.duration]||c.fx.speeds._default;f.old=f.complete;f.complete=function(){f.queue!==false&&c(this).dequeue();c.isFunction(f.old)&&f.old.call(this)};return f},easing:{linear:function(a,b,d,f){return d+f*a},swing:function(a,b,d,f){return(-Math.cos(a*Math.PI)/2+0.5)*f+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]||
c.fx.step._default)(this);if((this.prop==="height"||this.prop==="width")&&this.elem.style)this.elem.style.display="block"},cur:function(a){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];return(a=parseFloat(c.css(this.elem,this.prop,a)))&&a>-10000?a:parseFloat(c.curCSS(this.elem,this.prop))||0},custom:function(a,b,d){function f(j){return e.step(j)}this.startTime=J();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start;
this.pos=this.state=0;var e=this;f.elem=this.elem;if(f()&&c.timers.push(f)&&!W)W=setInterval(c.fx.tick,13)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(a){var b=J(),d=true;if(a||b>=this.options.duration+this.startTime){this.now=
this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var f in this.options.curAnim)if(this.options.curAnim[f]!==true)d=false;if(d){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;a=c.data(this.elem,"olddisplay");this.elem.style.display=a?a:this.options.display;if(c.css(this.elem,"display")==="none")this.elem.style.display="block"}this.options.hide&&c(this.elem).hide();if(this.options.hide||this.options.show)for(var e in this.options.curAnim)c.style(this.elem,
e,this.options.orig[e]);this.options.complete.call(this.elem)}return false}else{e=b-this.startTime;this.state=e/this.options.duration;a=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||a](this.state,e,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for(var a=c.timers,b=0;b<a.length;b++)a[b]()||a.splice(b--,1);a.length||
c.fx.stop()},stop:function(){clearInterval(W);W=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){c.style(a.elem,"opacity",a.now)},_default:function(a){if(a.elem.style&&a.elem.style[a.prop]!=null)a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit;else a.elem[a.prop]=a.now}}});if(c.expr&&c.expr.filters)c.expr.filters.animated=function(a){return c.grep(c.timers,function(b){return a===b.elem}).length};c.fn.offset="getBoundingClientRect"in s.documentElement?
function(a){var b=this[0];if(a)return this.each(function(e){c.offset.setOffset(this,a,e)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);var d=b.getBoundingClientRect(),f=b.ownerDocument;b=f.body;f=f.documentElement;return{top:d.top+(self.pageYOffset||c.support.boxModel&&f.scrollTop||b.scrollTop)-(f.clientTop||b.clientTop||0),left:d.left+(self.pageXOffset||c.support.boxModel&&f.scrollLeft||b.scrollLeft)-(f.clientLeft||b.clientLeft||0)}}:function(a){var b=
this[0];if(a)return this.each(function(r){c.offset.setOffset(this,a,r)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);c.offset.initialize();var d=b.offsetParent,f=b,e=b.ownerDocument,j,i=e.documentElement,o=e.body;f=(e=e.defaultView)?e.getComputedStyle(b,null):b.currentStyle;for(var k=b.offsetTop,n=b.offsetLeft;(b=b.parentNode)&&b!==o&&b!==i;){if(c.offset.supportsFixedPosition&&f.position==="fixed")break;j=e?e.getComputedStyle(b,null):b.currentStyle;
k-=b.scrollTop;n-=b.scrollLeft;if(b===d){k+=b.offsetTop;n+=b.offsetLeft;if(c.offset.doesNotAddBorder&&!(c.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(b.nodeName))){k+=parseFloat(j.borderTopWidth)||0;n+=parseFloat(j.borderLeftWidth)||0}f=d;d=b.offsetParent}if(c.offset.subtractsBorderForOverflowNotVisible&&j.overflow!=="visible"){k+=parseFloat(j.borderTopWidth)||0;n+=parseFloat(j.borderLeftWidth)||0}f=j}if(f.position==="relative"||f.position==="static"){k+=o.offsetTop;n+=o.offsetLeft}if(c.offset.supportsFixedPosition&&
f.position==="fixed"){k+=Math.max(i.scrollTop,o.scrollTop);n+=Math.max(i.scrollLeft,o.scrollLeft)}return{top:k,left:n}};c.offset={initialize:function(){var a=s.body,b=s.createElement("div"),d,f,e,j=parseFloat(c.curCSS(a,"marginTop",true))||0;c.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"});b.innerHTML="<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>";
a.insertBefore(b,a.firstChild);d=b.firstChild;f=d.firstChild;e=d.nextSibling.firstChild.firstChild;this.doesNotAddBorder=f.offsetTop!==5;this.doesAddBorderForTableAndCells=e.offsetTop===5;f.style.position="fixed";f.style.top="20px";this.supportsFixedPosition=f.offsetTop===20||f.offsetTop===15;f.style.position=f.style.top="";d.style.overflow="hidden";d.style.position="relative";this.subtractsBorderForOverflowNotVisible=f.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==j;a.removeChild(b);
c.offset.initialize=c.noop},bodyOffset:function(a){var b=a.offsetTop,d=a.offsetLeft;c.offset.initialize();if(c.offset.doesNotIncludeMarginInBodyOffset){b+=parseFloat(c.curCSS(a,"marginTop",true))||0;d+=parseFloat(c.curCSS(a,"marginLeft",true))||0}return{top:b,left:d}},setOffset:function(a,b,d){if(/static/.test(c.curCSS(a,"position")))a.style.position="relative";var f=c(a),e=f.offset(),j=parseInt(c.curCSS(a,"top",true),10)||0,i=parseInt(c.curCSS(a,"left",true),10)||0;if(c.isFunction(b))b=b.call(a,
d,e);d={top:b.top-e.top+j,left:b.left-e.left+i};"using"in b?b.using.call(a,d):f.css(d)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),f=/^body|html$/i.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.curCSS(a,"marginTop",true))||0;d.left-=parseFloat(c.curCSS(a,"marginLeft",true))||0;f.top+=parseFloat(c.curCSS(b[0],"borderTopWidth",true))||0;f.left+=parseFloat(c.curCSS(b[0],"borderLeftWidth",true))||0;return{top:d.top-
f.top,left:d.left-f.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||s.body;a&&!/^body|html$/i.test(a.nodeName)&&c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(f){var e=this[0],j;if(!e)return null;if(f!==w)return this.each(function(){if(j=wa(this))j.scrollTo(!a?f:c(j).scrollLeft(),a?f:c(j).scrollTop());else this[d]=f});else return(j=wa(e))?"pageXOffset"in j?j[a?"pageYOffset":
"pageXOffset"]:c.support.boxModel&&j.document.documentElement[d]||j.document.body[d]:e[d]}});c.each(["Height","Width"],function(a,b){var d=b.toLowerCase();c.fn["inner"+b]=function(){return this[0]?c.css(this[0],d,false,"padding"):null};c.fn["outer"+b]=function(f){return this[0]?c.css(this[0],d,false,f?"margin":"border"):null};c.fn[d]=function(f){var e=this[0];if(!e)return f==null?null:this;if(c.isFunction(f))return this.each(function(j){var i=c(this);i[d](f.call(this,j,i[d]()))});return"scrollTo"in
e&&e.document?e.document.compatMode==="CSS1Compat"&&e.document.documentElement["client"+b]||e.document.body["client"+b]:e.nodeType===9?Math.max(e.documentElement["client"+b],e.body["scroll"+b],e.documentElement["scroll"+b],e.body["offset"+b],e.documentElement["offset"+b]):f===w?c.css(e,d):this.css(d,typeof f==="string"?f:f+"px")}});A.jQuery=A.$=c})(window);

function debugout (s)
{
	s = ""+s;
//	s = s.replace (/\n/g, "N");
//	s = s.replace (/\r/g, "R");
//	s = s.replace (/\t/g, "T");
//	s = s.replace (/ /g, "/");

	s = s.replace (/&/g, "&amp;");
	s = s.replace (/</g, "&lt;");
	var div = document.getElementById ("debug");
	if (div) div.innerHTML += s+"<br/>";

//	netscape.security.PrivilegeManager.enablePrivilege ("UniversalXPConnect");
//	var consoleServce = Components.classes["@mozilla.org/consoleservice;1"].getService(Components.interface.nsIConsoleService);
//	consoleService.logStringMessage (s);
}

function builtin__dechex (n)
{
	if (n < 0) n = 0xffffffff + n + 1;
	return parseInt (n,10).toString (16);
}

function builtin__serialize (obj)
{
//	debugout ("typeof obj = "+(typeof obj));
	if (builtin__is_array (obj))
	{
		var res = "a:"+obj.length+":{";
		var i;
		for (i = 0; i < obj.length; i++)
		{
			res += builtin__serialize (i);
			res += builtin__serialize (obj[i]);
		}
		return res+"}";
	}
	else if (typeof obj == "object")
	{
		var count = 0;
		for (key in obj)
			count++;
		var res = "a:"+count+":{";
		for (key in obj)
		{
			res += builtin__serialize (key);
			res += builtin__serialize (obj[key]);
		}
		return res+"}";
	}
	else if (typeof obj == "string")
	{
		return "s:"+obj.length+":\""+obj+"\";";
	}
	else if (typeof obj == "number")
	{
		return "i:"+obj+";";
	}
	else if (typeof obj == "boolean")
	{
		return "b:"+(obj?"1":"0")+";";
	}
	else
	{
		return "N;";
	}
}

function builtin__unserializer (s)
{
	this.str = s;

	this.pop_to_term = function ()
	{
		var res = this.str.match (/^([^;\:]*)[;\:](.*)$/);
		if (res === null) this.die ("Failed to pop to term on '"+this.str+"'");
		this.str = res[2];
		return res[1];
	}

	this.pop_count = function (n)
	{
		var res = this.str.substr (0,n);
		this.str = this.str.substr (n);
		return res;
	}

	this.die = function (msg)
	{
		throw msg;
	}

	this.evaluate = function ()
	{
		var code = this.pop_to_term ();
		if (code == "i")
		{
			var val = this.pop_to_term ();
			return parseInt(val,10);
		}
		else if (code == "N")
		{
			return null;
		}
		else if (code == "b")
		{
			var val = this.pop_to_term ();
			return val == 1;
		}
		else if (code == "s")
		{

			var len = this.pop_to_term ();
			var quote = this.pop_count (1);
			if (quote != "\"") this.die ("Expected open quote");
			var res = this.pop_count (len);
			var quote = this.pop_count (2);
			if (quote != "\";") this.die ("Expected close quote");
			return res;
		}
		else if (code == "a")
		{
			var n = this.pop_to_term ();
			if (this.pop_count (1) != "{") this.die ("Expected {");
			var is_struct = false;
			var sobj = new Object;
			var aobj = new Array;
			for (var i = 0; i < n; i++)
			{
				var key = this.evaluate ();
				var val = this.evaluate ();
				if (key != i) is_struct = true;
				sobj[key] = val;
				aobj[i] = val;
			}
			if (this.pop_count (1) != "}") this.die ("Expected }");
			return is_struct ? sobj : aobj;
		}
		else
		{
			this.die ("Don't know what an "+code+" is");
		}
	}
}

function builtin__unserialize (s)
{
	try
	{
		var u = new builtin__unserializer (s);
		return u.evaluate ();
	} catch (ex)
	{
		return false;
	}
}


function builtin__md5 (str)
{
	return hex_md5 (str);
}

function builtin__sha1 (str)
{
	return SHA1 (str);
}


function builtin__error_log (str)
{
	debugout (str);
}

function builtin__set_focus (id)
{
	document.getElementById (id).focus();
}

function builtin__get_class (obj)
{
	return rpcclass.get_classname (obj);
}

function builtin__is_numeric (s)
{
	return builtin__preg_match ("/^\\d+$/", s);
}

/*
function builtin__call_static_method (classname, method, arg)
{
	if (rpcclass.classes2[classname].statics[method] == undefined) throw "Attempt to call static method "+classname+"::"+method+" which does not exist";
	return rpcclass.classes2[classname].statics[method] (arg);
}
*/

function builtin__array ()
{
	var res = new Array;
	for (var i = 0; arguments[i] != undefined; i++)
		res[i] = arguments[i];
	return res;
}

function builtin__count (a)
{
	if (a.constructor == Array) return a.length;
	var res = 0;
	for (key in a)
		res++;
	return res;
}

function rpcclass_save ()
{
	xmlrpc_init ();
	xmlrpc_action ();
}

function builtin__is_object (obj)
{
	if (typeof obj != "object") return false;
	if (obj == null) return false;
	if (obj.constructor == Array) return false;
	return true;
}

function builtin__is_array (obj)
{
	if (typeof obj != "object") return false;
	if (obj == null) return false;
	if (obj.constructor != Array) return false;
	return true;
}

function builtin__is_string (obj)
{
	return typeof obj == "string";
}


function builtin__substr (s, start, len)
{
	s = "" + s;
	if (arguments.length == 3)
		return s.substr(start,len);
	else
		return s.substr (start);
}

function builtin__str_replace (p, r, s)
{
	s = ""+s;
	var res = "";
	for (;;)
	{
		var i = s.indexOf (p);
		if (i == -1) return res + s;
		res += s.substr (0, i) + r;
		s = s.substr (i + p.length);
	}
}

function builtin__strlen (s)
{
	return s.length;
}

function builtin__strstr (haystack, needle)
{
	var pos = haystack.indexOf (needle);
	if (pos == -1)
		return null;
	else
		return haystack.substr (pos);
}

function builtin__strpos (haystack, needle)
{
	var pos = haystack.indexOf (needle);
	if (pos == -1)
		return false;
	else
		return pos;
}


function builtin__strtolower (s)
{
	return s.toLowerCase();
}


function builtin__rtrim (s, charlist)
{
	if (arguments.length == 1) charlist = " \t\n\r\0\x0b";
	s = ""+s;

	for (;;)
	{
		if (s.length == 0 || charlist.indexOf(s.substr(s.length-1,1)) == -1) break;
		s = s.substr(0,s.length-1);
	}

//	if (s.match (/^\s+$/)) return "";
//	var matches = s.match (/^(.*\S)\s*$/);
//	if (matches)
//	{
//		return matches[1];
//	}
	return s;
}

function builtin__ltrim (s, charlist)
{
	if (arguments.length == 1) charlist = " \t\n\r\0\x0b";
	s = ""+s;

	for (;;)
	{
		if (s.length == 0 || charlist.indexOf(s.substr(0,1)) == -1) break;
		s = s.substr(1);
	}

//	if (s.match (/^\s+$/)) return "";
//	var matches = s.match (/^\s+(\S.*)$/);
//	if (matches)
//	{
//		return matches[1];
//	}
	return s;
}


function builtin__trim (s, charlist)
{
	if (arguments.length == 1) charlist = " \t\n\r\0\x0b";
	return builtin__rtrim (builtin__ltrim (s, charlist), charlist);
}

function builtin__isset (o)
{
	return typeof o !== "undefined";
}

function builtin__aarray ()
{
	return new Object;
}

function builtin__debugout (s)
{
	debugout(s);
}

function builtin__make_uniq ()
{
	if (window.rpcclass_uniq === undefined) window.rpcclass_uniq = 4314;
	return "JSX"+(++window.rpcclass_uniq);
}

function builtin__addslashes (s)
{
	return s.replace (/"/g, "\\\"");
}


function builtin__explode (boundary, string)
{
	var res = string.split (boundary);
	return res;
}

function builtin__time ()
{
	var d = new Date ();
	return parseInt(d.getTime()/1000);
}

function builtin__cal_days_in_month (calendar, month, year)
{
	return (month == 2) ? (year % 4 ? 28 : (year % 100 ? 29 : (year % 400 ? 28 : 29))) : (((month - 1) % 7 % 2) ? 30 : 31);
}

// var builtin__sprintf = sprintf;

function builtin__date (fmt, parm)
{
	if (arguments.length == 1)
		var value = new Date ();
	else
		var value = new Date (parm*1000);
	var res = "";
	for (i = 0; i < fmt.length; i++)
	{
		switch (fmt.substr(i,1))
		{
		case 'r':
			res += value.toLocaleString();
			break;

		case 'Y':
			res += value.getFullYear();
			break;

		case 'y':
			var n = value.getFullYear() % 100;
			if (n < 10)
				res += "0"+n;
			else
				res += n;
			break;


		case 'm':
			if (value.getMonth() < 9)
				res += "0" + (1 + value.getMonth());
			else
				res += 1 + value.getMonth();
			break;

		case 'F':
			var months = [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ];
			res += months[value.getMonth()];
			break;


		case 'M':
			var months = [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ];
			res += months[value.getMonth()];
			break;

		case 'j':
			res += value.getDate();
			break;

		case 'S':
			var units = value.getDate() % 10;
			var tens = parseInt ((value.getDate() % 100) / 10, 10);
			if (tens == 1)
			{
				res += "th";
			}
			else
			{
				if (units == 1)
					res += "st";
				else if (units == 2)
					res += "nd";
				else if (units == 3)
					res += "rd";
				else
					res += "th";
			}
			break;

		case 'd':
			if (value.getDate() < 10)
				res += "0"+value.getDate();
			else
				res += value.getDate();
			break;

		case 'w':
			res += value.getDay();
			break;

		case 'N':
			var xd = value.getDay();
			if (xd == 0) xd = 7;
			res += xd;
			break;

		case 'D':
			var days = [ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" ];
			res += days[value.getDay()];
			break;

		case 'i':	// minutes with leading zeros
			if (value.getMinutes() < 10)
				res += "0"+value.getMinutes();
			else
				res += value.getMinutes();
			break;

		case 's':	// seconds with leading zeros
			if (value.getSeconds() < 10)
				res += "0"+value.getSeconds();
			else
				res += value.getSeconds();
			break;

		case 'H':	// 24 hour hours with leading zeros
			if (value.getHours() < 10)
				res += "0"+value.getHours();
			else
				res += value.getHours();
			break;

		default:
			res += fmt.substr(i,1);
			break;
		}
	}
	return res;
}

function builtin__gmdate (fmt, parm)
{
	if (arguments.length == 1)
		var value = new Date ();
	else
		var value = new Date (parm*1000);
	var res = "";
	for (i = 0; i < fmt.length; i++)
	{
		switch (fmt.substr(i,1))
		{
		case 'r':
			res += value.toUTCString();
			break;

		case 'Y':
			res += value.getUTCFullYear();
			break;

		case 'y':
			var n = value.getUTCFullYear() % 100;
			if (n < 10)
				res += "0"+n;
			else
				res += n;
			break;


		case 'm':
			if (value.getUTCMonth() < 9)
				res += "0" + (1 + value.getUTCMonth());
			else
				res += 1 + value.getUTCMonth();
			break;

		case 'F':
			var months = [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ];
			res += months[value.getUTCMonth()];
			break;


		case 'M':
			var months = [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ];
			res += months[value.getUTCMonth()];
			break;

		case 'j':
			res += value.getUTCDate();
			break;

		case 'S':
			var units = value.getUTCDate() % 10;
			var tens = parseInt ((value.getUTCDate() % 100) / 10, 10);
			if (tens == 1)
			{
				res += "th";
			}
			else
			{
				if (units == 1)
					res += "st";
				else if (units == 2)
					res += "nd";
				else if (units == 3)
					res += "rd";
				else
					res += "th";
			}
			break;

		case 'd':
			if (value.getUTCDate() < 10)
				res += "0"+value.getUTCDate();
			else
				res += value.getUTCDate();
			break;

		case 'w':
			res += value.getUTCDay();
			break;

		case 'N':
			var xd = value.getUTCDay();
			if (xd == 0) xd = 7;
			res += xd;
			break;

		case 'D':
			var days = [ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" ];
			res += days[value.getUTCDay()];
			break;

		case 'i':	// minutes with leading zeros
			if (value.getUTCMinutes() < 10)
				res += "0"+value.getUTCMinutes();
			else
				res += value.getUTCMinutes();
			break;

		case 's':	// seconds with leading zeros
			if (value.getUTCSeconds() < 10)
				res += "0"+value.getUTCSeconds();
			else
				res += value.getUTCSeconds();
			break;

		case 'H':	// 24 hour hours with leading zeros
			if (value.getUTCHours() < 10)
				res += "0"+value.getUTCHours();
			else
				res += value.getUTCHours();
			break;

		default:
			res += fmt.substr(i,1);
			break;
		}
	}
	return res;
}


function builtin__htmlentities (text)
{
	text = ""+text;
	text = text.replace (/&/g, "&amp;");
	text = text.replace (/"/g, "&quot;");
	text = text.replace (/'/g, "&apos;");
	text = text.replace (/</g, "&lt;");
	text = text.replace (/>/g, "&gt;");
	return text;
}

function builtin__floatval (text)
{
	return parseFloat (text);
}

function builtin__str_pad (str, len, pad, end)
{
	if (arguments.length < 3) pad = " ";
	if (arguments.length < 4) end = 1;
	pad = ""+pad;
	str = ""+str;
	if (end == 0)
	{
		while (str.length < len) str = pad+str;
	}
	else if (end == 1)
	{
		while (str.length < len) str += pad;
	}
	else
	{
		throw "STR_PAD_BOTH not implemented yet";
	}
	return str;
}

function builtin__alert (text)
{
	alert (text);
}

function builtin__die (text)
{
	alert (text);
	throw text;
}

function builtin__method_exists (obj, method)
{
	if (obj.constructor == String)
	{
		// must be a class name
		var c = eval (obj);
		return c[method] !== undefined || c["inst__"+method] !== undefined;
	}
	return obj[method] !== undefined || obj.constructor["pinst__"+method] !== undefined;
}

function builtin__in_array (item, arr)
{
	for (var i in arr)
	{
		if (arr[i] == item)
		{
			return true;
		}
	}
	return false;
}

function builtin__array_search (item, arr)
{
	for (var i in arr)
	{
		if (arr[i] == item)
		{
			return i;
		}
	}
	return false;
}


function builtin__preg_match (phppattern, string, matches)
{
	var splitter = phppattern.substr(0,1);
	if (phppattern.substr(phppattern.length-1,1) != splitter) throw "Can't do this yet";
	var pattern = phppattern.substr(1,phppattern.length-2);
	var attribs = "";
	var re = new RegExp (pattern, attribs);
	string = ""+string;
	var res = string.match (re);
	if (res == null) return false;
	if (matches != undefined)
	{
		for (var i in res)
			matches[i] = res[i];
	}
	return true;
}

function builtin__preg_match_all (phppattern, string, matches, flags)
{
	if (arguments.length < 4) flags = 1;
	var splitter = phppattern.substr(0,1);
	if (phppattern.substr(phppattern.length-1,1) != splitter) throw "Can't do this yet";
	var pattern = phppattern.substr(1,phppattern.length-2);
	var attribs = "g";
	var re = new RegExp (pattern, attribs);
	var count = 0;
	string = ""+string;
	if (flags == 1)
	{
		// PREG_PATTERN_ORDER mode
		while (null != (m = re.exec (string)))
		{
			for (var i in m)
			{
				if (matches[i] == undefined) matches[i] = new Array;
				matches[i][count] = m[i];
			}
			count++;
		}
	}
	else
	{
		// PREG_SET_ORDER mode
		while (null != (m = re.exec (string)))
		{
			matches[count] = new Array;
			for (var i in m)
			{
				matches[count][i] = m[i];
			}
			count++;
		}
	}
	return count;
}

function builtin__preg_replace (phppattern, replace, str)
{
	var splitter = phppattern.substr(0,1);
	if (phppattern.substr(phppattern.length-1,1) != splitter) throw "Can't do this yet";
	var pattern = phppattern.substr(1,phppattern.length-2);
	var re = new RegExp (pattern, "g");
	var res = str.replace (re, replace);
	return res;
}

function builtin__preg_replace_callback (phppattern, fn, str)
{
	var splitter = phppattern.substr(0,1);
	if (phppattern.substr(phppattern.length-1,1) != splitter) throw "Can't do this yet";
	var pattern = phppattern.substr(1,phppattern.length-2);
	var re = new RegExp (pattern, "g");

	function replacer (s)
	{
		if (builtin__is_array (fn))
		{
			obj = fn[0];
			method = fn[1];
			return obj[method] (arguments);
		}
		else
		{
			return fn (arguments);
		}
	}

	var res = str.replace (re, replacer);
	return res;
}


function builtin__mktime (hour, min, sec, month, day, year)
{
	var d = new Date (year, month-1, day, hour, min, sec, 0);
	return d.getTime()/1000;
}

function builtin__parse_mysql_datetime (mt)
{
	if (mt == "") return 0;
	if (mt == "0000-00-00 00:00:00") return 0;
	res = builtin__mktime (mt.substr(11,2),mt.substr(14,2),mt.substr(17,2),mt.substr(5,2),mt.substr(8,2),mt.substr(0,4));
	return res;
}

function builtin__ord (ch)
{
	return ch.charCodeAt (0);
}

function builtin__urlencode (s)
{
	s = encodeURIComponent (s);
	return s.replace ("/ /g", "+");
}

function builtin__urldecode (s)
{
	s = s.replace (/\+/g, " ");
	return decodeURIComponent(s);
}

function builtin__base64_encode (s)
{
	return Base64.encode (s);
}

function builtin__base64_decode (s)
{
	return Base64.decode (s);
}


function builtin__array_splice (arr, offset, len, replace)
{
	if (arguments.length > 2)
	{
		if (len) arr.splice (offset, len);
		if (arguments.length == 4)
		{
			if (replace.constructor == Array)
			{
				for (i in replace)
				{
					var item = replace[i];
					arr.splice (parseInt(offset,10)+parseInt(i,10), 0, item);
				}
			}
			else
			{
				arr.splice (offset, 0, replace);
			}
		}
	}
	else
	{
		arr.length = offset;
	}
	return arr;
}

function builtin__usort (arr, fn)
{
	if (builtin__is_array (fn))
	{
		if (fn[0].constructor == String)
		{
			var cls = eval (fn[0]);
			var sortfn = cls[fn[1]];
			arr.sort (sortfn);
		}
		else
		{
			var obj = fn[0];
			var sortfn = obj.constructor.prototype[fn[1]];
			arr.sort (sortfn);
		}
	}
	else
	{
		throw "global comparison fn not implemented yet";
	}
}

function builtin__implode (sep, arr)
{
	return arr.join (sep);
}


function builtin__setcookie (name, value, expire, path)
{
	var expdate = new Date (expire*1000);
	var val = name+"="+escape(value)+"; expires="+expdate.toUTCString()+"; path=/";
//	debugout ("setcookie "+val);
	document.cookie = val;
}


function builtin__ob_start ()
{
	if (window.__outbuffer !== undefined)
	{
		if (window.__outbuffer_stack === undefined)
			window.__outbuffer_stack = new Array;
		window.__outbuffer_stack.push (window.__outbuffer);
	}
	window.__outbuffer = "";
}

function builtin__ob_get_clean ()
{
	var value = window.__outbuffer;
	if (window.__outbuffer_stack !== undefined)
		window.__outbuffer = window.__outbuffer_stack.pop();
	else
		window.__outbuffer = undefined;
	return value;
}


function builtin__echo (str)
{
	if (window.__outbuffer !== undefined)
		window.__outbuffer += str;
	else
		debugout (str);
}

/*
 * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
 * Digest Algorithm, as defined in RFC 1321.
 * Version 2.1 Copyright (C) Paul Johnston 1999 - 2002.
 * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
 * Distributed under the BSD License
 * See http://pajhome.org.uk/crypt/md5 for more info.
 */

/*
 * Configurable variables. You may need to tweak these to be compatible with
 * the server-side, but the defaults work in most cases.
 */
var hexcase = 0;  /* hex output format. 0 - lowercase; 1 - uppercase        */
var b64pad  = ""; /* base-64 pad character. "=" for strict RFC compliance   */
var chrsz   = 8;  /* bits per input character. 8 - ASCII; 16 - Unicode      */

/*
 * These are the functions you'll usually want to call
 * They take string arguments and return either hex or base-64 encoded strings
 */
function hex_md5(s){ return binl2hex(core_md5(str2binl(s), s.length * chrsz));}
function b64_md5(s){ return binl2b64(core_md5(str2binl(s), s.length * chrsz));}
function str_md5(s){ return binl2str(core_md5(str2binl(s), s.length * chrsz));}
function hex_hmac_md5(key, data) { return binl2hex(core_hmac_md5(key, data)); }
function b64_hmac_md5(key, data) { return binl2b64(core_hmac_md5(key, data)); }
function str_hmac_md5(key, data) { return binl2str(core_hmac_md5(key, data)); }

/* 
 * Perform a simple self-test to see if the VM is working 
 */
function md5_vm_test()
{
  return hex_md5("abc") == "900150983cd24fb0d6963f7d28e17f72";
}

/*
 * Calculate the MD5 of an array of little-endian words, and a bit length
 */
function core_md5(x, len)
{
  /* append padding */
  x[len >> 5] |= 0x80 << ((len) % 32);
  x[(((len + 64) >>> 9) << 4) + 14] = len;
  
  var a =  1732584193;
  var b = -271733879;
  var c = -1732584194;
  var d =  271733878;

  for(var i = 0; i < x.length; i += 16)
  {
    var olda = a;
    var oldb = b;
    var oldc = c;
    var oldd = d;
 
    a = md5_ff(a, b, c, d, x[i+ 0], 7 , -680876936);
    d = md5_ff(d, a, b, c, x[i+ 1], 12, -389564586);
    c = md5_ff(c, d, a, b, x[i+ 2], 17,  606105819);
    b = md5_ff(b, c, d, a, x[i+ 3], 22, -1044525330);
    a = md5_ff(a, b, c, d, x[i+ 4], 7 , -176418897);
    d = md5_ff(d, a, b, c, x[i+ 5], 12,  1200080426);
    c = md5_ff(c, d, a, b, x[i+ 6], 17, -1473231341);
    b = md5_ff(b, c, d, a, x[i+ 7], 22, -45705983);
    a = md5_ff(a, b, c, d, x[i+ 8], 7 ,  1770035416);
    d = md5_ff(d, a, b, c, x[i+ 9], 12, -1958414417);
    c = md5_ff(c, d, a, b, x[i+10], 17, -42063);
    b = md5_ff(b, c, d, a, x[i+11], 22, -1990404162);
    a = md5_ff(a, b, c, d, x[i+12], 7 ,  1804603682);
    d = md5_ff(d, a, b, c, x[i+13], 12, -40341101);
    c = md5_ff(c, d, a, b, x[i+14], 17, -1502002290);
    b = md5_ff(b, c, d, a, x[i+15], 22,  1236535329);

    a = md5_gg(a, b, c, d, x[i+ 1], 5 , -165796510);
    d = md5_gg(d, a, b, c, x[i+ 6], 9 , -1069501632);
    c = md5_gg(c, d, a, b, x[i+11], 14,  643717713);
    b = md5_gg(b, c, d, a, x[i+ 0], 20, -373897302);
    a = md5_gg(a, b, c, d, x[i+ 5], 5 , -701558691);
    d = md5_gg(d, a, b, c, x[i+10], 9 ,  38016083);
    c = md5_gg(c, d, a, b, x[i+15], 14, -660478335);
    b = md5_gg(b, c, d, a, x[i+ 4], 20, -405537848);
    a = md5_gg(a, b, c, d, x[i+ 9], 5 ,  568446438);
    d = md5_gg(d, a, b, c, x[i+14], 9 , -1019803690);
    c = md5_gg(c, d, a, b, x[i+ 3], 14, -187363961);
    b = md5_gg(b, c, d, a, x[i+ 8], 20,  1163531501);
    a = md5_gg(a, b, c, d, x[i+13], 5 , -1444681467);
    d = md5_gg(d, a, b, c, x[i+ 2], 9 , -51403784);
    c = md5_gg(c, d, a, b, x[i+ 7], 14,  1735328473);
    b = md5_gg(b, c, d, a, x[i+12], 20, -1926607734);

    a = md5_hh(a, b, c, d, x[i+ 5], 4 , -378558);
    d = md5_hh(d, a, b, c, x[i+ 8], 11, -2022574463);
    c = md5_hh(c, d, a, b, x[i+11], 16,  1839030562);
    b = md5_hh(b, c, d, a, x[i+14], 23, -35309556);
    a = md5_hh(a, b, c, d, x[i+ 1], 4 , -1530992060);
    d = md5_hh(d, a, b, c, x[i+ 4], 11,  1272893353);
    c = md5_hh(c, d, a, b, x[i+ 7], 16, -155497632);
    b = md5_hh(b, c, d, a, x[i+10], 23, -1094730640);
    a = md5_hh(a, b, c, d, x[i+13], 4 ,  681279174);
    d = md5_hh(d, a, b, c, x[i+ 0], 11, -358537222);
    c = md5_hh(c, d, a, b, x[i+ 3], 16, -722521979);
    b = md5_hh(b, c, d, a, x[i+ 6], 23,  76029189);
    a = md5_hh(a, b, c, d, x[i+ 9], 4 , -640364487);
    d = md5_hh(d, a, b, c, x[i+12], 11, -421815835);
    c = md5_hh(c, d, a, b, x[i+15], 16,  530742520);
    b = md5_hh(b, c, d, a, x[i+ 2], 23, -995338651);

    a = md5_ii(a, b, c, d, x[i+ 0], 6 , -198630844);
    d = md5_ii(d, a, b, c, x[i+ 7], 10,  1126891415);
    c = md5_ii(c, d, a, b, x[i+14], 15, -1416354905);
    b = md5_ii(b, c, d, a, x[i+ 5], 21, -57434055);
    a = md5_ii(a, b, c, d, x[i+12], 6 ,  1700485571);
    d = md5_ii(d, a, b, c, x[i+ 3], 10, -1894986606);
    c = md5_ii(c, d, a, b, x[i+10], 15, -1051523);
    b = md5_ii(b, c, d, a, x[i+ 1], 21, -2054922799);
    a = md5_ii(a, b, c, d, x[i+ 8], 6 ,  1873313359);
    d = md5_ii(d, a, b, c, x[i+15], 10, -30611744);
    c = md5_ii(c, d, a, b, x[i+ 6], 15, -1560198380);
    b = md5_ii(b, c, d, a, x[i+13], 21,  1309151649);
    a = md5_ii(a, b, c, d, x[i+ 4], 6 , -145523070);
    d = md5_ii(d, a, b, c, x[i+11], 10, -1120210379);
    c = md5_ii(c, d, a, b, x[i+ 2], 15,  718787259);
    b = md5_ii(b, c, d, a, x[i+ 9], 21, -343485551);

    a = safe_add(a, olda);
    b = safe_add(b, oldb);
    c = safe_add(c, oldc);
    d = safe_add(d, oldd);
  }
  return Array(a, b, c, d);
  
}

/*
 * These functions implement the four basic operations the algorithm uses.
 */
function md5_cmn(q, a, b, x, s, t)
{
  return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s),b);
}
function md5_ff(a, b, c, d, x, s, t)
{
  return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t);
}
function md5_gg(a, b, c, d, x, s, t)
{
  return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t);
}
function md5_hh(a, b, c, d, x, s, t)
{
  return md5_cmn(b ^ c ^ d, a, b, x, s, t);
}
function md5_ii(a, b, c, d, x, s, t)
{
  return md5_cmn(c ^ (b | (~d)), a, b, x, s, t);
}

/*
 * Calculate the HMAC-MD5, of a key and some data
 */
function core_hmac_md5(key, data)
{
  var bkey = str2binl(key);
  if(bkey.length > 16) bkey = core_md5(bkey, key.length * chrsz);

  var ipad = Array(16), opad = Array(16);
  for(var i = 0; i < 16; i++) 
  {
    ipad[i] = bkey[i] ^ 0x36363636;
    opad[i] = bkey[i] ^ 0x5C5C5C5C;
  }

  var hash = core_md5(ipad.concat(str2binl(data)), 512 + data.length * chrsz);
  return core_md5(opad.concat(hash), 512 + 128);
}

/*
 * Add integers, wrapping at 2^32. This uses 16-bit operations internally
 * to work around bugs in some JS interpreters.
 */
function safe_add(x, y)
{
  var lsw = (x & 0xFFFF) + (y & 0xFFFF);
  var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
  return (msw << 16) | (lsw & 0xFFFF);
}

/*
 * Bitwise rotate a 32-bit number to the left.
 */
function bit_rol(num, cnt)
{
  return (num << cnt) | (num >>> (32 - cnt));
}

/*
 * Convert a string to an array of little-endian words
 * If chrsz is ASCII, characters >255 have their hi-byte silently ignored.
 */
function str2binl(str)
{
  var bin = Array();
  var mask = (1 << chrsz) - 1;
  for(var i = 0; i < str.length * chrsz; i += chrsz)
    bin[i>>5] |= (str.charCodeAt(i / chrsz) & mask) << (i%32);
  return bin;
}

/*
 * Convert an array of little-endian words to a string
 */
function binl2str(bin)
{
  var str = "";
  var mask = (1 << chrsz) - 1;
  for(var i = 0; i < bin.length * 32; i += chrsz)
    str += String.fromCharCode((bin[i>>5] >>> (i % 32)) & mask);
  return str;
}

/*
 * Convert an array of little-endian words to a hex string.
 */
function binl2hex(binarray)
{
  var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef";
  var str = "";
  for(var i = 0; i < binarray.length * 4; i++)
  {
    str += hex_tab.charAt((binarray[i>>2] >> ((i%4)*8+4)) & 0xF) +
           hex_tab.charAt((binarray[i>>2] >> ((i%4)*8  )) & 0xF);
  }
  return str;
}

/*
 * Convert an array of little-endian words to a base-64 string
 */
function binl2b64(binarray)
{
  var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
  var str = "";
  for(var i = 0; i < binarray.length * 4; i += 3)
  {
    var triplet = (((binarray[i   >> 2] >> 8 * ( i   %4)) & 0xFF) << 16)
                | (((binarray[i+1 >> 2] >> 8 * ((i+1)%4)) & 0xFF) << 8 )
                |  ((binarray[i+2 >> 2] >> 8 * ((i+2)%4)) & 0xFF);
    for(var j = 0; j < 4; j++)
    {
      if(i * 8 + j * 6 > binarray.length * 32) str += b64pad;
      else str += tab.charAt((triplet >> 6*(3-j)) & 0x3F);
    }
  }
  return str;
}

function php_frame (name, instrs)
{
	this.fnname = name;
	this.instrs = instrs;
	this.pc = 0;
	this.s = new Array;
	this.v = new Object;
}

function php_engine (name, instrs)
{
	this.old_frames = new Array;
	this.old_frames_depth = 0;
	this.frame = new php_frame (name, instrs);
	this.running = false;
	this.thread_id = ++php_engine.started_threads;

	this.backtrace = function (error)
	{
		debugout ("Backtrace....");
		debugout (error+" in function "+this.frame.fnname);
		if (this.m !== undefined) debugout ("Marker is "+this.frame.m);
		for (var i = 0; i < this.old_frames_depth; i++)
		{
			debugout ("called from "+this.old_frames[this.old_frames_depth-i-1].fnname+" at marker "+this.old_frames[this.old_frames_depth-i-1].m);
		}
	}

	this.destroy = function ()
	{
		var i;
		var found = false;
		for (i = 0; i < php_engine.threads.length; i++)
		{
			if (php_engine.threads[i] == this)
			{
				php_engine.threads.splice (i,1);
				found = true;
				break;
			}
		}
		if (!found)
			throw "Failed to find thread during thread stop";
		asyncnotify.thread_stopping();
	}

	this.run = function ()
	{
//		debugout ("Running......\n");

		var nested_thread = php_engine.current_thread;
		php_engine.current_thread = this;
		var saved_onerror = window.onerror;
		window.onerror = php_engine.error_handler;

		var max = 100000;
		this.running = true;
		this.tracing = 0;
		while (this.running)
		{
			if (this.tracing)
			{
				var text = "";
				for (varname in this.frame.v) text += varname+":"+this.frame.v[varname]+",";
				debugout ("v "+text);
debugout ("this.frame.pc = "+this.frame.pc);
debugout ("this.frame.instrs = "+this.frame.instrs);
				if (this.frame.pc >= 0 && this.frame.instrs != null)
					debugout ("execute "+this.frame.pc+":"+this.frame.instrs[this.frame.pc]);
			}

 			if (this.frame.instrs == null)
			{
				this.destroy ()
				break;
			}
			if (this.frame.pc == -1)
				this.php_return_void (0);
			else
			{
				var pc = this.frame.pc++;
				if (this.frame.instrs[this.frame.pc] == null) this.frame.pc = -1;
				this.frame.instrs[pc] (this, this.frame);
			}
		}
//		debugout ("Quit run loop\n");
		window.onerror = saved_onerror;
		php_engine.current_thread = nested_thread;
	}

	this.php_return_void = function (stack_depth)
	{
		if (this.old_frames_depth == 0)
		{
			debugout ("Finished executing PHP\n");
			this.running = false;
		}
		else
		{
//			debugout ("returning from PHP function - depth = "+this.old_frames_depth+"\n");
			this.frame = this.old_frames[--this.old_frames_depth];
			this.old_frames[this.old_frames_depth] = null;
		}
	}

	this.return_pop = function (res)
	{
		if (this.old_frames_depth == 0)
		{
			debugout ("Finished executing PHP\n");
			this.running = false;
		}
		else
		{
//			debugout ("returning from PHP function - depth = "+this.old_frames_depth+"\n");
			this.frame = this.old_frames[--this.old_frames_depth];
			this.old_frames[this.old_frames_depth] = null;
			stack_depth = this.frame.saved_sp;
			this.php_push (stack_depth++, res);
		}
	}


	this.php_return_pop = function (stack_depth)
	{
		if (this.old_frames_depth == 0)
		{
			debugout ("Finished executing PHP\n");
			this.running = false;
		}
		else
		{
//			debugout ("returning from PHP function - depth = "+this.old_frames_depth+"\n");
			res = this.php_pop(stack_depth--);
			this.frame = this.old_frames[--this.old_frames_depth];
			this.old_frames[this.old_frames_depth] = null;
			stack_depth = this.frame.saved_sp;
			this.php_push (stack_depth++, res);
		}
	}

	this.smcall = function (stack_depth, classobj, methodname, args)
	{
		var nargs = args.length;
		stack_depth -= nargs;

		if (typeof classobj != "function")
		{
			this.backtrace ("Classobj is not a function but a '"+(typeof classobj)+"'");
			throw "Classobj is not a function but a '"+(typeof classobj)+"' in call to method "+methodname;
		}

		var codegroup = classobj.codegroup;
		if (codegroup !== undefined)
		{
			classobj.codegroup = undefined;
			var dlargs = ([codegroup, classobj.prototype.classname, methodname, args]);
			this.smcall (stack_depth+dlargs.length, dynloader, "load_codegroup_smcall", dlargs);
			return;
		}

		var instrs = classobj["inst__"+methodname];
		var arg_names = classobj["args__"+methodname];
//		debugout ("calling "+classobj.prototype.classname+":"+methodname+", arg_names = "+arg_names);
		if (arg_names === undefined)
		{
			// need to fix this
			if (classobj[methodname] === undefined)
			{
				alert ("Bad method "+methodname+" : "+typeof classobj[methodname]+" in class "+classobj);
			}
			else
			{
				var res = classobj[methodname].apply (null, args);
				this.php_push (stack_depth++, res);
			}
		}
		else
		{
			if (nargs < arg_names.length)
			{
				var err = "argument missing in call to "+methodname+" ";
				for (var xi = 0; xi < arg_names.length; xi++)
					err += arg_names[xi]+",";
				err += " = ";
				for (var xi = 0; xi < nargs; xi++)
					err += args[xi]+",";
//				debugout (err);
				this.backtrace (err);

				while (args.length < arg_names.length)
					args[args.length] = null;
			}

//			var args = new Array;
//			for (var i = 0; i < arg_names.length; i++)
//				args[i] = this.php_pop();

			this.frame.saved_sp = stack_depth;

			this.old_frames[this.old_frames_depth++] = this.frame;
			this.frame = new php_frame (classobj.prototype.classname+"::"+methodname, instrs);
			for (var i = 0; i < arg_names.length; i++)
			{
				this.frame.v[arg_names[i]] = args[i];
			}
		}
	}

	this.php_static_method_call = function (stack_depth, classobj, methodname, nargs)
	{
		var args = new Array;
		var sd = stack_depth;
		for (var i = 0; i < nargs; i++)
			args[i] = this.php_pop(sd--);

		this.smcall (stack_depth, classobj, methodname, args);
	}

	this.mcall = function (stack_depth, obj, methodname, args)
	{
		var nargs = args.length;
		stack_depth -= 2+nargs;

		if (obj === undefined || obj === null)
		{
			this.backtrace ("Bad object in call to "+methodname);
			throw "Bad object in call to "+methodname;
		}

		var classname = obj.classname;
		if (classname !== undefined)
		{
			var cls = eval(classname);
			var codegroup = cls.codegroup;
			if (codegroup !== undefined)
			{
				cls.codegroup = undefined;
				var dlargs = ([codegroup, obj, methodname, args]);
				this.smcall (stack_depth+dlargs.length, dynloader, "load_codegroup_mcall", dlargs);
				return;
			}
		}

//		debugout ("calling method "+classname+"::"+methodname);

		// warning: IE7 doesn't have a constructor attribute on builtins
		if (obj.constructor === undefined || obj.constructor["pargs__"+methodname] === undefined)
		{
			// need to fix this
			if (obj[methodname] === undefined)
			{
				alert ("Bad method "+methodname+" : "+typeof obj[methodname]+" in object "+obj);
			}
			else
			{
//				debugout ("Calling native method "+obj+":"+methodname);

				/* IE is a bit rubbish here, apply is not available on native methods */

				var res = null;

				switch (nargs)
				{
				case 0:
					res = obj[methodname] ();
					break;
				case 1:
					res = obj[methodname] (args[0]);
					break;
				case 2:
					res = obj[methodname] (args[0], args[1]);
					break;
				case 3:
					res = obj[methodname] (args[0], args[1], args[2]);
					break;
				case 4:
					res = obj[methodname] (args[0], args[1], args[2], args[3]);
					break;
				case 5:
					res = obj[methodname] (args[0], args[1], args[2], args[3], args[4]);
					break;

				default:
					alert ("Native method - too many arguments - call John");
					throw "Native method - too many arguments - call John";
				}

				this.php_push (stack_depth++, res);
			}
		}
		else
		{
			var instrs = obj.constructor["pinst__"+methodname];
			var arg_names = obj.constructor["pargs__"+methodname];
			if (nargs < arg_names.length)
			{
				var err = "argument missing in call to "+methodname+" ";
				for (var xi = 0; xi < arg_names.length; xi++)
					err += arg_names[xi]+",";
				err += " = ";
				for (var xi = 0; xi < nargs; xi++)
					err += args[xi]+",";
//				debugout (err);
				this.backtrace (err);

				while (args.length < arg_names.length)
					args[args.length] = null;
			}

			this.frame.saved_sp = stack_depth;
			this.old_frames[this.old_frames_depth++] = this.frame;
			this.frame = new php_frame (classname+"::"+methodname, instrs);
			this.frame.v["this"] = obj;
			for (var i = 0; i < arg_names.length; i++)
				this.frame.v[arg_names[i]] = args[i];
		}
	}

	this.php_method_call = function (stack_depth, nargs)
	{
		var sd = stack_depth;
		var obj = this.php_pop(sd--);
		var methodname = this.php_pop(sd--);
		var args = new Array;
		for (var i = 0; i < nargs; i++)
			args[i] = this.php_pop(sd--);

		this.mcall (stack_depth, obj, methodname, args);
	}

	this.php_array = function (stack_depth, n)
	{
		var res = new Array;
		var i;
		for (i = 0; i < n; i++)
			res[res.length] = this.php_pop(stack_depth--);
		this.php_push (stack_depth++, res);
	}

	this.php_aarray = function (stack_depth, n)
	{
		var res = new Object;
		var i;
		for (i = 0; i < n; i++)
		{
			var key = this.php_pop(stack_depth--);
			var val = this.php_pop(stack_depth--);
			res[key] = val;
		}
		this.php_push (stack_depth++, res);
	}

	this.php_unset = function (stack_depth)
	{
		var target = this.php_pop(stack_depth--);
		delete target.obj[target.field];
	}

	this.php_builtin = function (stack_depth, fn, nargs)
	{
		switch (fn)
		{
		case "intval":
			var s = this.php_pop(stack_depth--);
			this.php_push (stack_depth++, parseInt(s,10));
			break;

		case "die":
			var s = this.php_pop(stack_depth--);
			alert ("Die "+s);
			this.running = false;
			break;

		case "document_getElementById":
			var el = this.php_pop(stack_depth--);
			this.php_push (stack_depth++, document.getElementById (el));
			break;

		case "document_getInnerHTML":
			var el = this.php_pop(stack_depth--);
			this.php_push (stack_depth++, el.innerHTML);
			break;

		case "document_setInnerHTML":
			var el = this.php_pop(stack_depth--);
			var val = this.php_pop(stack_depth--);
			el.innerHTML = val;
			break;

		case "wait_for_completion":
			this.cover = new cover;
			this.cover.open ();
			this.running = false;
			this.frame.saved_sp = stack_depth;
//			debugout ("suspending thread "+this.thread_id);
			break;

		case "wait_for_input":
			this.running = false;
//			debugout ("Suspending......\n\n");
			this.frame.saved_sp = stack_depth;
			break;

		case "alert":
			var msg = this.php_pop(stack_depth--);
			alert (msg);
			break;

		case "debugout":
			var msg = this.php_pop(stack_depth--);
			debugout (msg);
			break;

		case "strlen":
			var str = this.php_pop(stack_depth--);
			if (str === null) this.backtrace ("str is null");
			this.php_push (stack_depth++, str.length);
			break;

//		case "urlencode":
//			var s = this.php_pop(stack_depth--);
//			this.php_push (stack_depth++, encodeURIComponent(s));
//			break;

		case "addslashes":
			var s = this.php_pop(stack_depth--);
			this.php_push (stack_depth++, builtin__addslashes (s));
			break;

		case "htmlentities":
			var s = this.php_pop(stack_depth--);
			this.php_push (stack_depth++, builtin__htmlentities (s));
			break;

		case "urldecode":
			var s = this.php_pop(stack_depth--);
			s = s.replace (/\+/g, " ");
			this.php_push (stack_depth++, decodeURIComponent(s));
			break;

		case "is_array":
			var arr = this.php_pop(stack_depth--);
			if (arr === undefined || arr === null)
			{
				this.php_push (stack_depth++, false);
				break;
			}
			this.php_push (stack_depth++, arr.constructor == Array);
			break;

		case "in_array":
			var item = this.php_pop(stack_depth--);
			var arr = this.php_pop(stack_depth--);
			var res = false;
			for (var i in arr)
			{
				if (arr[i] == item)
				{
					res = true;
					break;
				}
			}
			this.php_push (stack_depth++, res);
			break;

		case "isset":
			var obj = this.php_pop(stack_depth--);
			this.php_push (stack_depth++, obj !== undefined);
			break;

		case "count":
			var obj = this.php_pop(stack_depth--);
			if (obj === undefined || obj === null)
			{
				this.backtrace ("obj is undefined");
				this.php_push (stack_depth++, 0);
				break;
			}
			this.php_push (stack_depth++, obj.length);
			break;

		case "intval":
			var n = this.php_pop(stack_depth--);
			this.php_push (stack_depth++, parseInt(n,10));
			break;


		case "get_class":
			var obj = this.php_pop(stack_depth--);
			this.php_push (stack_depth++, obj.classname);
			break;

		case "strstr":
			var haystack = this.php_pop(stack_depth--);
			var needle = this.php_pop(stack_depth--);
			var pos = haystack.indexOf (needle);
			if (pos == -1)
				this.php_push (stack_depth++, null);
			else
				this.php_push (stack_depth++, haystack.substr (pos));
			break;

		case "str_replace":
			var pattern = this.php_pop(stack_depth--);
			var replacement = this.php_pop(stack_depth--);
			var str = this.php_pop(stack_depth--);
			str = str.replace (pattern, replacement);
			this.php_push(stack_depth++, str);
			break;

		case "substr":
			if (nargs == 3)
			{
				var s = this.php_pop(stack_depth--);
				var start = this.php_pop(stack_depth--);
				var len = this.php_pop(stack_depth--);
				s = ""+s;
				var res = s.substr(start,len);
				this.php_push (stack_depth++, res);
			}
			else
			{
				var s = this.php_pop(stack_depth--);
				var start = this.php_pop(stack_depth--);
				s = ""+s;
				var res = s.substr(start,s.length-start);
				this.php_push (stack_depth++, res);
			}
			break;

		case "mktime":
			var hours = this.php_pop(stack_depth--);
			var mins = this.php_pop(stack_depth--);
			var secs = this.php_pop(stack_depth--);
			var month = this.php_pop(stack_depth--);
			var day = this.php_pop(stack_depth--);
			var year = this.php_pop(stack_depth--);
			var d = new Date (year, month-1, day, hours, mins, secs, 0);
			this.php_push (stack_depth++, d.valueOf() / 1000);
			break;

		case "date":
			var fmt = this.php_pop(stack_depth--);
			var val = builtin__time();
			if (nargs == 2)
				val = this.php_pop(stack_depth--);
			var res = builtin__date (fmt, val);
			this.php_push (stack_depth++, res);
			break;

		case "explode":
			var boundary = this.php_pop(stack_depth--);
			var str = "" + this.php_pop(stack_depth--);
			var res = str.split (boundary);
			this.php_push (stack_depth++, res);
			break;

		case "trace":
			this.tracing = this.php_pop(stack_depth--);
			break;

		case "array_splice":
			var arr = this.php_pop(stack_depth--);
			var offset = this.php_pop(stack_depth--);
			var len = this.php_pop(stack_depth--);
			if (len) arr.splice (offset, len);
			if (nargs == 4)
			{
				var replace = this.php_pop(stack_depth--);
				if (replace.constructor == Array)
				{
					for (i in replace)
					{
						var item = replace[i];
						arr.splice (parseInt(offset,10)+parseInt(i,10), 0, item);
					}
				}
				else
				{
					arr.splice (offset, 0, replace);
				}
			}
			this.php_push (stack_depth++, arr);
			break;

		case "sleep":
			var args = this.php_pop(stack_depth--);
			this.php_push (stack_depth++, args);
			this.php_static_method_call (stack_depth, lib, "sleep", 1);
			break;

		case "phpengine_call_static_method":
			var classname = this.php_pop(stack_depth--);
			var methodname = this.php_pop(stack_depth--);
			var args = this.php_pop(stack_depth--);
			this.php_push (stack_depth++, args);
			this.php_static_method_call (stack_depth, eval(classname), methodname, 1);
			break;

		case "phpengine_call_method":
			var nargs = this.php_pop(stack_depth--);
			var obj = this.php_pop(stack_depth--);
			var methodname = this.php_pop(stack_depth--);
			var args = this.php_pop(stack_depth--);
			this.php_push (stack_depth++, args);
			this.php_push (stack_depth++, methodname);
			this.php_push (stack_depth++, obj);
			this.php_method_call (stack_depth, nargs);
			break;

		case "call_user_func_array":
			var fn = this.php_pop(stack_depth--);
			var args = this.php_pop(stack_depth--);
			if (typeof(fn) == "object" && fn.constructor == Array)
			{
				var obj = fn[0];
				var method = fn[1];
				if (obj.constructor === String)
				{
					var classobj = eval(obj);
					this.smcall (stack_depth+args.length, classobj, method, args);
				}
				else
				{
					this.mcall (stack_depth+2+args.length, obj, method, args);
				}
			}
			else
			{
				throw "call_user_func_array can only do class members";
			}
			break;

//		case "ob_start":
//			if (window.__outbuffer !== undefined)
//			{
//				if (window.__outbuffer_stack === undefined)
//					window.__outbuffer_stack = new Array;
//				window.__outbuffer_stack.push (window.__outbuffer);
//			}
//			window.__outbuffer = "";
//			break;
//
//		case "ob_get_clean":
//			var value = window.__outbuffer;
//			if (window.__outbuffer_stack !== undefined)
//				window.__outbuffer = window.__outbuffer_stack.pop();
//			else
//				delete window.__outbuffer;
//			this.php_push (stack_depth++, value);
//			break;

		case "trim":
			var str = this.php_pop(stack_depth--);
			this.php_push (stack_depth++, builtin__trim(str));
			break;

		case "aarray":
			this.php_push (stack_depth++, new Object);
			break;

		default:
			var args = new Array;
			var i;
			for (i = 0; i < nargs; i++)
				args[args.length] = this.php_pop(stack_depth--);
			var f = eval("builtin__"+fn);
			var res = f.apply (null, args);
			this.php_push (stack_depth++, res);
			break;
		}
	}

	this.php_new = function (stack_depth, classname)
	{	
		this.php_push (stack_depth++, eval ("new "+classname));
	}

	this.php_deref_lvalue = function (stack_depth)
	{
		var obj = this.php_pop(stack_depth--);
		var fieldname = this.php_pop(stack_depth--);
		this.php_push (stack_depth++, ({obj:obj, field:fieldname}));
	}

	this.php_push_int = function (stack_depth, i)
	{
		this.php_push (stack_depth++, i);
	}

	this.php_push_null = function (stack_depth)
	{
		this.php_push (stack_depth++, null);
	}

	this.php_push_true = function (stack_depth)
	{
		this.php_push (stack_depth++, true);
	}

	this.php_push_false = function (stack_depth)
	{
		this.php_push (stack_depth++, false);
	}

	this.php_push_static_var_lvalue = function (stack_depth, classobj, name)
	{
		this.php_push (stack_depth++, ({obj:classobj, field:name}));
	}

	this.php_push_var_lvalue = function (stack_depth, name)
	{
		this.php_push (stack_depth++, ({obj:this.frame.v, field:name}));
	}

	this.php_push_global_lvalue = function (stack_depth, name)
	{
		this.php_push (stack_depth++, ({obj:null, field:name}));
	}

	this.php_push_static_var = function (stack_depth, classobj, name)
	{
		var val = classobj[name];
		this.php_push (stack_depth++, val);
	}

	this.php_push_var = function (stack_depth, name)
	{
		var val = this.frame.v[name];
		this.php_push (stack_depth++, val);
	}

	this.php_push_global = function (stack_depth, name)
	{
		var val = eval(name);
		this.php_push (stack_depth, val);
	}

	this.enumkeys = function (arr)
	{
		var keys = new Array;
		for (key in arr) keys[keys.length] = key;
		return keys;
	}


	this.php_enumerate_keys = function (stack_depth)
	{
		var arr = this.php_pop(stack_depth--);
		var keys = this.enumkeys(arr);
		this.php_push (stack_depth++, keys);
	}

	this.php_shift = function (stack_depth)
	{
		var arr = this.php_pop(stack_depth--);
		this.php_push (stack_depth++, arr.shift());
	}

	this.php_self = function (stack_depth, classname)
	{
		this.php_push (stack_depth++, classname);
	}

	this.php_postinc = function (stack_depth)
	{
		var target = this.php_pop (stack_depth--);
		this.php_push (stack_depth++, target.obj[target.field]++);
	}

	this.php_index = function (stack_depth)
	{
		var arr = this.php_pop(stack_depth--);
		var ind = this.php_pop(stack_depth--);
		if (arr === null || arr === undefined || ind === undefined) this.backtrace ("index");
		this.php_push (stack_depth++, arr[ind]);
	}

	this.php_index_lvalue = function (stack_depth)
	{
		var arr = this.php_pop(stack_depth--);
		var ind = this.php_pop(stack_depth--);
		var res = {obj:arr, field: ind};
		this.php_push (stack_depth++, res);
	}


	this.php_nextindex = function (stack_depth)
	{
		var arr = this.php_pop(stack_depth--);
		this.php_push (stack_depth++, arr[arr.length-1]);
	}

	this.php_nextindex_lvalue = function (stack_depth)
	{
		var arr = this.php_pop(stack_depth--);
		if (arr == undefined) this.backtrace("arr is undefined in nextindex_lvalue");
		var res = {obj:arr, field: (arr.length)};
		this.php_push (stack_depth++, res);
	}

	this.php_array_count = function (stack_depth)
	{
		var arr = this.php_pop(stack_depth--);
		this.php_push (stack_depth++, arr.length);
	}

	this.php_postdec = function (stack_depth)
	{
		var target = this.php_pop(stack_depth--);
		this.php_push (stack_depth++, target.obj[target.field]);
		target.obj[target.field]--;
	}

	this.php_assign = function (stack_depth)
	{
		var target = this.php_pop (stack_depth--);
		var value = this.php_pop (stack_depth--);
		if (value === undefined) this.backtrace ("value written to "+target.obj+" field "+target.field+" is undefined ");
		if (target.obj === undefined) this.backtrace ("Target is undefined");
		try
		{
			target.obj[target.field] = value;
		}
		catch (err)
		{
			this.backtrace (err);
		}
		this.php_push (stack_depth++, value);
	}

	this.php_not = function (stack_depth)
	{
		var value = this.php_pop(stack_depth--);
		this.php_push (stack_depth++, !value);
	}

	this.php_two_op = function (stack_depth, op)
	{
		var value1 = this.php_pop(stack_depth--);
		var value2 = this.php_pop(stack_depth--);
		var res;
		if (op == ".")
		{
			res = (""+value1)+value2;
		}
		else if (op == "==")
		{
			res = value1 == value2;
		}
		else if (op == "===")
		{
			res = value1 === value2;
		}
		else if (op == "!==")
		{
			res = value1 !== value2;
		}
		else if (op == "!=")
		{
			res = value1 != value2;
		}
		else if (op == "+")
		{
			res = parseInt(value1,10) + parseInt(value2,10);
		}
		else if (op == "||")
		{
			res = value1 || value2;
		}
		else if (op == "&&")
		{
			res = value1 && value2;
		}
		else
		{
			if (typeof value1 == "string")
				res = eval ("\""+value1+"\" "+op+" \""+value2+"\"");
			else
				res = eval (value1+" "+op+" "+value2);
		}
		this.php_push (stack_depth++, res);
	}

	this.php_deref = function (stack_depth)
	{
		var obj = this.php_pop(stack_depth--);
		var field = this.php_pop(stack_depth--);
		if (obj === undefined || obj === null)
		{
			this.backtrace ("obj is not valid in deref of field "+field);
			this.php_push (stack_depth++, null);
			return;
		}
		this.php_push (stack_depth++, obj[field]);
	}

	this.php_push = function (stack_depth, val)
	{
		this.frame.s[stack_depth] = val;
	}

	this.php_pop = function (stack_depth)
	{
		var value = this.frame.s[stack_depth-1];
		this.frame.s[stack_depth-1] = null;
		return value;
	}

	this.php_push_string = function (stack_depth, str)
	{
		this.php_push (stack_depth++, str);
	}

//	this.php_echo = function (stack_depth)
//	{
//		if (window.__outbuffer !== undefined)
//			window.__outbuffer += this.php_pop(stack_depth);
//		else
//			debugout (this.php_pop (stack_depth));
//	}

	this.php_array_first = function (stack_depth)
	{
		var arr = this.php_pop (stack_depth--);
		this.php_push (stack_depth++, 0);	// FIXME
	}

	this.resume = function (action,parm)
	{
		if (this.cover)
		{
			this.cover.close ();
			this.cover = null;
		}
		var stack_depth = this.frame.saved_sp;
		this.php_push (stack_depth++, {"action":action, "parm":parm});
//		debugout ("Resume called, action = "+action+", parm = "+parm);
		this.run();
		return false;
	}

}

php_engine.started_threads = 1;

php_engine.start_static = function (classname, funcname, args)
{
	asyncnotify.thread_starting();
//	debugout ("start_static called with classname="+classname+", funcname="+funcname);
//	var p = new php_engine (eval (classname+".inst__"+funcname));
	var p = new php_engine (null);
	var stack_depth = 0;
	php_engine.threads.push(p);
	for (i = args.length; i; i--)
		p.php_push (stack_depth++, args[i-1]);
	p.php_static_method_call (stack_depth, eval(classname), funcname, args.length);
	p.run();
}

php_engine.start = function (obj, funcname, args)
{
	asyncnotify.thread_starting();
//	debugout ("start called on method"+funcname);
	var p = new php_engine (null);
	php_engine.threads.push(p);
	var stack_depth = 0;
	for (i = args.length; i; i--)
		p.php_push (stack_depth++, args[i-1]);
	p.php_push (stack_depth++, funcname);
	p.php_push (stack_depth++, obj);
	p.php_method_call (stack_depth, args.length);
	p.run();
}

php_engine.get_current_thread_id = function ()
{
	return php_engine.current_thread.thread_id;
}

php_engine.find_thread = function (tid)
{
	var i;
	for (i = 0; i < php_engine.threads.length; i++)
	{
		var t = php_engine.threads[i];
		if (t.thread_id == tid)
		{
			return t;
		}
	}
	return null;
}

php_engine.destroy_thread = function (tid)
{
	var t = php_engine.find_thread (tid);
	if (t) t.destroy ();
}

php_engine.resume_thread = function (tid, action, parm)
{
//	debugout ("Trying to resume thread "+tid+" with action "+action);
	var t = php_engine.find_thread (tid);
	if (t !== null)
	{
		t.resume (action, parm);
		return false;
	}
//	alert ("Failed to resume thread "+tid);
	debugout ("Failed to resume thread "+tid);
	return false;
}


php_engine.resume = function (action, parm)
{
	php_engine.threads[php_engine.threads.length-1].resume (action,parm);
	return false;
}

php_engine.error_handler = function (msg, file, line)
{
	alert ("Internal error: "+msg+", "+file+", "+line);
	debugout ("Internal error: "+msg+", "+file+", "+line);
	php_engine.current_thread.backtrace (msg);
}

php_engine.threads = new Array;




function popup_card ()
{
	this.popup = new popup(this);

	this.render_popup = function ()
	{
		var p = rpc_get_user_info (this.uid);

		html = "<div class=\"addressCard\">";
		html += "<div class=\"addressCardTitle\" style=\"font-size:16px\">"+p.nname+" "+p.sname+"</div>";
		html += "<div class=\"addressCardInfo\">";
		if (p.address1 != "") html += p.address1+"<br/>";
		if (p.address2 != "") html += p.address2+"<br/>";
		if (p.address3 != "") html += p.address3+"<br/>";
		if (p.address4 != "") html += p.address4+"<br/>";
		if (p.postalcode != "")
		{
			var mapref = "http://maps.google.co.uk/maps?q="+encodeURIComponent (p.postalcode);
			html += "<a href=\""+mapref+"\" target=\"_blank\">"+p.postalcode+"</a><br/>";
		}
		html += "</div>";
		if (p.telephone != "")
		{
			var num = p.telephone.replace (/ /, "");
			var callref = "callto:"+num+"+type=phone";
			html += "<div class=\"addressCardInfo\">Telephone: <a href=\""+callref+"\">"+p.telephone+"</a></div>";
		}
		if (p.mobile != "")
		{
			var num = p.mobile.replace (/ /, "");
			var callref = "callto:"+num+"+type=phone";
			html += "<div class=\"addressCardInfo\">Mobile: <a href=\""+callref+"\">"+p.mobile+"</a></div>";
		}
		if (p.email != "") html += "<div class=\"addressCardInfo\">Email: <a href=\"mailto:"+p.email+"\">"+p.email+"</a></div>";
		html += "</div>";
		return html;
	}

	this.popup_event = function (event, uid)
	{
		this.uid = uid;
		this.popup.popup (event,300,200);
	}

	this.popup_at = function (x, y, uid)
	{
		this.uid = uid;
		this.popup.popup_at (x,y,300,200);
	}

	this.popup_over = function (el, uid)
	{
		this.uid = uid;
		this.popup.popup_over (el, 300, 200);
	}
}


/**
 * *
 * *  Secure Hash Algorithm (SHA1)
 * *  http://www.webtoolkit.info/
 * *
 * **/
 
function SHA1 (msg) {
 
	function rotate_left(n,s) {
		var t4 = ( n<<s ) | (n>>>(32-s));
		return t4;
	};
 
	function lsb_hex(val) {
		var str="";
		var i;
		var vh;
		var vl;
 
		for( i=0; i<=6; i+=2 ) {
			vh = (val>>>(i*4+4))&0x0f;
			vl = (val>>>(i*4))&0x0f;
			str += vh.toString(16) + vl.toString(16);
		}
		return str;
	};
 
	function cvt_hex(val) {
		var str="";
		var i;
		var v;
 
		for( i=7; i>=0; i-- ) {
			v = (val>>>(i*4))&0x0f;
			str += v.toString(16);
		}
		return str;
	};
 
 
	function Utf8Encode(string) {
		string = string.replace(/\r\n/g,"\n");
		var utftext = "";
 
		for (var n = 0; n < string.length; n++) {
 
			var c = string.charCodeAt(n);
 
			if (c < 128) {
				utftext += String.fromCharCode(c);
			}
			else if((c > 127) && (c < 2048)) {
				utftext += String.fromCharCode((c >> 6) | 192);
				utftext += String.fromCharCode((c & 63) | 128);
			}
			else {
				utftext += String.fromCharCode((c >> 12) | 224);
				utftext += String.fromCharCode(((c >> 6) & 63) | 128);
				utftext += String.fromCharCode((c & 63) | 128);
			}
 
		}
 
		return utftext;
	};
 
	var blockstart;
	var i, j;
	var W = new Array(80);
	var H0 = 0x67452301;
	var H1 = 0xEFCDAB89;
	var H2 = 0x98BADCFE;
	var H3 = 0x10325476;
	var H4 = 0xC3D2E1F0;
	var A, B, C, D, E;
	var temp;
 
	msg = Utf8Encode(msg);
 
	var msg_len = msg.length;
 
	var word_array = new Array();
	for( i=0; i<msg_len-3; i+=4 ) {
		j = msg.charCodeAt(i)<<24 | msg.charCodeAt(i+1)<<16 |
		msg.charCodeAt(i+2)<<8 | msg.charCodeAt(i+3);
		word_array.push( j );
	}
 
	switch( msg_len % 4 ) {
		case 0:
			i = 0x080000000;
		break;
		case 1:
			i = msg.charCodeAt(msg_len-1)<<24 | 0x0800000;
		break;
 
		case 2:
			i = msg.charCodeAt(msg_len-2)<<24 | msg.charCodeAt(msg_len-1)<<16 | 0x08000;
		break;
 
		case 3:
			i = msg.charCodeAt(msg_len-3)<<24 | msg.charCodeAt(msg_len-2)<<16 | msg.charCodeAt(msg_len-1)<<8	| 0x80;
		break;
	}
 
	word_array.push( i );
 
	while( (word_array.length % 16) != 14 ) word_array.push( 0 );
 
	word_array.push( msg_len>>>29 );
	word_array.push( (msg_len<<3)&0x0ffffffff );
 
 
	for ( blockstart=0; blockstart<word_array.length; blockstart+=16 ) {
 
		for( i=0; i<16; i++ ) W[i] = word_array[blockstart+i];
		for( i=16; i<=79; i++ ) W[i] = rotate_left(W[i-3] ^ W[i-8] ^ W[i-14] ^ W[i-16], 1);
 
		A = H0;
		B = H1;
		C = H2;
		D = H3;
		E = H4;
 
		for( i= 0; i<=19; i++ ) {
			temp = (rotate_left(A,5) + ((B&C) | (~B&D)) + E + W[i] + 0x5A827999) & 0x0ffffffff;
			E = D;
			D = C;
			C = rotate_left(B,30);
			B = A;
			A = temp;
		}
 
		for( i=20; i<=39; i++ ) {
			temp = (rotate_left(A,5) + (B ^ C ^ D) + E + W[i] + 0x6ED9EBA1) & 0x0ffffffff;
			E = D;
			D = C;
			C = rotate_left(B,30);
			B = A;
			A = temp;
		}
 
		for( i=40; i<=59; i++ ) {
			temp = (rotate_left(A,5) + ((B&C) | (B&D) | (C&D)) + E + W[i] + 0x8F1BBCDC) & 0x0ffffffff;
			E = D;
			D = C;
			C = rotate_left(B,30);
			B = A;
			A = temp;
		}
 
		for( i=60; i<=79; i++ ) {
			temp = (rotate_left(A,5) + (B ^ C ^ D) + E + W[i] + 0xCA62C1D6) & 0x0ffffffff;
			E = D;
			D = C;
			C = rotate_left(B,30);
			B = A;
			A = temp;
		}
 
		H0 = (H0 + A) & 0x0ffffffff;
		H1 = (H1 + B) & 0x0ffffffff;
		H2 = (H2 + C) & 0x0ffffffff;
		H3 = (H3 + D) & 0x0ffffffff;
		H4 = (H4 + E) & 0x0ffffffff;
 
	}
 
	var temp = cvt_hex(H0) + cvt_hex(H1) + cvt_hex(H2) + cvt_hex(H3) + cvt_hex(H4);
 
	return temp.toLowerCase();
 
}

function uploadCompleted ()
{
	uploader.upload_completed();
}

function rpcclass () { this.do_construct (arguments); }
rpcclass.init_methods = function (c) {
	var cp = c.prototype;
	cp.get_id =  function ()
	{
{
		return (this.obj_id);
		}
			}

;
	c.args__flatten = c.pargs__flatten =  ["parm"];
	c.inst__flatten = c.pinst__flatten =  [
/*0*/	function (e,f) { if (builtin__is_array (f.v.parm)) f.pc=1; else f.pc=26; },
	function (e,f) {
		f.v.res = "(";
		f.v.numeric_keys = true;
		f.v.max = 0;
		f.v._k2 = e.enumkeys (f.v.parm);
	},
	function (e,f) {
		f.pc=4;
		if (!((f.v._k2).length)) f.pc=3;
	},
	function (e,f) { if (f.v.numeric_keys) f.pc=22; else f.pc=23; },
	function (e,f) {
		f.v.key = (f.v._k2).shift();
		f.v.value = (f.v.parm)[(f.v.key)];
		if (!(builtin__is_numeric (f.v.key))) f.pc=5; else f.pc=6;
	},
/*5*/	function (e,f) {
		f.pc=3;
		f.v.numeric_keys = false;
	},
	function (e,f) { if (((f.v.key)) > ((f.v.max))) f.pc=7; else f.pc=2; },
	function (e,f) {
		f.pc=2;
		f.v.max = f.v.key;
	},
	function (e,f) {
		f.v.res = "" + (f.v.res) + ("[");
		f.v.need_comma = false;
		f.v._k4 = e.enumkeys (f.v.parm);
	},
	function (e,f) {
		f.pc=11;
		if (!((f.v._k4).length)) f.pc=10;
	},
/*10*/	function (e,f) {
		f.pc=25;
		f.v.res = "" + (f.v.res) + ("]");
	},
	function (e,f) {
		f.v._i5 = (f.v._k4).shift();
		f.v.p = (f.v.parm)[(f.v._i5)];
		if (f.v.need_comma) f.pc=12; else f.pc=13;
	},
	function (e,f) { f.v.res = "" + (f.v.res) + (","); },
	function (e,f) { e.smcall (1, rpcclass,"flatten", ([f.v.p])); },
	function (e,f) {
		f.pc=9;
		var t16 = f.s[0]; 
		f.v.res = "" + (f.v.res) + (t16);
		f.v.need_comma = true;
	},
/*15*/	function (e,f) {
		f.v.res = "" + (f.v.res) + ("{");
		f.v.need_comma = false;
		f.v._k6 = e.enumkeys (f.v.parm);
	},
	function (e,f) {
		f.pc=18;
		if (!((f.v._k6).length)) f.pc=17;
	},
	function (e,f) {
		f.pc=25;
		f.v.res = "" + (f.v.res) + ("}");
	},
	function (e,f) {
		f.v.key = (f.v._k6).shift();
		f.v.p = (f.v.parm)[(f.v.key)];
		if (f.v.need_comma) f.pc=19; else f.pc=20;
	},
	function (e,f) { f.v.res = "" + (f.v.res) + (","); },
/*20*/	function (e,f) { e.smcall (1, rpcclass,"flatten", ([f.v.p])); },
	function (e,f) {
		f.pc=16;
		var t26 = f.s[0]; 
		f.v.res = "" + (f.v.res) + (("'") + ("" + (f.v.key) + (("':") + (t26))));
		f.v.need_comma = true;
	},
	function (e,f) {
		f.pc=24;
		f.s[0] = ((parseInt((f.v.max),10) + parseInt((1),10))) == ((builtin__count (f.v.parm)));
	},
	function (e,f) { f.s[0] = false; },
	function (e,f) { var t29 = f.s[0]; if (t29) f.pc=8; else f.pc=15; },
/*25*/	function (e,f) {
		f.v.res = "" + (f.v.res) + (")");
		e.return_pop (f.v.res);
	},
	function (e,f) { if (((f.v.parm)) === ((null))) f.pc=27; else f.pc=28; },
	function (e,f) {
		f.pc=32;
		f.v.res = "null";
	},
	function (e,f) { if (((f.v.parm).obj_id) !== undefined) f.pc=29; else f.pc=31; },
	function (e,f) { e.mcall (2, f.v.parm, "render_gobi", ([])); },
/*30*/	function (e,f) {
		f.pc=32;
		var t33 = f.s[0]; f.v.res = t33;
	},
	function (e,f) {
		f.v.parm = builtin__str_replace ("\\","\\\\",f.v.parm);
		f.v.parm = builtin__str_replace ("'","\\'",f.v.parm);
		f.v.parm = builtin__str_replace ("\"","\\x22",f.v.parm);
		f.v.res = ("'") + ("" + (f.v.parm) + ("'"));
	},
	function (e,f) { e.return_pop (f.v.res); },
null	];

;
	cp.make_start_engine =  function (method,parm)
	{
		var me = this;
		return function () { return rpcclass.start_engine (me, null, me.classname, me.get_id(), method, null); };
			}

;
	cp.bind =  function (el,eventtype,handler)
	{
		$(el).bind (eventtype, handler);
			}

;
	cp.unbind =  function (el,eventtype,handler)
	{
		$(el).unbind (eventtype, handler);
			}

;
	c.pargs__handler =  ["method","parm"];
	c.pinst__handler =  [
/*0*/	function (e,f) {
		f.s[0] = ")";
		e.smcall (2, rpcclass,"flatten", ([f.v.parm]));
	},
	function (e,f) {
		var t38 = f.s[1]; var t39 = f.s[0]; 
		f.s[0] = ("', '") + ("" + (f.v.method) + (("', ") + ("" + (t38) + (t39))));
		e.mcall (3, f.v["this"], "get_id", ([]));
	},
	function (e,f) {
		var t40 = f.s[1]; var t41 = f.s[0]; 
		e.return_pop (("return rpcclass.call_handler (this, event, '") + ("" + ((f.v["this"]).classname) + (("', '") + ("" + (t40) + (t41)))));
	},
null	];

;
	c.pargs__render_start_sync =  ["method","parm"];
	c.pinst__render_start_sync =  [
/*0*/	function (e,f) {
		f.s[0] = ")";
		e.smcall (2, rpcclass,"flatten", ([f.v.parm]));
	},
	function (e,f) {
		var t42 = f.s[1]; var t43 = f.s[0]; 
		f.s[0] = ("', '") + ("" + (f.v.method) + (("', ") + ("" + (t42) + (t43))));
		e.mcall (3, f.v["this"], "get_id", ([]));
	},
	function (e,f) {
		var t44 = f.s[1]; var t45 = f.s[0]; 
		e.return_pop (("return rpcclass.call_sync (this, event, '") + ("" + ((f.v["this"]).classname) + (("', '") + ("" + (t44) + (t45)))));
	},
null	];

;
	c.pargs__render_start =  ["method","parm"];
	c.pinst__render_start =  [
/*0*/	function (e,f) {
		f.s[0] = ")";
		e.smcall (2, rpcclass,"flatten", ([f.v.parm]));
	},
	function (e,f) {
		var t46 = f.s[1]; var t47 = f.s[0]; 
		f.s[0] = ("', '") + ("" + (f.v.method) + (("', ") + ("" + (t46) + (t47))));
		e.mcall (3, f.v["this"], "get_id", ([]));
	},
	function (e,f) {
		var t48 = f.s[1]; var t49 = f.s[0]; 
		e.return_pop (("return rpcclass.start_engine (this, event, '") + ("" + ((f.v["this"]).classname) + (("', '") + ("" + (t48) + (t49)))));
	},
null	];

;
	c.args__render_start_static = c.pargs__render_start_static =  ["classname","method","parm"];
	c.inst__render_start_static = c.pinst__render_start_static =  [
/*0*/	function (e,f) {
		f.s[0] = ")";
		e.smcall (2, rpcclass,"flatten", ([f.v.parm]));
	},
	function (e,f) {
		var t50 = f.s[1]; var t51 = f.s[0]; 
		e.return_pop (("return rpcclass.start_engine_static (this, event, '") + ("" + (f.v.classname) + (("', '") + ("" + (f.v.method) + (("', ") + ("" + (t50) + (t51)))))));
	},
null	];

;
	c.args__render_resume = c.pargs__render_resume =  ["action","parm"];
	c.inst__render_resume = c.pinst__render_resume =  [
/*0*/	function (e,f) {
		f.s[0] = ")";
		e.smcall (2, rpcclass,"flatten", ([f.v.parm]));
	},
	function (e,f) {
		var t52 = f.s[1]; var t53 = f.s[0]; 
		f.s[0] = (",'") + ("" + (f.v.action) + (("',") + ("" + (t52) + (t53))));
		e.smcall (1, php_engine,"get_current_thread_id", ([]));
	},
	function (e,f) {
		var t54 = f.s[1]; var t55 = f.s[0]; 
		e.return_pop (("return rpcclass.resume_thread (this, event, ") + ("" + (t54) + (t55)));
	},
null	];

;
	c.resume_thread = cp.resume_thread =  function (el,event,threadid,action,parm)
	{
		if (typeof event === "undefined") event = window.event;
//		if (el) popup.set_default_element (el);
//		popup.set_default_event (event);
		return php_engine.resume_thread (threadid, action, parm);
			}

;
	c.args__render_resume_ev = c.pargs__render_resume_ev =  ["action","parm"];
	c.inst__render_resume_ev = c.pinst__render_resume_ev =  [
/*0*/	function (e,f) {
		f.s[0] = ")";
		e.smcall (2, rpcclass,"flatten", ([f.v.parm]));
	},
	function (e,f) {
		var t56 = f.s[1]; var t57 = f.s[0]; 
		f.s[0] = (",'") + ("" + (f.v.action) + (("',") + ("" + (t56) + (t57))));
		e.smcall (1, php_engine,"get_current_thread_id", ([]));
	},
	function (e,f) {
		var t58 = f.s[1]; var t59 = f.s[0]; 
		e.return_pop (("return rpcclass.resume_thread_ev (this, event, ") + ("" + (t58) + (t59)));
	},
null	];

;
	c.resume_thread_ev = cp.resume_thread_ev =  function (el,event,threadid,action,parm)
	{
		if (typeof event === "undefined") event = window.event;
//		if (el) popup.set_default_element (el);
		rpcclass.last_resume_el = el;
		rpcclass.last_resume_x = event.clientX;
		rpcclass.last_resume_y = event.clientY;
		rpcclass.last_resume_ctrlkey = event.ctrlKey;
		popup.set_default_event (event);
		return php_engine.resume_thread (threadid, action, parm);
			}

;
	c.call_sync = cp.call_sync =  function (el,event,classname,objid,method,args)
	{
		if (typeof event === "undefined") event = window.event;
//		if (el) popup.set_default_element (el);
		if (event !== null) popup.set_default_event (event);
		if (rpcclass.classes[classname] == undefined)
		{
			alert ("Unexpected unknown class "+classname);
			throw new Error ("Unexpected unknown class "+classname);
		}
		if (objid == null)
		{
			alert ("Attempt to call method of "+classname+" with null objid");
			throw new Error ("Attempt to call "+classname+"::"+method+" with null objid");
		}
		if (rpcclass.classes[classname].objects[objid] == undefined)
			throw new Error ("Attempt to start engine on "+classname+"::"+objid+" which does not exist");
		return rpcclass.classes[classname].objects[objid][method] (el, args, event);
			}

;
	c.start_engine = cp.start_engine =  function (el,event,classname,objid,method,args)
	{
		if (typeof event === "undefined") event = window.event;
		if (event !== null)
		{
			rpcclass.last_start_el = el;
			rpcclass.last_start_x = event.clientX + browser.scroll_left();
			rpcclass.last_start_y = event.clientY + browser.scroll_top();
			rpcclass.last_start_ctrlkey = event.ctrlKey;
			popup.set_default_event (event);
			if (event.preventDefault) event.preventDefault();
			else event.returnResult = false;
			if (event.stopPropagation) event.stopPropagation();
			else event.cancelBubble = true;
		}
		if (rpcclass.classes[classname] == undefined)
		{
			alert ("Unexpected unknown class "+classname);
			throw new Error ("Unexpected unknown class "+classname);
		}
		if (objid == null)
		{
			alert ("Attempt to call method of "+classname+" with null objid");
			throw new Error ("Attempt to call "+classname+"::"+method+" with null objid");
		}
		if (rpcclass.classes[classname].objects[objid] == undefined)
			throw new Error ("Attempt to start engine on "+classname+"::"+objid+" which does not exist");
		var all_args = [el, args, event];
		php_engine.start (rpcclass.classes[classname].objects[objid], method, all_args);
		return false;
			}

;
	cp.start_timeout_callback_sync =  function (interval,method,parm)
	{
{
		;
		return (window.setTimeout  ("rpcclass.start_engine (this, null, '" + builtin__get_class (this) + "', '" + this.get_id  () + "', '" + method + "', null)",interval));
		}
			}

;
	c.pargs__start_timeout_callback =  ["interval","method","parm"];
	c.pinst__start_timeout_callback =  [
/*0*/	function (e,f) {
		f.s[0] = f.v.interval;
		f.s[1] = ")";
		e.smcall (3, rpcclass,"flatten", ([f.v.parm]));
	},
	function (e,f) {
		var t60 = f.s[2]; var t61 = f.s[1]; 
		f.s[1] = ("', '") + ("" + (f.v.method) + (("', ") + ("" + (t60) + (t61))));
		e.mcall (4, f.v["this"], "get_id", ([]));
	},
	function (e,f) {
		var t62 = f.s[2]; var t63 = f.s[1]; 
		var t64 = f.s[0]; e.mcall (4, window, "setTimeout", ([("rpcclass.start_engine (this, null, '") + ("" + ((f.v["this"]).classname) + (("', '") + ("" + (t62) + (t63)))), t64]));
	},
	function (e,f) { var t65 = f.s[0]; e.return_pop (t65); },
null	];

;
	c.pargs__stop_timeout =  ["timer"];
	c.pinst__stop_timeout =  [
/*0*/	function (e,f) { e.mcall (3, window, "clearTimeout", ([f.v.timer])); },
null	];

;
	c.pargs__start_interval_timer_callback =  ["interval","method","parm"];
	c.pinst__start_interval_timer_callback =  [
/*0*/	function (e,f) {
		f.s[0] = f.v.interval;
		f.s[1] = ")";
		e.smcall (3, rpcclass,"flatten", ([f.v.parm]));
	},
	function (e,f) {
		var t66 = f.s[2]; var t67 = f.s[1]; 
		f.s[1] = ("', '") + ("" + (f.v.method) + (("', ") + ("" + (t66) + (t67))));
		e.mcall (4, f.v["this"], "get_id", ([]));
	},
	function (e,f) {
		var t68 = f.s[2]; var t69 = f.s[1]; 
		var t70 = f.s[0]; e.mcall (4, window, "setInterval", ([("rpcclass.start_engine (this, null, '") + ("" + ((f.v["this"]).classname) + (("', '") + ("" + (t68) + (t69)))), t70]));
	},
	function (e,f) { var t71 = f.s[0]; e.return_pop (t71); },
null	];

;
	c.interval_timer = cp.interval_timer =  function (tid,val)
	{
		php_engine.resume_thread (tid, val, null);
			}

;
	c.args__stop_interval_timer = c.pargs__stop_interval_timer =  ["timer"];
	c.inst__stop_interval_timer = c.pinst__stop_interval_timer =  [
/*0*/	function (e,f) { e.mcall (3, window, "clearInterval", ([f.v.timer])); },
null	];

;
	c.args__start_interval_timer = c.pargs__start_interval_timer =  ["interval","resume_val"];
	c.inst__start_interval_timer = c.pinst__start_interval_timer =  [
/*0*/	function (e,f) {
		f.s[0] = f.v.interval;
		f.s[1] = (", '") + ("" + (f.v.resume_val) + ("')"));
		e.smcall (2, php_engine,"get_current_thread_id", ([]));
	},
	function (e,f) {
		var t72 = f.s[2]; var t73 = f.s[1]; 
		var t74 = f.s[0]; e.mcall (4, window, "setInterval", ([("rpcclass.interval_timer (") + ("" + (t72) + (t73)), t74]));
	},
	function (e,f) { var t75 = f.s[0]; e.return_pop (t75); },
null	];

;
	c.start_engine_static = cp.start_engine_static =  function (el,event,classname,method,args)
	{
//		if (el) popup.set_default_element (el);
		if (typeof event === "undefined") event = window.event;
		if (event !== null)
		{
			popup.set_default_event (event);
			rpcclass.last_start_el = el;
			rpcclass.last_start_x = event.clientX + browser.scroll_left();
			rpcclass.last_start_y = event.clientY + browser.scroll_top();
			rpcclass.last_start_ctrlkey = event.ctrlKey;
		}
		if (rpcclass.classes[classname] == undefined)
		{
			alert ("Unexpected unknown class "+classname);
			throw new Error ("Unexpected unknown class "+classname);
		}
		var all_args = [el, args, event];
		php_engine.start_static (classname, method, all_args);
		return false;
			}

;
	cp.call_self_using_engine =  function (method,args)
	{
		php_engine.start (this, method, args);
			}

;
	c.do_call_on_load = cp.do_call_on_load =  function ()
	{
		for (i in rpcclass.call_on_load_list)
		{
			var item = rpcclass.call_on_load_list[i];
			var cls = eval (item.classname);
			if (item.sync)
				cls[item.method] (eval (item.arg));
			else
				rpcclass.start_engine_static (null, null, item.classname, item.method, eval (item.arg));
		}
			}

;
	c.lookup_object = cp.lookup_object =  function (classname,field,value)
	{
		if (rpcclass.classes[classname] === undefined) throw "Undefined class: "+classname;
		for (objid in rpcclass.classes[classname].objects)
		{
			if (rpcclass.classes[classname].objects[objid][field] == value)
				return rpcclass.classes[classname].objects[objid];
		}
		return null;
			}

;
	cp.toString =  function ()
	{
		return "["+this.classname+" object "+this.obj_id+"]";
			}

;
	cp.do_construct =  function (args)
	{
		if (args.length != 0)
			this.obj_id = args[0];
		else
			this.obj_id = "JS"+(rpcclass.uniq());
		rpcclass.register (this);
			}

;
	c.register = cp.register =  function (obj)
	{
		if (obj == undefined || rpcclass.classes[obj.classname] == undefined)
		{
			debugout ("rpcclass::register called with bad argument from "+arguments.callee.caller.toString());
			return;
		}
		rpcclass.classes[obj.classname].objects[obj.obj_id] = obj;
			}

;
	c.call_method_by_name = cp.call_method_by_name =  function (classname,objid,method,args)
	{
		if (rpcclass.classes[classname] == undefined)
		{
			alert ("Unexpected unknown class "+classname);
			throw new Error ("Unexpected unknown class "+classname);
		}
		if (objid == null)
		{
			alert ("Attempt to call method of "+classname+" with null objid");
			throw new Error ("Attempt to call "+classname+"::"+method+" with null objid");
		}
		if (rpcclass.classes[classname].objects[objid] == undefined)
		{
			debugout ("class "+classname+" object "+objid+" is not defined during call_method_by_name method = "+method);
			throw new Error ("class "+classname+" object "+objid+" is not defined during call_method_by_name method = "+method);
		}
		return rpcclass.classes[classname].objects[objid][method] (args);
			}

;
	c.args__call_static_method = c.pargs__call_static_method =  ["classname","method","args"];
	c.inst__call_static_method = c.pinst__call_static_method =  [
/*0*/	function (e,f) {
		f.s[0] = f.v.args;
		f.s[1] = f.v.method;
		f.s[2] = f.v.classname;
		e.php_builtin (3, "phpengine_call_static_method", 3);
	},
	function (e,f) { var t76 = f.s[0]; e.return_pop (t76); },
null	];

;
	c.uniq = cp.uniq =  function ()
	{
		if (window.rpc_uniq === undefined)
		{
			var d = new Date;
			window.rpc_uniq = (d.getTime() % 10000) * 100;
		}
		return ++window.rpc_uniq;
			}

;
	c.define_classes = cp.define_classes =  function (classnames)
	{
	}

;
	c.setup_class = cp.setup_class =  function (cls,classname,is_readonly,props,proptypes)
	{
		var cp = cls.prototype;
		cp.classname = classname;
		cp.rpcprops = props;
		cp.rpcproptypes = proptypes;
		cp.class_is_readonly = is_readonly;
		var classdef = new Object;
		classdef.classname = classname;
		classdef.constructor = cp.constructor;
		classdef.objects = new Object;
		if (rpcclass.classes == undefined) rpcclass.classes = new Object;
		rpcclass.classes[classname] = classdef;
			}

;
	c.get_classname = cp.get_classname =  function (obj)
	{
		var i;
		for (name in rpcclass.classes)
		{
			if (rpcclass.classes[name].constructor == obj.constructor)
			{
				return name;
			}
		}
		return null;
			}

;
	cp.uji =  function (fields)
	{
		this.unserialize_js_init (fields);
			}

;
	c.download_object = cp.download_object =  function (classname,objid,fields)
	{
		var xobj = rpcclass.get_object_by_id (classname, objid);
		xobj.unserialize_js_init (fields);
			}

;
	c.object_present = cp.object_present =  function (classname,objid)
	{
		return (rpcclass.classes[classname].objects[objid] !== undefined);
			}

;
	c.get_object_by_id = cp.get_object_by_id =  function (classname,objid)
	{
		if (objid == 0) return null;
		if (rpcclass.classes[classname].objects[objid] == undefined)
		{
			var obj = new rpcclass.classes[classname].constructor (objid);
			rpcclass.classes[classname].objects[objid] = obj;
		}
		return rpcclass.classes[classname].objects[objid];
			}

;
	c.dobj = cp.dobj =  function (id,fields)
	{
		return rpcclass.download_object (this.prototype.classname, id, fields);
			}

;
	c.pargs__render_calc_gobi =  [];
	c.pinst__render_calc_gobi =  [
/*0*/	function (e,f) {
		f.s[0] = "')";
		e.mcall (3, f.v["this"], "get_id", ([]));
	},
	function (e,f) {
		var t77 = f.s[1]; var t78 = f.s[0]; 
		e.return_pop ("" + ((f.v["this"]).classname) + ((".gobi('") + ("" + (t77) + (t78))));
	},
null	];

;
	c.pargs__render_gobi =  [];
	c.pinst__render_gobi =  [
/*0*/	function (e,f) { e.mcall (2, f.v["this"], "render_calc_gobi", ([])); },
	function (e,f) { var t79 = f.s[0]; e.return_pop (t79); },
null	];

;
	c.gobi = cp.gobi =  function (id)
	{
		return rpcclass.get_object_by_id (this.prototype.classname, id);
			}

;
	c.object_loaded = cp.object_loaded =  function (obj)
	{
//		debugout ("*** Object "+obj.classname+":"+obj.obj_id+" loaded from server");
			}

;
	c.call_handler = cp.call_handler =  function (el,event,classname,objid,method,args)
	{
		if (typeof event === "undefined") event = window.event;
		if (rpcclass.classes[classname] == undefined)
		{
			alert ("Unexpected unknown class "+classname);
			throw new Error ("Unexpected unknown class "+classname);
		}
		if (objid == null)
		{
			alert ("Attempt to call method of "+classname+" with null objid");
			throw new Error ("Attempt to call "+classname+"::"+method+" with null objid");
		}
		if (rpcclass.classes[classname].objects[objid] == undefined)
			throw new Error ("Attempt to use object "+classname+"::"+objid+" which does not exist");
		if (rpcclass.classes[classname].objects[objid][method] == undefined)
			throw new Error ("Attempt to call "+classname+"::"+method+" which does not exist");
		rpcclass.classes[classname].objects[objid][method] (el, args, event);
		return false;
			}

;
	c.convert_xml_to_object = cp.convert_xml_to_object =  function (node)
	{
		if (node.tagName == "array")
		{
			var res = new Array();
			for (var i = 0; i < node.childNodes.length; i++)
			{
				res[i] = rpcclass.convert_xml_to_object (node.childNodes[i]);
			}
			return res;
		}
		else if (node.tagName == "struct")
		{
			var res = new Object;
			for (var i = 0; i < node.childNodes.length; i++)
			{
				var fieldname = node.childNodes[i].getAttribute ("name");
				res[fieldname] = rpcclass.convert_xml_to_object (node.childNodes[i].firstChild);
			}
			return res;
		}
		else if (node.tagName == "classref")
		{
			var classname = node.getAttribute("classname");
			var obj_id = node.getAttribute ("id");
			return new rpcclassloader (classname, obj_id);
		}
		else if (node.tagName == "object")
		{
			var classname = node.getAttribute("classname");
			var obj_id = node.getAttribute ("id");
			var res = rpcclass.get_object_by_id (classname, obj_id);
			return res;
		}
		else if (node.tagName == "int")
		{
			return parseInt(node.firstChild.nodeValue);
		}
		else if (node.tagName == "string")
		{
			if (node.firstChild)
				return node.firstChild.nodeValue;
			else
				return "";
		}
		else if (node.tagName == "bool")
		{
			return (node.firstChild.nodeValue == 1);
		}
		else if (node.tagName == "null")
		{
			return null;
		}
		else if (node.tagName == "htmlelement")
		{
			return document.getElementById (node.getAttribute("id"));
		}
		else
		{
			alert ("Don't know how to convert node "+node.tagName);
			return null;
		}
			}

;
	c.load_object_from_class3 = cp.load_object_from_class3 =  function (node)
	{
		var classname = node.getAttribute("classname");
		var obj_id = node.getAttribute ("id");
		var text = "";
		for (var j = 0; node.childNodes[j] != undefined; j++)
		{
			if (node.childNodes[j].nodeType == 3)
				text += node.childNodes[j].nodeValue;
		}

//		var values = node.firstChild.nodeValue;
		var values = text;

//		debugout ("Got class3 = "+classname+": "+obj_id+"="+values);
		var res = rpcclass.get_object_by_id (classname, obj_id);
		var evalues = eval ("("+values+")");
		res.unserialize_js_rpc (evalues);
		rpcclass.object_loaded (res);
			}

;
	c.load_object_from_xml = cp.load_object_from_xml =  function (node)
	{
		var classname = node.getAttribute("classname");
		var obj_id = node.getAttribute ("id");

		var res = rpcclass.get_object_by_id (classname, obj_id);

//		debugout ("========================================");
//		debugout ("unserialize "+classname+":"+obj_id);
		res.classname = classname;
		for (var j = 0; j < node.childNodes.length; j++)
		{
			var field = node.childNodes[j];
			var fieldname = field.getAttribute ("name");
			if (fieldname != "listeners" && fieldname != "messages")	// NASTY HACK
				res[fieldname] = rpcclass.convert_xml_to_object (field.firstChild);
//			debugout (fieldname+"="+res[fieldname]);
		}
		rpcclass.object_loaded (res);
			}

;
	c.pargs__call_function_async =  ["meth","margs"];
	c.pinst__call_function_async =  [
/*0*/	function (e,f) { e.smcall (3, ajax,"do_call_function_async", ([f.v["this"], f.v.meth, f.v.margs])); },
	function (e,f) { var t80 = f.s[0]; e.return_pop (t80); },
null	];

;
	c.args__call_static_function_async = c.pargs__call_static_function_async =  ["classname","meth","margs"];
	c.inst__call_static_function_async = c.pinst__call_static_function_async =  [
/*0*/	function (e,f) { e.smcall (3, ajax,"do_call_static_function_async", ([f.v.classname, f.v.meth, f.v.margs])); },
	function (e,f) { var t81 = f.s[0]; e.return_pop (t81); },
null	];

;
	c.pargs__listen_msg =  ["msg_type","obj","notify_method"];
	c.pinst__listen_msg =  [
/*0*/	function (e,f) {
		f.v.listener = ({});
		f.v.listener.msg_type = f.v.msg_type;
		f.v.listener.obj = f.v.obj;
		f.v.listener.notify_method = f.v.notify_method;
		if (!(((f.v["this"]).listeners) !== undefined)) f.pc=1; else f.pc=2;
	},
	function (e,f) { f.v["this"].listeners = ([]); },
	function (e,f) { (f.v["this"]).listeners[(f.v["this"]).listeners.length] = f.v.listener; },
null	];

;
	c.pargs__send_msg =  ["msg_type","args"];
	c.pinst__send_msg =  [
/*0*/	function (e,f) { if (!(((f.v["this"]).listeners) !== undefined)) f.pc=1; else f.pc=2; },
	function (e,f) { f.v["this"].listeners = ([]); },
	function (e,f) { f.v._k8 = e.enumkeys ((f.v["this"]).listeners); },
	function (e,f) { if (!((f.v._k8).length)) f.pc=-1; },
	function (e,f) {
		f.v._i9 = (f.v._k8).shift();
		f.v.listener = ((f.v["this"]).listeners)[(f.v._i9)];
		if ((((f.v.listener).msg_type)) == ((f.v.msg_type))) f.pc=5; else f.pc=3;
	},
/*5*/	function (e,f) {
		f.pc=3;
		f.v.method = (f.v.listener).notify_method;
		e.mcall (3, (f.v.listener).obj, f.v.method, ([f.v.args]));
	},
null	];

;
	cp.serialize =  function (closure)
	{
		var res = "";
		var j = 0;
		for (i = 0; i < this.rpcprops.length; i++)
		{
			var name = this.rpcprops[i];
			var pt = this.rpcproptypes[i];
//			debugout ("serialize property "+name+" ("+pt+")");
			if (pt != 2)
			{
				var sobj = (pt == 1) ? ajax.stub_object (this[name]) : ajax.serialize_object (this[name], closure);
//				debugout ("serialized property "+name+" as "+sobj);
				res += "{f:"+name+":"+encodeURIComponent (sobj)+"}";
			}
		}
		return res;
			}

;
	cp.unserialize_js_init =  function (values)
	{
		var i;
		for (i = 0; i < this.rpcprops.length; i++)
			this[this.rpcprops[i]] = values[i];
			}

;
	cp.unserialize_js_rpc =  function (values)
	{
		var j = 0;
		var i;
		for (i = 0; i < this.rpcprops.length; i++)
		{
			if (this.rpcproptypes[i] == 0)
			{
				this[this.rpcprops[i]] = values[j++];
			}
		}
			}

;
};
rpcclass.init_methods (rpcclass);
rpcclass.setup_class (rpcclass, "rpcclass",0, (["obj_id","listeners"]), ([0,2]));
function rootpath () { this.do_construct (arguments); }
rootpath.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
	c.map = cp.map =  function (path)
	{
{
		return (rootpath.root_path + path);
		}
			}

;
};
rootpath.init_methods (rootpath);
rpcclass.setup_class (rootpath, "rootpath",0, (["listeners"]), ([2]));
function auth () { this.do_construct (arguments); }
auth.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
	c.args__logged_in = c.pargs__logged_in =  [];
	c.inst__logged_in = c.pinst__logged_in =  [
/*0*/	function (e,f) {
		e.php_push_static_var (0, auth,"is_system");
		var t93 = f.s[0]; if (t93) f.pc=1; else f.pc=2;
	},
	function (e,f) {
		f.pc=3;
		f.s[0] = true;
	},
	function (e,f) {
		e.php_push_static_var (1, auth,"euid");
		var t94 = f.s[1]; f.s[0] = ((t94)) != ((0));
	},
	function (e,f) { var t95 = f.s[0]; e.return_pop (t95); },
null	];

;
	c.args__my_uid = c.pargs__my_uid =  [];
	c.inst__my_uid = c.pinst__my_uid =  [
/*0*/	function (e,f) {
		e.php_push_static_var (0, auth,"euid");
		var t96 = f.s[0]; e.return_pop (t96);
	},
null	];

;
	c.args__agree_t_and_c =  [];
	c.inst__agree_t_and_c =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_function_async", (["auth", "agree_t_and_c", ([])])); },
	function (e,f) { var t97 = f.s[0]; e.return_pop (t97); },
null	];

;
	c.args__open_t_and_c_dialog = c.pargs__open_t_and_c_dialog =  ["el","arg","ev"];
	c.inst__open_t_and_c_dialog = c.pinst__open_t_and_c_dialog =  [
/*0*/	function (e,f) {
		f.v.tc = builtin__urldecode (f.v.arg);
		f.v.fields = ([({name:"tandc", type:"html", label:"", html:f.v.tc})]);
		f.v.pop = new popupform;
		e.mcall (6, f.v.pop, "initialise", ([0, 0, "Terms and Conditions", f.v.fields]));
	},
	function (e,f) { e.mcall (4, f.v.pop, "use_ok_cancel", ([true, false])); },
	function (e,f) { e.mcall (2, f.v.pop, "open", ([])); },
	function (e,f) {  },
	function (e,f) { e.mcall (2, f.v.pop, "run", ([])); },
/*5*/	function (e,f) {
		var t102 = f.s[0]; f.v.event = t102;
		f.v.action = (f.v.event).action;
		if (((f.v.action)) == (("OK"))) f.pc=6; else f.pc=4;
	},
	function (e,f) { e.mcall (2, f.v.pop, "close", ([])); },
	function (e,f) { e.smcall (0, auth,"agree_t_and_c", ([])); },
null	];

;
	c.launch_t_and_c_dialog = cp.launch_t_and_c_dialog =  function (tandc)
	{
{
		popup.set_default_coordinates  (200,200);;
		rpcclass.start_engine_static  (null,null,"auth","open_t_and_c_dialog",tandc);;
		}
			}

;
	c.launch_login_dialog = cp.launch_login_dialog =  function ()
	{
{
		popup.set_default_coordinates  (150,150);;
		rpcclass.start_engine_static  (null,null,"auth","open_login_dialog",null);;
		}
			}

;
	c.args__handle_simple_login =  ["username","password","save_authority"];
	c.inst__handle_simple_login =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_function_async", (["auth", "handle_simple_login", ([f.v.username, f.v.password, f.v.save_authority])])); },
	function (e,f) { var t104 = f.s[0]; e.return_pop (t104); },
null	];

;
	c.args__get_challenge =  ["username"];
	c.inst__get_challenge =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_function_async", (["auth", "get_challenge", ([f.v.username])])); },
	function (e,f) { var t105 = f.s[0]; e.return_pop (t105); },
null	];

;
	c.args__handle_response =  ["username","challenge","response","save_authority"];
	c.inst__handle_response =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_function_async", (["auth", "handle_response", ([f.v.username, f.v.challenge, f.v.response, f.v.save_authority])])); },
	function (e,f) { var t106 = f.s[0]; e.return_pop (t106); },
null	];

;
	c.args__is_valid_mobile = c.pargs__is_valid_mobile =  ["identifier"];
	c.inst__is_valid_mobile = c.pinst__is_valid_mobile =  [
/*0*/	function (e,f) { e.return_pop (builtin__preg_match ("/^07[0-9 ]{8,10}$/",f.v.identifier)); },
null	];

;
	c.args__is_valid_email = c.pargs__is_valid_email =  ["identifier"];
	c.inst__is_valid_email = c.pinst__is_valid_email =  [
/*0*/	function (e,f) { e.return_pop (builtin__preg_match ("/^[0-9a-zA-Z\\.\\+\\-_']+@[-0-9a-zA-Z\\.]+$/",f.v.identifier)); },
null	];

;
	c.args__try_identification =  ["identifier"];
	c.inst__try_identification =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_function_async", (["auth", "try_identification", ([f.v.identifier])])); },
	function (e,f) { var t107 = f.s[0]; e.return_pop (t107); },
null	];

;
	c.args__test_confirmation_code =  ["code"];
	c.inst__test_confirmation_code =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_function_async", (["auth", "test_confirmation_code", ([f.v.code])])); },
	function (e,f) { var t108 = f.s[0]; e.return_pop (t108); },
null	];

;
	c.args__identity_chosen =  ["authority","phandle"];
	c.inst__identity_chosen =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_function_async", (["auth", "identity_chosen", ([f.v.authority, f.v.phandle])])); },
	function (e,f) { var t109 = f.s[0]; e.return_pop (t109); },
null	];

;
	c.args__get_my_username =  [];
	c.inst__get_my_username =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_function_async", (["auth", "get_my_username", ([])])); },
	function (e,f) { var t110 = f.s[0]; e.return_pop (t110); },
null	];

;
	c.args__try_set_username_and_password =  ["username","epwd"];
	c.inst__try_set_username_and_password =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_function_async", (["auth", "try_set_username_and_password", ([f.v.username, f.v.epwd])])); },
	function (e,f) { var t111 = f.s[0]; e.return_pop (t111); },
null	];

;
	c.args__set_username_and_password = c.pargs__set_username_and_password =  [];
	c.inst__set_username_and_password = c.pinst__set_username_and_password =  [
/*0*/	function (e,f) { e.smcall (0, auth,"get_my_username", ([])); },
	function (e,f) {
		var t113 = f.s[0]; f.v.username = t113;
		f.v.pop = new popupform;
		f.v.fields = ([]);
		f.v.fields[f.v.fields.length] = ({type:"html", name:"", label:"", html:"<p>Please set a username and password.</p>"});
		if (((f.v.username)) == ((""))) f.pc=2; else f.pc=3;
	},
	function (e,f) {
		f.pc=4;
		f.v.fields[f.v.fields.length] = ({type:"text", name:"username", label:"Username", focus:"true"});
		f.v.fields[f.v.fields.length] = ({type:"password", name:"password", label:"Password"});
	},
	function (e,f) {
		f.v.fields[f.v.fields.length] = ({type:"text", name:"username", label:"Username", value:f.v.username});
		f.v.fields[f.v.fields.length] = ({type:"password", name:"password", label:"Password", focus:"true"});
	},
	function (e,f) {
		f.v.fields[f.v.fields.length] = ({type:"password", name:"password2", label:"Retype password"});
		e.mcall (6, f.v.pop, "initialise", ([0, 0, "Account details", f.v.fields]));
	},
/*5*/	function (e,f) { e.mcall (4, f.v.pop, "use_ok_cancel", ([true, false])); },
	function (e,f) { e.mcall (2, f.v.pop, "open", ([])); },
	function (e,f) {  },
	function (e,f) { e.mcall (2, f.v.pop, "run", ([])); },
	function (e,f) {
		var t123 = f.s[0]; f.v.ev = t123;
		if ((((f.v.ev).action)) == (("OK"))) f.pc=10; else f.pc=8;
	},
/*10*/	function (e,f) { e.mcall (2, f.v.pop, "get_form_fields", ([])); },
	function (e,f) {
		var t125 = f.s[0]; f.v.values = t125;
		if ((((f.v.values).password)) != (((f.v.values).password2))) f.pc=12; else f.pc=13;
	},
	function (e,f) {
		f.pc=8;
		e.smcall (1, popupok,"run", (["Passwords do not match"]));
	},
	function (e,f) { e.smcall (1, aes,"encrypt", ([(f.v.values).password])); },
	function (e,f) {
		f.s[1] = (f.v.values).username;
		e.php_static_method_call (2, auth,"try_set_username_and_password", 2);
	},
/*15*/	function (e,f) {
		var t128 = f.s[0]; f.v.testres = t128;
		if (((f.v.testres)) === ((null))) f.pc=16; else f.pc=18;
	},
	function (e,f) { e.mcall (2, f.v.pop, "close", ([])); },
	function (e,f) { f.pc=-1; },
	function (e,f) {
		f.pc=8;
		e.smcall (1, popupok,"run", ([f.v.testres]));
	},
null	];

;
	c.args__select_candidate = c.pargs__select_candidate =  ["res","identifier"];
	c.inst__select_candidate = c.pinst__select_candidate =  [
/*0*/	function (e,f) {
		f.v.candidates = (f.v.res).candidates;
		f.v.authority = (f.v.res).authority;
		f.v.pop = new popupform;
		f.v.fields = ([]);
		f.v.fields[f.v.fields.length] = ({type:"html", name:"", label:"", html:"<p>Please select which person you are...</p>"});
		f.v._k10 = e.enumkeys (f.v.candidates);
	},
	function (e,f) {
		f.pc=3;
		if (!((f.v._k10).length)) f.pc=2;
	},
	function (e,f) {
		f.pc=5;
		f.s[0] = "\">None of the above</a>";
		e.smcall (3, auth,"render_resume", (["select_one", ""]));
	},
	function (e,f) {
		f.v.handle = (f.v._k10).shift();
		f.v.nicename = (f.v.candidates)[(f.v.handle)];
		f.s[0] = ("\">") + ("" + (f.v.nicename) + ("</a>"));
		e.smcall (3, auth,"render_resume", (["select_one", f.v.handle]));
	},
	function (e,f) {
		f.pc=1;
		var t137 = f.s[1]; var t138 = f.s[0]; 
		f.v.fields[f.v.fields.length] = ({type:"html", name:"", label:"", html:("<a href=\"#\" onclick=\"") + ("" + (t137) + (t138))});
	},
/*5*/	function (e,f) {
		var t140 = f.s[1]; var t141 = f.s[0]; 
		f.v.fields[f.v.fields.length] = ({type:"html", name:"", label:"", html:("<a href=\"#\" onclick=\"") + ("" + (t140) + (t141))});
		e.mcall (6, f.v.pop, "initialise", ([0, 0, "Who are you?", f.v.fields]));
	},
	function (e,f) { e.mcall (4, f.v.pop, "use_ok_cancel", ([false, true])); },
	function (e,f) { e.mcall (2, f.v.pop, "open", ([])); },
	function (e,f) {  },
	function (e,f) { e.mcall (2, f.v.pop, "run", ([])); },
/*10*/	function (e,f) {
		var t144 = f.s[0]; f.v.ev = t144;
		if ((((f.v.ev).action)) == (("cancel"))) f.pc=11; else f.pc=13;
	},
	function (e,f) { e.mcall (2, f.v.pop, "close", ([])); },
	function (e,f) { f.pc=-1; },
	function (e,f) { if ((((f.v.ev).action)) == (("select_one"))) f.pc=14; else f.pc=9; },
	function (e,f) { e.mcall (2, f.v.pop, "close", ([])); },
/*15*/	function (e,f) {
		f.v.handle = (f.v.ev).parm;
		if (((f.v.handle)) == ((""))) f.pc=16; else f.pc=18;
	},
	function (e,f) { e.smcall (1, auth,"open_signup_dialog", ([f.v.identifier])); },
	function (e,f) { f.pc=-1; },
	function (e,f) { e.smcall (2, auth,"identity_chosen", ([f.v.authority, f.v.handle])); },
	function (e,f) { e.smcall (0, auth,"set_username_and_password", ([])); },
/*20*/	function (e,f) { e.smcall (2, browser,"reload", ([([]), ({})])); },
null	];

;
	c.args__secure_post = c.pargs__secure_post =  ["values"];
	c.inst__secure_post = c.pinst__secure_post =  [
/*0*/	function (e,f) {
		f.v.res = ({});
		f.v._k12 = e.enumkeys (f.v.values);
	},
	function (e,f) {
		f.pc=3;
		if (!((f.v._k12).length)) f.pc=2;
	},
	function (e,f) { e.return_pop (f.v.res); },
	function (e,f) {
		f.s[0] = f.v.key = (f.v._k12).shift();
		f.s[1] = f.v.val = (f.v.values)[(f.v.key)];
		e.smcall (3, aes,"encrypt", ([f.v.val]));
	},
	function (e,f) {
		f.pc=1;
		var t151 = f.s[2]; f.v.res[f.v.key] = t151;
	},
null	];

;
	c.args__do_account_activation =  ["p","newdata","identifier"];
	c.inst__do_account_activation =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_function_async", (["auth", "do_account_activation", ([f.v.p, f.v.newdata, f.v.identifier])])); },
	function (e,f) { var t152 = f.s[0]; e.return_pop (t152); },
null	];

;
	c.args__use_this_account = c.pargs__use_this_account =  ["el","args","ev"];
	c.inst__use_this_account = c.pinst__use_this_account =  [
/*0*/	function (e,f) {
		f.v.p = (f.v.args)[(0)];
		f.v.values = (f.v.args)[(1)];
		if (((f.v.p)) === ((""))) f.pc=1; else f.pc=4;
	},
	function (e,f) { e.smcall (0, siteauth,"lookup", ([])); },
	function (e,f) {
		var t156 = f.s[0]; f.v.p = t156;
		if (((f.v.p)) === ((null))) f.pc=3; else f.pc=4;
	},
	function (e,f) { f.pc=-1; },
	function (e,f) { if (((f.v.p)) === ((null))) f.pc=5; else f.pc=14; },
/*5*/	function (e,f) {
		f.pc=7;
		e.smcall (1, popupokcancel,"run", ([("Create new person ") + ("" + ((f.v.values).nname) + ((" ") + ("" + ((f.v.values).sname) + ("?"))))]));
	},
	function (e,f) { f.pc=-1; },
	function (e,f) {
		var t157 = f.s[0]; 
		if (!(t157)) f.pc=6; else f.pc=8;
	},
	function (e,f) {
		f.pc=11;
		f.v.newdata = ({fname:(f.v.values).nname, nname:(f.v.values).nname, sname:(f.v.values).sname});
		e.smcall (1, auth,"is_valid_email", ([(f.v.values).identifier]));
	},
	function (e,f) {
		f.pc=12;
		f.v.newdata.email = (f.v.values).identifier;
	},
/*10*/	function (e,f) {
		f.pc=12;
		f.v.newdata.mobile = (f.v.values).identifier;
	},
	function (e,f) { var t161 = f.s[0]; if (t161) f.pc=9; else f.pc=10; },
	function (e,f) { e.smcall (3, auth,"do_account_activation", ([null, f.v.newdata, (f.v.values).identifier])); },
	function (e,f) {
		f.pc=-1;
		var t163 = f.s[0]; f.v.res = t163;
		e.smcall (1, popupok,"run", ([f.v.res]));
	},
	function (e,f) {
		f.pc=17;
		f.v.pop = new popupform;
		f.v.fields = ([]);
		f.v.adjustments = ([]);
		f.v.adjustments.fname = ({name:"nname", "default":"replace"});
		f.v.adjustments.nname = ({name:"nname", "default":"replace"});
		f.v.adjustments.sname = ({name:"sname", "default":"replace"});
		e.smcall (1, auth,"is_valid_email", ([(f.v.values).identifier]));
	},
/*15*/	function (e,f) {
		f.pc=18;
		f.v.adjustments.email = ({name:"identifier", "default":"replace"});
		f.v.adjustments.other_email = ({name:"identifier", "default":"keep"});
		f.v.adjustments.mobile = null;
	},
	function (e,f) {
		f.pc=18;
		f.v.adjustments.email = null;
		f.v.adjustments.other_email = null;
		f.v.adjustments.mobile = ({name:"identifier", "default":"replace"});
	},
	function (e,f) { var t176 = f.s[0]; if (t176) f.pc=15; else f.pc=16; },
	function (e,f) { f.v._k14 = e.enumkeys (f.v.adjustments); },
	function (e,f) {
		f.pc=21;
		if (!((f.v._k14).length)) f.pc=20;
	},
/*20*/	function (e,f) {
		f.pc=28;
		e.mcall (6, f.v.pop, "initialise", ([600, 200, ("Update existing account for ") + ((f.v.p).nicename), f.v.fields]));
	},
	function (e,f) {
		f.v.key = (f.v._k14).shift();
		f.v.rule = (f.v.adjustments)[(f.v.key)];
		e.smcall (1, siteauth,"get_field_info", ([f.v.key]));
	},
	function (e,f) {
		var t181 = f.s[0]; f.v.fi = t181;
		f.v.lab = "" + ((f.v.fi).label) + ((" '") + ("" + ((f.v.p)[(f.v.key)]) + ("'")));
		if (((f.v.rule)) !== ((null))) f.pc=25; else f.pc=26;
	},
	function (e,f) {
		f.pc=19;
		f.v.options = ({replace:("Set to '") + ("" + ((f.v.values)[((f.v.rule).name)]) + ("'")), keep:"Keep existing"});
		f.v.fields[f.v.fields.length] = ({type:"enum", name:("change_") + (f.v.key), label:f.v.lab, value:(f.v.rule)[("default")], options:f.v.options});
	},
	function (e,f) {
		f.pc=19;
		f.v.fields[f.v.fields.length] = ({type:"label", name:"", label:f.v.lab, value:""});
	},
/*25*/	function (e,f) {
		f.pc=27;
		f.s[0] = (((f.v.p)[(f.v.key)])) != (((f.v.values)[((f.v.rule).name)]));
	},
	function (e,f) { f.s[0] = false; },
	function (e,f) { var t186 = f.s[0]; if (t186) f.pc=23; else f.pc=24; },
	function (e,f) { e.mcall (2, f.v.pop, "open", ([])); },
	function (e,f) {  },
/*30*/	function (e,f) { e.mcall (2, f.v.pop, "run", ([])); },
	function (e,f) {
		var t188 = f.s[0]; f.v.ev = t188;
		if ((((f.v.ev).action)) == (("cancel"))) f.pc=32; else f.pc=34;
	},
	function (e,f) { e.mcall (2, f.v.pop, "close", ([])); },
	function (e,f) { f.pc=-1; },
	function (e,f) { if ((((f.v.ev).action)) == (("OK"))) f.pc=35; else f.pc=30; },
/*35*/	function (e,f) { e.mcall (2, f.v.pop, "get_form_fields", ([])); },
	function (e,f) {
		var t190 = f.s[0]; f.v.fill_values = t190;
		e.mcall (2, f.v.pop, "close", ([]));
	},
	function (e,f) {
		f.v.newdata = ({});
		f.v._k16 = e.enumkeys (f.v.adjustments);
	},
	function (e,f) {
		f.pc=40;
		if (!((f.v._k16).length)) f.pc=39;
	},
	function (e,f) {
		f.pc=46;
		e.smcall (3, auth,"do_account_activation", ([f.v.p, f.v.newdata, (f.v.values).identifier]));
	},
/*40*/	function (e,f) {
		f.v.key = (f.v._k16).shift();
		f.v.rule = (f.v.adjustments)[(f.v.key)];
		if (((f.v.rule)) !== ((null))) f.pc=43; else f.pc=44;
	},
	function (e,f) { if ((((f.v.fill_values)[(("change_") + (f.v.key))])) == (("replace"))) f.pc=42; else f.pc=38; },
	function (e,f) {
		f.pc=38;
		f.v.newdata[f.v.key] = (f.v.values)[((f.v.rule).name)];
	},
	function (e,f) {
		f.pc=45;
		f.s[0] = (((f.v.p)[(f.v.key)])) != (((f.v.values)[((f.v.rule).name)]));
	},
	function (e,f) { f.s[0] = false; },
/*45*/	function (e,f) { var t196 = f.s[0]; if (t196) f.pc=41; else f.pc=38; },
	function (e,f) {
		var t198 = f.s[0]; f.v.res = t198;
		e.smcall (1, popupok,"run", ([f.v.res]));
	},
	function (e,f) { f.pc=-1; },
null	];

;
	c.args__signup =  ["values"];
	c.inst__signup =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_function_async", (["auth", "signup", ([f.v.values])])); },
	function (e,f) { var t199 = f.s[0]; e.return_pop (t199); },
null	];

;
	c.args__open_signup_dialog = c.pargs__open_signup_dialog =  ["identifier"];
	c.inst__open_signup_dialog = c.pinst__open_signup_dialog =  [
/*0*/	function (e,f) {
		f.v.pop = new popupform;
		f.v.fields = ([]);
		f.v.fields[f.v.fields.length] = ({type:"text", name:"nname", label:"First name", focus:true});
		f.v.fields[f.v.fields.length] = ({type:"text", name:"sname", label:"Surname"});
		f.v.fields[f.v.fields.length] = ({type:"text", name:"identifier", label:"Email address or mobile number", value:f.v.identifier});
		f.v.fields[f.v.fields.length] = ({type:"text", name:"leader", label:"Name of a church leader who knows you"});
		e.mcall (6, f.v.pop, "initialise", ([300, 200, "Request an account", f.v.fields]));
	},
	function (e,f) { e.mcall (2, f.v.pop, "open", ([])); },
	function (e,f) {  },
	function (e,f) { e.mcall (2, f.v.pop, "run", ([])); },
	function (e,f) {
		var t207 = f.s[0]; f.v.ev = t207;
		if ((((f.v.ev).action)) == (("cancel"))) f.pc=5; else f.pc=7;
	},
/*5*/	function (e,f) { e.mcall (2, f.v.pop, "close", ([])); },
	function (e,f) { f.pc=-1; },
	function (e,f) { if ((((f.v.ev).action)) == (("OK"))) f.pc=8; else f.pc=3; },
	function (e,f) { e.mcall (2, f.v.pop, "get_form_fields", ([])); },
	function (e,f) {
		var t209 = f.s[0]; f.v.values = t209;
		if (((builtin__trim ((f.v.values).nname))) == ((""))) f.pc=15; else f.pc=16;
	},
/*10*/	function (e,f) {
		f.pc=3;
		e.smcall (1, popupok,"run", (["Please fill in all fields"]));
	},
	function (e,f) { e.smcall (1, auth,"signup", ([f.v.values])); },
	function (e,f) { e.mcall (2, f.v.pop, "close", ([])); },
	function (e,f) { e.smcall (1, popupok,"run", (["An email has been sent to an administrator. You should hear back shortly."])); },
	function (e,f) { f.pc=-1; },
/*15*/	function (e,f) {
		f.pc=21;
		f.s[0] = true;
	},
	function (e,f) { if (((builtin__trim ((f.v.values).sname))) == ((""))) f.pc=17; else f.pc=18; },
	function (e,f) {
		f.pc=21;
		f.s[0] = true;
	},
	function (e,f) { if (((builtin__trim ((f.v.values).identifier))) == ((""))) f.pc=19; else f.pc=20; },
	function (e,f) {
		f.pc=21;
		f.s[0] = true;
	},
/*20*/	function (e,f) { f.s[0] = ((builtin__trim ((f.v.values).leader))) == (("")); },
	function (e,f) { var t210 = f.s[0]; if (t210) f.pc=10; else f.pc=11; },
null	];

;
	c.args__try_confirmation_code = c.pargs__try_confirmation_code =  ["code"];
	c.inst__try_confirmation_code = c.pinst__try_confirmation_code =  [
/*0*/	function (e,f) { e.smcall (1, auth,"test_confirmation_code", ([f.v.code])); },
	function (e,f) {
		var t212 = f.s[0]; f.v.res = t212;
		if (((f.v.res)) === ((null))) f.pc=2; else f.pc=3;
	},
	function (e,f) {
		f.pc=-1;
		e.smcall (1, popupok,"run", (["Invalid confirmation code"]));
	},
	function (e,f) { e.smcall (2, auth,"select_candidate", ([f.v.res, f.v.identifier])); },
null	];

;
	c.args__open_identify_dialog = c.pargs__open_identify_dialog =  [];
	c.inst__open_identify_dialog = c.pinst__open_identify_dialog =  [
/*0*/	function (e,f) {
		f.v.pop = new popupform;
		f.v.fields = ([]);
		f.v.fields[f.v.fields.length] = ({type:"text", name:"identifier", label:"Mobile number or email address or confirmation code", focus:"true"});
		f.v.is_mobile = false;
		f.v.is_email = false;
		e.mcall (6, f.v.pop, "initialise", ([300, 150, "Identify yourself", f.v.fields]));
	},
	function (e,f) { e.mcall (2, f.v.pop, "open", ([])); },
	function (e,f) {  },
	function (e,f) {
		f.pc=5;
		e.mcall (2, f.v.pop, "run", ([]));
	},
	function (e,f) {
		f.pc=24;
		e.smcall (1, auth,"try_identification", ([f.v.identifier]));
	},
/*5*/	function (e,f) {
		var t219 = f.s[0]; f.v.ev = t219;
		if ((((f.v.ev).action)) == (("cover"))) f.pc=8; else f.pc=9;
	},
	function (e,f) { e.mcall (2, f.v.pop, "close", ([])); },
	function (e,f) { f.pc=-1; },
	function (e,f) {
		f.pc=10;
		f.s[0] = true;
	},
	function (e,f) { f.s[0] = (((f.v.ev).action)) == (("cancel")); },
/*10*/	function (e,f) { var t220 = f.s[0]; if (t220) f.pc=6; else f.pc=11; },
	function (e,f) { if ((((f.v.ev).action)) == (("OK"))) f.pc=12; else f.pc=3; },
	function (e,f) { e.mcall (2, f.v.pop, "get_form_fields", ([])); },
	function (e,f) {
		f.pc=23;
		var t222 = f.s[0]; f.v.values = t222;
		f.v.identifier = (f.v.values).identifier;
		f.v.identifier = builtin__preg_replace ("/ /","",f.v.identifier);
		e.smcall (1, auth,"is_valid_mobile", ([f.v.identifier]));
	},
	function (e,f) {
		f.pc=4;
		f.v.is_mobile = true;
	},
/*15*/	function (e,f) {
		f.pc=22;
		e.smcall (1, auth,"is_valid_email", ([f.v.identifier]));
	},
	function (e,f) {
		f.pc=4;
		f.v.is_email = true;
	},
	function (e,f) { if (builtin__preg_match ("/^\\d+$/",f.v.identifier)) f.pc=18; else f.pc=21; },
	function (e,f) { e.mcall (2, f.v.pop, "close", ([])); },
	function (e,f) { e.smcall (1, auth,"try_confirmation_code", ([f.v.identifier])); },
/*20*/	function (e,f) { f.pc=-1; },
	function (e,f) {
		f.pc=3;
		e.smcall (1, popupok,"run", (["Please enter a mobile number starting 07 or a valid email address or a confirmation key"]));
	},
	function (e,f) { var t227 = f.s[0]; if (t227) f.pc=16; else f.pc=17; },
	function (e,f) { var t228 = f.s[0]; if (t228) f.pc=14; else f.pc=15; },
	function (e,f) { e.mcall (2, f.v.pop, "close", ([])); },
/*25*/	function (e,f) {
		f.v.fields = ([]);
		f.v.instrs = "";
		if (f.v.is_mobile) f.pc=26; else f.pc=27;
	},
	function (e,f) {
		f.pc=28;
		f.v.instrs = "" + (f.v.instrs) + ("<p>If the website knows about you, you should receive a text message containing an confirmation code within the next minute</p>");
		f.v.instrs = "" + (f.v.instrs) + ("<p>Depending on the time of day, your text may get delayed so please be patient</p>");
	},
	function (e,f) {
		f.v.instrs = "" + (f.v.instrs) + ("<p>If the website knows about you, you should receive an email containing an confirmation code within the next 10 minutes.</p>");
		f.v.instrs = "" + (f.v.instrs) + ("<p>Sometimes email can get delayed by spam filters or can be put in your spam folder, please check there before giving up.</p>");
	},
	function (e,f) {
		f.v.instrs = "" + (f.v.instrs) + ("<p>When you receive the confirmation code, type it in here...</p>");
		f.v.instrs = "" + (f.v.instrs) + ("<p>If you have waited for an confirmation code but nothing arrived then click 'Cancel'</p>");
		f.v.fields[f.v.fields.length] = ({type:"html", name:"", html:f.v.instrs});
		f.v.fields[f.v.fields.length] = ({type:"text", name:"code", label:"Confirmation code", focus:true});
		e.mcall (6, f.v.pop, "initialise", ([0, 0, "Enter confirmation code", f.v.fields]));
	},
	function (e,f) { e.mcall (2, f.v.pop, "open", ([])); },
/*30*/	function (e,f) {  },
	function (e,f) { e.mcall (2, f.v.pop, "run", ([])); },
	function (e,f) {
		var t240 = f.s[0]; f.v.ev = t240;
		if ((((f.v.ev).action)) == (("cancel"))) f.pc=33; else f.pc=36;
	},
	function (e,f) { e.mcall (2, f.v.pop, "close", ([])); },
	function (e,f) { e.smcall (1, auth,"open_signup_dialog", ([f.v.identifier])); },
/*35*/	function (e,f) { f.pc=-1; },
	function (e,f) { if ((((f.v.ev).action)) == (("OK"))) f.pc=37; else f.pc=31; },
	function (e,f) { e.mcall (2, f.v.pop, "get_form_fields", ([])); },
	function (e,f) {
		var t242 = f.s[0]; f.v.values = t242;
		e.mcall (2, f.v.pop, "close", ([]));
	},
	function (e,f) { e.smcall (1, auth,"try_confirmation_code", ([(f.v.values).code])); },
/*40*/	function (e,f) { f.pc=-1; },
null	];

;
	c.args__open_login_dialog = c.pargs__open_login_dialog =  [];
	c.inst__open_login_dialog = c.pinst__open_login_dialog =  [
/*0*/	function (e,f) {
		f.v.pop = new popupform;
		f.v.fields = ([]);
		f.v.fields[f.v.fields.length] = ({type:"text", name:"username", label:"Username", focus:true});
		f.v.fields[f.v.fields.length] = ({type:"password", name:"password", label:"Password"});
		f.v.fields[f.v.fields.length] = ({type:"yesno", name:"save_authority", label:"Remember password"});
		f.v.fields[f.v.fields.length] = ({type:"html", name:"", label:"", html:"<div style=\"font-size:75%\">Do not remember password on a shared computer</div>"});
		f.s[0] = "\">Login</button>";
		e.smcall (3, auth,"render_resume", (["OK", null]));
	},
	function (e,f) {
		var t249 = f.s[1]; var t250 = f.s[0]; 
		f.v.fields[f.v.fields.length] = ({type:"html", name:"", label:"", html:("<button style=\"float:right\" onclick=\"") + ("" + (t249) + (t250))});
		e.smcall (1, siteauth,"add_login_fields", ([f.v.fields]));
	},
	function (e,f) {
		e.php_push_static_var (0, auth,"allow_signup");
		var t252 = f.s[0]; if (t252) f.pc=3; else f.pc=6;
	},
	function (e,f) {
		f.s[0] = ("\">I have a confirmation code...</a><br/>") + ("</div>");
		e.smcall (3, auth,"render_resume", (["confcode", null]));
	},
	function (e,f) {
		var t253 = f.s[1]; var t254 = f.s[0]; 
		f.s[0] = ("\">Help, I can't get in...</a><br/>") + (("<a href=\"#\" onclick=\"") + ("" + (t253) + (t254)));
		e.smcall (3, auth,"render_resume", (["unknown", null]));
	},
/*5*/	function (e,f) {
		var t255 = f.s[1]; var t256 = f.s[0]; 
		f.v.fields[f.v.fields.length] = ({type:"html", name:"", label:"", html:("<div style=\"border:solid #c0c0c0 1px;padding:3px;margin:5px\">") + (("<a href=\"#\" onclick=\"") + ("" + (t255) + (t256)))});
	},
	function (e,f) { e.mcall (6, f.v.pop, "initialise", ([0, 0, "Login", f.v.fields])); },
	function (e,f) { e.mcall (4, f.v.pop, "use_ok_cancel", ([false, true])); },
	function (e,f) { e.mcall (2, f.v.pop, "open", ([])); },
	function (e,f) {  },
/*10*/	function (e,f) { e.mcall (2, f.v.pop, "run", ([])); },
	function (e,f) {
		var t259 = f.s[0]; f.v.ev = t259;
		if ((((f.v.ev).action)) == (("cover"))) f.pc=48; else f.pc=49;
	},
	function (e,f) { e.mcall (2, f.v.pop, "close", ([])); },
	function (e,f) { f.pc=-1; },
	function (e,f) { if ((((f.v.ev).action)) == (("unknown"))) f.pc=15; else f.pc=18; },
/*15*/	function (e,f) { e.mcall (2, f.v.pop, "close", ([])); },
	function (e,f) { e.smcall (0, auth,"open_identify_dialog", ([])); },
	function (e,f) { f.pc=-1; },
	function (e,f) { if ((((f.v.ev).action)) == (("confcode"))) f.pc=19; else f.pc=24; },
	function (e,f) { e.mcall (2, f.v.pop, "close", ([])); },
/*20*/	function (e,f) { e.smcall (4, popupeditbox,"run", ([0, 0, "Enter confirmation code", ""])); },
	function (e,f) {
		var t261 = f.s[0]; f.v.identifier = t261;
		if (((f.v.identifier)) !== ((null))) f.pc=22; else f.pc=10;
	},
	function (e,f) { e.smcall (1, auth,"try_confirmation_code", ([f.v.identifier])); },
	function (e,f) { f.pc=-1; },
	function (e,f) { if ((((f.v.ev).action)) == (("OK"))) f.pc=25; else f.pc=42; },
/*25*/	function (e,f) { e.mcall (2, f.v.pop, "get_form_fields", ([])); },
	function (e,f) {
		var t263 = f.s[0]; f.v.values = t263;
		if ((((f.v.values).username)) == ((""))) f.pc=27; else f.pc=28;
	},
	function (e,f) {
		f.pc=10;
		e.smcall (1, popupok,"run", (["Please enter a username"]));
	},
	function (e,f) { if ((((f.v.values).password)) == ((""))) f.pc=29; else f.pc=30; },
	function (e,f) {
		f.pc=10;
		e.smcall (1, popupok,"run", (["Please enter a password"]));
	},
/*30*/	function (e,f) { if (!(builtin__method_exists ("siteauth","use_challenge_response"))) f.pc=36; else f.pc=37; },
	function (e,f) {
		f.v.password = builtin__md5 ((f.v.values).password);
		e.smcall (1, auth,"get_challenge", ([(f.v.values).username]));
	},
	function (e,f) {
		var t266 = f.s[0]; f.v.challenge = t266;
		e.smcall (4, auth,"handle_response", ([(f.v.values).username, f.v.challenge, builtin__sha1 ("" + (f.v.challenge) + (("|") + (f.v.password))), (f.v.values).save_authority]));
	},
	function (e,f) {
		f.pc=39;
		var t268 = f.s[0]; f.v.res = t268;
	},
	function (e,f) { e.smcall (3, auth,"handle_simple_login", ([(f.v.values).username, (f.v.values).password, (f.v.values).save_authority])); },
/*35*/	function (e,f) {
		f.pc=39;
		var t270 = f.s[0]; f.v.res = t270;
	},
	function (e,f) {
		f.pc=38;
		f.s[0] = true;
	},
	function (e,f) { e.smcall (0, siteauth,"use_challenge_response", ([])); },
	function (e,f) { var t271 = f.s[0]; if (t271) f.pc=31; else f.pc=34; },
	function (e,f) { if (f.v.res) f.pc=40; else f.pc=41; },
/*40*/	function (e,f) {
		f.pc=10;
		e.smcall (2, browser,"reload", ([([]), ({})]));
	},
	function (e,f) {
		f.pc=10;
		e.smcall (1, popupok,"run", (["Wrong username or password"]));
	},
	function (e,f) {
		f.pc=47;
		e.smcall (1, siteauth,"recognise_login_action", ([f.v.ev]));
	},
	function (e,f) { e.mcall (2, f.v.pop, "get_form_fields", ([])); },
	function (e,f) {
		var t273 = f.s[0]; f.v.values = t273;
		e.mcall (2, f.v.pop, "close", ([]));
	},
/*45*/	function (e,f) { e.smcall (2, siteauth,"handle_login_action", ([f.v.ev, f.v.values])); },
	function (e,f) { f.pc=-1; },
	function (e,f) { var t274 = f.s[0]; if (t274) f.pc=43; else f.pc=10; },
	function (e,f) {
		f.pc=50;
		f.s[0] = true;
	},
	function (e,f) { f.s[0] = (((f.v.ev).action)) == (("cancel")); },
/*50*/	function (e,f) { var t275 = f.s[0]; if (t275) f.pc=12; else f.pc=14; },
null	];

;
	c.args__login_facebook =  ["fbid","email","fname","sname","token"];
	c.inst__login_facebook =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_function_async", (["auth", "login_facebook", ([f.v.fbid, f.v.email, f.v.fname, f.v.sname, f.v.token])])); },
	function (e,f) { var t276 = f.s[0]; e.return_pop (t276); },
null	];

;
};
auth.init_methods (auth);
rpcclass.setup_class (auth, "auth",0, (["listeners"]), ([2]));
function ajax () { this.do_construct (arguments); }
ajax.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
	cp.cancel =  function ()
	{
		if (this.req !== undefined)
			this.req.abort();
			}

;
	c.create = cp.create =  function (rpc_method,args,completion,completion_arg)
	{
var aj;{
		aj = eval ("new "+"ajax");;
		aj.rpc_method = rpc_method;;
		aj.args = args;;
		aj.completion = completion;;
		aj.completion_arg = completion_arg;;
		return (aj);
		}
			}

;
	c.args__do_call_function_async = c.pargs__do_call_function_async =  ["obj","meth","margs"];
	c.inst__do_call_function_async = c.pinst__do_call_function_async =  [
/*0*/	function (e,f) {
		f.v.args = ([]);
		f.v.args[f.v.args.length] = f.v.meth;
		f.v.args[f.v.args.length] = f.v.obj;
		f.v.args[f.v.args.length] = f.v.margs;
		e.smcall (0, php_engine,"get_current_thread_id", ([]));
	},
	function (e,f) {
		f.s[1] = "php_engine.resume_thread";
		f.s[2] = f.v.args;
		f.s[3] = "rpc_call_method";
		e.php_static_method_call (4, ajax,"create", 4);
	},
	function (e,f) {
		var t283 = f.s[0]; f.v.aj = t283;
		e.mcall (2, f.v.aj, "initiate", ([]));
	},
	function (e,f) {  },
	function (e,f) { e.php_builtin (0, "wait_for_completion", 0); },
/*5*/	function (e,f) {
		var t285 = f.s[0]; f.v.res = t285;
		if ((((f.v.res).action)) == (("ajax-complete"))) f.pc=6; else f.pc=4;
	},
	function (e,f) { e.return_pop ((f.v.res).parm); },
null	];

;
	c.args__do_call_static_function_async = c.pargs__do_call_static_function_async =  ["classname","meth","margs"];
	c.inst__do_call_static_function_async = c.pinst__do_call_static_function_async =  [
/*0*/	function (e,f) {
		f.v.args = ([]);
		f.v.args[f.v.args.length] = f.v.classname;
		f.v.args[f.v.args.length] = f.v.meth;
		f.v.args[f.v.args.length] = f.v.margs;
		e.smcall (0, php_engine,"get_current_thread_id", ([]));
	},
	function (e,f) {
		f.s[1] = "php_engine.resume_thread";
		f.s[2] = f.v.args;
		f.s[3] = "rpc_call_static_method";
		e.php_static_method_call (4, ajax,"create", 4);
	},
	function (e,f) {
		var t292 = f.s[0]; f.v.aj = t292;
		e.mcall (2, f.v.aj, "initiate", ([]));
	},
	function (e,f) {  },
	function (e,f) { e.php_builtin (0, "wait_for_completion", 0); },
/*5*/	function (e,f) {
		var t294 = f.s[0]; f.v.res = t294;
		if ((((f.v.res).action)) == (("ajax-complete"))) f.pc=6; else f.pc=4;
	},
	function (e,f) { e.return_pop ((f.v.res).parm); },
null	];

;
	cp.handle_response =  function (data)
	{
		var compound = data.firstChild;
		for (var i = 0; i < compound.childNodes.length; i++)
		{
			node = compound.childNodes[i];
			if (node.tagName == "result")
			{
				var text = "";
				for (var j = 0; node.childNodes[j] != undefined; j++)
				{
					if (node.childNodes[j].nodeType == 3)
						text += node.childNodes[j].nodeValue;
				}
				var result = ajax.convert_xml_to_object (text);
				var completion = eval (this.completion);
				completion (this.completion_arg, "ajax-complete", result);
			}
			else if (node.tagName == "result3")
			{
				var text = "";
				for (var j = 0; node.childNodes[j] != undefined; j++)
				{
					if (node.childNodes[j].nodeType == 3)
						text += node.childNodes[j].nodeValue;
				}
//					debugout ("Got result "+text);
				var result = eval ("("+text+")");
//					debugout ("Value is '"+result+"'");
				var completion = eval (this.completion);
				completion (this.completion_arg, "ajax-complete", result);
			}
			else if (node.tagName == "stdout")
			{
				for (var j = 0; node.childNodes[j] != undefined; j++)
					builtin__echo (node.childNodes[j].nodeValue);
//				var div = document.getElementById ("debug");
//				if (div) div.innerHTML += node.firstChild.nodeValue;
			}
			else if (node.tagName == "error")
			{
				alert (node.firstChild.nodeValue);
				throw new Error (node.firstChild.nodeValue);
			}
//				else if (node.tagName == "class")
//				{
//					ajax.load_object_from_xml (node);
//				}
			else if (node.tagName == "class3")
			{
				ajax.load_object_from_class3 (node);
			}
		}
		window.status = "";
		return false;
			}

;
	cp.complete2 =  function (data)
	{
		return this.handle_response (data);
			}

;
	cp.complete =  function (req)
	{
//		debugout ("AJAX transaction "+this.corr+" completed with status "+req.status);
		if (req.status == 0)
		{
			// aborted
			return;
		}

		if (req.status != 200)
		{
			alert ("Failed when contacting server ("+req.status+")");
			throw new Error ("Failed when contacting server ("+req.status+")");
		}

		if (req.responseXML == null || req.responseXML.firstChild == null)
		{
			debugout (req.responseText);
			alert ("RPC call failed: "+req.responseText);
			throw new Error ("RPC call failed");
		}


		window.status = "Decoding response";
//				alert (req.responseText);

		if (req.responseXML.firstChild.tagName == "compound")
		{
			return this.handle_response (req.responseXML);
		}
		else
		{
			alert ("Unexpected response "+req.responseXML.firstChild.tagName+":"+req.responseText);
			throw new Error ("Unexpected response "+req.responseXML.firstChild.tagName);
		}
			}

;
	cp.initiate =  function ()
	{
		var msg = new Object;
		var closure = new Array;

		var sargs = ajax.serialize_object (this.args, closure);
		msg.method = this.rpc_method;
		msg.args = sargs;

		var i;
		for (i = 0; i < closure.length; i++)
		{
			var obj = closure[i];
			msg["object"+i] = "classname="+encodeURIComponent(obj.classname)+"&obj_id="+encodeURIComponent(obj.obj_id)+"&fields="+encodeURIComponent(obj.serialize(closure));
		}


		this.corr = builtin__make_uniq();
		var myobj = this;

		$.post(rootpath.map("/pj/ajax.php?page_version="+window.page_version), msg, function (data, textStatus) {myobj.complete2 (data);}, "xml");

			}

;
	c.stub_object = cp.stub_object =  function (obj)
	{
//		debugout ("stubbing object "+obj);
		if (obj === null || obj === undefined)
		{
			return "{n}";
		}
		else if (obj.constructor == Array)
		{
			var res = "{a:";
			for (var i = 0; i < obj.length; i++)
			{
				var childtag = ajax.stub_object (obj[i]);
				if (childtag == null)
					alert ("Failed to encode array index "+i+" of "+obj);
				else
				{
					res += "["+encodeURIComponent (childtag)+"]";
				}	
			}
			return res + "}";
		}
		else
		{
			if (obj.serialize == undefined)
			{
				debugout ("Object to stub is not an object, it is a "+typeof obj+" = "+obj.constructor);
			}
			return "{o:"+obj.classname+":"+encodeURIComponent(obj.obj_id)+"}";
		}
			}

;
	c.add_to_closure = cp.add_to_closure =  function (closure,obj)
	{
		for (var i in closure)
			if (closure[i] == obj)
				return;
		closure[closure.length] = obj;
			}

;
	c.serialize_object1 = cp.serialize_object1 =  function (obj,closure,structures)
	{
//		debugout ("serializing object "+obj);
		if (++antirecurse == 1000)
		{
			alert ("Too much recursion");
			throw ("Too much recursion");
		}
		else if (typeof obj == "string")
		{
			return "{s:"+encodeURIComponent (obj)+"}";
		}
		else if (typeof obj == "number")
		{
			return "{i:"+encodeURIComponent (obj)+"}";
		}
		else if (typeof obj == "boolean")
		{
			return "{b:"+(obj?"1":"0")+"}";
		}
		else if (obj === undefined)
		{
			return "{n}";
		}
		else if (typeof obj == "object")
		{
			if (obj == null)
			{
				return "{n}";
			}
			else if (obj.constructor == Array)
			{
				var res = "{a:";
				for (var i = 0; i < obj.length; i++)
				{
					var childtag = ajax.serialize_object1 (obj[i], closure, structures);
					if (childtag == null)
						alert ("Failed to encode array index "+i+" of "+obj);
					else
					{
						res += "["+encodeURIComponent (childtag)+"]";
					}	
				}
				return res + "}";
			}
			else
			{
				var classname = rpcclass.get_classname (obj);
				if (classname)
				{
					if (obj.classname !== classname)
					{
						alert ("Class name should be "+classname+" but is "+obj.classname);
						throw ("Class name should be "+classname+" but is "+obj.classname);
					}
					if (obj.class_is_readonly == 0)
						ajax.add_to_closure (closure, obj);
					return "{o:"+classname+":"+encodeURIComponent(obj.obj_id)+"}";
				}
				else if (obj.nodeName != null)
				{
					if (obj.id == undefined) obj.id = "HTML"+builtin__make_uniq();
					return "{h:"+encodeURIComponent(obj.id)+"}";
				}
				else
				{
					for (var o in structures)
					{
						if (o == obj)
						{
							alert ("Object is recursive");
							throw ("Object is recursive");
						}
					}
					structures[structures.length] = obj;

					var res = "{t:";
					for (var p in obj)
					{
						if (typeof (obj[p]) != "function")
						{
							res += "["+encodeURIComponent(p)+"="+encodeURIComponent(ajax.serialize_object1(obj[p], closure, structures))+"]";
						}
					}
					return res+"}";
				}
			}
		}
		else
		{
			debugout ("Cannot convert type "+(typeof obj)+" to XML");
			return null;
		}
			}

;
	c.serialize_object = cp.serialize_object =  function (obj,closure)
	{
		antirecurse = 0;
		var structures = new Array;
//		alert("serializing object "+obj);
		var res = ajax.serialize_object1 (obj, closure, structures);
//		alert ("res = "+res);
		return res;
			}

;
};
ajax.init_methods (ajax);
rpcclass.setup_class (ajax, "ajax",0, (["listeners"]), ([2]));
function dynloader () { this.do_construct (arguments); }
dynloader.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
	c.actually_load_codegroup = cp.actually_load_codegroup =  function (name)
	{
var heads;var head;var script;{
		;
		heads = document.getElementsByTagName  ("head");;
		head = heads[0];;
		script = document.createElement  ("script");;
		script.setAttribute  ("type","text/javascript");;
		script.setAttribute  ("src","/pj/js.php?codegroup=" + name);;
		head.appendChild  (script);;
		}
			}

;
	c.args__load_codegroup = c.pargs__load_codegroup =  ["name"];
	c.inst__load_codegroup = c.pinst__load_codegroup =  [
/*0*/	function (e,f) {
		e.php_push_static_var (1, dynloader,"codegroups");
		var t295 = f.s[1]; 
		if (((t295)) === ((null))) f.pc=1; else f.pc=2;
	},
	function (e,f) {
		f.s[0] = ({});
		e.php_push_static_var_lvalue (1, dynloader,"codegroups");
		e.php_assign (2);
	},
	function (e,f) {
		e.php_push_static_var (1, dynloader,"codegroups");
		var t297 = f.s[1]; 
		if (((t297)[(f.v.name)]) !== undefined) f.pc=3; else f.pc=4;
	},
	function (e,f) { f.pc=-1; },
	function (e,f) {
		e.php_push_static_var (2, dynloader,"codegroups");
		var t298 = f.s[2]; t298[f.v.name] = true;
		e.smcall (0, php_engine,"get_current_thread_id", ([]));
	},
/*5*/	function (e,f) {
		e.php_push_static_var_lvalue (1, dynloader,"thread_id");
		e.php_assign (2);
		e.mcall (4, window, "setTimeout", ([("dynloader.actually_load_codegroup('") + ("" + (f.v.name) + ("')")), 1]));
	},
	function (e,f) { e.php_builtin (0, "wait_for_completion", 0); },
null	];

;
	c.load_complete = cp.load_complete =  function (name)
	{
{
		php_engine.resume_thread  (dynloader.thread_id,"load-complete",null);;
		}
			}

;
	c.args__load_codegroup_mcall = c.pargs__load_codegroup_mcall =  ["name","obj","methodname","args"];
	c.inst__load_codegroup_mcall = c.pinst__load_codegroup_mcall =  [
/*0*/	function (e,f) { e.smcall (1, dynloader,"load_codegroup", ([f.v.name])); },
	function (e,f) {
		f.s[0] = f.v.args;
		f.s[1] = ([f.v.obj, f.v.methodname]);
		e.php_builtin (2, "call_user_func_array", 2);
	},
	function (e,f) { var t302 = f.s[0]; e.return_pop (t302); },
null	];

;
	c.args__load_codegroup_smcall = c.pargs__load_codegroup_smcall =  ["name","classname","methodname","args"];
	c.inst__load_codegroup_smcall = c.pinst__load_codegroup_smcall =  [
/*0*/	function (e,f) { e.smcall (1, dynloader,"load_codegroup", ([f.v.name])); },
	function (e,f) {
		f.s[0] = f.v.args;
		f.s[1] = ([f.v.classname, f.v.methodname]);
		e.php_builtin (2, "call_user_func_array", 2);
	},
	function (e,f) { var t303 = f.s[0]; e.return_pop (t303); },
null	];

;
};
dynloader.init_methods (dynloader);
rpcclass.setup_class (dynloader, "dynloader",0, (["listeners"]), ([2]));
function dbclass () { this.do_construct (arguments); }
dbclass.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
	c.args__find_object = c.pargs__find_object =  ["cname","id"];
	c.inst__find_object = c.pinst__find_object =  [
/*0*/	function (e,f) {
		f.pc=2;
		e.smcall (2, rpcclass,"object_present", ([f.v.cname, ("dbclass:") + ("" + (f.v.cname) + ((":") + (f.v.id)))]));
	},
	function (e,f) { e.return_pop (null); },
	function (e,f) {
		var t304 = f.s[0]; 
		if (!(t304)) f.pc=1; else f.pc=3;
	},
	function (e,f) { e.smcall (2, rpcclass,"get_object_by_id", ([f.v.cname, ("dbclass:") + ("" + (f.v.cname) + ((":") + (f.v.id)))])); },
	function (e,f) { var t305 = f.s[0]; e.return_pop (t305); },
null	];

;
	c.pargs__render_calc_gobi =  [];
	c.pinst__render_calc_gobi =  [
/*0*/	function (e,f) { e.return_pop ("" + ((f.v["this"]).classname) + ((".dgobi('") + ("" + ((f.v["this"]).rowid) + ("')")))); },
null	];

;
	c.dgobi = cp.dgobi =  function (id)
	{
		return rpcclass.get_object_by_id (this.prototype.classname, "dbclass:"+this.prototype.classname+":"+id);
			}

;
};
dbclass.init_methods (dbclass);
rpcclass.setup_class (dbclass, "dbclass",0, (["rowid","listeners"]), ([0,2]));
function single_use_token () { this.do_construct (arguments); }
single_use_token.init_methods = function (c) {
	dbclass.init_methods(c);
	var cp = c.prototype;
};
single_use_token.init_methods (single_use_token);
rpcclass.setup_class (single_use_token, "single_use_token",0, (["tokenstr","timeout","data","owner","rowid","listeners"]), ([0,0,0,0,0,2]));
function aes () { this.do_construct (arguments); }
aes.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
	c.get_key_complete = cp.get_key_complete =  function (res)
	{
{
		php_engine.resume_thread  (aes.thread_id,"sgk-complete",res);;
		}
			}

;
	c.args__get_key = c.pargs__get_key =  [];
	c.inst__get_key = c.pinst__get_key =  [
/*0*/	function (e,f) {
		e.php_push_static_var (0, aes,"current_key");
		var t306 = f.s[0]; 
		if ((t306) !== undefined) f.pc=1; else f.pc=2;
	},
	function (e,f) { f.pc=-1; },
	function (e,f) {
		f.v.cookie = (document).cookie;
		f.v.sessid = builtin__strstr (f.v.cookie,"PHPSESSID=");
		if (((f.v.sessid)) === ((false))) f.pc=3; else f.pc=4;
	},
	function (e,f) {
		f.s[0] = builtin__alert ("session cookie not found");
		f.pc=-1;
	},
	function (e,f) {
		f.v.sessid = builtin__substr (f.v.sessid,10);
		f.v.pos = builtin__strpos (f.v.sessid,";");
		if (((f.v.pos)) !== ((false))) f.pc=5; else f.pc=6;
	},
/*5*/	function (e,f) { f.v.sessid = builtin__substr (f.v.sessid,0,f.v.pos); },
	function (e,f) {
		f.v.url = ("https://secure.concordant.co.uk/relay/get-key2.php?targethost=") + ("" + ((encodeURIComponent ((window).location))) + (("&sessid=") + ((encodeURIComponent (f.v.sessid)))));
		e.mcall (3, document, "getElementsByTagName", (["head"]));
	},
	function (e,f) {
		var t314 = f.s[0]; f.v.heads = t314;
		f.v.head = (f.v.heads)[(0)];
		e.mcall (3, document, "createElement", (["script"]));
	},
	function (e,f) {
		var t317 = f.s[0]; f.v.script = t317;
		e.mcall (4, f.v.script, "setAttribute", (["type", "text/javascript"]));
	},
	function (e,f) { e.mcall (4, f.v.script, "setAttribute", (["src", f.v.url])); },
/*10*/	function (e,f) { e.mcall (3, f.v.head, "appendChild", ([f.v.script])); },
	function (e,f) { e.smcall (0, php_engine,"get_current_thread_id", ([])); },
	function (e,f) {
		e.php_push_static_var_lvalue (1, aes,"thread_id");
		e.php_assign (2);
	},
	function (e,f) { e.php_builtin (0, "wait_for_completion", 0); },
	function (e,f) {
		var t321 = f.s[0]; f.v.ev = t321;
		if ((((f.v.ev).action)) == (("sgk-complete"))) f.pc=15; else f.pc=13;
	},
/*15*/	function (e,f) {
		f.s[0] = builtin__debugout (("urlencoded key is ") + ((f.v.ev).parm));
		f.s[0] = (f.v.ev).parm;
		e.php_push_static_var_lvalue (1, aes,"current_key");
		e.php_assign (2);
	},
null	];

;
	c.args__encrypt = c.pargs__encrypt =  ["plaintext"];
	c.inst__encrypt = c.pinst__encrypt =  [
/*0*/	function (e,f) { e.smcall (0, aes,"get_key", ([])); },
	function (e,f) {
		e.php_push_static_var (1, aes,"current_key");
		var t323 = f.s[1]; e.mcall (5, AesCtr, "encrypt", ([f.v.plaintext, t323, 256]));
	},
	function (e,f) { var t324 = f.s[0]; e.return_pop (t324); },
null	];

;
	c.args__decrypt = c.pargs__decrypt =  ["ciphertext"];
	c.inst__decrypt = c.pinst__decrypt =  [
/*0*/	function (e,f) { e.smcall (0, aes,"get_key", ([])); },
	function (e,f) {
		e.php_push_static_var (1, aes,"current_key");
		var t325 = f.s[1]; e.mcall (5, AesCtr, "decrypt", ([f.v.ciphertext, t325, 256]));
	},
	function (e,f) { var t326 = f.s[0]; e.return_pop (t326); },
null	];

;
	c.args__encrypt_struct = c.pargs__encrypt_struct =  ["str"];
	c.inst__encrypt_struct = c.pinst__encrypt_struct =  [
/*0*/	function (e,f) {
		f.v.res = ({});
		f.v._k18 = e.enumkeys (f.v.str);
	},
	function (e,f) {
		f.pc=3;
		if (!((f.v._k18).length)) f.pc=2;
	},
	function (e,f) { e.return_pop (f.v.res); },
	function (e,f) {
		f.s[0] = f.v.key = (f.v._k18).shift();
		f.s[1] = f.v.value = (f.v.str)[(f.v.key)];
		e.smcall (3, aes,"encrypt", ([f.v.value]));
	},
	function (e,f) {
		f.pc=1;
		var t332 = f.s[2]; f.v.res[f.v.key] = t332;
	},
null	];

;
	c.args__decrypt_struct = c.pargs__decrypt_struct =  ["str"];
	c.inst__decrypt_struct = c.pinst__decrypt_struct =  [
/*0*/	function (e,f) {
		f.v.res = ({});
		f.v._k20 = e.enumkeys (f.v.str);
	},
	function (e,f) {
		f.pc=3;
		if (!((f.v._k20).length)) f.pc=2;
	},
	function (e,f) { e.return_pop (f.v.res); },
	function (e,f) {
		f.s[0] = f.v.key = (f.v._k20).shift();
		f.s[1] = f.v.value = (f.v.str)[(f.v.key)];
		e.smcall (3, aes,"decrypt", ([f.v.value]));
	},
	function (e,f) {
		f.pc=1;
		var t338 = f.s[2]; f.v.res[f.v.key] = t338;
	},
null	];

;
};
aes.init_methods (aes);
rpcclass.setup_class (aes, "aes",0, (["listeners"]), ([2]));
function site_config () { this.do_construct (arguments); }
site_config.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
};
site_config.init_methods (site_config);
rpcclass.setup_class (site_config, "site_config",0, (["listeners"]), ([2]));
function lib () { this.do_construct (arguments); }
lib.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
	c.args__sleep = c.pargs__sleep =  ["n"];
	c.inst__sleep = c.pinst__sleep =  [
/*0*/	function (e,f) { e.smcall (0, php_engine,"get_current_thread_id", ([])); },
	function (e,f) {
		var t340 = f.s[0]; f.v.tid = t340;
		e.mcall (4, window, "setTimeout", ([("rpcclass.resume_thread (null, null, ") + ("" + (f.v.tid) + (", 'sleep_complete', null)")), f.v.n]));
	},
	function (e,f) {  },
	function (e,f) { e.php_builtin (0, "wait_for_input", 0); },
	function (e,f) {
		var t342 = f.s[0]; f.v.ev = t342;
		if ((((f.v.ev).action)) == (("sleep_complete"))) f.pc=-1; else f.pc=3;
	},
null	];

;
	c.floatmul = cp.floatmul =  function (a0,a1)
	{
		return parseFloat(a0) * parseFloat(a1);
			}

;
	c.floatdiv = cp.floatdiv =  function (a0,a1)
	{
		return parseFloat(a0) / parseFloat(a1);
			}

;
	c.floatadd = cp.floatadd =  function (a0,a1)
	{
		return parseFloat(a0) + parseFloat(a1);
			}

;
	c.args__page_version = c.pargs__page_version =  [];
	c.inst__page_version = c.pinst__page_version =  [
/*0*/	function (e,f) { e.return_pop ((window).page_version); },
null	];

;
	c.evaluate_javascript = cp.evaluate_javascript =  function (code)
	{
		return eval (code);
			}

;
	c.insertAtCaret = cp.insertAtCaret =  function (obj,text)
	{
		if(document.selection) {
			obj.focus();
			var orig = obj.value.replace(/\r\n/g, "\n");
			var range = document.selection.createRange();

			if(range.parentElement() != obj) {
				return false;
			}

			range.text = text;
			
			var actual = tmp = obj.value.replace(/\r\n/g, "\n");

			for(var diff = 0; diff < orig.length; diff++) {
				if(orig.charAt(diff) != actual.charAt(diff)) break;
			}

			for(var index = 0, start = 0; 
				tmp.match(text) 
					&& (tmp = tmp.replace(text, "")) 
					&& index <= diff; 
				index = start + text.length
			) {
				start = actual.indexOf(text, index);
			}
		} else if(obj.selectionStart) {
			var start = obj.selectionStart;
			var end   = obj.selectionEnd;

			obj.value = obj.value.substr(0, start) 
				+ text 
				+ obj.value.substr(end, obj.value.length);
		}
		
		if(start != null) {
			lib.setCaretTo(obj, start + text.length);
		} else {
			obj.value += text;
		}
			}

;
	c.setCaretTo = cp.setCaretTo =  function (obj,pos)
	{
		if(obj.createTextRange) {
			var range = obj.createTextRange();
			range.move('character', pos);
			range.select();
		} else if(obj.selectionStart) {
			obj.focus();
			obj.setSelectionRange(pos, pos);
		}
			}

;
	c.document_x_of = cp.document_x_of =  function (obj)
	{
		var res = 0;
		while (obj)
		{
			res += obj.offsetLeft;
			obj = obj.offsetParent;
			if (obj) res -= obj.scrollLeft;
		}
		return res;
			}

;
	c.block_x_of = cp.block_x_of =  function (obj)
	{
		var res = 0;
		while (obj)
		{
			if (obj.style.position == "absolute") break;
			res += obj.offsetLeft;
			obj = obj.offsetParent;
		}
		return res;
			}

;
	c.document_y_of = cp.document_y_of =  function (obj)
	{
		var res = 0;
/*
		while (obj)
		{
			res += obj.offsetTop;
			obj = obj.offsetParent;
			if (obj)
			{
				if (obj.scrollTop) debugout ("tagName = "+obj.tagName);
				res -= obj.scrollTop;
			}
		}
*/
		var next = obj;
		while (obj)
		{
			if (obj == next)
			{
				res += obj.offsetTop;
				next = obj.offsetParent;
			}
			if (obj.scrollTop !== undefined)
				res -= obj.scrollTop;
			obj = obj.parentNode;

		}
		res += browser.scroll_top ();
		return res;
			}

;
	c.block_y_of = cp.block_y_of =  function (obj)
	{
		var res = 0;
		while (obj)
		{
			if (obj.style.position == "absolute") break;
			res += obj.offsetTop;
			obj = obj.offsetParent;
		}
		return res;
			}

;
	c.args__render_price = c.pargs__render_price =  ["price"];
	c.inst__render_price = c.pinst__render_price =  [
/*0*/	function (e,f) {
		f.v.sign = "";
		if (((f.v.price)) < ((0))) f.pc=1; else f.pc=2;
	},
	function (e,f) {
		f.v.sign = "-";
		f.v.price = parseInt((0),10) - parseInt((f.v.price),10);
	},
	function (e,f) {
		f.v.price = builtin__str_pad (f.v.price,3,"0",0);
		e.return_pop ("" + (f.v.sign) + (("£") + ("" + (builtin__substr (f.v.price,0,parseInt(((f.v.price).length),10) - parseInt((2),10))) + ((".") + (builtin__substr (f.v.price,parseInt(((f.v.price).length),10) - parseInt((2),10)))))));
	},
null	];

;
	c.args__render_price_simple = c.pargs__render_price_simple =  ["price"];
	c.inst__render_price_simple = c.pinst__render_price_simple =  [
/*0*/	function (e,f) {
		f.v.sign = "";
		if (((f.v.price)) < ((0))) f.pc=1; else f.pc=2;
	},
	function (e,f) {
		f.v.sign = "-";
		f.v.price = parseInt((0),10) - parseInt((f.v.price),10);
	},
	function (e,f) {
		f.v.price = builtin__str_pad (f.v.price,3,"0",0);
		e.return_pop ("" + (f.v.sign) + ("" + (builtin__substr (f.v.price,0,parseInt(((f.v.price).length),10) - parseInt((2),10))) + ((".") + (builtin__substr (f.v.price,parseInt(((f.v.price).length),10) - parseInt((2),10))))));
	},
null	];

;
	c.args__parse_price_simple = c.pargs__parse_price_simple =  ["str"];
	c.inst__parse_price_simple = c.pinst__parse_price_simple =  [
/*0*/	function (e,f) {
		f.v.str = builtin__trim (f.v.str);
		f.v.sign = 1;
		if (((builtin__substr (f.v.str,0,1))) == (("-"))) f.pc=1; else f.pc=2;
	},
	function (e,f) {
		f.v.sign = parseInt((0),10) - parseInt((1),10);
		f.v.str = builtin__substr (f.v.str,1);
	},
	function (e,f) {
		f.v.matches = ([]);
		if (builtin__preg_match ("/^([0-9]+)\\.([0-9]{2})$/",f.v.str,f.v.matches)) f.pc=3; else f.pc=4;
	},
	function (e,f) {
		f.v.amount = ((parseInt(((((f.v.matches)[(1)])) * ((100))),10) + parseInt(((f.v.matches)[(2)]),10))) * ((f.v.sign));
		e.return_pop (f.v.amount);
	},
	function (e,f) { if (builtin__preg_match ("/^([0-9]+)$/",f.v.str,f.v.matches)) f.pc=5; else f.pc=6; },
/*5*/	function (e,f) {
		f.v.amount = (((((f.v.matches)[(1)])) * ((100)))) * ((f.v.sign));
		e.return_pop (f.v.amount);
	},
	function (e,f) { e.return_pop (null); },
null	];

;
};
lib.init_methods (lib);
rpcclass.setup_class (lib, "lib",0, (["listeners"]), ([2]));
function miscfile () { this.do_construct (arguments); }
miscfile.init_methods = function (c) {
	dbclass.init_methods(c);
	var cp = c.prototype;
};
miscfile.init_methods (miscfile);
rpcclass.setup_class (miscfile, "miscfile",1, (["section","name","mimetype","rowid","listeners"]), ([0,0,0,0,2]));
function asyncnotify () { this.do_construct (arguments); }
asyncnotify.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
	c.thread_starting = cp.thread_starting =  function ()
	{
		asyncnotify.thread_running++;
			}

;
	c.thread_stopping = cp.thread_stopping =  function ()
	{
		if (0 == (--asyncnotify.thread_running));
			asyncnotify.dispatch ();
			}

;
	c.post_request = cp.post_request =  function ()
	{
var args;var aj;{
		if (! asyncnotify.on_browser || asyncnotify.req != null || ! asyncnotify.needed)
		{return }
		;
		args = [];;
		args[args.length] = "asyncnotify";;
		args[args.length] = "poll";;
		args[args.length] = [];;
		aj = ajax.create  ("rpc_call_static_method",args,"asyncnotify.raw_completion",null);;
		aj.initiate  ();;
		asyncnotify.req = aj;;
		}
			}

;
	c.onunload = cp.onunload =  function ()
	{
		if (asyncnotify.req != null)
			asyncnotify.req.cancel();
			}

;
	c.initialise = cp.initialise =  function ()
	{
		asyncnotify.on_browser = true;
		asyncnotify.post_request();
		window.onunload = asyncnotify.onunload;
			}

;
	c.pargs__process_message =  [];
	c.pinst__process_message =  [
/*0*/	function (e,f) { if (!(((f.v["this"]).method) !== undefined)) f.pc=1; else f.pc=2; },
	function (e,f) {
		f.s[0] = builtin__debugout (("Expected method to be defined in ") + (f.v["this"]));
		f.pc=-1;
	},
	function (e,f) {
		f.v.method = (f.v["this"]).method;
		e.mcall (3, (f.v["this"]).obj, f.v.method, ([(f.v["this"]).result]));
	},
null	];

;
	c.dispatch = cp.dispatch =  function ()
	{
		if (asyncnotify.msg_queue.length == 0) return;
		var obj = asyncnotify.msg_queue.shift();
		obj.call_self_using_engine ("process_message", ([]));
			}

;
	cp.completion =  function (msg)
	{
		this.result = msg;
		if (this.wait_for_idle)
		{
			asyncnotify.msg_queue.push (this);

			if (asyncnotify.thread_running == 0)
			{
				asyncnotify.dispatch();
			}
		}
		else
		{
			this.call_self_using_engine ("process_message", ([]));
		}

			}

;
	c.raw_completion = cp.raw_completion =  function (arg,cmd,res)
	{
		asyncnotify.req = null;
		asyncnotify.post_request();
		if (res == null) return;

		var ths = rpcclass.get_object_by_id ("asyncnotify", res["objid"]);

		var msg = res["msg"];
		ths.completion (msg);
			}

;
	c.pargs__establish_watch =  [];
	c.pinst__establish_watch =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["establish_watch", ([])])); },
	function (e,f) { var t359 = f.s[0]; e.return_pop (t359); },
null	];

;
	c.args__create_watch = c.pargs__create_watch =  ["key","obj","method","wait_for_idle"];
	c.inst__create_watch = c.pinst__create_watch =  [
/*0*/	function (e,f) {
		e.php_push_static_var (0, asyncnotify,"never_watch");
		var t360 = f.s[0]; if (t360) f.pc=1; else f.pc=2;
	},
	function (e,f) { e.return_pop (null); },
	function (e,f) {
		f.v.asn = new asyncnotify;
		f.v.asn.key = f.v.key;
		f.v.asn.obj = f.v.obj;
		e.mcall (2, f.v.obj, "get_id", ([]));
	},
	function (e,f) {
		var t365 = f.s[0]; f.v.asn.tobjid = t365;
		f.v.asn.method = f.v.method;
		f.v.asn.wait_for_idle = f.v.wait_for_idle;
		e.mcall (2, f.v.asn, "establish_watch", ([]));
	},
	function (e,f) {
		f.s[0] = true;
		e.php_push_static_var_lvalue (1, asyncnotify,"needed");
		e.php_assign (2);
		e.smcall (0, asyncnotify,"post_request", ([]));
	},
/*5*/	function (e,f) { e.return_pop (f.v.asn); },
null	];

;
	c.args__notify =  ["key","msg"];
	c.inst__notify =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_function_async", (["asyncnotify", "notify", ([f.v.key, f.v.msg])])); },
	function (e,f) { var t369 = f.s[0]; e.return_pop (t369); },
null	];

;
	c.args__notify_ex =  ["key","msg","obj_list"];
	c.inst__notify_ex =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_function_async", (["asyncnotify", "notify_ex", ([f.v.key, f.v.msg, f.v.obj_list])])); },
	function (e,f) { var t370 = f.s[0]; e.return_pop (t370); },
null	];

;
	c.args__poll =  [];
	c.inst__poll =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_function_async", (["asyncnotify", "poll", ([])])); },
	function (e,f) { var t371 = f.s[0]; e.return_pop (t371); },
null	];

;
};
asyncnotify.init_methods (asyncnotify);
rpcclass.setup_class (asyncnotify, "asyncnotify",0, (["key","method","wait_for_idle","tobjid","obj","listeners"]), ([0,0,0,0,0,2]));
function timer () { this.do_construct (arguments); }
timer.init_methods = function (c) {
	dbclass.init_methods(c);
	var cp = c.prototype;
};
timer.init_methods (timer);
rpcclass.setup_class (timer, "timer",0, (["classname","method","period","next","rowid","listeners"]), ([0,0,0,0,0,2]));
function dataitemdiv () { this.do_construct (arguments); }
dataitemdiv.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
	c.args__create = c.pargs__create =  ["data","render_method","render_arg"];
	c.inst__create = c.pinst__create =  [
/*0*/	function (e,f) {
		f.v.did = new dataitemdiv;
		f.v.did.data = f.v.data;
		f.v.did.render_method = f.v.render_method;
		f.v.did.render_arg = f.v.render_arg;
		e.mcall (5, f.v.data, "listen_msg", (["update_notification", f.v.did, "changed"]));
	},
	function (e,f) {
		f.s[0] = "\">";
		e.mcall (3, f.v.did, "get_id", ([]));
	},
	function (e,f) {
		var t376 = f.s[1]; var t377 = f.s[0]; 
		window.__outbuffer += ("<div id=\"did-") + ("" + (t376) + (t377));
		e.mcall (3, f.v.data, f.v.render_method, ([f.v.render_arg]));
	},
	function (e,f) {
		window.__outbuffer += "</div>";
		e.return_pop (f.v.did);
	},
null	];

;
	c.pargs__changed =  [];
	c.pinst__changed =  [
/*0*/	function (e,f) { e.mcall (2, f.v["this"], "get_id", ([])); },
	function (e,f) {
		var t378 = f.s[0]; 
		e.mcall (3, document, "getElementById", ([("did-") + (t378)]));
	},
	function (e,f) {
		var t380 = f.s[0]; f.v.el = t380;
		f.s[0] = builtin__ob_start ();
		f.v.method = (f.v["this"]).render_method;
		e.mcall (3, (f.v["this"]).data, f.v.method, ([(f.v["this"]).render_arg]));
	},
	function (e,f) { f.v.el.innerHTML = builtin__ob_get_clean (); },
null	];

;
};
dataitemdiv.init_methods (dataitemdiv);
rpcclass.setup_class (dataitemdiv, "dataitemdiv",0, (["data","render_method","render_arg","listeners"]), ([0,0,0,2]));
function dragndrop () { this.do_construct (arguments); }
dragndrop.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
	c.begin_from_xy = cp.begin_from_xy =  function (elementToDrag,x,y,onlyY,parent,release_method,move_method)
	{
		var deltaX = x - parseInt (elementToDrag.style.left);
		var deltaY = y - parseInt (elementToDrag.style.top);

		var old_movehandler;
		var old_uphandler;
		var old_onselectstart;

		function retfalse ()
		{
			return false;
		}

		if (document.addEventListener)
		{
			document.addEventListener ("mousemove", moveHandler, true);
			document.addEventListener ("mouseup", upHandler, true);
		}
		else if (document.attachEvent)
		{
			document.attachEvent ("onmousemove", moveHandler);
			document.attachEvent ("onmouseup", upHandler);
			old_onselectstart = document.onselectstart;
			document.onselectstart = retfalse;
		}
		else
		{
			old_movehandler = document.onmousemove;
			old_uphandler = document.onmouseup;
			document.onmousemove = moveHandler;
			document.onmouseup = upHandler;
		}


		function moveHandler (e)
		{
			if (!e) e = window.event;
			if (!onlyY)
				elementToDrag.style.left = (e.clientX - deltaX) + "px";
			elementToDrag.style.top = (e.clientY - deltaY) + "px";
			if (e.stopPropagation) e.stopPropagation();
			else e.cancelBubble = true;
			if (parent)
			{
				parent[move_method] (e);
	//			deltaX = event.clientX - parseInt (elementToDrag.style.left);
				deltaY = e.clientY - parseInt (elementToDrag.style.top);
			}
		}

		function upHandler (e)
		{
			if (!e) e = window.event;
			if (document.removeEventListener)
			{
				document.removeEventListener ("mouseup", upHandler, true);
				document.removeEventListener ("mousemove", moveHandler, true);
			}
			else if (document.detachEvent)
			{
				document.detachEvent ("onmouseup", upHandler);
				document.detachEvent ("onmousemove", moveHandler);
				document.onselectstart = old_onselectstart;
			}
			else
			{
				document.onmouseup = old_uphandler;
				document.onmousemove = old_movehandler;
			}
			if (e.stopPropagation) e.stopPropagation();
			else e.cancelBubble = true;

			if (parent)
			{
				parent[release_method] (e);
				parent = null;
			}
		}


			}

;
	c.begin_from_event = cp.begin_from_event =  function (elementToDrag,event,onlyY,parent,release_method,move_method)
	{
		if (!event) event = window.event;
		if (event.stopPropagation)
		{
			event.stopPropagation();
			event.preventDefault();
		}
		else event.cancelBubble = true;
		dragndrop.begin_from_xy (elementToDrag, event.clientX, event.clientY, onlyY, parent, release_method, move_method);
			}

;
};
dragndrop.init_methods (dragndrop);
rpcclass.setup_class (dragndrop, "dragndrop",0, (["listeners"]), ([2]));
function dragndrop2 () { this.do_construct (arguments); }
dragndrop2.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
	cp.begin_xy =  function (x,y,elementToDrag)
	{
		this.el = elementToDrag;

		this.deltaX = x - parseInt (this.el.style.left);
		this.deltaY = y - parseInt (this.el.style.top);

		var me = this;

		this.move_fn = function (e) { me.moveHandler(e); };
		this.up_fn = function (e) { me.upHandler(e); };

		if (document.addEventListener)
		{
			document.addEventListener ("mousemove", this.move_fn, true);
			document.addEventListener ("mouseup", this.up_fn, true);
		}
		else if (document.attachEvent)
		{
			document.attachEvent ("onmousemove", this.move_fn);
			document.attachEvent ("onmouseup", this.up_fn);
			this.old_onselectstart = document.onselectstart;
			document.onselectstart = function () { return false; };
		}
		else
		{
			this.old_movehandler = document.onmousemove;
			this.old_uphandler = document.onmouseup;
			document.onmousemove = this.move_fn;
			document.onmouseup = this.up_fn;
		}
			}

;
	cp.begin =  function (event,elementToDrag)
	{
		if (!event) event = window.event;
		if (event.stopPropagation)
		{
			event.stopPropagation();
			event.preventDefault();
		}
		else event.cancelBubble = true;

		this.begin_xy (event.clientX, event.clientY, elementToDrag);
			}

;
	cp.moveHandler =  function (e)
	{
		if (!e) e = window.event;
		if (e.stopPropagation) e.stopPropagation();
		else e.cancelBubble = true;

		this.x = (e.clientX + browser.scroll_left()) - this.deltaX;
		this.y = (e.clientY + browser.scroll_top()) - this.deltaY;
		if (this.constrain_x !== undefined) this.x = this.constrain_x (x);
		if (this.constrain_y !== undefined) this.y = this.constrain_x (y);

		this.el.style.left = this.x+"px";
		this.el.style.top = this.y+"px";

		if (this.drag_move !== undefined) this.drag_move (this.x, this.y);
			}

;
	cp.upHandler =  function (e)
	{
		if (!e) e = window.event;
		if (document.removeEventListener)
		{
			document.removeEventListener ("mouseup", this.up_fn, true);
			document.removeEventListener ("mousemove", this.move_fn, true);
		}
		else if (document.detachEvent)
		{
			document.detachEvent ("onmouseup", this.up_fn);
			document.detachEvent ("onmousemove", this.move_fn);
			document.onselectstart = this.old_onselectstart;
		}
		else
		{
			document.onmouseup = this.old_uphandler;
			document.onmousemove = this.old_movehandler;
		}
		if (e.stopPropagation) e.stopPropagation();
		else e.cancelBubble = true;

		this.call_self_using_engine ("drag_release_helper", ([this.x, this.y]));
			}

;
	c.args__cloneNode = c.pargs__cloneNode =  ["el"];
	c.inst__cloneNode = c.pinst__cloneNode =  [
/*0*/	function (e,f) { e.mcall (3, f.v.el, "cloneNode", ([true])); },
	function (e,f) {
		var t384 = f.s[0]; f.v.nel = t384;
		(f.v.nel).style.position = "absolute";
		f.s[0] = "px";
		e.smcall (2, lib,"document_x_of", ([f.v.el]));
	},
	function (e,f) {
		var t386 = f.s[1]; var t387 = f.s[0]; 
		(f.v.nel).style.left = "" + (t386) + (t387);
		f.s[0] = "px";
		e.smcall (2, lib,"document_y_of", ([f.v.el]));
	},
	function (e,f) {
		var t389 = f.s[1]; var t390 = f.s[0]; 
		(f.v.nel).style.top = "" + (t389) + (t390);
		e.mcall (3, (document).documentElement, "appendChild", ([f.v.nel]));
	},
	function (e,f) { e.return_pop (f.v.nel); },
null	];

;
	cp.highlight =  function (el)
	{
{
		this.saved_style = el.style.border;;
		el.style.border = "solid blue 2px";;
		}
			}

;
	cp.unhighlight =  function (el)
	{
{
		el.style.border = this.saved_style;;
		}
			}

;
	cp.find_drop_target =  function (x,y)
	{
var d;var el;var el_left;var el_top;var el_right;var el_bottom;{
		for (d in this.drop_targets)
		{
		el = this.drop_targets[d];
		{
		el_left = lib.document_x_of  (el);;
		el_top = lib.document_y_of  (el);;
		el_right = el_left + el.clientWidth;;
		el_bottom = el_top + el.clientHeight;;
		if (el_left < x && el_right > x && el_top < y && el_bottom > y)
		{return (d) }
		;
		}
		}
		;
		return (null);
		}
			}

;
	cp.hover =  function (d)
	{
var del;{
		del = ((d === null) ? null : this.drop_targets[d]);;
		if (this.last_hover !== del)
		{{
		if (this.last_hover !== null)
		{{
		this.unhighlight  (this.last_hover);;
		this.last_hover = null;;
		}
		 }
		;
		if (del !== null)
		{{
		this.last_hover = del;;
		this.highlight  (this.last_hover);;
		}
		 }
		;
		}
		 }
		;
		}
			}

;
	cp.drag_move =  function (x,y)
	{
var d;{
		d = this.find_drop_target  (x,y);;
		this.hover  (d);;
		}
			}

;
	c.pargs__drag_release_helper =  ["x","y"];
	c.pinst__drag_release_helper =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "find_drop_target", ([f.v.x, f.v.y])); },
	function (e,f) {
		var t393 = f.s[0]; f.v.d = t393;
		e.mcall (3, f.v["this"], "hover", ([f.v.d]));
	},
	function (e,f) { e.mcall (4, f.v["this"], "drag_release", ([f.v.d, (f.v["this"]).drag_is_copy])); },
	function (e,f) { e.mcall (3, ((f.v["this"]).nel).parentNode, "removeChild", ([(f.v["this"]).nel])); },
	function (e,f) { if (!((f.v["this"]).drag_is_copy)) f.pc=5; else f.pc=6; },
/*5*/	function (e,f) { ((f.v["this"]).arm_el).style.display = ""; },
	function (e,f) { e.mcall (3, f.v["this"], "hover", ([null])); },
null	];

;
	c.pargs__fire =  [];
	c.pinst__fire =  [
/*0*/	function (e,f) {
		f.v["this"].dragtimer = null;
		e.mcall (5, f.v["this"], "disarm_drag", ([f.v.el, f.v.arg, f.v.ev]));
	},
	function (e,f) {
		f.v["this"].last_hover = null;
		e.smcall (1, dragndrop2,"cloneNode", ([(f.v["this"]).arm_el]));
	},
	function (e,f) {
		var t398 = f.s[0]; f.v["this"].nel = t398;
		if (!((f.v["this"]).drag_is_copy)) f.pc=3; else f.pc=4;
	},
	function (e,f) { ((f.v["this"]).arm_el).style.display = "none"; },
	function (e,f) { e.mcall (5, f.v["this"], "begin_xy", ([(f.v["this"]).arm_x, (f.v["this"]).arm_y, (f.v["this"]).nel])); },
null	];

;
	c.pargs__arm_helper =  ["el","is_copy","drop_targets"];
	c.pinst__arm_helper =  [
/*0*/	function (e,f) {
		e.php_push_static_var (0, rpcclass,"last_start_x");
		var t401 = f.s[0]; f.v["this"].arm_x = t401;
		e.php_push_static_var (0, rpcclass,"last_start_y");
		var t403 = f.s[0]; f.v["this"].arm_y = t403;
		f.v["this"].arm_el = f.v.el;
		f.v["this"].drag_is_copy = f.v.is_copy;
		f.v["this"].drop_targets = f.v.drop_targets;
		e.mcall (5, f.v["this"], "start_timeout_callback", ([300, "fire", null]));
	},
	function (e,f) {
		var t408 = f.s[0]; f.v["this"].dragtimer = t408;
		e.mcall (4, f.v["this"], "make_start_engine", (["disarm_drag", null]));
	},
	function (e,f) {
		var t410 = f.s[0]; f.v["this"].disarm_drag_thunk = t410;
		e.mcall (5, f.v["this"], "bind", ([f.v.el, "mouseup", (f.v["this"]).disarm_drag_thunk]));
	},
	function (e,f) { e.mcall (5, f.v["this"], "bind", ([f.v.el, "mouseout", (f.v["this"]).disarm_drag_thunk])); },
null	];

;
	c.pargs__disarm_drag =  ["el","arg","ev"];
	c.pinst__disarm_drag =  [
/*0*/	function (e,f) { e.mcall (5, f.v["this"], "unbind", ([(f.v["this"]).arm_el, "mouseup", (f.v["this"]).disarm_drag_thunk])); },
	function (e,f) { e.mcall (5, f.v["this"], "unbind", ([(f.v["this"]).arm_el, "mouseout", (f.v["this"]).disarm_drag_thunk])); },
	function (e,f) { if ((((f.v["this"]).dragtimer)) !== ((null))) f.pc=3; else f.pc=-1; },
	function (e,f) { e.mcall (3, f.v["this"], "stop_timeout", ([(f.v["this"]).dragtimer])); },
	function (e,f) { f.v["this"].dragtimer = null; },
null	];

;
};
dragndrop2.init_methods (dragndrop2);
rpcclass.setup_class (dragndrop2, "dragndrop2",0, (["el","deltaX","deltaY","old_movehandler","old_uphandler","old_onselectstart","move_fn","up_fn","x","y","dragtimer","arm_el","nel","drag_is_copy","disarm_drag_thunk","arm_x","arm_y","drop_targets","last_hover","saved_style","listeners"]), ([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2]));
function divTableManager () { this.do_construct (arguments); }
divTableManager.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
	c.pargs__initialise =  ["owner","ncols"];
	c.pinst__initialise =  [
/*0*/	function (e,f) {
		f.v["this"].owner = f.v.owner;
		f.v["this"].rows = ([]);
		f.v["this"].tid = builtin__make_uniq ();
		f.v["this"].ncols = f.v.ncols;
		f.v["this"].widths = ([]);
		f.v["this"].headers = null;
		f.v.n = ((98)) / ((f.v.ncols));
		f.v.i = 0;
	},
	function (e,f) {
		f.pc=3;
		if (!(((f.v.i)) < ((f.v.ncols)))) f.pc=2;
	},
	function (e,f) {
		f.pc=-1;
		f.v["this"].ignore_background_class = false;
	},
	function (e,f) {
		f.pc=1;
		(f.v["this"]).widths[f.v.i] = "" + (f.v.n) + ("%");
		e.php_push_var_lvalue (0, "i");
		e.php_postinc (1);
	},
null	];

;
	c.pargs__initialise2 =  ["owner","widths"];
	c.pinst__initialise2 =  [
/*0*/	function (e,f) {
		f.v["this"].owner = f.v.owner;
		f.v["this"].rows = ([]);
		f.v["this"].tid = builtin__make_uniq ();
		f.v["this"].ncols = builtin__count (f.v.widths);
		f.v["this"].widths = f.v.widths;
		f.v["this"].ignore_background_class = false;
		f.v["this"].headers = null;
	},
null	];

;
	c.pargs__column_headers =  ["headers"];
	c.pinst__column_headers =  [
/*0*/	function (e,f) { f.v["this"].headers = f.v.headers; },
null	];

;
	c.pargs__no_background =  [];
	c.pinst__no_background =  [
/*0*/	function (e,f) { f.v["this"].ignore_background_class = true; },
null	];

;
	c.pargs__context_menu =  ["el","arg","ev"];
	c.pinst__context_menu =  [
/*0*/	function (e,f) { e.mcall (3, document, "getElementById", ([("table") + ("" + ((f.v["this"]).tid) + (("-row") + (f.v.arg)))])); },
	function (e,f) {
		var t433 = f.s[0]; f.v.row = t433;
		f.v.oldstyle = ((f.v.row).style).border;
		(f.v.row).style.border = "1px solid blue";
		e.smcall (1, popup,"set_default_event", ([f.v.ev]));
	},
	function (e,f) { e.mcall (3, (f.v["this"]).owner, "context_menu", ([f.v.arg])); },
	function (e,f) { (f.v.row).style.border = f.v.oldstyle; },
null	];

;
	c.pargs__on_row_click =  ["el","arg","ev"];
	c.pinst__on_row_click =  [
/*0*/	function (e,f) { e.mcall (3, document, "getElementById", ([("table") + ("" + ((f.v["this"]).tid) + (("-row") + (f.v.arg)))])); },
	function (e,f) {
		var t438 = f.s[0]; f.v.row = t438;
		f.v.oldstyle = ((f.v.row).style).border;
		(f.v.row).style.border = "1px solid blue";
		e.smcall (1, popup,"set_default_event", ([f.v.ev]));
	},
	function (e,f) { e.mcall (3, (f.v["this"]).owner, "on_row_click", ([f.v.arg])); },
	function (e,f) { (f.v.row).style.border = f.v.oldstyle; },
null	];

;
	c.pargs__render_row =  ["row","classname","header"];
	c.pinst__render_row =  [
/*0*/	function (e,f) { if ((f.v["this"]).ignore_background_class) f.pc=1; else f.pc=11; },
	function (e,f) {
		f.v.classattr = "";
		if (f.v.header) f.pc=2; else f.pc=8;
	},
	function (e,f) { if (builtin__method_exists ((f.v["this"]).owner,"get_header_class")) f.pc=3; else f.pc=5; },
	function (e,f) {
		f.s[0] = "\"";
		e.mcall (4, (f.v["this"]).owner, "get_header_class", ([f.v.row]));
	},
	function (e,f) {
		f.pc=12;
		var t443 = f.s[1]; var t444 = f.s[0]; 
		f.v.classattr = ("class=\"") + ("" + (t443) + (t444));
	},
/*5*/	function (e,f) { if (builtin__method_exists ((f.v["this"]).owner,"get_row_class")) f.pc=6; else f.pc=12; },
	function (e,f) {
		f.s[0] = "\"";
		e.mcall (4, (f.v["this"]).owner, "get_row_class", ([f.v.row]));
	},
	function (e,f) {
		f.pc=12;
		var t446 = f.s[1]; var t447 = f.s[0]; 
		f.v.classattr = ("class=\"") + ("" + (t446) + (t447));
	},
	function (e,f) { if (builtin__method_exists ((f.v["this"]).owner,"get_row_class")) f.pc=9; else f.pc=12; },
	function (e,f) {
		f.s[0] = "\"";
		e.mcall (4, (f.v["this"]).owner, "get_row_class", ([f.v.row]));
	},
/*10*/	function (e,f) {
		f.pc=12;
		var t449 = f.s[1]; var t450 = f.s[0]; 
		f.v.classattr = ("class=\"") + ("" + (t449) + (t450));
	},
	function (e,f) { f.v.classattr = ("class=\"") + ("" + (f.v.classname) + ("\"")); },
	function (e,f) { if (builtin__method_exists ((f.v["this"]).owner,"get_row_style")) f.pc=13; else f.pc=15; },
	function (e,f) { e.mcall (3, (f.v["this"]).owner, "get_row_style", ([f.v.row])); },
	function (e,f) {
		f.pc=16;
		var t454 = f.s[0]; f.v.styleattr = t454;
	},
/*15*/	function (e,f) { f.v.styleattr = ""; },
	function (e,f) { if (f.v.header) f.pc=17; else f.pc=18; },
	function (e,f) {
		f.pc=29;
		window.__outbuffer += ("<div id=\"table") + ("" + ((f.v["this"]).tid) + (("-header\" ") + ("" + (f.v.classattr) + ((" ") + ("" + (f.v.styleattr) + (" style=\"clear:both; width:99%; float:left\""))))));
		window.__outbuffer += ">";
		f.v.fields = (f.v["this"]).headers;
	},
	function (e,f) {
		f.s[0] = ("\" ") + ("" + (f.v.classattr) + ((" ") + ("" + (f.v.styleattr) + (" style=\"clear:both; width:99%; float:left\""))));
		e.mcall (3, f.v.row, "get_id", ([]));
	},
	function (e,f) {
		var t457 = f.s[1]; var t458 = f.s[0]; 
		window.__outbuffer += ("<div id=\"table") + ("" + ((f.v["this"]).tid) + (("-row") + ("" + (t457) + (t458))));
		if (builtin__method_exists ((f.v["this"]).owner,"context_menu")) f.pc=20; else f.pc=23;
	},
/*20*/	function (e,f) {
		f.s[0] = "\"";
		e.mcall (3, f.v.row, "get_id", ([]));
	},
	function (e,f) { var t459 = f.s[1]; e.mcall (5, f.v["this"], "render_start", (["context_menu", t459])); },
	function (e,f) {
		var t460 = f.s[1]; var t461 = f.s[0]; 
		window.__outbuffer += (" oncontextmenu=\"") + ("" + (t460) + (t461));
	},
	function (e,f) { if (builtin__method_exists ((f.v["this"]).owner,"on_row_click")) f.pc=24; else f.pc=27; },
	function (e,f) {
		f.s[0] = "\"";
		e.mcall (3, f.v.row, "get_id", ([]));
	},
/*25*/	function (e,f) { var t462 = f.s[1]; e.mcall (5, f.v["this"], "render_start", (["on_row_click", t462])); },
	function (e,f) {
		var t463 = f.s[1]; var t464 = f.s[0]; 
		window.__outbuffer += (" onclick=\"") + ("" + (t463) + (t464));
	},
	function (e,f) {
		window.__outbuffer += ">";
		e.mcall (3, (f.v["this"]).owner, "get_row_fields", ([f.v.row]));
	},
	function (e,f) { var t466 = f.s[0]; f.v.fields = t466; },
	function (e,f) {
		f.v.n = ((99)) / (((f.v["this"]).ncols));
		f.v.i = 0;
	},
/*30*/	function (e,f) {
		f.pc=32;
		if (!(((f.v.i)) < (((f.v["this"]).ncols)))) f.pc=31;
	},
	function (e,f) {
		f.pc=-1;
		window.__outbuffer += "</div>\n";
	},
	function (e,f) {
		f.v.text = (f.v.fields)[(f.v.i)];
		if (((f.v.text)) == ((""))) f.pc=33; else f.pc=34;
	},
	function (e,f) { f.v.text = "&nbsp;"; },
	function (e,f) {
		f.pc=30;
		window.__outbuffer += ("<div style=\"float:left; clear:none; width:") + ("" + (((f.v["this"]).widths)[(f.v.i)]) + (("\">") + ("" + (f.v.text) + ("</div>"))));
		e.php_push_var_lvalue (0, "i");
		e.php_postinc (1);
	},
null	];

;
	c.pargs__render_table =  ["initial_rows"];
	c.pinst__render_table =  [
/*0*/	function (e,f) {
		f.v["this"].rows = f.v.initial_rows;
		window.__outbuffer += "<div style='width:99%; float:left'>";
		window.__outbuffer += ("<div id='") + ("" + ((f.v["this"]).tid) + ("' style='width:99%; float:left'>"));
		if ((((f.v["this"]).headers)) !== ((null))) f.pc=1; else f.pc=3;
	},
	function (e,f) { e.mcall (5, f.v["this"], "render_row", ([null, "divTableOdd", true])); },
	function (e,f) {
		f.pc=4;
		f.v.odd = false;
	},
	function (e,f) { f.v.odd = true; },
	function (e,f) { f.v._k22 = e.enumkeys ((f.v["this"]).rows); },
/*5*/	function (e,f) {
		f.pc=7;
		if (!((f.v._k22).length)) f.pc=6;
	},
	function (e,f) {
		window.__outbuffer += ("<div id=\"tab") + ("" + ((f.v["this"]).tid) + ("-end-marker\" style=\"clear:both\"></div>"));
		window.__outbuffer += "</div>";
		window.__outbuffer += "<div style=\"clear:both\">";
		if (builtin__method_exists ((f.v["this"]).owner,"new_name")) f.pc=12; else f.pc=17;
	},
	function (e,f) {
		f.v._i23 = (f.v._k22).shift();
		f.v.row = ((f.v["this"]).rows)[(f.v._i23)];
		f.s[0] = false;
		if (f.v.odd) f.pc=8; else f.pc=9;
	},
	function (e,f) {
		f.pc=10;
		f.s[1] = "divTableOdd";
	},
	function (e,f) { f.s[1] = "divTableEven"; },
/*10*/	function (e,f) { var t478 = f.s[1]; var t479 = f.s[0]; e.mcall (5, f.v["this"], "render_row", ([f.v.row, t478, t479])); },
	function (e,f) {
		f.pc=5;
		f.v.odd = !(f.v.odd);
	},
	function (e,f) {
		f.pc=16;
		f.s[0] = "";
		e.mcall (3, (f.v["this"]).owner, "new_name", ([]));
	},
	function (e,f) {
		f.s[0] = "</button>";
		e.mcall (3, (f.v["this"]).owner, "new_name", ([]));
	},
	function (e,f) {
		var t481 = f.s[1]; var t482 = f.s[0]; 
		f.s[0] = ("\" >") + ("" + (t481) + (t482));
		e.mcall (5, f.v["this"], "render_start", (["add_new_clicked", false]));
	},
/*15*/	function (e,f) {
		f.pc=17;
		var t483 = f.s[1]; var t484 = f.s[0]; 
		window.__outbuffer += ("<button onclick=\"") + ("" + (t483) + (t484));
	},
	function (e,f) {
		var t485 = f.s[1]; var t486 = f.s[0]; 
		if (((t485)) !== ((t486))) f.pc=13; else f.pc=17;
	},
	function (e,f) {
		window.__outbuffer += "</div>";
		window.__outbuffer += "</div>";
	},
null	];

;
	c.pargs__add_new_clicked =  ["buttonobj"];
	c.pinst__add_new_clicked =  [
/*0*/	function (e,f) { e.mcall (3, (f.v["this"]).owner, "insert_row", ([f.v.buttonobj])); },
null	];

;
	cp.recolour_rows =  function ()
	{
		if (this.ignore_background_class) return;
		var tobj = document.getElementById (this.tid);
		var odd = true;
		var endmarker = "tab"+this.tid+"-end-marker";
		for (i = 0; i < tobj.childNodes.length; i++)
		{
			var child = tobj.childNodes[i];
			if (child.nodeType == 1 && child.tagName == "DIV" && child.id != endmarker)
			{
				tobj.childNodes[i].className = odd ? "divTableOdd" : "divTableEven";
				odd = !odd;
			}
		}
			}

;
	c.pargs__append_row =  ["row"];
	c.pinst__append_row =  [
/*0*/	function (e,f) { e.mcall (3, document, "getElementById", ([(f.v["this"]).tid])); },
	function (e,f) {
		var t488 = f.s[0]; f.v.tobj = t488;
		f.v.count = 0;
		f.v.n = 0;
		f.v.i = 0;
	},
	function (e,f) {
		f.pc=4;
		if (!(((f.v.i)) < ((((f.v.tobj).childNodes).length)))) f.pc=3;
	},
	function (e,f) {
		f.pc=10;
		e.mcall (3, document, "getElementById", ([("tab") + ("" + ((f.v["this"]).tid) + ("-end-marker"))]));
	},
	function (e,f) {
		f.v.child = ((f.v.tobj).childNodes)[(f.v.i)];
		if ((((f.v.child).nodeType)) == ((1))) f.pc=6; else f.pc=7;
	},
/*5*/	function (e,f) {
		f.pc=9;
		e.php_push_var_lvalue (0, "count");
		e.php_postinc (1);
	},
	function (e,f) {
		f.pc=8;
		f.s[0] = (((f.v.child).tagName)) == (("DIV"));
	},
	function (e,f) { f.s[0] = false; },
	function (e,f) { var t494 = f.s[0]; if (t494) f.pc=5; else f.pc=9; },
	function (e,f) {
		f.pc=2;
		e.php_push_var_lvalue (0, "i");
		e.php_postinc (1);
	},
/*10*/	function (e,f) {
		var t497 = f.s[0]; f.v.endobj = t497;
		e.mcall (3, document, "createElement", (["div"]));
	},
	function (e,f) {
		var t499 = f.s[0]; f.v.xdiv = t499;
		e.mcall (3, (f.v["this"]).owner, "get_row_fields", ([f.v.row]));
	},
	function (e,f) {
		var t501 = f.s[0]; f.v.f = t501;
		f.s[0] = builtin__ob_start ();
		f.s[0] = false;
		if (((f.v.count)) % ((2))) f.pc=13; else f.pc=14;
	},
	function (e,f) {
		f.pc=15;
		f.s[1] = "divTableOdd";
	},
	function (e,f) { f.s[1] = "divTableEven"; },
/*15*/	function (e,f) { var t502 = f.s[1]; var t503 = f.s[0]; e.mcall (5, f.v["this"], "render_row", ([f.v.row, t502, t503])); },
	function (e,f) {
		f.v.xdiv.innerHTML = builtin__ob_get_clean ();
		f.v.rowdiv = ((f.v.xdiv).childNodes)[(0)];
		e.mcall (4, f.v.tobj, "insertBefore", ([f.v.rowdiv, f.v.endobj]));
	},
null	];

;
	c.pargs__prepend_row =  ["row"];
	c.pinst__prepend_row =  [
/*0*/	function (e,f) { e.mcall (3, document, "getElementById", ([(f.v["this"]).tid])); },
	function (e,f) {
		var t507 = f.s[0]; f.v.tobj = t507;
		e.mcall (3, document, "getElementById", ([("tab") + ("" + ((f.v["this"]).tid) + ("-end-marker"))]));
	},
	function (e,f) {
		var t509 = f.s[0]; f.v.endobj = t509;
		f.v.i = 0;
	},
	function (e,f) {
		f.pc=5;
		if (!(((f.v.i)) < ((((f.v.tobj).childNodes).length)))) f.pc=4;
	},
	function (e,f) {
		f.pc=11;
		e.mcall (3, document, "createElement", (["div"]));
	},
/*5*/	function (e,f) {
		f.v.child = ((f.v.tobj).childNodes)[(f.v.i)];
		if ((((f.v.child).nodeType)) == ((1))) f.pc=8; else f.pc=9;
	},
	function (e,f) {
		f.pc=4;
		f.v.endobj = f.v.child;
	},
	function (e,f) {
		f.pc=3;
		e.php_push_var_lvalue (0, "i");
		e.php_postinc (1);
	},
	function (e,f) {
		f.pc=10;
		f.s[0] = (((f.v.child).tagName)) == (("DIV"));
	},
	function (e,f) { f.s[0] = false; },
/*10*/	function (e,f) { var t514 = f.s[0]; if (t514) f.pc=6; else f.pc=7; },
	function (e,f) {
		var t516 = f.s[0]; f.v.xdiv = t516;
		e.mcall (3, (f.v["this"]).owner, "get_row_fields", ([f.v.row]));
	},
	function (e,f) {
		var t518 = f.s[0]; f.v.f = t518;
		f.s[0] = builtin__ob_start ();
		e.mcall (5, f.v["this"], "render_row", ([f.v.row, "", false]));
	},
	function (e,f) {
		f.v.xdiv.innerHTML = builtin__ob_get_clean ();
		f.v.rowdiv = ((f.v.xdiv).childNodes)[(0)];
		e.mcall (4, f.v.tobj, "insertBefore", ([f.v.rowdiv, f.v.endobj]));
	},
	function (e,f) { e.mcall (2, f.v["this"], "recolour_rows", ([])); },
null	];

;
	c.args__insert_before = c.pargs__insert_before =  ["row","before"];
	c.inst__insert_before = c.pinst__insert_before =  [
/*0*/	function (e,f) { e.mcall (3, document, "getElementById", ([(f.v["this"]).tid])); },
	function (e,f) {
		var t522 = f.s[0]; f.v.tobj = t522;
		f.v.cnt = 0;
		f.v.i = 0;
	},
	function (e,f) {
		f.pc=4;
		if (!(((f.v.i)) < ((((f.v.tobj).childNodes).length)))) f.pc=3;
	},
	function (e,f) {
		f.pc=10;
		e.mcall (2, f.v.before, "get_id", ([]));
	},
	function (e,f) {
		f.v.child = ((f.v.tobj).childNodes)[(f.v.i)];
		if ((((f.v.child).nodeType)) == ((1))) f.pc=6; else f.pc=7;
	},
/*5*/	function (e,f) {
		f.pc=9;
		e.php_push_var_lvalue (0, "cnt");
		e.php_postinc (1);
	},
	function (e,f) {
		f.pc=8;
		f.s[0] = (((f.v.child).tagName)) == (("DIV"));
	},
	function (e,f) { f.s[0] = false; },
	function (e,f) { var t527 = f.s[0]; if (t527) f.pc=5; else f.pc=9; },
	function (e,f) {
		f.pc=2;
		e.php_push_var_lvalue (0, "i");
		e.php_postinc (1);
	},
/*10*/	function (e,f) {
		var t529 = f.s[0]; 
		e.mcall (3, document, "getElementById", ([("table") + ("" + ((f.v["this"]).tid) + (("-row") + (t529)))]));
	},
	function (e,f) {
		var t531 = f.s[0]; f.v.robj = t531;
		e.mcall (3, document, "createElement", (["div"]));
	},
	function (e,f) {
		var t533 = f.s[0]; f.v.xdiv = t533;
		e.mcall (3, (f.v["this"]).owner, "get_row_fields", ([f.v.row]));
	},
	function (e,f) {
		var t535 = f.s[0]; f.v.f = t535;
		f.s[0] = builtin__ob_start ();
		f.s[0] = false;
		if (((f.v.cnt)) % ((2))) f.pc=14; else f.pc=15;
	},
	function (e,f) {
		f.pc=16;
		f.s[1] = "divTableOdd";
	},
/*15*/	function (e,f) { f.s[1] = "divTableEven"; },
	function (e,f) { var t536 = f.s[1]; var t537 = f.s[0]; e.mcall (5, f.v["this"], "render_row", ([f.v.row, t536, t537])); },
	function (e,f) {
		f.v.xdiv.innerHTML = builtin__ob_get_clean ();
		f.v.rowdiv = ((f.v.xdiv).childNodes)[(0)];
		e.mcall (4, f.v.tobj, "insertBefore", ([f.v.rowdiv, f.v.robj]));
	},
	function (e,f) { e.mcall (2, f.v["this"], "recolour_rows", ([])); },
null	];

;
	cp.remove_row =  function (row)
	{
		var robj = document.getElementById ("table"+this.tid+"-row"+row.get_id());
		robj.parentNode.removeChild (robj);
		this.recolour_rows ();
			}

;
	cp.get_rows =  function ()
	{
		var tobj = document.getElementById (this.tid);
		var endobj = document.getElementById ("tab"+this.tid+"-end-marker");

		var res = [];
		var i;
//		for (i = tobj.childNodes.length-1; i >= 0; i--)
		for (i = 0; i < tobj.childNodes.length; i++)
		{
			var cobj = tobj.childNodes[i];
			if (cobj != endobj && cobj.nodeType == 1 && cobj.tagName == "DIV")
			{
				var id = cobj.id;
				var matches = id.match (/\-row(.*)$/);
				res[res.length] = matches[1];
			}
		}

		return res;

			}

;
	c.pargs__rerender_row =  ["row"];
	c.pinst__rerender_row =  [
/*0*/	function (e,f) { e.mcall (2, f.v.row, "get_id", ([])); },
	function (e,f) {
		var t540 = f.s[0]; 
		e.mcall (3, document, "getElementById", ([("table") + ("" + ((f.v["this"]).tid) + (("-row") + (t540)))]));
	},
	function (e,f) {
		var t542 = f.s[0]; f.v.robj = t542;
		f.s[0] = builtin__ob_start ();
		e.mcall (5, f.v["this"], "render_row", ([f.v.row, "", false]));
	},
	function (e,f) {
		f.v.html = builtin__ob_get_clean ();
		e.mcall (3, document, "createElement", (["div"]));
	},
	function (e,f) {
		var t545 = f.s[0]; f.v.xdiv = t545;
		f.v.xdiv.innerHTML = f.v.html;
		f.v.rowdiv = ((f.v.xdiv).childNodes)[(0)];
		e.mcall (4, (f.v.robj).parentNode, "insertBefore", ([f.v.rowdiv, f.v.robj]));
	},
/*5*/	function (e,f) { e.mcall (3, (f.v.robj).parentNode, "removeChild", ([f.v.robj])); },
	function (e,f) { e.mcall (2, f.v["this"], "recolour_rows", ([])); },
null	];

;
	cp.nail_row =  function (obj)
	{
		obj.style.width = (obj.snapshot_w-0)+"px";
		obj.style.height = (obj.snapshot_h-0)+"px";
		obj.style.left = obj.snapshot_x+"px";
		obj.style.top = obj.snapshot_y+"px";
		obj.style.position = "absolute";
		obj.style.zIndex = popup.next_zindex()+10; // 999;
			}

;
	cp.snapshot_div =  function (obj)
	{
		obj.snapshot_x = lib.block_x_of (obj);
		obj.snapshot_y = lib.block_y_of (obj);
		obj.snapshot_w = obj.offsetWidth;
		obj.snapshot_h = obj.offsetHeight;
		obj.snapshot_z = obj.style.zIndex;
			}

;
	cp.snapshot_table =  function ()
	{
		var tobj = document.getElementById (this.tid);
		var endobj = document.getElementById ("tab"+this.tid+"-end-marker");
		this.snapshot_div (tobj);

//		this.x_adjust = lib.document_x_of (tobj) - tobj.snapshot_x;
		this.y_adjust = lib.document_y_of (tobj) - tobj.snapshot_y;

		var i;
		for (i = tobj.childNodes.length-1; i >= 0; i--)
		{
			var cobj = tobj.childNodes[i];
			if (cobj != endobj && cobj.nodeType == 1 && cobj.tagName == "DIV")
			{
				this.snapshot_div (cobj);
			}
		}

		tobj.style.width = (tobj.snapshot_w-2)+"px";
		tobj.style.height = (tobj.snapshot_h-2)+"px";

		for (i = tobj.childNodes.length-1; i >= 0; i--)
		{
			var cobj = tobj.childNodes[i];
			if (cobj != endobj && cobj.nodeType == 1 && cobj.tagName == "DIV")
			{
				this.nail_row (cobj);
			}
		}
			}

;
	cp.unsnapshot_table =  function ()
	{
		var tobj = document.getElementById (this.tid);
		var endobj = document.getElementById ("tab"+this.tid+"-end-marker");
		for (i = 0; i < tobj.childNodes.length; i++)
		{
			var cobj = tobj.childNodes[i];
			if (cobj != endobj && cobj.nodeType == 1 && cobj.tagName == "DIV")
			{
				cobj.style.left = "";
				cobj.style.top = "";
				cobj.style.width = "98%";
				cobj.style.height = "";
				cobj.style.position = "static";
				cobj.style.zIndex = cobj.snapshot_z;
			}
		}

		tobj.style.width = "100%";
		tobj.style.height = "";
		tobj.style.zIndex = tobj.snapshot_z;

			}

;
	c.pargs__reorder_animate =  [];
	c.pinst__reorder_animate =  [
/*0*/	function (e,f) {
		f.v["this"].reordering = true;
		f.s[0] = 20;
		f.s[1] = "', 'timer', 0)";
		e.mcall (4, f.v["this"], "get_id", ([]));
	},
	function (e,f) {
		var t549 = f.s[2]; var t550 = f.s[1]; 
		var t551 = f.s[0]; e.mcall (4, window, "setInterval", ([("rpcclass.call_method_by_name ('divTableManager', '") + ("" + (t549) + (t550)), t551]));
	},
	function (e,f) {
		var t553 = f.s[0]; f.v["this"].timerid = t553;
		e.smcall (0, php_engine,"get_current_thread_id", ([]));
	},
	function (e,f) {
		var t555 = f.s[0]; f.v["this"].thread_id = t555;
		e.php_builtin (0, "wait_for_completion", 0);
	},
	function (e,f) {
		f.v["this"].reordering = false;
		e.mcall (3, window, "clearInterval", ([(f.v["this"]).timerid]));
	},
null	];

;
	c.pargs__reorder_rows =  ["new_rows"];
	c.pinst__reorder_rows =  [
/*0*/	function (e,f) { e.mcall (3, document, "getElementById", ([(f.v["this"]).tid])); },
	function (e,f) {
		var t558 = f.s[0]; f.v.tobj = t558;
		e.mcall (3, document, "getElementById", ([("tab") + ("" + ((f.v["this"]).tid) + ("-end-marker"))]));
	},
	function (e,f) {
		var t560 = f.s[0]; f.v.endobj = t560;
		f.v.div_by_id = ({});
		f.v.i = 0;
	},
	function (e,f) {
		f.pc=5;
		if (!(((f.v.i)) < ((((f.v.tobj).childNodes).length)))) f.pc=4;
	},
	function (e,f) {
		f.pc=13;
		f.v._k24 = e.enumkeys (f.v.new_rows);
	},
/*5*/	function (e,f) {
		f.v.cobj = ((f.v.tobj).childNodes)[(f.v.i)];
		if (((f.v.cobj)) != ((f.v.endobj))) f.pc=7; else f.pc=10;
	},
	function (e,f) {
		f.pc=12;
		f.v.matches = ([]);
		f.s[0] = builtin__preg_match ("/\\-row(.*)$/",(f.v.cobj).id,f.v.matches);
		f.v.id = (f.v.matches)[(1)];
		f.v.div_by_id[f.v.id] = f.v.cobj;
	},
	function (e,f) { if ((((f.v.cobj).nodeType)) == ((1))) f.pc=8; else f.pc=9; },
	function (e,f) {
		f.pc=11;
		f.s[0] = (((f.v.cobj).tagName)) == (("DIV"));
	},
	function (e,f) {
		f.pc=11;
		f.s[0] = false;
	},
/*10*/	function (e,f) { f.s[0] = false; },
	function (e,f) { var t568 = f.s[0]; if (t568) f.pc=6; else f.pc=12; },
	function (e,f) {
		f.pc=3;
		e.php_push_var_lvalue (0, "i");
		e.php_postinc (1);
	},
	function (e,f) {
		f.pc=15;
		if (!((f.v._k24).length)) f.pc=14;
	},
	function (e,f) {
		f.pc=21;
		e.mcall (2, f.v["this"], "snapshot_table", ([]));
	},
/*15*/	function (e,f) {
		f.v._i25 = (f.v._k24).shift();
		f.v.row = (f.v.new_rows)[(f.v._i25)];
		e.mcall (2, f.v.row, "get_id", ([]));
	},
	function (e,f) {
		var t573 = f.s[0]; f.v.id = t573;
		if (!(((f.v.div_by_id)[(f.v.id)]) !== undefined)) f.pc=17; else f.pc=13;
	},
	function (e,f) { e.mcall (3, document, "createElement", (["div"])); },
	function (e,f) {
		var t575 = f.s[0]; f.v.xdiv = t575;
		f.s[0] = builtin__ob_start ();
		e.mcall (5, f.v["this"], "render_row", ([f.v.row, "divTableOdd", false]));
	},
	function (e,f) {
		f.v.xdiv.innerHTML = builtin__ob_get_clean ();
		f.v.rowdiv = ((f.v.xdiv).childNodes)[(0)];
		e.mcall (4, f.v.tobj, "insertBefore", ([f.v.rowdiv, f.v.endobj]));
	},
/*20*/	function (e,f) {
		f.pc=13;
		f.v.div_by_id[f.v.id] = f.v.rowdiv;
	},
	function (e,f) { f.v._k26 = e.enumkeys (f.v.div_by_id); },
	function (e,f) {
		f.pc=24;
		if (!((f.v._k26).length)) f.pc=23;
	},
	function (e,f) {
		f.pc=25;
		f.v._k28 = e.enumkeys (f.v.new_rows);
	},
	function (e,f) {
		f.pc=22;
		f.s[0] = f.v.id = (f.v._k26).shift();
		f.s[1] = f.v.cobj = (f.v.div_by_id)[(f.v.id)];
		e.mcall (5, (f.v.cobj).parentNode, "removeChild", ([f.v.cobj]));
	},
/*25*/	function (e,f) {
		f.pc=27;
		if (!((f.v._k28).length)) f.pc=26;
	},
	function (e,f) {
		f.pc=29;
		e.mcall (2, f.v["this"], "reorder_animate", ([]));
	},
	function (e,f) {
		f.v._i29 = (f.v._k28).shift();
		f.v.row = (f.v.new_rows)[(f.v._i29)];
		e.mcall (2, f.v.row, "get_id", ([]));
	},
	function (e,f) {
		f.pc=25;
		var t586 = f.s[0]; f.v.id = t586;
		f.v.rowdiv = (f.v.div_by_id)[(f.v.id)];
		e.mcall (4, f.v.tobj, "insertBefore", ([f.v.rowdiv, f.v.endobj]));
	},
	function (e,f) { e.mcall (2, f.v["this"], "unsnapshot_table", ([])); },
/*30*/	function (e,f) { e.mcall (2, f.v["this"], "recolour_rows", ([])); },
null	];

;
	c.pargs__get_row_el =  ["row"];
	c.pinst__get_row_el =  [
/*0*/	function (e,f) { e.mcall (2, f.v.row, "get_id", ([])); },
	function (e,f) {
		var t588 = f.s[0]; 
		e.mcall (3, document, "getElementById", ([("table") + ("" + ((f.v["this"]).tid) + (("-row") + (t588)))]));
	},
	function (e,f) { var t589 = f.s[0]; e.return_pop (t589); },
null	];

;
	c.pargs__drag_group_complete =  [];
	c.pinst__drag_group_complete =  [
/*0*/	function (e,f) { e.mcall (3, ((f.v["this"]).drag_group_div).parentNode, "removeChild", ([(f.v["this"]).drag_group_div])); },
null	];

;
	cp.drag_group_stop =  function (ev)
	{
{
		this.owner.on_drag_group_stop  (ev.clientX,ev.clientY,this.drag_group_payload);;
		}
			}

;
	cp.drag_group_move =  function (ev)
	{
{
		this.owner.on_drag_group_move  (ev.clientX,ev.clientY);;
		}
			}

;
	c.pargs__drag_group_start =  ["rows","event"];
	c.pinst__drag_group_start =  [
/*0*/	function (e,f) { e.mcall (3, document, "createElement", (["div"])); },
	function (e,f) {
		var t591 = f.s[0]; f.v.div = t591;
		f.v["this"].drag_group_payload = f.v.rows;
		f.v["this"].drag_group_div = f.v.div;
		(f.v.div).style.position = "absolute";
		e.mcall (3, (document).body, "appendChild", ([f.v.div]));
	},
	function (e,f) {
		f.v.drows = ([]);
		f.v._k30 = e.enumkeys (f.v.rows);
	},
	function (e,f) {
		f.pc=5;
		if (!((f.v._k30).length)) f.pc=4;
	},
	function (e,f) {
		f.pc=15;
		(f.v.div).style.left = "" + (f.v.left) + ("px");
		(f.v.div).style.top = "" + (f.v.top) + ("px");
		f.s[0] = 20;
		e.smcall (1, popup,"next_zindex", ([]));
	},
/*5*/	function (e,f) {
		f.v._i31 = (f.v._k30).shift();
		f.v.row = (f.v.rows)[(f.v._i31)];
		e.mcall (3, f.v["this"], "get_row_el", ([f.v.row]));
	},
	function (e,f) {
		var t602 = f.s[0]; f.v.rowel = t602;
		e.smcall (1, lib,"document_x_of", ([f.v.rowel]));
	},
	function (e,f) {
		var t604 = f.s[0]; f.v.rowx = t604;
		e.smcall (1, lib,"document_y_of", ([f.v.rowel]));
	},
	function (e,f) {
		var t606 = f.s[0]; f.v.rowy = t606;
		e.mcall (3, f.v.rowel, "cloneNode", ([true]));
	},
	function (e,f) {
		var t608 = f.s[0]; f.v.dup = t608;
		f.v.drows[f.v.drows.length] = ({userobj:f.v.row, origel:f.v.rowel, rowel:f.v.dup, x:f.v.rowx, y:f.v.rowy});
		if (((builtin__count (f.v.drows))) == ((1))) f.pc=10; else f.pc=11;
	},
/*10*/	function (e,f) {
		f.pc=3;
		f.v.top = f.v.rowy;
		f.v.left = f.v.rowx;
	},
	function (e,f) { if (((f.v.top)) > ((f.v.rowy))) f.pc=12; else f.pc=13; },
	function (e,f) { f.v.top = f.v.rowy; },
	function (e,f) { if (((f.v.left)) > ((f.v.rowx))) f.pc=14; else f.pc=3; },
	function (e,f) {
		f.pc=3;
		f.v.left = f.v.rowx;
	},
/*15*/	function (e,f) {
		var t614 = f.s[1]; var t615 = f.s[0]; 
		(f.v.div).style.zIndex = parseInt((t614),10) + parseInt((t615),10);
		f.v._k32 = e.enumkeys (f.v.drows);
	},
	function (e,f) {
		f.pc=18;
		if (!((f.v._k32).length)) f.pc=17;
	},
	function (e,f) {
		f.pc=-1;
		e.smcall (6, dragndrop,"begin_from_event", ([f.v.div, f.v.event, false, f.v["this"], "drag_group_stop", "drag_group_move"]));
	},
	function (e,f) {
		f.v._i33 = (f.v._k32).shift();
		f.v.drow = (f.v.drows)[(f.v._i33)];
		f.v.rowel = (f.v.drow).rowel;
		f.v.origel = (f.v.drow).origel;
		f.v.rowx = (f.v.drow).x;
		f.v.rowy = (f.v.drow).y;
		e.mcall (3, f.v.div, "appendChild", ([f.v.rowel]));
	},
	function (e,f) {
		f.pc=16;
		(f.v.rowel).style.position = "absolute";
		(f.v.rowel).style.left = "" + (parseInt((f.v.rowx),10) - parseInt((f.v.left),10)) + ("px");
		(f.v.rowel).style.top = "" + (parseInt((f.v.rowy),10) - parseInt((f.v.top),10)) + ("px");
		(f.v.rowel).style.width = "" + ((f.v.origel).offsetWidth) + ("px");
		(f.v.rowel).style.height = "" + ((f.v.origel).offsetHeight) + ("px");
		e.smcall (2, browser,"set_alpha", ([f.v.rowel, 50]));
	},
null	];

;
	cp.drag_start =  function (event,row)
	{
		event.cancelBubble = true;

		var robj = document.getElementById ("table"+this.tid+"-row"+row.get_id());

		var width = robj.offsetWidth;
		var height = robj.offsetHeight;
		var x = lib.document_x_of (robj);
		var y = lib.document_y_of (robj);

		this.snapshot_table();

		robj.parentNode.removeChild (robj);

		robj.style.left = (x+20)+"px";
		robj.style.top = y+"px";
		robj.style.border = "black solid 1px";
		document.body.appendChild (robj);

		this.dragging_robj = robj;
		beginDrag (robj, event, true, this);

		this.timerid = window.setInterval ("rpcclass.call_method_by_name ('divTableManager', '"+this.get_id()+"', 'timer', 0)", 20);

			}

;
	cp.release_action =  function ()
	{
		window.clearInterval (this.timerid);

		var y = parseInt (this.dragging_robj.style.top) - this.y_adjust;
		var h = parseInt (this.dragging_robj.style.height);
		var midy = y + h/2;
		var tobj = document.getElementById (this.tid);
		var endobj = document.getElementById ("tab"+this.tid+"-end-marker");

		var i;
		var y = tobj.snapshot_y;
		var next = null;
		for (i = 0; i < tobj.childNodes.length; i++)
		{
			var cobj = tobj.childNodes[i];
			if (cobj != endobj && cobj.nodeType == 1 && cobj.tagName == "DIV")
			{
				if (next == null && y+cobj.snapshot_h >= midy)
				{
					next = cobj;
					break;
				}
				y += cobj.snapshot_h;
			}
		}

		this.dragging_robj.parentNode.removeChild (this.dragging_robj);
		tobj.insertBefore (this.dragging_robj, next);
		this.dragging_robj.style.border = "";

		this.unsnapshot_table ();

		this.recolour_rows();

		this.dragging_robj = null;

		var neworder = new Array;
		for (i = 0; i < tobj.childNodes.length; i++)
		{
			var cobj = tobj.childNodes[i];
			if (cobj != endobj && cobj.nodeType == 1 && cobj.tagName == "DIV")
			{
				var matches = cobj.id.match (/table(.*)\-row(.*)/);
				neworder[neworder.length] = matches[2];
			}
		}

		var args = [ neworder ];
		this.owner.call_self_using_engine ("reorder", args);

			}

;
	cp.move_action =  function ()
	{
		var y = parseInt (this.dragging_robj.style.top);
		var h = parseInt (this.dragging_robj.style.height);
		var top = browser.scroll_top(); // document.documentElement.scrollTop;
		var bottom = top + browser.window_height(); // document.documentElement.clientHeight;
		var end = browser.document_height(); // document.documentElement.scrollHeight;
		if (y < top+30 && top > 0)
		{
			window.scrollBy (0,-10);
			this.dragging_robj.style.top = (y-10)+"px";
		}
		if (y+h > bottom - 30 && bottom < end)
		{
			window.scrollBy (0,10);
			this.dragging_robj.style.top = (y+10)+"px";
		}
			}

;
	cp.timer =  function ()
	{
		var drag_y, drag_h;
		if (this.dragging_robj)
		{
			drag_h = parseInt (this.dragging_robj.style.height);
			drag_y = parseInt (this.dragging_robj.style.top) + drag_h / 2 - this.y_adjust;
		}

		var tobj = document.getElementById (this.tid);
		var endobj = document.getElementById ("tab"+this.tid+"-end-marker");

		var i;
		var y = tobj.snapshot_y;
		var included_gap = false;
		var settled = true;
		for (i = 0; i < tobj.childNodes.length; i++)
		{
			var cobj = tobj.childNodes[i];
			if (cobj != endobj && cobj.nodeType == 1 && cobj.tagName == "DIV")
			{
				if (this.dragging_robj && !included_gap && y+cobj.snapshot_h >= drag_y)
				{
					y += drag_h;
					included_gap = true;
				}

				if (cobj.snapshot_y > y)
				{
					if (cobj.snapshot_y > y+3)
						cobj.snapshot_y -= 3;
					else
						cobj.snapshot_y--;
					this.nail_row (cobj);
					settled = false;
				}
				else if (cobj.snapshot_y < y)
				{
					if (cobj.snapshot_y < y-3)
						cobj.snapshot_y += 3;
					else
						cobj.snapshot_y++;
					this.nail_row (cobj);
					settled = false;
				}
				else
				{
				}
				y += cobj.snapshot_h;
			}
		}
		if (settled && this.reordering)
		{
			php_engine.resume_thread (this.thread_id, "reorder-complete", null);
		}

			}

;
};
divTableManager.init_methods (divTableManager);
rpcclass.setup_class (divTableManager, "divTableManager",0, (["owner","rows","tid","ncols","widths","ignore_background_class","drag_timer","headers","listeners"]), ([2,2,2,2,2,2,2,2,2]));
function form_element () { this.do_construct (arguments); }
form_element.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
	c.pargs__init_helper =  [];
	c.pinst__init_helper =  [
/*0*/	function (e,f) { /* This is a NOP */ },
null	];

;
	c.pargs__initialise =  ["form","fielddef","values"];
	c.pinst__initialise =  [
/*0*/	function (e,f) {
		f.v["this"].form = f.v.form;
		f.v["this"].fielddef = f.v.fielddef;
		f.v["this"].raw_value = "";
		f.v["this"].change_timer_handle = null;
		if (((f.v.values)) !== ((null))) f.pc=1; else f.pc=7;
	},
	function (e,f) { if (((f.v.fielddef).name) !== undefined) f.pc=2; else f.pc=7; },
	function (e,f) {
		f.v.fname = (f.v.fielddef).name;
		if (builtin__is_object (f.v.values)) f.pc=3; else f.pc=5;
	},
	function (e,f) { if (((f.v.values)[(f.v.fname)]) !== undefined) f.pc=4; else f.pc=7; },
	function (e,f) {
		f.pc=7;
		f.v["this"].raw_value = (f.v.values)[(f.v.fname)];
	},
/*5*/	function (e,f) { if (((f.v.values)[(f.v.fname)]) !== undefined) f.pc=6; else f.pc=7; },
	function (e,f) { f.v["this"].raw_value = (f.v.values)[(f.v.fname)]; },
	function (e,f) { e.mcall (2, f.v["this"], "init_helper", ([])); },
null	];

;
	c.pargs__change_timer =  [];
	c.pinst__change_timer =  [
/*0*/	function (e,f) {
		f.v["this"].change_timer_handle = null;
		e.mcall (2, f.v["this"], "check_for_possible_change", ([]));
	},
null	];

;
	cp.trigger_change_timer =  function ()
	{
{
		if (this.change_timer_handle === null)
		{{
		this.change_timer_handle = this.start_timeout_callback_sync  (300,"change_timer",null);;
		}
		 }
		;
		}
			}

;
	c.pargs__is_readonly =  [];
	c.pinst__is_readonly =  [
/*0*/	function (e,f) { if ((((f.v["this"]).fielddef).readonly) !== undefined) f.pc=1; else f.pc=2; },
	function (e,f) {
		f.pc=3;
		f.s[0] = ((((f.v["this"]).fielddef).readonly)) == (("1"));
	},
	function (e,f) { f.s[0] = false; },
	function (e,f) { var t637 = f.s[0]; e.return_pop (t637); },
null	];

;
	c.pargs__is_required =  [];
	c.pinst__is_required =  [
/*0*/	function (e,f) { if ((((f.v["this"]).fielddef).required) !== undefined) f.pc=1; else f.pc=2; },
	function (e,f) {
		f.pc=3;
		f.s[0] = ((((f.v["this"]).fielddef).required)) == (("1"));
	},
	function (e,f) { f.s[0] = false; },
	function (e,f) { var t638 = f.s[0]; e.return_pop (t638); },
null	];

;
	c.pargs__render =  [];
	c.pinst__render =  [
/*0*/	function (e,f) { /* This is a NOP */ },
null	];

;
	c.pargs__render_button =  [];
	c.pinst__render_button =  [
/*0*/	function (e,f) { /* This is a NOP */ },
null	];

;
	c.pargs__render_value =  ["raw_value"];
	c.pinst__render_value =  [
/*0*/	function (e,f) { e.return_pop (f.v.raw_value); },
null	];

;
	c.pargs__render_raw_value =  [];
	c.pinst__render_raw_value =  [
/*0*/	function (e,f) { e.mcall (3, f.v["this"], "render_value", ([(f.v["this"]).raw_value])); },
	function (e,f) { var t639 = f.s[0]; e.return_pop (t639); },
null	];

;
	c.pargs__parse_value =  ["value"];
	c.pinst__parse_value =  [
/*0*/	function (e,f) { e.return_pop (f.v.value); },
null	];

;
	c.pargs__row_el =  [];
	c.pinst__row_el =  [
/*0*/	function (e,f) { e.return_pop (null); },
null	];

;
	c.pargs__is_enabled =  [];
	c.pinst__is_enabled =  [
/*0*/	function (e,f) { if (!((((f.v["this"]).fielddef).enabled) !== undefined)) f.pc=1; else f.pc=2; },
	function (e,f) { e.return_pop (true); },
	function (e,f) { e.mcall (3, (f.v["this"]).form, "is_enabled", ([((f.v["this"]).fielddef).enabled])); },
	function (e,f) { var t640 = f.s[0]; e.return_pop (t640); },
null	];

;
	c.pargs__check_option_enable =  [];
	c.pinst__check_option_enable =  [
/*0*/	function (e,f) { /* This is a NOP */ },
null	];

;
	c.pargs__check_enable =  [];
	c.pinst__check_enable =  [
/*0*/	function (e,f) { e.mcall (2, f.v["this"], "row_el", ([])); },
	function (e,f) {
		var t642 = f.s[0]; f.v.rowel = t642;
		if (((f.v.rowel)) !== ((null))) f.pc=2; else f.pc=6;
	},
	function (e,f) {
		f.pc=5;
		e.mcall (2, f.v["this"], "is_enabled", ([]));
	},
	function (e,f) {
		f.pc=6;
		(f.v.rowel).style.display = "";
	},
	function (e,f) {
		f.pc=6;
		(f.v.rowel).style.display = "none";
	},
/*5*/	function (e,f) { var t645 = f.s[0]; if (t645) f.pc=3; else f.pc=4; },
	function (e,f) { e.mcall (2, f.v["this"], "check_option_enable", ([])); },
null	];

;
	c.pargs__value_legal =  [];
	c.pinst__value_legal =  [
/*0*/	function (e,f) { e.return_pop (true); },
null	];

;
	c.args__create = c.pargs__create =  ["form","fielddef","values"];
	c.inst__create = c.pinst__create =  [
/*0*/	function (e,f) {
		f.v.cname = ("form_element_") + ((f.v.fielddef).type);
		f.v.obj = eval ("new "+f.v.cname);
		e.mcall (5, f.v.obj, "initialise", ([f.v.form, f.v.fielddef, f.v.values]));
	},
	function (e,f) { e.return_pop (f.v.obj); },
null	];

;
};
form_element.init_methods (form_element);
rpcclass.setup_class (form_element, "form_element",0, (["form","fielddef","raw_value","change_timer_handle","listeners"]), ([0,0,0,0,2]));
function form_element_hidden () { this.do_construct (arguments); }
form_element_hidden.init_methods = function (c) {
	form_element.init_methods(c);
	var cp = c.prototype;
};
form_element_hidden.init_methods (form_element_hidden);
rpcclass.setup_class (form_element_hidden, "form_element_hidden",0, (["form","fielddef","raw_value","change_timer_handle","listeners"]), ([0,0,0,0,2]));
function form_element_condition () { this.do_construct (arguments); }
form_element_condition.init_methods = function (c) {
	form_element.init_methods(c);
	var cp = c.prototype;
	c.pargs__eval_condition =  ["condition"];
	c.pinst__eval_condition =  [
/*0*/	function (e,f) { e.smcall (1, form_condition,"parse", ([((f.v["this"]).fielddef).expr])); },
	function (e,f) {
		var t649 = f.s[0]; f.v.fc = t649;
		e.mcall (3, f.v.fc, "evaluate", ([(f.v["this"]).form]));
	},
	function (e,f) { var t650 = f.s[0]; e.return_pop (t650); },
null	];

;
	c.pargs__render_value =  ["raw_value"];
	c.pinst__render_value =  [
/*0*/	function (e,f) {
		f.pc=3;
		e.mcall (3, f.v["this"], "eval_condition", ([""]));
	},
	function (e,f) {
		f.pc=4;
		f.s[0] = "1";
	},
	function (e,f) {
		f.pc=4;
		f.s[0] = "0";
	},
	function (e,f) { var t651 = f.s[0]; if (t651) f.pc=1; else f.pc=2; },
	function (e,f) { var t652 = f.s[0]; e.return_pop (t652); },
null	];

;
};
form_element_condition.init_methods (form_element_condition);
rpcclass.setup_class (form_element_condition, "form_element_condition",0, (["form","fielddef","raw_value","change_timer_handle","listeners"]), ([0,0,0,0,2]));
function form_element_condition_count () { this.do_construct (arguments); }
form_element_condition_count.init_methods = function (c) {
	form_element.init_methods(c);
	var cp = c.prototype;
	c.pargs__eval_condition_count =  [];
	c.pinst__eval_condition_count =  [
/*0*/	function (e,f) {
		f.v.cl = builtin__explode (",",((f.v["this"]).fielddef).expr);
		f.v.res = 0;
		f.v._k34 = e.enumkeys (f.v.cl);
	},
	function (e,f) {
		f.pc=3;
		if (!((f.v._k34).length)) f.pc=2;
	},
	function (e,f) { e.return_pop (f.v.res); },
	function (e,f) {
		f.v._i35 = (f.v._k34).shift();
		f.v.c = (f.v.cl)[(f.v._i35)];
		e.smcall (1, form_condition,"parse", ([f.v.c]));
	},
	function (e,f) {
		f.pc=6;
		var t659 = f.s[0]; f.v.fc = t659;
		e.mcall (3, f.v.fc, "evaluate", ([(f.v["this"]).form]));
	},
/*5*/	function (e,f) {
		f.pc=1;
		e.php_push_var_lvalue (0, "res");
		e.php_postinc (1);
	},
	function (e,f) { var t661 = f.s[0]; if (t661) f.pc=5; else f.pc=1; },
null	];

;
	c.pargs__render_value =  ["raw_value"];
	c.pinst__render_value =  [
/*0*/	function (e,f) {
		f.pc=3;
		e.mcall (3, f.v["this"], "eval_condition", ([""]));
	},
	function (e,f) {
		f.pc=4;
		f.s[0] = "1";
	},
	function (e,f) {
		f.pc=4;
		f.s[0] = "0";
	},
	function (e,f) { var t662 = f.s[0]; if (t662) f.pc=1; else f.pc=2; },
	function (e,f) { var t663 = f.s[0]; e.return_pop (t663); },
null	];

;
};
form_element_condition_count.init_methods (form_element_condition_count);
rpcclass.setup_class (form_element_condition_count, "form_element_condition_count",0, (["form","fielddef","raw_value","change_timer_handle","listeners"]), ([0,0,0,0,2]));
function form_element_line_base () { this.do_construct (arguments); }
form_element_line_base.init_methods = function (c) {
	form_element.init_methods(c);
	var cp = c.prototype;
	c.pargs__data_el_id =  [];
	c.pinst__data_el_id =  [
/*0*/	function (e,f) { e.mcall (2, f.v["this"], "get_id", ([])); },
	function (e,f) {
		var t664 = f.s[0]; 
		e.return_pop (("data-") + (t664));
	},
null	];

;
	c.pargs__data_el =  [];
	c.pinst__data_el =  [
/*0*/	function (e,f) { e.mcall (2, f.v["this"], "data_el_id", ([])); },
	function (e,f) { var t665 = f.s[0]; e.mcall (3, document, "getElementById", ([t665])); },
	function (e,f) { var t666 = f.s[0]; e.return_pop (t666); },
null	];

;
	c.pargs__label_el =  [];
	c.pinst__label_el =  [
/*0*/	function (e,f) { e.mcall (2, f.v["this"], "get_id", ([])); },
	function (e,f) {
		var t667 = f.s[0]; 
		e.mcall (3, document, "getElementById", ([("label-") + (t667)]));
	},
	function (e,f) { var t668 = f.s[0]; e.return_pop (t668); },
null	];

;
	c.pargs__row_el =  [];
	c.pinst__row_el =  [
/*0*/	function (e,f) { e.mcall (2, f.v["this"], "get_id", ([])); },
	function (e,f) {
		var t669 = f.s[0]; 
		e.mcall (3, document, "getElementById", ([("row-") + (t669)]));
	},
	function (e,f) { var t670 = f.s[0]; e.return_pop (t670); },
null	];

;
	c.pargs__set_unparsable_value =  ["raw_value"];
	c.pinst__set_unparsable_value =  [
/*0*/	function (e,f) { e.mcall (3, f.v["this"], "render_value", ([f.v.raw_value])); },
	function (e,f) {
		var t672 = f.s[0]; f.v.text_val = t672;
		f.v["this"].raw_value = f.v.raw_value;
		e.mcall (2, f.v["this"], "data_el", ([]));
	},
	function (e,f) {
		var t675 = f.s[0]; f.v.el = t675;
		f.v.el.innerHTML = f.v.text_val;
		e.mcall (2, f.v["this"], "change_detected", ([]));
	},
null	];

;
	c.pargs__set_value =  ["raw_value"];
	c.pinst__set_value =  [
/*0*/	function (e,f) { e.mcall (2, f.v["this"], "read_current_value", ([])); },
	function (e,f) {
		var t678 = f.s[0]; f.v.old = t678;
		e.mcall (3, f.v["this"], "render_value", ([f.v.raw_value]));
	},
	function (e,f) {
		var t680 = f.s[0]; f.v.text_val = t680;
		if (((f.v.old)) != ((f.v.text_val))) f.pc=3; else f.pc=-1;
	},
	function (e,f) { e.mcall (3, f.v["this"], "parse_value", ([f.v.text_val])); },
	function (e,f) {
		var t682 = f.s[0]; f.v["this"].raw_value = t682;
		e.mcall (2, f.v["this"], "data_el", ([]));
	},
/*5*/	function (e,f) {
		var t684 = f.s[0]; f.v.el = t684;
		f.v.el.innerHTML = f.v.text_val;
		e.mcall (2, f.v["this"], "change_detected", ([]));
	},
null	];

;
	c.pargs__set_current_value =  ["raw_value"];
	c.pinst__set_current_value =  [
/*0*/	function (e,f) { e.mcall (2, f.v["this"], "read_current_value", ([])); },
	function (e,f) {
		var t687 = f.s[0]; f.v.old = t687;
		e.mcall (3, f.v["this"], "render_value", ([f.v.raw_value]));
	},
	function (e,f) {
		var t689 = f.s[0]; f.v.text_val = t689;
		if (((f.v.old)) != ((f.v.text_val))) f.pc=3; else f.pc=-1;
	},
	function (e,f) { e.mcall (3, f.v["this"], "parse_value", ([f.v.text_val])); },
	function (e,f) {
		var t691 = f.s[0]; f.v["this"].raw_value = t691;
		e.mcall (2, f.v["this"], "data_el", ([]));
	},
/*5*/	function (e,f) {
		var t693 = f.s[0]; f.v.el = t693;
		f.v.el.value = f.v.text_val;
		e.mcall (2, f.v["this"], "change_detected", ([]));
	},
null	];

;
	c.pargs__value_legal =  [];
	c.pinst__value_legal =  [
/*0*/	function (e,f) {
		f.pc=2;
		e.mcall (2, f.v["this"], "is_enabled", ([]));
	},
	function (e,f) { e.return_pop (true); },
	function (e,f) {
		var t695 = f.s[0]; 
		if (!(t695)) f.pc=1; else f.pc=3;
	},
	function (e,f) { if ((((f.v["this"]).raw_value)) === ((null))) f.pc=4; else f.pc=5; },
	function (e,f) { e.return_pop (false); },
/*5*/	function (e,f) { if ((((f.v["this"]).raw_value)) != ((""))) f.pc=6; else f.pc=7; },
	function (e,f) { e.return_pop (true); },
	function (e,f) { e.mcall (2, f.v["this"], "is_required", ([])); },
	function (e,f) {
		var t696 = f.s[0]; 
		e.return_pop (!(t696));
	},
null	];

;
	c.pargs__rerender_label =  [];
	c.pinst__rerender_label =  [
/*0*/	function (e,f) { e.mcall (2, f.v["this"], "label_el", ([])); },
	function (e,f) {
		var t698 = f.s[0]; f.v.el = t698;
		f.s[0] = builtin__ob_start ();
		e.mcall (2, f.v["this"], "render_label", ([]));
	},
	function (e,f) { f.v.el.innerHTML = builtin__ob_get_clean (); },
null	];

;
	c.pargs__change_detected =  [];
	c.pinst__change_detected =  [
/*0*/	function (e,f) { e.mcall (2, f.v["this"], "rerender_label", ([])); },
	function (e,f) { e.mcall (4, (f.v["this"]).form, "changed", ([((f.v["this"]).fielddef).name, (f.v["this"]).raw_value])); },
null	];

;
	c.pargs__current_value_is_raw =  [];
	c.pinst__current_value_is_raw =  [
/*0*/	function (e,f) { e.return_pop (false); },
null	];

;
	c.pargs__read_current_value =  [];
	c.pinst__read_current_value =  [
/*0*/	function (e,f) { e.mcall (2, f.v["this"], "data_el", ([])); },
	function (e,f) {
		var t701 = f.s[0]; f.v.el = t701;
		if (((f.v.el)) === ((null))) f.pc=2; else f.pc=3;
	},
	function (e,f) { e.return_pop (null); },
	function (e,f) { e.return_pop ((f.v.el).value); },
null	];

;
	c.pargs__check_for_possible_change =  [];
	c.pinst__check_for_possible_change =  [
/*0*/	function (e,f) { e.mcall (2, f.v["this"], "read_current_value", ([])); },
	function (e,f) {
		var t703 = f.s[0]; f.v.current = t703;
		if (((f.v.current)) === ((null))) f.pc=2; else f.pc=3;
	},
	function (e,f) { f.pc=-1; },
	function (e,f) {
		f.pc=6;
		e.mcall (2, f.v["this"], "current_value_is_raw", ([]));
	},
	function (e,f) { e.mcall (3, f.v["this"], "parse_value", ([f.v.current])); },
/*5*/	function (e,f) {
		f.pc=7;
		var t705 = f.s[0]; f.v.current = t705;
	},
	function (e,f) {
		var t706 = f.s[0]; 
		if (!(t706)) f.pc=4; else f.pc=7;
	},
	function (e,f) { if (((f.v.current)) !== (((f.v["this"]).raw_value))) f.pc=8; else f.pc=-1; },
	function (e,f) {
		f.v["this"].raw_value = f.v.current;
		e.mcall (2, f.v["this"], "change_detected", ([]));
	},
null	];

;
	c.pargs__onchange_handler =  ["el","arg","ev"];
	c.pinst__onchange_handler =  [
/*0*/	function (e,f) { e.mcall (2, f.v["this"], "check_for_possible_change", ([])); },
null	];

;
	c.pargs__render_label =  [];
	c.pinst__render_label =  [
/*0*/	function (e,f) { e.mcall (2, f.v["this"], "value_legal", ([])); },
	function (e,f) {
		var t708 = f.s[0]; 
		f.v.red = !(t708);
		if (f.v.red) f.pc=2; else f.pc=3;
	},
	function (e,f) { window.__outbuffer += "<span style=\"color:red\">"; },
	function (e,f) { if (builtin__method_exists (f.v["this"],"custom_label")) f.pc=4; else f.pc=6; },
	function (e,f) { e.mcall (2, f.v["this"], "custom_label", ([])); },
/*5*/	function (e,f) {
		f.pc=8;
		var t710 = f.s[0]; window.__outbuffer += t710;
	},
	function (e,f) { if (((((f.v["this"]).fielddef).label)) != ((""))) f.pc=7; else f.pc=8; },
	function (e,f) { window.__outbuffer += "" + (((f.v["this"]).fielddef).label) + (":"); },
	function (e,f) { if (f.v.red) f.pc=9; else f.pc=-1; },
	function (e,f) { window.__outbuffer += "</span>"; },
null	];

;
	c.pargs__focus =  [];
	c.pinst__focus =  [
/*0*/	function (e,f) { e.mcall (2, f.v["this"], "data_el", ([])); },
	function (e,f) {
		var t712 = f.s[0]; f.v.el = t712;
		e.mcall (2, f.v.el, "focus", ([]));
	},
null	];

;
	c.pargs__render_line_element_helper =  ["prefix","tagname","attrs","body","onclick"];
	c.pinst__render_line_element_helper =  [
/*0*/	function (e,f) {
		f.s[0] = "\"";
		e.mcall (3, f.v["this"], "get_id", ([]));
	},
	function (e,f) {
		f.pc=3;
		var t713 = f.s[1]; var t714 = f.s[0]; 
		window.__outbuffer += ("<tr id=\"row-") + ("" + (t713) + (t714));
		e.mcall (2, f.v["this"], "is_enabled", ([]));
	},
	function (e,f) {
		f.pc=4;
		window.__outbuffer += " style=\"display:none\"";
	},
	function (e,f) {
		var t715 = f.s[0]; 
		if (!(t715)) f.pc=2; else f.pc=4;
	},
	function (e,f) {
		window.__outbuffer += ">";
		if (builtin__method_exists (f.v["this"],"one_column")) f.pc=5; else f.pc=8;
	},
/*5*/	function (e,f) {
		window.__outbuffer += "<td colspan=\"2\">";
		f.s[0] = "\" >";
		e.mcall (3, f.v["this"], "get_id", ([]));
	},
	function (e,f) {
		var t716 = f.s[1]; var t717 = f.s[0]; 
		window.__outbuffer += ("<div style=\"text-align:left\" id=\"label-") + ("" + (t716) + (t717));
		e.mcall (2, f.v["this"], "render_label", ([]));
	},
	function (e,f) {
		f.pc=11;
		window.__outbuffer += "</div>";
	},
	function (e,f) {
		f.s[0] = "\" >";
		e.mcall (3, f.v["this"], "get_id", ([]));
	},
	function (e,f) {
		var t718 = f.s[1]; var t719 = f.s[0]; 
		window.__outbuffer += ("<td style=\"text-align:right\" id=\"label-") + ("" + (t718) + (t719));
		e.mcall (2, f.v["this"], "render_label", ([]));
	},
/*10*/	function (e,f) { window.__outbuffer += "</td><td>"; },
	function (e,f) {
		window.__outbuffer += f.v.prefix;
		f.s[0] = ("\" name=\"") + ("" + (((f.v["this"]).fielddef).name) + ("\""));
		e.mcall (3, f.v["this"], "get_id", ([]));
	},
	function (e,f) {
		var t720 = f.s[1]; var t721 = f.s[0]; 
		window.__outbuffer += ("<") + ("" + (f.v.tagname) + ((" id=\"data-") + ("" + (t720) + (t721))));
		f.v._k36 = e.enumkeys (f.v.attrs);
	},
	function (e,f) {
		f.pc=15;
		if (!((f.v._k36).length)) f.pc=14;
	},
	function (e,f) {
		window.__outbuffer += " style=\"";
		if ((((f.v["this"]).fielddef).width) !== undefined) f.pc=19; else f.pc=22;
	},
/*15*/	function (e,f) {
		f.v.attr = (f.v._k36).shift();
		f.v.value = (f.v.attrs)[(f.v.attr)];
		if (((f.v.attr)) != (("style"))) f.pc=16; else f.pc=13;
	},
	function (e,f) {
		f.s[0] = "\"";
		e.smcall (2, form,"entities", ([f.v.value]));
	},
	function (e,f) {
		f.pc=13;
		var t725 = f.s[1]; var t726 = f.s[0]; 
		window.__outbuffer += (" ") + ("" + (f.v.attr) + (("=\"") + ("" + (t725) + (t726))));
	},
	function (e,f) {
		f.pc=24;
		window.__outbuffer += ("width:") + ("" + (((f.v["this"]).fielddef).width) + ("px;"));
	},
	function (e,f) { if (((((f.v["this"]).fielddef).width)) != ((""))) f.pc=20; else f.pc=21; },
/*20*/	function (e,f) {
		f.pc=23;
		f.s[0] = ((((f.v["this"]).fielddef).width)) != (("0"));
	},
	function (e,f) {
		f.pc=23;
		f.s[0] = false;
	},
	function (e,f) { f.s[0] = false; },
	function (e,f) { var t727 = f.s[0]; if (t727) f.pc=18; else f.pc=24; },
	function (e,f) { if ((((f.v["this"]).fielddef).height) !== undefined) f.pc=26; else f.pc=29; },
/*25*/	function (e,f) {
		f.pc=31;
		window.__outbuffer += ("height:") + ("" + (((f.v["this"]).fielddef).height) + ("px;"));
	},
	function (e,f) { if (((((f.v["this"]).fielddef).height)) != ((""))) f.pc=27; else f.pc=28; },
	function (e,f) {
		f.pc=30;
		f.s[0] = ((((f.v["this"]).fielddef).height)) != (("0"));
	},
	function (e,f) {
		f.pc=30;
		f.s[0] = false;
	},
	function (e,f) { f.s[0] = false; },
/*30*/	function (e,f) { var t728 = f.s[0]; if (t728) f.pc=25; else f.pc=31; },
	function (e,f) { if (((f.v.attrs).style) !== undefined) f.pc=32; else f.pc=33; },
	function (e,f) { window.__outbuffer += (f.v.attrs).style; },
	function (e,f) {
		window.__outbuffer += "\"";
		if (((f.v.body)) === ((null))) f.pc=34; else f.pc=35;
	},
	function (e,f) {
		f.pc=36;
		window.__outbuffer += "/>";
	},
/*35*/	function (e,f) {
		window.__outbuffer += ">";
		window.__outbuffer += f.v.body;
		window.__outbuffer += ("</") + ("" + (f.v.tagname) + (">"));
	},
	function (e,f) {
		window.__outbuffer += "</td>";
		if (((f.v.onclick)) !== ((null))) f.pc=37; else f.pc=38;
	},
	function (e,f) {
		window.__outbuffer += "<td>";
		window.__outbuffer += ("<a href=\"#\" onclick=\"") + ("" + (f.v.onclick) + ("\">change</a>"));
		window.__outbuffer += "</td>";
	},
	function (e,f) {
		window.__outbuffer += "</tr>";
		if ((((f.v["this"]).fielddef).focus) !== undefined) f.pc=39; else f.pc=-1;
	},
	function (e,f) { (f.v["this"]).form.focusfield = f.v["this"]; },
null	];

;
	c.pargs__edit_field =  ["el","args","ev"];
	c.pinst__edit_field =  [
/*0*/	function (e,f) {
		f.v.fields = ([]);
		f.v.fields[f.v.fields.length] = (f.v["this"]).fielddef;
		f.v.fields[f.v.fields.length] = ({type:"ok"});
		f.v.fields[f.v.fields.length] = ({name:"cancel", type:"button", label:"Cancel", action:"cancel"});
		f.v.fname = ((f.v["this"]).fielddef).name;
		f.v.values = ({});
		f.v.values[f.v.fname] = (f.v["this"]).raw_value;
		e.smcall (3, form,"create", ([f.v["this"], f.v.fields, f.v.values]));
	},
	function (e,f) {
		var t738 = f.s[0]; f.v.xf = t738;
		e.mcall (3, f.v.xf, "focus", ([0]));
	},
	function (e,f) {
		f.v.xf.env = ((f.v["this"]).form).env;
		e.mcall (5, f.v.xf, "popup", ([0, 0, "Change"]));
	},
	function (e,f) {
		var t741 = f.s[0]; f.v.newvals = t741;
		if (((f.v.newvals)) !== ((null))) f.pc=4; else f.pc=-1;
	},
	function (e,f) { e.mcall (3, f.v["this"], "set_value", ([(f.v.newvals)[(f.v.fname)]])); },
null	];

;
};
form_element_line_base.init_methods (form_element_line_base);
rpcclass.setup_class (form_element_line_base, "form_element_line_base",0, (["form","fielddef","raw_value","change_timer_handle","listeners"]), ([0,0,0,0,2]));
function form_element_label () { this.do_construct (arguments); }
form_element_label.init_methods = function (c) {
	form_element_line_base.init_methods(c);
	var cp = c.prototype;
	c.pargs__value_legal =  [];
	c.pinst__value_legal =  [
/*0*/	function (e,f) { e.return_pop (true); },
null	];

;
	c.pargs__render =  [];
	c.pinst__render =  [
/*0*/	function (e,f) {
		f.s[0] = null;
		e.mcall (3, f.v["this"], "render_raw_value", ([]));
	},
	function (e,f) { var t742 = f.s[1]; var t743 = f.s[0]; e.mcall (7, f.v["this"], "render_line_element_helper", (["", "span", ([]), t742, t743])); },
null	];

;
};
form_element_label.init_methods (form_element_label);
rpcclass.setup_class (form_element_label, "form_element_label",0, (["form","fielddef","raw_value","change_timer_handle","listeners"]), ([0,0,0,0,2]));
function form_element_textarea () { this.do_construct (arguments); }
form_element_textarea.init_methods = function (c) {
	form_element_line_base.init_methods(c);
	var cp = c.prototype;
	c.pargs__one_column =  [];
	c.pinst__one_column =  [
/*0*/	function (e,f) { /* This is a NOP */ },
null	];

;
	cp.text_changed =  function (el,arg,ev)
	{
{
		this.trigger_change_timer  ();;
		return (true);
		}
			}

;
	c.pargs__render =  [];
	c.pinst__render =  [
/*0*/	function (e,f) { e.mcall (2, f.v["this"], "render_raw_value", ([])); },
	function (e,f) {
		var t745 = f.s[0]; f.v.value = t745;
		f.v.attrs = ([]);
		f.v.attrs.style = "margin-left:20px; border: solid 1px #c0c0c0; padding:3px;";
		if (((((f.v["this"]).form).form_mode)) == ((1))) f.pc=13; else f.pc=15;
	},
	function (e,f) { e.mcall (4, f.v["this"], "render_start_sync", (["text_changed", null])); },
	function (e,f) {
		var t749 = f.s[0]; f.v.attrs.onkeydown = t749;
		e.mcall (4, f.v["this"], "render_start_sync", (["text_changed", null]));
	},
	function (e,f) {
		f.pc=-1;
		var t751 = f.s[0]; f.v.attrs.onchange = t751;
		e.mcall (7, f.v["this"], "render_line_element_helper", (["", "textarea", f.v.attrs, builtin__htmlentities (f.v.value), null]));
	},
/*5*/	function (e,f) { if (((((f.v["this"]).form).form_mode)) == ((0))) f.pc=10; else f.pc=11; },
	function (e,f) {
		f.pc=-1;
		e.mcall (7, f.v["this"], "render_line_element_helper", (["", "div", f.v.attrs, builtin__str_replace ("\n","<br/>",builtin__htmlentities (f.v.value)), null]));
	},
	function (e,f) { if (((((f.v["this"]).form).form_mode)) == ((2))) f.pc=8; else f.pc=-1; },
	function (e,f) { e.mcall (4, f.v["this"], "render_start", (["edit_field", null])); },
	function (e,f) {
		f.pc=-1;
		var t752 = f.s[0]; e.mcall (7, f.v["this"], "render_line_element_helper", (["", "div", f.v.attrs, builtin__str_replace ("\n","<br/>",builtin__htmlentities (f.v.value)), t752]));
	},
/*10*/	function (e,f) {
		f.pc=12;
		f.s[0] = true;
	},
	function (e,f) { e.mcall (2, f.v["this"], "is_readonly", ([])); },
	function (e,f) { var t753 = f.s[0]; if (t753) f.pc=6; else f.pc=7; },
	function (e,f) { e.mcall (2, f.v["this"], "is_readonly", ([])); },
	function (e,f) {
		f.pc=16;
		var t754 = f.s[0]; f.s[0] = !(t754);
	},
/*15*/	function (e,f) { f.s[0] = false; },
	function (e,f) { var t755 = f.s[0]; if (t755) f.pc=2; else f.pc=5; },
null	];

;
};
form_element_textarea.init_methods (form_element_textarea);
rpcclass.setup_class (form_element_textarea, "form_element_textarea",0, (["form","fielddef","raw_value","change_timer_handle","listeners"]), ([0,0,0,0,2]));
function form_element_text_base () { this.do_construct (arguments); }
form_element_text_base.init_methods = function (c) {
	form_element_line_base.init_methods(c);
	var cp = c.prototype;
	cp.text_changed =  function (el,arg,ev)
	{
{
		this.trigger_change_timer  ();;
		return (true);
		}
			}

;
	c.pargs__render_text_element_helper =  ["prefix","input_type"];
	c.pinst__render_text_element_helper =  [
/*0*/	function (e,f) { e.mcall (2, f.v["this"], "render_raw_value", ([])); },
	function (e,f) {
		var t757 = f.s[0]; f.v.value = t757;
		if (((((f.v["this"]).form).form_mode)) == ((1))) f.pc=13; else f.pc=15;
	},
	function (e,f) {
		f.v.attrs = ({type:f.v.input_type, value:f.v.value});
		e.mcall (4, f.v["this"], "render_start_sync", (["text_changed", null]));
	},
	function (e,f) {
		var t760 = f.s[0]; f.v.attrs.onkeydown = t760;
		e.mcall (4, f.v["this"], "render_start_sync", (["text_changed", null]));
	},
	function (e,f) {
		f.pc=-1;
		var t762 = f.s[0]; f.v.attrs.onchange = t762;
		e.mcall (7, f.v["this"], "render_line_element_helper", ([f.v.prefix, "input", f.v.attrs, null, null]));
	},
/*5*/	function (e,f) { if (((((f.v["this"]).form).form_mode)) == ((0))) f.pc=10; else f.pc=11; },
	function (e,f) {
		f.pc=-1;
		e.mcall (7, f.v["this"], "render_line_element_helper", ([f.v.prefix, "span", ([]), f.v.value, null]));
	},
	function (e,f) { if (((((f.v["this"]).form).form_mode)) == ((2))) f.pc=8; else f.pc=-1; },
	function (e,f) { e.mcall (4, f.v["this"], "render_start", (["edit_field", null])); },
	function (e,f) {
		f.pc=-1;
		var t763 = f.s[0]; e.mcall (7, f.v["this"], "render_line_element_helper", ([f.v.prefix, "span", ([]), f.v.value, t763]));
	},
/*10*/	function (e,f) {
		f.pc=12;
		f.s[0] = true;
	},
	function (e,f) { e.mcall (2, f.v["this"], "is_readonly", ([])); },
	function (e,f) { var t764 = f.s[0]; if (t764) f.pc=6; else f.pc=7; },
	function (e,f) { e.mcall (2, f.v["this"], "is_readonly", ([])); },
	function (e,f) {
		f.pc=16;
		var t765 = f.s[0]; f.s[0] = !(t765);
	},
/*15*/	function (e,f) { f.s[0] = false; },
	function (e,f) { var t766 = f.s[0]; if (t766) f.pc=2; else f.pc=5; },
null	];

;
	c.pargs__eval_condition =  ["condition"];
	c.pinst__eval_condition =  [
/*0*/	function (e,f) { if (((builtin__substr (f.v.condition,0,1))) == (("="))) f.pc=1; else f.pc=2; },
	function (e,f) { e.return_pop (((builtin__substr (f.v.condition,1))) == (((f.v["this"]).raw_value))); },
	function (e,f) {
		f.s[0] = builtin__debugout (("form_element_text_base:eval_condition - don't know how to check ") + ("" + (f.v.condition) + ((" for ") + ((f.v["this"]).raw_value))));
		e.return_pop (false);
	},
null	];

;
};
form_element_text_base.init_methods (form_element_text_base);
rpcclass.setup_class (form_element_text_base, "form_element_text_base",0, (["form","fielddef","raw_value","change_timer_handle","listeners"]), ([0,0,0,0,2]));
function form_element_float () { this.do_construct (arguments); }
form_element_float.init_methods = function (c) {
	form_element_text_base.init_methods(c);
	var cp = c.prototype;
	c.pargs__init_helper =  [];
	c.pinst__init_helper =  [
/*0*/	function (e,f) { if ((((f.v["this"]).raw_value)) == ((""))) f.pc=1; else f.pc=-1; },
	function (e,f) { if ((((f.v["this"]).fielddef).deffloat) !== undefined) f.pc=2; else f.pc=3; },
	function (e,f) {
		f.pc=-1;
		f.v["this"].raw_value = ("") + (((f.v["this"]).fielddef).deffloat);
	},
	function (e,f) { f.v["this"].raw_value = "0"; },
null	];

;
	c.pargs__render =  [];
	c.pinst__render =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "render_text_element_helper", (["", "text"])); },
null	];

;
	c.pargs__render_value =  ["raw_value"];
	c.pinst__render_value =  [
/*0*/	function (e,f) { e.return_pop (f.v.raw_value); },
null	];

;
	c.pargs__parse_value =  ["value"];
	c.pinst__parse_value =  [
/*0*/	function (e,f) { if (((f.v.value)) == ((""))) f.pc=2; else f.pc=4; },
	function (e,f) { e.return_pop (""); },
	function (e,f) { e.mcall (2, f.v["this"], "is_required", ([])); },
	function (e,f) {
		f.pc=5;
		var t769 = f.s[0]; f.s[0] = !(t769);
	},
	function (e,f) { f.s[0] = false; },
/*5*/	function (e,f) { var t770 = f.s[0]; if (t770) f.pc=1; else f.pc=6; },
	function (e,f) { if (!(builtin__preg_match ("/^\\-?[0-9]+(\\.[0-9]*)?$/",f.v.value))) f.pc=7; else f.pc=8; },
	function (e,f) { e.return_pop (null); },
	function (e,f) {
		f.v.value = builtin__floatval (f.v.value);
		if ((((f.v["this"]).fielddef).minfloat) !== undefined) f.pc=10; else f.pc=11;
	},
	function (e,f) { e.return_pop (null); },
/*10*/	function (e,f) {
		f.pc=12;
		f.s[0] = ((f.v.value)) < ((((f.v["this"]).fielddef).minfloat));
	},
	function (e,f) { f.s[0] = false; },
	function (e,f) { var t772 = f.s[0]; if (t772) f.pc=9; else f.pc=13; },
	function (e,f) { if ((((f.v["this"]).fielddef).maxfloat) !== undefined) f.pc=15; else f.pc=16; },
	function (e,f) { e.return_pop (null); },
/*15*/	function (e,f) {
		f.pc=17;
		f.s[0] = ((f.v.value)) > ((((f.v["this"]).fielddef).maxfloat));
	},
	function (e,f) { f.s[0] = false; },
	function (e,f) { var t773 = f.s[0]; if (t773) f.pc=14; else f.pc=18; },
	function (e,f) { e.return_pop (f.v.value); },
null	];

;
};
form_element_float.init_methods (form_element_float);
rpcclass.setup_class (form_element_float, "form_element_float",0, (["form","fielddef","raw_value","change_timer_handle","listeners"]), ([0,0,0,0,2]));
function form_element_integer () { this.do_construct (arguments); }
form_element_integer.init_methods = function (c) {
	form_element_text_base.init_methods(c);
	var cp = c.prototype;
	c.pargs__init_helper =  [];
	c.pinst__init_helper =  [
/*0*/	function (e,f) { if ((((f.v["this"]).raw_value)) == ((""))) f.pc=1; else f.pc=-1; },
	function (e,f) { if ((((f.v["this"]).fielddef).definteger) !== undefined) f.pc=2; else f.pc=3; },
	function (e,f) {
		f.pc=-1;
		f.v["this"].raw_value = ("") + (((f.v["this"]).fielddef).definteger);
	},
	function (e,f) { f.v["this"].raw_value = "0"; },
null	];

;
	c.pargs__render =  [];
	c.pinst__render =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "render_text_element_helper", (["", "text"])); },
null	];

;
	c.pargs__render_value =  ["raw_value"];
	c.pinst__render_value =  [
/*0*/	function (e,f) { e.return_pop (f.v.raw_value); },
null	];

;
	c.pargs__parse_value =  ["value"];
	c.pinst__parse_value =  [
/*0*/	function (e,f) { if (((f.v.value)) == ((""))) f.pc=2; else f.pc=4; },
	function (e,f) { e.return_pop (""); },
	function (e,f) { e.mcall (2, f.v["this"], "is_required", ([])); },
	function (e,f) {
		f.pc=5;
		var t776 = f.s[0]; f.s[0] = !(t776);
	},
	function (e,f) { f.s[0] = false; },
/*5*/	function (e,f) { var t777 = f.s[0]; if (t777) f.pc=1; else f.pc=6; },
	function (e,f) { if (!(builtin__preg_match ("/^\\-?\\d+$/",f.v.value))) f.pc=7; else f.pc=8; },
	function (e,f) { e.return_pop (null); },
	function (e,f) {
		f.v.value = parseInt((0),10) + parseInt((f.v.value),10);
		if ((((f.v["this"]).fielddef).mininteger) !== undefined) f.pc=10; else f.pc=11;
	},
	function (e,f) { e.return_pop (null); },
/*10*/	function (e,f) {
		f.pc=12;
		f.s[0] = ((f.v.value)) < ((((f.v["this"]).fielddef).mininteger));
	},
	function (e,f) { f.s[0] = false; },
	function (e,f) { var t779 = f.s[0]; if (t779) f.pc=9; else f.pc=13; },
	function (e,f) { if ((((f.v["this"]).fielddef).maxinteger) !== undefined) f.pc=15; else f.pc=16; },
	function (e,f) { e.return_pop (null); },
/*15*/	function (e,f) {
		f.pc=17;
		f.s[0] = ((f.v.value)) > ((((f.v["this"]).fielddef).maxinteger));
	},
	function (e,f) { f.s[0] = false; },
	function (e,f) { var t780 = f.s[0]; if (t780) f.pc=14; else f.pc=18; },
	function (e,f) { e.return_pop (f.v.value); },
null	];

;
};
form_element_integer.init_methods (form_element_integer);
rpcclass.setup_class (form_element_integer, "form_element_integer",0, (["form","fielddef","raw_value","change_timer_handle","listeners"]), ([0,0,0,0,2]));
function form_element_date () { this.do_construct (arguments); }
form_element_date.init_methods = function (c) {
	form_element_text_base.init_methods(c);
	var cp = c.prototype;
	c.pargs__popup_date =  [];
	c.pinst__popup_date =  [
/*0*/	function (e,f) { e.mcall (2, f.v["this"], "read_current_value", ([])); },
	function (e,f) {
		var t782 = f.s[0]; f.v.current = t782;
		if (((f.v.current)) === ((null))) f.pc=2; else f.pc=3;
	},
	function (e,f) {
		f.pc=6;
		f.v.old = builtin__time ();
	},
	function (e,f) { e.mcall (3, f.v["this"], "parse_value", ([f.v.current])); },
	function (e,f) {
		var t785 = f.s[0]; f.v.old = t785;
		if (((f.v.old)) === ((null))) f.pc=5; else f.pc=6;
	},
/*5*/	function (e,f) { f.v.old = builtin__time (); },
	function (e,f) { e.smcall (2, popupdate,"run", ([((f.v["this"]).fielddef).label, f.v.old])); },
	function (e,f) {
		var t788 = f.s[0]; f.v.v = t788;
		if (((f.v.v)) !== ((null))) f.pc=8; else f.pc=-1;
	},
	function (e,f) { e.mcall (3, f.v["this"], "set_current_value", ([f.v.v])); },
null	];

;
	c.pargs__render_value =  ["raw_value"];
	c.pinst__render_value =  [
/*0*/	function (e,f) { e.return_pop (builtin__date ("Y-m-d",f.v.raw_value)); },
null	];

;
	c.pargs__parse_value =  ["value"];
	c.pinst__parse_value =  [
/*0*/	function (e,f) { if (((f.v.value)) == ((""))) f.pc=2; else f.pc=4; },
	function (e,f) { e.return_pop (""); },
	function (e,f) { e.mcall (2, f.v["this"], "is_required", ([])); },
	function (e,f) {
		f.pc=5;
		var t789 = f.s[0]; f.s[0] = !(t789);
	},
	function (e,f) { f.s[0] = false; },
/*5*/	function (e,f) { var t790 = f.s[0]; if (t790) f.pc=1; else f.pc=6; },
	function (e,f) {
		f.v.matches = ([]);
		if (builtin__preg_match ("/^(2\\d\\d\\d)\\-(\\d\\d?)\\-(\\d\\d?)$/",f.v.value,f.v.matches)) f.pc=7; else f.pc=8;
	},
	function (e,f) {
		f.s[0] = builtin__debugout (("Parsed it ") + (f.v.matches));
		e.return_pop (builtin__mktime (0,0,0,(f.v.matches)[(2)],(f.v.matches)[(3)],(f.v.matches)[(1)]));
	},
	function (e,f) { e.return_pop (null); },
null	];

;
	c.pargs__render =  [];
	c.pinst__render =  [
/*0*/	function (e,f) { if (((((f.v["this"]).form).form_mode)) == ((1))) f.pc=12; else f.pc=14; },
	function (e,f) {
		f.s[0] = "text";
		f.s[1] = "\" src=\"/pj/graphics/calendar-small.png\" />";
		e.mcall (6, f.v["this"], "render_start", (["popup_date", null]));
	},
	function (e,f) {
		f.pc=-1;
		var t792 = f.s[2]; var t793 = f.s[1]; 
		var t794 = f.s[0]; e.mcall (4, f.v["this"], "render_text_element_helper", ([("<img onclick=\"") + ("" + (t792) + (t793)), t794]));
	},
	function (e,f) { if (((((f.v["this"]).form).form_mode)) == ((0))) f.pc=9; else f.pc=10; },
	function (e,f) {
		f.pc=-1;
		e.mcall (4, f.v["this"], "render_text_element_helper", (["", "text"]));
	},
/*5*/	function (e,f) { if (((((f.v["this"]).form).form_mode)) == ((2))) f.pc=6; else f.pc=-1; },
	function (e,f) { e.mcall (4, f.v["this"], "render_start", (["edit_field", null])); },
	function (e,f) { e.mcall (3, f.v["this"], "render_raw_value", ([])); },
	function (e,f) {
		f.pc=-1;
		var t795 = f.s[1]; var t796 = f.s[0]; e.mcall (7, f.v["this"], "render_line_element_helper", (["", "span", ([]), t795, t796]));
	},
	function (e,f) {
		f.pc=11;
		f.s[0] = true;
	},
/*10*/	function (e,f) { e.mcall (2, f.v["this"], "is_readonly", ([])); },
	function (e,f) { var t797 = f.s[0]; if (t797) f.pc=4; else f.pc=5; },
	function (e,f) { e.mcall (2, f.v["this"], "is_readonly", ([])); },
	function (e,f) {
		f.pc=15;
		var t798 = f.s[0]; f.s[0] = !(t798);
	},
	function (e,f) { f.s[0] = false; },
/*15*/	function (e,f) { var t799 = f.s[0]; if (t799) f.pc=1; else f.pc=3; },
null	];

;
};
form_element_date.init_methods (form_element_date);
rpcclass.setup_class (form_element_date, "form_element_date",0, (["form","fielddef","raw_value","change_timer_handle","listeners"]), ([0,0,0,0,2]));
function form_element_time () { this.do_construct (arguments); }
form_element_time.init_methods = function (c) {
	form_element_text_base.init_methods(c);
	var cp = c.prototype;
	c.pargs__render_value =  ["raw_value"];
	c.pinst__render_value =  [
/*0*/	function (e,f) { e.return_pop (builtin__date ("H:i",f.v.raw_value)); },
null	];

;
	c.pargs__parse_value =  ["value"];
	c.pinst__parse_value =  [
/*0*/	function (e,f) { if (((f.v.value)) == ((""))) f.pc=2; else f.pc=4; },
	function (e,f) { e.return_pop (""); },
	function (e,f) { e.mcall (2, f.v["this"], "is_required", ([])); },
	function (e,f) {
		f.pc=5;
		var t800 = f.s[0]; f.s[0] = !(t800);
	},
	function (e,f) { f.s[0] = false; },
/*5*/	function (e,f) { var t801 = f.s[0]; if (t801) f.pc=1; else f.pc=6; },
	function (e,f) {
		f.v.matches = ([]);
		if (builtin__preg_match ("/^(\\d\\d?)\\:(\\d\\d)$/",f.v.value,f.v.matches)) f.pc=8; else f.pc=11;
	},
	function (e,f) {
		f.s[0] = builtin__debugout (("Parsed it ") + (f.v.matches));
		e.return_pop (builtin__mktime ((f.v.matches)[(1)],(f.v.matches)[(2)],0,1,1,2000));
	},
	function (e,f) { if ((((f.v.matches)[(1)])) < ((24))) f.pc=9; else f.pc=10; },
	function (e,f) {
		f.pc=12;
		f.s[0] = (((f.v.matches)[(2)])) < ((60));
	},
/*10*/	function (e,f) {
		f.pc=12;
		f.s[0] = false;
	},
	function (e,f) { f.s[0] = false; },
	function (e,f) { var t803 = f.s[0]; if (t803) f.pc=7; else f.pc=13; },
	function (e,f) { e.return_pop (null); },
null	];

;
	c.pargs__render =  [];
	c.pinst__render =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "render_text_element_helper", (["", "text"])); },
null	];

;
};
form_element_time.init_methods (form_element_time);
rpcclass.setup_class (form_element_time, "form_element_time",0, (["form","fielddef","raw_value","change_timer_handle","listeners"]), ([0,0,0,0,2]));
function form_element_datetime () { this.do_construct (arguments); }
form_element_datetime.init_methods = function (c) {
	form_element_text_base.init_methods(c);
	var cp = c.prototype;
	c.pargs__popup_date =  [];
	c.pinst__popup_date =  [
/*0*/	function (e,f) { e.mcall (2, f.v["this"], "read_current_value", ([])); },
	function (e,f) {
		var t805 = f.s[0]; f.v.current = t805;
		if (((f.v.current)) === ((null))) f.pc=2; else f.pc=3;
	},
	function (e,f) {
		f.pc=6;
		f.v.old = builtin__time ();
	},
	function (e,f) { e.mcall (3, f.v["this"], "parse_value", ([f.v.current])); },
	function (e,f) {
		var t808 = f.s[0]; f.v.old = t808;
		if (((f.v.old)) === ((null))) f.pc=5; else f.pc=6;
	},
/*5*/	function (e,f) { f.v.old = builtin__time (); },
	function (e,f) { e.smcall (2, popupdate,"run", ([((f.v["this"]).fielddef).label, f.v.old])); },
	function (e,f) {
		var t811 = f.s[0]; f.v.v = t811;
		if (((f.v.v)) !== ((null))) f.pc=8; else f.pc=-1;
	},
	function (e,f) { e.mcall (3, f.v["this"], "set_current_value", ([builtin__mktime (builtin__date ("H",f.v.old),builtin__date ("i",f.v.old),0,builtin__date ("m",f.v.v),builtin__date ("d",f.v.v),builtin__date ("Y",f.v.v))])); },
null	];

;
	c.pargs__render_value =  ["raw_value"];
	c.pinst__render_value =  [
/*0*/	function (e,f) { e.return_pop (builtin__date ("Y-m-d H:i",f.v.raw_value)); },
null	];

;
	c.pargs__parse_datetime =  ["value"];
	c.pinst__parse_datetime =  [
/*0*/	function (e,f) { if (((f.v.value)) == ((""))) f.pc=2; else f.pc=4; },
	function (e,f) { e.return_pop (""); },
	function (e,f) { e.mcall (2, f.v["this"], "is_required", ([])); },
	function (e,f) {
		f.pc=5;
		var t812 = f.s[0]; f.s[0] = !(t812);
	},
	function (e,f) { f.s[0] = false; },
/*5*/	function (e,f) { var t813 = f.s[0]; if (t813) f.pc=1; else f.pc=6; },
	function (e,f) {
		f.v.matches = ([]);
		if (builtin__preg_match ("/^(2\\d\\d\\d)\\-(\\d\\d?)\\-(\\d\\d?) (\\d\\d?)\\:(\\d\\d)$/",f.v.value,f.v.matches)) f.pc=8; else f.pc=11;
	},
	function (e,f) { e.return_pop (builtin__mktime ((f.v.matches)[(4)],(f.v.matches)[(5)],0,(f.v.matches)[(2)],(f.v.matches)[(3)],(f.v.matches)[(1)])); },
	function (e,f) { if ((((f.v.matches)[(4)])) < ((24))) f.pc=9; else f.pc=10; },
	function (e,f) {
		f.pc=12;
		f.s[0] = (((f.v.matches)[(5)])) < ((60));
	},
/*10*/	function (e,f) {
		f.pc=12;
		f.s[0] = false;
	},
	function (e,f) { f.s[0] = false; },
	function (e,f) { var t815 = f.s[0]; if (t815) f.pc=7; else f.pc=13; },
	function (e,f) { e.return_pop (null); },
null	];

;
	c.pargs__parse_value =  ["value"];
	c.pinst__parse_value =  [
/*0*/	function (e,f) { e.mcall (3, f.v["this"], "parse_datetime", ([f.v.value])); },
	function (e,f) { var t816 = f.s[0]; e.return_pop (t816); },
null	];

;
	c.pargs__render =  [];
	c.pinst__render =  [
/*0*/	function (e,f) {
		f.s[0] = "text";
		f.s[1] = "\" src=\"/pj/graphics/calendar-small.png\" />";
		e.mcall (6, f.v["this"], "render_start", (["popup_date", null]));
	},
	function (e,f) {
		var t817 = f.s[2]; var t818 = f.s[1]; 
		var t819 = f.s[0]; e.mcall (4, f.v["this"], "render_text_element_helper", ([("<img onclick=\"") + ("" + (t817) + (t818)), t819]));
	},
null	];

;
};
form_element_datetime.init_methods (form_element_datetime);
rpcclass.setup_class (form_element_datetime, "form_element_datetime",0, (["form","fielddef","raw_value","change_timer_handle","listeners"]), ([0,0,0,0,2]));
function form_element_price () { this.do_construct (arguments); }
form_element_price.init_methods = function (c) {
	form_element_text_base.init_methods(c);
	var cp = c.prototype;
	c.pargs__render =  [];
	c.pinst__render =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "render_text_element_helper", (["&#163;", "text"])); },
null	];

;
	c.pargs__render_value =  ["raw_value"];
	c.pinst__render_value =  [
/*0*/	function (e,f) { e.smcall (1, lib,"render_price_simple", ([f.v.raw_value])); },
	function (e,f) { var t820 = f.s[0]; e.return_pop (t820); },
null	];

;
	c.pargs__parse_value =  ["value"];
	c.pinst__parse_value =  [
/*0*/	function (e,f) { if (((f.v.value)) == ((""))) f.pc=2; else f.pc=4; },
	function (e,f) { e.return_pop (""); },
	function (e,f) { e.mcall (2, f.v["this"], "is_required", ([])); },
	function (e,f) {
		f.pc=5;
		var t821 = f.s[0]; f.s[0] = !(t821);
	},
	function (e,f) { f.s[0] = false; },
/*5*/	function (e,f) { var t822 = f.s[0]; if (t822) f.pc=1; else f.pc=6; },
	function (e,f) { e.smcall (1, lib,"parse_price_simple", ([f.v.value])); },
	function (e,f) {
		var t824 = f.s[0]; f.v.n = t824;
		if (((f.v.n)) === ((null))) f.pc=8; else f.pc=9;
	},
	function (e,f) { e.return_pop (null); },
	function (e,f) { if ((((f.v["this"]).fielddef).minprice) !== undefined) f.pc=11; else f.pc=12; },
/*10*/	function (e,f) { e.return_pop (null); },
	function (e,f) {
		f.pc=13;
		f.s[0] = ((f.v.n)) < ((((f.v["this"]).fielddef).minprice));
	},
	function (e,f) { f.s[0] = false; },
	function (e,f) { var t825 = f.s[0]; if (t825) f.pc=10; else f.pc=14; },
	function (e,f) { if ((((f.v["this"]).fielddef).maxprice) !== undefined) f.pc=16; else f.pc=17; },
/*15*/	function (e,f) { e.return_pop (null); },
	function (e,f) {
		f.pc=18;
		f.s[0] = ((f.v.n)) > ((((f.v["this"]).fielddef).maxprice));
	},
	function (e,f) { f.s[0] = false; },
	function (e,f) { var t826 = f.s[0]; if (t826) f.pc=15; else f.pc=19; },
	function (e,f) { e.return_pop (f.v.n); },
null	];

;
};
form_element_price.init_methods (form_element_price);
rpcclass.setup_class (form_element_price, "form_element_price",0, (["form","fielddef","raw_value","change_timer_handle","listeners"]), ([0,0,0,0,2]));
function form_element_email () { this.do_construct (arguments); }
form_element_email.init_methods = function (c) {
	form_element_text_base.init_methods(c);
	var cp = c.prototype;
	c.pargs__render =  [];
	c.pinst__render =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "render_text_element_helper", (["", "text"])); },
null	];

;
	c.pargs__parse_value =  ["value"];
	c.pinst__parse_value =  [
/*0*/	function (e,f) { if (((f.v.value)) == ((""))) f.pc=2; else f.pc=4; },
	function (e,f) { e.return_pop (""); },
	function (e,f) { e.mcall (2, f.v["this"], "is_required", ([])); },
	function (e,f) {
		f.pc=5;
		var t827 = f.s[0]; f.s[0] = !(t827);
	},
	function (e,f) { f.s[0] = false; },
/*5*/	function (e,f) { var t828 = f.s[0]; if (t828) f.pc=1; else f.pc=6; },
	function (e,f) { if (!(builtin__preg_match ("/^[0-9a-zA-Z\\.\\+\\-_']+@[-0-9a-zA-Z\\.]+$/",f.v.value))) f.pc=7; else f.pc=8; },
	function (e,f) { e.return_pop (null); },
	function (e,f) { e.return_pop (f.v.value); },
null	];

;
};
form_element_email.init_methods (form_element_email);
rpcclass.setup_class (form_element_email, "form_element_email",0, (["form","fielddef","raw_value","change_timer_handle","listeners"]), ([0,0,0,0,2]));
function form_element_text () { this.do_construct (arguments); }
form_element_text.init_methods = function (c) {
	form_element_text_base.init_methods(c);
	var cp = c.prototype;
	c.pargs__render =  [];
	c.pinst__render =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "render_text_element_helper", (["", "text"])); },
null	];

;
};
form_element_text.init_methods (form_element_text);
rpcclass.setup_class (form_element_text, "form_element_text",0, (["form","fielddef","raw_value","change_timer_handle","listeners"]), ([0,0,0,0,2]));
function form_element_postcode () { this.do_construct (arguments); }
form_element_postcode.init_methods = function (c) {
	form_element_text_base.init_methods(c);
	var cp = c.prototype;
	c.pargs__render =  [];
	c.pinst__render =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "render_text_element_helper", (["", "text"])); },
null	];

;
};
form_element_postcode.init_methods (form_element_postcode);
rpcclass.setup_class (form_element_postcode, "form_element_postcode",0, (["form","fielddef","raw_value","change_timer_handle","listeners"]), ([0,0,0,0,2]));
function form_element_dn () { this.do_construct (arguments); }
form_element_dn.init_methods = function (c) {
	form_element_text_base.init_methods(c);
	var cp = c.prototype;
	c.pargs__render =  [];
	c.pinst__render =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "render_text_element_helper", (["", "text"])); },
null	];

;
};
form_element_dn.init_methods (form_element_dn);
rpcclass.setup_class (form_element_dn, "form_element_dn",0, (["form","fielddef","raw_value","change_timer_handle","listeners"]), ([0,0,0,0,2]));
function form_element_password () { this.do_construct (arguments); }
form_element_password.init_methods = function (c) {
	form_element_text_base.init_methods(c);
	var cp = c.prototype;
	c.pargs__render =  [];
	c.pinst__render =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "render_text_element_helper", (["", "password"])); },
null	];

;
};
form_element_password.init_methods (form_element_password);
rpcclass.setup_class (form_element_password, "form_element_password",0, (["form","fielddef","raw_value","change_timer_handle","listeners"]), ([0,0,0,0,2]));
function form_element_enum_base () { this.do_construct (arguments); }
form_element_enum_base.init_methods = function (c) {
	form_element_line_base.init_methods(c);
	var cp = c.prototype;
	c.pargs__option_label =  ["opt"];
	c.pinst__option_label =  [
/*0*/	function (e,f) { e.return_pop ((f.v.opt).label); },
null	];

;
	cp.onkey =  function (el,arg,ev)
	{
{
		this.trigger_change_timer  ();;
		return (true);
		}
			}

;
	c.pargs__render_value =  ["raw_value"];
	c.pinst__render_value =  [
/*0*/	function (e,f) {
		f.v.label = "";
		f.v._k38 = e.enumkeys ((f.v["this"]).options);
	},
	function (e,f) {
		f.pc=3;
		if (!((f.v._k38).length)) f.pc=2;
	},
	function (e,f) { e.return_pop (""); },
	function (e,f) {
		f.v._i39 = (f.v._k38).shift();
		f.v.opt = ((f.v["this"]).options)[(f.v._i39)];
		if ((((f.v.opt).name)) == ((f.v.raw_value))) f.pc=4; else f.pc=1;
	},
	function (e,f) { e.mcall (3, f.v["this"], "option_label", ([f.v.opt])); },
/*5*/	function (e,f) { var t833 = f.s[0]; e.return_pop (t833); },
null	];

;
	c.pargs__parse_value =  ["value"];
	c.pinst__parse_value =  [
/*0*/	function (e,f) {
		f.v.label = "";
		f.v._k40 = e.enumkeys ((f.v["this"]).options);
	},
	function (e,f) {
		f.pc=3;
		if (!((f.v._k40).length)) f.pc=2;
	},
	function (e,f) { e.return_pop (""); },
	function (e,f) {
		f.v._i41 = (f.v._k40).shift();
		f.v.opt = ((f.v["this"]).options)[(f.v._i41)];
		f.s[0] = "'";
		e.mcall (4, f.v["this"], "option_label", ([f.v.opt]));
	},
	function (e,f) {
		f.pc=6;
		var t838 = f.s[1]; var t839 = f.s[0]; 
		f.s[0] = builtin__debugout (("Checking '") + ("" + (f.v.value) + (("' against '") + ("" + (t838) + (t839)))));
		f.s[0] = f.v.value;
		e.mcall (4, f.v["this"], "option_label", ([f.v.opt]));
	},
/*5*/	function (e,f) { e.return_pop ((f.v.opt).name); },
	function (e,f) {
		var t840 = f.s[1]; var t841 = f.s[0]; 
		if (((t840)) == ((t841))) f.pc=5; else f.pc=1;
	},
null	];

;
	c.pargs__option_list =  [];
	c.pinst__option_list =  [
/*0*/	function (e,f) {
		f.v.live_opts = ([]);
		f.v.default_key = "";
		f.v._k42 = e.enumkeys ((f.v["this"]).options);
	},
	function (e,f) {
		f.pc=3;
		if (!((f.v._k42).length)) f.pc=2;
	},
	function (e,f) { if ((((f.v["this"]).raw_value)) == ((""))) f.pc=17; else f.pc=18; },
	function (e,f) {
		f.v._i43 = (f.v._k42).shift();
		f.v.opt = ((f.v["this"]).options)[(f.v._i43)];
		if (((f.v.opt).enabled) !== undefined) f.pc=4; else f.pc=5;
	},
	function (e,f) {
		f.pc=6;
		e.mcall (3, (f.v["this"]).form, "is_enabled", ([(f.v.opt).enabled]));
	},
/*5*/	function (e,f) { f.s[0] = true; },
	function (e,f) {
		var t848 = f.s[0]; f.v.opt.live = t848;
		if ((f.v.opt).live) f.pc=7; else f.pc=8;
	},
	function (e,f) {
		f.pc=1;
		f.v.live_opts[f.v.live_opts.length] = f.v.opt;
	},
	function (e,f) { if ((((f.v.opt).name)) == (((f.v["this"]).raw_value))) f.pc=9; else f.pc=1; },
	function (e,f) {
		f.pc=1;
		f.v["this"].raw_value = "";
	},
/*10*/	function (e,f) { if (((builtin__count (f.v.live_opts))) == ((1))) f.pc=11; else f.pc=12; },
	function (e,f) {
		f.pc=20;
		f.v["this"].raw_value = ((f.v.live_opts)[(0)]).name;
	},
	function (e,f) { if ((((f.v["this"]).fielddef).defoption) !== undefined) f.pc=13; else f.pc=20; },
	function (e,f) { f.v._k44 = e.enumkeys (f.v.live_opts); },
	function (e,f) { if (!((f.v._k44).length)) f.pc=20; },
/*15*/	function (e,f) {
		f.v._i45 = (f.v._k44).shift();
		f.v.opt = (f.v.live_opts)[(f.v._i45)];
		if ((((f.v.opt).name)) == ((((f.v["this"]).fielddef).defoption))) f.pc=16; else f.pc=14;
	},
	function (e,f) {
		f.pc=20;
		f.v["this"].raw_value = (f.v.opt).name;
	},
	function (e,f) {
		f.pc=19;
		f.s[0] = true;
	},
	function (e,f) { f.s[0] = (((f.v["this"]).raw_value)) === ((null)); },
	function (e,f) { var t856 = f.s[0]; if (t856) f.pc=10; else f.pc=20; },
/*20*/	function (e,f) {
		f.v.options = "";
		if ((((f.v["this"]).raw_value)) == ((""))) f.pc=21; else f.pc=22;
	},
	function (e,f) { f.v.options = "" + (f.v.options) + ("<option value=\"\" selected=\"selected\"></option>"); },
	function (e,f) { f.v._k46 = e.enumkeys (f.v.live_opts); },
	function (e,f) {
		f.pc=25;
		if (!((f.v._k46).length)) f.pc=24;
	},
	function (e,f) { e.return_pop (f.v.options); },
/*25*/	function (e,f) {
		f.v._i47 = (f.v._k46).shift();
		f.v.opt = (f.v.live_opts)[(f.v._i47)];
		if ((((f.v.opt).name)) == (((f.v["this"]).raw_value))) f.pc=26; else f.pc=27;
	},
	function (e,f) {
		f.pc=28;
		f.s[0] = "selected=\"selected\"";
	},
	function (e,f) { f.s[0] = ""; },
	function (e,f) {
		var t863 = f.s[0]; f.v.def = t863;
		f.s[0] = "</option>";
		e.mcall (4, f.v["this"], "option_label", ([f.v.opt]));
	},
	function (e,f) {
		f.pc=23;
		var t864 = f.s[1]; var t865 = f.s[0]; 
		f.v.options = "" + (f.v.options) + (("<option value=\"") + ("" + ((f.v.opt).name) + (("\" ") + ("" + (f.v.def) + ((">") + ("" + (t864) + (t865)))))));
	},
null	];

;
	c.pargs__eval_condition =  ["condition"];
	c.pinst__eval_condition =  [
/*0*/	function (e,f) { if (((builtin__substr (f.v.condition,0,1))) == (("="))) f.pc=1; else f.pc=2; },
	function (e,f) { e.return_pop (((builtin__substr (f.v.condition,1))) == (((f.v["this"]).raw_value))); },
	function (e,f) {
		f.s[0] = builtin__debugout (("form_element_enum_base:eval_condition - don't know how to check ") + ("" + (f.v.condition) + ((" for ") + ((f.v["this"]).raw_value))));
		e.return_pop (false);
	},
null	];

;
	c.pargs__current_value_is_raw =  [];
	c.pinst__current_value_is_raw =  [
/*0*/	function (e,f) { if (((((f.v["this"]).form).form_mode)) == ((1))) f.pc=1; else f.pc=3; },
	function (e,f) { e.mcall (2, f.v["this"], "is_readonly", ([])); },
	function (e,f) {
		f.pc=4;
		var t867 = f.s[0]; f.s[0] = !(t867);
	},
	function (e,f) { f.s[0] = false; },
	function (e,f) { var t868 = f.s[0]; e.return_pop (t868); },
null	];

;
	c.pargs__render =  [];
	c.pinst__render =  [
/*0*/	function (e,f) { if (((((f.v["this"]).form).form_mode)) == ((1))) f.pc=15; else f.pc=17; },
	function (e,f) { e.mcall (2, f.v["this"], "option_list", ([])); },
	function (e,f) {
		var t870 = f.s[0]; f.v.options = t870;
		f.v.attrs = ([]);
		e.mcall (4, f.v["this"], "render_start", (["onchange_handler", null]));
	},
	function (e,f) {
		var t873 = f.s[0]; f.v.attrs.onchange = t873;
		e.mcall (4, f.v["this"], "render_start_sync", (["onkey", null]));
	},
	function (e,f) {
		f.pc=-1;
		var t875 = f.s[0]; f.v.attrs.onkeypress = t875;
		e.mcall (7, f.v["this"], "render_line_element_helper", (["", "select", f.v.attrs, f.v.options, null]));
	},
/*5*/	function (e,f) { if (((((f.v["this"]).form).form_mode)) == ((0))) f.pc=12; else f.pc=13; },
	function (e,f) {
		f.s[0] = null;
		e.mcall (3, f.v["this"], "render_raw_value", ([]));
	},
	function (e,f) {
		f.pc=-1;
		var t876 = f.s[1]; var t877 = f.s[0]; e.mcall (7, f.v["this"], "render_line_element_helper", (["", "span", ([]), t876, t877]));
	},
	function (e,f) { if (((((f.v["this"]).form).form_mode)) == ((2))) f.pc=9; else f.pc=-1; },
	function (e,f) { e.mcall (4, f.v["this"], "render_start", (["edit_field", null])); },
/*10*/	function (e,f) { e.mcall (3, f.v["this"], "render_raw_value", ([])); },
	function (e,f) {
		f.pc=-1;
		var t878 = f.s[1]; var t879 = f.s[0]; e.mcall (7, f.v["this"], "render_line_element_helper", (["", "span", ([]), t878, t879]));
	},
	function (e,f) {
		f.pc=14;
		f.s[0] = true;
	},
	function (e,f) { e.mcall (2, f.v["this"], "is_readonly", ([])); },
	function (e,f) { var t880 = f.s[0]; if (t880) f.pc=6; else f.pc=8; },
/*15*/	function (e,f) { e.mcall (2, f.v["this"], "is_readonly", ([])); },
	function (e,f) {
		f.pc=18;
		var t881 = f.s[0]; f.s[0] = !(t881);
	},
	function (e,f) { f.s[0] = false; },
	function (e,f) { var t882 = f.s[0]; if (t882) f.pc=1; else f.pc=5; },
null	];

;
	c.pargs__check_option_enable =  [];
	c.pinst__check_option_enable =  [
/*0*/	function (e,f) { if (((((f.v["this"]).form).form_mode)) != ((1))) f.pc=1; else f.pc=2; },
	function (e,f) { f.pc=-1; },
	function (e,f) {
		f.v.reload = false;
		f.v._k48 = e.enumkeys ((f.v["this"]).options);
	},
	function (e,f) {
		f.pc=5;
		if (!((f.v._k48).length)) f.pc=4;
	},
	function (e,f) { if (f.v.reload) f.pc=9; else f.pc=-1; },
/*5*/	function (e,f) {
		f.v._i49 = (f.v._k48).shift();
		f.v.opt = ((f.v["this"]).options)[(f.v._i49)];
		if (((f.v.opt).enabled) !== undefined) f.pc=6; else f.pc=3;
	},
	function (e,f) {
		f.pc=8;
		e.mcall (3, (f.v["this"]).form, "is_enabled", ([(f.v.opt).enabled]));
	},
	function (e,f) {
		f.pc=4;
		f.v.reload = true;
	},
	function (e,f) {
		var t888 = f.s[0]; 
		if ((((f.v.opt).live)) != ((t888))) f.pc=7; else f.pc=3;
	},
	function (e,f) { e.mcall (2, f.v["this"], "data_el", ([])); },
/*10*/	function (e,f) {
		var t890 = f.s[0]; f.v.el = t890;
		e.mcall (2, f.v["this"], "option_list", ([]));
	},
	function (e,f) {
		var t892 = f.s[0]; f.v.el.innerHTML = t892;
		e.mcall (2, f.v["this"], "change_detected", ([]));
	},
null	];

;
	c.pargs__edit_field =  ["el","args","ev"];
	c.pinst__edit_field =  [
/*0*/	function (e,f) { e.smcall (0, menu,"create", ([])); },
	function (e,f) {
		var t894 = f.s[0]; f.v.menu = t894;
		f.v._k50 = e.enumkeys ((f.v["this"]).options);
	},
	function (e,f) {
		f.pc=4;
		if (!((f.v._k50).length)) f.pc=3;
	},
	function (e,f) {
		f.pc=5;
		e.smcall (1, popupmenu,"run", ([f.v.menu]));
	},
	function (e,f) {
		f.pc=2;
		f.v._i51 = (f.v._k50).shift();
		f.v.opt = ((f.v["this"]).options)[(f.v._i51)];
		e.mcall (4, f.v.menu, "add_item", ([(f.v.opt).name, (f.v.opt).label]));
	},
/*5*/	function (e,f) {
		var t899 = f.s[0]; f.v.choice = t899;
		if (((f.v.choice)) !== ((null))) f.pc=6; else f.pc=-1;
	},
	function (e,f) { e.mcall (3, f.v["this"], "set_value", ([f.v.choice])); },
null	];

;
};
form_element_enum_base.init_methods (form_element_enum_base);
rpcclass.setup_class (form_element_enum_base, "form_element_enum_base",0, (["options","form","fielddef","raw_value","change_timer_handle","listeners"]), ([0,0,0,0,0,2]));
function form_element_enum () { this.do_construct (arguments); }
form_element_enum.init_methods = function (c) {
	form_element_enum_base.init_methods(c);
	var cp = c.prototype;
	c.pargs__init_helper =  [];
	c.pinst__init_helper =  [
/*0*/	function (e,f) { if (builtin__is_object (((f.v["this"]).fielddef).options)) f.pc=1; else f.pc=5; },
	function (e,f) {
		f.v.newopts = ([]);
		f.v._k52 = e.enumkeys (((f.v["this"]).fielddef).options);
	},
	function (e,f) {
		f.pc=4;
		if (!((f.v._k52).length)) f.pc=3;
	},
	function (e,f) {
		f.pc=-1;
		f.v["this"].options = f.v.newopts;
	},
	function (e,f) {
		f.pc=2;
		f.v.key = (f.v._k52).shift();
		f.v.value = (((f.v["this"]).fielddef).options)[(f.v.key)];
		f.v.value.name = f.v.key;
		f.v.newopts[f.v.newopts.length] = f.v.value;
	},
/*5*/	function (e,f) { f.v["this"].options = ((f.v["this"]).fielddef).options; },
null	];

;
};
form_element_enum.init_methods (form_element_enum);
rpcclass.setup_class (form_element_enum, "form_element_enum",0, (["options","form","fielddef","raw_value","change_timer_handle","listeners"]), ([0,0,0,0,0,2]));
function form_element_yesno () { this.do_construct (arguments); }
form_element_yesno.init_methods = function (c) {
	form_element_enum_base.init_methods(c);
	var cp = c.prototype;
	c.pargs__init_helper =  [];
	c.pinst__init_helper =  [
/*0*/	function (e,f) { f.v["this"].options = ([({name:"1", label:"Yes"}), ({name:"0", label:"No"})]); },
null	];

;
};
form_element_yesno.init_methods (form_element_yesno);
rpcclass.setup_class (form_element_yesno, "form_element_yesno",0, (["options","form","fielddef","raw_value","change_timer_handle","listeners"]), ([0,0,0,0,0,2]));
function form_element_button () { this.do_construct (arguments); }
form_element_button.init_methods = function (c) {
	form_element.init_methods(c);
	var cp = c.prototype;
	c.pargs__clicked =  ["el","arg","ev"];
	c.pinst__clicked =  [
/*0*/	function (e,f) { if ((((f.v["this"]).fielddef).arg) !== undefined) f.pc=1; else f.pc=2; },
	function (e,f) {
		f.pc=3;
		f.s[0] = ((f.v["this"]).fielddef).arg;
	},
	function (e,f) { f.s[0] = null; },
	function (e,f) {
		var t910 = f.s[0]; f.v.arg = t910;
		e.mcall (4, (f.v["this"]).form, "clicked", ([((f.v["this"]).fielddef).action, f.v.arg]));
	},
null	];

;
	c.pargs__render_button =  [];
	c.pinst__render_button =  [
/*0*/	function (e,f) {
		f.s[0] = ("\" type=\"button\" style=\"width:60px\" value=\"") + ("" + (((f.v["this"]).fielddef).label) + ("\""));
		e.mcall (3, f.v["this"], "get_id", ([]));
	},
	function (e,f) {
		var t911 = f.s[1]; var t912 = f.s[0]; 
		window.__outbuffer += ("<input id=\"button-") + ("" + (t911) + (t912));
		f.s[0] = "\"";
		e.mcall (5, f.v["this"], "render_start", (["clicked", null]));
	},
	function (e,f) {
		f.pc=4;
		var t913 = f.s[1]; var t914 = f.s[0]; 
		window.__outbuffer += (" onclick=\"") + ("" + (t913) + (t914));
		e.mcall (2, f.v["this"], "is_enabled", ([]));
	},
	function (e,f) {
		f.pc=5;
		window.__outbuffer += " disabled=\"true\"";
	},
	function (e,f) {
		var t915 = f.s[0]; 
		if (!(t915)) f.pc=3; else f.pc=5;
	},
/*5*/	function (e,f) { window.__outbuffer += " />"; },
null	];

;
	c.pargs__check_enable =  [];
	c.pinst__check_enable =  [
/*0*/	function (e,f) { e.mcall (2, f.v["this"], "get_id", ([])); },
	function (e,f) {
		var t916 = f.s[0]; 
		e.mcall (3, document, "getElementById", ([("button-") + (t916)]));
	},
	function (e,f) {
		f.pc=5;
		var t918 = f.s[0]; f.v.el = t918;
		e.mcall (2, f.v["this"], "is_enabled", ([]));
	},
	function (e,f) {
		f.pc=6;
		f.s[0] = false;
	},
	function (e,f) {
		f.pc=6;
		f.s[0] = true;
	},
/*5*/	function (e,f) { var t919 = f.s[0]; if (t919) f.pc=3; else f.pc=4; },
	function (e,f) { var t921 = f.s[0]; f.v.el.disabled = t921; },
null	];

;
};
form_element_button.init_methods (form_element_button);
rpcclass.setup_class (form_element_button, "form_element_button",0, (["form","fielddef","raw_value","change_timer_handle","listeners"]), ([0,0,0,0,2]));
function form_element_cancel () { this.do_construct (arguments); }
form_element_cancel.init_methods = function (c) {
	form_element_button.init_methods(c);
	var cp = c.prototype;
	c.pargs__init_helper =  [];
	c.pinst__init_helper =  [
/*0*/	function (e,f) {
		(f.v["this"]).fielddef.label = "Cancel";
		(f.v["this"]).fielddef.action = "cancel";
	},
null	];

;
};
form_element_cancel.init_methods (form_element_cancel);
rpcclass.setup_class (form_element_cancel, "form_element_cancel",0, (["form","fielddef","raw_value","change_timer_handle","listeners"]), ([0,0,0,0,2]));
function form_element_ok () { this.do_construct (arguments); }
form_element_ok.init_methods = function (c) {
	form_element.init_methods(c);
	var cp = c.prototype;
	c.pargs__render_button =  [];
	c.pinst__render_button =  [
/*0*/	function (e,f) {
		f.s[0] = "\" type=\"submit\" style=\"width:60px\" value=\"Ok\"";
		e.mcall (3, f.v["this"], "get_id", ([]));
	},
	function (e,f) {
		f.pc=3;
		var t924 = f.s[1]; var t925 = f.s[0]; 
		window.__outbuffer += ("<input id=\"button-") + ("" + (t924) + (t925));
		e.mcall (2, (f.v["this"]).form, "form_valid", ([]));
	},
	function (e,f) {
		f.pc=4;
		window.__outbuffer += "disabled=\"true\"";
	},
	function (e,f) {
		var t926 = f.s[0]; 
		if (!(t926)) f.pc=2; else f.pc=4;
	},
	function (e,f) { window.__outbuffer += " />"; },
null	];

;
	c.pargs__check_enable =  [];
	c.pinst__check_enable =  [
/*0*/	function (e,f) { e.mcall (2, f.v["this"], "get_id", ([])); },
	function (e,f) {
		var t927 = f.s[0]; 
		e.mcall (3, document, "getElementById", ([("button-") + (t927)]));
	},
	function (e,f) {
		f.pc=5;
		var t929 = f.s[0]; f.v.el = t929;
		e.mcall (2, (f.v["this"]).form, "form_valid", ([]));
	},
	function (e,f) {
		f.pc=6;
		f.s[0] = false;
	},
	function (e,f) {
		f.pc=6;
		f.s[0] = true;
	},
/*5*/	function (e,f) { var t930 = f.s[0]; if (t930) f.pc=3; else f.pc=4; },
	function (e,f) { var t932 = f.s[0]; f.v.el.disabled = t932; },
null	];

;
};
form_element_ok.init_methods (form_element_ok);
rpcclass.setup_class (form_element_ok, "form_element_ok",0, (["form","fielddef","raw_value","change_timer_handle","listeners"]), ([0,0,0,0,2]));
function form_element_array_element () { this.do_construct (arguments); }
form_element_array_element.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
};
form_element_array_element.init_methods (form_element_array_element);
rpcclass.setup_class (form_element_array_element, "form_element_array_element",0, (["element","listeners"]), ([0,2]));
function form_element_array () { this.do_construct (arguments); }
form_element_array.init_methods = function (c) {
	form_element_line_base.init_methods(c);
	var cp = c.prototype;
	c.pargs__init_helper =  [];
	c.pinst__init_helper =  [
/*0*/	function (e,f) { if ((((f.v["this"]).raw_value)) === ((""))) f.pc=1; else f.pc=-1; },
	function (e,f) { f.v["this"].raw_value = ([]); },
null	];

;
	c.pargs__get_all_rows =  [];
	c.pinst__get_all_rows =  [
/*0*/	function (e,f) {
		f.v.res = ([]);
		e.mcall (2, (f.v["this"]).dtm, "get_rows", ([]));
	},
	function (e,f) {
		var t936 = f.s[0]; f.v.ids = t936;
		f.v._k54 = e.enumkeys (f.v.ids);
	},
	function (e,f) {
		f.pc=4;
		if (!((f.v._k54).length)) f.pc=3;
	},
	function (e,f) { e.return_pop (f.v.res); },
	function (e,f) {
		f.v._i55 = (f.v._k54).shift();
		f.v.id = (f.v.ids)[(f.v._i55)];
		e.smcall (2, rpcclass,"get_object_by_id", (["form_element_array_element", f.v.id]));
	},
/*5*/	function (e,f) {
		f.pc=2;
		var t941 = f.s[0]; f.v.cf = t941;
		f.v.res[f.v.res.length] = (f.v.cf).element;
	},
null	];

;
	c.pargs__change_indication =  [];
	c.pinst__change_indication =  [
/*0*/	function (e,f) { /* This is a NOP */ },
null	];

;
	c.pargs__changed =  [];
	c.pinst__changed =  [
/*0*/	function (e,f) { e.mcall (2, f.v["this"], "get_all_rows", ([])); },
	function (e,f) {
		var t944 = f.s[0]; f.v["this"].raw_value = t944;
		e.mcall (2, f.v["this"], "change_indication", ([]));
	},
null	];

;
	c.pargs__edit_element_link =  ["el","elobj","ev"];
	c.pinst__edit_element_link =  [
/*0*/	function (e,f) { e.mcall (3, f.v["this"], "edit_element", ([(f.v.elobj).element])); },
	function (e,f) {
		var t946 = f.s[0]; f.v.newval = t946;
		if (((f.v.newval)) !== ((null))) f.pc=2; else f.pc=-1;
	},
	function (e,f) {
		f.v.elobj.element = f.v.newval;
		e.mcall (3, (f.v["this"]).dtm, "rerender_row", ([f.v.elobj]));
	},
	function (e,f) { e.mcall (2, f.v["this"], "changed", ([])); },
null	];

;
	c.pargs__get_elobj =  ["obj"];
	c.pinst__get_elobj =  [
/*0*/	function (e,f) { e.mcall (2, (f.v["this"]).dtm, "get_rows", ([])); },
	function (e,f) {
		var t949 = f.s[0]; f.v.ids = t949;
		f.v._k56 = e.enumkeys (f.v.ids);
	},
	function (e,f) {
		f.pc=4;
		if (!((f.v._k56).length)) f.pc=3;
	},
	function (e,f) { e.return_pop (null); },
	function (e,f) {
		f.v._i57 = (f.v._k56).shift();
		f.v.id = (f.v.ids)[(f.v._i57)];
		e.smcall (2, rpcclass,"get_object_by_id", (["form_element_array_element", f.v.id]));
	},
/*5*/	function (e,f) {
		var t954 = f.s[0]; f.v.cf = t954;
		if ((((f.v.cf).element)) == ((f.v.obj))) f.pc=6; else f.pc=2;
	},
	function (e,f) { e.return_pop (f.v.cf); },
null	];

;
	c.pargs__rerender_row =  ["obj"];
	c.pinst__rerender_row =  [
/*0*/	function (e,f) { e.mcall (3, f.v["this"], "get_elobj", ([f.v.obj])); },
	function (e,f) {
		var t956 = f.s[0]; f.v.elobj = t956;
		if (((f.v.elobj)) !== ((null))) f.pc=2; else f.pc=-1;
	},
	function (e,f) { e.mcall (3, (f.v["this"]).dtm, "rerender_row", ([f.v.elobj])); },
null	];

;
	c.pargs__delete_element =  ["obj"];
	c.pinst__delete_element =  [
/*0*/	function (e,f) { e.mcall (3, f.v["this"], "get_elobj", ([f.v.obj])); },
	function (e,f) {
		var t958 = f.s[0]; f.v.elobj = t958;
		if (((f.v.elobj)) !== ((null))) f.pc=2; else f.pc=-1;
	},
	function (e,f) { e.mcall (3, (f.v["this"]).dtm, "remove_row", ([f.v.elobj])); },
	function (e,f) { e.mcall (2, f.v["this"], "changed", ([])); },
null	];

;
	c.pargs__delete_element_link =  ["el","elobj","ev"];
	c.pinst__delete_element_link =  [
/*0*/	function (e,f) {
		f.pc=3;
		e.smcall (1, popupokcancel,"run", (["Delete row?"]));
	},
	function (e,f) { e.mcall (3, (f.v["this"]).dtm, "remove_row", ([f.v.elobj])); },
	function (e,f) {
		f.pc=-1;
		e.mcall (2, f.v["this"], "changed", ([]));
	},
	function (e,f) { var t959 = f.s[0]; if (t959) f.pc=1; else f.pc=-1; },
null	];

;
	c.pargs__insert_row =  [];
	c.pinst__insert_row =  [
/*0*/	function (e,f) { e.mcall (2, f.v["this"], "create_element", ([])); },
	function (e,f) {
		var t961 = f.s[0]; f.v.data = t961;
		if (((f.v.data)) !== ((null))) f.pc=2; else f.pc=-1;
	},
	function (e,f) {
		f.v.elobj = new form_element_array_element;
		f.v.elobj.element = f.v.data;
		e.mcall (3, (f.v["this"]).dtm, "append_row", ([f.v.elobj]));
	},
	function (e,f) { e.mcall (2, f.v["this"], "changed", ([])); },
null	];

;
	c.pargs__new_name =  [];
	c.pinst__new_name =  [
/*0*/	function (e,f) { if (builtin__method_exists (f.v["this"],"create_element")) f.pc=1; else f.pc=2; },
	function (e,f) { e.return_pop ("Add new"); },
	function (e,f) { e.return_pop (""); },
null	];

;
	c.pargs__reorder =  ["neworder"];
	c.pinst__reorder =  [
/*0*/	function (e,f) { e.mcall (2, f.v["this"], "changed", ([])); },
null	];

;
	c.pargs__dragstart =  ["el","elobj","ev"];
	c.pinst__dragstart =  [
/*0*/	function (e,f) { e.mcall (4, (f.v["this"]).dtm, "drag_start", ([f.v.ev, f.v.elobj])); },
	function (e,f) { var t964 = f.s[0]; e.return_pop (t964); },
null	];

;
	c.pargs__can_delete_element =  [];
	c.pinst__can_delete_element =  [
/*0*/	function (e,f) { e.return_pop (true); },
null	];

;
	c.pargs__can_delete_this_element =  ["el"];
	c.pinst__can_delete_this_element =  [
/*0*/	function (e,f) { e.return_pop (true); },
null	];

;
	c.pargs__get_row_fields =  ["elobj"];
	c.pinst__get_row_fields =  [
/*0*/	function (e,f) {
		f.v.res = ([]);
		if (builtin__method_exists (f.v["this"],"drag_image")) f.pc=1; else f.pc=4;
	},
	function (e,f) { e.mcall (2, f.v["this"], "drag_image", ([])); },
	function (e,f) {
		var t967 = f.s[0]; f.v.img = t967;
		f.s[0] = ("\" src=\"") + ("" + (f.v.img) + ("\"/>"));
		e.mcall (5, f.v["this"], "render_start", (["dragstart", f.v.elobj]));
	},
	function (e,f) {
		var t968 = f.s[1]; var t969 = f.s[0]; 
		f.v.res[f.v.res.length] = ("<img ondragstart=\"return false\" onmousedown=\"") + ("" + (t968) + (t969));
	},
	function (e,f) { e.mcall (3, f.v["this"], "row_fields", ([(f.v.elobj).element])); },
/*5*/	function (e,f) {
		var t972 = f.s[0]; f.v.rfields = t972;
		f.v._k58 = e.enumkeys (f.v.rfields);
	},
	function (e,f) {
		f.pc=8;
		if (!((f.v._k58).length)) f.pc=7;
	},
	function (e,f) { if (builtin__method_exists (f.v["this"],"edit_element")) f.pc=9; else f.pc=11; },
	function (e,f) {
		f.pc=6;
		f.s[0] = f.v._i59 = (f.v._k58).shift();
		f.s[1] = f.v.rf = (f.v.rfields)[(f.v._i59)];
		f.v.res[f.v.res.length] = f.v.rf;
	},
	function (e,f) {
		f.s[0] = "\">edit</a>";
		e.mcall (5, f.v["this"], "render_start", (["edit_element_link", f.v.elobj]));
	},
/*10*/	function (e,f) {
		var t977 = f.s[1]; var t978 = f.s[0]; 
		f.v.res[f.v.res.length] = ("<a href=\"#\" onclick=\"") + ("" + (t977) + (t978));
	},
	function (e,f) {
		f.pc=17;
		e.mcall (2, f.v["this"], "can_delete_element", ([]));
	},
	function (e,f) {
		f.pc=16;
		e.mcall (3, f.v["this"], "can_delete_this_element", ([(f.v.elobj).element]));
	},
	function (e,f) {
		f.s[0] = "\">delete</a>";
		e.mcall (5, f.v["this"], "render_start", (["delete_element_link", f.v.elobj]));
	},
	function (e,f) {
		f.pc=18;
		var t980 = f.s[1]; var t981 = f.s[0]; 
		f.v.res[f.v.res.length] = ("<a href=\"#\" onclick=\"") + ("" + (t980) + (t981));
	},
/*15*/	function (e,f) {
		f.pc=18;
		f.v.res[f.v.res.length] = "";
	},
	function (e,f) { var t984 = f.s[0]; if (t984) f.pc=13; else f.pc=15; },
	function (e,f) { var t985 = f.s[0]; if (t985) f.pc=12; else f.pc=18; },
	function (e,f) { e.return_pop (f.v.res); },
null	];

;
	c.pargs__render =  [];
	c.pinst__render =  [
/*0*/	function (e,f) {
		f.v.optobjs = ([]);
		f.v._k60 = e.enumkeys ((f.v["this"]).raw_value);
	},
	function (e,f) {
		f.pc=3;
		if (!((f.v._k60).length)) f.pc=2;
	},
	function (e,f) { if (((((f.v["this"]).form).form_mode)) == ((1))) f.pc=22; else f.pc=23; },
	function (e,f) {
		f.pc=1;
		f.v._i61 = (f.v._k60).shift();
		f.v.opt = ((f.v["this"]).raw_value)[(f.v._i61)];
		f.v.optobj = new form_element_array_element;
		f.v.optobj.element = f.v.opt;
		f.v.optobjs[f.v.optobjs.length] = f.v.optobj;
	},
	function (e,f) {
		f.v["this"].dtm = new divTableManager;
		e.mcall (2, f.v["this"], "table_widths", ([]));
	},
/*5*/	function (e,f) { var t994 = f.s[0]; e.mcall (4, (f.v["this"]).dtm, "initialise2", ([f.v["this"], t994])); },
	function (e,f) {
		f.s[0] = builtin__ob_start ();
		e.mcall (3, (f.v["this"]).dtm, "render_table", ([f.v.optobjs]));
	},
	function (e,f) {
		f.pc=-1;
		f.v.body = builtin__ob_get_clean ();
		e.mcall (7, f.v["this"], "render_line_element_helper", (["", "div", ([]), f.v.body, null]));
	},
	function (e,f) { if (((((f.v["this"]).form).form_mode)) == ((0))) f.pc=9; else f.pc=-1; },
	function (e,f) {
		f.s[0] = builtin__ob_start ();
		window.__outbuffer += "<table>";
		f.v._k62 = e.enumkeys (f.v.optobjs);
	},
/*10*/	function (e,f) {
		f.pc=12;
		if (!((f.v._k62).length)) f.pc=11;
	},
	function (e,f) {
		f.pc=-1;
		window.__outbuffer += "</table>";
		f.v.body = builtin__ob_get_clean ();
		e.mcall (7, f.v["this"], "render_line_element_helper", (["", "div", ([]), f.v.body, null]));
	},
	function (e,f) {
		f.v._i63 = (f.v._k62).shift();
		f.v.o = (f.v.optobjs)[(f.v._i63)];
		e.mcall (3, f.v["this"], "get_row_fields", ([f.v.o]));
	},
	function (e,f) {
		var t1001 = f.s[0]; f.v.fields = t1001;
		window.__outbuffer += "<tr>";
		f.v.i = 0;
	},
	function (e,f) {
		f.pc=16;
		if (!(((f.v.i)) < ((parseInt((builtin__count (f.v.fields)),10) - parseInt((2),10))))) f.pc=15;
	},
/*15*/	function (e,f) {
		f.pc=10;
		window.__outbuffer += "</tr>";
	},
	function (e,f) { if (((f.v.i)) != ((0))) f.pc=18; else f.pc=19; },
	function (e,f) {
		f.pc=21;
		window.__outbuffer += ("<td>") + ("" + ((f.v.fields)[(f.v.i)]) + ("</td>"));
	},
	function (e,f) {
		f.pc=20;
		f.s[0] = true;
	},
	function (e,f) { f.s[0] = !(builtin__method_exists (f.v["this"],"drag_image")); },
/*20*/	function (e,f) { var t1003 = f.s[0]; if (t1003) f.pc=17; else f.pc=21; },
	function (e,f) {
		f.pc=14;
		e.php_push_var_lvalue (0, "i");
		e.php_postinc (1);
	},
	function (e,f) {
		f.pc=24;
		f.s[0] = true;
	},
	function (e,f) { f.s[0] = ((((f.v["this"]).form).form_mode)) == ((2)); },
	function (e,f) { var t1005 = f.s[0]; if (t1005) f.pc=4; else f.pc=8; },
null	];

;
};
form_element_array.init_methods (form_element_array);
rpcclass.setup_class (form_element_array, "form_element_array",0, (["dtm","form","fielddef","raw_value","change_timer_handle","listeners"]), ([0,0,0,0,0,2]));
function form () { this.do_construct (arguments); }
form.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
	c.args__create = c.pargs__create =  ["parent","fields","values"];
	c.inst__create = c.pinst__create =  [
/*0*/	function (e,f) {
		f.v.res = new form;
		f.v.res.elements = ([]);
		f.v.res.parent = f.v.parent;
		f.v.res.tid = null;
		f.v.res.enforce_validity = true;
		f.v.res.focusfield = null;
		f.v.res.env = ({ignore_me:"1"});
		f.v.res.last_click_arg = null;
		f.v._k64 = e.enumkeys (f.v.fields);
	},
	function (e,f) {
		f.pc=3;
		if (!((f.v._k64).length)) f.pc=2;
	},
	function (e,f) { e.return_pop (f.v.res); },
	function (e,f) {
		f.s[0] = f.v._i65 = (f.v._k64).shift();
		f.s[1] = f.v.fielddef = (f.v.fields)[(f.v._i65)];
		e.smcall (5, form_element,"create", ([f.v.res, f.v.fielddef, f.v.values]));
	},
	function (e,f) {
		f.pc=1;
		var t1018 = f.s[2]; (f.v.res).elements[(f.v.res).elements.length] = t1018;
	},
null	];

;
	c.pargs__set_env =  ["key","value"];
	c.pinst__set_env =  [
/*0*/	function (e,f) { (f.v["this"]).env[f.v.key] = f.v.value; },
null	];

;
	c.pargs__get_env =  ["key"];
	c.pinst__get_env =  [
/*0*/	function (e,f) { if (!((((f.v["this"]).env)[(f.v.key)]) !== undefined)) f.pc=1; else f.pc=2; },
	function (e,f) { e.return_pop (null); },
	function (e,f) { e.return_pop (((f.v["this"]).env)[(f.v.key)]); },
null	];

;
	c.pargs__get_last_click_arg =  [];
	c.pinst__get_last_click_arg =  [
/*0*/	function (e,f) { e.return_pop ((f.v["this"]).last_click_arg); },
null	];

;
	c.pargs__focus =  ["index"];
	c.pinst__focus =  [
/*0*/	function (e,f) { f.v["this"].focusfield = ((f.v["this"]).elements)[(f.v.index)]; },
null	];

;
	c.pargs__can_be_invalid =  ["yesno"];
	c.pinst__can_be_invalid =  [
/*0*/	function (e,f) { f.v["this"].enforce_validity = !(f.v.yesno); },
null	];

;
	c.pargs__clicked =  ["action","arg"];
	c.pinst__clicked =  [
/*0*/	function (e,f) {
		f.v["this"].last_click_arg = f.v.arg;
		if ((((f.v["this"]).parent)) !== ((null))) f.pc=2; else f.pc=3;
	},
	function (e,f) {
		f.pc=5;
		e.mcall (3, (f.v["this"]).parent, "clicked", ([f.v.action]));
	},
	function (e,f) {
		f.pc=4;
		f.s[0] = builtin__method_exists ((f.v["this"]).parent,"clicked");
	},
	function (e,f) { f.s[0] = false; },
	function (e,f) { var t1023 = f.s[0]; if (t1023) f.pc=1; else f.pc=5; },
/*5*/	function (e,f) { if ((((f.v["this"]).tid)) !== ((null))) f.pc=6; else f.pc=-1; },
	function (e,f) { e.smcall (3, php_engine,"resume_thread", ([(f.v["this"]).tid, f.v.action, null])); },
null	];

;
	c.pargs__check_enable =  [];
	c.pinst__check_enable =  [
/*0*/	function (e,f) { f.v._k66 = e.enumkeys ((f.v["this"]).elements); },
	function (e,f) { if (!((f.v._k66).length)) f.pc=-1; },
	function (e,f) {
		f.pc=1;
		f.s[0] = f.v._i67 = (f.v._k66).shift();
		f.s[1] = f.v.el = ((f.v["this"]).elements)[(f.v._i67)];
		e.mcall (4, f.v.el, "check_enable", ([]));
	},
null	];

;
	c.pargs__changed =  ["fname","value"];
	c.pinst__changed =  [
/*0*/	function (e,f) { if ((((f.v["this"]).parent)) !== ((null))) f.pc=2; else f.pc=3; },
	function (e,f) {
		f.pc=5;
		e.mcall (4, (f.v["this"]).parent, "form_changed", ([f.v.fname, f.v.value]));
	},
	function (e,f) {
		f.pc=4;
		f.s[0] = builtin__method_exists ((f.v["this"]).parent,"form_changed");
	},
	function (e,f) { f.s[0] = false; },
	function (e,f) { var t1027 = f.s[0]; if (t1027) f.pc=1; else f.pc=5; },
/*5*/	function (e,f) { e.mcall (2, f.v["this"], "check_enable", ([])); },
null	];

;
	c.pargs__ok_clicked =  [];
	c.pinst__ok_clicked =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "clicked", (["OK", null])); },
null	];

;
	c.pargs__is_enabled =  ["expr"];
	c.pinst__is_enabled =  [
/*0*/	function (e,f) { e.smcall (1, form_condition,"parse", ([f.v.expr])); },
	function (e,f) {
		var t1029 = f.s[0]; f.v.fe = t1029;
		e.mcall (3, f.v.fe, "evaluate", ([f.v["this"]]));
	},
	function (e,f) {
		var t1031 = f.s[0]; f.v.result = t1031;
		e.return_pop (f.v.result);
	},
null	];

;
	c.pargs__render =  ["form_mode"];
	c.pinst__render =  [
/*0*/	function (e,f) {
		f.v["this"].form_mode = f.v.form_mode;
		if ((((f.v["this"]).form_mode)) == ((1))) f.pc=1; else f.pc=4;
	},
	function (e,f) {
		f.s[0] = "\">";
		e.mcall (5, f.v["this"], "render_start", (["ok_clicked", null]));
	},
	function (e,f) {
		var t1033 = f.s[1]; var t1034 = f.s[0]; 
		f.s[0] = ("-form\" onsubmit=\"") + ("" + (t1033) + (t1034));
		e.mcall (3, f.v["this"], "get_id", ([]));
	},
	function (e,f) {
		var t1035 = f.s[1]; var t1036 = f.s[0]; 
		window.__outbuffer += ("<form id=\"data-") + ("" + (t1035) + (t1036));
	},
	function (e,f) {
		window.__outbuffer += "<table>";
		f.v._k68 = e.enumkeys ((f.v["this"]).elements);
	},
/*5*/	function (e,f) {
		f.pc=7;
		if (!((f.v._k68).length)) f.pc=6;
	},
	function (e,f) {
		f.pc=8;
		window.__outbuffer += "<tr><td></td><td style=\"text-align:right\">";
		f.v._k70 = e.enumkeys ((f.v["this"]).elements);
	},
	function (e,f) {
		f.pc=5;
		f.v._i69 = (f.v._k68).shift();
		f.v.el = ((f.v["this"]).elements)[(f.v._i69)];
		e.mcall (2, f.v.el, "render", ([]));
	},
	function (e,f) {
		f.pc=10;
		if (!((f.v._k70).length)) f.pc=9;
	},
	function (e,f) {
		window.__outbuffer += "</td></tr>";
		window.__outbuffer += "</table>";
		if ((((f.v["this"]).form_mode)) == ((1))) f.pc=11; else f.pc=-1;
	},
/*10*/	function (e,f) {
		f.pc=8;
		f.s[0] = f.v._i71 = (f.v._k70).shift();
		f.s[1] = f.v.el = ((f.v["this"]).elements)[(f.v._i71)];
		e.mcall (4, f.v.el, "render_button", ([]));
	},
	function (e,f) { window.__outbuffer += "</form>"; },
null	];

;
	c.args__entities = c.pargs__entities =  ["str"];
	c.inst__entities = c.pinst__entities =  [
/*0*/	function (e,f) {
		f.v.str = ("") + (f.v.str);
		f.v.res = "";
		f.v.str = ("") + (f.v.str);
		f.v.i = 0;
	},
	function (e,f) {
		f.pc=3;
		if (!(((f.v.i)) < (((f.v.str).length)))) f.pc=2;
	},
	function (e,f) { e.return_pop (f.v.res); },
	function (e,f) {
		f.v.ch = builtin__substr (f.v.str,f.v.i,1);
		if (!(builtin__preg_match ("/[A-Za-z0-9 ]/",f.v.ch))) f.pc=4; else f.pc=5;
	},
	function (e,f) {
		f.pc=6;
		f.v.res = "" + (f.v.res) + (("&#") + ("" + (builtin__ord (f.v.ch)) + (";")));
	},
/*5*/	function (e,f) { f.v.res = "" + (f.v.res) + (f.v.ch); },
	function (e,f) {
		f.pc=1;
		e.php_push_var_lvalue (0, "i");
		e.php_postinc (1);
	},
null	];

;
	c.pargs__initialise =  ["width","height","title"];
	c.pinst__initialise =  [
/*0*/	function (e,f) {
		f.v["this"].title = f.v.title;
		f.v["this"].width = f.v.width;
		f.v["this"].height = f.v.height;
		f.v["this"].pop = new popup;
		e.mcall (3, (f.v["this"]).pop, "initialise", ([f.v["this"]]));
	},
null	];

;
	c.pargs__open =  [];
	c.pinst__open =  [
/*0*/	function (e,f) {
		f.s[0] = builtin__ob_start ();
		window.__outbuffer += ("<h3>") + ("" + ((f.v["this"]).title) + ("</h3>"));
		e.mcall (3, f.v["this"], "render", ([1]));
	},
	function (e,f) {
		f.v.html = builtin__ob_get_clean ();
		e.mcall (5, (f.v["this"]).pop, "open", ([(f.v["this"]).width, (f.v["this"]).height, f.v.html]));
	},
	function (e,f) { if ((((f.v["this"]).focusfield)) != ((null))) f.pc=3; else f.pc=-1; },
	function (e,f) { e.mcall (2, (f.v["this"]).focusfield, "focus", ([])); },
null	];

;
	c.pargs__close =  [];
	c.pinst__close =  [
/*0*/	function (e,f) { e.mcall (2, (f.v["this"]).pop, "close", ([])); },
null	];

;
	c.pargs__form_valid =  [];
	c.pinst__form_valid =  [
/*0*/	function (e,f) { if (!((f.v["this"]).enforce_validity)) f.pc=1; else f.pc=2; },
	function (e,f) { e.return_pop (true); },
	function (e,f) { f.v._k72 = e.enumkeys ((f.v["this"]).elements); },
	function (e,f) {
		f.pc=5;
		if (!((f.v._k72).length)) f.pc=4;
	},
	function (e,f) { e.return_pop (true); },
/*5*/	function (e,f) {
		f.pc=7;
		f.v._i73 = (f.v._k72).shift();
		f.v.el = ((f.v["this"]).elements)[(f.v._i73)];
		e.mcall (2, f.v.el, "value_legal", ([]));
	},
	function (e,f) { e.return_pop (false); },
	function (e,f) {
		var t1059 = f.s[0]; 
		if (!(t1059)) f.pc=6; else f.pc=3;
	},
null	];

;
	c.pargs__get_element =  ["name"];
	c.pinst__get_element =  [
/*0*/	function (e,f) { f.v._k74 = e.enumkeys ((f.v["this"]).elements); },
	function (e,f) {
		f.pc=3;
		if (!((f.v._k74).length)) f.pc=2;
	},
	function (e,f) { e.return_pop (null); },
	function (e,f) {
		f.s[0] = f.v._i75 = (f.v._k74).shift();
		f.s[1] = f.v.el = ((f.v["this"]).elements)[(f.v._i75)];
		if (((((f.v.el).fielddef).name)) == ((f.v.name))) f.pc=4; else f.pc=1;
	},
	function (e,f) { e.return_pop (f.v.el); },
null	];

;
	c.pargs__get_values =  [];
	c.pinst__get_values =  [
/*0*/	function (e,f) {
		f.v.res = ({});
		f.v._k76 = e.enumkeys ((f.v["this"]).elements);
	},
	function (e,f) {
		f.pc=3;
		if (!((f.v._k76).length)) f.pc=2;
	},
	function (e,f) { e.return_pop (f.v.res); },
	function (e,f) {
		f.pc=5;
		f.v._i77 = (f.v._k76).shift();
		f.v.el = ((f.v["this"]).elements)[(f.v._i77)];
		e.mcall (2, f.v.el, "is_enabled", ([]));
	},
	function (e,f) {
		f.pc=1;
		f.v.res[((f.v.el).fielddef).name] = (f.v.el).raw_value;
	},
/*5*/	function (e,f) { var t1068 = f.s[0]; if (t1068) f.pc=4; else f.pc=1; },
null	];

;
	c.pargs__popup =  ["width","height","title"];
	c.pinst__popup =  [
/*0*/	function (e,f) { e.mcall (5, f.v["this"], "initialise", ([f.v.width, f.v.height, f.v.title])); },
	function (e,f) { e.mcall (2, f.v["this"], "open", ([])); },
	function (e,f) { e.smcall (0, php_engine,"get_current_thread_id", ([])); },
	function (e,f) {
		var t1070 = f.s[0]; f.v["this"].tid = t1070;
		f.v.res = null;
	},
	function (e,f) {
		f.pc=6;
		e.php_builtin (0, "wait_for_input", 0);
	},
/*5*/	function (e,f) {
		f.pc=13;
		e.mcall (2, f.v["this"], "close", ([]));
	},
	function (e,f) {
		var t1073 = f.s[0]; f.v.ev = t1073;
		if ((((f.v.ev).action)) == (("OK"))) f.pc=7; else f.pc=11;
	},
	function (e,f) {
		f.pc=10;
		e.mcall (2, f.v["this"], "form_valid", ([]));
	},
	function (e,f) { e.mcall (2, f.v["this"], "get_values", ([])); },
	function (e,f) {
		f.pc=5;
		var t1075 = f.s[0]; f.v.res = t1075;
	},
/*10*/	function (e,f) { var t1076 = f.s[0]; if (t1076) f.pc=8; else f.pc=4; },
	function (e,f) { if ((((f.v.ev).action)) == (("cancel"))) f.pc=12; else f.pc=4; },
	function (e,f) { f.pc=5; },
	function (e,f) {
		f.v["this"].tid = null;
		e.return_pop (f.v.res);
	},
null	];

;
};
form.init_methods (form);
rpcclass.setup_class (form, "form",0, (["parent","elements","focusfield","pop","title","width","height","tid","enforce_validity","env","last_click_arg","form_mode","listeners"]), ([0,0,0,0,0,0,0,0,0,0,0,0,2]));
function form_condition () { this.do_construct (arguments); }
form_condition.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
	c.pargs__advance =  [];
	c.pinst__advance =  [
/*0*/	function (e,f) {
		f.v["this"].ch = builtin__substr ((f.v["this"]).expr,(f.v["this"]).pos,1);
		f.s[0] = "pos";
		f.s[1] = f.v["this"];
		e.php_deref_lvalue (2);
		e.php_postinc (1);
	},
null	];

;
	c.pargs__next_token =  [];
	c.pinst__next_token =  [
/*0*/	function (e,f) { if ((((f.v["this"]).ch)) == ((""))) f.pc=1; else f.pc=2; },
	function (e,f) {
		f.v["this"].tok = "";
		f.pc=-1;
	},
	function (e,f) {
		f.v.ops = "|&()!";
		if (builtin__strstr (f.v.ops,(f.v["this"]).ch)) f.pc=3; else f.pc=4;
	},
	function (e,f) {
		f.pc=-1;
		f.v["this"].tok = (f.v["this"]).ch;
		e.mcall (2, f.v["this"], "advance", ([]));
	},
	function (e,f) { f.v["this"].tok = ""; },
/*5*/	function (e,f) {
		f.v["this"].tok = "" + ((f.v["this"]).tok) + ((f.v["this"]).ch);
		e.mcall (2, f.v["this"], "advance", ([]));
	},
	function (e,f) { if ((((f.v["this"]).ch)) == ((""))) f.pc=7; else f.pc=8; },
	function (e,f) {
		f.pc=9;
		f.s[0] = true;
	},
	function (e,f) { f.s[0] = builtin__strstr (f.v.ops,(f.v["this"]).ch); },
	function (e,f) { var t1085 = f.s[0]; if (t1085) f.pc=-1; else f.pc=5; },
null	];

;
	c.pargs__parse_or =  [];
	c.pinst__parse_or =  [
/*0*/	function (e,f) { e.mcall (2, f.v["this"], "parse_and", ([])); },
	function (e,f) {
		var t1087 = f.s[0]; f.v.left = t1087;
		if ((((f.v["this"]).tok)) == (("|"))) f.pc=2; else f.pc=5;
	},
	function (e,f) { e.mcall (2, f.v["this"], "next_token", ([])); },
	function (e,f) { e.mcall (2, f.v["this"], "parse_or", ([])); },
	function (e,f) {
		var t1089 = f.s[0]; f.v.right = t1089;
		f.v.left = ({op:"|", args:([f.v.left, f.v.right])});
	},
/*5*/	function (e,f) { e.return_pop (f.v.left); },
null	];

;
	c.pargs__parse_and =  [];
	c.pinst__parse_and =  [
/*0*/	function (e,f) { e.mcall (2, f.v["this"], "parse_not", ([])); },
	function (e,f) {
		var t1092 = f.s[0]; f.v.left = t1092;
		if ((((f.v["this"]).tok)) == (("&"))) f.pc=2; else f.pc=5;
	},
	function (e,f) { e.mcall (2, f.v["this"], "next_token", ([])); },
	function (e,f) { e.mcall (2, f.v["this"], "parse_or", ([])); },
	function (e,f) {
		var t1094 = f.s[0]; f.v.right = t1094;
		f.v.left = ({op:"&", args:([f.v.left, f.v.right])});
	},
/*5*/	function (e,f) { e.return_pop (f.v.left); },
null	];

;
	c.pargs__parse_not =  [];
	c.pinst__parse_not =  [
/*0*/	function (e,f) { if ((((f.v["this"]).tok)) == (("!"))) f.pc=1; else f.pc=4; },
	function (e,f) { e.mcall (2, f.v["this"], "next_token", ([])); },
	function (e,f) { e.mcall (2, f.v["this"], "parse_not", ([])); },
	function (e,f) {
		var t1096 = f.s[0]; 
		e.return_pop (({op:"!", args:([t1096])}));
	},
	function (e,f) { e.mcall (2, f.v["this"], "parse_node", ([])); },
/*5*/	function (e,f) { var t1097 = f.s[0]; e.return_pop (t1097); },
null	];

;
	c.pargs__parse_node =  [];
	c.pinst__parse_node =  [
/*0*/	function (e,f) { if ((((f.v["this"]).tok)) == (("("))) f.pc=1; else f.pc=7; },
	function (e,f) { e.mcall (2, f.v["this"], "next_token", ([])); },
	function (e,f) { e.mcall (2, f.v["this"], "parse_or", ([])); },
	function (e,f) {
		var t1099 = f.s[0]; f.v.content = t1099;
		if ((((f.v["this"]).tok)) != ((")"))) f.pc=4; else f.pc=5;
	},
	function (e,f) {
		f.v["this"].error = true;
		e.return_pop (null);
	},
/*5*/	function (e,f) { e.mcall (2, f.v["this"], "next_token", ([])); },
	function (e,f) { e.return_pop (f.v.content); },
	function (e,f) {
		f.v.res = ({op:"node", text:(f.v["this"]).tok});
		e.mcall (2, f.v["this"], "next_token", ([]));
	},
	function (e,f) { e.return_pop (f.v.res); },
null	];

;
	c.pargs__dump =  ["indent","node"];
	c.pinst__dump =  [
/*0*/	function (e,f) {
		f.s[0] = builtin__debugout ("" + (builtin__str_pad ("",f.v.indent)) + ("" + ((f.v.node).op) + (": ")));
		if (((f.v.node).args) !== undefined) f.pc=1; else f.pc=4;
	},
	function (e,f) { f.v._k78 = e.enumkeys ((f.v.node).args); },
	function (e,f) { if (!((f.v._k78).length)) f.pc=-1; },
	function (e,f) {
		f.pc=2;
		f.s[0] = f.v._i79 = (f.v._k78).shift();
		f.s[1] = f.v.parm = ((f.v.node).args)[(f.v._i79)];
		e.mcall (6, f.v["this"], "dump", ([parseInt((f.v.indent),10) + parseInt((4),10), f.v.parm]));
	},
	function (e,f) { f.s[0] = builtin__debugout ("" + (builtin__str_pad ("",parseInt((f.v.indent),10) + parseInt((4),10))) + ((f.v.node).text)); },
null	];

;
	c.pargs__evaluate_node =  ["form","node"];
	c.pinst__evaluate_node =  [
/*0*/	function (e,f) { if ((((f.v.node).op)) == (("|"))) f.pc=1; else f.pc=7; },
	function (e,f) { f.v._k80 = e.enumkeys ((f.v.node).args); },
	function (e,f) {
		f.pc=4;
		if (!((f.v._k80).length)) f.pc=3;
	},
	function (e,f) { e.return_pop (false); },
	function (e,f) {
		f.pc=6;
		f.v._i81 = (f.v._k80).shift();
		f.v.parm = ((f.v.node).args)[(f.v._i81)];
		e.mcall (4, f.v["this"], "evaluate_node", ([f.v.form, f.v.parm]));
	},
/*5*/	function (e,f) { e.return_pop (true); },
	function (e,f) { var t1108 = f.s[0]; if (t1108) f.pc=5; else f.pc=2; },
	function (e,f) { if ((((f.v.node).op)) == (("&"))) f.pc=8; else f.pc=14; },
	function (e,f) { f.v._k82 = e.enumkeys ((f.v.node).args); },
	function (e,f) {
		f.pc=11;
		if (!((f.v._k82).length)) f.pc=10;
	},
/*10*/	function (e,f) { e.return_pop (true); },
	function (e,f) {
		f.pc=13;
		f.v._i83 = (f.v._k82).shift();
		f.v.parm = ((f.v.node).args)[(f.v._i83)];
		e.mcall (4, f.v["this"], "evaluate_node", ([f.v.form, f.v.parm]));
	},
	function (e,f) { e.return_pop (false); },
	function (e,f) {
		var t1112 = f.s[0]; 
		if (!(t1112)) f.pc=12; else f.pc=9;
	},
	function (e,f) { if ((((f.v.node).op)) == (("!"))) f.pc=15; else f.pc=17; },
/*15*/	function (e,f) { e.mcall (4, f.v["this"], "evaluate_node", ([f.v.form, ((f.v.node).args)[(0)]])); },
	function (e,f) {
		var t1113 = f.s[0]; 
		e.return_pop (!(t1113));
	},
	function (e,f) { if ((((f.v.node).op)) == (("node"))) f.pc=18; else f.pc=64; },
	function (e,f) {
		f.v.matches = ([]);
		if (builtin__preg_match ("/^([0-9a-zA-Z_]+)(.*)$/",(f.v.node).text,f.v.matches)) f.pc=19; else f.pc=63;
	},
	function (e,f) {
		f.v.key = (f.v.matches)[(1)];
		f.v.condition = (f.v.matches)[(2)];
		if (((f.v.key)) == (("1"))) f.pc=20; else f.pc=21;
	},
/*20*/	function (e,f) { e.return_pop (true); },
	function (e,f) { if (((f.v.key)) == (("0"))) f.pc=22; else f.pc=23; },
	function (e,f) { e.return_pop (false); },
	function (e,f) { if (((f.v.key)) == (("env"))) f.pc=24; else f.pc=27; },
	function (e,f) {
		f.v.condition = builtin__substr (f.v.condition,1);
		if (!((((f.v.form).env)[(f.v.condition)]) !== undefined)) f.pc=25; else f.pc=26;
	},
/*25*/	function (e,f) {
		f.s[0] = builtin__debugout (("Env ") + ("" + (f.v.condition) + (" is not set\n")));
		e.return_pop (false);
	},
	function (e,f) { e.return_pop (((f.v.form).env)[(f.v.condition)]); },
	function (e,f) { if (((f.v.key)) == (("form_valid"))) f.pc=28; else f.pc=30; },
	function (e,f) { e.mcall (2, f.v.form, "form_valid", ([])); },
	function (e,f) { var t1118 = f.s[0]; e.return_pop (t1118); },
/*30*/	function (e,f) { if (((f.v.key)) == (("parent"))) f.pc=31; else f.pc=33; },
	function (e,f) {
		f.v.condition = builtin__substr (f.v.condition,1);
		e.mcall (2, (f.v.form).parent, f.v.condition, ([]));
	},
	function (e,f) { var t1120 = f.s[0]; e.return_pop (t1120); },
	function (e,f) { if (((f.v.key)) == (("date"))) f.pc=34; else f.pc=57; },
	function (e,f) { if (((builtin__substr (f.v.condition,0,2))) == ((">="))) f.pc=35; else f.pc=36; },
/*35*/	function (e,f) {
		f.pc=45;
		f.v.comparison = ">=";
	},
	function (e,f) { if (((builtin__substr (f.v.condition,0,2))) == (("<="))) f.pc=37; else f.pc=38; },
	function (e,f) {
		f.pc=45;
		f.v.comparison = "<=";
	},
	function (e,f) { if (((builtin__substr (f.v.condition,0,1))) == ((">"))) f.pc=39; else f.pc=40; },
	function (e,f) {
		f.pc=45;
		f.v.comparison = ">";
	},
/*40*/	function (e,f) { if (((builtin__substr (f.v.condition,0,1))) == (("<"))) f.pc=41; else f.pc=42; },
	function (e,f) {
		f.pc=45;
		f.v.comparison = "<";
	},
	function (e,f) { if (((builtin__substr (f.v.condition,0,1))) == (("="))) f.pc=43; else f.pc=44; },
	function (e,f) {
		f.pc=45;
		f.v.comparison = "=";
	},
	function (e,f) {
		f.s[0] = builtin__debugout (("Comparison is not recognised in ") + (f.v.condition));
		e.return_pop (false);
	},
/*45*/	function (e,f) {
		f.v.matches = ([]);
		if (!(builtin__preg_match ("/(\\d\\d\\d\\d)-(\\d\\d)-(\\d\\d)/",builtin__substr (f.v.condition,(f.v.comparison).length),f.v.matches))) f.pc=46; else f.pc=47;
	},
	function (e,f) {
		f.s[0] = builtin__debugout (("Failed to parse date in ") + (f.v.condition));
		e.return_pop (false);
	},
	function (e,f) {
		f.v.t = builtin__mktime (0,0,0,(f.v.matches)[(2)],(f.v.matches)[(3)],(f.v.matches)[(1)]);
		f.v.today = builtin__mktime (0,0,0,builtin__date ("m"),builtin__date ("d"),builtin__date ("Y"));
		if (((f.v.comparison)) == ((">="))) f.pc=48; else f.pc=49;
	},
	function (e,f) {
		f.s[0] = f.v.t;
		f.s[1] = f.v.today;
		e.php_two_op (2, ">=");
		var t1129 = f.s[0]; e.return_pop (t1129);
	},
	function (e,f) { if (((f.v.comparison)) == (("<="))) f.pc=50; else f.pc=51; },
/*50*/	function (e,f) {
		f.s[0] = f.v.t;
		f.s[1] = f.v.today;
		e.php_two_op (2, "<=");
		var t1130 = f.s[0]; e.return_pop (t1130);
	},
	function (e,f) { if (((f.v.comparison)) == ((">"))) f.pc=52; else f.pc=53; },
	function (e,f) { e.return_pop (((f.v.today)) > ((f.v.t))); },
	function (e,f) { if (((f.v.comparison)) == (("<"))) f.pc=54; else f.pc=55; },
	function (e,f) { e.return_pop (((f.v.today)) < ((f.v.t))); },
/*55*/	function (e,f) { if (((f.v.comparison)) == (("="))) f.pc=56; else f.pc=57; },
	function (e,f) { e.return_pop (((f.v.today)) == ((f.v.t))); },
	function (e,f) { f.v._k84 = e.enumkeys ((f.v.form).elements); },
	function (e,f) {
		f.pc=60;
		if (!((f.v._k84).length)) f.pc=59;
	},
	function (e,f) {
		f.s[0] = builtin__debugout (("Unrecognised key ") + ("" + (f.v.key) + ((" for node ") + ((f.v.node).text))));
		e.return_pop (false);
	},
/*60*/	function (e,f) {
		f.v._i85 = (f.v._k84).shift();
		f.v.el = ((f.v.form).elements)[(f.v._i85)];
		if (((((f.v.el).fielddef).name)) == ((f.v.key))) f.pc=61; else f.pc=58;
	},
	function (e,f) { e.mcall (3, f.v.el, "eval_condition", ([f.v.condition])); },
	function (e,f) { var t1134 = f.s[0]; e.return_pop (t1134); },
	function (e,f) {
		f.s[0] = builtin__debugout (("Unparsable format for node ") + ((f.v.node).text));
		e.return_pop (false);
	},
	function (e,f) {
		f.s[0] = builtin__debugout (("Don't know how to evaluate ") + ((f.v.node).op));
		e.return_pop (false);
	},
null	];

;
	c.pargs__evaluate =  ["form"];
	c.pinst__evaluate =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "evaluate_node", ([f.v.form, (f.v["this"]).root])); },
	function (e,f) {
		var t1136 = f.s[0]; f.v.res = t1136;
		e.return_pop (f.v.res);
	},
null	];

;
	c.args__parse = c.pargs__parse =  ["expr"];
	c.inst__parse = c.pinst__parse =  [
/*0*/	function (e,f) {
		e.php_push_static_var (1, form_condition,"cache");
		var t1137 = f.s[1]; 
		if (!(((t1137)[(f.v.expr)]) !== undefined)) f.pc=1; else f.pc=5;
	},
	function (e,f) {
		f.v.fc = new form_condition;
		f.v.fc.expr = f.v.expr;
		f.v.fc.pos = 0;
		f.v.fc.error = false;
		e.mcall (2, f.v.fc, "advance", ([]));
	},
	function (e,f) { e.mcall (2, f.v.fc, "next_token", ([])); },
	function (e,f) { e.mcall (2, f.v.fc, "parse_or", ([])); },
	function (e,f) {
		var t1143 = f.s[0]; f.v.fc.root = t1143;
		e.php_push_static_var (2, form_condition,"cache");
		var t1144 = f.s[2]; t1144[f.v.expr] = f.v.fc;
	},
/*5*/	function (e,f) {
		e.php_push_static_var (1, form_condition,"cache");
		var t1146 = f.s[1]; 
		e.return_pop ((t1146)[(f.v.expr)]);
	},
null	];

;
};
form_condition.init_methods (form_condition);
rpcclass.setup_class (form_condition, "form_condition",0, (["expr","pos","root","error","tok","ch","listeners"]), ([0,0,0,0,0,0,2]));
function uploader () { this.do_construct (arguments); }
uploader.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
	c.pargs__handle_pdf =  ["name","realname"];
	c.pinst__handle_pdf =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["handle_pdf", ([f.v.name, f.v.realname])])); },
	function (e,f) { var t1147 = f.s[0]; e.return_pop (t1147); },
null	];

;
	c.pargs__render =  [];
	c.pinst__render =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["render", ([])])); },
	function (e,f) { var t1148 = f.s[0]; e.return_pop (t1148); },
null	];

;
	c.pargs__upload_complete_indication =  ["msg"];
	c.pinst__upload_complete_indication =  [
/*0*/	function (e,f) { e.smcall (3, php_engine,"resume_thread", ([(f.v["this"]).thread_id, "pdf_arrived", f.v.msg])); },
null	];

;
	c.pargs__pdf_upload =  ["msg"];
	c.pinst__pdf_upload =  [
/*0*/	function (e,f) { if ((f.v["this"]).can_accept_pdf) f.pc=1; else f.pc=-1; },
	function (e,f) {
		f.v.msg = builtin__explode ("|",f.v.msg);
		f.v.tmpname = (f.v.msg)[(0)];
		f.v.realname = (f.v.msg)[(1)];
		f.s[0] = builtin__debugout (("Handling incoming pdf at '") + ("" + (f.v.tmpname) + (("' called '") + ("" + (f.v.realname) + ("'")))));
		f.v.matches = ([]);
		if (builtin__preg_match ("/^(.*)\\.([^\\.]{1,4})$/",f.v.realname,f.v.matches)) f.pc=2; else f.pc=3;
	},
	function (e,f) {
		f.pc=4;
		f.v.realname = "" + ((f.v.matches)[(1)]) + (".pdf");
	},
	function (e,f) { f.v.realname = "" + (f.v.realname) + (".pdf"); },
	function (e,f) { e.mcall (4, f.v["this"], "handle_pdf", ([f.v.tmpname, f.v.realname])); },
/*5*/	function (e,f) { e.smcall (3, php_engine,"resume_thread", ([(f.v["this"]).thread_id, "pdf_arrived", f.v.msg])); },
null	];

;
	cp.create_uploader =  function (place,status,targetPHP,show)
	{
		return new weeby_uploader (place, status, targetPHP, show);
			}

;
	c.pargs__run =  [];
	c.pinst__run =  [
/*0*/	function (e,f) { e.mcall (2, f.v["this"], "get_id", ([])); },
	function (e,f) {
		var t1155 = f.s[0]; 
		f.v["this"].uploader_id = ("uploader_") + (t1155);
		f.v["this"].doc_count = 0;
		e.mcall (2, f.v["this"], "render", ([]));
	},
	function (e,f) {
		var t1158 = f.s[0]; 
		f.v.fields = ([({name:"uploader", type:"html", html:t1158})]);
		f.s[0] = false;
		f.s[1] = "pdf_upload";
		f.s[2] = f.v["this"];
		e.smcall (3, auth,"my_uid", ([]));
	},
	function (e,f) {
		var t1160 = f.s[3]; f.s[3] = ("pdf-upload:") + (t1160);
		e.php_static_method_call (4, asyncnotify,"create_watch", 4);
	},
	function (e,f) { e.smcall (4, asyncnotify,"create_watch", ([("uploader:") + ((f.v["this"]).uploader_id), f.v["this"], "upload_complete_indication", false])); },
/*5*/	function (e,f) {
		f.v.pop = new popupform;
		e.mcall (6, f.v.pop, "initialise", ([300, 280, "Upload files", f.v.fields]));
	},
	function (e,f) { e.mcall (2, f.v.pop, "open", ([])); },
	function (e,f) {
		f.pc=12;
		f.s[0] = "-drop-div";
		e.mcall (3, f.v["this"], "get_id", ([]));
	},
	function (e,f) {
		f.s[0] = null;
		e.smcall (4, page_dispatcher,"makelink", (["uploader", "do_upload", ({uploader_id:(f.v["this"]).uploader_id})]));
	},
	function (e,f) {
		f.s[2] = "-status-div";
		e.mcall (5, f.v["this"], "get_id", ([]));
	},
/*10*/	function (e,f) {
		var t1165 = f.s[3]; var t1166 = f.s[2]; f.s[2] = "" + (t1165) + (t1166);
		f.s[3] = "-drop-div";
		e.mcall (6, f.v["this"], "get_id", ([]));
	},
	function (e,f) {
		f.pc=14;
		var t1167 = f.s[4]; var t1168 = f.s[3]; 
		var t1169 = f.s[2]; var t1170 = f.s[1]; var t1171 = f.s[0]; e.mcall (6, f.v["this"], "create_uploader", (["" + (t1167) + (t1168), t1169, t1170, t1171]));
	},
	function (e,f) {
		var t1172 = f.s[1]; var t1173 = f.s[0]; 
		e.mcall (3, document, "getElementById", (["" + (t1172) + (t1173)]));
	},
	function (e,f) { var t1174 = f.s[0]; if (t1174) f.pc=8; else f.pc=14; },
	function (e,f) {  },
/*15*/	function (e,f) {
		f.pc=17;
		e.mcall (3, document, "getElementById", ([("count_") + ((f.v["this"]).uploader_id)]));
	},
	function (e,f) {
		f.pc=32;
		e.mcall (2, f.v.pop, "close_by_hiding", ([]));
	},
	function (e,f) {
		var t1176 = f.s[0]; f.v.el = t1176;
		f.v.el.innerHTML = (f.v["this"]).doc_count;
		e.smcall (0, php_engine,"get_current_thread_id", ([]));
	},
	function (e,f) {
		var t1179 = f.s[0]; f.v["this"].thread_id = t1179;
		f.v["this"].can_accept_pdf = true;
		e.mcall (2, f.v.pop, "run", ([]));
	},
	function (e,f) {
		var t1182 = f.s[0]; f.v.event = t1182;
		f.v["this"].can_accept_pdf = false;
		f.v.action = (f.v.event).action;
		if (((f.v.action)) == (("OK"))) f.pc=22; else f.pc=23;
	},
/*20*/	function (e,f) {
		f.pc=16;
		f.v.res = true;
	},
	function (e,f) { if (((f.v.action)) == (("cancel"))) f.pc=25; else f.pc=26; },
	function (e,f) {
		f.pc=24;
		f.s[0] = (((f.v["this"]).doc_count)) != ((0));
	},
	function (e,f) { f.s[0] = false; },
	function (e,f) { var t1186 = f.s[0]; if (t1186) f.pc=20; else f.pc=21; },
/*25*/	function (e,f) {
		f.pc=16;
		f.v["this"].doc_count = 0;
	},
	function (e,f) { if (((f.v.action)) == (("upload_complete"))) f.pc=27; else f.pc=29; },
	function (e,f) { e.mcall (2, f.v["this"], "get_file_info", ([])); },
	function (e,f) {
		var t1189 = f.s[0]; f.v.fi = t1189;
		f.v["this"].doc_count = builtin__count (f.v.fi);
	},
	function (e,f) { if (((f.v.action)) == (("pdf_arrived"))) f.pc=30; else f.pc=15; },
/*30*/	function (e,f) { e.mcall (2, f.v["this"], "get_file_info", ([])); },
	function (e,f) {
		f.pc=15;
		var t1192 = f.s[0]; f.v.fi = t1192;
		f.v["this"].doc_count = builtin__count (f.v.fi);
	},
	function (e,f) { e.return_pop ((((f.v["this"]).doc_count)) != ((0))); },
null	];

;
	c.pargs__get_file_info =  [];
	c.pinst__get_file_info =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["get_file_info", ([])])); },
	function (e,f) { var t1194 = f.s[0]; e.return_pop (t1194); },
null	];

;
	c.pargs__clear_files =  [];
	c.pinst__clear_files =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["clear_files", ([])])); },
	function (e,f) { var t1195 = f.s[0]; e.return_pop (t1195); },
null	];

;
	c.upload_completed = cp.upload_completed =  function ()
	{
{
		php_engine.resume  ("upload_complete");;
		}
			}

;
};
uploader.init_methods (uploader);
rpcclass.setup_class (uploader, "uploader",0, (["uploader_id","doc_count","listeners"]), ([0,0,2]));
function cover () { this.do_construct (arguments); }
cover.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
	cp.close =  function ()
	{
		if (this.cover)
		{
			window.clearInterval (this.fader);
			document.body.removeChild (this.cover);
			this.cover = null;
			popup.zindex -= 20;
		}
			}

;
	cp.cover_clicked =  function (e)
	{
		if (!e) e = window.event;
		this.close();
		if (e) e.cancelBubble = true;
		return false;
			}

;
	cp.open =  function ()
	{
		if (popup.zindex == undefined) popup.zindex = 60;
		popup.zindex += 20;
		this.cover = document.createElement ("div");

		
		if (window.XMLHttpRequest)
		{
			this.cover.style.position = "fixed";
			this.cover.style.left = "0px";
			this.cover.style.top = "0px";
		}
		else
		{
			// MSIE 6
			this.cover.style.position = "absolute";
			this.cover.style.left = document.documentElement.scrollLeft+"px";
			this.cover.style.top = document.documentElement.scrollTop+"px";
		}

		// doing it in this rather strange order is to stop MSIE flickering when DIV is added but transparency hasn't caught up yet
		this.cover.style.width = "1px";
		this.cover.style.height = "1px";
		document.body.appendChild (this.cover);
		browser.set_alpha (this.cover, 1);

		this.cover.style.width = document.documentElement.scrollWidth+"px";
		this.cover.style.height = document.documentElement.clientHeight+"px";
		this.cover.style.zIndex = popup.zindex+100;
		this.cover.style.background = "white";

		var centre_x = browser.scroll_left() + browser.window_width()/2;
		var centre_y = browser.window_height()/2;

		if (!window.XMLHttpRequest)
		{
			// MSIE 6
			centre_y = browser.scroll_top() + browser.window_height()/2;
		}

		this.cover.innerHTML = "<img style=\"position:absolute; left:"+centre_x+"px; top:"+centre_y+"px\" src=\""+rootpath.map("/pj/graphics/spinner.gif")+"\"/>";

//		document.body.appendChild (this.cover);

		var cover_listener_code = "{ rpcclass.call_method_by_name ('popup', '"+this.get_id()+"', 'cover_clicked'); }";
		var cover_listener = new Function ("e", cover_listener_code);
		if (this.cover.addEventListener)
			this.cover.addEventListener ("click", cover_listener, false);
		else
			this.cover.attachEvent ("onclick", cover_listener);

		this.fade_level = 0;
		cover.current = this;
		this.fader = window.setInterval ("cover.fade()", 50);

			}

;
	cp.do_fade =  function ()
	{
var n;{
		n = this.fade_level;;
		if (this.cover !== null)
		{browser.set_alpha  (this.cover,n); }
		;
		this.fade_level = this.fade_level + 1;;
		}
			}

;
	c.fade = cp.fade =  function ()
	{
		cover.current.do_fade();
			}

;
};
cover.init_methods (cover);
rpcclass.setup_class (cover, "cover",0, (["listeners"]), ([2]));
function popup () { this.do_construct (arguments); }
popup.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
	cp.initialise =  function ()
	{
		this.div = null;
		this.cover = null;
		this.disable_cover = false;
		this.x = popup.x;
		this.y = popup.y;
			}

;
	cp.close =  function ()
	{
		if (this.relocate_timer)
		{
			window.clearInterval (this.relocate_timer);
			this.relocate_timer = null;
		}

		if (this.div)
		{
			if (this.cover) document.body.removeChild (this.cover);

			document.body.removeChild (this.div);

			var i;
			for (i = 0; i < 5; i++)
				document.body.removeChild (this.shadow[i]);
			this.div = null;
			popup.leave_modal ();
		}
			}

;
	cp.close_by_hiding =  function ()
	{
		if (this.relocate_timer)
		{
			window.clearInterval (this.relocate_timer);
			this.relocate_timer = null;
		}
		if (this.div)
		{
			if (this.cover) document.body.removeChild (this.cover);

// workaround for IE not coping with radupload in a div which gets deleted
//			document.body.removeChild (this.div);
			this.div.style.display = "none";

			var i;
			for (i = 0; i < 5; i++)
				document.body.removeChild (this.shadow[i]);
			this.div = null;
			popup.leave_modal();
		}
			}

;
	cp.cover_clicked =  function (e)
	{
		if (!e) e = window.event;
		this.close();
		if (e) e.cancelBubble = true;
		return false;
			}

;
	c.next_zindex = cp.next_zindex =  function ()
	{
		if (popup.zindex == undefined) popup.zindex = 60;
		return popup.zindex + 20;
			}

;
	c.enter_modal = cp.enter_modal =  function ()
	{
		var res = popup.next_zindex ();
		popup.zindex += 20;
		return res;
			}

;
	c.leave_modal = cp.leave_modal =  function ()
	{
		popup.zindex -= 20;
			}

;
	cp.open =  function (width,height,html)
	{
		popup.enter_modal ();

		if (!this.disable_cover)
		{
			this.cover = document.createElement ("div");

			if (window.XMLHttpRequest)
			{
				this.cover.style.position = "fixed";
				this.cover.style.left = "0px";
				this.cover.style.top = "0px";

				if (document.all)
				{
					// MSIE 7 and 8
					this.cover.style.background = "white";
					browser.set_alpha (this.cover, 0);
				}
				else
				{
					this.cover.style.background = "transparent";
				}
			}
			else
			{
				// MSIE 6
				this.cover.style.position = "absolute";
				this.cover.style.left = browser.scroll_left()+"px";
				this.cover.style.top = browser.scroll_top()+"px";

				this.cover.style.background = "white";
				this.cover.style.filter = "alpha(opacity=0)";
			}

			this.cover.style.width = browser.window_width()+"px";
			this.cover.style.height = browser.window_height()+"px";
			this.cover.style.zIndex = ""+(popup.zindex-10); // "90";

			document.body.appendChild (this.cover);

			var cover_listener_code = "{ php_engine.resume_thread ("+php_engine.get_current_thread_id()+",'cover',null); }";
			var cover_listener = new Function ("e", cover_listener_code);
			if (this.cover.addEventListener)
			{
				this.cover.addEventListener ("click", cover_listener, false);
				this.cover.addEventListener ("contextmenu", cover_listener, false);
			}
			else
			{
				this.cover.attachEvent ("onclick", cover_listener);
				this.cover.attachEvent ("oncontextmenu", cover_listener);
			}
		}

		var margin = 50;
		if (this.y + height + margin > browser.scroll_top() + browser.window_height())
		{
			this.y = browser.scroll_top() + browser.window_height() - height - margin;
		}
		if (this.x + width + margin > browser.scroll_left() + browser.window_width())
		{
			this.x = browser.scroll_left() + browser.window_width() - width - margin;
		}
		if (this.y < margin) this.y = margin;

		this.div = document.createElement ("div");
		this.div.className = "popupdiv";

		if (width != 0)
		{
			this.div.style.width = width+"px";
			this.div.style.height = height+"px";
		}

		this.div.style.position = "absolute";
//		this.div.style.left = this.x+"px";
//		this.div.style.top = this.y+"px";
		this.div.style.left = "0px";
		this.div.style.top = "0px";
		this.div.style.zIndex = popup.zindex;

		this.div.innerHTML = html;

		document.body.appendChild (this.div);

		if (width == 0)
		{
			width = this.div.clientWidth-8;
			height = this.div.clientHeight-8;

			var width_clamped = false;
			var height_clamped = false;
			if (width > browser.window_width() - margin*2)
			{
				width = browser.window_width() - margin;
				width_clamped = true;
			}
			if (height > browser.window_height() - margin*2)
			{
				height = browser.window_height() - margin*2;
				height_clamped = true;
			}

			if (width_clamped || height_clamped)
			{
				var style = "overflow:auto;";
				if (width_clamped) style += " width:"+width+"px;";
				if (height_clamped) style += " height:"+height+"px;";
				this.div.innerHTML = "<div style=\""+style+"\">"+this.div.innerHTML+"</div>";
			}

			if (this.y + height + margin > browser.scroll_top() + browser.window_height())
			{
				this.y = browser.scroll_top() + browser.window_height() - height - margin;
			}
			if (this.x + width + margin > browser.scroll_left() + browser.window_width())
			{
				this.x = browser.scroll_left() + browser.window_width() - width - margin;
			}
			if (this.y < 0) this.y = 0;
		}

		this.div.style.left = this.x+"px";
		this.div.style.top = this.y+"px";

		this.w = width;
		this.h = height;

		this.shadow = new Array();
		var i;
		for (i = 0; i < 5; i++)
		{
			this.shadow[i] = document.createElement ("div");

			this.shadow[i].style.width = "1px";
			this.shadow[i].style.height = "1px";
			this.shadow[i].style.position = "absolute";
			this.shadow[i].style.left = (this.x+1+i)+"px";
			this.shadow[i].style.top = (this.y+1+i)+"px";
			this.shadow[i].style.zIndex = popup.zindex-i-1; // 99-i;
			this.shadow[i].style.background = "#000000";

			document.body.appendChild (this.shadow[i]);

			browser.set_alpha (this.shadow[i], 5);

			this.shadow[i].style.width = (width+11)+"px";
			this.shadow[i].style.height = (height+11)+"px";
		}

		var me = this;
		this.relocate_timer = window.setInterval (function () { me.relocate (); }, 100);
			}

;
	cp.relocate =  function ()
	{
var margin;var width;var height;var x;var y;var i;var sel;{
		margin = 50;;
		width = this.div.clientWidth - 8;;
		height = this.div.clientHeight - 8;;
		x = this.x;;
		y = this.y;;
		if (height + margin * 2 > browser.window_height  ())
		{{
		if (y + height + margin < browser.scroll_top  () + browser.window_height  ())
		{y = browser.scroll_top  () + browser.window_height  () - height - margin; }
		;
		if (y > browser.scroll_top  () + margin)
		{y = browser.scroll_top  () + margin; }
		;
		}
		 }
		else {{
		if (y + height + margin > browser.scroll_top  () + browser.window_height  ())
		{{
		y = browser.scroll_top  () + browser.window_height  () - height - margin;;
		}
		 }
		;
		if (y < browser.scroll_top  () + margin)
		{y = browser.scroll_top  () + margin; }
		;
		}
		 }
		;
		if (width + margin * 2 > browser.window_width  ())
		{{
		if (x < browser.scroll_left  () + browser.window_width  () - margin - width)
		{x = browser.scroll_left  () + browser.window_width  () - width - margin; }
		;
		if (x > browser.scroll_left  () + margin)
		{x = browser.scroll_left  () + margin; }
		;
		}
		 }
		else {{
		if (x + width + margin > browser.scroll_left  () + browser.window_width  ())
		{{
		x = browser.scroll_left  () + browser.window_width  () - width - margin;;
		}
		 }
		;
		if (x < browser.scroll_left  () + margin)
		{x = browser.scroll_left  () + margin; }
		;
		}
		 }
		;
		if (this.x == x && this.y == y && this.w == width && this.h == height)
		{return }
		;
		this.x = x;;
		this.y = y;;
		this.w = width;;
		this.h = height;;
		this.div.style.left = this.x + "px";;
		this.div.style.top = this.y + "px";;
		for (i = 0;i < 5;i++) {{
		sel = this.shadow[i];;
		sel.style.left = this.x + 1 + i + "px";;
		sel.style.top = this.y + 1 + i + "px";;
		sel.style.width = width + 11 + "px";;
		sel.style.height = height + 11 + "px";;
		}
		};
		}
			}

;
	c.pargs__set_content =  ["html"];
	c.pinst__set_content =  [
/*0*/	function (e,f) { (f.v["this"]).div.innerHTML = f.v.html; },
null	];

;
	c.pargs__get_x =  [];
	c.pinst__get_x =  [
/*0*/	function (e,f) { e.return_pop ((f.v["this"]).x); },
null	];

;
	c.pargs__get_y =  [];
	c.pinst__get_y =  [
/*0*/	function (e,f) { e.return_pop ((f.v["this"]).y); },
null	];

;
	cp.no_cover =  function ()
	{
		this.disable_cover = true;
			}

;
	cp.set_coordinates =  function (x,y)
	{
		this.x = x;
		this.y = y;
			}

;
	cp.set_element =  function (el)
	{
		this.x = lib.document_x_of(el);
		this.y = lib.document_y_of(el);
			}

;
	cp.set_event =  function (event)
	{
		this.x = event.clientX;
		this.y = event.clientY + browser.scroll_top();
			}

;
	cp.grab_keyboard =  function ()
	{
		var key_listener = new Function ("e", "{ if (!e) e = window.event; php_engine.resume_thread ("+php_engine.get_current_thread_id()+",'key',e.keyCode); }");

		if (this.div.addEventListener)
		{
			document.addEventListener ("keydown", key_listener, true);
		}
		else
		{
			this.div.attachEvent ("onkeydown", key_listener);
		}
		debugout ("onkeydown listener established\n");
			}

;
	c.set_default_coordinates = cp.set_default_coordinates =  function (x,y)
	{
		popup.x = x;
		popup.y = y;
			}

;
	c.set_default_element = cp.set_default_element =  function (el)
	{
		popup.x = lib.document_x_of(el);
		popup.y = lib.document_y_of(el);
			}

;
	c.set_default_event = cp.set_default_event =  function (event)
	{
		popup.x = event.clientX + browser.scroll_left();
		popup.y = event.clientY + browser.scroll_top();
			}

;
};
popup.init_methods (popup);
rpcclass.setup_class (popup, "popup",0, (["listeners"]), ([2]));
function popupform () { this.do_construct (arguments); }
popupform.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
	c.pargs__cancel =  ["el","arg","event"];
	c.pinst__cancel =  [
/*0*/	function (e,f) { e.mcall (2, (f.v["this"]).pop, "close", ([])); },
null	];

;
	c.pargs__submit =  ["el","arg","event"];
	c.pinst__submit =  [
/*0*/	function (e,f) {
		f.v.results = ([]);
		f.v._k86 = e.enumkeys ((f.v["this"]).fields);
	},
	function (e,f) {
		f.pc=3;
		if (!((f.v._k86).length)) f.pc=2;
	},
	function (e,f) {
		f.pc=-1;
		e.mcall (2, (f.v["this"]).pop, "close", ([]));
	},
	function (e,f) {
		f.pc=1;
		f.v._i87 = (f.v._k86).shift();
		f.v.field = ((f.v["this"]).fields)[(f.v._i87)];
		f.v.results[f.v.field] = ((f.v.el)[(f.v.field)]).value;
	},
null	];

;
	c.pargs__open_date =  ["el","i","ev"];
	c.pinst__open_date =  [
/*0*/	function (e,f) {
		f.v.field = ((f.v["this"]).fields)[(f.v.i)];
		f.s[0] = "-form";
		e.mcall (3, f.v["this"], "get_id", ([]));
	},
	function (e,f) {
		var t1203 = f.s[1]; var t1204 = f.s[0]; 
		e.mcall (3, document, "getElementById", (["" + (t1203) + (t1204)]));
	},
	function (e,f) {
		var t1206 = f.s[0]; f.v.form = t1206;
		f.v.fname = "" + ((f.v.field).name) + ("-date");
		f.v.element = (f.v.form)[(f.v.fname)];
		f.v.value = (f.v.element).value;
		f.v.value = builtin__parse_mysql_datetime ("" + (f.v.value) + (" 00:00:00"));
		e.smcall (2, popupdate,"run", ([(f.v.field).label, f.v.value]));
	},
	function (e,f) {
		var t1212 = f.s[0]; f.v.value = t1212;
		f.v.element.value = builtin__date ("Y-m-d",f.v.value);
	},
null	];

;
	c.pargs__edit_query =  ["el","i","ev"];
	c.pinst__edit_query =  [
/*0*/	function (e,f) { f.v.field = ((f.v["this"]).fields)[(f.v.i)]; },
null	];

;
	c.pargs__insert_at_caret =  ["fname","text"];
	c.pinst__insert_at_caret =  [
/*0*/	function (e,f) {
		f.s[0] = "-form";
		e.mcall (3, f.v["this"], "get_id", ([]));
	},
	function (e,f) {
		var t1215 = f.s[1]; var t1216 = f.s[0]; 
		e.mcall (3, document, "getElementById", (["" + (t1215) + (t1216)]));
	},
	function (e,f) {
		var t1218 = f.s[0]; f.v.form = t1218;
		f.v.element = (f.v.form)[(f.v.fname)];
		e.smcall (2, lib,"insertAtCaret", ([f.v.element, f.v.text]));
	},
null	];

;
	c.pargs__render =  [];
	c.pinst__render =  [
/*0*/	function (e,f) {
		f.s[0] = "\"><table>";
		e.smcall (3, popupform,"render_resume", (["OK", null]));
	},
	function (e,f) {
		var t1220 = f.s[1]; var t1221 = f.s[0]; 
		f.s[0] = ("-form\" onsubmit=\"") + ("" + (t1220) + (t1221));
		e.mcall (3, f.v["this"], "get_id", ([]));
	},
	function (e,f) {
		var t1222 = f.s[1]; var t1223 = f.s[0]; 
		f.v["this"].html = ("<h3>") + ("" + ((f.v["this"]).title) + (("</h3><form id=\"") + ("" + (t1222) + (t1223))));
		f.v["this"].focusfield = null;
		f.v._k88 = e.enumkeys ((f.v["this"]).fields);
	},
	function (e,f) {
		f.pc=5;
		if (!((f.v._k88).length)) f.pc=4;
	},
	function (e,f) {
		f.pc=232;
		f.v["this"].html = "" + ((f.v["this"]).html) + ("<tr><td></td><td style=\"text-align:right\">");
		f.v._k96 = e.enumkeys ((f.v["this"]).fields);
	},
/*5*/	function (e,f) {
		f.v.i = (f.v._k88).shift();
		f.v.field = ((f.v["this"]).fields)[(f.v.i)];
		f.s[0] = (":") + ((f.v.field).name);
		e.mcall (3, f.v["this"], "get_id", ([]));
	},
	function (e,f) {
		var t1231 = f.s[1]; var t1232 = f.s[0]; 
		f.v.fieldid = "" + (t1231) + (t1232);
		if (((f.v.field).value) !== undefined) f.pc=7; else f.pc=8;
	},
	function (e,f) {
		f.pc=9;
		f.v.value = (f.v.field).value;
	},
	function (e,f) { f.v.value = ""; },
	function (e,f) { if ((((f.v.field).type)) == (("label"))) f.pc=10; else f.pc=13; },
/*10*/	function (e,f) {
		f.v["this"].html = "" + ((f.v["this"]).html) + ("<tr><td style=\"text-align:right\">");
		if ((((f.v.field).label)) != ((""))) f.pc=11; else f.pc=12;
	},
	function (e,f) { f.v["this"].html = "" + ((f.v["this"]).html) + ("" + ((f.v.field).label) + (":")); },
	function (e,f) {
		f.pc=230;
		f.v.evalue = builtin__htmlentities (f.v.value);
		f.v["this"].html = "" + ((f.v["this"]).html) + (("</td><td>") + ("" + (f.v.evalue) + ("</td></tr>")));
	},
	function (e,f) { if ((((f.v.field).type)) == (("text"))) f.pc=219; else f.pc=220; },
	function (e,f) { if (((f.v.value)) === ((null))) f.pc=15; else f.pc=16; },
/*15*/	function (e,f) { f.v.value = ""; },
	function (e,f) {
		f.v["this"].html = "" + ((f.v["this"]).html) + ("<tr><td style=\"text-align:right\">");
		if ((((f.v.field).label)) != ((""))) f.pc=17; else f.pc=18;
	},
	function (e,f) { f.v["this"].html = "" + ((f.v["this"]).html) + ("" + ((f.v.field).label) + (":")); },
	function (e,f) { if ((((f.v.field).type)) == (("price"))) f.pc=19; else f.pc=21; },
	function (e,f) {
		f.v["this"].html = "" + ((f.v["this"]).html) + ("&#163;");
		e.smcall (1, lib,"render_price_simple", ([f.v.value]));
	},
/*20*/	function (e,f) { var t1245 = f.s[0]; f.v.value = t1245; },
	function (e,f) {
		f.v.evalue = "";
		f.v.i = 0;
	},
	function (e,f) {
		f.pc=24;
		if (!(((f.v.i)) < (((f.v.value).length)))) f.pc=23;
	},
	function (e,f) {
		f.v["this"].html = "" + ((f.v["this"]).html) + (("</td><td><input id=\"") + ("" + (f.v.fieldid) + ("\"")));
		if ((((f.v.field).type)) == (("password"))) f.pc=28; else f.pc=29;
	},
	function (e,f) {
		f.v.ch = builtin__substr (f.v.value,f.v.i,1);
		if (!(builtin__preg_match ("/[A-Za-z0-9 ]/",f.v.ch))) f.pc=25; else f.pc=26;
	},
/*25*/	function (e,f) {
		f.pc=27;
		f.v.evalue = "" + (f.v.evalue) + (("&#") + ("" + (builtin__ord (f.v.ch)) + (";")));
	},
	function (e,f) { f.v.evalue = "" + (f.v.evalue) + (f.v.ch); },
	function (e,f) {
		f.pc=22;
		e.php_push_var_lvalue (0, "i");
		e.php_postinc (1);
	},
	function (e,f) {
		f.pc=30;
		f.v["this"].html = "" + ((f.v["this"]).html) + (" type=\"password\"");
	},
	function (e,f) { f.v["this"].html = "" + ((f.v["this"]).html) + (" type=\"text\""); },
/*30*/	function (e,f) {
		f.v["this"].html = "" + ((f.v["this"]).html) + ((" name=\"") + ("" + ((f.v.field).name) + (("\" value=\"") + ("" + (f.v.evalue) + ("\" style=\"")))));
		if (((f.v.field).width) !== undefined) f.pc=32; else f.pc=33;
	},
	function (e,f) {
		f.pc=35;
		f.v["this"].html = "" + ((f.v["this"]).html) + (("width:") + ("" + ((f.v.field).width) + ("px;")));
	},
	function (e,f) {
		f.pc=34;
		f.s[0] = (((f.v.field).width)) != ((""));
	},
	function (e,f) { f.s[0] = false; },
	function (e,f) { var t1257 = f.s[0]; if (t1257) f.pc=31; else f.pc=35; },
/*35*/	function (e,f) { if (((f.v.field).height) !== undefined) f.pc=37; else f.pc=38; },
	function (e,f) {
		f.pc=40;
		f.v["this"].html = "" + ((f.v["this"]).html) + (("height:") + ("" + ((f.v.field).height) + ("px;")));
	},
	function (e,f) {
		f.pc=39;
		f.s[0] = (((f.v.field).height)) != ((""));
	},
	function (e,f) { f.s[0] = false; },
	function (e,f) { var t1259 = f.s[0]; if (t1259) f.pc=36; else f.pc=40; },
/*40*/	function (e,f) {
		f.pc=230;
		f.v["this"].html = "" + ((f.v["this"]).html) + ("\"");
		f.v["this"].html = "" + ((f.v["this"]).html) + (" /></td></tr>");
	},
	function (e,f) { if ((((f.v.field).type)) == (("date"))) f.pc=42; else f.pc=56; },
	function (e,f) {
		f.v["this"].html = "" + ((f.v["this"]).html) + ("<tr><td style=\"text-align:right\">");
		if ((((f.v.field).label)) != ((""))) f.pc=43; else f.pc=44;
	},
	function (e,f) { f.v["this"].html = "" + ((f.v["this"]).html) + ("" + ((f.v.field).label) + (":")); },
	function (e,f) {
		f.v.evalue = builtin__date ("Y-m-d",f.v.value);
		f.v["this"].html = "" + ((f.v["this"]).html) + (("</td><td><input id=\"") + ("" + (f.v.fieldid) + (("\" type=\"text\" name=\"") + ("" + ((f.v.field).name) + (("-date\" value=\"") + ("" + (f.v.evalue) + ("\" style=\"")))))));
		if (((f.v.field).width) !== undefined) f.pc=46; else f.pc=47;
	},
/*45*/	function (e,f) {
		f.pc=49;
		f.v["this"].html = "" + ((f.v["this"]).html) + (("width:") + ("" + ((f.v.field).width) + ("px;")));
	},
	function (e,f) {
		f.pc=48;
		f.s[0] = (((f.v.field).width)) != ((""));
	},
	function (e,f) { f.s[0] = false; },
	function (e,f) { var t1267 = f.s[0]; if (t1267) f.pc=45; else f.pc=49; },
	function (e,f) { if (((f.v.field).height) !== undefined) f.pc=51; else f.pc=52; },
/*50*/	function (e,f) {
		f.pc=54;
		f.v["this"].html = "" + ((f.v["this"]).html) + (("height:") + ("" + ((f.v.field).height) + ("px;")));
	},
	function (e,f) {
		f.pc=53;
		f.s[0] = (((f.v.field).height)) != ((""));
	},
	function (e,f) { f.s[0] = false; },
	function (e,f) { var t1269 = f.s[0]; if (t1269) f.pc=50; else f.pc=54; },
	function (e,f) {
		f.v["this"].html = "" + ((f.v["this"]).html) + ("\" />");
		f.s[0] = "\"><img style=\"border-style:none\" src=\"/pj/graphics/calendar-small.png\" alt=\"change\"/></a>";
		e.mcall (5, f.v["this"], "render_start", (["open_date", f.v.i]));
	},
/*55*/	function (e,f) {
		f.pc=230;
		var t1271 = f.s[1]; var t1272 = f.s[0]; 
		f.v["this"].html = "" + ((f.v["this"]).html) + (("<a href=\"#\" onclick=\"") + ("" + (t1271) + (t1272)));
		f.v["this"].html = "" + ((f.v["this"]).html) + ("</td></tr>");
	},
	function (e,f) { if ((((f.v.field).type)) == (("time"))) f.pc=57; else f.pc=70; },
	function (e,f) {
		f.v["this"].html = "" + ((f.v["this"]).html) + ("<tr><td style=\"text-align:right\">");
		if ((((f.v.field).label)) != ((""))) f.pc=58; else f.pc=59;
	},
	function (e,f) { f.v["this"].html = "" + ((f.v["this"]).html) + ("" + ((f.v.field).label) + (":")); },
	function (e,f) {
		f.v.evalue = builtin__date ("H:i",f.v.value);
		f.v["this"].html = "" + ((f.v["this"]).html) + (("</td><td><input id=\"") + ("" + (f.v.fieldid) + (("\" type=\"text\" name=\"") + ("" + ((f.v.field).name) + (("\" value=\"") + ("" + (f.v.evalue) + ("\" style=\"")))))));
		if (((f.v.field).width) !== undefined) f.pc=61; else f.pc=62;
	},
/*60*/	function (e,f) {
		f.pc=64;
		f.v["this"].html = "" + ((f.v["this"]).html) + (("width:") + ("" + ((f.v.field).width) + ("px;")));
	},
	function (e,f) {
		f.pc=63;
		f.s[0] = (((f.v.field).width)) != ((""));
	},
	function (e,f) { f.s[0] = false; },
	function (e,f) { var t1280 = f.s[0]; if (t1280) f.pc=60; else f.pc=64; },
	function (e,f) { if (((f.v.field).height) !== undefined) f.pc=66; else f.pc=67; },
/*65*/	function (e,f) {
		f.pc=69;
		f.v["this"].html = "" + ((f.v["this"]).html) + (("height:") + ("" + ((f.v.field).height) + ("px;")));
	},
	function (e,f) {
		f.pc=68;
		f.s[0] = (((f.v.field).height)) != ((""));
	},
	function (e,f) { f.s[0] = false; },
	function (e,f) { var t1282 = f.s[0]; if (t1282) f.pc=65; else f.pc=69; },
	function (e,f) {
		f.pc=230;
		f.v["this"].html = "" + ((f.v["this"]).html) + ("\" /></td></tr>");
	},
/*70*/	function (e,f) { if ((((f.v.field).type)) == (("datetime"))) f.pc=71; else f.pc=97; },
	function (e,f) {
		f.v["this"].html = "" + ((f.v["this"]).html) + ("<tr><td style=\"text-align:right\">");
		if ((((f.v.field).label)) != ((""))) f.pc=72; else f.pc=73;
	},
	function (e,f) { f.v["this"].html = "" + ((f.v["this"]).html) + ("" + ((f.v.field).label) + (":")); },
	function (e,f) {
		f.v["this"].html = "" + ((f.v["this"]).html) + ("</td><td>");
		f.v["this"].html = "" + ((f.v["this"]).html) + (("<input id=\"") + ("" + (f.v.fieldid) + (("\" type=\"text\" name=\"") + ("" + ((f.v.field).name) + (("-date\" value=\"") + ("" + (builtin__date ("Y-m-d",f.v.value)) + ("\" style=\"")))))));
		if (((f.v.field).width) !== undefined) f.pc=76; else f.pc=77;
	},
	function (e,f) {
		f.pc=79;
		f.v["this"].html = "" + ((f.v["this"]).html) + (("width:") + ("" + ((f.v.field).width) + ("px;")));
	},
/*75*/	function (e,f) {
		f.pc=79;
		f.v["this"].html = "" + ((f.v["this"]).html) + ("width:70px;");
	},
	function (e,f) {
		f.pc=78;
		f.s[0] = (((f.v.field).width)) != ((""));
	},
	function (e,f) { f.s[0] = false; },
	function (e,f) { var t1290 = f.s[0]; if (t1290) f.pc=74; else f.pc=75; },
	function (e,f) { if (((f.v.field).height) !== undefined) f.pc=81; else f.pc=82; },
/*80*/	function (e,f) {
		f.pc=84;
		f.v["this"].html = "" + ((f.v["this"]).html) + (("height:") + ("" + ((f.v.field).height) + ("px;")));
	},
	function (e,f) {
		f.pc=83;
		f.s[0] = (((f.v.field).height)) != ((""));
	},
	function (e,f) { f.s[0] = false; },
	function (e,f) { var t1292 = f.s[0]; if (t1292) f.pc=80; else f.pc=84; },
	function (e,f) {
		f.v["this"].html = "" + ((f.v["this"]).html) + ("\" />");
		f.s[0] = "\"><img style=\"border-style:none\" src=\"/pj/graphics/calendar-small.png\" alt=\"change\"/></a>";
		e.mcall (5, f.v["this"], "render_start", (["open_date", f.v.i]));
	},
/*85*/	function (e,f) {
		var t1294 = f.s[1]; var t1295 = f.s[0]; 
		f.v["this"].html = "" + ((f.v["this"]).html) + (("<a href=\"#\" onclick=\"") + ("" + (t1294) + (t1295)));
		f.v["this"].html = "" + ((f.v["this"]).html) + (("<input type=\"text\" name=\"") + ("" + ((f.v.field).name) + (("-time\" value=\"") + ("" + (builtin__date ("H:i",f.v.value)) + ("\" style=\"")))));
		if (((f.v.field).width) !== undefined) f.pc=88; else f.pc=89;
	},
	function (e,f) {
		f.pc=91;
		f.v["this"].html = "" + ((f.v["this"]).html) + (("width:") + ("" + ((f.v.field).width) + ("px;")));
	},
	function (e,f) {
		f.pc=91;
		f.v["this"].html = "" + ((f.v["this"]).html) + ("width:35px;");
	},
	function (e,f) {
		f.pc=90;
		f.s[0] = (((f.v.field).width)) != ((""));
	},
	function (e,f) { f.s[0] = false; },
/*90*/	function (e,f) { var t1300 = f.s[0]; if (t1300) f.pc=86; else f.pc=87; },
	function (e,f) { if (((f.v.field).height) !== undefined) f.pc=93; else f.pc=94; },
	function (e,f) {
		f.pc=96;
		f.v["this"].html = "" + ((f.v["this"]).html) + (("height:") + ("" + ((f.v.field).height) + ("px;")));
	},
	function (e,f) {
		f.pc=95;
		f.s[0] = (((f.v.field).height)) != ((""));
	},
	function (e,f) { f.s[0] = false; },
/*95*/	function (e,f) { var t1302 = f.s[0]; if (t1302) f.pc=92; else f.pc=96; },
	function (e,f) {
		f.pc=230;
		f.v["this"].html = "" + ((f.v["this"]).html) + ("\" />");
		f.v["this"].html = "" + ((f.v["this"]).html) + ("</td></tr>");
	},
	function (e,f) { if ((((f.v.field).type)) == (("image"))) f.pc=98; else f.pc=111; },
	function (e,f) {
		f.v["this"].html = "" + ((f.v["this"]).html) + ("<tr><td style=\"text-align:right\">");
		if ((((f.v.field).label)) != ((""))) f.pc=99; else f.pc=100;
	},
	function (e,f) { f.v["this"].html = "" + ((f.v["this"]).html) + ("" + ((f.v.field).label) + (":")); },
/*100*/	function (e,f) {
		f.v["this"].html = "" + ((f.v["this"]).html) + (("</td><td><img src=\"") + ("" + (f.v.value) + ("\" style=\"")));
		if (((f.v.field).width) !== undefined) f.pc=102; else f.pc=103;
	},
	function (e,f) {
		f.pc=105;
		f.v["this"].html = "" + ((f.v["this"]).html) + (("width:") + ("" + ((f.v.field).width) + ("px;")));
	},
	function (e,f) {
		f.pc=104;
		f.s[0] = (((f.v.field).width)) != ((""));
	},
	function (e,f) { f.s[0] = false; },
	function (e,f) { var t1309 = f.s[0]; if (t1309) f.pc=101; else f.pc=105; },
/*105*/	function (e,f) { if (((f.v.field).height) !== undefined) f.pc=107; else f.pc=108; },
	function (e,f) {
		f.pc=110;
		f.v["this"].html = "" + ((f.v["this"]).html) + (("height:") + ("" + ((f.v.field).height) + ("px;")));
	},
	function (e,f) {
		f.pc=109;
		f.s[0] = (((f.v.field).height)) != ((""));
	},
	function (e,f) { f.s[0] = false; },
	function (e,f) { var t1311 = f.s[0]; if (t1311) f.pc=106; else f.pc=110; },
/*110*/	function (e,f) {
		f.pc=230;
		f.v["this"].html = "" + ((f.v["this"]).html) + ("\" /></td></tr>");
	},
	function (e,f) { if ((((f.v.field).type)) == (("textbox"))) f.pc=112; else f.pc=124; },
	function (e,f) {
		f.v.evalue = "";
		f.v.i = 0;
	},
	function (e,f) {
		f.pc=115;
		if (!(((f.v.i)) < (((f.v.value).length)))) f.pc=114;
	},
	function (e,f) { if ((((f.v.field).label)) != ((""))) f.pc=122; else f.pc=123; },
/*115*/	function (e,f) {
		f.v.ch = builtin__substr (f.v.value,f.v.i,1);
		if (!(builtin__preg_match ("/[A-Za-z0-9 ]/",f.v.ch))) f.pc=116; else f.pc=120;
	},
	function (e,f) {
		f.v.c = builtin__ord (f.v.ch);
		if (((f.v.c)) == ((10))) f.pc=117; else f.pc=118;
	},
	function (e,f) {
		f.pc=121;
		f.v.evalue = "" + (f.v.evalue) + ("\r\n");
	},
	function (e,f) { if (((f.v.c)) == ((13))) f.pc=121; else f.pc=119; },
	function (e,f) {
		f.pc=121;
		f.v.evalue = "" + (f.v.evalue) + (("&#") + ("" + (builtin__ord (f.v.ch)) + (";")));
	},
/*120*/	function (e,f) { f.v.evalue = "" + (f.v.evalue) + (f.v.ch); },
	function (e,f) {
		f.pc=113;
		e.php_push_var_lvalue (0, "i");
		e.php_postinc (1);
	},
	function (e,f) { f.v["this"].html = "" + ((f.v["this"]).html) + (("<tr><td style=\"text-align:right\">") + ("" + ((f.v.field).label) + (":</td><td></td></tr>"))); },
	function (e,f) {
		f.pc=230;
		f.v["this"].html = "" + ((f.v["this"]).html) + (("<tr><td colspan=\"2\"><textarea id=\"") + ("" + (f.v.fieldid) + (("\" name=\"") + ("" + ((f.v.field).name) + (("\" style=\"width:") + ("" + ((f.v.field).width) + (("px;height:") + ("" + ((f.v.field).height) + (("px;margin:15px;\">") + ("" + (f.v.evalue) + ("</textarea></td></tr>")))))))))));
	},
	function (e,f) { if ((((f.v.field).type)) == (("table"))) f.pc=125; else f.pc=139; },
/*125*/	function (e,f) {
		f.v["this"].html = "" + ((f.v["this"]).html) + ("<tr>");
		if ((((f.v.field).label)) != ((""))) f.pc=126; else f.pc=127;
	},
	function (e,f) {
		f.pc=128;
		f.v["this"].html = "" + ((f.v["this"]).html) + (("<td style=\"text-align:right\">") + ("" + ((f.v.field).label) + (":</td>")));
		f.v["this"].html = "" + ((f.v["this"]).html) + ("<td>");
	},
	function (e,f) { f.v["this"].html = "" + ((f.v["this"]).html) + ("<td colspan=\"2\">"); },
	function (e,f) {
		f.v["this"].html = "" + ((f.v["this"]).html) + ("<div style=\"");
		if (((f.v.field).width) !== undefined) f.pc=129; else f.pc=130;
	},
	function (e,f) { f.v["this"].html = "" + ((f.v["this"]).html) + (("width:") + ("" + ((f.v.field).width) + ("px;"))); },
/*130*/	function (e,f) { if (((f.v.field).height) !== undefined) f.pc=131; else f.pc=132; },
	function (e,f) { f.v["this"].html = "" + ((f.v["this"]).html) + (("height:") + ("" + ((f.v.field).height) + ("px;"))); },
	function (e,f) {
		f.v["this"].html = "" + ((f.v["this"]).html) + ("overflow:auto\">");
		f.v["this"].html = "" + ((f.v["this"]).html) + ("<table style=\"width:90%\">");
		f.v.odd = 1;
		f.v._k90 = e.enumkeys ((f.v.field).options);
	},
	function (e,f) {
		f.pc=135;
		if (!((f.v._k90).length)) f.pc=134;
	},
	function (e,f) {
		f.pc=230;
		f.v["this"].html = "" + ((f.v["this"]).html) + ("</table>");
		f.v["this"].html = "" + ((f.v["this"]).html) + ("</div>");
		f.v["this"].html = "" + ((f.v["this"]).html) + ("</td>");
		f.v["this"].html = "" + ((f.v["this"]).html) + ("</tr>");
	},
/*135*/	function (e,f) {
		f.v._i91 = (f.v._k90).shift();
		f.v.pagename = ((f.v.field).options)[(f.v._i91)];
		if (f.v.odd) f.pc=136; else f.pc=137;
	},
	function (e,f) {
		f.pc=138;
		f.v["this"].html = "" + ((f.v["this"]).html) + ("<tr class=\"comboodd\">");
	},
	function (e,f) { f.v["this"].html = "" + ((f.v["this"]).html) + ("<tr class=\"comboeven\">"); },
	function (e,f) {
		f.pc=133;
		f.v["this"].html = "" + ((f.v["this"]).html) + ("" + (f.v.pagename) + ("</tr>"));
		f.v.odd = !(f.v.odd);
	},
	function (e,f) { if ((((f.v.field).type)) == (("html"))) f.pc=140; else f.pc=146; },
/*140*/	function (e,f) { if (((f.v.field).label) !== undefined) f.pc=143; else f.pc=144; },
	function (e,f) {
		f.pc=230;
		f.v["this"].html = "" + ((f.v["this"]).html) + ("<tr><td style=\"text-align:right\">");
		f.v["this"].html = "" + ((f.v["this"]).html) + ("" + ((f.v.field).label) + (":"));
		f.v["this"].html = "" + ((f.v["this"]).html) + (("</td><td>") + ("" + ((f.v.field).html) + ("</td></tr>")));
	},
	function (e,f) {
		f.pc=230;
		f.v["this"].html = "" + ((f.v["this"]).html) + (("<tr><td colspan=\"2\">") + ("" + ((f.v.field).html) + ("</td></tr>")));
	},
	function (e,f) {
		f.pc=145;
		f.s[0] = (((f.v.field).label)) != ((""));
	},
	function (e,f) { f.s[0] = false; },
/*145*/	function (e,f) { var t1348 = f.s[0]; if (t1348) f.pc=141; else f.pc=142; },
	function (e,f) { if ((((f.v.field).type)) == (("query_expr"))) f.pc=147; else f.pc=152; },
	function (e,f) {
		f.v["this"].html = "" + ((f.v["this"]).html) + ("<tr><td style=\"text-align:right\">");
		if ((((f.v.field).label)) != ((""))) f.pc=148; else f.pc=149;
	},
	function (e,f) { f.v["this"].html = "" + ((f.v["this"]).html) + ("" + ((f.v.field).label) + (":")); },
	function (e,f) {
		f.s[0] = "\">";
		e.mcall (5, f.v.value, "render_start", (["edit", 0]));
	},
/*150*/	function (e,f) {
		var t1351 = f.s[1]; var t1352 = f.s[0]; 
		f.v["this"].html = "" + ((f.v["this"]).html) + (("</td><td><a href=\"#\" onclick=\"") + ("" + (t1351) + (t1352)));
		f.s[0] = builtin__ob_start ();
		e.smcall (3, dataitemdiv,"create", ([f.v.value, "render_text", false]));
	},
	function (e,f) {
		f.pc=230;
		f.v["this"].html = "" + ((f.v["this"]).html) + (builtin__ob_get_clean ());
		f.v["this"].html = "" + ((f.v["this"]).html) + ("</a></td></tr>");
	},
	function (e,f) { if ((((f.v.field).type)) == (("yesno"))) f.pc=153; else f.pc=173; },
	function (e,f) {
		f.v["this"].html = "" + ((f.v["this"]).html) + ("<tr><td style=\"text-align:right\">");
		if ((((f.v.field).label)) != ((""))) f.pc=154; else f.pc=155;
	},
	function (e,f) { f.v["this"].html = "" + ((f.v["this"]).html) + ("" + ((f.v.field).label) + (":")); },
/*155*/	function (e,f) {
		f.v["this"].html = "" + ((f.v["this"]).html) + (("</td><td><select id=\"") + ("" + (f.v.fieldid) + (("\" name=\"") + ("" + ((f.v.field).name) + ("\" style=\"")))));
		if (((f.v.field).width) !== undefined) f.pc=157; else f.pc=158;
	},
	function (e,f) {
		f.pc=160;
		f.v["this"].html = "" + ((f.v["this"]).html) + (("width:") + ("" + ((f.v.field).width) + ("px;")));
	},
	function (e,f) {
		f.pc=159;
		f.s[0] = (((f.v.field).width)) != ((""));
	},
	function (e,f) { f.s[0] = false; },
	function (e,f) { var t1360 = f.s[0]; if (t1360) f.pc=156; else f.pc=160; },
/*160*/	function (e,f) { if (((f.v.field).height) !== undefined) f.pc=162; else f.pc=163; },
	function (e,f) {
		f.pc=165;
		f.v["this"].html = "" + ((f.v["this"]).html) + (("height:") + ("" + ((f.v.field).height) + ("px;")));
	},
	function (e,f) {
		f.pc=164;
		f.s[0] = (((f.v.field).height)) != ((""));
	},
	function (e,f) { f.s[0] = false; },
	function (e,f) { var t1362 = f.s[0]; if (t1362) f.pc=161; else f.pc=165; },
/*165*/	function (e,f) {
		f.v["this"].html = "" + ((f.v["this"]).html) + ("\"");
		if ((f.v["this"]).use_onchange) f.pc=166; else f.pc=168;
	},
	function (e,f) {
		f.s[0] = "\"";
		e.mcall (5, f.v["this"], "render_resume", (["form_changed", (f.v.field).name]));
	},
	function (e,f) {
		var t1364 = f.s[1]; var t1365 = f.s[0]; 
		f.v["this"].html = "" + ((f.v["this"]).html) + ((" onchange=\"") + ("" + (t1364) + (t1365)));
	},
	function (e,f) {
		f.v["this"].html = "" + ((f.v["this"]).html) + (">");
		f.v["this"].html = "" + ((f.v["this"]).html) + ("<option value=\"1\"");
		if (((f.v.value)) == ((1))) f.pc=169; else f.pc=170;
	},
	function (e,f) { f.v["this"].html = "" + ((f.v["this"]).html) + (" selected=\"selected\""); },
/*170*/	function (e,f) {
		f.v["this"].html = "" + ((f.v["this"]).html) + (">yes</option>");
		f.v["this"].html = "" + ((f.v["this"]).html) + ("<option value=\"0\"");
		if (((f.v.value)) == ((0))) f.pc=171; else f.pc=172;
	},
	function (e,f) { f.v["this"].html = "" + ((f.v["this"]).html) + (" selected=\"selected\""); },
	function (e,f) {
		f.pc=230;
		f.v["this"].html = "" + ((f.v["this"]).html) + (">no</option>");
		f.v["this"].html = "" + ((f.v["this"]).html) + ("</select>");
		f.v["this"].html = "" + ((f.v["this"]).html) + ("</td></tr>");
	},
	function (e,f) { if ((((f.v.field).type)) == (("list"))) f.pc=174; else f.pc=195; },
	function (e,f) {
		f.v["this"].html = "" + ((f.v["this"]).html) + ("<tr><td style=\"text-align:right\">");
		if ((((f.v.field).label)) != ((""))) f.pc=175; else f.pc=176;
	},
/*175*/	function (e,f) { f.v["this"].html = "" + ((f.v["this"]).html) + ("" + ((f.v.field).label) + (":")); },
	function (e,f) {
		f.v["this"].html = "" + ((f.v["this"]).html) + (("</td><td><select id=\"") + ("" + (f.v.fieldid) + (("\" name=\"") + ("" + ((f.v.field).name) + ("\" style=\"")))));
		if (((f.v.field).width) !== undefined) f.pc=178; else f.pc=179;
	},
	function (e,f) {
		f.pc=181;
		f.v["this"].html = "" + ((f.v["this"]).html) + (("width:") + ("" + ((f.v.field).width) + ("px;")));
	},
	function (e,f) {
		f.pc=180;
		f.s[0] = (((f.v.field).width)) != ((""));
	},
	function (e,f) { f.s[0] = false; },
/*180*/	function (e,f) { var t1380 = f.s[0]; if (t1380) f.pc=177; else f.pc=181; },
	function (e,f) { if (((f.v.field).height) !== undefined) f.pc=183; else f.pc=184; },
	function (e,f) {
		f.pc=186;
		f.v["this"].html = "" + ((f.v["this"]).html) + (("height:") + ("" + ((f.v.field).height) + ("px;")));
	},
	function (e,f) {
		f.pc=185;
		f.s[0] = (((f.v.field).height)) != ((""));
	},
	function (e,f) { f.s[0] = false; },
/*185*/	function (e,f) { var t1382 = f.s[0]; if (t1382) f.pc=182; else f.pc=186; },
	function (e,f) {
		f.v["this"].html = "" + ((f.v["this"]).html) + ("\"");
		if ((f.v["this"]).use_onchange) f.pc=187; else f.pc=189;
	},
	function (e,f) {
		f.s[0] = "\"";
		e.mcall (5, f.v["this"], "render_resume", (["form_changed", (f.v.field).name]));
	},
	function (e,f) {
		var t1384 = f.s[1]; var t1385 = f.s[0]; 
		f.v["this"].html = "" + ((f.v["this"]).html) + ((" onchange=\"") + ("" + (t1384) + (t1385)));
	},
	function (e,f) {
		f.v["this"].html = "" + ((f.v["this"]).html) + (">");
		f.v._k92 = e.enumkeys ((f.v.field).options);
	},
/*190*/	function (e,f) {
		f.pc=192;
		if (!((f.v._k92).length)) f.pc=191;
	},
	function (e,f) {
		f.pc=230;
		f.v["this"].html = "" + ((f.v["this"]).html) + ("</select>");
		f.v["this"].html = "" + ((f.v["this"]).html) + ("</td></tr>");
	},
	function (e,f) {
		f.v._i93 = (f.v._k92).shift();
		f.v.xvalue = ((f.v.field).options)[(f.v._i93)];
		f.v["this"].html = "" + ((f.v["this"]).html) + (("<option value=\"") + ("" + (f.v.xvalue) + ("\"")));
		if (((f.v.value)) == ((f.v.xvalue))) f.pc=193; else f.pc=194;
	},
	function (e,f) { f.v["this"].html = "" + ((f.v["this"]).html) + (" selected=\"selected\""); },
	function (e,f) {
		f.pc=190;
		f.v["this"].html = "" + ((f.v["this"]).html) + ((">") + ("" + (f.v.xvalue) + ("</option>")));
	},
/*195*/	function (e,f) { if ((((f.v.field).type)) == (("enum"))) f.pc=196; else f.pc=217; },
	function (e,f) {
		f.v["this"].html = "" + ((f.v["this"]).html) + ("<tr><td style=\"text-align:right\">");
		if ((((f.v.field).label)) != ((""))) f.pc=197; else f.pc=198;
	},
	function (e,f) { f.v["this"].html = "" + ((f.v["this"]).html) + ("" + ((f.v.field).label) + (":")); },
	function (e,f) {
		f.v["this"].html = "" + ((f.v["this"]).html) + (("</td><td><select id=\"") + ("" + (f.v.fieldid) + (("\" name=\"") + ("" + ((f.v.field).name) + ("\" style=\"")))));
		if (((f.v.field).width) !== undefined) f.pc=200; else f.pc=201;
	},
	function (e,f) {
		f.pc=203;
		f.v["this"].html = "" + ((f.v["this"]).html) + (("width:") + ("" + ((f.v.field).width) + ("px;")));
	},
/*200*/	function (e,f) {
		f.pc=202;
		f.s[0] = (((f.v.field).width)) != ((""));
	},
	function (e,f) { f.s[0] = false; },
	function (e,f) { var t1400 = f.s[0]; if (t1400) f.pc=199; else f.pc=203; },
	function (e,f) { if (((f.v.field).height) !== undefined) f.pc=205; else f.pc=206; },
	function (e,f) {
		f.pc=208;
		f.v["this"].html = "" + ((f.v["this"]).html) + (("height:") + ("" + ((f.v.field).height) + ("px;")));
	},
/*205*/	function (e,f) {
		f.pc=207;
		f.s[0] = (((f.v.field).height)) != ((""));
	},
	function (e,f) { f.s[0] = false; },
	function (e,f) { var t1402 = f.s[0]; if (t1402) f.pc=204; else f.pc=208; },
	function (e,f) {
		f.v["this"].html = "" + ((f.v["this"]).html) + ("\"");
		if ((f.v["this"]).use_onchange) f.pc=209; else f.pc=211;
	},
	function (e,f) {
		f.s[0] = "\"";
		e.mcall (5, f.v["this"], "render_resume", (["form_changed", (f.v.field).name]));
	},
/*210*/	function (e,f) {
		var t1404 = f.s[1]; var t1405 = f.s[0]; 
		f.v["this"].html = "" + ((f.v["this"]).html) + ((" onchange=\"") + ("" + (t1404) + (t1405)));
	},
	function (e,f) {
		f.v["this"].html = "" + ((f.v["this"]).html) + (">");
		f.v._k94 = e.enumkeys ((f.v.field).options);
	},
	function (e,f) {
		f.pc=214;
		if (!((f.v._k94).length)) f.pc=213;
	},
	function (e,f) {
		f.pc=230;
		f.v["this"].html = "" + ((f.v["this"]).html) + ("</select>");
		f.v["this"].html = "" + ((f.v["this"]).html) + ("</td></tr>");
	},
	function (e,f) {
		f.v.xkey = (f.v._k94).shift();
		f.v.xvalue = ((f.v.field).options)[(f.v.xkey)];
		f.v["this"].html = "" + ((f.v["this"]).html) + (("<option value=\"") + ("" + (f.v.xkey) + ("\"")));
		if (((f.v.value)) == ((f.v.xkey))) f.pc=215; else f.pc=216;
	},
/*215*/	function (e,f) { f.v["this"].html = "" + ((f.v["this"]).html) + (" selected=\"selected\""); },
	function (e,f) {
		f.pc=212;
		f.v["this"].html = "" + ((f.v["this"]).html) + ((">") + ("" + (f.v.xvalue) + ("</option>")));
	},
	function (e,f) { if ((((f.v.field).type)) == (("button"))) f.pc=230; else f.pc=218; },
	function (e,f) {
		f.pc=230;
		f.v["this"].html = "" + ((f.v["this"]).html) + (("Don't know how to render a ") + ((f.v.field).type));
	},
	function (e,f) {
		f.pc=229;
		f.s[0] = true;
	},
/*220*/	function (e,f) { if ((((f.v.field).type)) == (("password"))) f.pc=221; else f.pc=222; },
	function (e,f) {
		f.pc=229;
		f.s[0] = true;
	},
	function (e,f) { if ((((f.v.field).type)) == (("postcode"))) f.pc=223; else f.pc=224; },
	function (e,f) {
		f.pc=229;
		f.s[0] = true;
	},
	function (e,f) { if ((((f.v.field).type)) == (("dn"))) f.pc=225; else f.pc=226; },
/*225*/	function (e,f) {
		f.pc=229;
		f.s[0] = true;
	},
	function (e,f) { if ((((f.v.field).type)) == (("integer"))) f.pc=227; else f.pc=228; },
	function (e,f) {
		f.pc=229;
		f.s[0] = true;
	},
	function (e,f) { f.s[0] = (((f.v.field).type)) == (("price")); },
	function (e,f) { var t1417 = f.s[0]; if (t1417) f.pc=14; else f.pc=41; },
/*230*/	function (e,f) { if (((f.v.field).focus) !== undefined) f.pc=231; else f.pc=3; },
	function (e,f) {
		f.pc=3;
		f.v["this"].focusfield = f.v.fieldid;
	},
	function (e,f) {
		f.pc=234;
		if (!((f.v._k96).length)) f.pc=233;
	},
	function (e,f) { if ((f.v["this"]).use_ok) f.pc=237; else f.pc=241; },
	function (e,f) {
		f.v._i97 = (f.v._k96).shift();
		f.v.field = ((f.v["this"]).fields)[(f.v._i97)];
		f.s[0] = (":") + ((f.v.field).name);
		e.mcall (3, f.v["this"], "get_id", ([]));
	},
/*235*/	function (e,f) {
		var t1421 = f.s[1]; var t1422 = f.s[0]; 
		f.v.fieldid = "" + (t1421) + (t1422);
		if ((((f.v.field).type)) == (("button"))) f.pc=236; else f.pc=232;
	},
	function (e,f) {
		f.pc=232;
		f.v["this"].html = "" + ((f.v["this"]).html) + (("<input id=\"") + ("" + (f.v.fieldid) + (("\" type=\"button\" name=\"") + ("" + ((f.v.field).name) + (("\" value=\"") + ("" + ((f.v.field).label) + (("\" onclick=\"") + ("" + ((f.v.field).action) + ("\"/>")))))))));
	},
	function (e,f) {
		f.s[0] = ":OK-button";
		e.mcall (3, f.v["this"], "get_id", ([]));
	},
	function (e,f) {
		var t1425 = f.s[1]; var t1426 = f.s[0]; 
		f.v.fieldid = "" + (t1425) + (t1426);
		if ((((f.v["this"]).focusfield)) == ((null))) f.pc=239; else f.pc=240;
	},
	function (e,f) { f.v["this"].focusfield = f.v.fieldid; },
/*240*/	function (e,f) { f.v["this"].html = "" + ((f.v["this"]).html) + (("<input id=\"") + ("" + (f.v.fieldid) + ("\" type=\"submit\" style=\"width:60px\" value=\"Ok\">"))); },
	function (e,f) { if ((f.v["this"]).use_cancel) f.pc=242; else f.pc=247; },
	function (e,f) {
		f.s[0] = ":cancel-button";
		e.mcall (3, f.v["this"], "get_id", ([]));
	},
	function (e,f) {
		var t1430 = f.s[1]; var t1431 = f.s[0]; 
		f.v.fieldid = "" + (t1430) + (t1431);
		if ((((f.v["this"]).focusfield)) == ((null))) f.pc=244; else f.pc=245;
	},
	function (e,f) { f.v["this"].focusfield = f.v.fieldid; },
/*245*/	function (e,f) {
		f.s[0] = "\">";
		e.smcall (3, popupform,"render_resume", (["cancel", null]));
	},
	function (e,f) {
		var t1434 = f.s[1]; var t1435 = f.s[0]; 
		f.v["this"].html = "" + ((f.v["this"]).html) + (("<input id=\"") + ("" + (f.v.fieldid) + (("\" type=\"button\" style=\"width:60px\" value=\"Cancel\" onclick=\"") + ("" + (t1434) + (t1435)))));
	},
	function (e,f) {
		f.v["this"].html = "" + ((f.v["this"]).html) + ("</td></tr>");
		f.v["this"].html = "" + ((f.v["this"]).html) + ("</table></form>");
	},
null	];

;
	c.pargs__initialise =  ["width","height","title","fields"];
	c.pinst__initialise =  [
/*0*/	function (e,f) {
		f.v["this"].use_ok = true;
		f.v["this"].use_cancel = true;
		f.v["this"].use_onchange = false;
		f.v["this"].title = f.v.title;
		f.v["this"].fields = f.v.fields;
		e.mcall (2, f.v["this"], "render", ([]));
	},
	function (e,f) {
		f.v["this"].width = f.v.width;
		f.v["this"].height = f.v.height;
		f.v["this"].pop = new popup;
		e.mcall (3, (f.v["this"]).pop, "initialise", ([f.v["this"]]));
	},
null	];

;
	c.pargs__use_ok_cancel =  ["use_ok","use_cancel"];
	c.pinst__use_ok_cancel =  [
/*0*/	function (e,f) {
		f.v["this"].use_ok = f.v.use_ok;
		f.v["this"].use_cancel = f.v.use_cancel;
		e.mcall (2, f.v["this"], "render", ([]));
	},
null	];

;
	c.pargs__send_changes =  [];
	c.pinst__send_changes =  [
/*0*/	function (e,f) {
		f.v["this"].use_onchange = true;
		e.mcall (2, f.v["this"], "render", ([]));
	},
null	];

;
	c.pargs__set_element =  ["el"];
	c.pinst__set_element =  [
/*0*/	function (e,f) { e.mcall (3, (f.v["this"]).pop, "set_element", ([f.v.el])); },
null	];

;
	c.pargs__open =  [];
	c.pinst__open =  [
/*0*/	function (e,f) { e.mcall (5, (f.v["this"]).pop, "open", ([(f.v["this"]).width, (f.v["this"]).height, (f.v["this"]).html])); },
	function (e,f) { if ((f.v["this"]).focusfield) f.pc=2; else f.pc=-1; },
	function (e,f) {
		f.s[0] = "focus";
		e.mcall (4, document, "getElementById", ([(f.v["this"]).focusfield]));
	},
	function (e,f) { var t1450 = f.s[1]; var t1451 = f.s[0]; e.mcall (2, t1450, t1451, ([])); },
null	];

;
	c.pargs__set_content =  ["fields"];
	c.pinst__set_content =  [
/*0*/	function (e,f) {
		f.v["this"].fields = f.v.fields;
		e.mcall (2, f.v["this"], "render", ([]));
	},
	function (e,f) { e.mcall (3, (f.v["this"]).pop, "set_content", ([(f.v["this"]).html])); },
	function (e,f) { if ((f.v["this"]).focusfield) f.pc=3; else f.pc=-1; },
	function (e,f) {
		f.s[0] = "focus";
		e.mcall (4, document, "getElementById", ([(f.v["this"]).focusfield]));
	},
	function (e,f) { var t1453 = f.s[1]; var t1454 = f.s[0]; e.mcall (2, t1453, t1454, ([])); },
null	];

;
	c.pargs__get_form_fields =  [];
	c.pinst__get_form_fields =  [
/*0*/	function (e,f) {
		f.s[0] = "-form";
		e.mcall (3, f.v["this"], "get_id", ([]));
	},
	function (e,f) {
		var t1455 = f.s[1]; var t1456 = f.s[0]; 
		e.mcall (3, document, "getElementById", (["" + (t1455) + (t1456)]));
	},
	function (e,f) {
		var t1458 = f.s[0]; f.v.form = t1458;
		f.v.results = ({});
		f.v._k98 = e.enumkeys ((f.v["this"]).fields);
	},
	function (e,f) {
		f.pc=5;
		if (!((f.v._k98).length)) f.pc=4;
	},
	function (e,f) { e.return_pop (f.v.results); },
/*5*/	function (e,f) {
		f.v._i99 = (f.v._k98).shift();
		f.v.field = ((f.v["this"]).fields)[(f.v._i99)];
		if (((f.v.field).name) !== undefined) f.pc=6; else f.pc=3;
	},
	function (e,f) {
		f.v.n = (f.v.field).name;
		if ((((f.v.field).type)) == (("datetime"))) f.pc=7; else f.pc=8;
	},
	function (e,f) {
		f.pc=3;
		f.v.value = ((f.v.form)[("" + (f.v.n) + ("-date"))]).value;
		f.v.value2 = ((f.v.form)[("" + (f.v.n) + ("-time"))]).value;
		f.v.value = builtin__parse_mysql_datetime ("" + (f.v.value) + ((" ") + ("" + (f.v.value2) + (":00"))));
		f.v.results[f.v.n] = f.v.value;
	},
	function (e,f) { if ((((f.v.field).type)) == (("date"))) f.pc=9; else f.pc=10; },
	function (e,f) {
		f.pc=3;
		f.v.value = ((f.v.form)[("" + (f.v.n) + ("-date"))]).value;
		f.v.value = builtin__parse_mysql_datetime ("" + (f.v.value) + (" 00:00:00"));
		f.v.results[f.v.n] = f.v.value;
	},
/*10*/	function (e,f) { if ((((f.v.field).type)) == (("price"))) f.pc=11; else f.pc=13; },
	function (e,f) { e.smcall (1, lib,"parse_price_simple", ([((f.v.form)[(f.v.n)]).value])); },
	function (e,f) {
		f.pc=3;
		var t1472 = f.s[0]; f.v.results[f.v.n] = t1472;
	},
	function (e,f) { if (((f.v.form)[(f.v.n)]) !== undefined) f.pc=14; else f.pc=20; },
	function (e,f) { if ((((f.v.form)[(f.v.n)]).value) !== undefined) f.pc=15; else f.pc=3; },
/*15*/	function (e,f) {
		f.v.value = ((f.v.form)[(f.v.n)]).value;
		if ((((f.v.field).type)) == (("textbox"))) f.pc=16; else f.pc=17;
	},
	function (e,f) {
		f.pc=19;
		f.v.value = builtin__preg_replace ("/([^\r])[\n]/","$1\r\n",f.v.value);
	},
	function (e,f) { if ((((f.v.field).type)) == (("time"))) f.pc=18; else f.pc=19; },
	function (e,f) { f.v.value = parseInt((builtin__parse_mysql_datetime (("2000-01-01 ") + (f.v.value))),10) - parseInt((builtin__mktime (0,0,0,1,1,2000)),10); },
	function (e,f) {
		f.pc=3;
		f.v.results[f.v.n] = f.v.value;
	},
/*20*/	function (e,f) {
		f.pc=3;
		f.v.results[f.v.n] = (f.v.field).value;
	},
null	];

;
	c.pargs__run =  [];
	c.pinst__run =  [
/*0*/	function (e,f) { e.php_builtin (0, "wait_for_input", 0); },
	function (e,f) { var t1478 = f.s[0]; e.return_pop (t1478); },
null	];

;
	c.pargs__close =  [];
	c.pinst__close =  [
/*0*/	function (e,f) { e.mcall (2, (f.v["this"]).pop, "close", ([])); },
null	];

;
	c.pargs__close_by_hiding =  [];
	c.pinst__close_by_hiding =  [
/*0*/	function (e,f) { e.mcall (2, (f.v["this"]).pop, "close_by_hiding", ([])); },
null	];

;
	c.args__quick = c.pargs__quick =  ["title","fields","use_ok","use_cancel"];
	c.inst__quick = c.pinst__quick =  [
/*0*/	function (e,f) {
		f.v.pop = new popupform;
		e.mcall (6, f.v.pop, "initialise", ([0, 0, f.v.title, f.v.fields]));
	},
	function (e,f) { e.mcall (4, f.v.pop, "use_ok_cancel", ([f.v.use_ok, f.v.use_cancel])); },
	function (e,f) { e.mcall (2, f.v.pop, "open", ([])); },
	function (e,f) { f.v.res = null; },
	function (e,f) {
		f.pc=6;
		e.mcall (2, f.v.pop, "run", ([]));
	},
/*5*/	function (e,f) {
		f.pc=13;
		e.mcall (2, f.v.pop, "close", ([]));
	},
	function (e,f) {
		var t1482 = f.s[0]; f.v.event = t1482;
		f.v.action = (f.v.event).action;
		if (((f.v.action)) == (("cover"))) f.pc=8; else f.pc=9;
	},
	function (e,f) { if (((f.v.action)) == (("OK"))) f.pc=11; else f.pc=4; },
	function (e,f) {
		f.pc=10;
		f.s[0] = true;
	},
	function (e,f) { f.s[0] = ((f.v.action)) == (("cancel")); },
/*10*/	function (e,f) { var t1484 = f.s[0]; if (t1484) f.pc=5; else f.pc=7; },
	function (e,f) { e.mcall (2, f.v.pop, "get_form_fields", ([])); },
	function (e,f) {
		f.pc=5;
		var t1486 = f.s[0]; f.v.res = t1486;
	},
	function (e,f) { e.return_pop (f.v.res); },
null	];

;
};
popupform.init_methods (popupform);
rpcclass.setup_class (popupform, "popupform",0, (["pop","html","width","height","listeners"]), ([0,0,0,0,2]));
function popupdate () { this.do_construct (arguments); }
popupdate.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
	c.pargs__render =  [];
	c.pinst__render =  [
/*0*/	function (e,f) {
		f.v.month = builtin__date ("m",(f.v["this"]).curdate);
		f.v.year = builtin__date ("Y",(f.v["this"]).curdate);
		f.v.prevmonth = builtin__mktime (0,0,0,parseInt((f.v.month),10) - parseInt((1),10),1,f.v.year);
		f.v.nextmonth = builtin__mktime (0,0,0,parseInt((f.v.month),10) + parseInt((1),10),1,f.v.year);
		f.s[0] = builtin__ob_start ();
		window.__outbuffer += "\n<div style=\"text-align:center;width:205px;font-family:arial\">\n<a style=\"float:left;font-size:70%\" href=\"#\" onclick=\"";
		e.mcall (4, f.v["this"], "render_resume", (["move", f.v.prevmonth]));
	},
	function (e,f) {
		var t1491 = f.s[0]; window.__outbuffer += t1491;
		window.__outbuffer += "\">&lt;&lt;";
		window.__outbuffer += builtin__date ("M-y",f.v.prevmonth);
		window.__outbuffer += "</a>\n<a style=\"float:right;font-size:70%\" href=\"#\" onclick=\"";
		e.mcall (4, f.v["this"], "render_resume", (["move", f.v.nextmonth]));
	},
	function (e,f) {
		var t1492 = f.s[0]; window.__outbuffer += t1492;
		window.__outbuffer += "\">";
		window.__outbuffer += builtin__date ("M-y",f.v.nextmonth);
		window.__outbuffer += "&gt;&gt;</a>\n";
		window.__outbuffer += builtin__date ("F",(f.v["this"]).curdate);
		window.__outbuffer += "<br/>\n";
		window.__outbuffer += builtin__date ("Y",(f.v["this"]).curdate);
		window.__outbuffer += "\n</div>\n\n<table class=\"popupdate\">\n<tr>\n";
		f.v.i = 0;
	},
	function (e,f) {
		f.pc=5;
		if (!(((f.v.i)) < ((7)))) f.pc=4;
	},
	function (e,f) {
		f.pc=6;
		window.__outbuffer += "</tr>";
		f.v.dim = builtin__cal_days_in_month (0,f.v.month,f.v.year);
		f.v.dow = builtin__date ("w",builtin__mktime (0,0,0,f.v.month,1,f.v.year));
		f.v.firstday = parseInt((1),10) - parseInt((f.v.dow),10);
		f.v.taildays = parseInt((7),10) - parseInt((((parseInt((f.v.dow),10) + parseInt((f.v.dim),10))) % ((7))),10);
		f.v.lastday = parseInt((f.v.dim),10) + parseInt((f.v.taildays),10);
		f.v.day = f.v.firstday;
	},
/*5*/	function (e,f) {
		f.pc=3;
		f.v.day = builtin__date ("D",builtin__mktime (0,0,0,1,parseInt((f.v.i),10) + parseInt((2),10),2000));
		window.__outbuffer += ("<th>") + ("" + (f.v.day) + ("</th>"));
		e.php_push_var_lvalue (0, "i");
		e.php_postinc (1);
	},
	function (e,f) {
		f.pc=8;
		f.s[0] = f.v.lastday;
		f.s[1] = f.v.day;
		e.php_two_op (2, "<=");
		var t1502 = f.s[0]; if (!(t1502)) f.pc=7;
	},
	function (e,f) { if (((f.v.dow)) != ((6))) f.pc=20; else f.pc=21; },
	function (e,f) {
		f.v.thisday = builtin__mktime (0,0,0,f.v.month,f.v.day,f.v.year);
		f.v.dow = builtin__date ("w",f.v.thisday);
		if (((f.v.dow)) == ((0))) f.pc=9; else f.pc=10;
	},
	function (e,f) { window.__outbuffer += "<tr>"; },
/*10*/	function (e,f) {
		f.v.style = "";
		f.v.boxstyle = "";
		if (((f.v.thisday)) == (((f.v["this"]).olddate))) f.pc=11; else f.pc=12;
	},
	function (e,f) { f.v.boxstyle = "" + (f.v.boxstyle) + ("background:#c0c0ff;"); },
	function (e,f) { if (((builtin__date ("m",f.v.thisday))) != ((builtin__date ("m",(f.v["this"]).curdate)))) f.pc=13; else f.pc=14; },
	function (e,f) { f.v.style = "" + (f.v.style) + ("color:#c0c0c0;"); },
	function (e,f) { if (((f.v.thisday)) == (((f.v["this"]).today))) f.pc=15; else f.pc=16; },
/*15*/	function (e,f) { f.v.style = "" + (f.v.style) + ("border: solid 1px red;"); },
	function (e,f) {
		f.v.boxstyle = "" + (f.v.boxstyle) + ("text-align:center;");
		f.v.style = "" + (f.v.style) + ("text-decoration:none;");
		window.__outbuffer += ("<td style=\"") + ("" + (f.v.boxstyle) + ("\">"));
		f.s[0] = ("\">") + ("" + (builtin__date ("j",f.v.thisday)) + ("</a>"));
		e.mcall (5, f.v["this"], "render_resume", (["pick_date", f.v.thisday]));
	},
	function (e,f) {
		var t1512 = f.s[1]; var t1513 = f.s[0]; 
		window.__outbuffer += ("<a class=\"calendarButtons\" style=\"") + ("" + (f.v.style) + (("\" href=\"#\" onclick=\"") + ("" + (t1512) + (t1513))));
		window.__outbuffer += "</td>";
		if (((f.v.dow)) == ((6))) f.pc=18; else f.pc=19;
	},
	function (e,f) { window.__outbuffer += "</tr>"; },
	function (e,f) {
		f.pc=6;
		e.php_push_var_lvalue (0, "day");
		e.php_postinc (1);
	},
/*20*/	function (e,f) { window.__outbuffer += "</tr>"; },
	function (e,f) {
		window.__outbuffer += "\n</table>\n";
		e.return_pop (builtin__ob_get_clean ());
	},
null	];

;
	c.pargs__fields =  [];
	c.pinst__fields =  [
/*0*/	function (e,f) { e.mcall (2, f.v["this"], "render", ([])); },
	function (e,f) {
		var t1515 = f.s[0]; 
		f.v.res = ([({name:"cal", type:"html", html:t1515})]);
		f.v.this_month = builtin__mktime (0,0,0,builtin__date ("m"),builtin__date ("d"),builtin__date ("Y"));
		if (((builtin__date ("Y-m"))) != ((builtin__date ("Y-m",(f.v["this"]).curdate)))) f.pc=2; else f.pc=4;
	},
	function (e,f) { e.mcall (4, f.v["this"], "render_resume", (["move", f.v.this_month])); },
	function (e,f) {
		var t1518 = f.s[0]; 
		f.v.res[f.v.res.length] = ({name:"today", type:"button", label:"This month", action:t1518});
	},
	function (e,f) { e.return_pop (f.v.res); },
null	];

;
	c.pargs__run_dialog =  [];
	c.pinst__run_dialog =  [
/*0*/	function (e,f) {
		f.v["this"].today = builtin__mktime (0,0,0,builtin__date ("m"),builtin__date ("d"),builtin__date ("Y"));
		f.v.pop = new popupform;
		e.mcall (2, f.v["this"], "fields", ([]));
	},
	function (e,f) { var t1522 = f.s[0]; e.mcall (6, f.v.pop, "initialise", ([220, 250, (f.v["this"]).title, t1522])); },
	function (e,f) { e.mcall (4, f.v.pop, "use_ok_cancel", ([false, true])); },
	function (e,f) { e.mcall (2, f.v.pop, "open", ([])); },
	function (e,f) { f.v["this"].result = null; },
/*5*/	function (e,f) {
		f.pc=7;
		e.mcall (2, f.v["this"], "fields", ([]));
	},
	function (e,f) {
		f.pc=-1;
		e.mcall (2, f.v.pop, "close", ([]));
	},
	function (e,f) { var t1524 = f.s[0]; e.mcall (3, f.v.pop, "set_content", ([t1524])); },
	function (e,f) { e.mcall (2, f.v.pop, "run", ([])); },
	function (e,f) {
		var t1526 = f.s[0]; f.v.event = t1526;
		f.v.action = (f.v.event).action;
		if (((f.v.action)) == (("cover"))) f.pc=15; else f.pc=16;
	},
/*10*/	function (e,f) { f.pc=6; },
	function (e,f) { if (((f.v.action)) == (("move"))) f.pc=12; else f.pc=13; },
	function (e,f) {
		f.pc=5;
		f.v["this"].curdate = (f.v.event).parm;
	},
	function (e,f) { if (((f.v.action)) == (("pick_date"))) f.pc=14; else f.pc=5; },
	function (e,f) {
		f.pc=6;
		f.v["this"].result = (f.v.event).parm;
	},
/*15*/	function (e,f) {
		f.pc=17;
		f.s[0] = true;
	},
	function (e,f) { f.s[0] = ((f.v.action)) == (("cancel")); },
	function (e,f) { var t1530 = f.s[0]; if (t1530) f.pc=10; else f.pc=11; },
null	];

;
	c.args__run = c.pargs__run =  ["title","olddate"];
	c.inst__run = c.pinst__run =  [
/*0*/	function (e,f) {
		f.v.pd = new popupdate;
		f.v.pd.title = f.v.title;
		f.v.pd.result = f.v.olddate;
		f.v.pd.olddate = f.v.olddate;
		f.v.pd.curdate = f.v.olddate;
		e.mcall (2, f.v.pd, "run_dialog", ([]));
	},
	function (e,f) { e.return_pop ((f.v.pd).result); },
null	];

;
};
popupdate.init_methods (popupdate);
rpcclass.setup_class (popupdate, "popupdate",0, (["olddate","curdate","title","listeners"]), ([0,0,0,2]));
function menu () { this.do_construct (arguments); }
menu.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
	c.args__create = c.pargs__create =  [];
	c.inst__create = c.pinst__create =  [
/*0*/	function (e,f) {
		f.v.x = new menu;
		f.v.x.list = ([]);
		e.return_pop (f.v.x);
	},
null	];

;
	c.pargs__add_item =  ["key","text"];
	c.pinst__add_item =  [
/*0*/	function (e,f) {
		f.v.item = ({});
		f.v.item.key = f.v.key;
		f.v.item.value = f.v.text;
		(f.v["this"]).list[(f.v["this"]).list.length] = f.v.item;
	},
null	];

;
	c.pargs__add_submenu =  ["text","submenu"];
	c.pinst__add_submenu =  [
/*0*/	function (e,f) {
		f.v.item = ({});
		f.v.item.value = f.v.text;
		f.v.item.submenu = f.v.submenu;
		(f.v["this"]).list[(f.v["this"]).list.length] = f.v.item;
	},
null	];

;
	c.compare_values = cp.compare_values =  function (row1,row2)
	{
{
		if (row1["value"] < row2["value"])
		{return (0 - 1) }
		;
		if (row1["value"] > row2["value"])
		{return (1) }
		;
		return (0);
		}
			}

;
	c.pargs__sort =  [];
	c.pinst__sort =  [
/*0*/	function (e,f) { f.s[0] = builtin__usort ((f.v["this"]).list,(["menu", "compare_values"])); },
null	];

;
	c.pargs__length =  [];
	c.pinst__length =  [
/*0*/	function (e,f) { e.return_pop (builtin__count ((f.v["this"]).list)); },
null	];

;
	c.pargs__item =  ["i"];
	c.pinst__item =  [
/*0*/	function (e,f) { e.return_pop (((f.v["this"]).list)[(f.v.i)]); },
null	];

;
	c.pargs__get =  ["value"];
	c.pinst__get =  [
/*0*/	function (e,f) { f.v._k100 = e.enumkeys ((f.v["this"]).list); },
	function (e,f) {
		f.pc=3;
		if (!((f.v._k100).length)) f.pc=2;
	},
	function (e,f) { e.return_pop (null); },
	function (e,f) {
		f.v._i101 = (f.v._k100).shift();
		f.v.item = ((f.v["this"]).list)[(f.v._i101)];
		f.s[0] = builtin__debugout (("item['value'] = ") + ((f.v.item).value));
		if ((((f.v.item).value)) == ((f.v.value))) f.pc=4; else f.pc=1;
	},
	function (e,f) { if (((f.v.item).submenu) !== undefined) f.pc=5; else f.pc=6; },
/*5*/	function (e,f) { e.return_pop ((f.v.item).submenu); },
	function (e,f) { e.return_pop ((f.v.item).key); },
null	];

;
};
menu.init_methods (menu);
rpcclass.setup_class (menu, "menu",0, (["list","listeners"]), ([0,2]));
function popupmenu () { this.do_construct (arguments); }
popupmenu.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
	c.args__open_menu = c.pargs__open_menu =  ["menuitems","depth","x","y","no_cover"];
	c.inst__open_menu = c.pinst__open_menu =  [
/*0*/	function (e,f) {
		f.v.columns = parseInt (parseInt((((builtin__count ((f.v.menuitems).list))) / ((30))),10) + parseInt((1),10),10);
		if (((builtin__count ((f.v.menuitems).list))) > ((30))) f.pc=1; else f.pc=2;
	},
	function (e,f) {
		f.pc=3;
		f.s[0] = 30;
	},
	function (e,f) { f.s[0] = builtin__count ((f.v.menuitems).list); },
	function (e,f) {
		var t1551 = f.s[0]; f.v.rows = t1551;
		f.v.popup = new popup;
		e.mcall (2, f.v.popup, "initialise", ([]));
	},
	function (e,f) { if (((f.v.x)) != ((parseInt((0),10) - parseInt((1),10)))) f.pc=6; else f.pc=7; },
/*5*/	function (e,f) {
		f.pc=9;
		e.mcall (4, f.v.popup, "set_coordinates", ([f.v.x, f.v.y]));
	},
	function (e,f) {
		f.pc=8;
		f.s[0] = ((f.v.y)) != ((parseInt((0),10) - parseInt((1),10)));
	},
	function (e,f) { f.s[0] = false; },
	function (e,f) { var t1553 = f.s[0]; if (t1553) f.pc=5; else f.pc=9; },
	function (e,f) { if (f.v.no_cover) f.pc=10; else f.pc=11; },
/*10*/	function (e,f) { e.mcall (2, f.v.popup, "no_cover", ([])); },
	function (e,f) {
		f.v.contents = "";
		f.v.divopen = false;
		f.v.i = 0;
	},
	function (e,f) {
		f.pc=14;
		if (!(((f.v.i)) < ((builtin__count ((f.v.menuitems).list))))) f.pc=13;
	},
	function (e,f) { if (f.v.divopen) f.pc=26; else f.pc=27; },
	function (e,f) { if (((((f.v.i)) % ((30)))) == ((0))) f.pc=15; else f.pc=16; },
/*15*/	function (e,f) {
		f.v.contents = "" + (f.v.contents) + ("<div class=\"newpopupmenu\" style=\"float:left; clear:none; font-family:arial; font-size:11px\">");
		f.v.divopen = true;
	},
	function (e,f) { if (((((f.v.menuitems).list)[(f.v.i)]).submenu) !== undefined) f.pc=17; else f.pc=18; },
	function (e,f) {
		f.pc=19;
		f.v.contents = "" + (f.v.contents) + ("<div style=\"float:right; clear:none\">&gt;</div>");
	},
	function (e,f) { f.v.contents = "" + (f.v.contents) + ("<div style=\"float:right; clear:none\">&nbsp;</div>"); },
	function (e,f) {
		f.v.contents = "" + (f.v.contents) + (("<div id=\"popupmenuitem-") + ("" + (f.v.depth) + (("-") + ("" + (f.v.i) + ("\"")))));
		f.s[0] = "\"";
		e.smcall (3, popupmenu,"render_resume", (["select", ([f.v.depth, f.v.i])]));
	},
/*20*/	function (e,f) {
		var t1562 = f.s[1]; var t1563 = f.s[0]; 
		f.v.contents = "" + (f.v.contents) + ((" onclick=\"") + ("" + (t1562) + (t1563)));
		f.s[0] = "\"";
		e.smcall (3, popupmenu,"render_resume", (["down", ([f.v.depth, f.v.i])]));
	},
	function (e,f) {
		var t1565 = f.s[1]; var t1566 = f.s[0]; 
		f.v.contents = "" + (f.v.contents) + ((" onmousedown=\"") + ("" + (t1565) + (t1566)));
		f.s[0] = "\"";
		e.smcall (3, popupmenu,"render_resume", (["over", ([f.v.depth, f.v.i])]));
	},
	function (e,f) {
		var t1568 = f.s[1]; var t1569 = f.s[0]; 
		f.v.contents = "" + (f.v.contents) + ((" onmouseover=\"") + ("" + (t1568) + (t1569)));
		f.s[0] = "\"";
		e.smcall (3, popupmenu,"render_resume", (["out", ([f.v.depth, f.v.i])]));
	},
	function (e,f) {
		var t1571 = f.s[1]; var t1572 = f.s[0]; 
		f.v.contents = "" + (f.v.contents) + ((" onmouseout=\"") + ("" + (t1571) + (t1572)));
		f.v.contents = "" + (f.v.contents) + (" style=\"padding-top:2px;padding-bottom:2px\"");
		f.v.contents = "" + (f.v.contents) + ((">") + ((((f.v.menuitems).list)[(f.v.i)]).value));
		f.v.contents = "" + (f.v.contents) + ("</div>");
		if (((((f.v.i)) % ((30)))) == ((29))) f.pc=24; else f.pc=25;
	},
	function (e,f) {
		f.v.contents = "" + (f.v.contents) + ("</div>");
		f.v.divopen = false;
	},
/*25*/	function (e,f) {
		f.pc=12;
		e.php_push_var_lvalue (0, "i");
		e.php_postinc (1);
	},
	function (e,f) { f.v.contents = "" + (f.v.contents) + ("</div>"); },
	function (e,f) {
		f.v.width = ((150)) * ((f.v.columns));
		f.v.height = parseInt((((15)) * ((f.v.rows))),10) + parseInt((5),10);
		if (f.v.depth) f.pc=28; else f.pc=35;
	},
	function (e,f) {
		f.pc=32;
		f.s[0] = 50;
		e.smcall (1, browser,"scroll_left", ([]));
	},
	function (e,f) {
		f.s[0] = 20;
		f.s[1] = 150;
		f.s[2] = f.v.width;
		e.mcall (5, f.v.popup, "get_x", ([]));
	},
/*30*/	function (e,f) {
		var t1583 = f.s[3]; var t1584 = f.s[2]; 
		var t1585 = f.s[1]; 
		var t1586 = f.s[0]; 
		f.v.new_x = parseInt((parseInt((parseInt((t1583),10) - parseInt((t1584),10)),10) - parseInt((t1585),10)),10) - parseInt((t1586),10);
		e.mcall (2, f.v.popup, "get_y", ([]));
	},
	function (e,f) {
		f.pc=35;
		var t1588 = f.s[0]; e.mcall (4, f.v.popup, "set_coordinates", ([f.v.new_x, t1588]));
	},
	function (e,f) {
		var t1589 = f.s[1]; var t1590 = f.s[0]; f.s[0] = parseInt((t1589),10) - parseInt((t1590),10);
		e.smcall (1, browser,"window_width", ([]));
	},
	function (e,f) {
		var t1591 = f.s[1]; var t1592 = f.s[0]; f.s[0] = parseInt((t1591),10) + parseInt((t1592),10);
		f.s[1] = f.v.width;
		e.mcall (4, f.v.popup, "get_x", ([]));
	},
	function (e,f) {
		var t1593 = f.s[2]; var t1594 = f.s[1]; 
		var t1595 = f.s[0]; 
		if (((parseInt((t1593),10) + parseInt((t1594),10))) > ((t1595))) f.pc=29; else f.pc=35;
	},
/*35*/	function (e,f) { e.mcall (5, f.v.popup, "open", ([0, 0, f.v.contents])); },
	function (e,f) {
		f.v.res = ({});
		f.v.res.menuitems = f.v.menuitems;
		f.v.res.popup = f.v.popup;
		f.v.res.width = f.v.width;
		f.v.res.height = f.v.height;
		f.s[0] = parseInt((f.v.width),10) + parseInt((10),10);
		e.mcall (3, f.v.popup, "get_x", ([]));
	},
	function (e,f) {
		var t1601 = f.s[1]; var t1602 = f.s[0]; 
		f.v.res.right = parseInt((t1601),10) + parseInt((t1602),10);
		e.mcall (2, f.v.popup, "get_y", ([]));
	},
	function (e,f) {
		var t1605 = f.s[0]; f.v.res.top = t1605;
		e.return_pop (f.v.res);
	},
null	];

;
	c.args__highlight = c.pargs__highlight =  ["depth","index"];
	c.inst__highlight = c.pinst__highlight =  [
/*0*/	function (e,f) { e.mcall (3, document, "getElementById", ([("popupmenuitem-") + ("" + (f.v.depth) + (("-") + (f.v.index)))])); },
	function (e,f) {
		var t1607 = f.s[0]; f.v.el = t1607;
		(f.v.el).style.color = "#fff";
		(f.v.el).style.background = "#4d5e99";
	},
null	];

;
	c.args__unhighlight = c.pargs__unhighlight =  ["depth","index"];
	c.inst__unhighlight = c.pinst__unhighlight =  [
/*0*/	function (e,f) { e.mcall (3, document, "getElementById", ([("popupmenuitem-") + ("" + (f.v.depth) + (("-") + (f.v.index)))])); },
	function (e,f) {
		var t1611 = f.s[0]; f.v.el = t1611;
		if (f.v.el) f.pc=2; else f.pc=-1;
	},
	function (e,f) {
		(f.v.el).style.color = "";
		(f.v.el).style.background = "";
	},
null	];

;
	c.args__create = c.pargs__create =  ["menuitems"];
	c.inst__create = c.pinst__create =  [
/*0*/	function (e,f) {
		f.v.pm = new popupmenu;
		f.v.pm.menuitems = f.v.menuitems;
		e.smcall (2, popupmenu,"start_interval_timer", ([100, "menutimer"]));
	},
	function (e,f) {
		var t1617 = f.s[0]; f.v.pm.it = t1617;
		f.v.pm.popups = ([]);
		f.v.pm.depth = 0;
		f.v.pm.no_cover = false;
		f.v.pm.tid = null;
		e.return_pop (f.v.pm);
	},
null	];

;
	c.pargs__no_cover =  [];
	c.pinst__no_cover =  [
/*0*/	function (e,f) { f.v["this"].no_cover = true; },
null	];

;
	c.pargs__do_run =  [];
	c.pinst__do_run =  [
/*0*/	function (e,f) { e.smcall (0, php_engine,"get_current_thread_id", ([])); },
	function (e,f) {
		var t1624 = f.s[0]; f.v["this"].tid = t1624;
		e.smcall (5, popupmenu,"open_menu", ([(f.v["this"]).menuitems, 0, parseInt((0),10) - parseInt((1),10), parseInt((0),10) - parseInt((1),10), (f.v["this"]).no_cover]));
	},
	function (e,f) { var t1626 = f.s[0]; (f.v["this"]).popups[0] = t1626; },
	function (e,f) {
		f.pc=5;
		e.php_builtin (0, "wait_for_input", 0);
	},
	function (e,f) {
		f.v["this"].tid = null;
		e.return_pop (f.v.res);
	},
/*5*/	function (e,f) {
		var t1629 = f.s[0]; f.v.ev = t1629;
		f.v.cmd = (f.v.ev).action;
		f.v.val = (f.v.ev).parm;
		if (((f.v.cmd)) == (("down"))) f.pc=3; else f.pc=6;
	},
	function (e,f) { if (((f.v.cmd)) == (("over"))) f.pc=7; else f.pc=21; },
	function (e,f) {
		f.v.xdepth = (f.v.val)[(0)];
		f.v.xindex = (f.v.val)[(1)];
		f.v.i = f.v.xdepth;
	},
	function (e,f) {
		f.pc=10;
		if (!(((f.v.i)) < (((f.v["this"]).depth)))) f.pc=9;
	},
	function (e,f) {
		f.pc=12;
		e.smcall (2, popupmenu,"highlight", ([f.v.xdepth, f.v.xindex]));
	},
/*10*/	function (e,f) { e.smcall (2, popupmenu,"unhighlight", ([f.v.i, (((f.v["this"]).popups)[(f.v.i)]).active])); },
	function (e,f) {
		f.pc=8;
		e.php_push_var_lvalue (0, "i");
		e.php_postinc (1);
	},
	function (e,f) { f.v.i = 0; },
	function (e,f) {
		f.pc=15;
		if (!(((f.v.i)) < ((f.v.xdepth)))) f.pc=14;
	},
	function (e,f) { if ((((((((f.v["this"]).popups)[(f.v.xdepth)]).menuitems).list)[(f.v.xindex)]).submenu) !== undefined) f.pc=18; else f.pc=19; },
/*15*/	function (e,f) { e.smcall (2, popupmenu,"highlight", ([f.v.i, (((f.v["this"]).popups)[(f.v.i)]).active])); },
	function (e,f) {
		f.pc=13;
		e.php_push_var_lvalue (0, "i");
		e.php_postinc (1);
	},
	function (e,f) {
		f.pc=3;
		f.v.menutimer = 4;
		f.v.timeractivate_depth = f.v.xdepth;
		f.v.timeractivate_index = f.v.xindex;
	},
	function (e,f) {
		f.pc=20;
		f.s[0] = (((((f.v["this"]).popups)[(f.v.xdepth)]).active)) != ((f.v.xindex));
	},
	function (e,f) { f.s[0] = false; },
/*20*/	function (e,f) { var t1641 = f.s[0]; if (t1641) f.pc=17; else f.pc=3; },
	function (e,f) { if (((f.v.cmd)) == (("out"))) f.pc=22; else f.pc=28; },
	function (e,f) {
		f.v.xdepth = (f.v.val)[(0)];
		f.v.xindex = (f.v.val)[(1)];
		e.smcall (2, popupmenu,"unhighlight", ([f.v.xdepth, f.v.xindex]));
	},
	function (e,f) { f.v.i = 0; },
	function (e,f) {
		f.pc=26;
		if (!(((f.v.i)) < (((f.v["this"]).depth)))) f.pc=25;
	},
/*25*/	function (e,f) {
		f.pc=3;
		f.v.menutimer = 0;
	},
	function (e,f) { e.smcall (2, popupmenu,"highlight", ([f.v.i, (((f.v["this"]).popups)[(f.v.i)]).active])); },
	function (e,f) {
		f.pc=24;
		e.php_push_var_lvalue (0, "i");
		e.php_postinc (1);
	},
	function (e,f) { if (((f.v.cmd)) == (("select"))) f.pc=29; else f.pc=38; },
	function (e,f) {
		f.v.xdepth = (f.v.val)[(0)];
		f.v.xindex = (f.v.val)[(1)];
	},
/*30*/	function (e,f) {
		f.pc=32;
		if (!(((f.v.xdepth)) < (((f.v["this"]).depth)))) f.pc=31;
	},
	function (e,f) { if ((((((((f.v["this"]).popups)[((f.v["this"]).depth)]).menuitems).list)[(f.v.xindex)]).submenu) !== undefined) f.pc=34; else f.pc=37; },
	function (e,f) { e.mcall (2, (((f.v["this"]).popups)[((f.v["this"]).depth)]).popup, "close", ([])); },
	function (e,f) {
		f.pc=30;
		f.s[0] = "depth";
		f.s[1] = f.v["this"];
		e.php_deref_lvalue (2);
		e.php_postdec (1);
	},
	function (e,f) {
		f.v.submenu = ((((((f.v["this"]).popups)[((f.v["this"]).depth)]).menuitems).list)[(f.v.xindex)]).submenu;
		((f.v["this"]).popups)[((f.v["this"]).depth)].active = f.v.xindex;
		e.smcall (2, popupmenu,"highlight", ([f.v.xdepth, f.v.xindex]));
	},
/*35*/	function (e,f) {
		f.v.x = (((f.v["this"]).popups)[((f.v["this"]).depth)]).right;
		f.v.y = parseInt(((((f.v["this"]).popups)[((f.v["this"]).depth)]).top),10) + parseInt((((f.v.xindex)) * ((15))),10);
		f.s[0] = "depth";
		f.s[1] = f.v["this"];
		e.php_deref_lvalue (2);
		e.php_postinc (1);
		e.smcall (5, popupmenu,"open_menu", ([f.v.submenu, (f.v["this"]).depth, f.v.x, f.v.y, true]));
	},
	function (e,f) {
		f.pc=3;
		var t1656 = f.s[0]; (f.v["this"]).popups[(f.v["this"]).depth] = t1656;
	},
	function (e,f) {
		f.pc=4;
		f.v.res = ((((((f.v["this"]).popups)[(f.v.xdepth)]).menuitems).list)[(f.v.xindex)]).key;
	},
	function (e,f) { if (((f.v.cmd)) == (("cover"))) f.pc=39; else f.pc=40; },
	function (e,f) {
		f.pc=4;
		f.v.res = null;
	},
/*40*/	function (e,f) { if (((f.v.cmd)) == (("menutimer"))) f.pc=41; else f.pc=3; },
	function (e,f) { if (f.v.menutimer) f.pc=42; else f.pc=3; },
	function (e,f) {
		e.php_push_var_lvalue (0, "menutimer");
		e.php_postdec (1);
		if (!(f.v.menutimer)) f.pc=43; else f.pc=3;
	},
	function (e,f) {
		f.v.xdepth = f.v.timeractivate_depth;
		f.v.xindex = f.v.timeractivate_index;
	},
	function (e,f) {
		f.pc=46;
		if (!(((f.v.xdepth)) < (((f.v["this"]).depth)))) f.pc=45;
	},
/*45*/	function (e,f) { if ((((((((f.v["this"]).popups)[((f.v["this"]).depth)]).menuitems).list)[(f.v.xindex)]).submenu) !== undefined) f.pc=48; else f.pc=3; },
	function (e,f) { e.mcall (2, (((f.v["this"]).popups)[((f.v["this"]).depth)]).popup, "close", ([])); },
	function (e,f) {
		f.pc=44;
		f.s[0] = "depth";
		f.s[1] = f.v["this"];
		e.php_deref_lvalue (2);
		e.php_postdec (1);
	},
	function (e,f) {
		f.v.submenu = ((((((f.v["this"]).popups)[((f.v["this"]).depth)]).menuitems).list)[(f.v.xindex)]).submenu;
		((f.v["this"]).popups)[((f.v["this"]).depth)].active = f.v.xindex;
		e.smcall (2, popupmenu,"highlight", ([f.v.xdepth, f.v.xindex]));
	},
	function (e,f) {
		f.v.x = (((f.v["this"]).popups)[((f.v["this"]).depth)]).right;
		f.v.y = parseInt(((((f.v["this"]).popups)[((f.v["this"]).depth)]).top),10) + parseInt((((f.v.xindex)) * ((15))),10);
		f.s[0] = "depth";
		f.s[1] = f.v["this"];
		e.php_deref_lvalue (2);
		e.php_postinc (1);
		e.smcall (5, popupmenu,"open_menu", ([f.v.submenu, (f.v["this"]).depth, f.v.x, f.v.y, true]));
	},
/*50*/	function (e,f) {
		f.pc=3;
		var t1669 = f.s[0]; (f.v["this"]).popups[(f.v["this"]).depth] = t1669;
	},
null	];

;
	c.pargs__close =  [];
	c.pinst__close =  [
/*0*/	function (e,f) {  },
	function (e,f) { e.mcall (2, (((f.v["this"]).popups)[((f.v["this"]).depth)]).popup, "close", ([])); },
	function (e,f) { if ((((f.v["this"]).depth)) == ((0))) f.pc=3; else f.pc=4; },
	function (e,f) {
		f.pc=-1;
		e.smcall (1, popupmenu,"stop_interval_timer", ([(f.v["this"]).it]));
	},
	function (e,f) {
		f.pc=1;
		f.s[0] = "depth";
		f.s[1] = f.v["this"];
		e.php_deref_lvalue (2);
		e.php_postdec (1);
	},
null	];

;
	c.pargs__destroy =  [];
	c.pinst__destroy =  [
/*0*/	function (e,f) { if ((((f.v["this"]).tid)) !== ((null))) f.pc=1; else f.pc=2; },
	function (e,f) { e.smcall (1, php_engine,"destroy_thread", ([(f.v["this"]).tid])); },
	function (e,f) { e.mcall (2, f.v["this"], "close", ([])); },
null	];

;
	c.args__run = c.pargs__run =  ["menuitems"];
	c.inst__run = c.pinst__run =  [
/*0*/	function (e,f) { if (((builtin__count ((f.v.menuitems).list))) == ((0))) f.pc=1; else f.pc=2; },
	function (e,f) { e.return_pop (null); },
	function (e,f) { e.smcall (1, popupmenu,"create", ([f.v.menuitems])); },
	function (e,f) {
		var t1672 = f.s[0]; f.v.pm = t1672;
		e.mcall (2, f.v.pm, "do_run", ([]));
	},
	function (e,f) {
		var t1674 = f.s[0]; f.v.res = t1674;
		e.mcall (2, f.v.pm, "close", ([]));
	},
/*5*/	function (e,f) { e.return_pop (f.v.res); },
null	];

;
	c.args__quick = c.pargs__quick =  ["items"];
	c.inst__quick = c.pinst__quick =  [
/*0*/	function (e,f) { e.smcall (0, menu,"create", ([])); },
	function (e,f) {
		var t1676 = f.s[0]; f.v.m = t1676;
		f.v._k102 = e.enumkeys (f.v.items);
	},
	function (e,f) {
		f.pc=4;
		if (!((f.v._k102).length)) f.pc=3;
	},
	function (e,f) {
		f.pc=5;
		e.smcall (1, popupmenu,"run", ([f.v.m]));
	},
	function (e,f) {
		f.pc=2;
		f.s[0] = f.v._i103 = (f.v._k102).shift();
		f.s[1] = f.v.it = (f.v.items)[(f.v._i103)];
		e.mcall (6, f.v.m, "add_item", ([f.v.it, f.v.it]));
	},
/*5*/	function (e,f) { var t1680 = f.s[0]; e.return_pop (t1680); },
null	];

;
};
popupmenu.init_methods (popupmenu);
rpcclass.setup_class (popupmenu, "popupmenu",0, (["menuitems","popups","depth","it","tid","no_cover","listeners"]), ([0,0,0,0,0,0,2]));
function popupeditbox () { this.do_construct (arguments); }
popupeditbox.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
	c.args__run_helper = c.pargs__run_helper =  ["width","height","title","old_value","fieldtype"];
	c.inst__run_helper = c.pinst__run_helper =  [
/*0*/	function (e,f) {
		f.v.pop = new popupform;
		f.v.field = ({type:f.v.fieldtype, name:"inbox", label:"", focus:true, value:f.v.old_value, width:"400"});
		if (((f.v.width)) == ((0))) f.pc=1; else f.pc=2;
	},
	function (e,f) {
		f.pc=3;
		f.v.field.width = "500";
	},
	function (e,f) { f.v.field.width = parseInt((f.v.width),10) - parseInt((20),10); },
	function (e,f) {
		f.v.fields = ([f.v.field]);
		e.mcall (6, f.v.pop, "initialise", ([f.v.width, f.v.height, f.v.title, f.v.fields]));
	},
	function (e,f) { e.mcall (2, f.v.pop, "open", ([])); },
/*5*/	function (e,f) { f.v.res = ""; },
	function (e,f) {
		f.pc=8;
		e.mcall (2, f.v.pop, "run", ([]));
	},
	function (e,f) {
		f.pc=18;
		e.mcall (2, f.v.pop, "close", ([]));
	},
	function (e,f) {
		var t1688 = f.s[0]; f.v.event = t1688;
		if ((((f.v.event).action)) == (("cancel"))) f.pc=9; else f.pc=10;
	},
	function (e,f) {
		f.pc=7;
		f.v.res = null;
	},
/*10*/	function (e,f) { if (builtin__is_array (f.v.action)) f.pc=11; else f.pc=13; },
	function (e,f) {
		f.v.reason = (f.v.action)[(0)];
		f.v.parm = (f.v.action)[(1)];
		if (((f.v.reason)) == (("select"))) f.pc=12; else f.pc=6;
	},
	function (e,f) {
		f.pc=7;
		f.v.res = (f.v.action)[(1)];
	},
	function (e,f) { if ((((f.v.event).action)) == (("OK"))) f.pc=14; else f.pc=16; },
	function (e,f) { e.mcall (2, f.v.pop, "get_form_fields", ([])); },
/*15*/	function (e,f) {
		f.pc=7;
		var t1694 = f.s[0]; f.v.vals = t1694;
		f.v.res = (f.v.vals).inbox;
	},
	function (e,f) { if ((((f.v.event).action)) == (("cover"))) f.pc=17; else f.pc=6; },
	function (e,f) {
		f.pc=7;
		f.v.res = null;
	},
	function (e,f) { e.return_pop (f.v.res); },
null	];

;
	c.args__run = c.pargs__run =  ["width","height","title","old_value"];
	c.inst__run = c.pinst__run =  [
/*0*/	function (e,f) { e.smcall (5, popupeditbox,"run_helper", ([f.v.width, f.v.height, f.v.title, f.v.old_value, "text"])); },
	function (e,f) { var t1697 = f.s[0]; e.return_pop (t1697); },
null	];

;
	c.args__runpw = c.pargs__runpw =  ["width","height","title","old_value"];
	c.inst__runpw = c.pinst__runpw =  [
/*0*/	function (e,f) { e.smcall (5, popupeditbox,"run_helper", ([f.v.width, f.v.height, f.v.title, f.v.old_value, "password"])); },
	function (e,f) { var t1698 = f.s[0]; e.return_pop (t1698); },
null	];

;
};
popupeditbox.init_methods (popupeditbox);
rpcclass.setup_class (popupeditbox, "popupeditbox",0, (["listeners"]), ([2]));
function popupcombobox () { this.do_construct (arguments); }
popupcombobox.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
	c.args__run = c.pargs__run =  ["width","height","title","list","allow_manual","old_value"];
	c.inst__run = c.pinst__run =  [
/*0*/	function (e,f) {
		f.v.pop = new popupform;
		f.v.fields = ([]);
		f.v.options = ([]);
		f.v._k104 = e.enumkeys (f.v.list);
	},
	function (e,f) {
		f.pc=3;
		if (!((f.v._k104).length)) f.pc=2;
	},
	function (e,f) {
		f.v.fields[f.v.fields.length] = ({type:"table", name:"pages", label:"", options:f.v.options});
		if (f.v.allow_manual) f.pc=5; else f.pc=6;
	},
	function (e,f) {
		f.s[0] = f.v._i105 = (f.v._k104).shift();
		f.s[1] = f.v.item = (f.v.list)[(f.v._i105)];
		f.s[2] = ("\">") + ("" + (f.v.item) + ("</a></td>"));
		e.smcall (5, popupcombobox,"render_resume", (["select", f.v.item]));
	},
	function (e,f) {
		f.pc=1;
		var t1706 = f.s[3]; var t1707 = f.s[2]; 
		f.v.options[f.v.options.length] = ("<td><a href=\"#\" onclick=\"") + ("" + (t1706) + (t1707));
	},
/*5*/	function (e,f) { f.v.fields[f.v.fields.length] = ({type:"text", name:"inbox", label:"", focus:true, value:f.v.old_value}); },
	function (e,f) { e.mcall (6, f.v.pop, "initialise", ([f.v.width, f.v.height, f.v.title, f.v.fields])); },
	function (e,f) { e.mcall (2, f.v.pop, "open", ([])); },
	function (e,f) { f.v.res = ""; },
	function (e,f) {
		f.pc=11;
		e.mcall (2, f.v.pop, "run", ([]));
	},
/*10*/	function (e,f) {
		f.pc=20;
		e.mcall (2, f.v.pop, "close", ([]));
	},
	function (e,f) {
		var t1712 = f.s[0]; f.v.event = t1712;
		f.v.action = (f.v.event).action;
		if (((f.v.action)) == (("cancel"))) f.pc=12; else f.pc=13;
	},
	function (e,f) {
		f.pc=10;
		f.v.res = null;
	},
	function (e,f) { if (((f.v.action)) == (("select"))) f.pc=14; else f.pc=15; },
	function (e,f) {
		f.pc=10;
		f.v.res = (f.v.event).parm;
	},
/*15*/	function (e,f) { if (((f.v.action)) == (("OK"))) f.pc=16; else f.pc=18; },
	function (e,f) { e.mcall (2, f.v.pop, "get_form_fields", ([])); },
	function (e,f) {
		f.pc=10;
		var t1717 = f.s[0]; f.v.vals = t1717;
		f.v.res = (f.v.vals).inbox;
	},
	function (e,f) { if (((f.v.action)) == (("cover"))) f.pc=19; else f.pc=9; },
	function (e,f) {
		f.pc=10;
		f.v.res = null;
	},
/*20*/	function (e,f) { e.return_pop (f.v.res); },
null	];

;
};
popupcombobox.init_methods (popupcombobox);
rpcclass.setup_class (popupcombobox, "popupcombobox",0, (["listeners"]), ([2]));
function popupokcancel () { this.do_construct (arguments); }
popupokcancel.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
	c.args__run = c.pargs__run =  ["title"];
	c.inst__run = c.pinst__run =  [
/*0*/	function (e,f) {
		f.v.pop = new popupform;
		f.v.fields = ([]);
		e.mcall (6, f.v.pop, "initialise", ([0, 0, f.v.title, f.v.fields]));
	},
	function (e,f) { e.mcall (2, f.v.pop, "open", ([])); },
	function (e,f) {  },
	function (e,f) { e.mcall (2, f.v.pop, "run", ([])); },
	function (e,f) {
		var t1723 = f.s[0]; f.v.res = t1723;
		if ((((f.v.res).action)) == (("OK"))) f.pc=6; else f.pc=7;
	},
/*5*/	function (e,f) {
		f.pc=9;
		e.mcall (2, f.v.pop, "close", ([]));
	},
	function (e,f) {
		f.pc=8;
		f.s[0] = true;
	},
	function (e,f) { f.s[0] = (((f.v.res).action)) == (("cancel")); },
	function (e,f) { var t1724 = f.s[0]; if (t1724) f.pc=5; else f.pc=3; },
	function (e,f) { e.return_pop ((((f.v.res).action)) == (("OK"))); },
null	];

;
};
popupokcancel.init_methods (popupokcancel);
rpcclass.setup_class (popupokcancel, "popupokcancel",0, (["listeners"]), ([2]));
function popupok () { this.do_construct (arguments); }
popupok.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
	c.args__run = c.pargs__run =  ["title"];
	c.inst__run = c.pinst__run =  [
/*0*/	function (e,f) {
		f.v.pop = new popupform;
		f.v.fields = ([]);
		e.mcall (6, f.v.pop, "initialise", ([0, 0, f.v.title, f.v.fields]));
	},
	function (e,f) { e.mcall (4, f.v.pop, "use_ok_cancel", ([true, false])); },
	function (e,f) { e.mcall (2, f.v.pop, "open", ([])); },
	function (e,f) {  },
	function (e,f) { e.mcall (2, f.v.pop, "run", ([])); },
/*5*/	function (e,f) {
		var t1728 = f.s[0]; f.v.res = t1728;
		if ((((f.v.res).action)) == (("OK"))) f.pc=7; else f.pc=8;
	},
	function (e,f) {
		f.pc=10;
		e.mcall (2, f.v.pop, "close", ([]));
	},
	function (e,f) {
		f.pc=9;
		f.s[0] = true;
	},
	function (e,f) { f.s[0] = (((f.v.res).action)) == (("cover")); },
	function (e,f) { var t1729 = f.s[0]; if (t1729) f.pc=6; else f.pc=4; },
/*10*/	function (e,f) { e.return_pop ((((f.v.res).action)) == (("OK"))); },
null	];

;
};
popupok.init_methods (popupok);
rpcclass.setup_class (popupok, "popupok",0, (["listeners"]), ([2]));
function popupyesnocancel () { this.do_construct (arguments); }
popupyesnocancel.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
	c.args__run = c.pargs__run =  ["title"];
	c.inst__run = c.pinst__run =  [
/*0*/	function (e,f) {
		f.v.pop = new popupform;
		f.v.fields = ([]);
		e.smcall (2, popupyesnocancel,"render_resume", (["yes", 0]));
	},
	function (e,f) {
		var t1732 = f.s[0]; 
		f.v.fields[f.v.fields.length] = ({type:"button", name:"yes", label:"Yes", action:t1732});
		e.smcall (2, popupyesnocancel,"render_resume", (["no", 0]));
	},
	function (e,f) {
		var t1734 = f.s[0]; 
		f.v.fields[f.v.fields.length] = ({type:"button", name:"no", label:"No", action:t1734});
		e.mcall (6, f.v.pop, "initialise", ([0, 0, f.v.title, f.v.fields]));
	},
	function (e,f) { e.mcall (4, f.v.pop, "use_ok_cancel", ([false, true])); },
	function (e,f) { e.mcall (2, f.v.pop, "open", ([])); },
/*5*/	function (e,f) {  },
	function (e,f) { e.mcall (2, f.v.pop, "run", ([])); },
	function (e,f) {
		var t1737 = f.s[0]; f.v.res = t1737;
		if ((((f.v.res).action)) == (("yes"))) f.pc=9; else f.pc=10;
	},
	function (e,f) {
		f.pc=14;
		e.mcall (2, f.v.pop, "close", ([]));
	},
	function (e,f) {
		f.pc=13;
		f.s[0] = true;
	},
/*10*/	function (e,f) { if ((((f.v.res).action)) == (("no"))) f.pc=11; else f.pc=12; },
	function (e,f) {
		f.pc=13;
		f.s[0] = true;
	},
	function (e,f) { f.s[0] = (((f.v.res).action)) == (("cancel")); },
	function (e,f) { var t1738 = f.s[0]; if (t1738) f.pc=8; else f.pc=6; },
	function (e,f) { e.return_pop ((f.v.res).action); },
null	];

;
};
popupyesnocancel.init_methods (popupyesnocancel);
rpcclass.setup_class (popupyesnocancel, "popupyesnocancel",0, (["listeners"]), ([2]));
function popupyesno () { this.do_construct (arguments); }
popupyesno.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
	c.args__run = c.pargs__run =  ["title"];
	c.inst__run = c.pinst__run =  [
/*0*/	function (e,f) {
		f.v.pop = new popupform;
		f.v.fields = ([]);
		e.smcall (2, popupyesno,"render_resume", (["yes", 0]));
	},
	function (e,f) {
		var t1741 = f.s[0]; 
		f.v.fields[f.v.fields.length] = ({type:"button", name:"yes", label:"Yes", action:t1741});
		e.smcall (2, popupyesno,"render_resume", (["no", 0]));
	},
	function (e,f) {
		var t1743 = f.s[0]; 
		f.v.fields[f.v.fields.length] = ({type:"button", name:"no", label:"No", action:t1743});
		e.mcall (6, f.v.pop, "initialise", ([0, 0, f.v.title, f.v.fields]));
	},
	function (e,f) { e.mcall (4, f.v.pop, "use_ok_cancel", ([false, false])); },
	function (e,f) { e.mcall (2, f.v.pop, "open", ([])); },
/*5*/	function (e,f) {  },
	function (e,f) { e.mcall (2, f.v.pop, "run", ([])); },
	function (e,f) {
		var t1746 = f.s[0]; f.v.res = t1746;
		if ((((f.v.res).action)) == (("yes"))) f.pc=9; else f.pc=10;
	},
	function (e,f) {
		f.pc=12;
		e.mcall (2, f.v.pop, "close", ([]));
	},
	function (e,f) {
		f.pc=11;
		f.s[0] = true;
	},
/*10*/	function (e,f) { f.s[0] = (((f.v.res).action)) == (("no")); },
	function (e,f) { var t1747 = f.s[0]; if (t1747) f.pc=8; else f.pc=6; },
	function (e,f) { e.return_pop ((((f.v.res).action)) == (("yes"))); },
null	];

;
};
popupyesno.init_methods (popupyesno);
rpcclass.setup_class (popupyesno, "popupyesno",0, (["listeners"]), ([2]));
function popupobjeditor () { this.do_construct (arguments); }
popupobjeditor.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
	c.pargs__do_fields =  ["mode"];
	c.pinst__do_fields =  [
/*0*/	function (e,f) { e.mcall (2, (f.v["this"]).pop, "get_form_fields", ([])); },
	function (e,f) {
		var t1749 = f.s[0]; f.v.values = t1749;
		f.v.changed = false;
		f.v._k106 = e.enumkeys ((f.v["this"]).fields);
	},
	function (e,f) {
		f.pc=4;
		if (!((f.v._k106).length)) f.pc=3;
	},
	function (e,f) { e.return_pop (f.v.changed); },
	function (e,f) {
		f.v._i107 = (f.v._k106).shift();
		f.v.field = ((f.v["this"]).fields)[(f.v._i107)];
		f.v.fname = (f.v.field).name;
		if ((((f.v.field).type)) == (("query_expr"))) f.pc=5; else f.pc=7;
	},
/*5*/	function (e,f) { e.mcall (2, (f.v.field).value, "as_string", ([])); },
	function (e,f) {
		f.pc=8;
		var t1756 = f.s[0]; f.v.newval = t1756;
	},
	function (e,f) { f.v.newval = (f.v.values)[(f.v.fname)]; },
	function (e,f) { if (((f.v.mode)) == (("check_empty"))) f.pc=9; else f.pc=14; },
	function (e,f) { if ((((f.v.field).type)) == (("enum"))) f.pc=10; else f.pc=12; },
/*10*/	function (e,f) { if (((f.v.newval)) != (("0"))) f.pc=11; else f.pc=2; },
	function (e,f) {
		f.pc=3;
		f.v.changed = true;
	},
	function (e,f) { if (((f.v.newval)) != ((""))) f.pc=13; else f.pc=2; },
	function (e,f) {
		f.pc=3;
		f.v.changed = true;
	},
	function (e,f) { if (((f.v.mode)) == (("check_changed"))) f.pc=15; else f.pc=17; },
/*15*/	function (e,f) { if (((((f.v["this"]).obj)[(f.v.fname)])) != ((f.v.newval))) f.pc=16; else f.pc=2; },
	function (e,f) {
		f.pc=3;
		f.v.changed = true;
	},
	function (e,f) { if (((f.v.mode)) == (("save"))) f.pc=18; else f.pc=2; },
	function (e,f) { if (((((f.v["this"]).obj)[(f.v.fname)])) != ((f.v.newval))) f.pc=19; else f.pc=2; },
	function (e,f) {
		f.pc=2;
		f.v.changed = true;
		(f.v["this"]).obj[f.v.fname] = f.v.newval;
	},
null	];

;
	c.pargs__do_edit =  [];
	c.pinst__do_edit =  [
/*0*/	function (e,f) { f.v._k108 = e.enumkeys ((f.v["this"]).fields); },
	function (e,f) {
		f.pc=3;
		if (!((f.v._k108).length)) f.pc=2;
	},
	function (e,f) {
		f.pc=7;
		f.v["this"].pop = new popupform;
		e.mcall (6, (f.v["this"]).pop, "initialise", ([0, 0, (f.v["this"]).title, (f.v["this"]).fields]));
	},
	function (e,f) {
		f.v.key = (f.v._k108).shift();
		f.v.field = ((f.v["this"]).fields)[(f.v.key)];
		f.v.fname = (f.v.field).name;
		f.v.val = ((f.v["this"]).obj)[(f.v.fname)];
		if ((((f.v.field).type)) == (("query_expr"))) f.pc=4; else f.pc=6;
	},
	function (e,f) {
		f.s[0] = ([f.v.val]);
		f.s[1] = (["query_expr", "create_from_string"]);
		e.php_builtin (2, "call_user_func_array", 2);
	},
/*5*/	function (e,f) {
		f.pc=1;
		var t1770 = f.s[0]; ((f.v["this"]).fields)[(f.v.key)].value = t1770;
	},
	function (e,f) {
		f.pc=1;
		((f.v["this"]).fields)[(f.v.key)].value = f.v.val;
	},
	function (e,f) { e.mcall (2, (f.v["this"]).pop, "open", ([])); },
	function (e,f) { f.v.res = false; },
	function (e,f) {
		f.pc=11;
		e.mcall (2, (f.v["this"]).pop, "run", ([]));
	},
/*10*/	function (e,f) {
		f.pc=21;
		e.mcall (2, (f.v["this"]).pop, "close", ([]));
	},
	function (e,f) {
		var t1774 = f.s[0]; f.v.event = t1774;
		if ((((f.v.event).action)) == (("OK"))) f.pc=12; else f.pc=14;
	},
	function (e,f) { e.mcall (3, f.v["this"], "do_fields", (["save"])); },
	function (e,f) {
		f.pc=10;
		f.v.res = true;
	},
	function (e,f) { if ((((f.v.event).action)) == (("cover"))) f.pc=15; else f.pc=19; },
/*15*/	function (e,f) { e.mcall (3, f.v["this"], "do_fields", (["check_changed"])); },
	function (e,f) {
		var t1777 = f.s[0]; f.v.changed = t1777;
		if (!(f.v.changed)) f.pc=10; else f.pc=17;
	},
	function (e,f) { e.smcall (1, popupokcancel,"run", (["Discard changes?"])); },
	function (e,f) { var t1778 = f.s[0]; if (t1778) f.pc=10; else f.pc=9; },
	function (e,f) { if ((((f.v.event).action)) == (("cancel"))) f.pc=20; else f.pc=9; },
/*20*/	function (e,f) { f.pc=10; },
	function (e,f) { e.return_pop (f.v.res); },
null	];

;
	c.pargs__do_create =  [];
	c.pinst__do_create =  [
/*0*/	function (e,f) { f.v._k110 = e.enumkeys ((f.v["this"]).fields); },
	function (e,f) {
		f.pc=3;
		if (!((f.v._k110).length)) f.pc=2;
	},
	function (e,f) {
		f.pc=7;
		f.v["this"].pop = new popupform;
		e.mcall (6, (f.v["this"]).pop, "initialise", ([0, 0, (f.v["this"]).title, (f.v["this"]).fields]));
	},
	function (e,f) {
		f.v.key = (f.v._k110).shift();
		f.v.field = ((f.v["this"]).fields)[(f.v.key)];
		f.v.fname = (f.v.field).name;
		if ((((f.v.field).type)) == (("query_expr"))) f.pc=4; else f.pc=6;
	},
	function (e,f) {
		f.s[0] = ([""]);
		f.s[1] = (["query_expr", "create_from_string"]);
		e.php_builtin (2, "call_user_func_array", 2);
	},
/*5*/	function (e,f) {
		f.pc=1;
		var t1785 = f.s[0]; ((f.v["this"]).fields)[(f.v.key)].value = t1785;
	},
	function (e,f) {
		f.pc=1;
		((f.v["this"]).fields)[(f.v.key)].value = "";
	},
	function (e,f) { e.mcall (2, (f.v["this"]).pop, "open", ([])); },
	function (e,f) { f.v.res = null; },
	function (e,f) {
		f.pc=11;
		e.mcall (2, (f.v["this"]).pop, "run", ([]));
	},
/*10*/	function (e,f) {
		f.pc=24;
		e.mcall (2, (f.v["this"]).pop, "close", ([]));
	},
	function (e,f) {
		var t1789 = f.s[0]; f.v.event = t1789;
		if ((((f.v.event).action)) == (("OK"))) f.pc=12; else f.pc=17;
	},
	function (e,f) { e.mcall (2, (f.v["this"]).pop, "get_form_fields", ([])); },
	function (e,f) {
		f.s[1] = "popupobjeditor_create";
		f.s[2] = (f.v["this"]).cname;
		e.php_static_method_call (3, popupobjeditor,"call_static_method", 3);
	},
	function (e,f) {
		var t1792 = f.s[0]; f.v["this"].obj = t1792;
		if ((((f.v["this"]).obj)) !== ((null))) f.pc=15; else f.pc=9;
	},
/*15*/	function (e,f) { e.mcall (3, f.v["this"], "do_fields", (["save"])); },
	function (e,f) {
		f.pc=10;
		f.v.res = (f.v["this"]).obj;
	},
	function (e,f) { if ((((f.v.event).action)) == (("cover"))) f.pc=18; else f.pc=22; },
	function (e,f) { e.mcall (3, f.v["this"], "do_fields", (["check_empty"])); },
	function (e,f) {
		var t1795 = f.s[0]; f.v.changed = t1795;
		if (!(f.v.changed)) f.pc=10; else f.pc=20;
	},
/*20*/	function (e,f) { e.smcall (1, popupokcancel,"run", (["Discard changes?"])); },
	function (e,f) { var t1796 = f.s[0]; if (t1796) f.pc=10; else f.pc=9; },
	function (e,f) { if ((((f.v.event).action)) == (("cancel"))) f.pc=23; else f.pc=9; },
	function (e,f) { f.pc=10; },
	function (e,f) { e.return_pop (f.v.res); },
null	];

;
	c.args__to_struct = c.pargs__to_struct =  ["obj"];
	c.inst__to_struct = c.pinst__to_struct =  [
/*0*/	function (e,f) { e.mcall (2, f.v.obj, "popupobjeditor_fields", ([])); },
	function (e,f) {
		var t1798 = f.s[0]; f.v.fields = t1798;
		f.v.res = ({});
		f.v._k112 = e.enumkeys (f.v.fields);
	},
	function (e,f) {
		f.pc=4;
		if (!((f.v._k112).length)) f.pc=3;
	},
	function (e,f) { e.return_pop (f.v.res); },
	function (e,f) {
		f.pc=2;
		f.v.key = (f.v._k112).shift();
		f.v.field = (f.v.fields)[(f.v.key)];
		f.v.fname = (f.v.field).name;
		f.v.res[f.v.fname] = (f.v.obj)[(f.v.fname)];
	},
null	];

;
	c.args__from_struct = c.pargs__from_struct =  ["obj","str"];
	c.inst__from_struct = c.pinst__from_struct =  [
/*0*/	function (e,f) { e.mcall (2, f.v.obj, "popupobjeditor_fields", ([])); },
	function (e,f) {
		var t1806 = f.s[0]; f.v.fields = t1806;
		f.v._k114 = e.enumkeys (f.v.fields);
	},
	function (e,f) { if (!((f.v._k114).length)) f.pc=-1; },
	function (e,f) {
		f.pc=2;
		f.v.key = (f.v._k114).shift();
		f.v.field = (f.v.fields)[(f.v.key)];
		f.v.fname = (f.v.field).name;
		f.v.obj[f.v.fname] = (f.v.str)[(f.v.fname)];
	},
null	];

;
	c.args__edit = c.pargs__edit =  ["obj","title"];
	c.inst__edit = c.pinst__edit =  [
/*0*/	function (e,f) {
		f.v.me = new popupobjeditor;
		f.v.me.obj = f.v.obj;
		f.v.me.title = f.v.title;
		e.mcall (2, f.v.obj, "popupobjeditor_fields", ([]));
	},
	function (e,f) {
		var t1816 = f.s[0]; f.v.me.fields = t1816;
		e.mcall (2, f.v.me, "do_edit", ([]));
	},
	function (e,f) { var t1817 = f.s[0]; e.return_pop (t1817); },
null	];

;
	c.args__create = c.pargs__create =  ["cname","title"];
	c.inst__create = c.pinst__create =  [
/*0*/	function (e,f) {
		f.v.me = new popupobjeditor;
		f.v.me.cname = f.v.cname;
		f.v.me.title = f.v.title;
		e.smcall (3, popupobjeditor,"call_static_method", ([f.v.cname, "popupobjeditor_fields", null]));
	},
	function (e,f) {
		var t1822 = f.s[0]; f.v.me.fields = t1822;
		e.mcall (2, f.v.me, "do_create", ([]));
	},
	function (e,f) { var t1823 = f.s[0]; e.return_pop (t1823); },
null	];

;
};
popupobjeditor.init_methods (popupobjeditor);
rpcclass.setup_class (popupobjeditor, "popupobjeditor",0, (["cname","obj","title","fields","pop","listeners"]), ([0,0,0,0,0,2]));
function generic_tree_item () { this.do_construct (arguments); }
generic_tree_item.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
	cp.item_context =  function ()
	{
{
		return (this.context);
		}
			}

;
	cp.get_tree =  function ()
	{
{
		return (this.tree);
		}
			}

;
	c.pargs__do_initialise_branch =  ["tree","parent","name","context"];
	c.pinst__do_initialise_branch =  [
/*0*/	function (e,f) {
		f.v["this"].tree = f.v.tree;
		f.v["this"].parent = f.v.parent;
		f.v["this"].is_leaf = false;
		f.v["this"].name = f.v.name;
		f.v["this"].children = ([]);
		f.v["this"].context = f.v.context;
	},
null	];

;
	c.pargs__do_initialise_leaf =  ["tree","parent","name","context"];
	c.pinst__do_initialise_leaf =  [
/*0*/	function (e,f) {
		f.v["this"].tree = f.v.tree;
		f.v["this"].parent = f.v.parent;
		f.v["this"].is_leaf = true;
		f.v["this"].name = f.v.name;
		f.v["this"].context = f.v.context;
	},
null	];

;
	c.pargs__remove =  [];
	c.pinst__remove =  [
/*0*/	function (e,f) { e.mcall (2, f.v["this"], "node_removed", ([])); },
	function (e,f) { e.mcall (3, (f.v["this"]).parent, "removeChild", ([f.v["this"]])); },
null	];

;
	c.pargs__rename =  ["newname"];
	c.pinst__rename =  [
/*0*/	function (e,f) {
		f.v["this"].name = f.v.newname;
		e.mcall (2, f.v["this"], "node_changed", ([]));
	},
null	];

;
	c.pargs__removeChild =  ["node"];
	c.pinst__removeChild =  [
/*0*/	function (e,f) {
		f.v.i = builtin__array_search (f.v.node,(f.v["this"]).children);
		if (((f.v.i)) === ((false))) f.pc=1; else f.pc=2;
	},
	function (e,f) { f.s[0] = builtin__alert ("Failed to find child in parent"); },
	function (e,f) { f.s[0] = builtin__array_splice ((f.v["this"]).children,f.v.i,1); },
null	];

;
	c.pargs__add_child =  ["newnode"];
	c.pinst__add_child =  [
/*0*/	function (e,f) { f.v.i = 0; },
	function (e,f) {
		f.pc=4;
		if (!(((f.v.i)) < ((builtin__count ((f.v["this"]).children))))) f.pc=2;
	},
	function (e,f) { if (((f.v.i)) == ((builtin__count ((f.v["this"]).children)))) f.pc=5; else f.pc=7; },
	function (e,f) {
		f.pc=1;
		e.php_push_var_lvalue (0, "i");
		e.php_postinc (1);
	},
	function (e,f) { if ((((((f.v["this"]).children)[(f.v.i)]).name)) > (((f.v.newnode).name))) f.pc=2; else f.pc=3; },
/*5*/	function (e,f) { e.mcall (3, f.v.newnode, "node_added", ([null])); },
	function (e,f) {
		f.pc=-1;
		(f.v["this"]).children[(f.v["this"]).children.length] = f.v.newnode;
	},
	function (e,f) { e.mcall (3, f.v.newnode, "node_added", ([((f.v["this"]).children)[(f.v.i)]])); },
	function (e,f) { f.s[0] = builtin__array_splice ((f.v["this"]).children,f.v.i,0,([f.v.newnode])); },
null	];

;
	cp.depth =  function ()
	{
var n;var p;{
		n = 0;;
		for (p = this;p.parent !== null;p = p.parent) {n++;};
		return (n);
		}
			}

;
};
generic_tree_item.init_methods (generic_tree_item);
rpcclass.setup_class (generic_tree_item, "generic_tree_item",0, (["parent","is_leaf","name","context","children","tree","listeners"]), ([0,0,0,0,0,0,2]));
function generic_tree () { this.do_construct (arguments); }
generic_tree.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
	c.pargs__create_branch =  ["parent","name","obj"];
	c.pinst__create_branch =  [
/*0*/	function (e,f) {
		f.v.cname = (f.v["this"]).itemclass;
		f.v.it = eval ("new "+f.v.cname);
		e.mcall (6, f.v.it, "initialise_branch", ([f.v["this"], f.v.parent, f.v.name, f.v.obj]));
	},
	function (e,f) { e.return_pop (f.v.it); },
null	];

;
	c.pargs__create_leaf =  ["parent","name","obj"];
	c.pinst__create_leaf =  [
/*0*/	function (e,f) {
		f.v.cname = (f.v["this"]).itemclass;
		f.v.it = eval ("new "+f.v.cname);
		e.mcall (6, f.v.it, "initialise_leaf", ([f.v["this"], f.v.parent, f.v.name, f.v.obj]));
	},
	function (e,f) { e.return_pop (f.v.it); },
null	];

;
	c.pargs__add_fullname_item =  ["fullname","context"];
	c.pinst__add_fullname_item =  [
/*0*/	function (e,f) {
		f.v.fields = builtin__explode ("\\",f.v.fullname);
		f.v.path = "";
		f.v.pos = (f.v["this"]).root;
		f.v.n = builtin__count (f.v.fields);
		if (((f.v.context)) !== ((null))) f.pc=1; else f.pc=2;
	},
	function (e,f) {
		e.php_push_var_lvalue (0, "n");
		e.php_postdec (1);
	},
	function (e,f) { f.v.i = 0; },
	function (e,f) {
		f.pc=5;
		if (!(((f.v.i)) < ((f.v.n)))) f.pc=4;
	},
	function (e,f) { if (((f.v.context)) !== ((null))) f.pc=20; else f.pc=29; },
/*5*/	function (e,f) {
		f.v.field = (f.v.fields)[(f.v.i)];
		if (((f.v.path)) == ((""))) f.pc=6; else f.pc=7;
	},
	function (e,f) {
		f.pc=8;
		f.v.path = f.v.field;
	},
	function (e,f) { f.v.path = "" + (f.v.path) + (("\\") + (f.v.field)); },
	function (e,f) { f.v.j = 0; },
	function (e,f) {
		f.pc=11;
		if (!(((f.v.j)) < ((builtin__count ((f.v.pos).children))))) f.pc=10;
	},
/*10*/	function (e,f) { if (((f.v.j)) == ((builtin__count ((f.v.pos).children)))) f.pc=17; else f.pc=19; },
	function (e,f) { if ((((((f.v.pos).children)[(f.v.j)]).name)) == ((f.v.field))) f.pc=12; else f.pc=13; },
	function (e,f) { f.pc=10; },
	function (e,f) { if ((((((f.v.pos).children)[(f.v.j)]).name)) > ((f.v.field))) f.pc=14; else f.pc=16; },
	function (e,f) { e.mcall (5, f.v["this"], "create_branch", ([f.v.pos, f.v.field, null])); },
/*15*/	function (e,f) {
		f.pc=10;
		var t1855 = f.s[0]; f.v.child = t1855;
		f.s[0] = builtin__array_splice ((f.v.pos).children,f.v.j,0,([f.v.child]));
	},
	function (e,f) {
		f.pc=9;
		e.php_push_var_lvalue (0, "j");
		e.php_postinc (1);
	},
	function (e,f) { e.mcall (5, f.v["this"], "create_branch", ([f.v.pos, f.v.field, null])); },
	function (e,f) { var t1858 = f.s[0]; (f.v.pos).children[f.v.j] = t1858; },
	function (e,f) {
		f.pc=3;
		f.v.pos = ((f.v.pos).children)[(f.v.j)];
		e.php_push_var_lvalue (0, "i");
		e.php_postinc (1);
	},
/*20*/	function (e,f) { f.v.j = 0; },
	function (e,f) {
		f.pc=23;
		if (!(((f.v.j)) < ((builtin__count ((f.v.pos).children))))) f.pc=22;
	},
	function (e,f) {
		f.pc=25;
		e.mcall (5, f.v["this"], "create_leaf", ([f.v.pos, (f.v.fields)[(f.v.i)], f.v.context]));
	},
	function (e,f) { if ((((((f.v.pos).children)[(f.v.j)]).name)) > (((f.v.fields)[(f.v.i)]))) f.pc=22; else f.pc=24; },
	function (e,f) {
		f.pc=21;
		e.php_push_var_lvalue (0, "j");
		e.php_postinc (1);
	},
/*25*/	function (e,f) {
		var t1864 = f.s[0]; f.v.newnode = t1864;
		if (((f.v.j)) == ((builtin__count ((f.v.pos).children)))) f.pc=26; else f.pc=27;
	},
	function (e,f) {
		f.pc=28;
		(f.v.pos).children[(f.v.pos).children.length] = f.v.newnode;
	},
	function (e,f) { f.s[0] = builtin__array_splice ((f.v.pos).children,f.v.j,0,([f.v.newnode])); },
	function (e,f) { e.return_pop (f.v.newnode); },
	function (e,f) { e.return_pop (null); },
null	];

;
	c.pargs__initialise =  ["itemclass","rootname","rootcontext"];
	c.pinst__initialise =  [
/*0*/	function (e,f) {
		f.v["this"].itemclass = f.v.itemclass;
		f.v["this"].root = eval ("new "+f.v.itemclass);
		e.mcall (5, (f.v["this"]).root, "initialise_root", ([f.v["this"], f.v.rootname, f.v.rootcontext]));
	},
null	];

;
};
generic_tree.init_methods (generic_tree);
rpcclass.setup_class (generic_tree, "generic_tree",0, (["root","itemclass","listeners"]), ([0,0,2]));
function tree_editor_item () { this.do_construct (arguments); }
tree_editor_item.init_methods = function (c) {
	generic_tree_item.init_methods(c);
	var cp = c.prototype;
	c.pargs__initialise_branch =  ["te","parent","name","context"];
	c.pinst__initialise_branch =  [
/*0*/	function (e,f) { e.mcall (6, f.v["this"], "do_initialise_branch", ([f.v.te, f.v.parent, f.v.name, f.v.context])); },
	function (e,f) { f.v["this"].is_open = false; },
null	];

;
	c.pargs__initialise_leaf =  ["te","parent","name","context"];
	c.pinst__initialise_leaf =  [
/*0*/	function (e,f) { e.mcall (6, f.v["this"], "do_initialise_leaf", ([f.v.te, f.v.parent, f.v.name, f.v.context])); },
null	];

;
	c.pargs__is_displayed =  [];
	c.pinst__is_displayed =  [
/*0*/	function (e,f) { f.v.p = (f.v["this"]).parent; },
	function (e,f) {
		f.pc=4;
		if (!(((f.v.p)) !== ((null)))) f.pc=2;
	},
	function (e,f) { e.return_pop (true); },
	function (e,f) { e.return_pop (false); },
	function (e,f) { if (!((f.v.p).is_open)) f.pc=3; else f.pc=5; },
/*5*/	function (e,f) {
		f.pc=1;
		f.v.p = (f.v.p).parent;
	},
null	];

;
	c.pargs__redisplay =  [];
	c.pinst__redisplay =  [
/*0*/	function (e,f) { e.mcall (2, f.v["this"], "get_el", ([])); },
	function (e,f) {
		f.pc=4;
		var t1872 = f.s[0]; f.v.el = t1872;
		e.mcall (2, f.v["this"], "is_displayed", ([]));
	},
	function (e,f) {
		f.pc=5;
		(f.v.el).style.display = "block";
	},
	function (e,f) {
		f.pc=5;
		(f.v.el).style.display = "none";
	},
	function (e,f) { var t1875 = f.s[0]; if (t1875) f.pc=2; else f.pc=3; },
/*5*/	function (e,f) { e.mcall (2, f.v["this"], "get_id", ([])); },
	function (e,f) {
		var t1876 = f.s[0]; 
		e.mcall (3, document, "getElementById", ([("tree-node-label-") + (t1876)]));
	},
	function (e,f) {
		var t1878 = f.s[0]; f.v.el = t1878;
		if (((f.v["this"])) == ((((f.v["this"]).tree).current_item))) f.pc=8; else f.pc=9;
	},
	function (e,f) {
		f.pc=10;
		(f.v.el).style.background = "#4D5E99";
		(f.v.el).style.color = "white";
	},
	function (e,f) {
		(f.v.el).style.background = "";
		(f.v.el).style.color = "";
	},
/*10*/	function (e,f) { if (!((f.v["this"]).is_leaf)) f.pc=11; else f.pc=-1; },
	function (e,f) { e.mcall (2, f.v["this"], "get_id", ([])); },
	function (e,f) {
		var t1883 = f.s[0]; 
		e.mcall (3, document, "getElementById", ([("tree-node-plus-") + (t1883)]));
	},
	function (e,f) {
		var t1885 = f.s[0]; f.v.el = t1885;
		if (((f.v.el)) !== ((null))) f.pc=14; else f.pc=16;
	},
	function (e,f) { e.mcall (2, f.v["this"], "plus_minus", ([])); },
/*15*/	function (e,f) { var t1887 = f.s[0]; f.v.el.innerHTML = t1887; },
	function (e,f) { f.v._k116 = e.enumkeys ((f.v["this"]).children); },
	function (e,f) { if (!((f.v._k116).length)) f.pc=-1; },
	function (e,f) {
		f.pc=17;
		f.s[0] = f.v._i117 = (f.v._k116).shift();
		f.s[1] = f.v.child = ((f.v["this"]).children)[(f.v._i117)];
		e.mcall (4, f.v.child, "redisplay", ([]));
	},
null	];

;
	c.pargs__pre_expand =  [];
	c.pinst__pre_expand =  [
/*0*/	function (e,f) { /* This is a NOP */ },
null	];

;
	c.pargs__toggle_open =  ["el","arg","ev"];
	c.pinst__toggle_open =  [
/*0*/	function (e,f) { e.mcall (2, f.v["this"], "pre_expand", ([])); },
	function (e,f) {
		f.v["this"].is_open = !((f.v["this"]).is_open);
		e.mcall (2, f.v["this"], "redisplay", ([]));
	},
null	];

;
	c.pargs__open =  [];
	c.pinst__open =  [
/*0*/	function (e,f) { e.mcall (2, f.v["this"], "pre_expand", ([])); },
	function (e,f) {
		f.v["this"].is_open = true;
		f.s[0] = f.v["this"];
		f.s[1] = "open";
		e.mcall (4, f.v["this"], "get_tree", ([]));
	},
	function (e,f) { var t1893 = f.s[2]; var t1894 = f.s[1]; var t1895 = f.s[0]; e.mcall (3, t1893, t1894, ([t1895])); },
null	];

;
	c.pargs__click_open =  ["el","arg","ev"];
	c.pinst__click_open =  [
/*0*/	function (e,f) { e.mcall (2, f.v["this"], "open", ([])); },
null	];

;
	cp.get_el =  function ()
	{
{
		;
		return (document.getElementById  ("tree-node-" + this.get_id  ()));
		}
			}

;
	cp.find_element_under_cursor =  function (x,y)
	{
var el;var el_left;var el_top;var el_right;var el_bottom;var child;var res;{
		el = this.get_el  ();;
		el_left = lib.document_x_of  (el);;
		el_top = lib.document_y_of  (el);;
		el_right = el_left + el.clientWidth;;
		el_bottom = el_top + el.clientHeight;;
		if (el_left < x && el_right > x && el_top < y && el_bottom > y)
		{return (this) }
		;
		if (this.is_open)
		{{
		for (var _index in this.children)
		{
		child = this.children[_index];
		{
		res = child.find_element_under_cursor  (x,y);;
		if (res !== null)
		{return (res) }
		;
		}
		}
		;
		}
		 }
		;
		return (null);
		}
			}

;
	c.pargs__oncontextmenu =  ["el","arg","ev"];
	c.pinst__oncontextmenu =  [
/*0*/	function (e,f) { e.mcall (2, f.v["this"], "on_right_click", ([])); },
null	];

;
	c.pargs__render_to_el =  [];
	c.pinst__render_to_el =  [
/*0*/	function (e,f) { e.mcall (3, document, "createElement", (["div"])); },
	function (e,f) {
		var t1897 = f.s[0]; f.v.div = t1897;
		f.s[0] = builtin__ob_start ();
		e.mcall (2, f.v["this"], "render", ([]));
	},
	function (e,f) {
		f.v.div.innerHTML = builtin__ob_get_clean ();
		e.return_pop (((f.v.div).childNodes)[(0)]);
	},
null	];

;
	c.pargs__node_added =  ["refnode"];
	c.pinst__node_added =  [
/*0*/	function (e,f) {
		f.s[0] = builtin__debugout (("Node ") + ("" + ((f.v["this"]).name) + ((" added under node ") + (((f.v["this"]).parent).name))));
		e.mcall (2, f.v["this"], "render_to_el", ([]));
	},
	function (e,f) {
		var t1900 = f.s[0]; f.v.el = t1900;
		if (((f.v.refnode)) === ((null))) f.pc=2; else f.pc=10;
	},
	function (e,f) { f.v.refnode = (f.v["this"]).parent; },
	function (e,f) { if ((f.v.refnode).is_leaf) f.pc=6; else f.pc=7; },
	function (e,f) {
		f.pc=9;
		e.mcall (2, f.v.refnode, "get_el", ([]));
	},
/*5*/	function (e,f) {
		f.pc=3;
		f.v.refnode = ((f.v.refnode).children)[(parseInt((builtin__count ((f.v.refnode).children)),10) - parseInt((1),10))];
	},
	function (e,f) {
		f.pc=8;
		f.s[0] = true;
	},
	function (e,f) { f.s[0] = ((builtin__count ((f.v.refnode).children))) == ((0)); },
	function (e,f) { var t1903 = f.s[0]; if (t1903) f.pc=4; else f.pc=5; },
	function (e,f) {
		f.pc=12;
		var t1905 = f.s[0]; f.v.refel = t1905;
		f.v.refel = (f.v.refel).nextSibling;
	},
/*10*/	function (e,f) { e.mcall (2, f.v.refnode, "get_el", ([])); },
	function (e,f) { var t1908 = f.s[0]; f.v.refel = t1908; },
	function (e,f) { e.mcall (4, (f.v.refel).parentNode, "insertBefore", ([f.v.el, f.v.refel])); },
null	];

;
	c.pargs__node_removed =  [];
	c.pinst__node_removed =  [
/*0*/	function (e,f) { e.mcall (2, f.v["this"], "get_el", ([])); },
	function (e,f) {
		var t1910 = f.s[0]; f.v.el = t1910;
		e.mcall (3, (f.v.el).parentNode, "removeChild", ([f.v.el]));
	},
null	];

;
	c.pargs__node_changed =  [];
	c.pinst__node_changed =  [
/*0*/	function (e,f) { e.mcall (2, f.v["this"], "get_el", ([])); },
	function (e,f) {
		var t1912 = f.s[0]; f.v.el = t1912;
		e.mcall (2, f.v["this"], "render_to_el", ([]));
	},
	function (e,f) {
		var t1914 = f.s[0]; f.v.newel = t1914;
		e.mcall (4, (f.v.el).parentNode, "insertBefore", ([f.v.newel, f.v.el]));
	},
	function (e,f) { e.mcall (3, (f.v.el).parentNode, "removeChild", ([f.v.el])); },
null	];

;
	c.pargs__plus_minus =  [];
	c.pinst__plus_minus =  [
/*0*/	function (e,f) { if ((f.v["this"]).is_open) f.pc=1; else f.pc=2; },
	function (e,f) { e.return_pop ("(<span style=\"font-family:courier,monospace\">-</span>)"); },
	function (e,f) { e.return_pop ("(<span style=\"font-family:courier,monospace\">+</span>)"); },
null	];

;
	c.pargs__render =  [];
	c.pinst__render =  [
/*0*/	function (e,f) { e.mcall (2, f.v["this"], "depth", ([])); },
	function (e,f) {
		var t1916 = f.s[0]; f.v.depth = t1916;
		f.s[0] = ";border:solid 1px transparent;\">";
		if ((((f.v["this"]).parent)) == ((null))) f.pc=4; else f.pc=5;
	},
	function (e,f) {
		f.pc=7;
		f.s[1] = "block";
	},
	function (e,f) {
		f.pc=7;
		f.s[1] = "none";
	},
	function (e,f) {
		f.pc=6;
		f.s[1] = true;
	},
/*5*/	function (e,f) { f.s[1] = ((f.v["this"]).parent).is_open; },
	function (e,f) { var t1917 = f.s[1]; if (t1917) f.pc=2; else f.pc=3; },
	function (e,f) {
		var t1918 = f.s[1]; var t1919 = f.s[0]; 
		f.s[0] = ("\" style=\"margin-left:") + ("" + (((f.v.depth)) * ((30))) + (("px;display:") + ("" + (t1918) + (t1919))));
		e.mcall (3, f.v["this"], "get_id", ([]));
	},
	function (e,f) {
		var t1920 = f.s[1]; var t1921 = f.s[0]; 
		window.__outbuffer += ("<div id=\"tree-node-") + ("" + (t1920) + (t1921));
		if ((f.v["this"]).is_leaf) f.pc=9; else f.pc=10;
	},
	function (e,f) {
		f.pc=14;
		window.__outbuffer += "&nbsp;&nbsp;&nbsp;&nbsp;";
	},
/*10*/	function (e,f) {
		f.s[0] = "</a>";
		e.mcall (3, f.v["this"], "plus_minus", ([]));
	},
	function (e,f) {
		var t1922 = f.s[1]; var t1923 = f.s[0]; 
		f.s[0] = ("\">") + ("" + (t1922) + (t1923));
		e.mcall (5, f.v["this"], "render_start", (["toggle_open", null]));
	},
	function (e,f) {
		var t1924 = f.s[1]; var t1925 = f.s[0]; 
		f.s[0] = ("\" onclick=\"") + ("" + (t1924) + (t1925));
		e.mcall (3, f.v["this"], "get_id", ([]));
	},
	function (e,f) {
		var t1926 = f.s[1]; var t1927 = f.s[0]; 
		window.__outbuffer += ("<a href=\"#\" id=\"tree-node-plus-") + ("" + (t1926) + (t1927));
	},
	function (e,f) {
		f.s[0] = "\" />";
		e.mcall (5, f.v["this"], "render_start", (["oncontextmenu", null]));
	},
/*15*/	function (e,f) {
		var t1928 = f.s[1]; var t1929 = f.s[0]; 
		f.s[0] = ("\" alt=\"\" oncontextmenu=\"") + ("" + (t1928) + (t1929));
		e.mcall (3, f.v["this"], "icon", ([]));
	},
	function (e,f) {
		var t1930 = f.s[1]; var t1931 = f.s[0]; 
		window.__outbuffer += ("<img src=\"") + ("" + (t1930) + (t1931));
		if ((f.v["this"]).is_open) f.pc=19; else f.pc=20;
	},
	function (e,f) {
		f.pc=22;
		f.s[0] = "background:#4D5E99;color:white";
	},
	function (e,f) {
		f.pc=22;
		f.s[0] = "";
	},
	function (e,f) {
		f.pc=21;
		f.s[0] = (f.v["this"]).is_leaf;
	},
/*20*/	function (e,f) { f.s[0] = false; },
	function (e,f) { var t1932 = f.s[0]; if (t1932) f.pc=17; else f.pc=18; },
	function (e,f) {
		var t1934 = f.s[0]; f.v.style = t1934;
		f.s[0] = ("\" style=\"") + ("" + (f.v.style) + (("\">") + ("" + ((f.v["this"]).name) + ("</a>"))));
		e.mcall (5, f.v["this"], "render_start", (["oncontextmenu", null]));
	},
	function (e,f) {
		var t1935 = f.s[1]; var t1936 = f.s[0]; 
		f.s[0] = ("\" oncontextmenu=\"") + ("" + (t1935) + (t1936));
		e.mcall (5, f.v["this"], "render_start", (["click_open", null]));
	},
	function (e,f) {
		var t1937 = f.s[1]; var t1938 = f.s[0]; 
		f.s[0] = ("\" href=\"#\" onclick=\"") + ("" + (t1937) + (t1938));
		e.mcall (3, f.v["this"], "get_id", ([]));
	},
/*25*/	function (e,f) {
		var t1939 = f.s[1]; var t1940 = f.s[0]; 
		window.__outbuffer += ("&nbsp;<a id=\"tree-node-label-") + ("" + (t1939) + (t1940));
		window.__outbuffer += "</div>";
		if (!((f.v["this"]).is_leaf)) f.pc=26; else f.pc=-1;
	},
	function (e,f) { f.v._k118 = e.enumkeys ((f.v["this"]).children); },
	function (e,f) { if (!((f.v._k118).length)) f.pc=-1; },
	function (e,f) {
		f.pc=27;
		f.v._i119 = (f.v._k118).shift();
		f.v.child = ((f.v["this"]).children)[(f.v._i119)];
		e.mcall (3, f.v.child, "render", ([parseInt((f.v.depth),10) + parseInt((1),10)]));
	},
null	];

;
};
tree_editor_item.init_methods (tree_editor_item);
rpcclass.setup_class (tree_editor_item, "tree_editor_item",0, (["is_open","parent","is_leaf","name","context","children","tree","listeners"]), ([0,0,0,0,0,0,0,2]));
function tree_editor () { this.do_construct (arguments); }
tree_editor.init_methods = function (c) {
	generic_tree.init_methods(c);
	var cp = c.prototype;
	c.pargs__close =  [];
	c.pinst__close =  [
/*0*/	function (e,f) { if ((((f.v["this"]).current_item)) === ((null))) f.pc=1; else f.pc=2; },
	function (e,f) { f.pc=-1; },
	function (e,f) { e.mcall (2, (f.v["this"]).current_item, "close_document", ([])); },
	function (e,f) {
		f.s[0] = "";
		f.s[1] = "innerHTML";
		e.mcall (4, f.v["this"], "docpane", ([]));
	},
	function (e,f) {
		e.php_deref_lvalue (3);
		e.php_assign (2);
		f.v.it = (f.v["this"]).current_item;
		f.v["this"].current_item = null;
		e.mcall (2, f.v.it, "redisplay", ([]));
	},
null	];

;
	c.pargs__rerender_doc =  [];
	c.pinst__rerender_doc =  [
/*0*/	function (e,f) { e.mcall (2, f.v["this"], "docpane", ([])); },
	function (e,f) {
		var t1951 = f.s[0]; f.v.docpane = t1951;
		f.s[0] = builtin__ob_start ();
		if ((((f.v["this"]).doc)) !== ((null))) f.pc=2; else f.pc=3;
	},
	function (e,f) { e.mcall (2, (f.v["this"]).doc, "render_editor", ([])); },
	function (e,f) { f.v.docpane.innerHTML = builtin__ob_get_clean (); },
null	];

;
	c.pargs__open =  ["item"];
	c.pinst__open =  [
/*0*/	function (e,f) { e.mcall (2, f.v.item, "open_document", ([])); },
	function (e,f) {
		var t1954 = f.s[0]; f.v.doc = t1954;
		if (((f.v.doc)) !== ((null))) f.pc=2; else f.pc=4;
	},
	function (e,f) { e.mcall (2, f.v["this"], "close", ([])); },
	function (e,f) {
		f.v["this"].current_item = f.v.item;
		f.v["this"].doc = f.v.doc;
		e.mcall (2, f.v["this"], "rerender_doc", ([]));
	},
	function (e,f) { e.mcall (2, f.v.item, "redisplay", ([])); },
null	];

;
	c.pargs__docpane =  [];
	c.pinst__docpane =  [
/*0*/	function (e,f) { e.mcall (2, f.v["this"], "get_id", ([])); },
	function (e,f) {
		var t1957 = f.s[0]; 
		e.mcall (3, document, "getElementById", ([("tree-docpane-") + (t1957)]));
	},
	function (e,f) { var t1958 = f.s[0]; e.return_pop (t1958); },
null	];

;
	cp.drag_move =  function (x,y)
	{
var node;var el;{
		;
		x += browser.scroll_left  ();;
		y += browser.scroll_top  ();;
		node = this.root.find_element_under_cursor  (x,y);;
		if (node !== this.current_hover)
		{{
		if (this.current_hover !== null)
		{{
		el = document.getElementById  ("tree-node-" + this.current_hover.get_id  ());;
		el.style.borderColor = "transparent";;
		this.current_hover = null;;
		}
		 }
		;
		if (node !== null && node != this.current_item)
		{{
		if (node.can_drop  ())
		{{
		el = document.getElementById  ("tree-node-" + node.get_id  ());;
		el.style.borderColor = "blue";;
		this.current_hover = node;;
		}
		 }
		;
		}
		 }
		;
		}
		 }
		;
		}
			}

;
	c.pargs__drag_stop =  ["payload","is_copy"];
	c.pinst__drag_stop =  [
/*0*/	function (e,f) { if ((((f.v["this"]).current_hover)) === ((null))) f.pc=2; else f.pc=3; },
	function (e,f) { e.return_pop (false); },
	function (e,f) {
		f.pc=4;
		f.s[0] = true;
	},
	function (e,f) { f.s[0] = (((f.v["this"]).current_hover)) === (((f.v["this"]).current_item)); },
	function (e,f) { var t1959 = f.s[0]; if (t1959) f.pc=1; else f.pc=5; },
/*5*/	function (e,f) { e.mcall (5, f.v["this"], "handle_drag_and_drop", ([f.v.payload, (f.v["this"]).current_hover, f.v.is_copy])); },
	function (e,f) { e.mcall (2, (f.v["this"]).current_hover, "get_id", ([])); },
	function (e,f) {
		var t1960 = f.s[0]; 
		e.mcall (3, document, "getElementById", ([("tree-node-") + (t1960)]));
	},
	function (e,f) {
		var t1962 = f.s[0]; f.v.el = t1962;
		(f.v.el).style.borderColor = "transparent";
		e.return_pop (true);
	},
null	];

;
};
tree_editor.init_methods (tree_editor);
rpcclass.setup_class (tree_editor, "tree_editor",0, (["current_hover","current_item","doc","root","itemclass","listeners"]), ([0,0,0,0,0,2]));
function popupmenutree () { this.do_construct (arguments); }
popupmenutree.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
	c.pargs__tree_as_menu =  ["tree"];
	c.pinst__tree_as_menu =  [
/*0*/	function (e,f) { e.smcall (0, menu,"create", ([])); },
	function (e,f) {
		var t1965 = f.s[0]; f.v.menu = t1965;
		f.v._k120 = e.enumkeys ((f.v.tree).children);
	},
	function (e,f) {
		f.pc=4;
		if (!((f.v._k120).length)) f.pc=3;
	},
	function (e,f) { if ((f.v["this"]).admin) f.pc=8; else f.pc=10; },
	function (e,f) {
		f.v.i = (f.v._k120).shift();
		f.v.item = ((f.v.tree).children)[(f.v.i)];
		if ((((f.v.item).type)) == (("leaf"))) f.pc=5; else f.pc=6;
	},
/*5*/	function (e,f) {
		f.pc=2;
		e.mcall (4, f.v.menu, "add_item", ([(f.v.item).value, (f.v.item).name]));
	},
	function (e,f) { e.mcall (3, f.v["this"], "tree_as_menu", ([f.v.item])); },
	function (e,f) {
		f.pc=2;
		var t1970 = f.s[0]; f.v.sub = t1970;
		e.mcall (4, f.v.menu, "add_submenu", ([(f.v.item).name, f.v.sub]));
	},
	function (e,f) { e.mcall (4, f.v.menu, "add_item", ([("newc:") + ((f.v.tree).path), "New submenu..."])); },
	function (e,f) { e.mcall (4, f.v.menu, "add_item", ([("newg:") + ((f.v.tree).path), "New group here..."])); },
/*10*/	function (e,f) { e.return_pop (f.v.menu); },
null	];

;
	c.pargs__add_item_to_tree =  ["menuname","group"];
	c.pinst__add_item_to_tree =  [
/*0*/	function (e,f) {
		f.v.fields = builtin__explode ("\\",f.v.menuname);
		f.v.path = "";
		f.v.pos = (f.v["this"]).tree;
		f.v.n = builtin__count (f.v.fields);
		if (((f.v.group)) !== ((null))) f.pc=1; else f.pc=2;
	},
	function (e,f) {
		e.php_push_var_lvalue (0, "n");
		e.php_postdec (1);
	},
	function (e,f) { f.v.i = 0; },
	function (e,f) {
		f.pc=5;
		if (!(((f.v.i)) < ((f.v.n)))) f.pc=4;
	},
	function (e,f) { if (((f.v.group)) !== ((null))) f.pc=16; else f.pc=-1; },
/*5*/	function (e,f) {
		f.v.field = (f.v.fields)[(f.v.i)];
		if (((f.v.path)) == ((""))) f.pc=6; else f.pc=7;
	},
	function (e,f) {
		f.pc=8;
		f.v.path = f.v.field;
	},
	function (e,f) { f.v.path = "" + (f.v.path) + (("\\") + (f.v.field)); },
	function (e,f) { f.v.j = 0; },
	function (e,f) {
		f.pc=11;
		if (!(((f.v.j)) < ((builtin__count ((f.v.pos).children))))) f.pc=10;
	},
/*10*/	function (e,f) { if (((f.v.j)) == ((builtin__count ((f.v.pos).children)))) f.pc=14; else f.pc=15; },
	function (e,f) { if ((((((f.v.pos).children)[(f.v.j)]).name)) == ((f.v.field))) f.pc=12; else f.pc=13; },
	function (e,f) { f.pc=10; },
	function (e,f) {
		f.pc=9;
		e.php_push_var_lvalue (0, "j");
		e.php_postinc (1);
	},
	function (e,f) { (f.v.pos).children[f.v.j] = ({type:"branch", name:f.v.field, path:f.v.path, children:([])}); },
/*15*/	function (e,f) {
		f.pc=3;
		f.v.pos = ((f.v.pos).children)[(f.v.j)];
		e.php_push_var_lvalue (0, "i");
		e.php_postinc (1);
	},
	function (e,f) { (f.v.pos).children[(f.v.pos).children.length] = ({type:"leaf", name:(f.v.fields)[(f.v.i)], value:f.v.group}); },
null	];

;
	c.pargs__initialise_tree =  [];
	c.pinst__initialise_tree =  [
/*0*/	function (e,f) { f.v["this"].tree = ({type:"branch", name:"", path:"", children:([])}); },
null	];

;
	c.pargs__select =  [];
	c.pinst__select =  [
/*0*/	function (e,f) { e.mcall (2, f.v["this"], "create_tree", ([])); },
	function (e,f) {  },
	function (e,f) {
		f.pc=4;
		e.mcall (3, f.v["this"], "tree_as_menu", ([(f.v["this"]).tree]));
	},
	function (e,f) { e.return_pop (null); },
	function (e,f) {
		var t1988 = f.s[0]; f.v.menu = t1988;
		e.smcall (1, popupmenu,"run", ([f.v.menu]));
	},
/*5*/	function (e,f) {
		var t1990 = f.s[0]; f.v.value = t1990;
		if (((f.v.value)) == ((null))) f.pc=3; else f.pc=6;
	},
	function (e,f) {
		f.v.matches = ([]);
		if (builtin__preg_match ("/^newc\\:(.*)$/",f.v.value,f.v.matches)) f.pc=7; else f.pc=13;
	},
	function (e,f) {
		f.v.path = (f.v.matches)[(1)];
		e.smcall (6, popupcombobox,"run", ([0, 0, ("Create new submenu in ") + (f.v.path), ([]), true, ""]));
	},
	function (e,f) {
		var t1994 = f.s[0]; f.v.name = t1994;
		if (((f.v.name)) === ((null))) f.pc=3; else f.pc=9;
	},
	function (e,f) { if (((f.v.path)) == ((""))) f.pc=10; else f.pc=11; },
/*10*/	function (e,f) {
		f.pc=12;
		f.v.path = f.v.name;
	},
	function (e,f) { f.v.path = "" + (f.v.path) + (("\\") + (f.v.name)); },
	function (e,f) {
		f.pc=2;
		e.mcall (4, f.v["this"], "add_item_to_tree", ([f.v.path, null]));
	},
	function (e,f) { if (builtin__preg_match ("/^newg\\:(.*)$/",f.v.value,f.v.matches)) f.pc=14; else f.pc=21; },
	function (e,f) {
		f.v.path = (f.v.matches)[(1)];
		e.smcall (6, popupcombobox,"run", ([0, 0, ("Create new group in ") + (f.v.path), ([]), true, ""]));
	},
/*15*/	function (e,f) {
		var t1999 = f.s[0]; f.v.name = t1999;
		if (((f.v.name)) === ((null))) f.pc=3; else f.pc=16;
	},
	function (e,f) { if (((f.v.path)) == ((""))) f.pc=17; else f.pc=18; },
	function (e,f) {
		f.pc=19;
		f.v.path = f.v.name;
	},
	function (e,f) { f.v.path = "" + (f.v.path) + (("\\") + (f.v.name)); },
	function (e,f) { e.mcall (3, f.v["this"], "create_new", ([f.v.path])); },
/*20*/	function (e,f) { var t2002 = f.s[0]; e.return_pop (t2002); },
	function (e,f) { e.return_pop (f.v.value); },
null	];

;
};
popupmenutree.init_methods (popupmenutree);
rpcclass.setup_class (popupmenutree, "popupmenutree",0, (["tree","admin","listeners"]), ([0,0,2]));
function menubar () { this.do_construct (arguments); }
menubar.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
	c.pargs__run_menu =  ["n"];
	c.pinst__run_menu =  [
/*0*/	function (e,f) {
		f.v["this"].active_menu = f.v.n;
		e.mcall (3, f.v["this"], "get_menu_id", ([f.v.n]));
	},
	function (e,f) { var t2004 = f.s[0]; e.mcall (3, document, "getElementById", ([t2004])); },
	function (e,f) {
		var t2006 = f.s[0]; f.v.el = t2006;
		(f.v.el).style.background = "#316ac5";
		(f.v.el).style.color = "white";
		f.s[0] = (f.v.el).clientHeight;
		e.smcall (2, lib,"document_y_of", ([f.v.el]));
	},
	function (e,f) {
		var t2009 = f.s[1]; var t2010 = f.s[0]; f.s[0] = parseInt((t2009),10) + parseInt((t2010),10);
		e.smcall (2, lib,"document_x_of", ([f.v.el]));
	},
	function (e,f) { e.php_static_method_call (2, popup,"set_default_coordinates", 2); },
/*5*/	function (e,f) { e.mcall (2, f.v["this"], "get_menubar_id", ([])); },
	function (e,f) { var t2013 = f.s[0]; e.mcall (3, document, "getElementById", ([t2013])); },
	function (e,f) {
		var t2015 = f.s[0]; f.v.bar = t2015;
		f.s[0] = 1;
		e.smcall (1, popup,"next_zindex", ([]));
	},
	function (e,f) {
		var t2016 = f.s[1]; var t2017 = f.s[0]; 
		(f.v.bar).style.zIndex = parseInt((t2016),10) + parseInt((t2017),10);
		f.s[0] = "px";
		e.smcall (2, lib,"document_x_of", ([f.v.bar]));
	},
	function (e,f) {
		var t2019 = f.s[1]; var t2020 = f.s[0]; 
		(f.v.bar).style.left = "" + (t2019) + (t2020);
		f.s[0] = "px";
		e.smcall (2, lib,"document_y_of", ([f.v.bar]));
	},
/*10*/	function (e,f) {
		var t2022 = f.s[1]; var t2023 = f.s[0]; 
		(f.v.bar).style.top = "" + (t2022) + (t2023);
		(f.v.bar).style.width = "" + ((f.v.bar).offsetWidth) + ("px");
		(f.v.bar).style.height = "" + ((f.v.bar).offsetHeight) + ("px");
		(f.v.bar).style.position = "absolute";
		e.smcall (1, popupmenu,"create", ([(((f.v["this"]).items)[(f.v.n)]).menu]));
	},
	function (e,f) {
		var t2029 = f.s[0]; f.v["this"].pm = t2029;
		e.mcall (2, (f.v["this"]).pm, "do_run", ([]));
	},
	function (e,f) {
		var t2031 = f.s[0]; f.v.choice = t2031;
		e.mcall (2, f.v["this"], "deactivate", ([]));
	},
	function (e,f) { if ((((f.v["this"]).selection)) !== ((null))) f.pc=14; else f.pc=18; },
	function (e,f) { e.mcall (2, window, "getSelection", ([])); },
/*15*/	function (e,f) {
		var t2033 = f.s[0]; f.v.ranges = t2033;
		e.mcall (2, f.v.ranges, "removeAllRanges", ([]));
	},
	function (e,f) { e.mcall (3, f.v.ranges, "addRange", ([(f.v["this"]).selection])); },
	function (e,f) { f.v["this"].selection = null; },
	function (e,f) { if (((f.v.choice)) !== ((null))) f.pc=19; else f.pc=-1; },
	function (e,f) { if ((((f.v["this"]).selection)) !== ((null))) f.pc=20; else f.pc=20; },
/*20*/	function (e,f) {
		f.v.fn = (f.v.choice)[(0)];
		f.v.arg = (f.v.choice)[(1)];
		e.mcall (4, (f.v["this"]).owner, "menubar_action", ([f.v.fn, f.v.arg]));
	},
null	];

;
	c.pargs__deactivate =  [];
	c.pinst__deactivate =  [
/*0*/	function (e,f) { if ((((f.v["this"]).active_menu)) !== ((null))) f.pc=1; else f.pc=-1; },
	function (e,f) { e.mcall (2, f.v["this"], "get_menubar_id", ([])); },
	function (e,f) { var t2037 = f.s[0]; e.mcall (3, document, "getElementById", ([t2037])); },
	function (e,f) {
		var t2039 = f.s[0]; f.v.bar = t2039;
		(f.v.bar).style.zIndex = "";
		(f.v.bar).style.left = "";
		(f.v.bar).style.top = "";
		(f.v.bar).style.width = "";
		(f.v.bar).style.height = "";
		(f.v.bar).style.position = "";
		e.mcall (3, f.v["this"], "get_menu_id", ([(f.v["this"]).active_menu]));
	},
	function (e,f) { var t2046 = f.s[0]; e.mcall (3, document, "getElementById", ([t2046])); },
/*5*/	function (e,f) {
		var t2048 = f.s[0]; f.v.el = t2048;
		(f.v.el).style.background = "";
		(f.v.el).style.color = "";
		e.mcall (2, (f.v["this"]).pm, "destroy", ([]));
	},
	function (e,f) {
		f.v["this"].pm = null;
		f.v["this"].active_menu = null;
	},
null	];

;
	c.pargs__onmouseover =  ["el","arg","ev"];
	c.pinst__onmouseover =  [
/*0*/	function (e,f) { if ((((f.v["this"]).active_menu)) === ((null))) f.pc=1; else f.pc=2; },
	function (e,f) {
		f.pc=-1;
		(f.v.el).style.background = "#316ac5";
		(f.v.el).style.color = "white";
	},
	function (e,f) { e.mcall (2, f.v["this"], "deactivate", ([])); },
	function (e,f) { e.mcall (3, f.v["this"], "run_menu", ([f.v.arg])); },
null	];

;
	c.pargs__onmouseout =  ["el","arg","ev"];
	c.pinst__onmouseout =  [
/*0*/	function (e,f) { if ((((f.v["this"]).active_menu)) === ((null))) f.pc=1; else f.pc=-1; },
	function (e,f) {
		(f.v.el).style.background = "";
		(f.v.el).style.color = "";
	},
null	];

;
	c.pargs__onclick =  ["el","arg","ev"];
	c.pinst__onclick =  [
/*0*/	function (e,f) {
		f.v.item = ((f.v["this"]).items)[(f.v.arg)];
		e.mcall (2, f.v["this"], "deactivate", ([]));
	},
	function (e,f) { e.mcall (3, f.v["this"], "run_menu", ([f.v.arg])); },
null	];

;
	c.pargs__onmousedown =  ["el","arg","ev"];
	c.pinst__onmousedown =  [
/*0*/	function (e,f) { e.mcall (2, window, "getSelection", ([])); },
	function (e,f) {
		var t2059 = f.s[0]; f.v.ranges = t2059;
		if ((((f.v.ranges).rangeCount)) == ((0))) f.pc=2; else f.pc=3;
	},
	function (e,f) {
		f.pc=4;
		f.s[0] = null;
	},
	function (e,f) { e.mcall (3, f.v.ranges, "getRangeAt", ([0])); },
	function (e,f) { var t2061 = f.s[0]; f.v["this"].selection = t2061; },
null	];

;
	c.args__create = c.pargs__create =  ["owner"];
	c.inst__create = c.pinst__create =  [
/*0*/	function (e,f) {
		f.v.res = new menubar;
		f.v.res.owner = f.v.owner;
		f.v.res.items = ([]);
		f.v.res.active_menu = null;
		f.v.res.selection = null;
		e.return_pop (f.v.res);
	},
null	];

;
	c.pargs__add_item =  ["name","menu"];
	c.pinst__add_item =  [
/*0*/	function (e,f) { (f.v["this"]).items[(f.v["this"]).items.length] = ({name:f.v.name, menu:f.v.menu}); },
null	];

;
	c.pargs__get =  ["name"];
	c.pinst__get =  [
/*0*/	function (e,f) { f.v._k122 = e.enumkeys ((f.v["this"]).items); },
	function (e,f) {
		f.pc=3;
		if (!((f.v._k122).length)) f.pc=2;
	},
	function (e,f) { e.return_pop (null); },
	function (e,f) {
		f.s[0] = f.v._i123 = (f.v._k122).shift();
		f.s[1] = f.v.item = ((f.v["this"]).items)[(f.v._i123)];
		if ((((f.v.item).name)) == ((f.v.name))) f.pc=4; else f.pc=1;
	},
	function (e,f) { e.return_pop ((f.v.item).menu); },
null	];

;
	c.pargs__get_menu_id =  ["i"];
	c.pinst__get_menu_id =  [
/*0*/	function (e,f) {
		f.s[0] = ("-") + (f.v.i);
		e.mcall (3, f.v["this"], "get_id", ([]));
	},
	function (e,f) {
		var t2071 = f.s[1]; var t2072 = f.s[0]; 
		e.return_pop (("menu-item-") + ("" + (t2071) + (t2072)));
	},
null	];

;
	c.pargs__get_menubar_id =  [];
	c.pinst__get_menubar_id =  [
/*0*/	function (e,f) {
		f.s[0] = ("-") + (f.v.i);
		e.mcall (3, f.v["this"], "get_id", ([]));
	},
	function (e,f) {
		var t2073 = f.s[1]; var t2074 = f.s[0]; 
		e.return_pop (("menu-item-") + ("" + (t2073) + (t2074)));
	},
null	];

;
	c.pargs__render =  [];
	c.pinst__render =  [
/*0*/	function (e,f) {
		window.__outbuffer += "<div class=\"pjmenubar\" contentEditable=\"false\" >";
		f.s[0] = "\" style=\"float:left\" >";
		e.mcall (3, f.v["this"], "get_menubar_id", ([]));
	},
	function (e,f) {
		var t2075 = f.s[1]; var t2076 = f.s[0]; 
		window.__outbuffer += ("<div id=\"") + ("" + (t2075) + (t2076));
		f.v.i = 0;
	},
	function (e,f) {
		f.pc=4;
		if (!(((f.v.i)) < ((builtin__count ((f.v["this"]).items))))) f.pc=3;
	},
	function (e,f) {
		f.pc=-1;
		window.__outbuffer += "<div style=\"clear:both\"></div>";
		window.__outbuffer += "</div>";
		window.__outbuffer += "</div>";
	},
	function (e,f) {
		window.__outbuffer += "<div class=\"pjmenubarheader\"";
		f.s[0] = "\"";
		e.mcall (4, f.v["this"], "get_menu_id", ([f.v.i]));
	},
/*5*/	function (e,f) {
		var t2078 = f.s[1]; var t2079 = f.s[0]; 
		window.__outbuffer += (" id=\"") + ("" + (t2078) + (t2079));
		f.s[0] = "\"";
		e.mcall (5, f.v["this"], "render_start", (["onmouseover", f.v.i]));
	},
	function (e,f) {
		var t2080 = f.s[1]; var t2081 = f.s[0]; 
		window.__outbuffer += (" onmouseover=\"") + ("" + (t2080) + (t2081));
		f.s[0] = "\"";
		e.mcall (5, f.v["this"], "render_start", (["onmouseout", f.v.i]));
	},
	function (e,f) {
		var t2082 = f.s[1]; var t2083 = f.s[0]; 
		window.__outbuffer += (" onmouseout=\"") + ("" + (t2082) + (t2083));
		f.s[0] = "\"";
		e.mcall (5, f.v["this"], "render_start", (["onclick", f.v.i]));
	},
	function (e,f) {
		var t2084 = f.s[1]; var t2085 = f.s[0]; 
		window.__outbuffer += (" onclick=\"") + ("" + (t2084) + (t2085));
		f.s[0] = "\"";
		e.mcall (5, f.v["this"], "render_start", (["onmousedown", f.v.i]));
	},
	function (e,f) {
		f.pc=2;
		var t2086 = f.s[1]; var t2087 = f.s[0]; 
		window.__outbuffer += (" onmousedown=\"") + ("" + (t2086) + (t2087));
		window.__outbuffer += (">") + ("" + ((((f.v["this"]).items)[(f.v.i)]).name) + ("</div>"));
		e.php_push_var_lvalue (0, "i");
		e.php_postinc (1);
	},
null	];

;
};
menubar.init_methods (menubar);
rpcclass.setup_class (menubar, "menubar",0, (["owner","items","selection","active_menu","listeners"]), ([0,0,2,0,2]));
function tabmanager () { this.do_construct (arguments); }
tabmanager.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
	c.pargs__can_import =  [];
	c.pinst__can_import =  [
/*0*/	function (e,f) { e.return_pop (false); },
null	];

;
	c.pargs__rating_field =  [];
	c.pinst__rating_field =  [
/*0*/	function (e,f) { e.return_pop (null); },
null	];

;
	c.pargs__initialise =  ["tabclass","list_fields","search_fields"];
	c.pinst__initialise =  [
/*0*/	function (e,f) {
		f.v["this"].tabclass = f.v.tabclass;
		f.v["this"].list_fields = f.v.list_fields;
		f.v["this"].search_fields = f.v.search_fields;
	},
null	];

;
	c.pargs__run_search =  ["terms"];
	c.pinst__run_search =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["run_search", ([f.v.terms])])); },
	function (e,f) { var t2092 = f.s[0]; e.return_pop (t2092); },
null	];

;
	c.pargs__choose =  ["title","include_select","include_create","namehint"];
	c.pinst__choose =  [
/*0*/	function (e,f) {
		f.v.fields = ([]);
		f.v.fields[f.v.fields.length] = ({type:"text", name:"inbox", label:"", focus:true, value:f.v.namehint});
		if (f.v.include_create) f.pc=1; else f.pc=3;
	},
	function (e,f) { e.smcall (2, tabmanager,"render_resume", (["create", 0])); },
	function (e,f) {
		var t2095 = f.s[0]; 
		f.v.fields[f.v.fields.length] = ({type:"button", name:"create", label:"Create New", action:t2095});
	},
	function (e,f) {  },
	function (e,f) {
		f.v.re_search = false;
		f.v.pop = new popupform;
		e.mcall (6, f.v.pop, "initialise", ([0, 0, f.v.title, f.v.fields]));
	},
/*5*/	function (e,f) { e.mcall (2, f.v.pop, "open", ([])); },
	function (e,f) {  },
	function (e,f) {
		f.pc=9;
		e.mcall (2, f.v.pop, "run", ([]));
	},
	function (e,f) { if (!(f.v.re_search)) f.pc=93; else f.pc=4; },
	function (e,f) {
		var t2100 = f.s[0]; f.v.event = t2100;
		f.v.action = (f.v.event).action;
		f.v.rowid = 0;
		if (((f.v.action)) == (("cancel"))) f.pc=90; else f.pc=91;
	},
/*10*/	function (e,f) { e.mcall (2, f.v.pop, "close", ([])); },
	function (e,f) { f.pc=8; },
	function (e,f) { if (((f.v.action)) == (("OK"))) f.pc=13; else f.pc=76; },
	function (e,f) { e.mcall (2, f.v.pop, "get_form_fields", ([])); },
	function (e,f) {
		var t2104 = f.s[0]; f.v.vals = t2104;
		f.v.terms = (f.v.vals).inbox;
		e.mcall (2, f.v.pop, "close", ([]));
	},
/*15*/	function (e,f) { e.mcall (3, f.v["this"], "run_search", ([f.v.terms])); },
	function (e,f) {
		var t2107 = f.s[0]; f.v.res = t2107;
		if (((builtin__count (f.v.res))) == ((1))) f.pc=73; else f.pc=74;
	},
	function (e,f) {
		f.pc=8;
		f.v.item = (f.v.res)[(0)];
		f.v.rowid = (f.v.item).rowid;
	},
	function (e,f) {
		f.v.srfields = ([]);
		if (((builtin__count (f.v.res))) == ((0))) f.pc=19; else f.pc=20;
	},
	function (e,f) {
		f.pc=39;
		f.v.srfields[f.v.srfields.length] = ({name:"stuff", label:"", type:"label", value:"Nothing found"});
	},
/*20*/	function (e,f) {
		f.v.options = ([]);
		f.v._k124 = e.enumkeys (f.v.res);
	},
	function (e,f) {
		f.pc=23;
		if (!((f.v._k124).length)) f.pc=22;
	},
	function (e,f) {
		f.pc=39;
		f.v.srfields[f.v.srfields.length] = ({name:"table", label:"", type:"table", options:f.v.options});
	},
	function (e,f) {
		f.pc=28;
		f.v.i = (f.v._k124).shift();
		f.v.item = (f.v.res)[(f.v.i)];
		f.v.html = "";
		f.v.colour = "";
		f.s[0] = null;
		e.mcall (3, f.v["this"], "rating_field", ([]));
	},
	function (e,f) { e.mcall (2, f.v["this"], "rating_field", ([])); },
/*25*/	function (e,f) {
		var t2120 = f.s[0]; f.v.field = t2120;
		e.mcall (2, f.v["this"], "rating_field", ([]));
	},
	function (e,f) {
		var t2121 = f.s[0]; 
		e.mcall (3, f.v["this"], "rating_colour", ([(f.v.item)[(t2121)]]));
	},
	function (e,f) {
		f.pc=29;
		var t2123 = f.s[0]; f.v.colour = t2123;
	},
	function (e,f) {
		var t2124 = f.s[1]; var t2125 = f.s[0]; 
		if (((t2124)) != ((t2125))) f.pc=24; else f.pc=29;
	},
	function (e,f) { f.v._k126 = e.enumkeys ((f.v["this"]).list_fields); },
/*30*/	function (e,f) {
		f.pc=32;
		if (!((f.v._k126).length)) f.pc=31;
	},
	function (e,f) {
		f.pc=35;
		f.s[0] = "\">open</a></td>";
		e.smcall (3, tabmanager,"render_resume", (["open", f.v.i]));
	},
	function (e,f) {
		f.v._i127 = (f.v._k126).shift();
		f.v.fname = ((f.v["this"]).list_fields)[(f.v._i127)];
		f.v.html = "" + (f.v.html) + ("<td");
		if (((f.v.colour)) != ((""))) f.pc=33; else f.pc=34;
	},
	function (e,f) { f.v.html = "" + (f.v.html) + ((" style=\"color:") + ("" + (f.v.colour) + ("\""))); },
	function (e,f) {
		f.pc=30;
		f.v.html = "" + (f.v.html) + ((">") + ("" + ((f.v.item)[(f.v.fname)]) + ("</td>")));
	},
/*35*/	function (e,f) {
		var t2132 = f.s[1]; var t2133 = f.s[0]; 
		f.v.html = "" + (f.v.html) + (("<td><a href=\"#\" onclick=\"") + ("" + (t2132) + (t2133)));
		if (f.v.include_select) f.pc=36; else f.pc=38;
	},
	function (e,f) {
		f.s[0] = "\">select</a></td>";
		e.smcall (3, tabmanager,"render_resume", (["select", f.v.i]));
	},
	function (e,f) {
		var t2135 = f.s[1]; var t2136 = f.s[0]; 
		f.v.html = "" + (f.v.html) + (("<td><a href=\"#\" onclick=\"") + ("" + (t2135) + (t2136)));
	},
	function (e,f) {
		f.pc=21;
		f.v.options[f.v.options.length] = f.v.html;
	},
	function (e,f) { if (f.v.include_create) f.pc=40; else f.pc=43; },
/*40*/	function (e,f) { e.smcall (2, tabmanager,"render_resume", (["create", 0])); },
	function (e,f) {
		var t2139 = f.s[0]; 
		f.v.srfields[f.v.srfields.length] = ({type:"button", name:"create", label:"Create New", action:t2139});
		e.smcall (2, tabmanager,"render_resume", (["re_search", 0]));
	},
	function (e,f) {
		var t2141 = f.s[0]; 
		f.v.srfields[f.v.srfields.length] = ({type:"button", name:"create", label:"Search again", action:t2141});
	},
	function (e,f) {
		f.v.pop = new popupform;
		e.mcall (6, f.v.pop, "initialise", ([0, 0, "Search results", f.v.srfields]));
	},
	function (e,f) { e.mcall (4, f.v.pop, "use_ok_cancel", ([false, true])); },
/*45*/	function (e,f) { e.mcall (2, f.v.pop, "open", ([])); },
	function (e,f) {  },
	function (e,f) {
		f.pc=49;
		e.php_builtin (0, "wait_for_input", 0);
	},
	function (e,f) {
		f.pc=72;
		e.mcall (2, f.v.pop, "close", ([]));
	},
	function (e,f) {
		var t2145 = f.s[0]; f.v.event = t2145;
		if ((((f.v.event).action)) == (("re_search"))) f.pc=50; else f.pc=51;
	},
/*50*/	function (e,f) {
		f.pc=48;
		f.v.re_search = true;
	},
	function (e,f) { if ((((f.v.event).action)) == (("open"))) f.pc=52; else f.pc=55; },
	function (e,f) {
		f.v.item = (f.v.res)[((f.v.event).parm)];
		e.mcall (4, f.v["this"], "open", ([(f.v.item).rowid, f.v.include_select]));
	},
	function (e,f) {
		var t2149 = f.s[0]; f.v.inp = t2149;
		if (((f.v.inp)) == (("select"))) f.pc=54; else f.pc=47;
	},
	function (e,f) {
		f.pc=48;
		f.v.rowid = (f.v.item).rowid;
	},
/*55*/	function (e,f) { if ((((f.v.event).action)) == (("select"))) f.pc=56; else f.pc=57; },
	function (e,f) {
		f.pc=48;
		f.v.item = (f.v.res)[((f.v.event).parm)];
		f.v.rowid = (f.v.item).rowid;
	},
	function (e,f) { if ((((f.v.event).action)) == (("cover"))) f.pc=69; else f.pc=70; },
	function (e,f) { f.pc=48; },
	function (e,f) { if ((((f.v.event).action)) == (("create"))) f.pc=60; else f.pc=63; },
/*60*/	function (e,f) { e.mcall (2, f.v.pop, "close", ([])); },
	function (e,f) { e.mcall (3, f.v["this"], "create_new", ([f.v.terms])); },
	function (e,f) {
		f.pc=48;
		var t2154 = f.s[0]; f.v.rowid = t2154;
	},
	function (e,f) { if ((((f.v.event).action)) == (("import"))) f.pc=64; else f.pc=47; },
	function (e,f) { e.mcall (2, f.v.pop, "close", ([])); },
/*65*/	function (e,f) { e.mcall (3, f.v["this"], "import", ([f.v.terms])); },
	function (e,f) {
		var t2156 = f.s[0]; f.v.rowid = t2156;
		if (f.v.rowid) f.pc=67; else f.pc=47;
	},
	function (e,f) { e.mcall (4, f.v["this"], "open", ([f.v.rowid, f.v.include_select])); },
	function (e,f) { f.pc=48; },
	function (e,f) {
		f.pc=71;
		f.s[0] = true;
	},
/*70*/	function (e,f) { f.s[0] = (((f.v.event).action)) == (("cancel")); },
	function (e,f) { var t2157 = f.s[0]; if (t2157) f.pc=58; else f.pc=59; },
	function (e,f) { f.pc=8; },
	function (e,f) {
		f.pc=75;
		f.s[0] = f.v.include_select;
	},
	function (e,f) { f.s[0] = false; },
/*75*/	function (e,f) { var t2158 = f.s[0]; if (t2158) f.pc=17; else f.pc=18; },
	function (e,f) { if (((f.v.action)) == (("create"))) f.pc=77; else f.pc=83; },
	function (e,f) { e.mcall (2, f.v.pop, "get_form_fields", ([])); },
	function (e,f) {
		var t2160 = f.s[0]; f.v.vals = t2160;
		f.v.terms = (f.v.vals).inbox;
		if (((f.v.terms)) != ((""))) f.pc=79; else f.pc=80;
	},
	function (e,f) { f.v.namehint = f.v.terms; },
/*80*/	function (e,f) { e.mcall (2, f.v.pop, "close", ([])); },
	function (e,f) { e.mcall (3, f.v["this"], "create_new", ([f.v.namehint])); },
	function (e,f) {
		f.pc=8;
		var t2164 = f.s[0]; f.v.rowid = t2164;
	},
	function (e,f) { if (((f.v.action)) == (("import"))) f.pc=84; else f.pc=7; },
	function (e,f) { e.mcall (2, f.v.pop, "get_form_fields", ([])); },
/*85*/	function (e,f) {
		var t2166 = f.s[0]; f.v.vals = t2166;
		f.v.terms = (f.v.vals).inbox;
		if (((f.v.terms)) != ((""))) f.pc=86; else f.pc=87;
	},
	function (e,f) { f.v.namehint = f.v.terms; },
	function (e,f) { e.mcall (2, f.v.pop, "close", ([])); },
	function (e,f) { e.mcall (3, f.v["this"], "import", ([f.v.namehint])); },
	function (e,f) {
		var t2170 = f.s[0]; f.v.rowid = t2170;
		if (f.v.rowid) f.pc=8; else f.pc=7;
	},
/*90*/	function (e,f) {
		f.pc=92;
		f.s[0] = true;
	},
	function (e,f) { f.s[0] = ((f.v.action)) == (("cover")); },
	function (e,f) { var t2171 = f.s[0]; if (t2171) f.pc=10; else f.pc=12; },
	function (e,f) { e.return_pop (f.v.rowid); },
null	];

;
};
tabmanager.init_methods (tabmanager);
rpcclass.setup_class (tabmanager, "tabmanager",0, (["tabclass","list_fields","search_fields","listeners"]), ([0,0,0,2]));
function genericcalendar () { this.do_construct (arguments); }
genericcalendar.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
	c.pargs__call_add_item =  ["el","day","ev"];
	c.pinst__call_add_item =  [
/*0*/	function (e,f) { e.mcall (3, f.v["this"], "add_item", ([f.v.day])); },
null	];

;
	c.pargs__get_day_elements =  [];
	c.pinst__get_day_elements =  [
/*0*/	function (e,f) {
		f.v.els = ({});
		f.v._k128 = e.enumkeys ((f.v["this"]).day_ids);
	},
	function (e,f) {
		f.pc=3;
		if (!((f.v._k128).length)) f.pc=2;
	},
	function (e,f) { e.return_pop (f.v.els); },
	function (e,f) {
		f.s[0] = f.v.d = (f.v._k128).shift();
		f.s[1] = f.v.id = ((f.v["this"]).day_ids)[(f.v.d)];
		e.mcall (5, document, "getElementById", ([f.v.id]));
	},
	function (e,f) {
		f.pc=1;
		var t2177 = f.s[2]; f.v.els[f.v.d] = t2177;
	},
null	];

;
	c.pargs__get_day_html =  ["d"];
	c.pinst__get_day_html =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["get_day_html", ([f.v.d])])); },
	function (e,f) { var t2178 = f.s[0]; e.return_pop (t2178); },
null	];

;
	c.pargs__get_days_html =  ["dl"];
	c.pinst__get_days_html =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["get_days_html", ([f.v.dl])])); },
	function (e,f) { var t2179 = f.s[0]; e.return_pop (t2179); },
null	];

;
	c.pargs__day_is_displayed =  ["d"];
	c.pinst__day_is_displayed =  [
/*0*/	function (e,f) { e.mcall (3, f.v["this"], "day_el_name", ([f.v.d])); },
	function (e,f) { var t2180 = f.s[0]; e.mcall (3, document, "getElementById", ([t2180])); },
	function (e,f) {
		var t2182 = f.s[0]; f.v.el = t2182;
		e.return_pop (((f.v.el)) !== ((null)));
	},
null	];

;
	c.pargs__rerender_days =  ["cdl"];
	c.pinst__rerender_days =  [
/*0*/	function (e,f) {
		f.v.dl = ([]);
		f.v._k130 = e.enumkeys (f.v.cdl);
	},
	function (e,f) {
		f.pc=3;
		if (!((f.v._k130).length)) f.pc=2;
	},
	function (e,f) { if (((builtin__count (f.v.dl))) > ((0))) f.pc=6; else f.pc=-1; },
	function (e,f) {
		f.pc=5;
		f.s[0] = f.v._i131 = (f.v._k130).shift();
		f.s[1] = f.v.cd = (f.v.cdl)[(f.v._i131)];
		e.mcall (5, f.v["this"], "day_is_displayed", ([f.v.cd]));
	},
	function (e,f) {
		f.pc=1;
		f.v.dl[f.v.dl.length] = f.v.cd;
	},
/*5*/	function (e,f) { var t2188 = f.s[2]; if (t2188) f.pc=4; else f.pc=1; },
	function (e,f) { e.mcall (3, f.v["this"], "get_days_html", ([f.v.dl])); },
	function (e,f) {
		var t2190 = f.s[0]; f.v.hl = t2190;
		f.v.i = 0;
	},
	function (e,f) { if (!(((f.v.dl)[(f.v.i)]) !== undefined)) f.pc=-1; },
	function (e,f) { e.mcall (3, f.v["this"], "day_el_name", ([(f.v.dl)[(f.v.i)]])); },
/*10*/	function (e,f) { var t2192 = f.s[0]; e.mcall (3, document, "getElementById", ([t2192])); },
	function (e,f) {
		var t2194 = f.s[0]; f.v.el = t2194;
		if (((f.v.el)) !== ((null))) f.pc=12; else f.pc=13;
	},
	function (e,f) { f.v.el.innerHTML = (f.v.hl)[(f.v.i)]; },
	function (e,f) {
		f.pc=8;
		e.php_push_var_lvalue (0, "i");
		e.php_postinc (1);
	},
null	];

;
	c.pargs__rerender_day =  ["d"];
	c.pinst__rerender_day =  [
/*0*/	function (e,f) { e.mcall (3, f.v["this"], "rerender_days", ([([f.v.d])])); },
null	];

;
	c.pargs__day_el_name =  ["d"];
	c.pinst__day_el_name =  [
/*0*/	function (e,f) {
		f.s[0] = ("-") + (builtin__date ("Y-m-d",f.v.d));
		e.mcall (3, f.v["this"], "get_id", ([]));
	},
	function (e,f) {
		var t2197 = f.s[1]; var t2198 = f.s[0]; 
		e.return_pop (("cal-") + ("" + (t2197) + (t2198)));
	},
null	];

;
};
genericcalendar.init_methods (genericcalendar);
rpcclass.setup_class (genericcalendar, "genericcalendar",0, (["day_ids","listeners"]), ([0,2]));
function genericcalendaritemcomponent () { this.do_construct (arguments); }
genericcalendaritemcomponent.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
	c.pargs__as_string =  [];
	c.pinst__as_string =  [
/*0*/	function (e,f) {
		f.s[0] = (" from ") + ("" + (builtin__date ("Y-m-d",(f.v["this"]).first_day)) + ((" length ") + ((f.v["this"]).dayspan)));
		e.mcall (3, (f.v["this"]).gce, "title", ([]));
	},
	function (e,f) {
		var t2199 = f.s[1]; var t2200 = f.s[0]; 
		e.return_pop ("" + (t2199) + (t2200));
	},
null	];

;
	c.pargs__click =  ["el","arg","ev"];
	c.pinst__click =  [
/*0*/	function (e,f) { e.mcall (2, (f.v["this"]).gce, "click", ([])); },
null	];

;
	c.pargs__contextmenu =  ["el","arg","ev"];
	c.pinst__contextmenu =  [
/*0*/	function (e,f) { e.mcall (2, (f.v["this"]).gce, "contextmenu", ([])); },
null	];

;
	c.args__render_padding = c.pargs__render_padding =  [];
	c.inst__render_padding = c.pinst__render_padding =  [
/*0*/	function (e,f) { window.__outbuffer += "<div class=\"calendarPadding\">&nbsp;</div>"; },
null	];

;
	c.pargs__render =  ["date"];
	c.pinst__render =  [
/*0*/	function (e,f) { if (((f.v.date)) == (((f.v["this"]).first_day))) f.pc=1; else f.pc=13; },
	function (e,f) {
		f.pc=9;
		e.mcall (2, (f.v["this"]).gce, "is_block", ([]));
	},
	function (e,f) {
		f.v.classname = "calendarAllDayEntry";
		f.v.width = parseInt((((parseInt(((f.v["this"]).dayspan),10) - parseInt((1),10))) * ((90))),10) + parseInt((80),10);
		f.s[0] = (";width:") + ("" + (f.v.width) + ("px;opacity:0.8;"));
		e.mcall (3, (f.v["this"]).gce, "colour", ([]));
	},
	function (e,f) {
		var t2203 = f.s[1]; var t2204 = f.s[0]; 
		f.v.style = ("background:") + ("" + (t2203) + (t2204));
		e.mcall (2, (f.v["this"]).gce, "title", ([]));
	},
	function (e,f) {
		f.pc=10;
		var t2207 = f.s[0]; f.v.text = t2207;
	},
/*5*/	function (e,f) {
		f.v.classname = "calendarSingleEntry";
		f.s[0] = ";";
		e.mcall (3, (f.v["this"]).gce, "colour", ([]));
	},
	function (e,f) {
		var t2209 = f.s[1]; var t2210 = f.s[0]; 
		f.v.style = ("color:") + ("" + (t2209) + (t2210));
		e.mcall (2, (f.v["this"]).gce, "title", ([]));
	},
	function (e,f) {
		var t2212 = f.s[0]; 
		f.s[0] = (": ") + (builtin__htmlentities (t2212));
		e.mcall (3, (f.v["this"]).gce, "start_time", ([]));
	},
	function (e,f) {
		f.pc=10;
		var t2213 = f.s[1]; 
		var t2214 = f.s[0]; 
		f.v.text = "" + (builtin__date ("H:i",t2213)) + (t2214);
	},
	function (e,f) { var t2216 = f.s[0]; if (t2216) f.pc=2; else f.pc=5; },
/*10*/	function (e,f) {
		window.__outbuffer += ("<div class=\"") + ("" + (f.v.classname) + (("\" style=\"") + ("" + (f.v.style) + ("\""))));
		f.s[0] = "\"";
		e.mcall (5, f.v["this"], "render_start", (["click", null]));
	},
	function (e,f) {
		var t2217 = f.s[1]; var t2218 = f.s[0]; 
		window.__outbuffer += (" onclick=\"") + ("" + (t2217) + (t2218));
		f.s[0] = "\"";
		e.mcall (5, f.v["this"], "render_start", (["contextmenu", null]));
	},
	function (e,f) {
		f.pc=-1;
		var t2219 = f.s[1]; var t2220 = f.s[0]; 
		window.__outbuffer += (" oncontextmenu=\"") + ("" + (t2219) + (t2220));
		window.__outbuffer += ">";
		window.__outbuffer += builtin__htmlentities (f.v.text);
		window.__outbuffer += "</div>";
	},
	function (e,f) { e.smcall (0, genericcalendaritemcomponent,"render_padding", ([])); },
null	];

;
};
genericcalendaritemcomponent.init_methods (genericcalendaritemcomponent);
rpcclass.setup_class (genericcalendaritemcomponent, "genericcalendaritemcomponent",0, (["gce","first_day","dayspan","y_offset","listeners"]), ([2,0,0,0,2]));
function genericcalendarevent () { this.do_construct (arguments); }
genericcalendarevent.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
	cp.is_block =  function ()
	{
{
		return (this.sd != this.ed || this.all_day);
		}
			}

;
	c.pargs__click =  [];
	c.pinst__click =  [
/*0*/	function (e,f) { e.mcall (2, (f.v["this"]).obj, "calendar_open", ([])); },
null	];

;
	c.pargs__contextmenu =  [];
	c.pinst__contextmenu =  [
/*0*/	function (e,f) { e.mcall (2, (f.v["this"]).obj, "calendar_contextmenu", ([])); },
null	];

;
	c.pargs__colour =  [];
	c.pinst__colour =  [
/*0*/	function (e,f) { e.mcall (2, (f.v["this"]).obj, "colour", ([])); },
	function (e,f) { var t2221 = f.s[0]; e.return_pop (t2221); },
null	];

;
	c.pargs__title =  [];
	c.pinst__title =  [
/*0*/	function (e,f) { e.mcall (2, (f.v["this"]).obj, "title", ([])); },
	function (e,f) { var t2222 = f.s[0]; e.return_pop (t2222); },
null	];

;
	c.pargs__start_time =  [];
	c.pinst__start_time =  [
/*0*/	function (e,f) { e.mcall (2, (f.v["this"]).obj, "start_time", ([])); },
	function (e,f) { var t2223 = f.s[0]; e.return_pop (t2223); },
null	];

;
	c.pargs__end_time =  [];
	c.pinst__end_time =  [
/*0*/	function (e,f) { e.mcall (2, (f.v["this"]).obj, "end_time", ([])); },
	function (e,f) { var t2224 = f.s[0]; e.return_pop (t2224); },
null	];

;
	c.pargs__all_day =  [];
	c.pinst__all_day =  [
/*0*/	function (e,f) { e.return_pop ((f.v["this"]).all_day); },
null	];

;
	c.pargs__cache_object_data =  [];
	c.pinst__cache_object_data =  [
/*0*/	function (e,f) { e.mcall (2, (f.v["this"]).obj, "start_time", ([])); },
	function (e,f) { e.php_static_method_call (1, genericcalendar2,"date_from_datetime", 1); },
	function (e,f) {
		var t2227 = f.s[0]; f.v["this"].sd = t2227;
		e.mcall (2, (f.v["this"]).obj, "end_time", ([]));
	},
	function (e,f) { e.php_static_method_call (1, genericcalendar2,"date_from_datetime", 1); },
	function (e,f) {
		var t2230 = f.s[0]; f.v["this"].ed = t2230;
		e.mcall (2, (f.v["this"]).obj, "all_day", ([]));
	},
/*5*/	function (e,f) { var t2232 = f.s[0]; f.v["this"].all_day = t2232; },
null	];

;
	c.args__create = c.pargs__create =  ["obj","cal"];
	c.inst__create = c.pinst__create =  [
/*0*/	function (e,f) {
		f.v.gce = new genericcalendarevent;
		f.v.gce.obj = f.v.obj;
		f.v.gce.gcic_list = ([]);
		f.v.gce.cal = f.v.cal;
		e.mcall (2, f.v.gce, "cache_object_data", ([]));
	},
	function (e,f) { e.return_pop (f.v.gce); },
null	];

;
	c.pargs__create_components =  [];
	c.pinst__create_components =  [
/*0*/	function (e,f) {
		f.s[0] = builtin__error_log ("" + (builtin__date ("Y-m-d",(f.v["this"]).sd)) + (("...") + ("" + (builtin__date ("Y-m-d",(f.v["this"]).ed)) + ((", all_day = ") + ((f.v["this"]).all_day)))));
		if ((((f.v["this"]).sd)) > ((((f.v["this"]).cal).start_date))) f.pc=1; else f.pc=2;
	},
	function (e,f) {
		f.pc=3;
		f.s[0] = (f.v["this"]).sd;
	},
	function (e,f) { f.s[0] = ((f.v["this"]).cal).start_date; },
	function (e,f) {
		var t2238 = f.s[0]; f.v.d = t2238;
		f.v.gcic = null;
	},
	function (e,f) {
		f.s[0] = (f.v["this"]).ed;
		f.s[1] = f.v.d;
		e.php_two_op (2, "<=");
		var t2240 = f.s[0]; if (t2240) f.pc=5; else f.pc=6;
	},
/*5*/	function (e,f) {
		f.pc=7;
		f.s[0] = ((f.v.d)) < ((((f.v["this"]).cal).end_date));
	},
	function (e,f) { f.s[0] = false; },
	function (e,f) { var t2241 = f.s[0]; if (!(t2241)) f.pc=-1; },
	function (e,f) { if (((f.v.gcic)) === ((null))) f.pc=9; else f.pc=10; },
	function (e,f) {
		f.pc=11;
		f.v.gcic = new genericcalendaritemcomponent;
		f.v.gcic.gce = f.v["this"];
		f.v.gcic.dayspan = 1;
		f.v.gcic.first_day = f.v.d;
		(f.v["this"]).gcic_list[(f.v["this"]).gcic_list.length] = f.v.gcic;
	},
/*10*/	function (e,f) {
		f.s[0] = "dayspan";
		f.s[1] = f.v.gcic;
		e.php_deref_lvalue (2);
		e.php_postinc (1);
	},
	function (e,f) { e.mcall (3, (f.v["this"]).cal, "get_gcday", ([f.v.d])); },
	function (e,f) {
		var t2249 = f.s[0]; f.v.gcday = t2249;
		e.mcall (3, f.v.gcday, "add_component", ([f.v.gcic]));
	},
	function (e,f) { if (((builtin__date ("w",f.v.d))) == ((6))) f.pc=14; else f.pc=15; },
	function (e,f) { f.v.gcic = null; },
/*15*/	function (e,f) { e.smcall (1, genericcalendar2,"next_date", ([f.v.d])); },
	function (e,f) {
		f.pc=4;
		var t2252 = f.s[0]; f.v.d = t2252;
	},
null	];

;
	c.pargs__remove_components =  [];
	c.pinst__remove_components =  [
/*0*/	function (e,f) { f.v._k132 = e.enumkeys ((f.v["this"]).gcic_list); },
	function (e,f) { if (!((f.v._k132).length)) f.pc=-1; },
	function (e,f) {
		f.v._i133 = (f.v._k132).shift();
		f.v.gcic = ((f.v["this"]).gcic_list)[(f.v._i133)];
		f.v.d = (f.v.gcic).first_day;
		f.v.i = 0;
	},
	function (e,f) { if (!(((f.v.i)) < (((f.v.gcic).dayspan)))) f.pc=1; },
	function (e,f) { e.mcall (3, (f.v["this"]).cal, "get_gcday", ([f.v.d])); },
/*5*/	function (e,f) {
		var t2259 = f.s[0]; f.v.gcday = t2259;
		e.mcall (3, f.v.gcday, "remove_component", ([f.v.gcic]));
	},
	function (e,f) { e.smcall (1, genericcalendar2,"next_date", ([f.v.d])); },
	function (e,f) {
		f.pc=3;
		var t2261 = f.s[0]; f.v.d = t2261;
		e.php_push_var_lvalue (0, "i");
		e.php_postinc (1);
	},
null	];

;
};
genericcalendarevent.init_methods (genericcalendarevent);
rpcclass.setup_class (genericcalendarevent, "genericcalendarevent",0, (["sd","ed","all_day","obj","cal","gcic_list","listeners"]), ([0,0,0,0,0,0,2]));
function genericcalendarday () { this.do_construct (arguments); }
genericcalendarday.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
	c.pargs__add_component =  ["gcic"];
	c.pinst__add_component =  [
/*0*/	function (e,f) {
		(f.v["this"]).gcic_list[(f.v["this"]).gcic_list.length] = f.v.gcic;
		f.v["this"].dirty = true;
	},
null	];

;
	c.pargs__remove_component =  ["gcic"];
	c.pinst__remove_component =  [
/*0*/	function (e,f) {
		f.v.off = builtin__array_search (f.v.gcic,(f.v["this"]).gcic_list);
		f.s[0] = builtin__array_splice ((f.v["this"]).gcic_list,f.v.off,1);
		f.v["this"].dirty = true;
	},
null	];

;
	c.pargs__element_id =  [];
	c.pinst__element_id =  [
/*0*/	function (e,f) { e.mcall (3, (f.v["this"]).gcal, "day_el_name", ([(f.v["this"]).date])); },
	function (e,f) { var t2267 = f.s[0]; e.return_pop (t2267); },
null	];

;
	c.args__create = c.pargs__create =  ["gcal","date"];
	c.inst__create = c.pinst__create =  [
/*0*/	function (e,f) {
		f.v.res = new genericcalendarday;
		f.v.res.gcal = f.v.gcal;
		f.v.res.date = f.v.date;
		f.v.res.gcic_list = ([]);
		f.v.res.dirty = false;
		e.return_pop (f.v.res);
	},
null	];

;
	cp.sort_gcics =  function (g0,g1)
	{
var st0;var st1;{
		if (g0.gce.is_block  () && g1.gce.is_block  ())
		{{
		if (g0.dayspan > g1.dayspan)
		{return (0 - 1) }
		else {if (g0.dayspan < g1.dayspan)
		{return (1) }
		 }
		;
		return (0);
		}
		 }
		;
		if (g0.gce.is_block  () && ! g1.gce.is_block  ())
		{return (0 - 1) }
		;
		if (! g0.gce.is_block  () && g1.gce.is_block  ())
		{return (1) }
		;
		st0 = builtin__date ("H:i",g0.gce.start_time);;
		st1 = builtin__date ("H:i",g1.gce.start_time);;
		if (st0 < st1)
		{return (0 - 1) }
		;
		if (st0 > st1)
		{return (1) }
		;
		return (0);
		}
			}

;
	c.pargs__render =  [];
	c.pinst__render =  [
/*0*/	function (e,f) {
		f.v.date = (f.v["this"]).date;
		f.v.day = builtin__date ("d",f.v.date);
		f.v.month = builtin__date ("M",f.v.date);
		f.v.year = builtin__date ("Y",f.v.date);
		window.__outbuffer += "\n<div style=\"width:100%\">\n<span style=\"float:left; text-align:left; width:auto\">";
		window.__outbuffer += f.v.day;
		window.__outbuffer += " <span style=\"color:#c0c0c0\">";
		window.__outbuffer += f.v.month;
		window.__outbuffer += "</span></span>\n</div>\n\n";
		if (((builtin__date ("O",parseInt((f.v.date),10) + parseInt((((6)) * ((3600))),10)))) < ((builtin__date ("O",parseInt((f.v.date),10) - parseInt((((18)) * ((3600))),10))))) f.pc=1; else f.pc=2;
	},
	function (e,f) {
		f.pc=4;
		window.__outbuffer += "<div style=\"width:100%; color:red\">Clocks go back</div>";
	},
	function (e,f) { if (((builtin__date ("O",parseInt((f.v.date),10) + parseInt((((6)) * ((3600))),10)))) > ((builtin__date ("O",parseInt((f.v.date),10) - parseInt((((18)) * ((3600))),10))))) f.pc=3; else f.pc=4; },
	function (e,f) { window.__outbuffer += "<div style=\"width:100%; color:red\">Clocks go forwards</div>"; },
	function (e,f) { if (((builtin__count ((f.v["this"]).gcic_list))) == ((0))) f.pc=5; else f.pc=6; },
/*5*/	function (e,f) { f.pc=-1; },
	function (e,f) {
		f.v.items = ({});
		f.v.movable_items = ([]);
		f.v._k134 = e.enumkeys ((f.v["this"]).gcic_list);
	},
	function (e,f) {
		f.pc=9;
		if (!((f.v._k134).length)) f.pc=8;
	},
	function (e,f) {
		f.pc=12;
		f.s[0] = builtin__usort (f.v.movable_items,([f.v["this"], "sort_gcics"]));
		f.v._k136 = e.enumkeys (f.v.movable_items);
	},
	function (e,f) {
		f.v._i135 = (f.v._k134).shift();
		f.v.gcic = ((f.v["this"]).gcic_list)[(f.v._i135)];
		if ((((f.v.gcic).first_day)) == (((f.v["this"]).date))) f.pc=10; else f.pc=11;
	},
/*10*/	function (e,f) {
		f.pc=7;
		f.v.movable_items[f.v.movable_items.length] = f.v.gcic;
	},
	function (e,f) {
		f.pc=7;
		f.v.items[(f.v.gcic).y_offset] = f.v.gcic;
	},
	function (e,f) {
		f.pc=14;
		if (!((f.v._k136).length)) f.pc=13;
	},
	function (e,f) {
		f.pc=19;
		f.v.count = builtin__count (f.v.items);
		f.v.i = 0;
	},
	function (e,f) {
		f.v._i137 = (f.v._k136).shift();
		f.v.gcic = (f.v.movable_items)[(f.v._i137)];
		f.v.i = 0;
	},
/*15*/	function (e,f) {
		f.s[0] = builtin__count (f.v.items);
		f.s[1] = f.v.i;
		e.php_two_op (2, "<=");
		var t2290 = f.s[0]; if (!(t2290)) f.pc=12;
	},
	function (e,f) { if (!(((f.v.items)[(f.v.i)]) !== undefined)) f.pc=17; else f.pc=18; },
	function (e,f) {
		f.pc=12;
		f.v.gcic.y_offset = f.v.i;
		f.v.items[f.v.i] = f.v.gcic;
	},
	function (e,f) {
		f.pc=15;
		e.php_push_var_lvalue (0, "i");
		e.php_postinc (1);
	},
	function (e,f) { if (((f.v.i)) < ((100))) f.pc=20; else f.pc=21; },
/*20*/	function (e,f) {
		f.pc=22;
		f.s[0] = f.v.count;
	},
	function (e,f) { f.s[0] = false; },
	function (e,f) { var t2294 = f.s[0]; if (!(t2294)) f.pc=-1; },
	function (e,f) { if (((f.v.items)[(f.v.i)]) !== undefined) f.pc=24; else f.pc=25; },
	function (e,f) {
		f.pc=26;
		e.php_push_var_lvalue (0, "count");
		e.php_postdec (1);
		e.mcall (3, (f.v.items)[(f.v.i)], "render", ([(f.v["this"]).date]));
	},
/*25*/	function (e,f) { e.smcall (0, genericcalendaritemcomponent,"render_padding", ([])); },
	function (e,f) {
		f.pc=19;
		e.php_push_var_lvalue (0, "i");
		e.php_postinc (1);
	},
null	];

;
	c.pargs__rerender =  [];
	c.pinst__rerender =  [
/*0*/	function (e,f) { e.mcall (2, f.v["this"], "element_id", ([])); },
	function (e,f) { var t2297 = f.s[0]; e.mcall (3, document, "getElementById", ([t2297])); },
	function (e,f) {
		var t2299 = f.s[0]; f.v.el = t2299;
		if (((f.v.el)) !== ((null))) f.pc=3; else f.pc=5;
	},
	function (e,f) {
		f.s[0] = builtin__ob_start ();
		e.mcall (2, f.v["this"], "render", ([]));
	},
	function (e,f) { f.v.el.innerHTML = builtin__ob_get_clean (); },
/*5*/	function (e,f) { f.v["this"].dirty = false; },
null	];

;
};
genericcalendarday.init_methods (genericcalendarday);
rpcclass.setup_class (genericcalendarday, "genericcalendarday",0, (["date","gcic_list","gcal","dirty","listeners"]), ([0,0,0,0,2]));
function genericcalendar2 () { this.do_construct (arguments); }
genericcalendar2.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
	c.pargs__call_add_item =  ["el","day","ev"];
	c.pinst__call_add_item =  [
/*0*/	function (e,f) { e.mcall (3, f.v["this"], "add_item", ([f.v.day])); },
null	];

;
	c.pargs__day_el_name =  ["d"];
	c.pinst__day_el_name =  [
/*0*/	function (e,f) {
		f.s[0] = ("-") + (builtin__date ("Y-m-d",f.v.d));
		e.mcall (3, f.v["this"], "get_id", ([]));
	},
	function (e,f) {
		var t2302 = f.s[1]; var t2303 = f.s[0]; 
		e.return_pop (("cal-") + ("" + (t2302) + (t2303)));
	},
null	];

;
	c.pargs__mode_button =  ["el","arg","ev"];
	c.pinst__mode_button =  [
/*0*/	function (e,f) { e.mcall (3, f.v["this"], "change_mode", ([f.v.arg])); },
null	];

;
	c.pargs__jump =  ["el","arg","ev"];
	c.pinst__jump =  [
/*0*/	function (e,f) { e.mcall (3, f.v["this"], "change_date", ([f.v.arg])); },
null	];

;
	c.pargs__get_gcday =  ["date"];
	c.pinst__get_gcday =  [
/*0*/	function (e,f) { if (!((((f.v["this"]).gcdays)[(f.v.date)]) !== undefined)) f.pc=1; else f.pc=3; },
	function (e,f) { e.smcall (2, genericcalendarday,"create", ([f.v["this"], f.v.date])); },
	function (e,f) { var t2305 = f.s[0]; (f.v["this"]).gcdays[f.v.date] = t2305; },
	function (e,f) { e.return_pop (((f.v["this"]).gcdays)[(f.v.date)]); },
null	];

;
	c.args__date_from_datetime = c.pargs__date_from_datetime =  ["dt"];
	c.inst__date_from_datetime = c.pinst__date_from_datetime =  [
/*0*/	function (e,f) { e.return_pop (builtin__mktime (0,0,0,builtin__date ("m",f.v.dt),builtin__date ("d",f.v.dt),builtin__date ("Y",f.v.dt))); },
null	];

;
	c.args__next_date = c.pargs__next_date =  ["d"];
	c.inst__next_date = c.pinst__next_date =  [
/*0*/	function (e,f) { e.return_pop (builtin__mktime (0,0,0,builtin__date ("m",f.v.d),parseInt((builtin__date ("d",f.v.d)),10) + parseInt((1),10),builtin__date ("Y",f.v.d))); },
null	];

;
	c.pargs__add_event =  ["ev"];
	c.pinst__add_event =  [
/*0*/	function (e,f) { e.smcall (2, genericcalendarevent,"create", ([f.v.ev, f.v["this"]])); },
	function (e,f) {
		var t2307 = f.s[0]; f.v.gce = t2307;
		f.s[0] = f.v.gce;
		e.mcall (3, f.v.ev, "get_id", ([]));
	},
	function (e,f) {
		f.s[2] = (f.v["this"]).events;
		e.php_index_lvalue (3);
		e.php_assign (2);
		e.mcall (2, f.v.gce, "create_components", ([]));
	},
	function (e,f) { e.mcall (2, f.v["this"], "rerender_dirty", ([])); },
null	];

;
	c.pargs__rerender_dirty =  [];
	c.pinst__rerender_dirty =  [
/*0*/	function (e,f) { f.v._k138 = e.enumkeys ((f.v["this"]).gcdays); },
	function (e,f) { if (!((f.v._k138).length)) f.pc=-1; },
	function (e,f) {
		f.v._i139 = (f.v._k138).shift();
		f.v.gcday = ((f.v["this"]).gcdays)[(f.v._i139)];
		if ((f.v.gcday).dirty) f.pc=3; else f.pc=1;
	},
	function (e,f) {
		f.pc=1;
		e.mcall (2, f.v.gcday, "rerender", ([]));
	},
null	];

;
	c.pargs__delete_event =  ["ev"];
	c.pinst__delete_event =  [
/*0*/	function (e,f) {
		f.pc=2;
		e.mcall (2, f.v.ev, "get_id", ([]));
	},
	function (e,f) { f.pc=-1; },
	function (e,f) {
		var t2314 = f.s[0]; 
		if (!((((f.v["this"]).events)[(t2314)]) !== undefined)) f.pc=1; else f.pc=3;
	},
	function (e,f) { e.mcall (2, f.v.ev, "get_id", ([])); },
	function (e,f) {
		var t2315 = f.s[0]; 
		f.v.gce = ((f.v["this"]).events)[(t2315)];
		e.mcall (2, f.v.gce, "remove_components", ([]));
	},
/*5*/	function (e,f) { e.mcall (2, f.v.ev, "get_id", ([])); },
	function (e,f) {
		f.s[1] = (f.v["this"]).events;
		e.php_index_lvalue (2);
		e.php_unset (1);
		e.mcall (2, f.v["this"], "rerender_dirty", ([]));
	},
null	];

;
	c.pargs__modify_event =  ["ev"];
	c.pinst__modify_event =  [
/*0*/	function (e,f) {
		f.pc=2;
		e.mcall (2, f.v.ev, "get_id", ([]));
	},
	function (e,f) { f.pc=-1; },
	function (e,f) {
		var t2319 = f.s[0]; 
		if (!((((f.v["this"]).events)[(t2319)]) !== undefined)) f.pc=1; else f.pc=3;
	},
	function (e,f) { e.mcall (2, f.v.ev, "get_id", ([])); },
	function (e,f) {
		var t2320 = f.s[0]; 
		f.v.gce = ((f.v["this"]).events)[(t2320)];
		e.mcall (2, f.v.gce, "remove_components", ([]));
	},
/*5*/	function (e,f) { e.mcall (2, f.v.gce, "cache_object_data", ([])); },
	function (e,f) { e.mcall (2, f.v.gce, "create_components", ([])); },
	function (e,f) { e.mcall (2, f.v["this"], "rerender_dirty", ([])); },
null	];

;
	c.pargs__load_events =  [];
	c.pinst__load_events =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "get_events_in_range", ([(f.v["this"]).start_date, (f.v["this"]).end_date])); },
	function (e,f) {
		var t2323 = f.s[0]; f.v.el = t2323;
		f.v["this"].events = ({});
		f.v._k140 = e.enumkeys (f.v.el);
	},
	function (e,f) { if (!((f.v._k140).length)) f.pc=-1; },
	function (e,f) {
		f.pc=2;
		f.v._i141 = (f.v._k140).shift();
		f.v.ev = (f.v.el)[(f.v._i141)];
		e.mcall (3, f.v["this"], "add_event", ([f.v.ev]));
	},
null	];

;
	c.pargs__render_month_view =  [];
	c.pinst__render_month_view =  [
/*0*/	function (e,f) {
		f.v.month = builtin__date ("m",(f.v["this"]).current_date);
		f.v.year = builtin__date ("Y",(f.v["this"]).current_date);
		if (((f.v.year)) < ((1970))) f.pc=2; else f.pc=3;
	},
	function (e,f) { f.pc=-1; },
	function (e,f) {
		f.pc=4;
		f.s[0] = true;
	},
	function (e,f) { f.s[0] = ((f.v.year)) > ((2035)); },
	function (e,f) { var t2330 = f.s[0]; if (t2330) f.pc=1; else f.pc=5; },
/*5*/	function (e,f) {
		f.v.first_of_month = builtin__mktime (0,0,0,f.v.month,1,f.v.year);
		f.v.dow = builtin__date ("w",f.v.first_of_month);
		f.v.dim = builtin__cal_days_in_month (0,f.v.month,f.v.year);
		f.v.firstday = parseInt((parseInt((0),10) - parseInt((6),10)),10) - parseInt((f.v.dow),10);
		f.v.firstday = parseInt((1),10) - parseInt((f.v.dow),10);
		f.v.taildays = parseInt((7),10) - parseInt((((parseInt((f.v.dow),10) + parseInt((f.v.dim),10))) % ((7))),10);
		f.v.lastday = parseInt((f.v.dim),10) + parseInt((f.v.taildays),10);
		if (((f.v.taildays)) < ((7))) f.pc=6; else f.pc=7;
	},
	function (e,f) { f.v.lastday = parseInt((f.v.lastday),10) + parseInt((7),10); },
	function (e,f) {
		f.v["this"].start_date = builtin__mktime (0,0,0,f.v.month,f.v.firstday,f.v.year);
		f.v["this"].end_date = builtin__mktime (0,0,0,f.v.month,f.v.lastday,f.v.year);
		f.v["this"].gcdays = ([]);
		e.mcall (2, f.v["this"], "load_events", ([]));
	},
	function (e,f) {
		f.v.prevmonth = builtin__mktime (0,0,0,parseInt((f.v.month),10) - parseInt((1),10),1,f.v.year);
		f.v.nextmonth = builtin__mktime (0,0,0,parseInt((f.v.month),10) + parseInt((1),10),1,f.v.year);
		window.__outbuffer += "\n\n<div style=\"float:left\">\n<button style=\"padding:5px;margin:3px;background:#e0e0e0;height:24px;float:left\" onclick=\"";
		e.mcall (4, f.v["this"], "render_start", (["jump", f.v.prevmonth]));
	},
	function (e,f) {
		var t2344 = f.s[0]; window.__outbuffer += t2344;
		window.__outbuffer += "\">&lt;&lt;</button>\n<button style=\"padding:5px;margin:3px;background:#e0e0e0;height:24px;float:left\" onclick=\"";
		e.mcall (4, f.v["this"], "render_start", (["jump", builtin__time ()]));
	},
/*10*/	function (e,f) {
		var t2345 = f.s[0]; window.__outbuffer += t2345;
		window.__outbuffer += "\">Today</button>\n<button style=\"padding:5px;margin:3px;background:#e0e0e0;height:24px;float:left\" onclick=\"";
		e.mcall (4, f.v["this"], "render_start", (["jump", f.v.nextmonth]));
	},
	function (e,f) {
		var t2346 = f.s[0]; window.__outbuffer += t2346;
		window.__outbuffer += "\">&gt;&gt;</button>\n<h1 style=\"clear:none;float:left\">";
		window.__outbuffer += builtin__date ("M Y",builtin__mktime (0,0,0,f.v.month,1,f.v.year));
		window.__outbuffer += "</h1>\n</div>\n<div style=\"float:right\">\n<button style=\"padding:5px;margin:0px;background:#e0e0e0;height:24px\" onclick=\"";
		e.mcall (4, f.v["this"], "render_start", (["mode_button", "day"]));
	},
	function (e,f) {
		var t2347 = f.s[0]; window.__outbuffer += t2347;
		window.__outbuffer += "\">Day</button>\n<button style=\"padding:5px;margin:0px;background:#e0e0e0;height:24px\" onclick=\"";
		e.mcall (4, f.v["this"], "render_start", (["mode_button", "week"]));
	},
	function (e,f) {
		var t2348 = f.s[0]; window.__outbuffer += t2348;
		window.__outbuffer += "\">Week</button>\n<button style=\"padding:5px;margin:0px;background:#e0e0e0;height:24px\" onclick=\"";
		e.mcall (4, f.v["this"], "render_start", (["mode_button", "month"]));
	},
	function (e,f) {
		var t2349 = f.s[0]; window.__outbuffer += t2349;
		window.__outbuffer += "\">Month</button>\n</div>\n<div style=\"clear:both\"></div>\n\n";
		if (builtin__method_exists (f.v["this"],"render_header")) f.pc=15; else f.pc=16;
	},
/*15*/	function (e,f) { e.mcall (4, f.v["this"], "render_header", ([f.v.month, f.v.year])); },
	function (e,f) {
		window.__outbuffer += "\n\n<table id=\"calendarTable\">\n";
		window.__outbuffer += "<tr>";
		f.v.i = 0;
	},
	function (e,f) {
		f.pc=19;
		if (!(((f.v.i)) < ((7)))) f.pc=18;
	},
	function (e,f) {
		f.pc=20;
		window.__outbuffer += "</tr>";
		f.v.day = f.v.firstday;
	},
	function (e,f) {
		f.pc=17;
		f.v.day = builtin__date ("D",builtin__mktime (0,0,0,1,parseInt((f.v.i),10) + parseInt((2),10),2000));
		window.__outbuffer += ("<th>") + ("" + (f.v.day) + ("</th>"));
		e.php_push_var_lvalue (0, "i");
		e.php_postinc (1);
	},
/*20*/	function (e,f) {
		f.pc=22;
		f.s[0] = f.v.lastday;
		f.s[1] = f.v.day;
		e.php_two_op (2, "<=");
		var t2354 = f.s[0]; if (!(t2354)) f.pc=21;
	},
	function (e,f) { if (((f.v.dow)) != ((6))) f.pc=41; else f.pc=42; },
	function (e,f) {
		f.v.thisday = builtin__mktime (0,0,0,f.v.month,f.v.day,f.v.year);
		f.v.dow = builtin__date ("w",f.v.thisday);
		if (((f.v.dow)) == ((0))) f.pc=23; else f.pc=24;
	},
	function (e,f) { window.__outbuffer += "<tr>"; },
	function (e,f) {
		f.v.style = "";
		if (((f.v.day)) < ((1))) f.pc=26; else f.pc=27;
	},
/*25*/	function (e,f) {
		f.pc=29;
		f.v.style = "" + (f.v.style) + ("background-color:#e0e0e0");
	},
	function (e,f) {
		f.pc=28;
		f.s[0] = true;
	},
	function (e,f) { f.s[0] = ((f.v.day)) > ((f.v.dim)); },
	function (e,f) { var t2359 = f.s[0]; if (t2359) f.pc=25; else f.pc=29; },
	function (e,f) { if (((f.v.thisday)) == ((builtin__mktime (0,0,0,builtin__date ("m"),builtin__date ("d"),builtin__date ("Y"))))) f.pc=30; else f.pc=31; },
/*30*/	function (e,f) { f.v.style = "" + (f.v.style) + ("border:thin solid blue;"); },
	function (e,f) { e.mcall (3, f.v["this"], "get_gcday", ([f.v.thisday])); },
	function (e,f) {
		f.pc=35;
		var t2362 = f.s[0]; f.v.gcday = t2362;
		window.__outbuffer += ("<td style=\"") + ("" + (f.v.style) + ("\""));
		e.mcall (2, f.v["this"], "can_add", ([]));
	},
	function (e,f) {
		f.s[0] = "\"";
		e.mcall (5, f.v["this"], "render_start", (["call_add_item", f.v.thisday]));
	},
	function (e,f) {
		f.pc=36;
		var t2363 = f.s[1]; var t2364 = f.s[0]; 
		window.__outbuffer += (" onclick=\"") + ("" + (t2363) + (t2364));
	},
/*35*/	function (e,f) { var t2365 = f.s[0]; if (t2365) f.pc=33; else f.pc=36; },
	function (e,f) {
		window.__outbuffer += ">";
		f.s[0] = "\" class=\"calendarCell\">";
		e.mcall (3, f.v.gcday, "element_id", ([]));
	},
	function (e,f) {
		var t2366 = f.s[1]; var t2367 = f.s[0]; 
		window.__outbuffer += ("<div id=\"") + ("" + (t2366) + (t2367));
		e.mcall (2, f.v.gcday, "render", ([]));
	},
	function (e,f) {
		window.__outbuffer += "</div>";
		window.__outbuffer += "</td>";
		if (((f.v.dow)) == ((6))) f.pc=39; else f.pc=40;
	},
	function (e,f) { window.__outbuffer += "</tr>"; },
/*40*/	function (e,f) {
		f.pc=20;
		e.php_push_var_lvalue (0, "day");
		e.php_postinc (1);
	},
	function (e,f) { window.__outbuffer += "</tr>"; },
	function (e,f) {
		window.__outbuffer += "\n</table>\n\n<form action=\"\">\n<select name=\"month\">\n";
		f.v.i = 1;
	},
	function (e,f) {
		f.pc=45;
		f.s[0] = 12;
		f.s[1] = f.v.i;
		e.php_two_op (2, "<=");
		var t2370 = f.s[0]; if (!(t2370)) f.pc=44;
	},
	function (e,f) {
		f.pc=46;
		window.__outbuffer += "\n</select>\n<select name=\"year\">\n";
		f.v.thisyear = builtin__date ("Y");
		f.v.i = parseInt((f.v.thisyear),10) - parseInt((10),10);
	},
/*45*/	function (e,f) {
		f.pc=43;
		window.__outbuffer += ("<option value=\"") + ("" + (builtin__date ("m",builtin__mktime (0,0,0,f.v.i,1,2000))) + (("\">") + ("" + (builtin__date ("M",builtin__mktime (0,0,0,f.v.i,1,2000))) + ("</option>"))));
		e.php_push_var_lvalue (0, "i");
		e.php_postinc (1);
	},
	function (e,f) {
		f.pc=48;
		f.s[0] = parseInt((f.v.thisyear),10) + parseInt((4),10);
		f.s[1] = f.v.i;
		e.php_two_op (2, "<=");
		var t2374 = f.s[0]; if (!(t2374)) f.pc=47;
	},
	function (e,f) {
		window.__outbuffer += "\n</select>\n<input type=\"submit\" value=\"Go\"/>\n</form>\n<form action=\"\">\n<input type=\"hidden\" name=\"month\" value=\"";
		window.__outbuffer += builtin__date ("m");
		window.__outbuffer += "\">\n<input type=\"hidden\" name=\"year\" value=\"";
		window.__outbuffer += builtin__date ("Y");
		window.__outbuffer += "\">\n</form>\n\n";
		e.return_pop (f.v.first_of_month);
	},
	function (e,f) {
		window.__outbuffer += "<option value=\"$i\"";
		if (((f.v.i)) == ((f.v.thisyear))) f.pc=49; else f.pc=50;
	},
	function (e,f) { window.__outbuffer += " selected=\"yes\""; },
/*50*/	function (e,f) {
		f.pc=46;
		window.__outbuffer += (">") + ("" + (f.v.i) + ("</option>"));
		e.php_push_var_lvalue (0, "i");
		e.php_postinc (1);
	},
null	];

;
	c.pargs__render_week_view =  [];
	c.pinst__render_week_view =  [
/*0*/	function (e,f) { /* This is a NOP */ },
null	];

;
	c.pargs__render_day_view =  [];
	c.pinst__render_day_view =  [
/*0*/	function (e,f) { /* This is a NOP */ },
null	];

;
	c.pargs__render =  [];
	c.pinst__render =  [
/*0*/	function (e,f) {
		f.s[0] = ([]);
		f.s[1] = ([f.v["this"], ("render_") + ("" + ((f.v["this"]).current_mode) + ("_view"))]);
		e.php_builtin (2, "call_user_func_array", 2);
	},
null	];

;
	c.pargs__set_date =  ["d"];
	c.pinst__set_date =  [
/*0*/	function (e,f) { f.v["this"].current_date = f.v.d; },
null	];

;
	c.pargs__set_mode =  ["mode"];
	c.pinst__set_mode =  [
/*0*/	function (e,f) { f.v["this"].current_mode = f.v.mode; },
null	];

;
};
genericcalendar2.init_methods (genericcalendar2);
rpcclass.setup_class (genericcalendar2, "genericcalendar2",0, (["current_date","current_mode","start_date","end_date","gcdays","events","listeners"]), ([0,0,0,0,0,0,2]));
function site_config_editor_row () { this.do_construct (arguments); }
site_config_editor_row.codegroup = "site_config";
site_config_editor_row.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
};
site_config_editor_row.init_methods (site_config_editor_row);
rpcclass.setup_class (site_config_editor_row, "site_config_editor_row",0, (["value","listeners"]), ([0,2]));
function site_config_editor () { this.do_construct (arguments); }
site_config_editor.codegroup = "site_config";
site_config_editor.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
	c.args__create_new =  null;
	c.pargs__do_save =  null;
	c.pargs__edit_value_set =  null;
	c.pargs__row_click =  null;
	c.pargs__reorder =  null;
	c.pargs__insert_row =  null;
	c.pargs__dragstart =  null;
	c.pargs__delete_row_clicked =  null;
	c.pargs__get_row_fields =  null;
	c.pargs__new_name =  null;
	c.pargs__run =  null;
};
site_config_editor.init_methods (site_config_editor);
rpcclass.setup_class (site_config_editor, "site_config_editor",0, (["is_new","name","description","is_array","is_ordered","fields","value","listeners"]), ([0,0,0,0,0,0,0,2]));
function site () { this.do_construct (arguments); }
site.codegroup = "site_config";
site.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
	c.args__make_editor =  null;
	c.args__edit_config_file = c.pargs__edit_config_file =  null;
	c.args__edit_config_variable = c.pargs__edit_config_variable =  null;
	c.args__handle_uploaded_file =  null;
	c.args__do_delete =  null;
	c.args__edit_other_file = c.pargs__edit_other_file =  null;
	c.args__get_config =  null;
	c.args__get_config_mimetype =  null;
};
site.init_methods (site);
rpcclass.setup_class (site, "site",0, (["listeners"]), ([2]));
function pin () { this.do_construct (arguments); }
pin.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
	c.args__make_ordinal = c.pargs__make_ordinal =  ["n"];
	c.inst__make_ordinal = c.pinst__make_ordinal =  [
/*0*/	function (e,f) { if (((f.v.n)) == ((1))) f.pc=1; else f.pc=2; },
	function (e,f) { e.return_pop ("1st"); },
	function (e,f) { if (((f.v.n)) == ((2))) f.pc=3; else f.pc=4; },
	function (e,f) { e.return_pop ("2nd"); },
	function (e,f) { if (((f.v.n)) == ((3))) f.pc=5; else f.pc=6; },
/*5*/	function (e,f) { e.return_pop ("3rd"); },
	function (e,f) { e.return_pop ("" + (f.v.n) + ("th")); },
null	];

;
	c.args__run_dialog = c.pargs__run_dialog =  ["title","classname","challenge_method","response_method"];
	c.inst__run_dialog = c.pinst__run_dialog =  [
/*0*/	function (e,f) {
		f.s[0] = ([null]);
		f.s[1] = ([f.v.classname, f.v.challenge_method]);
		e.php_builtin (2, "call_user_func_array", 2);
	},
	function (e,f) {
		var t2470 = f.s[0]; f.v.challenge = t2470;
		if (((f.v.challenge)) === ((null))) f.pc=2; else f.pc=4;
	},
	function (e,f) {
		f.s[0] = ([null]);
		f.s[1] = ([f.v.classname, f.v.response_method]);
		e.php_builtin (2, "call_user_func_array", 2);
	},
	function (e,f) { var t2471 = f.s[0]; e.return_pop (t2471); },
	function (e,f) { if (builtin__is_array (f.v.challenge)) f.pc=5; else f.pc=24; },
/*5*/	function (e,f) { e.smcall (1, pin,"make_ordinal", ([parseInt(((f.v.challenge)[(1)]),10) + parseInt((1),10)])); },
	function (e,f) {
		var t2472 = f.s[0]; f.s[0] = (" and ") + (t2472);
		e.smcall (2, pin,"make_ordinal", ([parseInt(((f.v.challenge)[(0)]),10) + parseInt((1),10)]));
	},
	function (e,f) {
		var t2473 = f.s[1]; var t2474 = f.s[0]; 
		f.v.label = "" + (t2473) + (t2474);
		f.v.fields = ([({type:"password", name:"values", label:f.v.label, focus:1})]);
		f.v.pop = new popupform;
		e.mcall (6, f.v.pop, "initialise", ([0, 0, f.v.title, f.v.fields]));
	},
	function (e,f) { e.mcall (2, f.v.pop, "open", ([])); },
	function (e,f) { f.v.res = null; },
/*10*/	function (e,f) { e.mcall (2, f.v.pop, "run", ([])); },
	function (e,f) {
		var t2480 = f.s[0]; f.v.event = t2480;
		f.v.action = (f.v.event).action;
		if (((f.v.action)) == (("cover"))) f.pc=14; else f.pc=15;
	},
	function (e,f) {
		f.pc=23;
		e.mcall (2, f.v.pop, "close", ([]));
	},
	function (e,f) { if (((f.v.action)) == (("OK"))) f.pc=17; else f.pc=10; },
	function (e,f) {
		f.pc=16;
		f.s[0] = true;
	},
/*15*/	function (e,f) { f.s[0] = ((f.v.action)) == (("cancel")); },
	function (e,f) { var t2482 = f.s[0]; if (t2482) f.pc=12; else f.pc=13; },
	function (e,f) { e.mcall (2, f.v.pop, "get_form_fields", ([])); },
	function (e,f) {
		var t2484 = f.s[0]; f.v.f = t2484;
		e.mcall (2, f.v.pop, "close", ([]));
	},
	function (e,f) {
		f.s[0] = ([(f.v.f).values]);
		f.s[1] = ([f.v.classname, f.v.response_method]);
		e.php_builtin (2, "call_user_func_array", 2);
	},
/*20*/	function (e,f) {
		var t2486 = f.s[0]; f.v.res = t2486;
		if (!(f.v.res)) f.pc=21; else f.pc=22;
	},
	function (e,f) { e.smcall (1, popupok,"run", (["Failed"])); },
	function (e,f) { e.return_pop (f.v.res); },
	function (e,f) { e.return_pop (false); },
	function (e,f) { e.smcall (1, popupok,"run", ([f.v.challenge])); },
/*25*/	function (e,f) { e.return_pop (false); },
null	];

;
};
pin.init_methods (pin);
rpcclass.setup_class (pin, "pin",0, (["listeners"]), ([2]));
function paypal () { this.do_construct (arguments); }
paypal.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
	c.args__render_button = c.pargs__render_button =  ["product","itemref","price","paypal_account"];
	c.inst__render_button = c.pinst__render_button =  [
/*0*/	function (e,f) {
		window.__outbuffer += "\n<form id=\"paypal-button-form\" action=\"https://www.paypal.com/cgi-bin/webscr\" method=\"post\">\n<input type=\"hidden\" name=\"cmd\" value=\"_xclick\">\n<input type=\"hidden\" name=\"business\" value=\"";
		window.__outbuffer += f.v.paypal_account;
		window.__outbuffer += "\">\n<input type=\"hidden\" name=\"lc\" value=\"GB\">\n<input type=\"hidden\" name=\"item_name\" value=\"";
		window.__outbuffer += builtin__str_replace ("\"","'",f.v.product);
		window.__outbuffer += "\">\n<input type=\"hidden\" name=\"item_number\" value=\"";
		window.__outbuffer += f.v.itemref;
		window.__outbuffer += "\">\n<input type=\"hidden\" name=\"amount\" value=\"";
		window.__outbuffer += f.v.price;
		window.__outbuffer += "\">\n<input type=\"hidden\" name=\"currency_code\" value=\"GBP\">\n<input type=\"hidden\" name=\"button_subtype\" value=\"services\">\n<input type=\"hidden\" name=\"no_note\" value=\"1\">\n<input type=\"hidden\" name=\"no_shipping\" value=\"1\">\n<input type=\"hidden\" name=\"rm\" value=\"2\">\n<input type=\"hidden\" name=\"return\" value=\"http://";
		window.__outbuffer += ((browser.server())).HTTP_HOST;
		window.__outbuffer += "/pj/paypal.php?reason=complete&ref=";
		window.__outbuffer += f.v.itemref;
		window.__outbuffer += "\">\n<input type=\"hidden\" name=\"cancel_return\" value=\"http://";
		window.__outbuffer += ((browser.server())).HTTP_HOST;
		window.__outbuffer += "/pj/paypal.php?reason=cancel&ref=";
		window.__outbuffer += f.v.itemref;
		window.__outbuffer += "\">\n<input type=\"hidden\" name=\"notify_url\" value=\"http://";
		window.__outbuffer += ((browser.server())).HTTP_HOST;
		window.__outbuffer += "/pj/paypal.php?reason=ipn\">\n<input type=\"hidden\" name=\"cbhandle\" value=\"";
		window.__outbuffer += f.v.itemref;
		window.__outbuffer += "\">\n<input type=\"hidden\" name=\"bn\" value=\"PP-BuyNowBF:btn_buynowCC_LG.gif:NonHosted\">\n<input type=\"image\" src=\"https://www.paypal.com/en_US/GB/i/btn/btn_buynowCC_LG.gif\" border=\"0\" name=\"submit\" alt=\"PayPal - The safer, easier way to pay online.\">\n<img alt=\"\" border=\"0\" src=\"https://www.paypal.com/en_GB/i/scr/pixel.gif\" width=\"1\" height=\"1\">\n</form>\n";
	},
null	];

;
	c.args__go_pay = c.pargs__go_pay =  ["obj","product","amount","paypal_account"];
	c.inst__go_pay = c.pinst__go_pay =  [
/*0*/	function (e,f) {
		f.s[0] = 0;
		f.s[1] = "item";
		e.mcall (5, document, "getElementsByTagName", (["body"]));
	},
	function (e,f) { var t2487 = f.s[2]; var t2488 = f.s[1]; var t2489 = f.s[0]; e.mcall (3, t2487, t2488, ([t2489])); },
	function (e,f) {
		var t2491 = f.s[0]; f.v.body = t2491;
		e.mcall (3, document, "createElement", (["div"]));
	},
	function (e,f) {
		var t2493 = f.s[0]; f.v.div = t2493;
		e.mcall (3, f.v.body, "appendChild", ([f.v.div]));
	},
	function (e,f) {
		f.s[0] = builtin__ob_start ();
		e.smcall (4, paypal,"render_button", ([f.v.product, "" + ((f.v.obj).classname) + ((":") + ((f.v.obj).rowid)), f.v.amount, f.v.paypal_account]));
	},
/*5*/	function (e,f) {
		f.v.div.innerHTML = builtin__ob_get_clean ();
		e.mcall (3, document, "getElementById", (["paypal-button-form"]));
	},
	function (e,f) {
		var t2496 = f.s[0]; f.v.form = t2496;
		e.mcall (2, f.v.form, "submit", ([]));
	},
null	];

;
};
paypal.init_methods (paypal);
rpcclass.setup_class (paypal, "paypal",0, (["listeners"]), ([2]));
function page_dispatcher () { this.do_construct (arguments); }
page_dispatcher.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
	c.args__makelink = c.pargs__makelink =  ["classname","pagename","args"];
	c.inst__makelink = c.pinst__makelink =  [
/*0*/	function (e,f) {
		f.v.res = ("/pj/page.php?classname=") + ("" + ((encodeURIComponent (f.v.classname))) + (("&pagename=") + ((encodeURIComponent (f.v.pagename)))));
		f.v._k148 = e.enumkeys (f.v.args);
	},
	function (e,f) {
		f.pc=3;
		if (!((f.v._k148).length)) f.pc=2;
	},
	function (e,f) { e.return_pop (f.v.res); },
	function (e,f) {
		f.pc=1;
		f.s[0] = f.v.name = (f.v._k148).shift();
		f.s[1] = f.v.value = (f.v.args)[(f.v.name)];
		f.v.res = "" + (f.v.res) + (("&") + ("" + (f.v.name) + (("=") + ((encodeURIComponent (f.v.value))))));
	},
null	];

;
};
page_dispatcher.init_methods (page_dispatcher);
rpcclass.setup_class (page_dispatcher, "page_dispatcher",0, (["listeners"]), ([2]));
function filenode () { this.do_construct (arguments); }
filenode.init_methods = function (c) {
	dbclass.init_methods(c);
	var cp = c.prototype;
	c.pargs__can_read =  [];
	c.pinst__can_read =  [
/*0*/	function (e,f) { if ((((f.v["this"]).is_dir)) != ((0))) f.pc=1; else f.pc=2; },
	function (e,f) { e.return_pop ((f.v["this"]).xcan_read); },
	function (e,f) { e.return_pop (((f.v["this"]).parent).xcan_read); },
null	];

;
	c.pargs__can_write =  [];
	c.pinst__can_write =  [
/*0*/	function (e,f) { if ((((f.v["this"]).is_dir)) != ((0))) f.pc=1; else f.pc=2; },
	function (e,f) { e.return_pop ((f.v["this"]).xcan_write); },
	function (e,f) { e.return_pop (((f.v["this"]).parent).xcan_write); },
null	];

;
	c.pargs__file_change =  ["arg"];
	c.pinst__file_change =  [
/*0*/	function (e,f) {
		f.s[0] = builtin__debugout (("File change: ") + (f.v.arg));
		f.v.fields = builtin__explode ("|",f.v.arg);
		f.v.cmd = (f.v.fields)[(0)];
		f.v.rowid = (f.v.fields)[(1)];
		e.smcall (3, rpcclass,"lookup_object", (["filenode", "rowid", f.v.rowid]));
	},
	function (e,f) {
		var t2506 = f.s[0]; f.v.node = t2506;
		if (((f.v.node)) !== ((null))) f.pc=2; else f.pc=3;
	},
	function (e,f) {
		f.pc=-1;
		e.mcall (4, f.v.node, "send_msg", (["file_operation", f.v.fields]));
	},
	function (e,f) { f.s[0] = builtin__debugout (("Got notification for node ") + ("" + (f.v.rowid) + (" which I can't find"))); },
null	];

;
	c.pargs__get_sec =  [];
	c.pinst__get_sec =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["get_sec", ([])])); },
	function (e,f) { var t2507 = f.s[0]; e.return_pop (t2507); },
null	];

;
	c.pargs__set_sec =  ["sec"];
	c.pinst__set_sec =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["set_sec", ([f.v.sec])])); },
	function (e,f) { var t2508 = f.s[0]; e.return_pop (t2508); },
null	];

;
	c.pargs__run_security_dialog =  [];
	c.pinst__run_security_dialog =  [
/*0*/	function (e,f) { e.mcall (2, f.v["this"], "get_sec", ([])); },
	function (e,f) {
		var t2510 = f.s[0]; f.v.sec = t2510;
		f.s[0] = ([f.v["this"], f.v.sec]);
		f.s[1] = ([(f.v["this"]).filestore_class, "run_security_dialog"]);
		e.php_builtin (2, "call_user_func_array", 2);
	},
	function (e,f) {
		var t2512 = f.s[0]; f.v.sec = t2512;
		if (((f.v.sec)) !== ((null))) f.pc=3; else f.pc=-1;
	},
	function (e,f) { if (((f.v.sec)) === ((""))) f.pc=4; else f.pc=5; },
	function (e,f) {
		f.pc=-1;
		e.mcall (3, f.v["this"], "set_sec", ([null]));
	},
/*5*/	function (e,f) { e.mcall (3, f.v["this"], "set_sec", ([f.v.sec])); },
null	];

;
	c.pargs__dlist =  [];
	c.pinst__dlist =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["dlist", ([])])); },
	function (e,f) { var t2513 = f.s[0]; e.return_pop (t2513); },
null	];

;
	c.pargs__stream_url =  [];
	c.pinst__stream_url =  [
/*0*/	function (e,f) { e.smcall (3, page_dispatcher,"makelink", (["filenode", "loader", ({fid:(f.v["this"]).rowid})])); },
	function (e,f) { var t2514 = f.s[0]; e.return_pop (t2514); },
null	];

;
};
filenode.init_methods (filenode);
rpcclass.setup_class (filenode, "filenode",0, (["parent","name","filestore_class","is_dir","xcan_read","xcan_write","rowid","listeners"]), ([0,0,0,0,0,0,0,2]));
function richtext_node () { this.do_construct (arguments); }
richtext_node.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
	c.pargs__edtag =  [];
	c.pinst__edtag =  [
/*0*/	function (e,f) { e.mcall (2, f.v["this"], "xml_tag", ([])); },
	function (e,f) { var t2515 = f.s[0]; e.return_pop (t2515); },
null	];

;
	c.pargs__needs_content =  [];
	c.pinst__needs_content =  [
/*0*/	function (e,f) { e.return_pop (false); },
null	];

;
	c.pargs__can_merge =  [];
	c.pinst__can_merge =  [
/*0*/	function (e,f) { e.return_pop (false); },
null	];

;
	c.args__can_unformat = c.pargs__can_unformat =  [];
	c.inst__can_unformat = c.pinst__can_unformat =  [
/*0*/	function (e,f) { e.return_pop (false); },
null	];

;
	c.args__create = c.pargs__create =  ["richtextobj","tagname","props"];
	c.inst__create = c.pinst__create =  [
/*0*/	function (e,f) { if (!(((((f.v.richtextobj).renderer).class_list)[(f.v.tagname)]) !== undefined)) f.pc=1; else f.pc=2; },
	function (e,f) {
		f.s[0] = builtin__debugout (("class for tag ") + ("" + (f.v.tagname) + (" is not registered")));
		e.return_pop (null);
	},
	function (e,f) {
		f.v.cname = (((f.v.richtextobj).renderer).class_list)[(f.v.tagname)];
		f.v.obj = eval ("new "+f.v.cname);
		f.v.obj.richtextobj = f.v.richtextobj;
		f.v.obj.props = ({ignore:""});
		if (((f.v.props)) !== ((null))) f.pc=3; else f.pc=6;
	},
	function (e,f) { f.v._k150 = e.enumkeys (f.v.props); },
	function (e,f) { if (!((f.v._k150).length)) f.pc=6; },
/*5*/	function (e,f) {
		f.pc=4;
		f.s[0] = f.v.key = (f.v._k150).shift();
		f.s[1] = f.v.value = (f.v.props)[(f.v.key)];
		(f.v.obj).props[f.v.key] = f.v.value;
	},
	function (e,f) {
		f.s[0] = f.v.obj;
		e.mcall (3, f.v.obj, "get_el_id", ([]));
	},
	function (e,f) {
		f.s[2] = (f.v.richtextobj).node_list;
		e.php_index_lvalue (3);
		e.php_assign (2);
		e.return_pop (f.v.obj);
	},
null	];

;
	c.args__get_children = c.pargs__get_children =  [];
	c.inst__get_children = c.pinst__get_children =  [
/*0*/	function (e,f) { e.return_pop (([])); },
null	];

;
	c.pargs__can_contain_child =  ["tagname"];
	c.pinst__can_contain_child =  [
/*0*/	function (e,f) { e.mcall (2, f.v["this"], "get_children", ([])); },
	function (e,f) {
		var t2528 = f.s[0]; f.v.kids = t2528;
		f.v._k152 = e.enumkeys (f.v.kids);
	},
	function (e,f) {
		f.pc=4;
		if (!((f.v._k152).length)) f.pc=3;
	},
	function (e,f) { e.return_pop (false); },
	function (e,f) {
		f.v._i153 = (f.v._k152).shift();
		f.v.kid = (f.v.kids)[(f.v._i153)];
		if (((f.v.kid)) == ((f.v.tagname))) f.pc=5; else f.pc=6;
	},
/*5*/	function (e,f) { e.return_pop (true); },
	function (e,f) { if (((builtin__substr (f.v.kid,0,1))) == (("%"))) f.pc=8; else f.pc=9; },
	function (e,f) { e.return_pop (true); },
	function (e,f) {
		f.pc=10;
		e.mcall (4, (f.v["this"]).richtextobj, "in_group", ([f.v.kid, f.v.tagname]));
	},
	function (e,f) { f.s[0] = false; },
/*10*/	function (e,f) { var t2532 = f.s[0]; if (t2532) f.pc=7; else f.pc=2; },
null	];

;
	c.pargs__get_el_id =  [];
	c.pinst__get_el_id =  [
/*0*/	function (e,f) {
		f.s[0] = "-el";
		e.mcall (3, f.v["this"], "get_id", ([]));
	},
	function (e,f) {
		var t2533 = f.s[1]; var t2534 = f.s[0]; 
		e.return_pop ("" + (t2533) + (t2534));
	},
null	];

;
	c.args__is_leaf = c.pargs__is_leaf =  [];
	c.inst__is_leaf = c.pinst__is_leaf =  [
/*0*/	function (e,f) { e.return_pop (false); },
null	];

;
	c.pargs__delete_node =  ["el"];
	c.pinst__delete_node =  [
/*0*/	function (e,f) { e.mcall (3, (f.v.el).parentNode, "removeChild", ([f.v.el])); },
null	];

;
	c.pargs__reformat_node =  ["node"];
	c.pinst__reformat_node =  [
/*0*/	function (e,f) { if (builtin__method_exists (f.v["this"],"attrs")) f.pc=1; else f.pc=5; },
	function (e,f) { e.mcall (2, f.v["this"], "attrs", ([])); },
	function (e,f) {
		var t2536 = f.s[0]; f.v.attrs = t2536;
		f.v._k154 = e.enumkeys (f.v.attrs);
	},
	function (e,f) { if (!((f.v._k154).length)) f.pc=5; },
	function (e,f) {
		f.pc=3;
		f.s[0] = f.v.attr = (f.v._k154).shift();
		f.s[1] = f.v.value = (f.v.attrs)[(f.v.attr)];
		e.mcall (6, f.v.node, "setAttribute", ([f.v.attr, f.v.value]));
	},
/*5*/	function (e,f) { if (builtin__method_exists (f.v["this"],"context_menu")) f.pc=6; else f.pc=8; },
	function (e,f) { e.mcall (4, f.v["this"], "render_start", (["context_menu", 0])); },
	function (e,f) { var t2540 = f.s[0]; e.mcall (4, f.v.node, "setAttribute", (["oncontextmenu", t2540])); },
	function (e,f) {
		f.pc=10;
		e.mcall (2, f.v["this"], "is_leaf", ([]));
	},
	function (e,f) {
		f.pc=11;
		e.mcall (4, f.v.node, "setAttribute", (["contentEditable", "false"]));
	},
/*10*/	function (e,f) { var t2541 = f.s[0]; if (t2541) f.pc=9; else f.pc=11; },
	function (e,f) { if (builtin__method_exists (f.v["this"],"generate_node_body")) f.pc=12; else f.pc=-1; },
	function (e,f) { if (((f.v.node).childNodes).length) f.pc=13; else f.pc=15; },
	function (e,f) { e.mcall (2, f.v["this"], "generate_node_body", ([])); },
	function (e,f) {
		f.pc=-1;
		var t2543 = f.s[0]; ((f.v.node).childNodes)[(0)].nodeValue = t2543;
	},
/*15*/	function (e,f) { e.mcall (2, f.v["this"], "generate_node_body", ([])); },
	function (e,f) { var t2544 = f.s[0]; e.mcall (3, document, "createTextNode", ([t2544])); },
	function (e,f) {
		var t2546 = f.s[0]; f.v.tn = t2546;
		e.mcall (3, f.v.node, "appendChild", ([f.v.tn]));
	},
null	];

;
	c.pargs__render_editable_node =  ["richtextobj"];
	c.pinst__render_editable_node =  [
/*0*/	function (e,f) {
		f.s[0] = "\"";
		e.mcall (3, f.v["this"], "get_el_id", ([]));
	},
	function (e,f) {
		var t2547 = f.s[1]; var t2548 = f.s[0]; 
		f.s[0] = (" id=\"") + ("" + (t2547) + (t2548));
		e.mcall (3, f.v["this"], "edtag", ([]));
	},
	function (e,f) {
		var t2549 = f.s[1]; var t2550 = f.s[0]; 
		window.__outbuffer += ("<") + ("" + (t2549) + (t2550));
		if (builtin__method_exists (f.v["this"],"attrs")) f.pc=3; else f.pc=7;
	},
	function (e,f) { e.mcall (2, f.v["this"], "attrs", ([])); },
	function (e,f) {
		var t2552 = f.s[0]; f.v.attrs = t2552;
		f.v._k156 = e.enumkeys (f.v.attrs);
	},
/*5*/	function (e,f) { if (!((f.v._k156).length)) f.pc=7; },
	function (e,f) {
		f.pc=5;
		f.s[0] = f.v.attr = (f.v._k156).shift();
		f.s[1] = f.v.value = (f.v.attrs)[(f.v.attr)];
		window.__outbuffer += (" ") + ("" + (f.v.attr) + (("=\"") + ("" + (f.v.value) + ("\""))));
	},
	function (e,f) { if (builtin__method_exists (f.v["this"],"context_menu")) f.pc=8; else f.pc=10; },
	function (e,f) {
		f.s[0] = "\"";
		e.mcall (5, f.v["this"], "render_start", (["context_menu", 0]));
	},
	function (e,f) {
		var t2556 = f.s[1]; var t2557 = f.s[0]; 
		window.__outbuffer += (" oncontextmenu=\"") + ("" + (t2556) + (t2557));
	},
/*10*/	function (e,f) {
		f.pc=27;
		e.mcall (2, f.v["this"], "is_leaf", ([]));
	},
	function (e,f) {
		window.__outbuffer += " contentEditable=\"false\"";
		if (builtin__method_exists (f.v["this"],"generate_node_body")) f.pc=12; else f.pc=15;
	},
	function (e,f) {
		f.s[0] = ">";
		e.mcall (3, f.v["this"], "edtag", ([]));
	},
	function (e,f) {
		var t2558 = f.s[1]; var t2559 = f.s[0]; 
		f.s[0] = ("</") + ("" + (t2558) + (t2559));
		e.mcall (3, f.v["this"], "generate_node_body", ([]));
	},
	function (e,f) {
		var t2560 = f.s[1]; var t2561 = f.s[0]; 
		window.__outbuffer += (">") + ("" + (t2560) + (t2561));
		e.return_pop (null);
	},
/*15*/	function (e,f) {
		f.pc=19;
		f.s[0] = "span";
		e.mcall (3, f.v["this"], "edtag", ([]));
	},
	function (e,f) {
		f.s[0] = ">";
		e.mcall (3, f.v["this"], "edtag", ([]));
	},
	function (e,f) {
		f.pc=24;
		var t2562 = f.s[1]; var t2563 = f.s[0]; 
		window.__outbuffer += ("></") + ("" + (t2562) + (t2563));
	},
	function (e,f) {
		f.pc=24;
		window.__outbuffer += " />";
	},
	function (e,f) {
		var t2564 = f.s[1]; var t2565 = f.s[0]; 
		if (((t2564)) == ((t2565))) f.pc=20; else f.pc=21;
	},
/*20*/	function (e,f) {
		f.pc=23;
		f.s[0] = true;
	},
	function (e,f) {
		f.s[0] = "div";
		e.mcall (3, f.v["this"], "edtag", ([]));
	},
	function (e,f) { var t2566 = f.s[1]; var t2567 = f.s[0]; f.s[0] = ((t2566)) == ((t2567)); },
	function (e,f) { var t2568 = f.s[0]; if (t2568) f.pc=16; else f.pc=18; },
	function (e,f) { e.return_pop (null); },
/*25*/	function (e,f) {
		window.__outbuffer += ">";
		f.s[0] = ">";
		e.mcall (3, f.v["this"], "edtag", ([]));
	},
	function (e,f) {
		var t2569 = f.s[1]; var t2570 = f.s[0]; 
		e.return_pop (("</") + ("" + (t2569) + (t2570)));
	},
	function (e,f) { var t2571 = f.s[0]; if (t2571) f.pc=11; else f.pc=25; },
null	];

;
};
richtext_node.init_methods (richtext_node);
rpcclass.setup_class (richtext_node, "richtext_node",0, (["richtextobj","props","listeners"]), ([0,0,2]));
function richtext_simple_leaf_node () { this.do_construct (arguments); }
richtext_simple_leaf_node.init_methods = function (c) {
	richtext_node.init_methods(c);
	var cp = c.prototype;
	c.args__is_leaf = c.pargs__is_leaf =  [];
	c.inst__is_leaf = c.pinst__is_leaf =  [
/*0*/	function (e,f) { e.return_pop (true); },
null	];

;
};
richtext_simple_leaf_node.init_methods (richtext_simple_leaf_node);
rpcclass.setup_class (richtext_simple_leaf_node, "richtext_simple_leaf_node",0, (["richtextobj","props","listeners"]), ([0,0,2]));
function richtext_configurable_node () { this.do_construct (arguments); }
richtext_configurable_node.init_methods = function (c) {
	richtext_node.init_methods(c);
	var cp = c.prototype;
	c.pargs__edit_object_properties_dialog =  ["el"];
	c.pinst__edit_object_properties_dialog =  [
/*0*/	function (e,f) { e.smcall (1, popupmenu,"quick", ([(["Delete", "Properties"])])); },
	function (e,f) {
		var t2573 = f.s[0]; f.v.action = t2573;
		if (((f.v.action)) === ((null))) f.pc=2; else f.pc=3;
	},
	function (e,f) { f.pc=-1; },
	function (e,f) { if (((f.v.action)) == (("Delete"))) f.pc=4; else f.pc=7; },
	function (e,f) {
		f.pc=6;
		e.smcall (1, popupokcancel,"run", (["Delete this item?"]));
	},
/*5*/	function (e,f) {
		f.pc=-1;
		e.mcall (3, f.v["this"], "delete_node", ([f.v.el]));
	},
	function (e,f) { var t2574 = f.s[0]; if (t2574) f.pc=5; else f.pc=-1; },
	function (e,f) { e.mcall (2, f.v["this"], "get_fields", ([])); },
	function (e,f) {
		var t2576 = f.s[0]; f.v.fields = t2576;
		f.v.i = 0;
	},
	function (e,f) {
		f.pc=11;
		if (!(((f.v.fields)[(f.v.i)]) !== undefined)) f.pc=10;
	},
/*10*/	function (e,f) {
		f.pc=12;
		f.v.pop = new popupform;
		f.s[0] = f.v.fields;
		f.s[1] = " properties";
		e.mcall (4, f.v["this"], "xml_tag", ([]));
	},
	function (e,f) {
		f.pc=9;
		(f.v.fields)[(f.v.i)].value = ((f.v["this"]).props)[(((f.v.fields)[(f.v.i)]).name)];
		e.php_push_var_lvalue (0, "i");
		e.php_postinc (1);
	},
	function (e,f) {
		var t2581 = f.s[2]; var t2582 = f.s[1]; 
		var t2583 = f.s[0]; e.mcall (6, f.v.pop, "initialise", ([0, 0, "" + (t2581) + (t2582), t2583]));
	},
	function (e,f) { e.mcall (2, f.v.pop, "open", ([])); },
	function (e,f) {  },
/*15*/	function (e,f) {
		f.pc=17;
		e.mcall (2, f.v.pop, "run", ([]));
	},
	function (e,f) {
		f.pc=27;
		e.mcall (2, f.v.pop, "close", ([]));
	},
	function (e,f) {
		var t2585 = f.s[0]; f.v.event = t2585;
		if ((((f.v.event).action)) == (("OK"))) f.pc=18; else f.pc=23;
	},
	function (e,f) { e.mcall (2, f.v.pop, "get_form_fields", ([])); },
	function (e,f) {
		var t2587 = f.s[0]; f.v.res = t2587;
		f.v._k158 = e.enumkeys (f.v.res);
	},
/*20*/	function (e,f) {
		f.pc=22;
		if (!((f.v._k158).length)) f.pc=21;
	},
	function (e,f) { f.pc=16; },
	function (e,f) {
		f.pc=20;
		f.v.field = (f.v._k158).shift();
		f.v.value = (f.v.res)[(f.v.field)];
		(f.v["this"]).props[f.v.field] = f.v.value;
	},
	function (e,f) { if ((((f.v.event).action)) == (("cancel"))) f.pc=24; else f.pc=25; },
	function (e,f) {
		f.pc=26;
		f.s[0] = true;
	},
/*25*/	function (e,f) { f.s[0] = (((f.v.event).action)) == (("cover")); },
	function (e,f) { var t2592 = f.s[0]; if (t2592) f.pc=16; else f.pc=15; },
	function (e,f) { e.mcall (3, f.v["this"], "reformat_node", ([f.v.el])); },
null	];

;
	c.pargs__context_menu =  ["el","arg","ev"];
	c.pinst__context_menu =  [
/*0*/	function (e,f) { e.mcall (3, f.v["this"], "edit_object_properties_dialog", ([f.v.el])); },
null	];

;
};
richtext_configurable_node.init_methods (richtext_configurable_node);
rpcclass.setup_class (richtext_configurable_node, "richtext_configurable_node",0, (["richtextobj","props","listeners"]), ([0,0,2]));
function richtext_configurable_leaf_node () { this.do_construct (arguments); }
richtext_configurable_leaf_node.init_methods = function (c) {
	richtext_configurable_node.init_methods(c);
	var cp = c.prototype;
	c.pargs__edtag =  [];
	c.pinst__edtag =  [
/*0*/	function (e,f) { e.return_pop ("span"); },
null	];

;
	c.args__is_leaf = c.pargs__is_leaf =  [];
	c.inst__is_leaf = c.pinst__is_leaf =  [
/*0*/	function (e,f) { e.return_pop (true); },
null	];

;
};
richtext_configurable_leaf_node.init_methods (richtext_configurable_leaf_node);
rpcclass.setup_class (richtext_configurable_leaf_node, "richtext_configurable_leaf_node",0, (["richtextobj","props","listeners"]), ([0,0,2]));
function richtext_node_doc () { this.do_construct (arguments); }
richtext_node_doc.init_methods = function (c) {
	richtext_node.init_methods(c);
	var cp = c.prototype;
	c.args__xml_tag = c.pargs__xml_tag =  [];
	c.inst__xml_tag = c.pinst__xml_tag =  [
/*0*/	function (e,f) { e.return_pop ("doc"); },
null	];

;
	c.pargs__needs_content =  [];
	c.pinst__needs_content =  [
/*0*/	function (e,f) { e.return_pop (true); },
null	];

;
	c.args__get_children = c.pargs__get_children =  [];
	c.inst__get_children = c.pinst__get_children =  [
/*0*/	function (e,f) { e.return_pop ((["%ptext", "h1", "h2", "h3", "h4", "div", "p", "ul", "ol", "table", "hr", "clear"])); },
null	];

;
	c.pargs__edtag =  [];
	c.pinst__edtag =  [
/*0*/	function (e,f) { e.return_pop ("div"); },
null	];

;
	c.pargs__attrs =  [];
	c.pinst__attrs =  [
/*0*/	function (e,f) { e.return_pop (({contentEditable:"true", style:"min-height:32px"})); },
null	];

;
};
richtext_node_doc.init_methods (richtext_node_doc);
rpcclass.setup_class (richtext_node_doc, "richtext_node_doc",0, (["richtextobj","props","listeners"]), ([0,0,2]));
function richtext_node_header () { this.do_construct (arguments); }
richtext_node_header.init_methods = function (c) {
	richtext_node.init_methods(c);
	var cp = c.prototype;
	c.pargs__needs_content =  [];
	c.pinst__needs_content =  [
/*0*/	function (e,f) { e.return_pop (true); },
null	];

;
	c.args__can_unformat = c.pargs__can_unformat =  [];
	c.inst__can_unformat = c.pinst__can_unformat =  [
/*0*/	function (e,f) { e.return_pop (true); },
null	];

;
	c.args__get_children = c.pargs__get_children =  [];
	c.inst__get_children = c.pinst__get_children =  [
/*0*/	function (e,f) { e.return_pop ((["!text"])); },
null	];

;
	c.args__format_h = c.pargs__format_h =  ["richtextobj","arg","act"];
	c.inst__format_h = c.pinst__format_h =  [
/*0*/	function (e,f) { e.mcall (2, f.v.richtextobj, "get_selection_as_text", ([])); },
	function (e,f) {
		var t2594 = f.s[0]; f.v.content = t2594;
		if (((f.v.content)) != ((""))) f.pc=2; else f.pc=-1;
	},
	function (e,f) {
		f.s[0] = ([]);
		f.s[1] = ([(f.v.act)[("class")], "xml_tag"]);
		e.php_builtin (2, "call_user_func_array", 2);
	},
	function (e,f) {
		var t2596 = f.s[0]; f.v.tag = t2596;
		e.mcall (5, f.v.richtextobj, "replace_selection_with_node", ([builtin__strtolower (f.v.tag), null, f.v.content]));
	},
null	];

;
};
richtext_node_header.init_methods (richtext_node_header);
rpcclass.setup_class (richtext_node_header, "richtext_node_header",0, (["richtextobj","props","listeners"]), ([0,0,2]));
function richtext_node_h1 () { this.do_construct (arguments); }
richtext_node_h1.init_methods = function (c) {
	richtext_node_header.init_methods(c);
	var cp = c.prototype;
	c.args__xml_tag = c.pargs__xml_tag =  [];
	c.inst__xml_tag = c.pinst__xml_tag =  [
/*0*/	function (e,f) { e.return_pop ("h1"); },
null	];

;
	c.args__auto_import = c.pargs__auto_import =  ["richtextobj","node"];
	c.inst__auto_import = c.pinst__auto_import =  [
/*0*/	function (e,f) { if (((builtin__strtolower ((f.v.node).tagName))) == (("h1"))) f.pc=1; else f.pc=3; },
	function (e,f) { e.smcall (3, richtext_node_h1,"create", ([f.v.richtextobj, "h1", null])); },
	function (e,f) { var t2597 = f.s[0]; e.return_pop (t2597); },
	function (e,f) { e.return_pop (null); },
null	];

;
};
richtext_node_h1.init_methods (richtext_node_h1);
rpcclass.setup_class (richtext_node_h1, "richtext_node_h1",0, (["richtextobj","props","listeners"]), ([0,0,2]));
function richtext_node_h2 () { this.do_construct (arguments); }
richtext_node_h2.init_methods = function (c) {
	richtext_node_header.init_methods(c);
	var cp = c.prototype;
	c.args__xml_tag = c.pargs__xml_tag =  [];
	c.inst__xml_tag = c.pinst__xml_tag =  [
/*0*/	function (e,f) { e.return_pop ("h2"); },
null	];

;
	c.args__auto_import = c.pargs__auto_import =  ["richtextobj","node"];
	c.inst__auto_import = c.pinst__auto_import =  [
/*0*/	function (e,f) { if (((builtin__strtolower ((f.v.node).tagName))) == (("h2"))) f.pc=1; else f.pc=3; },
	function (e,f) { e.smcall (3, richtext_node_h2,"create", ([f.v.richtextobj, "h2", null])); },
	function (e,f) { var t2598 = f.s[0]; e.return_pop (t2598); },
	function (e,f) { e.return_pop (null); },
null	];

;
};
richtext_node_h2.init_methods (richtext_node_h2);
rpcclass.setup_class (richtext_node_h2, "richtext_node_h2",0, (["richtextobj","props","listeners"]), ([0,0,2]));
function richtext_node_h3 () { this.do_construct (arguments); }
richtext_node_h3.init_methods = function (c) {
	richtext_node_header.init_methods(c);
	var cp = c.prototype;
	c.args__xml_tag = c.pargs__xml_tag =  [];
	c.inst__xml_tag = c.pinst__xml_tag =  [
/*0*/	function (e,f) { e.return_pop ("h3"); },
null	];

;
	c.args__auto_import = c.pargs__auto_import =  ["richtextobj","node"];
	c.inst__auto_import = c.pinst__auto_import =  [
/*0*/	function (e,f) { if (((builtin__strtolower ((f.v.node).tagName))) == (("h3"))) f.pc=1; else f.pc=3; },
	function (e,f) { e.smcall (3, richtext_node_h3,"create", ([f.v.richtextobj, "h3", null])); },
	function (e,f) { var t2599 = f.s[0]; e.return_pop (t2599); },
	function (e,f) { e.return_pop (null); },
null	];

;
};
richtext_node_h3.init_methods (richtext_node_h3);
rpcclass.setup_class (richtext_node_h3, "richtext_node_h3",0, (["richtextobj","props","listeners"]), ([0,0,2]));
function richtext_node_h4 () { this.do_construct (arguments); }
richtext_node_h4.init_methods = function (c) {
	richtext_node_header.init_methods(c);
	var cp = c.prototype;
	c.args__xml_tag = c.pargs__xml_tag =  [];
	c.inst__xml_tag = c.pinst__xml_tag =  [
/*0*/	function (e,f) { e.return_pop ("h4"); },
null	];

;
	c.args__auto_import = c.pargs__auto_import =  ["richtextobj","node"];
	c.inst__auto_import = c.pinst__auto_import =  [
/*0*/	function (e,f) { if (((builtin__strtolower ((f.v.node).tagName))) == (("h4"))) f.pc=1; else f.pc=3; },
	function (e,f) { e.smcall (3, richtext_node_h4,"create", ([f.v.richtextobj, "h4", null])); },
	function (e,f) { var t2600 = f.s[0]; e.return_pop (t2600); },
	function (e,f) { e.return_pop (null); },
null	];

;
};
richtext_node_h4.init_methods (richtext_node_h4);
rpcclass.setup_class (richtext_node_h4, "richtext_node_h4",0, (["richtextobj","props","listeners"]), ([0,0,2]));
function richtext_node_br () { this.do_construct (arguments); }
richtext_node_br.init_methods = function (c) {
	richtext_simple_leaf_node.init_methods(c);
	var cp = c.prototype;
	c.args__xml_tag = c.pargs__xml_tag =  [];
	c.inst__xml_tag = c.pinst__xml_tag =  [
/*0*/	function (e,f) { e.return_pop ("br"); },
null	];

;
	c.args__auto_import = c.pargs__auto_import =  ["richtextobj","node"];
	c.inst__auto_import = c.pinst__auto_import =  [
/*0*/	function (e,f) { if (((builtin__strtolower ((f.v.node).tagName))) == (("br"))) f.pc=1; else f.pc=3; },
	function (e,f) { e.smcall (3, richtext_node_br,"create", ([f.v.richtextobj, "br", null])); },
	function (e,f) { var t2601 = f.s[0]; e.return_pop (t2601); },
	function (e,f) { e.return_pop (null); },
null	];

;
};
richtext_node_br.init_methods (richtext_node_br);
rpcclass.setup_class (richtext_node_br, "richtext_node_br",0, (["richtextobj","props","listeners"]), ([0,0,2]));
function richtext_node_hr () { this.do_construct (arguments); }
richtext_node_hr.init_methods = function (c) {
	richtext_simple_leaf_node.init_methods(c);
	var cp = c.prototype;
	c.args__xml_tag = c.pargs__xml_tag =  [];
	c.inst__xml_tag = c.pinst__xml_tag =  [
/*0*/	function (e,f) { e.return_pop ("hr"); },
null	];

;
	c.args__auto_import = c.pargs__auto_import =  ["richtextobj","node"];
	c.inst__auto_import = c.pinst__auto_import =  [
/*0*/	function (e,f) { if (((builtin__strtolower ((f.v.node).tagName))) == (("hr"))) f.pc=1; else f.pc=3; },
	function (e,f) { e.smcall (3, richtext_node_hr,"create", ([f.v.richtextobj, "hr", null])); },
	function (e,f) { var t2602 = f.s[0]; e.return_pop (t2602); },
	function (e,f) { e.return_pop (null); },
null	];

;
	c.args__insert_hr = c.pargs__insert_hr =  ["richtextobj","arg"];
	c.inst__insert_hr = c.pinst__insert_hr =  [
/*0*/	function (e,f) { e.mcall (5, f.v.richtextobj, "replace_selection_with_node", (["hr", null, null])); },
null	];

;
};
richtext_node_hr.init_methods (richtext_node_hr);
rpcclass.setup_class (richtext_node_hr, "richtext_node_hr",0, (["richtextobj","props","listeners"]), ([0,0,2]));
function richtext_node_clear () { this.do_construct (arguments); }
richtext_node_clear.init_methods = function (c) {
	richtext_node.init_methods(c);
	var cp = c.prototype;
	c.args__xml_tag = c.pargs__xml_tag =  [];
	c.inst__xml_tag = c.pinst__xml_tag =  [
/*0*/	function (e,f) { e.return_pop ("clear"); },
null	];

;
	c.args__is_leaf = c.pargs__is_leaf =  [];
	c.inst__is_leaf = c.pinst__is_leaf =  [
/*0*/	function (e,f) { e.return_pop (true); },
null	];

;
	c.pargs__edtag =  [];
	c.pinst__edtag =  [
/*0*/	function (e,f) { e.return_pop ("div"); },
null	];

;
	c.pargs__attrs =  [];
	c.pinst__attrs =  [
/*0*/	function (e,f) { e.return_pop (({style:"clear:both;width:100px;border-top:1px solid #c0c0c0"})); },
null	];

;
	c.args__insert_clear = c.pargs__insert_clear =  ["richtextobj","arg"];
	c.inst__insert_clear = c.pinst__insert_clear =  [
/*0*/	function (e,f) { e.mcall (5, f.v.richtextobj, "replace_selection_with_node", (["clear", null, null])); },
null	];

;
};
richtext_node_clear.init_methods (richtext_node_clear);
rpcclass.setup_class (richtext_node_clear, "richtext_node_clear",0, (["richtextobj","props","listeners"]), ([0,0,2]));
function richtext_node_strong () { this.do_construct (arguments); }
richtext_node_strong.init_methods = function (c) {
	richtext_node.init_methods(c);
	var cp = c.prototype;
	c.args__xml_tag = c.pargs__xml_tag =  [];
	c.inst__xml_tag = c.pinst__xml_tag =  [
/*0*/	function (e,f) { e.return_pop ("strong"); },
null	];

;
	c.pargs__needs_content =  [];
	c.pinst__needs_content =  [
/*0*/	function (e,f) { e.return_pop (true); },
null	];

;
	c.pargs__can_merge =  [];
	c.pinst__can_merge =  [
/*0*/	function (e,f) { e.return_pop (true); },
null	];

;
	c.args__can_unformat = c.pargs__can_unformat =  [];
	c.inst__can_unformat = c.pinst__can_unformat =  [
/*0*/	function (e,f) { e.return_pop (true); },
null	];

;
	c.args__get_children = c.pargs__get_children =  [];
	c.inst__get_children = c.pinst__get_children =  [
/*0*/	function (e,f) { e.return_pop ((["!text", "em"])); },
null	];

;
	c.args__auto_import = c.pargs__auto_import =  ["richtextobj","node"];
	c.inst__auto_import = c.pinst__auto_import =  [
/*0*/	function (e,f) { if (((builtin__strtolower ((f.v.node).tagName))) == (("strong"))) f.pc=3; else f.pc=4; },
	function (e,f) { e.smcall (3, richtext_node_strong,"create", ([f.v.richtextobj, "strong", null])); },
	function (e,f) { var t2603 = f.s[0]; e.return_pop (t2603); },
	function (e,f) {
		f.pc=5;
		f.s[0] = true;
	},
	function (e,f) { f.s[0] = ((builtin__strtolower ((f.v.node).tagName))) == (("b")); },
/*5*/	function (e,f) { var t2604 = f.s[0]; if (t2604) f.pc=1; else f.pc=6; },
	function (e,f) { e.return_pop (null); },
null	];

;
	c.args__format_strong = c.pargs__format_strong =  ["richtextobj","arg"];
	c.inst__format_strong = c.pinst__format_strong =  [
/*0*/	function (e,f) { e.mcall (3, f.v.richtextobj, "toggle_formatting", (["strong"])); },
null	];

;
};
richtext_node_strong.init_methods (richtext_node_strong);
rpcclass.setup_class (richtext_node_strong, "richtext_node_strong",0, (["richtextobj","props","listeners"]), ([0,0,2]));
function richtext_node_em () { this.do_construct (arguments); }
richtext_node_em.init_methods = function (c) {
	richtext_node.init_methods(c);
	var cp = c.prototype;
	c.args__xml_tag = c.pargs__xml_tag =  [];
	c.inst__xml_tag = c.pinst__xml_tag =  [
/*0*/	function (e,f) { e.return_pop ("em"); },
null	];

;
	c.pargs__needs_content =  [];
	c.pinst__needs_content =  [
/*0*/	function (e,f) { e.return_pop (true); },
null	];

;
	c.pargs__can_merge =  [];
	c.pinst__can_merge =  [
/*0*/	function (e,f) { e.return_pop (true); },
null	];

;
	c.args__can_unformat = c.pargs__can_unformat =  [];
	c.inst__can_unformat = c.pinst__can_unformat =  [
/*0*/	function (e,f) { e.return_pop (true); },
null	];

;
	c.args__get_children = c.pargs__get_children =  [];
	c.inst__get_children = c.pinst__get_children =  [
/*0*/	function (e,f) { e.return_pop ((["!text"])); },
null	];

;
	c.args__auto_import = c.pargs__auto_import =  ["richtextobj","node"];
	c.inst__auto_import = c.pinst__auto_import =  [
/*0*/	function (e,f) { if (((builtin__strtolower ((f.v.node).tagName))) == (("em"))) f.pc=3; else f.pc=4; },
	function (e,f) { e.smcall (3, richtext_node_em,"create", ([f.v.richtextobj, "em", null])); },
	function (e,f) { var t2605 = f.s[0]; e.return_pop (t2605); },
	function (e,f) {
		f.pc=5;
		f.s[0] = true;
	},
	function (e,f) { f.s[0] = ((builtin__strtolower ((f.v.node).tagName))) == (("i")); },
/*5*/	function (e,f) { var t2606 = f.s[0]; if (t2606) f.pc=1; else f.pc=6; },
	function (e,f) { e.return_pop (null); },
null	];

;
	c.args__format_em = c.pargs__format_em =  ["richtextobj","arg"];
	c.inst__format_em = c.pinst__format_em =  [
/*0*/	function (e,f) { e.mcall (3, f.v.richtextobj, "toggle_formatting", (["em"])); },
null	];

;
};
richtext_node_em.init_methods (richtext_node_em);
rpcclass.setup_class (richtext_node_em, "richtext_node_em",0, (["richtextobj","props","listeners"]), ([0,0,2]));
function richtext_node_div () { this.do_construct (arguments); }
richtext_node_div.init_methods = function (c) {
	richtext_node.init_methods(c);
	var cp = c.prototype;
	c.args__xml_tag = c.pargs__xml_tag =  [];
	c.inst__xml_tag = c.pinst__xml_tag =  [
/*0*/	function (e,f) { e.return_pop ("div"); },
null	];

;
	c.args__get_children = c.pargs__get_children =  [];
	c.inst__get_children = c.pinst__get_children =  [
/*0*/	function (e,f) { e.return_pop ((["%ptext", "p"])); },
null	];

;
	c.args__auto_import = c.pargs__auto_import =  ["richtextobj","node"];
	c.inst__auto_import = c.pinst__auto_import =  [
/*0*/	function (e,f) { if (((builtin__strtolower ((f.v.node).tagName))) == (("div"))) f.pc=1; else f.pc=3; },
	function (e,f) { e.smcall (3, richtext_node_div,"create", ([f.v.richtextobj, "div", null])); },
	function (e,f) { var t2607 = f.s[0]; e.return_pop (t2607); },
	function (e,f) { e.return_pop (null); },
null	];

;
};
richtext_node_div.init_methods (richtext_node_div);
rpcclass.setup_class (richtext_node_div, "richtext_node_div",0, (["richtextobj","props","listeners"]), ([0,0,2]));
function richtext_node_p () { this.do_construct (arguments); }
richtext_node_p.init_methods = function (c) {
	richtext_node.init_methods(c);
	var cp = c.prototype;
	c.args__xml_tag = c.pargs__xml_tag =  [];
	c.inst__xml_tag = c.pinst__xml_tag =  [
/*0*/	function (e,f) { e.return_pop ("p"); },
null	];

;
	c.args__get_children = c.pargs__get_children =  [];
	c.inst__get_children = c.pinst__get_children =  [
/*0*/	function (e,f) { e.return_pop ((["%ptext"])); },
null	];

;
	c.args__auto_import = c.pargs__auto_import =  ["richtextobj","node"];
	c.inst__auto_import = c.pinst__auto_import =  [
/*0*/	function (e,f) { if (((builtin__strtolower ((f.v.node).tagName))) == (("p"))) f.pc=1; else f.pc=3; },
	function (e,f) { e.smcall (3, richtext_node_p,"create", ([f.v.richtextobj, "p", null])); },
	function (e,f) { var t2608 = f.s[0]; e.return_pop (t2608); },
	function (e,f) { e.return_pop (null); },
null	];

;
	c.args__insert_paragraph = c.pargs__insert_paragraph =  ["richtextobj","arg"];
	c.inst__insert_paragraph = c.pinst__insert_paragraph =  [
/*0*/	function (e,f) { e.mcall (5, f.v.richtextobj, "replace_selection_with_node", (["p", null, ""])); },
null	];

;
};
richtext_node_p.init_methods (richtext_node_p);
rpcclass.setup_class (richtext_node_p, "richtext_node_p",0, (["richtextobj","props","listeners"]), ([0,0,2]));
function richtext_node_table () { this.do_construct (arguments); }
richtext_node_table.init_methods = function (c) {
	richtext_configurable_node.init_methods(c);
	var cp = c.prototype;
	c.args__xml_tag = c.pargs__xml_tag =  [];
	c.inst__xml_tag = c.pinst__xml_tag =  [
/*0*/	function (e,f) { e.return_pop ("table"); },
null	];

;
	c.pargs__attrs =  [];
	c.pinst__attrs =  [
/*0*/	function (e,f) { e.return_pop (({contentEditable:"false", style:"width:100%"})); },
null	];

;
	c.pargs__needs_content =  [];
	c.pinst__needs_content =  [
/*0*/	function (e,f) { e.return_pop (true); },
null	];

;
	c.pargs__get_fields =  [];
	c.pinst__get_fields =  [
/*0*/	function (e,f) { e.return_pop (([({type:"list", options:(["simple", "lined", "boxed", "banded"]), name:"type", label:"Style"})])); },
null	];

;
	c.args__auto_import = c.pargs__auto_import =  ["richtextobj","node"];
	c.inst__auto_import = c.pinst__auto_import =  [
/*0*/	function (e,f) { if (((builtin__strtolower ((f.v.node).tagName))) == (("table"))) f.pc=1; else f.pc=3; },
	function (e,f) { e.smcall (3, richtext_node_table,"create", ([f.v.richtextobj, "table", null])); },
	function (e,f) { var t2609 = f.s[0]; e.return_pop (t2609); },
	function (e,f) { e.return_pop (null); },
null	];

;
	c.args__insert_table = c.pargs__insert_table =  ["richtextobj","arg"];
	c.inst__insert_table = c.pinst__insert_table =  [
/*0*/	function (e,f) { e.mcall (2, f.v.richtextobj, "save_bookmark", ([])); },
	function (e,f) {
		var t2611 = f.s[0]; f.v.bm = t2611;
		e.mcall (2, f.v.richtextobj, "get_selection_as_text", ([]));
	},
	function (e,f) {
		var t2613 = f.s[0]; f.v.content = t2613;
		if (((builtin__trim (f.v.content))) == ((""))) f.pc=3; else f.pc=4;
	},
	function (e,f) { f.v.content = "type here"; },
	function (e,f) {
		f.v.fields = ([({name:"rows", type:"text", label:"Rows", value:"2"}), ({name:"cols", type:"text", label:"Columns", value:"2"})]);
		f.v.pop = new popupform;
		e.mcall (6, f.v.pop, "initialise", ([0, 0, "Insert table", f.v.fields]));
	},
/*5*/	function (e,f) { e.mcall (2, f.v.pop, "open", ([])); },
	function (e,f) {  },
	function (e,f) { e.mcall (2, f.v.pop, "run", ([])); },
	function (e,f) {
		var t2618 = f.s[0]; f.v.ev = t2618;
		if ((((f.v.ev).action)) == (("cover"))) f.pc=11; else f.pc=12;
	},
	function (e,f) { e.mcall (2, f.v.pop, "close", ([])); },
/*10*/	function (e,f) { f.pc=-1; },
	function (e,f) {
		f.pc=13;
		f.s[0] = true;
	},
	function (e,f) { f.s[0] = (((f.v.ev).action)) == (("cancel")); },
	function (e,f) { var t2619 = f.s[0]; if (t2619) f.pc=9; else f.pc=14; },
	function (e,f) { if ((((f.v.ev).action)) == (("OK"))) f.pc=15; else f.pc=7; },
/*15*/	function (e,f) { e.mcall (2, f.v.pop, "get_form_fields", ([])); },
	function (e,f) {
		var t2621 = f.s[0]; f.v.fields = t2621;
		f.v.rows = (f.v.fields).rows;
		f.v.cols = (f.v.fields).cols;
		e.mcall (2, f.v.pop, "close", ([]));
	},
	function (e,f) { e.mcall (4, f.v.richtextobj, "make_node", (["table", null])); },
	function (e,f) {
		var t2625 = f.s[0]; f.v.table_node = t2625;
		e.mcall (4, f.v.richtextobj, "make_node", (["tbody", null]));
	},
	function (e,f) {
		var t2627 = f.s[0]; f.v.tbody_node = t2627;
		e.mcall (3, f.v.table_node, "appendChild", ([f.v.tbody_node]));
	},
/*20*/	function (e,f) { f.v.y = 0; },
	function (e,f) {
		f.pc=23;
		if (!(((f.v.y)) < ((f.v.rows)))) f.pc=22;
	},
	function (e,f) {
		f.pc=33;
		e.mcall (3, f.v.richtextobj, "restore_bookmark", ([f.v.bm]));
	},
	function (e,f) { e.mcall (4, f.v.richtextobj, "make_node", (["tr", null])); },
	function (e,f) {
		var t2630 = f.s[0]; f.v.tr_node = t2630;
		f.v.x = 0;
	},
/*25*/	function (e,f) {
		f.pc=27;
		if (!(((f.v.x)) < ((f.v.cols)))) f.pc=26;
	},
	function (e,f) {
		f.pc=32;
		e.mcall (3, f.v.tbody_node, "appendChild", ([f.v.tr_node]));
	},
	function (e,f) { e.mcall (4, f.v.richtextobj, "make_node", (["td", null])); },
	function (e,f) {
		var t2633 = f.s[0]; f.v.td_node = t2633;
		e.mcall (3, document, "createTextNode", ([f.v.content]));
	},
	function (e,f) { var t2634 = f.s[0]; e.mcall (3, f.v.td_node, "appendChild", ([t2634])); },
/*30*/	function (e,f) {
		f.v.content = "type here";
		e.mcall (3, f.v.tr_node, "appendChild", ([f.v.td_node]));
	},
	function (e,f) {
		f.pc=25;
		e.php_push_var_lvalue (0, "x");
		e.php_postinc (1);
	},
	function (e,f) {
		f.pc=21;
		e.php_push_var_lvalue (0, "y");
		e.php_postinc (1);
	},
	function (e,f) { e.mcall (3, f.v.richtextobj, "replace_selection_with_raw_node", ([f.v.table_node])); },
null	];

;
};
richtext_node_table.init_methods (richtext_node_table);
rpcclass.setup_class (richtext_node_table, "richtext_node_table",0, (["richtextobj","props","listeners"]), ([0,0,2]));
function richtext_node_tbody () { this.do_construct (arguments); }
richtext_node_tbody.init_methods = function (c) {
	richtext_node.init_methods(c);
	var cp = c.prototype;
	c.args__xml_tag = c.pargs__xml_tag =  [];
	c.inst__xml_tag = c.pinst__xml_tag =  [
/*0*/	function (e,f) { e.return_pop ("tbody"); },
null	];

;
	c.args__get_children = c.pargs__get_children =  [];
	c.inst__get_children = c.pinst__get_children =  [
/*0*/	function (e,f) { e.return_pop ((["tr"])); },
null	];

;
	c.args__auto_import = c.pargs__auto_import =  ["richtextobj","node"];
	c.inst__auto_import = c.pinst__auto_import =  [
/*0*/	function (e,f) { if (((builtin__strtolower ((f.v.node).tagName))) == (("tbody"))) f.pc=1; else f.pc=3; },
	function (e,f) { e.smcall (3, richtext_node_tbody,"create", ([f.v.richtextobj, "tbody", null])); },
	function (e,f) { var t2638 = f.s[0]; e.return_pop (t2638); },
	function (e,f) { e.return_pop (null); },
null	];

;
};
richtext_node_tbody.init_methods (richtext_node_tbody);
rpcclass.setup_class (richtext_node_tbody, "richtext_node_tbody",0, (["richtextobj","props","listeners"]), ([0,0,2]));
function richtext_node_tr () { this.do_construct (arguments); }
richtext_node_tr.init_methods = function (c) {
	richtext_node.init_methods(c);
	var cp = c.prototype;
	c.args__xml_tag = c.pargs__xml_tag =  [];
	c.inst__xml_tag = c.pinst__xml_tag =  [
/*0*/	function (e,f) { e.return_pop ("tr"); },
null	];

;
	c.pargs__needs_content =  [];
	c.pinst__needs_content =  [
/*0*/	function (e,f) { e.return_pop (true); },
null	];

;
	c.args__get_children = c.pargs__get_children =  [];
	c.inst__get_children = c.pinst__get_children =  [
/*0*/	function (e,f) { e.return_pop ((["td"])); },
null	];

;
	c.args__auto_import = c.pargs__auto_import =  ["richtextobj","node"];
	c.inst__auto_import = c.pinst__auto_import =  [
/*0*/	function (e,f) { if (((builtin__strtolower ((f.v.node).tagName))) == (("tr"))) f.pc=1; else f.pc=3; },
	function (e,f) { e.smcall (3, richtext_node_tr,"create", ([f.v.richtextobj, "tr", null])); },
	function (e,f) { var t2639 = f.s[0]; e.return_pop (t2639); },
	function (e,f) { e.return_pop (null); },
null	];

;
};
richtext_node_tr.init_methods (richtext_node_tr);
rpcclass.setup_class (richtext_node_tr, "richtext_node_tr",0, (["richtextobj","props","listeners"]), ([0,0,2]));
function richtext_node_td () { this.do_construct (arguments); }
richtext_node_td.init_methods = function (c) {
	richtext_node.init_methods(c);
	var cp = c.prototype;
	c.args__xml_tag = c.pargs__xml_tag =  [];
	c.inst__xml_tag = c.pinst__xml_tag =  [
/*0*/	function (e,f) { e.return_pop ("td"); },
null	];

;
	c.pargs__attrs =  [];
	c.pinst__attrs =  [
/*0*/	function (e,f) { e.return_pop (({style:"border:solid 1px black", contentEditable:"true"})); },
null	];

;
	c.args__get_children = c.pargs__get_children =  [];
	c.inst__get_children = c.pinst__get_children =  [
/*0*/	function (e,f) { e.return_pop ((["%ptext"])); },
null	];

;
	c.pargs__context_menu =  ["el","arg","ev"];
	c.pinst__context_menu =  [
/*0*/	function (e,f) { e.smcall (1, popupmenu,"quick", ([(["Insert column after", "Insert column before", "Delete column", "Insert row after", "Insert row before", "Delete row", "Properties"])])); },
	function (e,f) {
		var t2641 = f.s[0]; f.v.choice = t2641;
		if (((f.v.choice)) == ((null))) f.pc=2; else f.pc=3;
	},
	function (e,f) { f.pc=-1; },
	function (e,f) {
		f.v.td_node = f.v.el;
		f.v.tr_node = (f.v.td_node).parentNode;
		f.v.tbody_node = (f.v.tr_node).parentNode;
		f.v.table_node = (f.v.tbody_node).parentNode;
		if (((builtin__strtolower ((f.v.table_node).tagName))) != (("table"))) f.pc=4; else f.pc=5;
	},
	function (e,f) {
		f.s[0] = builtin__alert (("Internal error - call CrossWebs tech support - expected table, found ") + ((f.v.table_node).tagName));
		f.pc=-1;
	},
/*5*/	function (e,f) {
		f.v.x = 0;
		f.v._k160 = e.enumkeys ((f.v.tr_node).childNodes);
	},
	function (e,f) {
		f.pc=8;
		if (!((f.v._k160).length)) f.pc=7;
	},
	function (e,f) {
		f.pc=14;
		f.v.y = 0;
		f.v._k162 = e.enumkeys ((f.v.tbody_node).childNodes);
	},
	function (e,f) {
		f.v._i161 = (f.v._k160).shift();
		f.v.child = ((f.v.tr_node).childNodes)[(f.v._i161)];
		if ((((f.v.child).nodeType)) == ((1))) f.pc=11; else f.pc=12;
	},
	function (e,f) { if (((f.v.child)) == ((f.v.td_node))) f.pc=7; else f.pc=10; },
/*10*/	function (e,f) {
		f.pc=6;
		e.php_push_var_lvalue (0, "x");
		e.php_postinc (1);
	},
	function (e,f) {
		f.pc=13;
		f.s[0] = ((builtin__strtolower ((f.v.child).tagName))) == (("td"));
	},
	function (e,f) { f.s[0] = false; },
	function (e,f) { var t2653 = f.s[0]; if (t2653) f.pc=9; else f.pc=6; },
	function (e,f) {
		f.pc=16;
		if (!((f.v._k162).length)) f.pc=15;
	},
/*15*/	function (e,f) { if (((f.v.choice)) == (("Insert column after"))) f.pc=89; else f.pc=90; },
	function (e,f) {
		f.v._i163 = (f.v._k162).shift();
		f.v.child = ((f.v.tbody_node).childNodes)[(f.v._i163)];
		if ((((f.v.child).nodeType)) == ((1))) f.pc=19; else f.pc=20;
	},
	function (e,f) { if (((f.v.child)) == ((f.v.tr_node))) f.pc=15; else f.pc=18; },
	function (e,f) {
		f.pc=14;
		e.php_push_var_lvalue (0, "y");
		e.php_postinc (1);
	},
	function (e,f) {
		f.pc=21;
		f.s[0] = ((builtin__strtolower ((f.v.child).tagName))) == (("tr"));
	},
/*20*/	function (e,f) { f.s[0] = false; },
	function (e,f) { var t2657 = f.s[0]; if (t2657) f.pc=17; else f.pc=14; },
	function (e,f) { f.v._k164 = e.enumkeys ((f.v.tbody_node).childNodes); },
	function (e,f) { if (!((f.v._k164).length)) f.pc=-1; },
	function (e,f) {
		f.v._i165 = (f.v._k164).shift();
		f.v.tr = ((f.v.tbody_node).childNodes)[(f.v._i165)];
		if ((((f.v.tr).nodeType)) == ((1))) f.pc=40; else f.pc=41;
	},
/*25*/	function (e,f) {
		f.v.j = 0;
		f.v._k166 = e.enumkeys ((f.v.tr).childNodes);
	},
	function (e,f) { if (!((f.v._k166).length)) f.pc=23; },
	function (e,f) {
		f.v._i167 = (f.v._k166).shift();
		f.v.td = ((f.v.tr).childNodes)[(f.v._i167)];
		if ((((f.v.td).nodeType)) == ((1))) f.pc=37; else f.pc=38;
	},
	function (e,f) { if (((f.v.j)) == ((f.v.x))) f.pc=29; else f.pc=36; },
	function (e,f) { e.mcall (4, (f.v["this"]).richtextobj, "make_node", (["td", null])); },
/*30*/	function (e,f) {
		var t2666 = f.s[0]; f.v.td_node = t2666;
		e.mcall (3, document, "createTextNode", (["type here"]));
	},
	function (e,f) { var t2667 = f.s[0]; e.mcall (3, f.v.td_node, "appendChild", ([t2667])); },
	function (e,f) { if (((f.v.choice)) == (("Insert column after"))) f.pc=33; else f.pc=34; },
	function (e,f) {
		f.pc=35;
		e.mcall (4, f.v.tr, "insertBefore", ([f.v.td_node, (f.v.td).nextSibling]));
	},
	function (e,f) { e.mcall (4, f.v.tr, "insertBefore", ([f.v.td_node, f.v.td])); },
/*35*/	function (e,f) { f.pc=23; },
	function (e,f) {
		f.pc=26;
		e.php_push_var_lvalue (0, "j");
		e.php_postinc (1);
	},
	function (e,f) {
		f.pc=39;
		f.s[0] = ((builtin__strtolower ((f.v.td).tagName))) == (("td"));
	},
	function (e,f) { f.s[0] = false; },
	function (e,f) { var t2669 = f.s[0]; if (t2669) f.pc=28; else f.pc=26; },
/*40*/	function (e,f) {
		f.pc=42;
		f.s[0] = ((builtin__strtolower ((f.v.tr).tagName))) == (("tr"));
	},
	function (e,f) { f.s[0] = false; },
	function (e,f) { var t2670 = f.s[0]; if (t2670) f.pc=25; else f.pc=23; },
	function (e,f) { if (((f.v.choice)) == (("Delete column"))) f.pc=44; else f.pc=63; },
	function (e,f) {
		f.pc=46;
		e.smcall (1, popupokcancel,"run", ([("Really delete column ") + ("" + (parseInt((f.v.x),10) + parseInt((1),10)) + ("?"))]));
	},
/*45*/	function (e,f) { f.pc=-1; },
	function (e,f) {
		var t2671 = f.s[0]; 
		if (!(t2671)) f.pc=45; else f.pc=47;
	},
	function (e,f) { f.v._k168 = e.enumkeys ((f.v.tbody_node).childNodes); },
	function (e,f) { if (!((f.v._k168).length)) f.pc=-1; },
	function (e,f) {
		f.v._i169 = (f.v._k168).shift();
		f.v.tr = ((f.v.tbody_node).childNodes)[(f.v._i169)];
		if ((((f.v.tr).nodeType)) == ((1))) f.pc=60; else f.pc=61;
	},
/*50*/	function (e,f) {
		f.v.j = 0;
		f.v._k170 = e.enumkeys ((f.v.tr).childNodes);
	},
	function (e,f) { if (!((f.v._k170).length)) f.pc=48; },
	function (e,f) {
		f.v._i171 = (f.v._k170).shift();
		f.v.td = ((f.v.tr).childNodes)[(f.v._i171)];
		if ((((f.v.td).nodeType)) == ((1))) f.pc=57; else f.pc=58;
	},
	function (e,f) { if (((f.v.j)) == ((f.v.x))) f.pc=54; else f.pc=56; },
	function (e,f) { e.mcall (3, (f.v.td).parentNode, "removeChild", ([f.v.td])); },
/*55*/	function (e,f) { f.pc=48; },
	function (e,f) {
		f.pc=51;
		e.php_push_var_lvalue (0, "j");
		e.php_postinc (1);
	},
	function (e,f) {
		f.pc=59;
		f.s[0] = ((builtin__strtolower ((f.v.td).tagName))) == (("td"));
	},
	function (e,f) { f.s[0] = false; },
	function (e,f) { var t2680 = f.s[0]; if (t2680) f.pc=53; else f.pc=51; },
/*60*/	function (e,f) {
		f.pc=62;
		f.s[0] = ((builtin__strtolower ((f.v.tr).tagName))) == (("tr"));
	},
	function (e,f) { f.s[0] = false; },
	function (e,f) { var t2681 = f.s[0]; if (t2681) f.pc=50; else f.pc=48; },
	function (e,f) { if (((f.v.choice)) == (("Insert row after"))) f.pc=86; else f.pc=87; },
	function (e,f) { e.mcall (4, (f.v["this"]).richtextobj, "make_node", (["tr", null])); },
/*65*/	function (e,f) {
		var t2683 = f.s[0]; f.v.new_tr_node = t2683;
		f.v._k172 = e.enumkeys ((f.v.tr_node).childNodes);
	},
	function (e,f) {
		f.pc=68;
		if (!((f.v._k172).length)) f.pc=67;
	},
	function (e,f) { if (((f.v.choice)) == (("Insert row after"))) f.pc=76; else f.pc=77; },
	function (e,f) {
		f.v._i173 = (f.v._k172).shift();
		f.v.td = ((f.v.tr_node).childNodes)[(f.v._i173)];
		if ((((f.v.td).nodeType)) == ((1))) f.pc=73; else f.pc=74;
	},
	function (e,f) { e.mcall (4, (f.v["this"]).richtextobj, "make_node", (["td", null])); },
/*70*/	function (e,f) {
		var t2688 = f.s[0]; f.v.new_td_node = t2688;
		e.mcall (3, document, "createTextNode", (["type here"]));
	},
	function (e,f) { var t2689 = f.s[0]; e.mcall (3, f.v.new_td_node, "appendChild", ([t2689])); },
	function (e,f) {
		f.pc=66;
		e.mcall (3, f.v.new_tr_node, "appendChild", ([f.v.new_td_node]));
	},
	function (e,f) {
		f.pc=75;
		f.s[0] = ((builtin__strtolower ((f.v.td).tagName))) == (("td"));
	},
	function (e,f) { f.s[0] = false; },
/*75*/	function (e,f) { var t2690 = f.s[0]; if (t2690) f.pc=69; else f.pc=66; },
	function (e,f) {
		f.pc=-1;
		e.mcall (4, (f.v.tr_node).parentNode, "insertBefore", ([f.v.new_tr_node, (f.v.tr_node).nextSibling]));
	},
	function (e,f) {
		f.pc=-1;
		e.mcall (4, (f.v.tr_node).parentNode, "insertBefore", ([f.v.new_tr_node, f.v.tr_node]));
	},
	function (e,f) { if (((f.v.choice)) == (("Delete row"))) f.pc=79; else f.pc=83; },
	function (e,f) {
		f.pc=81;
		e.smcall (1, popupokcancel,"run", ([("Really delete row ") + ("" + (parseInt((f.v.y),10) + parseInt((1),10)) + ("?"))]));
	},
/*80*/	function (e,f) { f.pc=-1; },
	function (e,f) {
		var t2691 = f.s[0]; 
		if (!(t2691)) f.pc=80; else f.pc=82;
	},
	function (e,f) {
		f.pc=-1;
		e.mcall (3, (f.v.tr_node).parentNode, "removeChild", ([f.v.tr_node]));
	},
	function (e,f) { if (((f.v.choice)) == (("Properties"))) f.pc=84; else f.pc=-1; },
	function (e,f) { e.mcall (3, (f.v["this"]).richtextobj, "obj_from_node", ([f.v.table_node])); },
/*85*/	function (e,f) {
		f.pc=-1;
		var t2693 = f.s[0]; f.v.obj = t2693;
		e.mcall (3, f.v.obj, "edit_object_properties_dialog", ([f.v.table_node]));
	},
	function (e,f) {
		f.pc=88;
		f.s[0] = true;
	},
	function (e,f) { f.s[0] = ((f.v.choice)) == (("Insert row before")); },
	function (e,f) { var t2694 = f.s[0]; if (t2694) f.pc=64; else f.pc=78; },
	function (e,f) {
		f.pc=91;
		f.s[0] = true;
	},
/*90*/	function (e,f) { f.s[0] = ((f.v.choice)) == (("Insert column before")); },
	function (e,f) { var t2695 = f.s[0]; if (t2695) f.pc=22; else f.pc=43; },
null	];

;
	c.args__auto_import = c.pargs__auto_import =  ["richtextobj","node"];
	c.inst__auto_import = c.pinst__auto_import =  [
/*0*/	function (e,f) { if (((builtin__strtolower ((f.v.node).tagName))) == (("td"))) f.pc=1; else f.pc=3; },
	function (e,f) { e.smcall (3, richtext_node_td,"create", ([f.v.richtextobj, "td", null])); },
	function (e,f) { var t2696 = f.s[0]; e.return_pop (t2696); },
	function (e,f) { e.return_pop (null); },
null	];

;
};
richtext_node_td.init_methods (richtext_node_td);
rpcclass.setup_class (richtext_node_td, "richtext_node_td",0, (["richtextobj","props","listeners"]), ([0,0,2]));
function richtext_node_ol () { this.do_construct (arguments); }
richtext_node_ol.init_methods = function (c) {
	richtext_node.init_methods(c);
	var cp = c.prototype;
	c.args__xml_tag = c.pargs__xml_tag =  [];
	c.inst__xml_tag = c.pinst__xml_tag =  [
/*0*/	function (e,f) { e.return_pop ("ol"); },
null	];

;
	c.pargs__needs_content =  [];
	c.pinst__needs_content =  [
/*0*/	function (e,f) { e.return_pop (true); },
null	];

;
	c.args__get_children = c.pargs__get_children =  [];
	c.inst__get_children = c.pinst__get_children =  [
/*0*/	function (e,f) { e.return_pop ((["li"])); },
null	];

;
	c.args__auto_import = c.pargs__auto_import =  ["richtextobj","node"];
	c.inst__auto_import = c.pinst__auto_import =  [
/*0*/	function (e,f) { if (((builtin__strtolower ((f.v.node).tagName))) == (("ol"))) f.pc=1; else f.pc=3; },
	function (e,f) { e.smcall (3, richtext_node_ol,"create", ([f.v.richtextobj, "ol", null])); },
	function (e,f) { var t2697 = f.s[0]; e.return_pop (t2697); },
	function (e,f) { e.return_pop (null); },
null	];

;
};
richtext_node_ol.init_methods (richtext_node_ol);
rpcclass.setup_class (richtext_node_ol, "richtext_node_ol",0, (["richtextobj","props","listeners"]), ([0,0,2]));
function richtext_node_ul () { this.do_construct (arguments); }
richtext_node_ul.init_methods = function (c) {
	richtext_node.init_methods(c);
	var cp = c.prototype;
	c.args__xml_tag = c.pargs__xml_tag =  [];
	c.inst__xml_tag = c.pinst__xml_tag =  [
/*0*/	function (e,f) { e.return_pop ("ul"); },
null	];

;
	c.pargs__needs_content =  [];
	c.pinst__needs_content =  [
/*0*/	function (e,f) { e.return_pop (true); },
null	];

;
	c.args__get_children = c.pargs__get_children =  [];
	c.inst__get_children = c.pinst__get_children =  [
/*0*/	function (e,f) { e.return_pop ((["li"])); },
null	];

;
	c.args__auto_import = c.pargs__auto_import =  ["richtextobj","node"];
	c.inst__auto_import = c.pinst__auto_import =  [
/*0*/	function (e,f) { if (((builtin__strtolower ((f.v.node).tagName))) == (("ul"))) f.pc=1; else f.pc=3; },
	function (e,f) { e.smcall (3, richtext_node_ul,"create", ([f.v.richtextobj, "ul", null])); },
	function (e,f) { var t2698 = f.s[0]; e.return_pop (t2698); },
	function (e,f) { e.return_pop (null); },
null	];

;
	c.args__insert_ul = c.pargs__insert_ul =  ["richtextobj","arg"];
	c.inst__insert_ul = c.pinst__insert_ul =  [
/*0*/	function (e,f) { e.mcall (2, f.v.richtextobj, "get_selection_as_text", ([])); },
	function (e,f) {
		var t2700 = f.s[0]; f.v.content = t2700;
		if (((builtin__trim (f.v.content))) == ((""))) f.pc=2; else f.pc=3;
	},
	function (e,f) { f.v.content = "type here"; },
	function (e,f) { e.mcall (4, f.v.richtextobj, "make_node", (["ul", null])); },
	function (e,f) {
		var t2703 = f.s[0]; f.v.ulnode = t2703;
		e.mcall (4, f.v.richtextobj, "make_node", (["li", null]));
	},
/*5*/	function (e,f) {
		var t2705 = f.s[0]; f.v.linode = t2705;
		e.mcall (3, f.v.ulnode, "appendChild", ([f.v.linode]));
	},
	function (e,f) { e.mcall (3, document, "createTextNode", ([f.v.content])); },
	function (e,f) { var t2706 = f.s[0]; e.mcall (3, f.v.linode, "appendChild", ([t2706])); },
	function (e,f) { e.mcall (3, f.v.richtextobj, "replace_selection_with_raw_node", ([f.v.ulnode])); },
null	];

;
};
richtext_node_ul.init_methods (richtext_node_ul);
rpcclass.setup_class (richtext_node_ul, "richtext_node_ul",0, (["richtextobj","props","listeners"]), ([0,0,2]));
function richtext_node_li () { this.do_construct (arguments); }
richtext_node_li.init_methods = function (c) {
	richtext_node.init_methods(c);
	var cp = c.prototype;
	c.args__xml_tag = c.pargs__xml_tag =  [];
	c.inst__xml_tag = c.pinst__xml_tag =  [
/*0*/	function (e,f) { e.return_pop ("li"); },
null	];

;
	c.args__get_children = c.pargs__get_children =  [];
	c.inst__get_children = c.pinst__get_children =  [
/*0*/	function (e,f) { e.return_pop ((["%ftext"])); },
null	];

;
	c.args__auto_import = c.pargs__auto_import =  ["richtextobj","node"];
	c.inst__auto_import = c.pinst__auto_import =  [
/*0*/	function (e,f) { if (((builtin__strtolower ((f.v.node).tagName))) == (("li"))) f.pc=1; else f.pc=3; },
	function (e,f) { e.smcall (3, richtext_node_li,"create", ([f.v.richtextobj, "li", null])); },
	function (e,f) { var t2707 = f.s[0]; e.return_pop (t2707); },
	function (e,f) { e.return_pop (null); },
null	];

;
};
richtext_node_li.init_methods (richtext_node_li);
rpcclass.setup_class (richtext_node_li, "richtext_node_li",0, (["richtextobj","props","listeners"]), ([0,0,2]));
function richtext_node_link () { this.do_construct (arguments); }
richtext_node_link.init_methods = function (c) {
	richtext_configurable_node.init_methods(c);
	var cp = c.prototype;
	c.args__xml_tag = c.pargs__xml_tag =  [];
	c.inst__xml_tag = c.pinst__xml_tag =  [
/*0*/	function (e,f) { e.return_pop ("link"); },
null	];

;
	c.pargs__edtag =  [];
	c.pinst__edtag =  [
/*0*/	function (e,f) { e.return_pop ("span"); },
null	];

;
	c.pargs__attrs =  [];
	c.pinst__attrs =  [
/*0*/	function (e,f) { e.return_pop (({style:"color:blue;text-decoration:underline"})); },
null	];

;
	c.pargs__needs_content =  [];
	c.pinst__needs_content =  [
/*0*/	function (e,f) { e.return_pop (true); },
null	];

;
	c.args__can_unformat = c.pargs__can_unformat =  [];
	c.inst__can_unformat = c.pinst__can_unformat =  [
/*0*/	function (e,f) { e.return_pop (true); },
null	];

;
	c.pargs__get_fields =  [];
	c.pinst__get_fields =  [
/*0*/	function (e,f) { e.return_pop (([({type:"text", name:"href", label:"Address"}), ({type:"yesno", name:"newwindow", label:"Open in new window"})])); },
null	];

;
	c.args__get_children = c.pargs__get_children =  [];
	c.inst__get_children = c.pinst__get_children =  [
/*0*/	function (e,f) { e.return_pop ((["!text"])); },
null	];

;
	c.args__auto_import = c.pargs__auto_import =  ["richtextobj","node"];
	c.inst__auto_import = c.pinst__auto_import =  [
/*0*/	function (e,f) { if (((builtin__strtolower ((f.v.node).tagName))) == (("a"))) f.pc=1; else f.pc=12; },
	function (e,f) { e.mcall (3, f.v.node, "getAttribute", (["href"])); },
	function (e,f) {
		var t2709 = f.s[0]; f.v.href = t2709;
		if (((builtin__substr (f.v.href,0,5))) == (("http:"))) f.pc=9; else f.pc=10;
	},
	function (e,f) {
		f.pc=6;
		f.s[0] = "_blank";
		e.mcall (4, f.v.node, "getAttribute", (["target"]));
	},
	function (e,f) {
		f.pc=7;
		f.s[0] = "1";
	},
/*5*/	function (e,f) {
		f.pc=7;
		f.s[0] = "0";
	},
	function (e,f) {
		var t2710 = f.s[1]; var t2711 = f.s[0]; 
		if (((t2710)) == ((t2711))) f.pc=4; else f.pc=5;
	},
	function (e,f) {
		var t2713 = f.s[0]; f.v.newwindow = t2713;
		e.smcall (3, richtext_node_link,"create", ([f.v.richtextobj, "link", ({href:f.v.href, newwindow:f.v.newwindow})]));
	},
	function (e,f) { var t2714 = f.s[0]; e.return_pop (t2714); },
	function (e,f) {
		f.pc=11;
		f.s[0] = true;
	},
/*10*/	function (e,f) { f.s[0] = ((builtin__substr (f.v.href,0,6))) == (("https:")); },
	function (e,f) { var t2715 = f.s[0]; if (t2715) f.pc=3; else f.pc=12; },
	function (e,f) { e.return_pop (null); },
null	];

;
	c.args__insert_link = c.pargs__insert_link =  ["richtextobj","arg"];
	c.inst__insert_link = c.pinst__insert_link =  [
/*0*/	function (e,f) { e.mcall (2, f.v.richtextobj, "get_selection_as_text", ([])); },
	function (e,f) {
		var t2717 = f.s[0]; f.v.content = t2717;
		if (((f.v.content)) == ((""))) f.pc=2; else f.pc=3;
	},
	function (e,f) { f.v.content = "link"; },
	function (e,f) { e.mcall (2, f.v.richtextobj, "save_bookmark", ([])); },
	function (e,f) {
		var t2720 = f.s[0]; f.v.bm = t2720;
		e.smcall (4, popupeditbox,"run", ([0, 0, "Web Address", "http://"]));
	},
/*5*/	function (e,f) {
		var t2722 = f.s[0]; f.v.href = t2722;
		e.mcall (3, f.v.richtextobj, "restore_bookmark", ([f.v.bm]));
	},
	function (e,f) { e.mcall (5, f.v.richtextobj, "replace_selection_with_node", (["link", ({href:f.v.href}), f.v.content])); },
null	];

;
	c.args__insert_ilink = c.pargs__insert_ilink =  ["richtextobj","arg"];
	c.inst__insert_ilink = c.pinst__insert_ilink =  [
/*0*/	function (e,f) { e.mcall (2, f.v.richtextobj, "get_selection_as_text", ([])); },
	function (e,f) {
		var t2724 = f.s[0]; f.v.content = t2724;
		if (((f.v.content)) == ((""))) f.pc=2; else f.pc=3;
	},
	function (e,f) { f.v.content = f.v.arg; },
	function (e,f) { e.mcall (5, f.v.richtextobj, "replace_selection_with_node", (["link", ({href:f.v.arg}), f.v.content])); },
null	];

;
};
richtext_node_link.init_methods (richtext_node_link);
rpcclass.setup_class (richtext_node_link, "richtext_node_link",0, (["richtextobj","props","listeners"]), ([0,0,2]));
function richtext_node_mail () { this.do_construct (arguments); }
richtext_node_mail.init_methods = function (c) {
	richtext_configurable_node.init_methods(c);
	var cp = c.prototype;
	c.args__xml_tag = c.pargs__xml_tag =  [];
	c.inst__xml_tag = c.pinst__xml_tag =  [
/*0*/	function (e,f) { e.return_pop ("mail"); },
null	];

;
	c.pargs__edtag =  [];
	c.pinst__edtag =  [
/*0*/	function (e,f) { e.return_pop ("span"); },
null	];

;
	c.pargs__attrs =  [];
	c.pinst__attrs =  [
/*0*/	function (e,f) { e.return_pop (({style:"color:blue;text-decoration:underline"})); },
null	];

;
	c.pargs__needs_content =  [];
	c.pinst__needs_content =  [
/*0*/	function (e,f) { e.return_pop (true); },
null	];

;
	c.args__can_unformat = c.pargs__can_unformat =  [];
	c.inst__can_unformat = c.pinst__can_unformat =  [
/*0*/	function (e,f) { e.return_pop (true); },
null	];

;
	c.pargs__get_fields =  [];
	c.pinst__get_fields =  [
/*0*/	function (e,f) { e.return_pop (([({type:"text", name:"addr", label:"Address"}), ({type:"text", name:"subject", label:"Subject"})])); },
null	];

;
	c.args__get_children = c.pargs__get_children =  [];
	c.inst__get_children = c.pinst__get_children =  [
/*0*/	function (e,f) { e.return_pop ((["!text"])); },
null	];

;
	c.args__auto_import = c.pargs__auto_import =  ["richtextobj","node"];
	c.inst__auto_import = c.pinst__auto_import =  [
/*0*/	function (e,f) { if (((builtin__strtolower ((f.v.node).tagName))) == (("a"))) f.pc=1; else f.pc=5; },
	function (e,f) { e.mcall (3, f.v.node, "getAttribute", (["href"])); },
	function (e,f) {
		var t2727 = f.s[0]; f.v.href = t2727;
		if (((builtin__substr (f.v.href,0,7))) == (("mailto:"))) f.pc=3; else f.pc=5;
	},
	function (e,f) { e.smcall (3, richtext_node_mail,"create", ([f.v.richtextobj, "mail", ({addr:builtin__substr (f.v.href,7), subject:""})])); },
	function (e,f) { var t2728 = f.s[0]; e.return_pop (t2728); },
/*5*/	function (e,f) { e.return_pop (null); },
null	];

;
	c.args__insert_mail = c.pargs__insert_mail =  ["richtextobj","arg"];
	c.inst__insert_mail = c.pinst__insert_mail =  [
/*0*/	function (e,f) { e.mcall (2, f.v.richtextobj, "get_selection_as_text", ([])); },
	function (e,f) {
		var t2730 = f.s[0]; f.v.sel = t2730;
		if (((f.v.sel)) != ((""))) f.pc=2; else f.pc=6;
	},
	function (e,f) { if (builtin__preg_match ("/@/",f.v.sel)) f.pc=3; else f.pc=4; },
	function (e,f) {
		f.pc=5;
		f.v.addr = f.v.sel;
	},
	function (e,f) { f.v.addr = "person@mail.com"; },
/*5*/	function (e,f) {
		f.pc=7;
		f.v.name = f.v.sel;
	},
	function (e,f) {
		f.v.name = "Name";
		f.v.addr = "person@mail.com";
	},
	function (e,f) { e.mcall (5, f.v.richtextobj, "replace_selection_with_node", (["mail", ({addr:f.v.addr}), f.v.name])); },
null	];

;
};
richtext_node_mail.init_methods (richtext_node_mail);
rpcclass.setup_class (richtext_node_mail, "richtext_node_mail",0, (["richtextobj","props","listeners"]), ([0,0,2]));
function richtext_node_img () { this.do_construct (arguments); }
richtext_node_img.init_methods = function (c) {
	richtext_configurable_leaf_node.init_methods(c);
	var cp = c.prototype;
	c.args__xml_tag = c.pargs__xml_tag =  [];
	c.inst__xml_tag = c.pinst__xml_tag =  [
/*0*/	function (e,f) { e.return_pop ("img"); },
null	];

;
	c.pargs__edtag =  [];
	c.pinst__edtag =  [
/*0*/	function (e,f) { e.return_pop ("img"); },
null	];

;
	c.pargs__attrs =  [];
	c.pinst__attrs =  [
/*0*/	function (e,f) {
		f.v.cls = "" + (((f.v["this"]).props).align) + ("image");
		e.mcall (3, ((f.v["this"]).richtextobj).renderer, "expand_url", ([((f.v["this"]).props).page]));
	},
	function (e,f) {
		var t2738 = f.s[0]; f.v.src = t2738;
		f.v.style = "";
		if ((((f.v["this"]).props).width) !== undefined) f.pc=3; else f.pc=4;
	},
	function (e,f) {
		f.pc=6;
		f.v.style = "" + (f.v.style) + (("width:") + ("" + (((f.v["this"]).props).width) + (";")));
	},
	function (e,f) {
		f.pc=5;
		f.s[0] = ((((f.v["this"]).props).width)) != ((""));
	},
	function (e,f) { f.s[0] = false; },
/*5*/	function (e,f) { var t2741 = f.s[0]; if (t2741) f.pc=2; else f.pc=6; },
	function (e,f) { if ((((f.v["this"]).props).height) !== undefined) f.pc=8; else f.pc=9; },
	function (e,f) {
		f.pc=11;
		f.v.style = "" + (f.v.style) + (("height:") + ("" + (((f.v["this"]).props).height) + (";")));
	},
	function (e,f) {
		f.pc=10;
		f.s[0] = ((((f.v["this"]).props).height)) != ((""));
	},
	function (e,f) { f.s[0] = false; },
/*10*/	function (e,f) { var t2743 = f.s[0]; if (t2743) f.pc=7; else f.pc=11; },
	function (e,f) { e.return_pop (({"class":f.v.cls, src:f.v.src, style:f.v.style})); },
null	];

;
	c.pargs__get_fields =  [];
	c.pinst__get_fields =  [
/*0*/	function (e,f) { e.return_pop (([({type:"list", options:(["left", "right"]), name:"align", label:"Align"}), ({type:"text", name:"width", label:"Width"}), ({type:"text", name:"height", label:"Height"})])); },
null	];

;
	c.args__auto_import = c.pargs__auto_import =  ["richtextobj","node"];
	c.inst__auto_import = c.pinst__auto_import =  [
/*0*/	function (e,f) { if (((builtin__strtolower ((f.v.node).tagName))) == (("img"))) f.pc=1; else f.pc=4; },
	function (e,f) { e.mcall (3, f.v.node, "getAttribute", (["src"])); },
	function (e,f) {
		var t2745 = f.s[0]; f.v.src = t2745;
		e.smcall (3, richtext_node_img,"create", ([f.v.richtextobj, "img", ({page:f.v.src})]));
	},
	function (e,f) { var t2746 = f.s[0]; e.return_pop (t2746); },
	function (e,f) { e.return_pop (null); },
null	];

;
	c.args__insert_image = c.pargs__insert_image =  ["richtextobj","page"];
	c.inst__insert_image = c.pinst__insert_image =  [
/*0*/	function (e,f) { if (((f.v.page)) === ((null))) f.pc=1; else f.pc=6; },
	function (e,f) { e.mcall (2, f.v.richtextobj, "save_bookmark", ([])); },
	function (e,f) {
		var t2748 = f.s[0]; f.v.bm = t2748;
		e.mcall (2, f.v.richtextobj, "image_picker", ([]));
	},
	function (e,f) {
		var t2750 = f.s[0]; f.v.page = t2750;
		e.mcall (3, f.v.richtextobj, "restore_bookmark", ([f.v.bm]));
	},
	function (e,f) { if (((f.v.page)) === ((null))) f.pc=5; else f.pc=6; },
/*5*/	function (e,f) { f.pc=-1; },
	function (e,f) { e.mcall (5, f.v.richtextobj, "replace_selection_with_node", (["img", ({page:f.v.page, align:"left"}), null])); },
null	];

;
};
richtext_node_img.init_methods (richtext_node_img);
rpcclass.setup_class (richtext_node_img, "richtext_node_img",0, (["richtextobj","props","listeners"]), ([0,0,2]));
function richtext_editor () { this.do_construct (arguments); }
richtext_editor.codegroup = "richtext_editor";
richtext_editor.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
	c.pargs__in_group =  null;
	c.pargs__make_node =  null;
	c.pargs__obj_from_node =  null;
	c.pargs__replace_selection_with_html =  null;
	c.pargs__replace_selection_with_raw_node =  null;
	c.pargs__replace_selection_with_node =  null;
	c.pargs__replace_node =  null;
	c.pargs__get_selection_as_text =  null;
	c.pargs__get_selection_as_html =  null;
	c.pargs__node_is_editable =  null;
	c.pargs__create_empty_text_node_at_insertion_point =  null;
	c.pargs__focus_on_text_node =  null;
	c.pargs__get_selection_nodes =  null;
	c.pargs__node_toString =  null;
	c.pargs__print_node =  null;
	c.pargs__dump_document_fragment =  null;
	c.pargs__range_as_string =  null;
	c.pargs__prune1 =  null;
	c.pargs__prune =  null;
	c.pargs__annotate_nodes1 =  null;
	c.pargs__merge_nodes1 =  null;
	c.pargs__normalize_nodes =  null;
	c.pargs__is_child =  null;
	c.pargs__node_in_range =  null;
	c.pargs__traverse =  null;
	c.pargs__walk =  null;
	c.args__child_index_of = c.pargs__child_index_of =  null;
	c.pargs__adjust_boundary =  null;
	c.pargs__fix_range_ends =  null;
	c.pargs__get_format_tag_node =  null;
	c.pargs__shallow_clone =  null;
	c.pargs__cut_out =  null;
	c.pargs__remove_tag =  null;
	c.pargs__remove_formatting =  null;
	c.pargs__find_node_with_valid_parent =  null;
	c.pargs__add_formatting =  null;
	c.pargs__record_text_node =  null;
	c.pargs__get_range_text_nodes =  null;
	c.pargs__unformat_nodes =  null;
	c.pargs__format_nodes =  null;
	c.pargs__tag_affects_all_nodes =  null;
	c.pargs__unformat =  null;
	c.pargs__toggle_formatting =  null;
	c.pargs__save_bookmark =  null;
	c.pargs__restore_bookmark =  null;
	c.pargs__insert_object =  null;
	c.pargs__timer10 =  null;
	c.pargs__button_click =  null;
	c.pargs__menubar_action =  null;
	c.pargs__fill_default_menubar =  null;
	c.pargs__add_menu_items =  null;
	c.pargs__load_menu =  null;
	c.pargs__editor_height =  null;
	c.pargs__find_first_nonempty_text_node =  null;
	c.pargs__run =  null;
	c.pargs__server_save =  null;
	c.pargs__finish =  null;
	c.pargs__presave =  null;
	c.pargs__close =  null;
	c.pargs__save_close =  null;
	c.pargs__reload =  null;
	c.pargs__cancel =  null;
};
richtext_editor.init_methods (richtext_editor);
rpcclass.setup_class (richtext_editor, "richtext_editor",0, (["el","epel","renderer","divid","need_select_all","pop","editable_html","it","groups","node_list","actions_list","monitor_list","text_node_list","listeners"]), ([2,2,0,0,0,2,0,2,0,0,0,0,2,2]));
function richtext () { this.do_construct (arguments); }
richtext.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
};
richtext.init_methods (richtext);
rpcclass.setup_class (richtext, "richtext",0, (["class_list","listeners"]), ([0,2]));
function simple_richtext_editor () { this.do_construct (arguments); }
simple_richtext_editor.codegroup = "richtext_editor";
simple_richtext_editor.init_methods = function (c) {
	richtext_editor.init_methods(c);
	var cp = c.prototype;
	c.pargs__get_buttons =  null;
	c.pargs__save =  null;
};
simple_richtext_editor.init_methods (simple_richtext_editor);
rpcclass.setup_class (simple_richtext_editor, "simple_richtext_editor",0, (["uniq","el","epel","renderer","divid","need_select_all","pop","editable_html","it","groups","node_list","actions_list","monitor_list","text_node_list","listeners"]), ([0,2,2,0,0,0,2,0,2,0,0,0,0,2,2]));
function hintedsearch () { this.do_construct (arguments); }
hintedsearch.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
	c.pargs__render_search_options =  [];
	c.pinst__render_search_options =  [
/*0*/	function (e,f) { /* This is a NOP */ },
null	];

;
	c.pargs__get_search_options =  ["sfobj"];
	c.pinst__get_search_options =  [
/*0*/	function (e,f) { e.return_pop (null); },
null	];

;
	c.pargs__search_form_id =  [];
	c.pinst__search_form_id =  [
/*0*/	function (e,f) { e.mcall (2, f.v["this"], "get_id", ([])); },
	function (e,f) {
		var t3141 = f.s[0]; 
		e.return_pop (("search_form_") + (t3141));
	},
null	];

;
	c.pargs__search_results_id =  [];
	c.pinst__search_results_id =  [
/*0*/	function (e,f) { e.mcall (2, f.v["this"], "get_id", ([])); },
	function (e,f) {
		var t3142 = f.s[0]; 
		e.return_pop (("search_results_") + (t3142));
	},
null	];

;
	c.pargs__form =  [];
	c.pinst__form =  [
/*0*/	function (e,f) { e.mcall (2, f.v["this"], "search_form_id", ([])); },
	function (e,f) { var t3143 = f.s[0]; e.mcall (3, document, "getElementById", ([t3143])); },
	function (e,f) { var t3144 = f.s[0]; e.return_pop (t3144); },
null	];

;
	c.pargs__search_box_id =  [];
	c.pinst__search_box_id =  [
/*0*/	function (e,f) { e.mcall (2, f.v["this"], "get_id", ([])); },
	function (e,f) {
		var t3145 = f.s[0]; 
		e.return_pop (("search_box_") + (t3145));
	},
null	];

;
	c.pargs__search_box =  [];
	c.pinst__search_box =  [
/*0*/	function (e,f) { e.mcall (2, f.v["this"], "search_box_id", ([])); },
	function (e,f) { var t3146 = f.s[0]; e.mcall (3, document, "getElementById", ([t3146])); },
	function (e,f) { var t3147 = f.s[0]; e.return_pop (t3147); },
null	];

;
	c.pargs__tick =  ["el","arg","ev"];
	c.pinst__tick =  [
/*0*/	function (e,f) { e.mcall (2, f.v["this"], "search_box", ([])); },
	function (e,f) {
		var t3149 = f.s[0]; f.v.obj = t3149;
		if (((f.v.obj)) === ((null))) f.pc=2; else f.pc=3;
	},
	function (e,f) { f.pc=-1; },
	function (e,f) {
		f.v.val = (f.v.obj).value;
		if ((((f.v["this"]).searchval)) != ((f.v.val))) f.pc=4; else f.pc=-1;
	},
	function (e,f) {
		f.v["this"].searchval = f.v.val;
		if (!((f.v["this"]).allow_empty)) f.pc=10; else f.pc=11;
	},
/*5*/	function (e,f) {
		f.pc=13;
		f.v["this"].unique_result = null;
		f.v.html = "";
	},
	function (e,f) { e.mcall (2, f.v["this"], "form", ([])); },
	function (e,f) {
		var t3155 = f.s[0]; f.v.sfobj = t3155;
		e.mcall (3, f.v["this"], "get_search_options", ([f.v.sfobj]));
	},
	function (e,f) {
		var t3157 = f.s[0]; f.v.opts = t3157;
		e.mcall (4, f.v["this"], "hint", ([(f.v["this"]).searchval, f.v.opts]));
	},
	function (e,f) {
		f.pc=13;
		var t3159 = f.s[0]; f.v.hint = t3159;
		f.v["this"].unique_result = (f.v.hint)[(0)];
		f.v.html = (f.v.hint)[(1)];
	},
/*10*/	function (e,f) {
		f.pc=12;
		f.s[0] = ((builtin__trim ((f.v["this"]).searchval))) == ((""));
	},
	function (e,f) { f.s[0] = false; },
	function (e,f) { var t3162 = f.s[0]; if (t3162) f.pc=5; else f.pc=6; },
	function (e,f) { e.mcall (2, f.v["this"], "search_results_id", ([])); },
	function (e,f) { var t3163 = f.s[0]; e.mcall (3, document, "getElementById", ([t3163])); },
/*15*/	function (e,f) {
		var t3165 = f.s[0]; f.v.srobj = t3165;
		if (((f.v.srobj)) !== ((null))) f.pc=16; else f.pc=-1;
	},
	function (e,f) { f.v.srobj.innerHTML = ("<table><tbody>") + ("" + (f.v.html) + ("</tbody></table>")); },
null	];

;
	c.pargs__search_change =  ["el","arg","ev"];
	c.pinst__search_change =  [
/*0*/	function (e,f) { f.v["this"].searchval = "" + ((f.v["this"]).searchval) + (" "); },
null	];

;
	c.pargs__stop_tick =  [];
	c.pinst__stop_tick =  [
/*0*/	function (e,f) { e.mcall (3, f.v["this"], "stop_interval_timer", ([(f.v["this"]).timer_id])); },
null	];

;
	c.args__focus = c.pargs__focus =  ["el","me","ev"];
	c.inst__focus = c.pinst__focus =  [
/*0*/	function (e,f) { e.mcall (2, f.v.me, "search_box", ([])); },
	function (e,f) {
		var t3169 = f.s[0]; f.v.el = t3169;
		e.mcall (2, f.v.el, "focus", ([]));
	},
	function (e,f) { e.mcall (5, f.v.me, "start_interval_timer_callback", ([300, "tick", null])); },
	function (e,f) { var t3171 = f.s[0]; f.v.me.timer_id = t3171; },
null	];

;
	c.pargs__set_search =  ["str"];
	c.pinst__set_search =  [
/*0*/	function (e,f) { e.mcall (2, f.v["this"], "search_box", ([])); },
	function (e,f) {
		var t3173 = f.s[0]; f.v.el = t3173;
		f.v.el.value = f.v.str;
	},
null	];

;
	c.pargs__search_return =  ["el","arg","ev"];
	c.pinst__search_return =  [
/*0*/	function (e,f) { if ((((f.v["this"]).unique_result)) === ((null))) f.pc=1; else f.pc=2; },
	function (e,f) { f.pc=-1; },
	function (e,f) { e.mcall (5, f.v["this"], "open_record", ([null, (f.v["this"]).unique_result, null])); },
null	];

;
	c.pargs__search_title =  [];
	c.pinst__search_title =  [
/*0*/	function (e,f) { e.return_pop ("Search"); },
null	];

;
	c.pargs__render_form_extras =  [];
	c.pinst__render_form_extras =  [
/*0*/	function (e,f) { /* This is a NOP */ },
null	];

;
	c.pargs__render_search_helper =  ["classname","allow_empty"];
	c.pinst__render_search_helper =  [
/*0*/	function (e,f) {
		f.v["this"].allow_empty = f.v.allow_empty;
		f.s[0] = "</legend>";
		e.mcall (3, f.v["this"], "search_title", ([]));
	},
	function (e,f) {
		var t3176 = f.s[1]; var t3177 = f.s[0]; 
		window.__outbuffer += ("<fieldset style=\"padding:10px\"><legend>") + ("" + (t3176) + (t3177));
		e.mcall (2, f.v["this"], "render_form_extras", ([]));
	},
	function (e,f) {
		f.s[0] = "\">";
		e.mcall (5, f.v["this"], "render_start", (["search_return", null]));
	},
	function (e,f) {
		var t3178 = f.s[1]; var t3179 = f.s[0]; 
		f.s[0] = ("\" onsubmit=\"") + ("" + (t3178) + (t3179));
		e.mcall (3, f.v["this"], "search_form_id", ([]));
	},
	function (e,f) {
		var t3180 = f.s[1]; var t3181 = f.s[0]; 
		window.__outbuffer += ("<form id=\"") + ("" + (t3180) + (t3181));
		f.s[0] = "\" type=\"text\" />";
		e.mcall (3, f.v["this"], "search_box_id", ([]));
	},
/*5*/	function (e,f) {
		var t3182 = f.s[1]; var t3183 = f.s[0]; 
		window.__outbuffer += ("<input id=\"") + ("" + (t3182) + (t3183));
		e.mcall (2, f.v["this"], "render_search_options", ([]));
	},
	function (e,f) {
		window.__outbuffer += "</form>";
		f.s[0] = "\"></div>";
		e.mcall (3, f.v["this"], "search_results_id", ([]));
	},
	function (e,f) {
		var t3184 = f.s[1]; var t3185 = f.s[0]; 
		window.__outbuffer += ("<div class=\"") + ("" + (f.v.classname) + (("\" id=\"") + ("" + (t3184) + (t3185))));
		window.__outbuffer += "</fieldset>";
	},
null	];

;
	c.pargs__render_search =  ["classname","allow_empty"];
	c.pinst__render_search =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "render_search_helper", ([f.v.classname, f.v.allow_empty])); },
	function (e,f) { e.mcall (5, f.v["this"], "start_timeout_callback", ([100, "focus", f.v["this"]])); },
null	];

;
};
hintedsearch.init_methods (hintedsearch);
rpcclass.setup_class (hintedsearch, "hintedsearch",0, (["searchval","unique_result","allow_empty","timer_id","listeners"]), ([0,0,0,0,2]));
function webapp_page () { this.do_construct (arguments); }
webapp_page.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
	c.args__webapp_parm_fields = c.pargs__webapp_parm_fields =  [];
	c.inst__webapp_parm_fields = c.pinst__webapp_parm_fields =  [
/*0*/	function (e,f) { e.return_pop (([])); },
null	];

;
	c.args__webapp_page_id = c.pargs__webapp_page_id =  ["cname","args"];
	c.inst__webapp_page_id = c.pinst__webapp_page_id =  [
/*0*/	function (e,f) {
		f.v.normarg = ([]);
		f.s[0] = ([]);
		f.s[1] = ([f.v.cname, "webapp_parm_fields"]);
		e.php_builtin (2, "call_user_func_array", 2);
	},
	function (e,f) {
		var t3188 = f.s[0]; f.v.pf = t3188;
		f.v._k198 = e.enumkeys (f.v.pf);
	},
	function (e,f) {
		f.pc=4;
		if (!((f.v._k198).length)) f.pc=3;
	},
	function (e,f) { e.return_pop ("" + (f.v.cname) + ((":") + (builtin__base64_encode (builtin__serialize (f.v.normarg))))); },
	function (e,f) {
		f.v._i199 = (f.v._k198).shift();
		f.v.pname = (f.v.pf)[(f.v._i199)];
		if (((f.v.args)[(f.v.pname)]) !== undefined) f.pc=5; else f.pc=6;
	},
/*5*/	function (e,f) {
		f.pc=7;
		f.s[0] = (f.v.args)[(f.v.pname)];
	},
	function (e,f) { f.s[0] = ""; },
	function (e,f) {
		f.pc=2;
		var t3193 = f.s[0]; f.v.normarg[f.v.normarg.length] = t3193;
	},
null	];

;
	c.args__get_or_create_from_id = c.pargs__get_or_create_from_id =  ["page_id"];
	c.inst__get_or_create_from_id = c.pinst__get_or_create_from_id =  [
/*0*/	function (e,f) {
		f.v.matches = ([]);
		if (!(builtin__preg_match ("/^([^:]+):(.*)/",f.v.page_id,f.v.matches))) f.pc=1; else f.pc=2;
	},
	function (e,f) {
		f.s[0] = builtin__alert (("Expected page_id to have a colon but it was ") + (f.v.page_id));
		f.pc=-1;
	},
	function (e,f) {
		f.pc=9;
		f.v.cname = (f.v.matches)[(1)];
		f.v.sargs = (f.v.matches)[(2)];
		e.smcall (2, rpcclass,"object_present", ([f.v.cname, f.v.page_id]));
	},
	function (e,f) {
		f.v.argv = builtin__unserialize (builtin__base64_decode (f.v.sargs));
		f.v.args = ({});
		f.s[0] = ([]);
		f.s[1] = ([f.v.cname, "webapp_parm_fields"]);
		e.php_builtin (2, "call_user_func_array", 2);
	},
	function (e,f) {
		var t3200 = f.s[0]; f.v.pf = t3200;
		f.v._k200 = e.enumkeys (f.v.pf);
	},
/*5*/	function (e,f) {
		f.pc=7;
		if (!((f.v._k200).length)) f.pc=6;
	},
	function (e,f) {
		f.pc=8;
		e.smcall (2, webapp,"create_page", ([f.v.cname, f.v.args]));
	},
	function (e,f) {
		f.pc=5;
		f.s[0] = f.v.i = (f.v._k200).shift();
		f.s[1] = f.v.pname = (f.v.pf)[(f.v.i)];
		f.v.args[f.v.pname] = (f.v.argv)[(f.v.i)];
	},
	function (e,f) {
		f.pc=10;
		var t3206 = f.s[0]; f.v.obj = t3206;
	},
	function (e,f) {
		var t3207 = f.s[0]; 
		if (!(t3207)) f.pc=3; else f.pc=10;
	},
/*10*/	function (e,f) { e.smcall (2, rpcclass,"get_object_by_id", ([f.v.cname, f.v.page_id])); },
	function (e,f) { var t3208 = f.s[0]; e.return_pop (t3208); },
null	];

;
	c.pargs__webapp_state_fields =  [];
	c.pinst__webapp_state_fields =  [
/*0*/	function (e,f) { e.return_pop (([])); },
null	];

;
	c.pargs__webapp_restore =  [];
	c.pinst__webapp_restore =  [
/*0*/	function (e,f) { /* This is a NOP */ },
null	];

;
	c.pargs__webapp_init =  [];
	c.pinst__webapp_init =  [
/*0*/	function (e,f) { /* This is a NOP */ },
null	];

;
	c.pargs__webapp_serialize_state =  [];
	c.pinst__webapp_serialize_state =  [
/*0*/	function (e,f) { e.mcall (2, f.v["this"], "webapp_state_fields", ([])); },
	function (e,f) {
		var t3210 = f.s[0]; f.v.fields = t3210;
		f.v.data = ([]);
		f.v._k202 = e.enumkeys (f.v.fields);
	},
	function (e,f) {
		f.pc=4;
		if (!((f.v._k202).length)) f.pc=3;
	},
	function (e,f) {
		f.v.sdata = builtin__serialize (f.v.data);
		e.return_pop (f.v.sdata);
	},
	function (e,f) {
		f.pc=2;
		f.s[0] = f.v._i203 = (f.v._k202).shift();
		f.s[1] = f.v.fname = (f.v.fields)[(f.v._i203)];
		f.v.data[f.v.data.length] = (f.v["this"])[(f.v.fname)];
	},
null	];

;
	c.pargs__webapp_jump =  ["args"];
	c.pinst__webapp_jump =  [
/*0*/	function (e,f) { e.smcall (2, webapp_page,"webapp_page_id", ([(f.v["this"]).classname, f.v.args])); },
	function (e,f) {
		var t3218 = f.s[0]; f.v.id = t3218;
		e.smcall (2, webapp,"create_page_hash", ([f.v.id, null]));
	},
	function (e,f) {
		var t3220 = f.s[0]; f.v.hash = t3220;
		e.smcall (1, webapp,"push", ([f.v.hash]));
	},
null	];

;
	c.pargs__webapp_save =  [];
	c.pinst__webapp_save =  [
/*0*/	function (e,f) { e.mcall (2, f.v["this"], "webapp_serialize_state", ([])); },
	function (e,f) { var t3222 = f.s[0]; f.v.sdata = t3222; },
null	];

;
	c.pargs__webapp_push =  [];
	c.pinst__webapp_push =  [
/*0*/	function (e,f) { e.mcall (2, f.v["this"], "webapp_serialize_state", ([])); },
	function (e,f) { e.mcall (3, f.v["this"], "get_id", ([])); },
	function (e,f) { e.php_static_method_call (2, webapp,"create_page_hash", 2); },
	function (e,f) {
		var t3226 = f.s[0]; f.v.hash = t3226;
		e.smcall (1, webapp,"push", ([f.v.hash]));
	},
null	];

;
	c.pargs__url =  [];
	c.pinst__url =  [
/*0*/	function (e,f) {
		f.s[0] = null;
		e.mcall (3, f.v["this"], "get_id", ([]));
	},
	function (e,f) { e.php_static_method_call (2, webapp,"url", 2); },
	function (e,f) { var t3229 = f.s[0]; e.return_pop (t3229); },
null	];

;
	c.pargs__render_ui_element =  ["id"];
	c.pinst__render_ui_element =  [
/*0*/	function (e,f) {
		f.v.handler = ("webapp_render_") + (f.v.id);
		if (builtin__method_exists (f.v["this"],f.v.handler)) f.pc=1; else f.pc=3;
	},
	function (e,f) { e.mcall (2, f.v["this"], f.v.handler, ([])); },
	function (e,f) { e.return_pop (true); },
	function (e,f) { e.return_pop (false); },
null	];

;
	c.pargs__rerender_ui_element =  ["id"];
	c.pinst__rerender_ui_element =  [
/*0*/	function (e,f) { e.mcall (3, document, "getElementById", ([("webapp_") + (f.v.id)])); },
	function (e,f) {
		var t3232 = f.s[0]; f.v.el = t3232;
		if (((f.v.el)) === ((null))) f.pc=2; else f.pc=3;
	},
	function (e,f) { f.s[0] = builtin__alert (("Strangely, ") + ("" + (f.v.id) + (" is not there"))); },
	function (e,f) {
		f.s[0] = builtin__ob_start ();
		e.mcall (3, f.v["this"], "render_ui_element", ([f.v.id]));
	},
	function (e,f) {
		var t3234 = f.s[0]; f.v.ok = t3234;
		f.v.html = builtin__ob_get_clean ();
		if (f.v.ok) f.pc=5; else f.pc=-1;
	},
/*5*/	function (e,f) { f.v.el.innerHTML = f.v.html; },
null	];

;
	c.pargs__webapp_pre_render =  [];
	c.pinst__webapp_pre_render =  [
/*0*/	function (e,f) { /* This is a NOP */ },
null	];

;
	c.pargs__rerender_page =  [];
	c.pinst__rerender_page =  [
/*0*/	function (e,f) { e.mcall (2, f.v["this"], "webapp_pre_render", ([])); },
	function (e,f) {
		e.php_push_static_var (0, webapp,"ui_fields");
		var t3237 = f.s[0]; 
		f.v._k204 = e.enumkeys (t3237);
	},
	function (e,f) { if (!((f.v._k204).length)) f.pc=-1; },
	function (e,f) {
		f.pc=2;
		f.s[0] = f.v._i205 = (f.v._k204).shift();
		e.php_push_static_var (2, webapp,"ui_fields");
		var t3240 = f.s[2]; 
		f.s[1] = f.v.id = (t3240)[(f.v._i205)];
		e.mcall (5, f.v["this"], "rerender_ui_element", ([f.v.id]));
	},
null	];

;
};
webapp_page.init_methods (webapp_page);
rpcclass.setup_class (webapp_page, "webapp_page",0, (["listeners"]), ([2]));
function webapp () { this.do_construct (arguments); }
webapp.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
	c.args__create_page_hash = c.pargs__create_page_hash =  ["id","state"];
	c.inst__create_page_hash = c.pinst__create_page_hash =  [
/*0*/	function (e,f) { e.return_pop (("pjapp/") + ("" + (f.v.id) + (("/") + (f.v.state)))); },
null	];

;
	c.args__url = c.pargs__url =  ["page_id"];
	c.inst__url = c.pinst__url =  [
/*0*/	function (e,f) { e.smcall (2, webapp,"create_page_hash", ([f.v.page_id, null])); },
	function (e,f) {
		var t3243 = f.s[0]; f.v.hash = t3243;
		e.php_push_static_var (0, webapp,"current_template");
		var t3244 = f.s[0]; 
		e.smcall (3, page_dispatcher,"makelink", (["webapp", "launch", ({hash:f.v.hash, template:t3244})]));
	},
	function (e,f) { var t3245 = f.s[0]; e.return_pop (t3245); },
null	];

;
	c.args__push = c.pargs__push =  ["newhash"];
	c.inst__push = c.pinst__push =  [
/*0*/	function (e,f) {
		f.s[0] = f.v.newhash;
		e.php_push_static_var_lvalue (1, webapp,"current_hash");
		e.php_assign (2);
		(document).location.hash = f.v.newhash;
		e.smcall (0, webapp,"rerender_page", ([]));
	},
null	];

;
	c.args__jump = c.pargs__jump =  ["cname","args"];
	c.inst__jump = c.pinst__jump =  [
/*0*/	function (e,f) { e.smcall (2, webapp_page,"webapp_page_id", ([f.v.cname, f.v.args])); },
	function (e,f) {
		var t3249 = f.s[0]; f.v.id = t3249;
		f.s[0] = builtin__debugout (("jump to new page ") + (f.v.id));
		e.smcall (2, webapp,"create_page_hash", ([f.v.id, null]));
	},
	function (e,f) {
		var t3251 = f.s[0]; f.v.hash = t3251;
		e.smcall (1, webapp,"push", ([f.v.hash]));
	},
null	];

;
	c.args__open = c.pargs__open =  ["el","hash","ev"];
	c.inst__open = c.pinst__open =  [
/*0*/	function (e,f) { e.smcall (1, webapp,"push", ([f.v.hash])); },
null	];

;
	c.args__render_hyperlink = c.pargs__render_hyperlink =  ["cname","args","text"];
	c.inst__render_hyperlink = c.pinst__render_hyperlink =  [
/*0*/	function (e,f) { e.smcall (2, webapp_page,"webapp_page_id", ([f.v.cname, f.v.args])); },
	function (e,f) {
		var t3253 = f.s[0]; f.v.page_id = t3253;
		f.s[0] = ("\">") + ("" + (builtin__htmlentities (f.v.text)) + ("</a>"));
		e.smcall (3, webapp,"create_page_hash", ([f.v.page_id, null]));
	},
	function (e,f) {
		f.s[2] = "open";
		f.s[3] = "webapp";
		e.php_static_method_call (4, webapp,"render_start_static", 3);
	},
	function (e,f) {
		var t3255 = f.s[1]; var t3256 = f.s[0]; 
		f.s[0] = ("\" onclick=\"") + ("" + (t3255) + (t3256));
		e.smcall (2, webapp,"url", ([f.v.page_id]));
	},
	function (e,f) {
		var t3257 = f.s[1]; var t3258 = f.s[0]; 
		window.__outbuffer += ("<a href=\"") + ("" + (t3257) + (t3258));
	},
null	];

;
	c.args__create_page_from_hash = c.pargs__create_page_from_hash =  ["hash"];
	c.inst__create_page_from_hash = c.pinst__create_page_from_hash =  [
/*0*/	function (e,f) {
		f.v.components = builtin__explode ("/",f.v.hash);
		if (((builtin__count (f.v.components))) != ((3))) f.pc=2; else f.pc=3;
	},
	function (e,f) { f.pc=-1; },
	function (e,f) {
		f.pc=4;
		f.s[0] = true;
	},
	function (e,f) { f.s[0] = (((f.v.components)[(0)])) != (("pjapp")); },
	function (e,f) { var t3260 = f.s[0]; if (t3260) f.pc=1; else f.pc=5; },
/*5*/	function (e,f) {
		f.v.page_id = (f.v.components)[(1)];
		f.v.state = (f.v.components)[(2)];
		e.smcall (1, webapp_page,"get_or_create_from_id", ([f.v.page_id]));
	},
	function (e,f) {
		var t3264 = f.s[0]; f.v.obj = t3264;
		e.mcall (2, f.v.obj, "webapp_state_fields", ([]));
	},
	function (e,f) {
		var t3266 = f.s[0]; f.v.fields = t3266;
		f.v.data = builtin__unserialize (f.v.state);
		f.v._k206 = e.enumkeys (f.v.fields);
	},
	function (e,f) {
		f.pc=10;
		if (!((f.v._k206).length)) f.pc=9;
	},
	function (e,f) {
		f.pc=14;
		e.mcall (2, f.v.obj, "webapp_restore", ([]));
	},
/*10*/	function (e,f) {
		f.v.i = (f.v._k206).shift();
		f.v.fname = (f.v.fields)[(f.v.i)];
		if (((f.v.data)) !== ((false))) f.pc=11; else f.pc=12;
	},
	function (e,f) {
		f.pc=13;
		f.s[0] = (f.v.data)[(f.v.i)];
	},
	function (e,f) { f.s[0] = ""; },
	function (e,f) {
		f.pc=8;
		var t3272 = f.s[0]; f.v.obj[f.v.fname] = t3272;
	},
	function (e,f) { e.return_pop (f.v.obj); },
null	];

;
	c.args__rerender_page = c.pargs__rerender_page =  [];
	c.inst__rerender_page = c.pinst__rerender_page =  [
/*0*/	function (e,f) {
		e.php_push_static_var (0, webapp,"current_hash");
		var t3274 = f.s[0]; f.v.hash = t3274;
		if (((f.v.hash)) == ((""))) f.pc=1; else f.pc=2;
	},
	function (e,f) {
		e.php_push_static_var (0, webapp,"default_hash");
		var t3276 = f.s[0]; f.v.hash = t3276;
	},
	function (e,f) { e.smcall (1, webapp,"create_page_from_hash", ([f.v.hash])); },
	function (e,f) {
		var t3278 = f.s[0]; f.v.page = t3278;
		f.s[0] = f.v.page;
		e.php_push_static_var_lvalue (1, webapp,"current_page");
		e.php_assign (2);
		e.mcall (2, f.v.page, "rerender_page", ([]));
	},
null	];

;
	c.pargs__poll =  ["el","arg","ev"];
	c.pinst__poll =  [
/*0*/	function (e,f) {
		f.v.hash = ((document).location).hash;
		if (((builtin__substr (f.v.hash,0,1))) == (("#"))) f.pc=1; else f.pc=2;
	},
	function (e,f) { f.v.hash = builtin__substr (f.v.hash,1); },
	function (e,f) {
		e.php_push_static_var (0, webapp,"current_hash");
		var t3282 = f.s[0]; 
		if (((f.v.hash)) != ((t3282))) f.pc=3; else f.pc=-1;
	},
	function (e,f) { if (((f.v.hash)) == ((""))) f.pc=4; else f.pc=5; },
	function (e,f) {
		f.pc=-1;
		e.smcall (2, browser,"reload", ([([]), ({})]));
	},
/*5*/	function (e,f) {
		f.s[0] = f.v.hash;
		e.php_push_static_var_lvalue (1, webapp,"current_hash");
		e.php_assign (2);
		e.smcall (0, webapp,"rerender_page", ([]));
	},
null	];

;
	c.args__create_page = c.pargs__create_page =  ["cname","args"];
	c.inst__create_page = c.pinst__create_page =  [
/*0*/	function (e,f) { e.smcall (2, webapp_page,"webapp_page_id", ([f.v.cname, f.v.args])); },
	function (e,f) {
		var t3285 = f.s[0]; f.v.id = t3285;
		f.v.p = eval ("new "+f.v.cname +"(f.v.id)");
		f.s[0] = ([]);
		f.s[1] = ([f.v.cname, "webapp_parm_fields"]);
		e.php_builtin (2, "call_user_func_array", 2);
	},
	function (e,f) {
		var t3288 = f.s[0]; f.v.pf = t3288;
		f.v._k208 = e.enumkeys (f.v.pf);
	},
	function (e,f) {
		f.pc=5;
		if (!((f.v._k208).length)) f.pc=4;
	},
	function (e,f) {
		f.pc=8;
		e.mcall (2, f.v.p, "webapp_init", ([]));
	},
/*5*/	function (e,f) {
		f.v._i209 = (f.v._k208).shift();
		f.v.pname = (f.v.pf)[(f.v._i209)];
		if (((f.v.args)[(f.v.pname)]) !== undefined) f.pc=6; else f.pc=7;
	},
	function (e,f) {
		f.pc=3;
		f.v.p[f.v.pname] = (f.v.args)[(f.v.pname)];
	},
	function (e,f) {
		f.pc=3;
		f.v.p[f.v.pname] = "";
	},
	function (e,f) { e.return_pop (f.v.p); },
null	];

;
	c.args__on_load = c.pargs__on_load =  ["el","arg","ev"];
	c.inst__on_load = c.pinst__on_load =  [
/*0*/	function (e,f) {
		f.v.app = new webapp;
		e.mcall (5, f.v.app, "start_interval_timer_callback", ([250, "poll", null]));
	},
null	];

;
};
webapp.init_methods (webapp);
rpcclass.setup_class (webapp, "webapp",0, (["listeners"]), ([2]));
function siteauth () { this.do_construct (arguments); }
siteauth.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
	c.args__get_field_info = c.pargs__get_field_info =  ["key"];
	c.inst__get_field_info = c.pinst__get_field_info =  [
/*0*/	function (e,f) { e.smcall (1, person,"get_field_info", ([f.v.key])); },
	function (e,f) { var t3295 = f.s[0]; e.return_pop (t3295); },
null	];

;
	c.args__lookup = c.pargs__lookup =  [];
	c.inst__lookup = c.pinst__lookup =  [
/*0*/	function (e,f) { e.smcall (0, person,"lookup", ([])); },
	function (e,f) { var t3296 = f.s[0]; e.return_pop (t3296); },
null	];

;
	c.args__is_webmaster = c.pargs__is_webmaster =  [];
	c.inst__is_webmaster = c.pinst__is_webmaster =  [
/*0*/	function (e,f) { e.smcall (0, person,"is_webmaster", ([])); },
	function (e,f) { var t3297 = f.s[0]; e.return_pop (t3297); },
null	];

;
	c.args__start_proxy_login = c.pargs__start_proxy_login =  ["provider","stay_logged_in"];
	c.inst__start_proxy_login = c.pinst__start_proxy_login =  [
/*0*/	function (e,f) {
		f.v.plvars = ({});
		f.v.plvars.provider = f.v.provider;
		f.v.plvars.stay_logged_in = f.v.stay_logged_in;
		f.v.plvars.site = ((browser.server())).HTTP_HOST;
		f.v.plvars.referrer = ((browser.server())).REQUEST_URI;
		e.smcall (2, page_dispatcher,"makelink", (["siteauth", "proxy_login_complete"]));
	},
	function (e,f) {
		var t3304 = f.s[0]; f.v.plvars.bounceback = t3304;
		e.smcall (1, browser,"redirect", ([("http://www.churchtechnologies.co.uk/pj/page.php?classname=proxy_login&pagename=launchpad&plvars=") + ("" + ((encodeURIComponent (builtin__serialize (f.v.plvars)))) + ("&plaction=login&args="))]));
	},
null	];

;
	c.args__add_login_fields = c.pargs__add_login_fields =  ["fields"];
	c.inst__add_login_fields = c.pinst__add_login_fields =  [
/*0*/	function (e,f) {
		e.php_push_static_var (1, auth,"allow_proxy");
		var t3305 = f.s[1]; 
		if (((t3305)) != ((0))) f.pc=1; else f.pc=-1;
	},
	function (e,f) {
		f.s[0] = ("\" />") + ("</div>");
		e.smcall (3, siteauth,"render_resume", (["proxylogin", "facebook"]));
	},
	function (e,f) {
		var t3306 = f.s[1]; var t3307 = f.s[0]; 
		f.v.fields[f.v.fields.length] = ({type:"html", name:"", label:"", html:("<div style=\"border:solid #c0c0c0 1px; padding:3px;margin:5px\">") + (("<p>Login using another provider...</p>") + (("<img src=\"/churchbuilder/graphics/facebook-logo.gif\" alt=\"Login using Facebook\" onclick=\"") + ("" + (t3306) + (t3307))))});
	},
null	];

;
	c.args__recognise_login_action = c.pargs__recognise_login_action =  ["ev"];
	c.inst__recognise_login_action = c.pinst__recognise_login_action =  [
/*0*/	function (e,f) { e.return_pop ((((f.v.ev).action)) == (("proxylogin"))); },
null	];

;
	c.args__handle_login_action = c.pargs__handle_login_action =  ["ev","values"];
	c.inst__handle_login_action = c.pinst__handle_login_action =  [
/*0*/	function (e,f) { if ((((f.v.ev).action)) == (("proxylogin"))) f.pc=1; else f.pc=-1; },
	function (e,f) { e.smcall (2, siteauth,"start_proxy_login", ([(f.v.ev).parm, (f.v.values).save_authority])); },
null	];

;
};
siteauth.init_methods (siteauth);
rpcclass.setup_class (siteauth, "siteauth",0, (["listeners"]), ([2]));
function bible () { this.do_construct (arguments); }
bible.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
	c.args__lookup = c.pargs__lookup =  ["ref"];
	c.inst__lookup = c.pinst__lookup =  [
/*0*/	function (e,f) { if (((f.v.ref)) != ((""))) f.pc=1; else f.pc=-1; },
	function (e,f) { e.mcall (5, window, "open", ([("http://bible.gospelcom.net/bible?version=NIV&passage=") + ("" + ((encodeURIComponent (f.v.ref))) + ("&version=64")), "", "width=900,height=600,scrollbars,resizable"])); },
null	];

;
};
bible.init_methods (bible);
rpcclass.setup_class (bible, "bible",0, (["listeners"]), ([2]));
function mailing_list () { this.do_construct (arguments); }
mailing_list.init_methods = function (c) {
	dbclass.init_methods(c);
	var cp = c.prototype;
	c.pargs__is_allowed =  [];
	c.pinst__is_allowed =  [
/*0*/	function (e,f) {
		f.pc=6;
		e.smcall (1, person,"i_match_query", (["Web\\Administrators"]));
	},
	function (e,f) {
		f.pc=7;
		f.s[0] = true;
	},
	function (e,f) {
		f.pc=5;
		e.smcall (0, person,"is_webmaster", ([]));
	},
	function (e,f) {
		f.pc=7;
		f.s[0] = true;
	},
	function (e,f) {
		f.pc=7;
		e.smcall (1, person,"i_match_expr", ([(f.v["this"]).sender_expr]));
	},
/*5*/	function (e,f) { var t3309 = f.s[0]; if (t3309) f.pc=3; else f.pc=4; },
	function (e,f) { var t3310 = f.s[0]; if (t3310) f.pc=1; else f.pc=2; },
	function (e,f) { var t3311 = f.s[0]; e.return_pop (t3311); },
null	];

;
	c.pargs__do_save =  [];
	c.pinst__do_save =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["do_save", ([])])); },
	function (e,f) { var t3312 = f.s[0]; e.return_pop (t3312); },
null	];

;
	c.args__do_create =  [];
	c.inst__do_create =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_function_async", (["mailing_list", "do_create", ([])])); },
	function (e,f) { var t3313 = f.s[0]; e.return_pop (t3313); },
null	];

;
	c.pargs__do_delete =  [];
	c.pinst__do_delete =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["do_delete", ([])])); },
	function (e,f) { var t3314 = f.s[0]; e.return_pop (t3314); },
null	];

;
	c.args__popupobjeditor_create = c.pargs__popupobjeditor_create =  ["values"];
	c.inst__popupobjeditor_create = c.pinst__popupobjeditor_create =  [
/*0*/	function (e,f) { if ((((f.v.values).name)) == ((""))) f.pc=1; else f.pc=3; },
	function (e,f) { e.smcall (1, popupok,"run", (["Need a name"])); },
	function (e,f) { e.return_pop (null); },
	function (e,f) { e.smcall (0, mailing_list,"do_create", ([])); },
	function (e,f) { var t3315 = f.s[0]; e.return_pop (t3315); },
null	];

;
	c.args__popupobjeditor_fields = c.pargs__popupobjeditor_fields =  [];
	c.inst__popupobjeditor_fields = c.pinst__popupobjeditor_fields =  [
/*0*/	function (e,f) { e.return_pop (([({name:"name", label:"Name", type:"text"}), ({name:"aka", label:"AKA", type:"text"}), ({name:"restriction", label:"Restriction", type:"enum", options:({"0":"Public", "1":"Church members only", "2":"List members only", "3":"Senders only"})}), ({name:"member_expr", label:"Members", type:"query_expr"}), ({name:"sender_expr", label:"Senders", type:"query_expr"})])); },
null	];

;
	c.pargs__edit_list =  [];
	c.pinst__edit_list =  [
/*0*/	function (e,f) {
		f.pc=3;
		e.smcall (2, popupobjeditor,"edit", ([f.v["this"], "Mailing list properties"]));
	},
	function (e,f) { e.mcall (2, f.v["this"], "do_save", ([])); },
	function (e,f) { e.return_pop (true); },
	function (e,f) { var t3316 = f.s[0]; if (t3316) f.pc=1; else f.pc=4; },
	function (e,f) { e.return_pop (false); },
null	];

;
	c.pargs__delete_list =  [];
	c.pinst__delete_list =  [
/*0*/	function (e,f) {
		f.pc=3;
		e.smcall (1, popupokcancel,"run", ([("Sure you want to delete ") + ("" + ((f.v["this"]).name) + ("?"))]));
	},
	function (e,f) { e.mcall (2, f.v["this"], "do_delete", ([])); },
	function (e,f) { e.return_pop (true); },
	function (e,f) { var t3317 = f.s[0]; if (t3317) f.pc=1; else f.pc=4; },
	function (e,f) { e.return_pop (false); },
null	];

;
	c.args__create = c.pargs__create =  [];
	c.inst__create = c.pinst__create =  [
/*0*/	function (e,f) { e.smcall (2, popupobjeditor,"create", (["mailing_list", "Mailing list properties"])); },
	function (e,f) {
		var t3319 = f.s[0]; f.v.obj = t3319;
		if (((f.v.obj)) !== ((null))) f.pc=2; else f.pc=3;
	},
	function (e,f) { e.mcall (2, f.v.obj, "do_save", ([])); },
	function (e,f) { e.return_pop (f.v.obj); },
null	];

;
	c.pargs__render_list =  [];
	c.pinst__render_list =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["render_list", ([])])); },
	function (e,f) { var t3320 = f.s[0]; e.return_pop (t3320); },
null	];

;
	c.pargs__show_list =  ["el","arg","ev"];
	c.pinst__show_list =  [
/*0*/	function (e,f) { e.mcall (2, f.v["this"], "render_list", ([])); },
	function (e,f) {
		var t3322 = f.s[0]; f.v.targets = t3322;
		f.v.fields = ([({name:"members", type:"table", width:300, label:"", options:f.v.targets})]);
		f.v.pop = new popupform;
		e.mcall (6, f.v.pop, "initialise", ([0, 0, (f.v["this"]).name, f.v.fields]));
	},
	function (e,f) { e.mcall (4, f.v.pop, "use_ok_cancel", ([true, false])); },
	function (e,f) { e.mcall (2, f.v.pop, "open", ([])); },
	function (e,f) { f.v.res = false; },
/*5*/	function (e,f) { e.mcall (2, f.v.pop, "run", ([])); },
	function (e,f) {
		var t3327 = f.s[0]; f.v.event = t3327;
		if ((((f.v.event).action)) == (("OK"))) f.pc=8; else f.pc=9;
	},
	function (e,f) {
		f.pc=-1;
		e.mcall (2, f.v.pop, "close", ([]));
	},
	function (e,f) {
		f.pc=10;
		f.s[0] = true;
	},
	function (e,f) { f.s[0] = (((f.v.event).action)) == (("cover")); },
/*10*/	function (e,f) { var t3328 = f.s[0]; if (t3328) f.pc=7; else f.pc=5; },
null	];

;
};
mailing_list.init_methods (mailing_list);
rpcclass.setup_class (mailing_list, "mailing_list",0, (["name","restriction","aka","member_expr","sender_expr","rowid","listeners"]), ([0,0,0,0,0,0,2]));
function mailing_list_manager () { this.do_construct (arguments); }
mailing_list_manager.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
	c.pargs__insert_row =  [];
	c.pinst__insert_row =  [
/*0*/	function (e,f) { e.smcall (0, mailing_list,"create", ([])); },
	function (e,f) {
		var t3330 = f.s[0]; f.v.l = t3330;
		if (((f.v.l)) !== ((null))) f.pc=2; else f.pc=-1;
	},
	function (e,f) { e.mcall (3, (f.v["this"]).dtm, "append_row", ([f.v.l])); },
null	];

;
	c.pargs__edit_list =  ["el","row","ev"];
	c.pinst__edit_list =  [
/*0*/	function (e,f) { e.mcall (2, f.v.row, "edit_list", ([])); },
	function (e,f) { e.mcall (3, (f.v["this"]).dtm, "rerender_row", ([f.v.row])); },
null	];

;
	c.pargs__show_list =  ["el","row","ev"];
	c.pinst__show_list =  [
/*0*/	function (e,f) { e.mcall (2, f.v.row, "show_list", ([])); },
null	];

;
	c.pargs__delete_list =  ["el","row","ev"];
	c.pinst__delete_list =  [
/*0*/	function (e,f) { e.mcall (2, f.v.row, "delete_list", ([])); },
	function (e,f) { e.mcall (3, (f.v["this"]).dtm, "remove_row", ([f.v.row])); },
null	];

;
	c.pargs__get_row_fields =  ["row"];
	c.pinst__get_row_fields =  [
/*0*/	function (e,f) {
		f.pc=6;
		e.mcall (2, f.v.row, "is_allowed", ([]));
	},
	function (e,f) {
		f.s[0] = "\">delete</a>";
		e.mcall (5, f.v["this"], "render_start", (["delete_list", f.v.row]));
	},
	function (e,f) {
		var t3331 = f.s[1]; var t3332 = f.s[0]; 
		f.s[0] = ("<a href=\"#\" onclick=\"") + ("" + (t3331) + (t3332));
		f.s[1] = "\">list</a>";
		e.mcall (6, f.v["this"], "render_start", (["show_list", f.v.row]));
	},
	function (e,f) {
		var t3333 = f.s[2]; var t3334 = f.s[1]; 
		f.s[1] = ("<a href=\"#\" onclick=\"") + ("" + (t3333) + (t3334));
		f.s[2] = "\">edit</a>";
		e.mcall (7, f.v["this"], "render_start", (["edit_list", f.v.row]));
	},
	function (e,f) {
		var t3335 = f.s[3]; var t3336 = f.s[2]; 
		var t3337 = f.s[1]; var t3338 = f.s[0]; 
		e.return_pop (([(f.v.row).name, ("<a href=\"#\" onclick=\"") + ("" + (t3335) + (t3336)), t3337, t3338]));
	},
/*5*/	function (e,f) { e.return_pop (([(f.v.row).name, "", "", ""])); },
	function (e,f) { var t3339 = f.s[0]; if (t3339) f.pc=1; else f.pc=5; },
null	];

;
};
mailing_list_manager.init_methods (mailing_list_manager);
rpcclass.setup_class (mailing_list_manager, "mailing_list_manager",0, (["dtm","listeners"]), ([0,2]));
function tag () { this.do_construct (arguments); }
tag.init_methods = function (c) {
	dbclass.init_methods(c);
	var cp = c.prototype;
	c.pargs__is_mine =  [];
	c.pinst__is_mine =  [
/*0*/	function (e,f) {
		f.pc=3;
		e.smcall (0, person,"is_webmaster", ([]));
	},
	function (e,f) {
		f.pc=4;
		f.s[0] = true;
	},
	function (e,f) {
		f.pc=4;
		e.smcall (1, person,"i_match_expr", ([(f.v["this"]).owners]));
	},
	function (e,f) { var t3340 = f.s[0]; if (t3340) f.pc=1; else f.pc=2; },
	function (e,f) { var t3341 = f.s[0]; e.return_pop (t3341); },
null	];

;
	c.args__my_tags = c.pargs__my_tags =  [];
	c.inst__my_tags = c.pinst__my_tags =  [
/*0*/	function (e,f) {
		f.v.res = ([]);
		e.php_push_static_var (0, tag,"all_tags");
		var t3343 = f.s[0]; 
		f.v._k210 = e.enumkeys (t3343);
	},
	function (e,f) {
		f.pc=3;
		if (!((f.v._k210).length)) f.pc=2;
	},
	function (e,f) { e.return_pop (f.v.res); },
	function (e,f) {
		f.pc=5;
		f.v._i211 = (f.v._k210).shift();
		e.php_push_static_var (2, tag,"all_tags");
		var t3346 = f.s[2]; 
		f.v.tag = (t3346)[(f.v._i211)];
		e.mcall (2, f.v.tag, "is_mine", ([]));
	},
	function (e,f) {
		f.pc=1;
		f.v.res[f.v.res.length] = f.v.tag;
	},
/*5*/	function (e,f) { var t3349 = f.s[0]; if (t3349) f.pc=4; else f.pc=1; },
null	];

;
};
tag.init_methods (tag);
rpcclass.setup_class (tag, "tag",0, (["name","owners","rowid","listeners"]), ([0,0,0,2]));
function miscfile_editor () { this.do_construct (arguments); }
miscfile_editor.codegroup = "richtext_editor";
miscfile_editor.init_methods = function (c) {
	simple_richtext_editor.init_methods(c);
	var cp = c.prototype;
};
miscfile_editor.init_methods (miscfile_editor);
rpcclass.setup_class (miscfile_editor, "miscfile_editor",0, (["uniq","el","epel","renderer","divid","need_select_all","pop","editable_html","it","groups","node_list","actions_list","monitor_list","text_node_list","listeners"]), ([0,2,2,0,0,0,2,0,2,0,0,0,0,2,2]));
function doc_richtext () { this.do_construct (arguments); }
doc_richtext.init_methods = function (c) {
	richtext.init_methods(c);
	var cp = c.prototype;
	c.pargs__expand_url =  ["url"];
	c.pinst__expand_url =  [
/*0*/	function (e,f) { if (((builtin__substr (f.v.url,0,5))) != (("http:"))) f.pc=7; else f.pc=8; },
	function (e,f) {
		f.v.ext = builtin__substr (f.v.url,parseInt(((f.v.url).length),10) - parseInt((4),10),4);
		if (((f.v.ext)) == ((".smm"))) f.pc=4; else f.pc=5;
	},
	function (e,f) {
		f.pc=10;
		f.v.url = ("/churchbuilder/view-doc.php?docid=") + ("" + (((f.v["this"]).doc).rowid) + (("&page=") + ("" + ((encodeURIComponent (f.v.url))) + (("&zonename=") + ((((f.v["this"]).doc).zone).name)))));
	},
	function (e,f) {
		f.pc=10;
		f.v.url = ("/churchbuilder/get-doc.php?docid=") + ("" + (((f.v["this"]).doc).rowid) + (("&page=") + ((encodeURIComponent (f.v.url)))));
	},
	function (e,f) {
		f.pc=6;
		f.s[0] = true;
	},
/*5*/	function (e,f) { f.s[0] = ((f.v.ext)) == ((".html")); },
	function (e,f) { var t3353 = f.s[0]; if (t3353) f.pc=2; else f.pc=3; },
	function (e,f) {
		f.pc=9;
		f.s[0] = ((builtin__substr (f.v.url,0,1))) != (("/"));
	},
	function (e,f) { f.s[0] = false; },
	function (e,f) { var t3354 = f.s[0]; if (t3354) f.pc=1; else f.pc=10; },
/*10*/	function (e,f) { e.return_pop (f.v.url); },
null	];

;
};
doc_richtext.init_methods (doc_richtext);
rpcclass.setup_class (doc_richtext, "doc_richtext",0, (["simple","doc","class_list","listeners"]), ([0,0,0,2]));
function doc_editor () { this.do_construct (arguments); }
doc_editor.codegroup = "richtext_editor";
doc_editor.init_methods = function (c) {
	richtext_editor.init_methods(c);
	var cp = c.prototype;
	c.pargs__pages =  null;
	c.pargs__refetch_files =  null;
	c.pargs__save =  null;
	c.pargs__presave =  null;
	c.pargs__close =  null;
	c.pargs__grab_uploaded_files =  null;
	c.pargs__upload =  null;
	c.pargs__do_newpage =  null;
	c.pargs__newpage =  null;
	c.pargs__jump_to =  null;
	c.pargs__do_delete_page =  null;
	c.pargs__delete_page =  null;
	c.pargs__add_menu_items =  null;
	c.pargs__get_buttons =  null;
};
doc_editor.init_methods (doc_editor);
rpcclass.setup_class (doc_editor, "doc_editor",0, (["doc","files","page","el","epel","renderer","divid","need_select_all","pop","editable_html","it","groups","node_list","actions_list","monitor_list","text_node_list","listeners"]), ([0,0,0,2,2,0,0,0,2,0,2,0,0,0,0,2,2]));
function docpage () { this.do_construct (arguments); }
docpage.codegroup = "doc";
docpage.init_methods = function (c) {
	dbclass.init_methods(c);
	var cp = c.prototype;
	c.pargs__is_text =  null;
	c.pargs__get_text =  null;
	c.pargs__job_cancel =  null;
	c.pargs__save_text =  null;
	c.pargs__do_save =  null;
	c.pargs__insert_thing =  null;
	c.pargs__edit_page =  null;
	c.pargs__delete_page =  null;
	c.args__get_page =  null;
	c.args__create =  null;
	c.args__list_files =  null;
	c.args__fetch_pages =  null;
	c.args__list_pages =  null;
	c.args__list_images =  null;
	c.args__remove_pages =  null;
};
docpage.init_methods (docpage);
rpcclass.setup_class (docpage, "docpage",0, (["docid","filename","mimetype","last_update","rowid","listeners"]), ([0,0,0,0,0,2]));
function doc () { this.do_construct (arguments); }
doc.codegroup = "doc";
doc.init_methods = function (c) {
	dbclass.init_methods(c);
	var cp = c.prototype;
	c.args__do_fetch =  null;
	c.args__find = c.pargs__find =  null;
	c.pargs__set_zone =  null;
	c.pargs__do_delete =  null;
	c.pargs__has_index =  null;
	c.pargs__edit_page_reload =  null;
	c.pargs__create_doc_editor =  null;
	c.pargs__edit2_page_reload =  null;
	c.launch_editor = cp.launch_editor =  function (info)
	{
var docid;var page;{
		docid = info[0];;
		page = info[1];;
		rpcclass.start_engine  (null,null,"doc",docid,"edit2_page_reload",page);;
		}
			}

;
	c.pargs__jump_to_page =  null;
	c.pargs__edit_page =  null;
	c.pargs__insert_thing =  null;
	c.pargs__render_insert_link =  null;
	c.pargs__get_properties_fields =  null;
	c.pargs__open_uploader =  null;
	c.pargs__approve =  null;
	c.pargs__approve_cancel =  null;
	c.pargs__do_save =  null;
	c.pargs__grab_uploaded_files =  null;
	c.pargs__set_release_state =  null;
	c.pargs__run_release_menu =  null;
	c.pargs__extend_date =  null;
	c.pargs__run_date_menu =  null;
	c.pargs__change_tags =  null;
	c.pargs__run_tag_menu =  null;
	c.pargs__edit =  null;
	c.pargs__edit2_reload =  null;
	c.pargs__edit_reload =  null;
	c.args__create = c.pargs__create =  null;
	c.args__do_create =  null;
};
doc.init_methods (doc);
rpcclass.setup_class (doc, "doc",0, (["zone","is_index","heading","summary","startdate","enddate","release_state","hide_private","weight","tags","editor","rowid","listeners"]), ([0,0,0,0,0,0,0,0,0,0,0,0,2]));
function richtext_node_private () { this.do_construct (arguments); }
richtext_node_private.init_methods = function (c) {
	richtext_node.init_methods(c);
	var cp = c.prototype;
	c.args__xml_tag = c.pargs__xml_tag =  [];
	c.inst__xml_tag = c.pinst__xml_tag =  [
/*0*/	function (e,f) { e.return_pop ("private"); },
null	];

;
	c.pargs__edtag =  [];
	c.pinst__edtag =  [
/*0*/	function (e,f) { e.return_pop ("span"); },
null	];

;
	c.pargs__attrs =  [];
	c.pinst__attrs =  [
/*0*/	function (e,f) { e.return_pop (({style:"background:#80ff80"})); },
null	];

;
	c.pargs__needs_content =  [];
	c.pinst__needs_content =  [
/*0*/	function (e,f) { e.return_pop (true); },
null	];

;
	c.pargs__can_merge =  [];
	c.pinst__can_merge =  [
/*0*/	function (e,f) { e.return_pop (true); },
null	];

;
	c.args__get_children = c.pargs__get_children =  [];
	c.inst__get_children = c.pinst__get_children =  [
/*0*/	function (e,f) { e.return_pop ((["%lltext"])); },
null	];

;
	c.args__format_private = c.pargs__format_private =  ["richtextobj","arg"];
	c.inst__format_private = c.pinst__format_private =  [
/*0*/	function (e,f) { e.mcall (3, f.v.richtextobj, "toggle_formatting", (["private"])); },
null	];

;
	c.args__format_public_and_private = c.pargs__format_public_and_private =  ["richtextobj","arg"];
	c.inst__format_public_and_private = c.pinst__format_public_and_private =  [
/*0*/	function (e,f) { e.mcall (2, f.v.richtextobj, "get_selection_nodes", ([])); },
	function (e,f) {
		var t3585 = f.s[0]; f.v.tnl = t3585;
		e.mcall (4, f.v.richtextobj, "unformat_nodes", ([f.v.tnl, (["public", "private"])]));
	},
	function (e,f) { e.mcall (2, f.v.richtextobj, "normalize_nodes", ([])); },
null	];

;
};
richtext_node_private.init_methods (richtext_node_private);
rpcclass.setup_class (richtext_node_private, "richtext_node_private",0, (["richtextobj","props","listeners"]), ([0,0,2]));
function richtext_node_public () { this.do_construct (arguments); }
richtext_node_public.init_methods = function (c) {
	richtext_node.init_methods(c);
	var cp = c.prototype;
	c.args__xml_tag = c.pargs__xml_tag =  [];
	c.inst__xml_tag = c.pinst__xml_tag =  [
/*0*/	function (e,f) { e.return_pop ("public"); },
null	];

;
	c.pargs__edtag =  [];
	c.pinst__edtag =  [
/*0*/	function (e,f) { e.return_pop ("span"); },
null	];

;
	c.pargs__attrs =  [];
	c.pinst__attrs =  [
/*0*/	function (e,f) { e.return_pop (({style:"background:yellow"})); },
null	];

;
	c.pargs__needs_content =  [];
	c.pinst__needs_content =  [
/*0*/	function (e,f) { e.return_pop (true); },
null	];

;
	c.pargs__can_merge =  [];
	c.pinst__can_merge =  [
/*0*/	function (e,f) { e.return_pop (true); },
null	];

;
	c.args__get_children = c.pargs__get_children =  [];
	c.inst__get_children = c.pinst__get_children =  [
/*0*/	function (e,f) { e.return_pop ((["%lltext"])); },
null	];

;
	c.args__format_public = c.pargs__format_public =  ["richtextobj","arg"];
	c.inst__format_public = c.pinst__format_public =  [
/*0*/	function (e,f) { e.mcall (3, f.v.richtextobj, "toggle_formatting", (["public"])); },
null	];

;
};
richtext_node_public.init_methods (richtext_node_public);
rpcclass.setup_class (richtext_node_public, "richtext_node_public",0, (["richtextobj","props","listeners"]), ([0,0,2]));
function richtext_node_zonelink () { this.do_construct (arguments); }
richtext_node_zonelink.init_methods = function (c) {
	richtext_node.init_methods(c);
	var cp = c.prototype;
	c.args__xml_tag = c.pargs__xml_tag =  [];
	c.inst__xml_tag = c.pinst__xml_tag =  [
/*0*/	function (e,f) { e.return_pop ("zonelink"); },
null	];

;
	c.pargs__edtag =  [];
	c.pinst__edtag =  [
/*0*/	function (e,f) { e.return_pop ("span"); },
null	];

;
	c.pargs__attrs =  [];
	c.pinst__attrs =  [
/*0*/	function (e,f) { e.return_pop (({style:"color:blue;text-decoration:underline"})); },
null	];

;
	c.pargs__needs_content =  [];
	c.pinst__needs_content =  [
/*0*/	function (e,f) { e.return_pop (true); },
null	];

;
	c.args__get_children = c.pargs__get_children =  [];
	c.inst__get_children = c.pinst__get_children =  [
/*0*/	function (e,f) { e.return_pop ((["!text"])); },
null	];

;
	c.args__insert_zonelink = c.pargs__insert_zonelink =  ["richtextobj","arg"];
	c.inst__insert_zonelink = c.pinst__insert_zonelink =  [
/*0*/	function (e,f) { e.mcall (2, f.v.richtextobj, "get_selection_as_text", ([])); },
	function (e,f) {
		var t3587 = f.s[0]; f.v.content = t3587;
		if (((f.v.content)) == ((""))) f.pc=2; else f.pc=3;
	},
	function (e,f) { f.v.content = (f.v.arg).name; },
	function (e,f) { e.mcall (5, f.v.richtextobj, "replace_selection_with_node", (["zonelink", ({zone:(f.v.arg).name}), f.v.content])); },
null	];

;
};
richtext_node_zonelink.init_methods (richtext_node_zonelink);
rpcclass.setup_class (richtext_node_zonelink, "richtext_node_zonelink",0, (["richtextobj","props","listeners"]), ([0,0,2]));
function richtext_node_person () { this.do_construct (arguments); }
richtext_node_person.init_methods = function (c) {
	richtext_node.init_methods(c);
	var cp = c.prototype;
	c.args__xml_tag = c.pargs__xml_tag =  [];
	c.inst__xml_tag = c.pinst__xml_tag =  [
/*0*/	function (e,f) { e.return_pop ("person"); },
null	];

;
	c.pargs__edtag =  [];
	c.pinst__edtag =  [
/*0*/	function (e,f) { e.return_pop ("span"); },
null	];

;
	c.args__is_leaf = c.pargs__is_leaf =  [];
	c.inst__is_leaf = c.pinst__is_leaf =  [
/*0*/	function (e,f) { e.return_pop (true); },
null	];

;
	c.pargs__attrs =  [];
	c.pinst__attrs =  [
/*0*/	function (e,f) { e.return_pop (({style:"color:blue;text-decoration:underline"})); },
null	];

;
	c.pargs__generate_node_body =  [];
	c.pinst__generate_node_body =  [
/*0*/	function (e,f) { e.return_pop ((f.v["this"]).nametext); },
null	];

;
	c.args__do_autoname =  ["html"];
	c.inst__do_autoname =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_function_async", (["richtext_node_person", "do_autoname", ([f.v.html])])); },
	function (e,f) { var t3589 = f.s[0]; e.return_pop (t3589); },
null	];

;
	c.args__autoname = c.pargs__autoname =  ["richtextobj","arg"];
	c.inst__autoname = c.pinst__autoname =  [
/*0*/	function (e,f) { e.mcall (2, f.v.richtextobj, "save_bookmark", ([])); },
	function (e,f) {
		var t3591 = f.s[0]; f.v.bm = t3591;
		e.mcall (2, f.v.richtextobj, "get_selection_as_html", ([]));
	},
	function (e,f) {
		var t3593 = f.s[0]; f.v.sel = t3593;
		if (((f.v.sel)) == ((""))) f.pc=3; else f.pc=4;
	},
	function (e,f) { f.pc=-1; },
	function (e,f) { e.smcall (1, richtext_node_person,"do_autoname", ([f.v.sel])); },
/*5*/	function (e,f) {
		var t3595 = f.s[0]; f.v.folk = t3595;
		f.v._k230 = e.enumkeys (f.v.folk);
	},
	function (e,f) {
		f.pc=8;
		if (!((f.v._k230).length)) f.pc=7;
	},
	function (e,f) {
		f.pc=16;
		e.mcall (3, f.v.richtextobj, "restore_bookmark", ([f.v.bm]));
	},
	function (e,f) {
		f.v.name = (f.v._k230).shift();
		f.v.info = (f.v.folk)[(f.v.name)];
		f.v.tag = "";
		f.v._k232 = e.enumkeys (f.v.info);
	},
	function (e,f) {
		f.pc=11;
		if (!((f.v._k232).length)) f.pc=10;
	},
/*10*/	function (e,f) {
		f.pc=6;
		f.v.sel = builtin__str_replace (f.v.name,f.v.tag,f.v.sel);
	},
	function (e,f) {
		f.v._i233 = (f.v._k232).shift();
		f.v.poss = (f.v.info)[(f.v._i233)];
		f.v.nametext = f.v.name;
		if (((builtin__count (f.v.info))) > ((1))) f.pc=12; else f.pc=13;
	},
	function (e,f) { f.v.nametext = "" + (f.v.nametext) + ((" (living at ") + ("" + ((f.v.poss).address1) + (")"))); },
	function (e,f) { e.smcall (3, richtext_node,"create", ([f.v.richtextobj, "person", ({uid:(f.v.poss).uid})])); },
	function (e,f) {
		var t3607 = f.s[0]; f.v.obj = t3607;
		f.v.obj.nametext = f.v.nametext;
		f.s[0] = builtin__ob_start ();
		e.mcall (3, f.v.obj, "render_editable_node", ([f.v.richtextobj]));
	},
/*15*/	function (e,f) {
		f.pc=9;
		var t3610 = f.s[0]; f.v.closetag = t3610;
		f.v.tag = "" + (f.v.tag) + (builtin__ob_get_clean ());
	},
	function (e,f) { e.mcall (3, f.v.richtextobj, "replace_selection_with_html", ([f.v.sel])); },
null	];

;
};
richtext_node_person.init_methods (richtext_node_person);
rpcclass.setup_class (richtext_node_person, "richtext_node_person",0, (["nametext","richtextobj","props","listeners"]), ([0,0,0,2]));
function richtext_node_button () { this.do_construct (arguments); }
richtext_node_button.init_methods = function (c) {
	richtext_configurable_leaf_node.init_methods(c);
	var cp = c.prototype;
	c.args__xml_tag = c.pargs__xml_tag =  [];
	c.inst__xml_tag = c.pinst__xml_tag =  [
/*0*/	function (e,f) { e.return_pop ("button"); },
null	];

;
	c.pargs__attrs =  [];
	c.pinst__attrs =  [
/*0*/	function (e,f) { if ((((f.v["this"]).props).align) !== undefined) f.pc=1; else f.pc=2; },
	function (e,f) {
		f.pc=3;
		f.s[0] = ((f.v["this"]).props).align;
	},
	function (e,f) { f.s[0] = "right"; },
	function (e,f) {
		var t3613 = f.s[0]; f.v.align = t3613;
		e.return_pop (({style:("display:block;width:100px;height:100px;color:white;background:orange;float:") + (f.v.align)}));
	},
null	];

;
	c.pargs__generate_node_body =  [];
	c.pinst__generate_node_body =  [
/*0*/	function (e,f) { e.return_pop ("Button"); },
null	];

;
	c.pargs__get_fields =  [];
	c.pinst__get_fields =  [
/*0*/	function (e,f) { e.return_pop (([({type:"text", name:"img", label:"Image file"}), ({type:"text", name:"text", label:"Text"}), ({type:"text", name:"font", label:"Font file"}), ({type:"text", name:"size", label:"Font size"}), ({type:"text", name:"color", label:"Colour (#rrggbb)"}), ({type:"list", options:(["left", "right"]), name:"align", label:"Align"})])); },
null	];

;
};
richtext_node_button.init_methods (richtext_node_button);
rpcclass.setup_class (richtext_node_button, "richtext_node_button",0, (["richtextobj","props","listeners"]), ([0,0,2]));
function richtext_node_youtube () { this.do_construct (arguments); }
richtext_node_youtube.init_methods = function (c) {
	richtext_configurable_leaf_node.init_methods(c);
	var cp = c.prototype;
	c.args__xml_tag = c.pargs__xml_tag =  [];
	c.inst__xml_tag = c.pinst__xml_tag =  [
/*0*/	function (e,f) { e.return_pop ("youtube"); },
null	];

;
	c.pargs__attrs =  [];
	c.pinst__attrs =  [
/*0*/	function (e,f) { e.return_pop (({style:"display:block;width:426px;height:355px;color:white;background:orange"})); },
null	];

;
	c.pargs__generate_node_body =  [];
	c.pinst__generate_node_body =  [
/*0*/	function (e,f) { e.return_pop (("YouTube player ") + (((f.v["this"]).props).href)); },
null	];

;
	c.pargs__get_fields =  [];
	c.pinst__get_fields =  [
/*0*/	function (e,f) { e.return_pop (([({type:"text", name:"href", label:"YouTube video id"})])); },
null	];

;
};
richtext_node_youtube.init_methods (richtext_node_youtube);
rpcclass.setup_class (richtext_node_youtube, "richtext_node_youtube",0, (["richtextobj","props","listeners"]), ([0,0,2]));
function richtext_node_mailform () { this.do_construct (arguments); }
richtext_node_mailform.init_methods = function (c) {
	richtext_configurable_leaf_node.init_methods(c);
	var cp = c.prototype;
	c.args__xml_tag = c.pargs__xml_tag =  [];
	c.inst__xml_tag = c.pinst__xml_tag =  [
/*0*/	function (e,f) { e.return_pop ("mailform"); },
null	];

;
	c.pargs__attrs =  [];
	c.pinst__attrs =  [
/*0*/	function (e,f) { e.return_pop (({style:"display:block;width:100%;height:200px;color:white;background:orange"})); },
null	];

;
	c.pargs__generate_node_body =  [];
	c.pinst__generate_node_body =  [
/*0*/	function (e,f) { e.return_pop (("Mail form to ") + ("" + (((f.v["this"]).props).to) + ((", subject ") + (((f.v["this"]).props).subject)))); },
null	];

;
	c.pargs__get_fields =  [];
	c.pinst__get_fields =  [
/*0*/	function (e,f) { e.return_pop (([({type:"text", name:"subject", label:"Subject"}), ({type:"text", name:"to", label:"To"})])); },
null	];

;
};
richtext_node_mailform.init_methods (richtext_node_mailform);
rpcclass.setup_class (richtext_node_mailform, "richtext_node_mailform",0, (["to","subject","richtextobj","props","listeners"]), ([0,0,0,0,2]));
function richtext_node_signup () { this.do_construct (arguments); }
richtext_node_signup.init_methods = function (c) {
	richtext_configurable_leaf_node.init_methods(c);
	var cp = c.prototype;
	c.args__xml_tag = c.pargs__xml_tag =  [];
	c.inst__xml_tag = c.pinst__xml_tag =  [
/*0*/	function (e,f) { e.return_pop ("signup"); },
null	];

;
	c.pargs__attrs =  [];
	c.pinst__attrs =  [
/*0*/	function (e,f) { e.return_pop (({style:"display:block;width:100px;height:50px;color:white;background:orange"})); },
null	];

;
	c.pargs__generate_node_body =  [];
	c.pinst__generate_node_body =  [
/*0*/	function (e,f) { e.return_pop (("Sign-up button to ") + (((f.v["this"]).props).gname)); },
null	];

;
	c.pargs__get_fields =  [];
	c.pinst__get_fields =  [
/*0*/	function (e,f) { e.return_pop (([({type:"text", name:"gname", label:"Group Name"})])); },
null	];

;
	c.args__do_signup =  ["gid"];
	c.inst__do_signup =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_function_async", (["richtext_node_signup", "do_signup", ([f.v.gid])])); },
	function (e,f) { var t3614 = f.s[0]; e.return_pop (t3614); },
null	];

;
	c.args__signup_button = c.pargs__signup_button =  ["el","gid","ev"];
	c.inst__signup_button = c.pinst__signup_button =  [
/*0*/	function (e,f) { e.smcall (1, richtext_node_signup,"do_signup", ([f.v.gid])); },
	function (e,f) {
		var t3616 = f.s[0]; f.v["in"] = t3616;
		if (f.v["in"]) f.pc=2; else f.pc=3;
	},
	function (e,f) {
		f.pc=4;
		f.s[0] = "Cancel Booking";
	},
	function (e,f) { f.s[0] = "Sign up"; },
	function (e,f) {
		var t3618 = f.s[0]; f.v.button_text = t3618;
		if (f.v["in"]) f.pc=5; else f.pc=6;
	},
/*5*/	function (e,f) {
		f.pc=7;
		f.s[0] = "(You are currently signed up)";
	},
	function (e,f) { f.s[0] = ""; },
	function (e,f) {
		var t3620 = f.s[0]; f.v.tag_text = t3620;
		e.mcall (3, document, "getElementById", ([("signup-") + ("" + (f.v.gid) + ("-button"))]));
	},
	function (e,f) {
		var t3622 = f.s[0]; f.v.button_el = t3622;
		e.mcall (3, document, "getElementById", ([("signup-") + ("" + (f.v.gid) + ("-tag"))]));
	},
	function (e,f) {
		var t3624 = f.s[0]; f.v.tag_el = t3624;
		f.v.button_el.innerHTML = f.v.button_text;
		f.v.tag_el.innerHTML = f.v.tag_text;
	},
null	];

;
};
richtext_node_signup.init_methods (richtext_node_signup);
rpcclass.setup_class (richtext_node_signup, "richtext_node_signup",0, (["richtextobj","props","listeners"]), ([0,0,2]));
function richtext_node_subzonebuttons () { this.do_construct (arguments); }
richtext_node_subzonebuttons.init_methods = function (c) {
	richtext_configurable_leaf_node.init_methods(c);
	var cp = c.prototype;
	c.args__xml_tag = c.pargs__xml_tag =  [];
	c.inst__xml_tag = c.pinst__xml_tag =  [
/*0*/	function (e,f) { e.return_pop ("subzonebuttons"); },
null	];

;
	c.pargs__attrs =  [];
	c.pinst__attrs =  [
/*0*/	function (e,f) { e.return_pop (({style:"display:block;width:163px;height:336px;color:white;background:orange;float:right"})); },
null	];

;
	c.pargs__generate_node_body =  [];
	c.pinst__generate_node_body =  [
/*0*/	function (e,f) { e.return_pop ("Sub-zone buttons"); },
null	];

;
	c.pargs__get_fields =  [];
	c.pinst__get_fields =  [
/*0*/	function (e,f) { e.return_pop (([({type:"text", name:"img", label:"Image file"}), ({type:"text", name:"font", label:"Font file"}), ({type:"text", name:"size", label:"Font size"}), ({type:"text", name:"color", label:"Colour (#rrggbb)"})])); },
null	];

;
};
richtext_node_subzonebuttons.init_methods (richtext_node_subzonebuttons);
rpcclass.setup_class (richtext_node_subzonebuttons, "richtext_node_subzonebuttons",0, (["richtextobj","props","listeners"]), ([0,0,2]));
function richtext_node_upcoming () { this.do_construct (arguments); }
richtext_node_upcoming.init_methods = function (c) {
	richtext_configurable_leaf_node.init_methods(c);
	var cp = c.prototype;
	c.args__xml_tag = c.pargs__xml_tag =  [];
	c.inst__xml_tag = c.pinst__xml_tag =  [
/*0*/	function (e,f) { e.return_pop ("upcoming"); },
null	];

;
	c.pargs__generate_node_body =  [];
	c.pinst__generate_node_body =  [
/*0*/	function (e,f) { e.return_pop ("Upcoming events block"); },
null	];

;
	c.pargs__attrs =  [];
	c.pinst__attrs =  [
/*0*/	function (e,f) { e.return_pop (({style:("display:block;width:163px;height:336px;color:white;background:orange;float:") + (((f.v["this"]).props).align)})); },
null	];

;
	c.pargs__get_fields =  [];
	c.pinst__get_fields =  [
/*0*/	function (e,f) { e.return_pop (([({type:"list", options:(["left", "right"]), name:"align", label:"Align"})])); },
null	];

;
};
richtext_node_upcoming.init_methods (richtext_node_upcoming);
rpcclass.setup_class (richtext_node_upcoming, "richtext_node_upcoming",0, (["richtextobj","props","listeners"]), ([0,0,2]));
function richtext_node_scrollbox () { this.do_construct (arguments); }
richtext_node_scrollbox.init_methods = function (c) {
	richtext_configurable_leaf_node.init_methods(c);
	var cp = c.prototype;
	c.args__xml_tag = c.pargs__xml_tag =  [];
	c.inst__xml_tag = c.pinst__xml_tag =  [
/*0*/	function (e,f) { e.return_pop ("scrollbox"); },
null	];

;
	c.pargs__generate_node_body =  [];
	c.pinst__generate_node_body =  [
/*0*/	function (e,f) { e.return_pop (("Scroll Box ") + (((f.v["this"]).props).text)); },
null	];

;
	c.pargs__attrs =  [];
	c.pinst__attrs =  [
/*0*/	function (e,f) {
		f.v.style = ("display:block;width:163px;height:336px;color:white;background:orange;float:") + (((f.v["this"]).props).align);
		e.return_pop (({style:f.v.style}));
	},
null	];

;
	c.pargs__get_fields =  [];
	c.pinst__get_fields =  [
/*0*/	function (e,f) { e.return_pop (([({type:"text", name:"text", label:"Text"}), ({type:"text", name:"width", label:"Width"}), ({type:"text", name:"height", label:"Height"}), ({type:"list", options:(["left", "right"]), name:"align", label:"Align"})])); },
null	];

;
	c.pargs__body =  [];
	c.pinst__body =  [
/*0*/	function (e,f) { e.return_pop (("Scroll Box ") + (builtin__htmlentities ((f.v["this"]).text))); },
null	];

;
	c.launch_jquery = cp.launch_jquery =  function (arg)
	{
		var headline_count;
		var headline_interval;
		var old_headline = 0;
		var current_headline=0;
		var headlines = new Array(); // an array of jQuery objects
		var width = $("div.rightscrollup").width();
		var height = $("div.rightscrollup").height();

		  headline_count = $("div.headline").size();

		function headline_rotate() {
		  current_headline = (old_headline + 1) % headline_count;
		  headlines[old_headline].animate({top: -height-5},"slow", function() {
		    $(this).css('top',(height+10)+'px');
		    });
		  headlines[current_headline].show().animate({top: 5},"slow");
		  old_headline = current_headline;
		}

		  if (headline_count)
		  {
			  for (var i = 0; i < headline_count; i++) {
			    headlines[i] = $("div.headline:eq("+i+")");
			  }

			  headlines[current_headline].css('top','5px');

			  headline_interval = setInterval(headline_rotate,10000);
			  $('.rightscrollup').hover(function() {
			    clearInterval(headline_interval);
			  }, function() {
			    headline_interval = setInterval(headline_rotate,10000);
			    headline_rotate();
			  });

		}
			}

;
};
richtext_node_scrollbox.init_methods (richtext_node_scrollbox);
rpcclass.setup_class (richtext_node_scrollbox, "richtext_node_scrollbox",0, (["richtextobj","props","listeners"]), ([0,0,2]));
function form_element_person_array () { this.do_construct (arguments); }
form_element_person_array.init_methods = function (c) {
	form_element_array.init_methods(c);
	var cp = c.prototype;
	c.pargs__table_widths =  [];
	c.pinst__table_widths =  [
/*0*/	function (e,f) { e.return_pop ((["20%", "30%", "30%", "20%"])); },
null	];

;
	c.pargs__select_person =  ["el","p","ev"];
	c.pinst__select_person =  [
/*0*/	function (e,f) { e.mcall (4, (f.v["this"]).form, "set_env", (["selected_person", f.v.p])); },
	function (e,f) { e.mcall (2, (f.v["this"]).form, "ok_clicked", ([])); },
null	];

;
	c.pargs__row_fields =  ["p"];
	c.pinst__row_fields =  [
/*0*/	function (e,f) {
		f.v.res = ([]);
		f.s[0] = ("\">") + ("" + ((f.v.p).nicename) + ("</a>"));
		e.mcall (5, f.v.p, "render_start", (["popup_summary", null]));
	},
	function (e,f) {
		var t3629 = f.s[1]; var t3630 = f.s[0]; 
		f.v.res[f.v.res.length] = ("<a href=\"#\" onclick=\"") + ("" + (t3629) + (t3630));
		f.v.res[f.v.res.length] = (f.v.p).address1;
		f.v.res[f.v.res.length] = (f.v.p).email;
		f.s[0] = "\">Use existing</a>";
		e.mcall (5, f.v["this"], "render_start", (["select_person", f.v.p]));
	},
	function (e,f) {
		var t3634 = f.s[1]; var t3635 = f.s[0]; 
		f.v.res[f.v.res.length] = ("<a href=\"#\" onclick=\"") + ("" + (t3634) + (t3635));
		e.return_pop (f.v.res);
	},
null	];

;
};
form_element_person_array.init_methods (form_element_person_array);
rpcclass.setup_class (form_element_person_array, "form_element_person_array",0, (["dtm","form","fielddef","raw_value","change_timer_handle","listeners"]), ([0,0,0,0,0,2]));
function person () { this.do_construct (arguments); }
person.init_methods = function (c) {
	dbclass.init_methods(c);
	var cp = c.prototype;
	c.pargs__send_activation_email =  [];
	c.pinst__send_activation_email =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["send_activation_email", ([])])); },
	function (e,f) { var t3637 = f.s[0]; e.return_pop (t3637); },
null	];

;
	c.pargs__do_set_password =  ["md5pw"];
	c.pinst__do_set_password =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["do_set_password", ([f.v.md5pw])])); },
	function (e,f) { var t3638 = f.s[0]; e.return_pop (t3638); },
null	];

;
	c.pargs__set_password =  ["el","arg","ev"];
	c.pinst__set_password =  [
/*0*/	function (e,f) { e.smcall (4, popupeditbox,"runpw", ([0, 0, "New Password", ""])); },
	function (e,f) {
		var t3640 = f.s[0]; f.v.pw = t3640;
		if (((f.v.pw)) !== ((null))) f.pc=2; else f.pc=-1;
	},
	function (e,f) { e.mcall (3, f.v["this"], "do_set_password", ([builtin__md5 (f.v.pw)])); },
null	];

;
	c.pargs__set_superpowers_pin =  ["el","arg","ev"];
	c.pinst__set_superpowers_pin =  [
/*0*/	function (e,f) { e.smcall (4, popupeditbox,"run", ([0, 0, "New PIN", ""])); },
	function (e,f) {
		var t3642 = f.s[0]; f.v.pw = t3642;
		if (((f.v.pw)) !== ((null))) f.pc=2; else f.pc=-1;
	},
	function (e,f) { e.mcall (3, f.v["this"], "do_set_superpowers_pin", ([f.v.pw])); },
null	];

;
	c.args__get_user_fields = c.pargs__get_user_fields =  [];
	c.inst__get_user_fields = c.pinst__get_user_fields =  [
/*0*/	function (e,f) {
		f.v.read_by_logged_in = ({members:"1", admin:"1", cwork:"1", webmasters:"1"});
		f.v.read_by_members = ({members:"consent", admin:"1", cwork:"1", webmasters:"1"});
		f.v.read_by_admin = ({members:"0", admin:"1", cwork:"1", webmasters:"1"});
		f.v.read_by_admin_if_adult = ({members:"consent", admin:"adult", cwork:"1", webmasters:"1"});
		f.v.read_by_cwork = ({members:"0", admin:"0", cwork:"1", webmasters:"1"});
		f.v.read_by_webmaster = ({members:"0", admin:"0", cwork:"0", webmasters:"1"});
		f.v.write_by_owner = ({owner:"1", admin:"1", cwork:"1", webmasters:"1"});
		f.v.write_by_owner_if_adult = ({owner:"1", admin:"adult", cwork:"1", webmasters:"1"});
		f.v.write_by_admin = ({owner:"0", admin:"1", cwork:"1", webmasters:"1"});
		f.v.write_by_admin_if_adult = ({owner:"0", admin:"adult", cwork:"1", webmasters:"1"});
		f.v.write_by_cwork = ({owner:"0", admin:"0", cwork:"1", webmasters:"1"});
		f.v.write_by_webmaster = ({owner:"0", admin:"0", cwork:"0", webmasters:"1"});
		f.v.write_by_none = ({owner:"0", admin:"0", cwork:"0", webmasters:"0"});
		f.v.email_notify_options = ({"0":"Never", "1":"Usual only", "2":"Other only", "3":"Both addresses"});
		f.v.res = ([]);
		f.v.res[f.v.res.length] = ({name:"salutation", type:"text", label:"Title", protection:"carelist", read:f.v.read_by_members, write:f.v.write_by_owner});
		f.v.res[f.v.res.length] = ({name:"fname", type:"text", label:"First name", protection:"public", read:f.v.read_by_logged_in, write:f.v.write_by_owner});
		f.v.res[f.v.res.length] = ({name:"nname", type:"text", label:"Usual name", protection:"public", read:f.v.read_by_logged_in, write:f.v.write_by_owner});
		f.v.res[f.v.res.length] = ({name:"sname", type:"text", label:"Surname", protection:"public", read:f.v.read_by_logged_in, write:f.v.write_by_owner});
		f.v.res[f.v.res.length] = ({name:"username", type:"text", label:"Username", protection:"admin", read:f.v.read_by_webmaster, write:f.v.write_by_webmaster});
		f.v.res[f.v.res.length] = ({name:"mailbox_name", type:"text", label:"Mailbox name", protection:"admin", read:f.v.read_by_webmaster, write:f.v.write_by_webmaster});
		f.v.res[f.v.res.length] = ({name:"mailbox_aliases", type:"text", label:"Mailbox aliases", protection:"admin", read:f.v.read_by_webmaster, write:f.v.write_by_webmaster});
		f.v.res[f.v.res.length] = ({name:"telephone", type:"dn", label:"Telephone", protection:"gate", gate:"show_phone", read:f.v.read_by_members, write:f.v.write_by_owner});
		f.v.res[f.v.res.length] = ({name:"show_phone", type:"yesno", label:"Show telephone to others", protection:"private", read:f.v.read_by_admin, write:f.v.write_by_owner});
		f.v.res[f.v.res.length] = ({name:"mobile", type:"dn", label:"Mobile", protection:"gate", gate:"show_mobile", read:f.v.read_by_admin_if_adult, write:f.v.write_by_owner_if_adult});
		f.v.res[f.v.res.length] = ({name:"show_mobile", type:"yesno", label:"Show mobile to others", protection:"private", read:f.v.read_by_admin, write:f.v.write_by_owner_if_adult});
		f.v.res[f.v.res.length] = ({name:"work_phone", type:"dn", label:"Work Phone", protection:"private", read:f.v.read_by_admin, write:f.v.write_by_owner});
		f.v.res[f.v.res.length] = ({name:"email", type:"email", label:"Usual email", protection:"gate", gate:"show_email", read:f.v.read_by_admin_if_adult, write:f.v.write_by_owner_if_adult});
		f.v.res[f.v.res.length] = ({name:"show_email", type:"yesno", label:"Show email to others", protection:"private", read:f.v.read_by_admin, write:f.v.write_by_owner_if_adult});
		f.v.res[f.v.res.length] = ({name:"email_notify_type", type:"enum", options:f.v.email_notify_options, label:"Preferred email", protection:"private", read:f.v.read_by_admin, write:f.v.write_by_owner});
		f.v.res[f.v.res.length] = ({name:"allow_reminders", type:"yesno", label:"Reminder emails", protection:"private", read:f.v.read_by_admin, write:f.v.write_by_owner});
		f.v.res[f.v.res.length] = ({name:"other_email", type:"email", label:"Other email", protection:"private", read:f.v.read_by_admin_if_adult, write:f.v.write_by_owner_if_adult});
		f.v.res[f.v.res.length] = ({name:"address1", type:"text", label:"Address 1", protection:"carelist", read:f.v.read_by_members, write:f.v.write_by_owner});
		f.v.res[f.v.res.length] = ({name:"address2", type:"text", label:"Address 2", protection:"carelist", read:f.v.read_by_members, write:f.v.write_by_owner});
		f.v.res[f.v.res.length] = ({name:"address3", type:"text", label:"Address 3", protection:"carelist", read:f.v.read_by_members, write:f.v.write_by_owner});
		f.v.res[f.v.res.length] = ({name:"address4", type:"text", label:"Address 4", protection:"carelist", read:f.v.read_by_members, write:f.v.write_by_owner});
		f.v.res[f.v.res.length] = ({name:"postalcode", type:"postcode", label:"Postal Code", protection:"carelist", read:f.v.read_by_members, write:f.v.write_by_owner});
		f.v.res[f.v.res.length] = ({name:"occupation", type:"text", label:"Occupation", protection:"carelist", read:f.v.read_by_members, write:f.v.write_by_owner});
		f.v.res[f.v.res.length] = ({name:"website", type:"text", label:"Website", protection:"carelist", read:f.v.read_by_members, write:f.v.write_by_owner});
		f.v.res[f.v.res.length] = ({name:"adult", type:"yesno", label:"Adult", protection:"isadult", read:f.v.read_by_admin, write:f.v.write_by_admin_if_adult});
		f.v.res[f.v.res.length] = ({name:"gender", type:"gender", label:"Gender", protection:"admin", read:f.v.read_by_admin, write:f.v.write_by_admin});
		f.v.res[f.v.res.length] = ({name:"dob", type:"date", label:"Date of Birth", protection:"childrw", read:f.v.read_by_cwork, write:f.v.write_by_cwork});
		f.v.res[f.v.res.length] = ({name:"alergies", type:"text", label:"Allergies", protection:"childro", read:f.v.read_by_cwork, write:f.v.write_by_cwork});
		f.v.res[f.v.res.length] = ({name:"school_year_adjust", type:"numeric", label:"School Year Adjust", protection:"childrw", read:f.v.read_by_cwork, write:f.v.write_by_cwork});
		f.v.res[f.v.res.length] = ({name:"famref", type:"text", label:"Family Reference", protection:"admin", read:f.v.read_by_admin, write:f.v.write_by_admin});
		f.v.res[f.v.res.length] = ({name:"relation", type:"text", label:"Family Position", protection:"admin", read:f.v.read_by_admin, write:f.v.write_by_admin});
		f.v.res[f.v.res.length] = ({name:"notes", type:"text", label:"Notes", protection:"admin", read:f.v.read_by_admin, write:f.v.write_by_admin});
		f.v.res[f.v.res.length] = ({name:"added_on", type:"date", label:"Added on", protection:"admin", readonly:"1", read:f.v.read_by_admin, write:f.v.write_by_none});
		f.v.res[f.v.res.length] = ({name:"added_by", type:"user", label:"Added by", protection:"admin", readonly:"1", read:f.v.read_by_admin, write:f.v.write_by_none});
		e.return_pop (f.v.res);
	},
null	];

;
	c.pargs__do_matches_expr =  ["expr"];
	c.pinst__do_matches_expr =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["do_matches_expr", ([f.v.expr])])); },
	function (e,f) { var t3692 = f.s[0]; e.return_pop (t3692); },
null	];

;
	c.pargs__matches_expr =  ["expr"];
	c.pinst__matches_expr =  [
/*0*/	function (e,f) { if (!((((f.v["this"]).matches_expr_cache)[(f.v.expr)]) !== undefined)) f.pc=1; else f.pc=9; },
	function (e,f) {
		f.v.matches = ([]);
		if ((((f.v["this"]).my_group_membership)) != ((null))) f.pc=5; else f.pc=6;
	},
	function (e,f) {
		f.pc=8;
		f.v.gid = (f.v.matches)[(1)];
		f.v.res = builtin__preg_match (("/\\{") + ("" + (f.v.gid) + ("\\}/")),(f.v["this"]).my_group_membership);
	},
	function (e,f) { e.mcall (3, f.v["this"], "do_matches_expr", ([f.v.expr])); },
	function (e,f) {
		f.pc=8;
		var t3697 = f.s[0]; f.v.res = t3697;
	},
/*5*/	function (e,f) {
		f.pc=7;
		f.s[0] = builtin__preg_match ("/^G(\\d+)\\.$/",f.v.expr,f.v.matches);
	},
	function (e,f) { f.s[0] = false; },
	function (e,f) { var t3698 = f.s[0]; if (t3698) f.pc=2; else f.pc=3; },
	function (e,f) { (f.v["this"]).matches_expr_cache[f.v.expr] = f.v.res; },
	function (e,f) { e.return_pop (((f.v["this"]).matches_expr_cache)[(f.v.expr)]); },
null	];

;
	c.pargs__matches_query =  ["queryname"];
	c.pinst__matches_query =  [
/*0*/	function (e,f) { if (((f.v.queryname)) == (("Everyone"))) f.pc=1; else f.pc=2; },
	function (e,f) { e.return_pop (true); },
	function (e,f) { e.smcall (1, stored_query,"lookup", ([f.v.queryname])); },
	function (e,f) {
		var t3701 = f.s[0]; f.v.expr = t3701;
		if (((f.v.expr)) === ((null))) f.pc=4; else f.pc=5;
	},
	function (e,f) { e.return_pop (false); },
/*5*/	function (e,f) { e.mcall (3, f.v["this"], "matches_expr", ([f.v.expr])); },
	function (e,f) { var t3702 = f.s[0]; e.return_pop (t3702); },
null	];

;
	c.args__fetch_by_id =  ["id"];
	c.inst__fetch_by_id =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_function_async", (["person", "fetch_by_id", ([f.v.id])])); },
	function (e,f) { var t3703 = f.s[0]; e.return_pop (t3703); },
null	];

;
	c.args__fetch_by_handle =  ["h"];
	c.inst__fetch_by_handle =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_function_async", (["person", "fetch_by_handle", ([f.v.h])])); },
	function (e,f) { var t3704 = f.s[0]; e.return_pop (t3704); },
null	];

;
	c.pargs__do_remove_from_group =  ["group"];
	c.pinst__do_remove_from_group =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["do_remove_from_group", ([f.v.group])])); },
	function (e,f) { var t3705 = f.s[0]; e.return_pop (t3705); },
null	];

;
	c.pargs__do_add_to_group =  ["group"];
	c.pinst__do_add_to_group =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["do_add_to_group", ([f.v.group])])); },
	function (e,f) { var t3706 = f.s[0]; e.return_pop (t3706); },
null	];

;
	c.args__raw_lookup =  ["terms"];
	c.inst__raw_lookup =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_function_async", (["person", "raw_lookup", ([f.v.terms])])); },
	function (e,f) { var t3707 = f.s[0]; e.return_pop (t3707); },
null	];

;
	c.args__lookup = c.pargs__lookup =  [];
	c.inst__lookup = c.pinst__lookup =  [
/*0*/	function (e,f) {
		f.v.pop = new popupform;
		f.v.fields = ([({type:"text", name:"terms", label:"Search for", focus:"true"})]);
		e.mcall (6, f.v.pop, "initialise", ([0, 0, "Lookup", f.v.fields]));
	},
	function (e,f) { e.mcall (2, f.v.pop, "open", ([])); },
	function (e,f) {  },
	function (e,f) { e.mcall (2, f.v.pop, "run", ([])); },
	function (e,f) {
		var t3711 = f.s[0]; f.v.event = t3711;
		f.v.action = (f.v.event).action;
		if (((f.v.action)) == (("OK"))) f.pc=5; else f.pc=48;
	},
/*5*/	function (e,f) { e.mcall (2, f.v.pop, "get_form_fields", ([])); },
	function (e,f) {
		var t3714 = f.s[0]; f.v.res = t3714;
		f.v.terms = (f.v.res).terms;
		e.mcall (2, f.v.pop, "close", ([]));
	},
	function (e,f) { e.smcall (1, person,"raw_lookup", ([f.v.terms])); },
	function (e,f) {
		var t3717 = f.s[0]; f.v.matches = t3717;
		if (((builtin__count (f.v.matches))) == ((1))) f.pc=9; else f.pc=10;
	},
	function (e,f) { e.return_pop ((f.v.matches)[(0)]); },
/*10*/	function (e,f) { if (((builtin__count (f.v.matches))) == ((0))) f.pc=11; else f.pc=22; },
	function (e,f) {
		e.php_push_static_var (0, person,"i_can_edit");
		var t3718 = f.s[0]; 
		if (!(t3718)) f.pc=12; else f.pc=14;
	},
	function (e,f) { e.smcall (1, popupok,"run", (["Person not found"])); },
	function (e,f) { e.return_pop (null); },
	function (e,f) {
		f.pc=16;
		e.smcall (1, popupokcancel,"run", (["Person not found - would you like to add them?"]));
	},
/*15*/	function (e,f) { e.return_pop (null); },
	function (e,f) {
		var t3719 = f.s[0]; 
		if (!(t3719)) f.pc=15; else f.pc=17;
	},
	function (e,f) {
		f.v.matches = ([]);
		if (builtin__preg_match ("/^(\\w+) (\\w+)$/",f.v.terms,f.v.matches)) f.pc=18; else f.pc=20;
	},
	function (e,f) { e.smcall (2, person,"add_new_person_helper", ([(f.v.matches)[(1)], (f.v.matches)[(2)]])); },
	function (e,f) { var t3721 = f.s[0]; e.return_pop (t3721); },
/*20*/	function (e,f) { e.smcall (2, person,"add_new_person_helper", (["", ""])); },
	function (e,f) { var t3722 = f.s[0]; e.return_pop (t3722); },
	function (e,f) {
		f.v.options = ([]);
		f.v.i = 0;
	},
	function (e,f) {
		f.pc=25;
		if (!(((f.v.matches)[(f.v.i)]) !== undefined)) f.pc=24;
	},
	function (e,f) {
		e.php_push_static_var (0, person,"i_can_edit");
		var t3725 = f.s[0]; if (t3725) f.pc=27; else f.pc=29;
	},
/*25*/	function (e,f) {
		f.v.match = (f.v.matches)[(f.v.i)];
		f.s[0] = "\">";
		e.smcall (3, person,"render_resume", (["select", f.v.i]));
	},
	function (e,f) {
		f.pc=23;
		var t3727 = f.s[1]; var t3728 = f.s[0]; 
		f.v.html = ("<td><a href=\"#\" onclick=\"") + ("" + (t3727) + (t3728));
		f.v.html = "" + (f.v.html) + ("" + ((f.v.match).nname) + ((" ") + ((f.v.match).sname)));
		f.v.html = "" + (f.v.html) + ((" (") + ("" + ((f.v.match).address1) + (")")));
		f.v.html = "" + (f.v.html) + ("</a></td>");
		f.v.options[f.v.options.length] = f.v.html;
		e.php_push_var_lvalue (0, "i");
		e.php_postinc (1);
	},
	function (e,f) {
		f.s[0] = "\">Add new person...</a></td>";
		e.smcall (3, person,"render_resume", (["add_new", null]));
	},
	function (e,f) {
		var t3735 = f.s[1]; var t3736 = f.s[0]; 
		f.v.options[f.v.options.length] = ("<td><a href=\"#\" onclick=\"") + ("" + (t3735) + (t3736));
	},
	function (e,f) {
		f.v.fields = ([({type:"table", label:"", width:250, options:f.v.options})]);
		f.v.res = null;
		e.mcall (6, f.v.pop, "initialise", ([0, 0, "Choose", f.v.fields]));
	},
/*30*/	function (e,f) { e.mcall (2, f.v.pop, "open", ([])); },
	function (e,f) {  },
	function (e,f) {
		f.pc=34;
		e.mcall (2, f.v.pop, "run", ([]));
	},
	function (e,f) {
		f.pc=47;
		e.mcall (2, f.v.pop, "close", ([]));
	},
	function (e,f) {
		var t3741 = f.s[0]; f.v.event = t3741;
		if ((((f.v.event).action)) == (("cover"))) f.pc=36; else f.pc=37;
	},
/*35*/	function (e,f) { if ((((f.v.event).action)) == (("select"))) f.pc=39; else f.pc=40; },
	function (e,f) {
		f.pc=38;
		f.s[0] = true;
	},
	function (e,f) { f.s[0] = (((f.v.event).action)) == (("cancel")); },
	function (e,f) { var t3742 = f.s[0]; if (t3742) f.pc=33; else f.pc=35; },
	function (e,f) {
		f.pc=33;
		f.v.res = (f.v.matches)[((f.v.event).parm)];
	},
/*40*/	function (e,f) { if ((((f.v.event).action)) == (("add_new"))) f.pc=41; else f.pc=32; },
	function (e,f) {
		f.v.matches = ([]);
		if (builtin__preg_match ("/^(\\w+) (\\w+)$/",f.v.terms,f.v.matches)) f.pc=42; else f.pc=44;
	},
	function (e,f) { e.smcall (2, person,"add_new_person_helper", ([(f.v.matches)[(1)], (f.v.matches)[(2)]])); },
	function (e,f) { var t3745 = f.s[0]; e.return_pop (t3745); },
	function (e,f) { e.smcall (2, person,"add_new_person_helper", (["", ""])); },
/*45*/	function (e,f) { var t3747 = f.s[0]; f.v.res = t3747; },
	function (e,f) { f.pc=33; },
	function (e,f) { e.return_pop (f.v.res); },
	function (e,f) { if (((f.v.action)) == (("cover"))) f.pc=51; else f.pc=52; },
	function (e,f) { e.mcall (2, f.v.pop, "close", ([])); },
/*50*/	function (e,f) { e.return_pop (null); },
	function (e,f) {
		f.pc=53;
		f.s[0] = true;
	},
	function (e,f) { f.s[0] = ((f.v.action)) == (("cancel")); },
	function (e,f) { var t3748 = f.s[0]; if (t3748) f.pc=49; else f.pc=3; },
null	];

;
	c.args__append_telephone = c.pargs__append_telephone =  ["html","prefix","num","postfix","sep"];
	c.inst__append_telephone = c.pinst__append_telephone =  [
/*0*/	function (e,f) { if (((f.v.num)) == ((""))) f.pc=1; else f.pc=2; },
	function (e,f) { e.return_pop (f.v.html); },
	function (e,f) { if (((f.v.html)) !== ((""))) f.pc=3; else f.pc=4; },
	function (e,f) { f.v.html = "" + (f.v.html) + (f.v.sep); },
	function (e,f) {
		f.v.xnum = builtin__preg_replace ("/[^0-9\\+]/","",f.v.num);
		f.v.href = ("tel:") + (f.v.xnum);
		f.v.html = "" + (f.v.html) + ("" + (f.v.prefix) + (("<a href=\"") + ("" + (f.v.href) + (("\">") + ("" + (f.v.num) + (("</a>") + (f.v.postfix)))))));
		e.return_pop (f.v.html);
	},
null	];

;
	c.args__append_email = c.pargs__append_email =  ["html","prefix","addr","postfix","sep"];
	c.inst__append_email = c.pinst__append_email =  [
/*0*/	function (e,f) { if (((f.v.addr)) == ((""))) f.pc=1; else f.pc=2; },
	function (e,f) { e.return_pop (f.v.html); },
	function (e,f) { if (((f.v.html)) !== ((""))) f.pc=3; else f.pc=4; },
	function (e,f) { f.v.html = "" + (f.v.html) + (f.v.sep); },
	function (e,f) {
		f.v.href = ("mailto:") + (f.v.addr);
		f.v.html = "" + (f.v.html) + ("" + (f.v.prefix) + (("<a href=\"") + ("" + (f.v.href) + (("\">") + ("" + (f.v.addr) + (("</a>") + (f.v.postfix)))))));
		e.return_pop (f.v.html);
	},
null	];

;
	c.args__append_web = c.pargs__append_web =  ["html","prefix","addr","postfix","sep"];
	c.inst__append_web = c.pinst__append_web =  [
/*0*/	function (e,f) { if (((f.v.addr)) == ((""))) f.pc=1; else f.pc=2; },
	function (e,f) { e.return_pop (f.v.html); },
	function (e,f) { if (((f.v.html)) !== ((""))) f.pc=3; else f.pc=4; },
	function (e,f) { f.v.html = "" + (f.v.html) + (f.v.sep); },
	function (e,f) {
		f.v.href = f.v.addr;
		f.v.html = "" + (f.v.html) + ("" + (f.v.prefix) + (("<a href=\"") + ("" + (f.v.href) + (("\" target=\"_blank\">") + ("" + (f.v.addr) + (("</a>") + (f.v.postfix)))))));
		e.return_pop (f.v.html);
	},
null	];

;
	c.args__append_text = c.pargs__append_text =  ["html","prefix","line","postfix","sep"];
	c.inst__append_text = c.pinst__append_text =  [
/*0*/	function (e,f) { if (((f.v.line)) == ((""))) f.pc=1; else f.pc=2; },
	function (e,f) { e.return_pop (f.v.html); },
	function (e,f) { if (((f.v.html)) !== ((""))) f.pc=3; else f.pc=4; },
	function (e,f) { f.v.html = "" + (f.v.html) + (f.v.sep); },
	function (e,f) {
		f.v.html = "" + (f.v.html) + ("" + (f.v.prefix) + ("" + (f.v.line) + (f.v.postfix)));
		e.return_pop (f.v.html);
	},
null	];

;
	c.pargs__append_address =  ["html","prefix","postfix","sep"];
	c.pinst__append_address =  [
/*0*/	function (e,f) { e.smcall (5, person,"append_text", ([f.v.html, f.v.prefix, (f.v["this"]).address1, f.v.postfix, f.v.sep])); },
	function (e,f) {
		var t3762 = f.s[0]; f.v.html = t3762;
		e.smcall (5, person,"append_text", ([f.v.html, f.v.prefix, (f.v["this"]).address2, f.v.postfix, f.v.sep]));
	},
	function (e,f) {
		var t3764 = f.s[0]; f.v.html = t3764;
		e.smcall (5, person,"append_text", ([f.v.html, f.v.prefix, (f.v["this"]).address3, f.v.postfix, f.v.sep]));
	},
	function (e,f) {
		var t3766 = f.s[0]; f.v.html = t3766;
		e.smcall (5, person,"append_text", ([f.v.html, f.v.prefix, (f.v["this"]).address4, f.v.postfix, f.v.sep]));
	},
	function (e,f) {
		var t3768 = f.s[0]; f.v.html = t3768;
		if ((((f.v["this"]).postalcode)) != ((""))) f.pc=5; else f.pc=8;
	},
/*5*/	function (e,f) {
		f.v.mapref = ("http://maps.google.co.uk/maps?q=") + ((f.v["this"]).postalcode);
		if (((f.v.html)) !== ((""))) f.pc=6; else f.pc=7;
	},
	function (e,f) { f.v.html = "" + (f.v.html) + (f.v.sep); },
	function (e,f) { f.v.html = "" + (f.v.html) + ("" + (f.v.prefix) + (("<a href=\"") + ("" + (f.v.mapref) + (("\" target=\"_blank\">") + ("" + ((f.v["this"]).postalcode) + (("</a>") + (f.v.postfix))))))); },
	function (e,f) { e.return_pop (f.v.html); },
null	];

;
	c.pargs__mugshot_link =  [];
	c.pinst__mugshot_link =  [
/*0*/	function (e,f) { if ((f.v["this"]).mugshot_available) f.pc=1; else f.pc=3; },
	function (e,f) { e.smcall (3, page_dispatcher,"makelink", (["person", "mugshot", ({handle:(f.v["this"]).handle})])); },
	function (e,f) { var t3772 = f.s[0]; e.return_pop (t3772); },
	function (e,f) { e.return_pop ("/churchbuilder/graphics/target.jpeg"); },
null	];

;
	c.pargs__people_manager_url =  ["full"];
	c.pinst__people_manager_url =  [
/*0*/	function (e,f) {
		f.v.url = "";
		if (f.v.full) f.pc=1; else f.pc=2;
	},
	function (e,f) { f.v.url = ("http://") + (((browser.server())).HTTP_HOST); },
	function (e,f) { e.return_pop ("" + (f.v.url) + (("/churchbuilder/people-manager.php?h=") + ((f.v["this"]).handle))); },
null	];

;
	c.pargs__people_manager_tag =  ["full","contents"];
	c.pinst__people_manager_tag =  [
/*0*/	function (e,f) { if (((f.v.contents)) === ((null))) f.pc=1; else f.pc=2; },
	function (e,f) { f.v.contents = (f.v["this"]).nicename; },
	function (e,f) {
		f.s[0] = ("\">") + ("" + (f.v.contents) + ("</a>"));
		e.mcall (4, f.v["this"], "people_manager_url", ([f.v.full]));
	},
	function (e,f) {
		var t3776 = f.s[1]; var t3777 = f.s[0]; 
		e.return_pop (("<a href=\"") + ("" + (t3776) + (t3777)));
	},
null	];

;
	c.pargs__popup_summary =  [];
	c.pinst__popup_summary =  [
/*0*/	function (e,f) {
		f.v.html = "<div class=\"addressCard\">";
		f.s[0] = "\" />";
		e.mcall (3, f.v["this"], "mugshot_link", ([]));
	},
	function (e,f) {
		var t3779 = f.s[1]; var t3780 = f.s[0]; 
		f.v.html = "" + (f.v.html) + (("<img style=\"float:right\" src=\"") + ("" + (t3779) + (t3780)));
		f.v.html = "" + (f.v.html) + (("<div class=\"addressCardTitle\" style=\"font-size:20px;font-weight:bold\">") + ("" + ((f.v["this"]).nicename) + ("</div>")));
		f.v.html = "" + (f.v.html) + ("<div class=\"addressCardInfo\">");
		e.mcall (6, f.v["this"], "append_address", ([f.v.html, "", "<br/>", ""]));
	},
	function (e,f) {
		var t3785 = f.s[0]; f.v.html = t3785;
		f.v.html = "" + (f.v.html) + ("</div>");
		e.smcall (5, person,"append_telephone", ([f.v.html, "<div class=\"addressCardInfo\">Telephone: ", (f.v["this"]).telephone, "</div>", ""]));
	},
	function (e,f) {
		var t3788 = f.s[0]; f.v.html = t3788;
		e.smcall (5, person,"append_telephone", ([f.v.html, "<div class=\"addressCardInfo\">Mobile: ", (f.v["this"]).mobile, "</div>", ""]));
	},
	function (e,f) {
		var t3790 = f.s[0]; f.v.html = t3790;
		e.smcall (5, person,"append_telephone", ([f.v.html, "<div class=\"addressCardInfo\">Work: ", (f.v["this"]).work_phone, "</div>", ""]));
	},
/*5*/	function (e,f) {
		var t3792 = f.s[0]; f.v.html = t3792;
		e.smcall (5, person,"append_email", ([f.v.html, "<div style=\"clear:both\" class=\"addressCardInfo\">Email: ", (f.v["this"]).email, "</div>", ""]));
	},
	function (e,f) {
		var t3794 = f.s[0]; f.v.html = t3794;
		if ((((f.v["this"]).occupation)) != ((""))) f.pc=7; else f.pc=8;
	},
	function (e,f) { f.v.html = "" + (f.v.html) + (("<div style=\"clear:both\" class=\"addressCardInfo\">Occupation: ") + ("" + ((f.v["this"]).occupation) + ("</div>"))); },
	function (e,f) { if ((((f.v["this"]).website)) != ((""))) f.pc=9; else f.pc=10; },
	function (e,f) { f.v.html = "" + (f.v.html) + (("<div style=\"clear:both\" class=\"addressCardInfo\">Website: <a href=\"") + ("" + ((f.v["this"]).website) + (("\" target=\"_blank\">") + ("" + ((f.v["this"]).website) + ("</a></div>"))))); },
/*10*/	function (e,f) {
		f.v.html = "" + (f.v.html) + ("</div>");
		e.mcall (4, f.v["this"], "people_manager_tag", ([false, "View Profile"]));
	},
	function (e,f) {
		var t3798 = f.s[0]; 
		f.v.html = "" + (f.v.html) + (t3798);
		f.v.pop = new popup;
		e.mcall (2, f.v.pop, "initialise", ([]));
	},
	function (e,f) { e.mcall (5, f.v.pop, "open", ([300, 280, f.v.html])); },
	function (e,f) { e.php_builtin (0, "wait_for_input", 0); },
	function (e,f) { e.mcall (2, f.v.pop, "close", ([])); },
null	];

;
	c.args__impersonations =  [];
	c.inst__impersonations =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_function_async", (["person", "impersonations", ([])])); },
	function (e,f) { var t3801 = f.s[0]; e.return_pop (t3801); },
null	];

;
	c.pargs__do_impersonate =  [];
	c.pinst__do_impersonate =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["do_impersonate", ([])])); },
	function (e,f) { var t3802 = f.s[0]; e.return_pop (t3802); },
null	];

;
	c.args__impersonate_choose = c.pargs__impersonate_choose =  ["el","arg","ev"];
	c.inst__impersonate_choose = c.pinst__impersonate_choose =  [
/*0*/	function (e,f) {
		f.pc=10;
		e.smcall (0, person,"is_webmaster", ([]));
	},
	function (e,f) { e.smcall (0, person,"lookup", ([])); },
	function (e,f) {
		f.pc=11;
		var t3804 = f.s[0]; f.v.p = t3804;
	},
	function (e,f) { e.smcall (0, menu,"create", ([])); },
	function (e,f) {
		var t3806 = f.s[0]; f.v.m = t3806;
		e.smcall (0, person,"impersonations", ([]));
	},
/*5*/	function (e,f) {
		var t3808 = f.s[0]; f.v.imp = t3808;
		f.v._k234 = e.enumkeys (f.v.imp);
	},
	function (e,f) {
		f.pc=8;
		if (!((f.v._k234).length)) f.pc=7;
	},
	function (e,f) {
		f.pc=9;
		e.smcall (1, popupmenu,"run", ([f.v.m]));
	},
	function (e,f) {
		f.pc=6;
		f.s[0] = f.v._i235 = (f.v._k234).shift();
		f.s[1] = f.v.person = (f.v.imp)[(f.v._i235)];
		e.mcall (6, f.v.m, "add_item", ([f.v.person, (f.v.person).nicename]));
	},
	function (e,f) {
		f.pc=11;
		var t3813 = f.s[0]; f.v.p = t3813;
	},
/*10*/	function (e,f) { var t3814 = f.s[0]; if (t3814) f.pc=1; else f.pc=3; },
	function (e,f) { if (((f.v.p)) !== ((null))) f.pc=12; else f.pc=-1; },
	function (e,f) { e.mcall (2, f.v.p, "do_impersonate", ([])); },
	function (e,f) { e.mcall (2, (window).location, "reload", ([])); },
null	];

;
	c.args__logged_in = c.pargs__logged_in =  [];
	c.inst__logged_in = c.pinst__logged_in =  [
/*0*/	function (e,f) {
		e.php_push_static_var (1, person,"me");
		var t3815 = f.s[1]; 
		if (((t3815)) !== ((null))) f.pc=1; else f.pc=2;
	},
	function (e,f) {
		f.pc=3;
		f.s[0] = true;
	},
	function (e,f) { e.smcall (0, person,"is_webmaster", ([])); },
	function (e,f) { var t3816 = f.s[0]; e.return_pop (t3816); },
null	];

;
	c.args__i_match_query = c.pargs__i_match_query =  ["queryname"];
	c.inst__i_match_query = c.pinst__i_match_query =  [
/*0*/	function (e,f) { if (((f.v.queryname)) == (("Everyone"))) f.pc=1; else f.pc=2; },
	function (e,f) { e.return_pop (true); },
	function (e,f) {
		e.php_push_static_var (0, person,"me");
		var t3817 = f.s[0]; 
		if (!((t3817) !== undefined)) f.pc=3; else f.pc=4;
	},
	function (e,f) { e.return_pop (false); },
	function (e,f) {
		e.php_push_static_var (0, person,"me");
		var t3819 = f.s[0]; f.v.x = t3819;
		if (((f.v.x)) === ((null))) f.pc=5; else f.pc=6;
	},
/*5*/	function (e,f) { e.return_pop (false); },
	function (e,f) { e.mcall (3, f.v.x, "matches_query", ([f.v.queryname])); },
	function (e,f) {
		var t3821 = f.s[0]; f.v.res = t3821;
		e.return_pop (f.v.res);
	},
null	];

;
	c.args__i_match_expr = c.pargs__i_match_expr =  ["expr"];
	c.inst__i_match_expr = c.pinst__i_match_expr =  [
/*0*/	function (e,f) { if (((f.v.expr)) == (("P"))) f.pc=1; else f.pc=2; },
	function (e,f) { e.return_pop (true); },
	function (e,f) {
		e.php_push_static_var (0, person,"me");
		var t3822 = f.s[0]; 
		if (!((t3822) !== undefined)) f.pc=3; else f.pc=4;
	},
	function (e,f) { e.return_pop (false); },
	function (e,f) {
		e.php_push_static_var (0, person,"me");
		var t3824 = f.s[0]; f.v.x = t3824;
		if (((f.v.x)) === ((null))) f.pc=5; else f.pc=6;
	},
/*5*/	function (e,f) { e.return_pop (false); },
	function (e,f) { e.mcall (3, f.v.x, "matches_expr", ([f.v.expr])); },
	function (e,f) { var t3825 = f.s[0]; e.return_pop (t3825); },
null	];

;
	c.args__calc_is_webmaster =  [];
	c.inst__calc_is_webmaster =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_function_async", (["person", "calc_is_webmaster", ([])])); },
	function (e,f) { var t3826 = f.s[0]; e.return_pop (t3826); },
null	];

;
	c.args__is_webmaster = c.pargs__is_webmaster =  [];
	c.inst__is_webmaster = c.pinst__is_webmaster =  [
/*0*/	function (e,f) {
		e.php_push_static_var (0, person,"is_webmaster_cache");
		var t3827 = f.s[0]; e.return_pop (t3827);
	},
null	];

;
	c.args__lose_superpowers =  [];
	c.inst__lose_superpowers =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_function_async", (["person", "lose_superpowers", ([])])); },
	function (e,f) { var t3828 = f.s[0]; e.return_pop (t3828); },
null	];

;
	c.args__get_superpowers =  ["values"];
	c.inst__get_superpowers =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_function_async", (["person", "get_superpowers", ([f.v.values])])); },
	function (e,f) { var t3829 = f.s[0]; e.return_pop (t3829); },
null	];

;
	c.pargs__do_set_superpowers_pin =  ["newpw"];
	c.pinst__do_set_superpowers_pin =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["do_set_superpowers_pin", ([f.v.newpw])])); },
	function (e,f) { var t3830 = f.s[0]; e.return_pop (t3830); },
null	];

;
	c.args__superpowers_challenge =  [];
	c.inst__superpowers_challenge =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_function_async", (["person", "superpowers_challenge", ([])])); },
	function (e,f) { var t3831 = f.s[0]; e.return_pop (t3831); },
null	];

;
	c.args__superpowers_dialog = c.pargs__superpowers_dialog =  [];
	c.inst__superpowers_dialog = c.pinst__superpowers_dialog =  [
/*0*/	function (e,f) {
		f.pc=6;
		e.smcall (0, person,"is_webmaster", ([]));
	},
	function (e,f) { e.smcall (0, person,"lose_superpowers", ([])); },
	function (e,f) {
		f.pc=-1;
		e.smcall (2, browser,"reload", ([({}), ([])]));
	},
	function (e,f) {
		f.pc=5;
		e.smcall (4, pin,"run_dialog", (["Superpowers Challenge", "person", "superpowers_challenge", "get_superpowers"]));
	},
	function (e,f) {
		f.pc=-1;
		e.smcall (2, browser,"reload", ([({}), ([])]));
	},
/*5*/	function (e,f) { var t3832 = f.s[0]; if (t3832) f.pc=4; else f.pc=-1; },
	function (e,f) { var t3833 = f.s[0]; if (t3833) f.pc=1; else f.pc=3; },
null	];

;
	c.args__my_uid = c.pargs__my_uid =  [];
	c.inst__my_uid = c.pinst__my_uid =  [
/*0*/	function (e,f) {
		e.php_push_static_var (0, person,"me");
		var t3834 = f.s[0]; 
		if (!((t3834) !== undefined)) f.pc=1; else f.pc=2;
	},
	function (e,f) { e.return_pop (0); },
	function (e,f) {
		e.php_push_static_var (0, person,"me");
		var t3836 = f.s[0]; f.v.x = t3836;
		if (((f.v.x)) === ((null))) f.pc=3; else f.pc=4;
	},
	function (e,f) { e.return_pop (0); },
	function (e,f) { e.return_pop ((f.v.x).rowid); },
null	];

;
	c.pargs__search_row_fields =  [];
	c.pinst__search_row_fields =  [
/*0*/	function (e,f) { e.mcall (6, f.v["this"], "append_address", (["", "", "", "<br/>"])); },
	function (e,f) {
		var t3838 = f.s[0]; f.v.addr = t3838;
		e.smcall (5, person,"append_email", ([f.v.addr, "", (f.v["this"]).email, "", "<br/>"]));
	},
	function (e,f) {
		var t3840 = f.s[0]; f.v.addr = t3840;
		e.smcall (5, person,"append_email", ([f.v.addr, "", (f.v["this"]).other_email, "", "<br/>"]));
	},
	function (e,f) {
		var t3842 = f.s[0]; f.v.addr = t3842;
		e.smcall (5, person,"append_web", ([f.v.addr, "", (f.v["this"]).website, "", "<br/>"]));
	},
	function (e,f) {
		var t3844 = f.s[0]; f.v.addr = t3844;
		f.v.phone = "";
		e.smcall (5, person,"append_telephone", ([f.v.phone, "Home:", (f.v["this"]).telephone, "", "<br/>"]));
	},
/*5*/	function (e,f) {
		var t3847 = f.s[0]; f.v.phone = t3847;
		e.smcall (5, person,"append_telephone", ([f.v.phone, "Mobile:", (f.v["this"]).mobile, "", "<br/>"]));
	},
	function (e,f) {
		var t3849 = f.s[0]; f.v.phone = t3849;
		e.smcall (5, person,"append_telephone", ([f.v.phone, "Work:", (f.v["this"]).work_phone, "", "<br/>"]));
	},
	function (e,f) {
		var t3851 = f.s[0]; f.v.phone = t3851;
		e.smcall (5, person,"append_text", ([f.v.phone, "Occupation:", (f.v["this"]).occupation, "", "<br/>"]));
	},
	function (e,f) {
		var t3853 = f.s[0]; f.v.phone = t3853;
		f.s[0] = "\" />";
		e.mcall (3, f.v["this"], "mugshot_link", ([]));
	},
	function (e,f) {
		var t3854 = f.s[1]; var t3855 = f.s[0]; 
		f.v.mugshot = ("<img src=\"") + ("" + (t3854) + (t3855));
		e.mcall (4, f.v["this"], "people_manager_tag", ([false, null]));
	},
/*10*/	function (e,f) {
		var t3858 = f.s[0]; f.v.name = t3858;
		e.return_pop (([f.v.name, f.v.addr, f.v.phone, f.v.mugshot]));
	},
null	];

;
	c.args__get_field_info = c.pargs__get_field_info =  ["name"];
	c.inst__get_field_info = c.pinst__get_field_info =  [
/*0*/	function (e,f) { e.smcall (0, person,"get_user_fields", ([])); },
	function (e,f) {
		var t3860 = f.s[0]; f.v.fs = t3860;
		f.v._k236 = e.enumkeys (f.v.fs);
	},
	function (e,f) {
		f.pc=4;
		if (!((f.v._k236).length)) f.pc=3;
	},
	function (e,f) { e.return_pop (false); },
	function (e,f) {
		f.s[0] = f.v._i237 = (f.v._k236).shift();
		f.s[1] = f.v.f = (f.v.fs)[(f.v._i237)];
		if ((((f.v.f).name)) == ((f.v.name))) f.pc=5; else f.pc=2;
	},
/*5*/	function (e,f) { e.return_pop (f.v.f); },
null	];

;
	c.pargs__can_write_field =  ["fname"];
	c.pinst__can_write_field =  [
/*0*/	function (e,f) { e.smcall (1, person,"get_field_info", ([f.v.fname])); },
	function (e,f) {
		var t3865 = f.s[0]; f.v.f = t3865;
		if (((f.v.f)) == ((null))) f.pc=2; else f.pc=3;
	},
	function (e,f) { e.return_pop (false); },
	function (e,f) {
		f.pc=6;
		f.v.perms = (f.v.f).write;
		e.smcall (0, person,"my_uid", ([]));
	},
	function (e,f) { if ((((f.v.perms).owner)) == (("1"))) f.pc=5; else f.pc=7; },
/*5*/	function (e,f) { e.return_pop (true); },
	function (e,f) {
		var t3867 = f.s[0]; 
		if ((((f.v["this"]).rowid)) == ((t3867))) f.pc=4; else f.pc=7;
	},
	function (e,f) {
		e.php_push_static_var (1, person,"me");
		var t3868 = f.s[1]; 
		if (((t3868)) !== ((null))) f.pc=10; else f.pc=16;
	},
	function (e,f) { if ((((f.v.perms).owner)) == (("1"))) f.pc=9; else f.pc=18; },
	function (e,f) { e.return_pop (true); },
/*10*/	function (e,f) {
		e.php_push_static_var (2, person,"me");
		var t3869 = f.s[2]; 
		if ((((t3869).relation)) == ((1))) f.pc=11; else f.pc=12;
	},
	function (e,f) {
		f.pc=13;
		f.s[0] = true;
	},
	function (e,f) {
		e.php_push_static_var (2, person,"me");
		var t3870 = f.s[2]; 
		f.s[0] = (((t3870).relation)) == ((2));
	},
	function (e,f) { var t3871 = f.s[0]; if (t3871) f.pc=14; else f.pc=15; },
	function (e,f) {
		f.pc=17;
		e.php_push_static_var (2, person,"me");
		var t3872 = f.s[2]; 
		f.s[0] = (((t3872).famref)) == (((f.v["this"]).famref));
	},
/*15*/	function (e,f) {
		f.pc=17;
		f.s[0] = false;
	},
	function (e,f) { f.s[0] = false; },
	function (e,f) { var t3873 = f.s[0]; if (t3873) f.pc=8; else f.pc=18; },
	function (e,f) {
		e.php_push_static_var (0, person,"i_can_edit");
		var t3874 = f.s[0]; if (t3874) f.pc=19; else f.pc=26;
	},
	function (e,f) { if ((((f.v.perms).admin)) == (("1"))) f.pc=20; else f.pc=21; },
/*20*/	function (e,f) { e.return_pop (true); },
	function (e,f) { if ((((f.v.perms).admin)) == (("adult"))) f.pc=23; else f.pc=24; },
	function (e,f) { e.return_pop (true); },
	function (e,f) {
		f.pc=25;
		f.s[0] = (f.v["this"]).adult;
	},
	function (e,f) { f.s[0] = false; },
/*25*/	function (e,f) { var t3875 = f.s[0]; if (t3875) f.pc=22; else f.pc=26; },
	function (e,f) {
		e.php_push_static_var (0, person,"i_am_childrens_worker");
		var t3876 = f.s[0]; if (t3876) f.pc=27; else f.pc=29;
	},
	function (e,f) { if ((((f.v.perms).cwork)) == (("1"))) f.pc=28; else f.pc=29; },
	function (e,f) { e.return_pop (true); },
	function (e,f) {
		f.pc=32;
		e.smcall (0, person,"is_webmaster", ([]));
	},
/*30*/	function (e,f) { if ((((f.v.perms).webmasters)) == (("1"))) f.pc=31; else f.pc=33; },
	function (e,f) { e.return_pop (true); },
	function (e,f) { var t3877 = f.s[0]; if (t3877) f.pc=30; else f.pc=33; },
	function (e,f) { e.return_pop (false); },
null	];

;
	c.pargs__save_value =  ["fname","value"];
	c.pinst__save_value =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["save_value", ([f.v.fname, f.v.value])])); },
	function (e,f) { var t3878 = f.s[0]; e.return_pop (t3878); },
null	];

;
	c.pargs__set_value =  ["f","value"];
	c.pinst__set_value =  [
/*0*/	function (e,f) {
		f.v.fname = (f.v.f).name;
		f.v.value = builtin__trim (f.v.value);
		e.mcall (4, f.v["this"], "save_value", ([f.v.fname, f.v.value]));
	},
	function (e,f) {
		var t3882 = f.s[0]; f.v.ok = t3882;
		if (!(f.v.ok)) f.pc=2; else f.pc=4;
	},
	function (e,f) { e.smcall (1, popupokcancel,"run", (["Save failed"])); },
	function (e,f) { f.pc=-1; },
	function (e,f) {
		f.s[0] = builtin__ob_start ();
		e.mcall (3, f.v["this"], "render_field", ([f.v.f]));
	},
/*5*/	function (e,f) {
		f.v.text = builtin__ob_get_clean ();
		e.mcall (3, document, "getElementById", ([("efield-") + (f.v.fname)]));
	},
	function (e,f) {
		var t3885 = f.s[0]; f.v.el = t3885;
		f.v.el.innerHTML = f.v.text;
	},
null	];

;
	c.pargs__edit_field =  ["el","arg","ev"];
	c.pinst__edit_field =  [
/*0*/	function (e,f) { e.smcall (1, person,"get_field_info", ([f.v.arg])); },
	function (e,f) {
		var t3888 = f.s[0]; f.v.f = t3888;
		if ((((f.v.f).type)) == (("yesno"))) f.pc=2; else f.pc=7;
	},
	function (e,f) { e.smcall (1, popupmenu,"quick", ([(["Yes", "No"])])); },
	function (e,f) {
		var t3890 = f.s[0]; f.v.r = t3890;
		if (((f.v.r)) == (("Yes"))) f.pc=4; else f.pc=5;
	},
	function (e,f) {
		f.pc=7;
		e.mcall (4, f.v["this"], "set_value", ([f.v.f, "1"]));
	},
/*5*/	function (e,f) { if (((f.v.r)) == (("No"))) f.pc=6; else f.pc=7; },
	function (e,f) { e.mcall (4, f.v["this"], "set_value", ([f.v.f, "0"])); },
	function (e,f) { if ((((f.v.f).type)) == (("enum"))) f.pc=8; else f.pc=16; },
	function (e,f) {
		f.v.m = ([]);
		f.v._k238 = e.enumkeys ((f.v.f).options);
	},
	function (e,f) {
		f.pc=11;
		if (!((f.v._k238).length)) f.pc=10;
	},
/*10*/	function (e,f) {
		f.pc=12;
		e.smcall (1, popupmenu,"quick", ([f.v.m]));
	},
	function (e,f) {
		f.pc=9;
		f.s[0] = f.v.opt = (f.v._k238).shift();
		f.s[1] = f.v.text = ((f.v.f).options)[(f.v.opt)];
		f.v.m[f.v.m.length] = f.v.text;
	},
	function (e,f) {
		var t3897 = f.s[0]; f.v.r = t3897;
		f.v._k240 = e.enumkeys ((f.v.f).options);
	},
	function (e,f) { if (!((f.v._k240).length)) f.pc=16; },
	function (e,f) {
		f.s[0] = f.v.opt = (f.v._k240).shift();
		f.s[1] = f.v.text = ((f.v.f).options)[(f.v.opt)];
		if (((f.v.r)) == ((f.v.text))) f.pc=15; else f.pc=13;
	},
/*15*/	function (e,f) {
		f.pc=13;
		e.mcall (6, f.v["this"], "set_value", ([f.v.f, f.v.opt]));
	},
	function (e,f) { if ((((f.v.f).type)) == (("gender"))) f.pc=17; else f.pc=22; },
	function (e,f) { e.smcall (1, popupmenu,"quick", ([(["Male", "Female"])])); },
	function (e,f) {
		var t3902 = f.s[0]; f.v.r = t3902;
		if (((f.v.r)) == (("Male"))) f.pc=19; else f.pc=20;
	},
	function (e,f) {
		f.pc=22;
		e.mcall (4, f.v["this"], "set_value", ([f.v.f, "M"]));
	},
/*20*/	function (e,f) { if (((f.v.r)) == (("Female"))) f.pc=21; else f.pc=22; },
	function (e,f) { e.mcall (4, f.v["this"], "set_value", ([f.v.f, "F"])); },
	function (e,f) { if ((((f.v.f).type)) == (("text"))) f.pc=26; else f.pc=27; },
	function (e,f) { e.smcall (6, popupcombobox,"run", ([0, 0, (f.v.f).label, null, true, (f.v["this"])[(f.v.arg)]])); },
	function (e,f) {
		var t3904 = f.s[0]; f.v.r = t3904;
		if (((f.v.r)) !== ((null))) f.pc=25; else f.pc=35;
	},
/*25*/	function (e,f) {
		f.pc=35;
		e.mcall (4, f.v["this"], "set_value", ([f.v.f, builtin__trim (f.v.r)]));
	},
	function (e,f) {
		f.pc=34;
		f.s[0] = true;
	},
	function (e,f) { if ((((f.v.f).type)) == (("email"))) f.pc=28; else f.pc=29; },
	function (e,f) {
		f.pc=34;
		f.s[0] = true;
	},
	function (e,f) { if ((((f.v.f).type)) == (("dn"))) f.pc=30; else f.pc=31; },
/*30*/	function (e,f) {
		f.pc=34;
		f.s[0] = true;
	},
	function (e,f) { if ((((f.v.f).type)) == (("numeric"))) f.pc=32; else f.pc=33; },
	function (e,f) {
		f.pc=34;
		f.s[0] = true;
	},
	function (e,f) { f.s[0] = (((f.v.f).type)) == (("postcode")); },
	function (e,f) { var t3905 = f.s[0]; if (t3905) f.pc=23; else f.pc=35; },
/*35*/	function (e,f) { if ((((f.v.f).type)) == (("date"))) f.pc=36; else f.pc=43; },
	function (e,f) { if ((((f.v["this"])[(f.v.arg)])) == ((0))) f.pc=37; else f.pc=38; },
	function (e,f) {
		f.pc=39;
		f.v.ov = "0000-00-00";
	},
	function (e,f) { f.v.ov = builtin__date ("Y-m-d",(f.v["this"])[(f.v.arg)]); },
	function (e,f) { e.smcall (6, popupcombobox,"run", ([0, 0, (f.v.f).label, null, true, f.v.ov])); },
/*40*/	function (e,f) {
		var t3909 = f.s[0]; f.v.r = t3909;
		if (((f.v.r)) !== ((null))) f.pc=41; else f.pc=43;
	},
	function (e,f) { e.smcall (1, person,"parse_mysql_date", ([f.v.r])); },
	function (e,f) {
		var t3911 = f.s[0]; f.v.evalue = t3911;
		e.mcall (4, f.v["this"], "set_value", ([f.v.f, f.v.evalue]));
	},
	function (e,f) { if ((((f.v.f).type)) == (("hidden"))) f.pc=-1; else f.pc=-1; },
null	];

;
	c.args__parse_mysql_date =  ["d"];
	c.inst__parse_mysql_date =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_function_async", (["person", "parse_mysql_date", ([f.v.d])])); },
	function (e,f) { var t3912 = f.s[0]; e.return_pop (t3912); },
null	];

;
	c.pargs__render_field =  ["f"];
	c.pinst__render_field =  [
/*0*/	function (e,f) {
		f.v.fname = (f.v.f).name;
		f.v.value = (f.v["this"])[(f.v.fname)];
		if (((builtin__trim (f.v.value))) == ((""))) f.pc=1; else f.pc=2;
	},
	function (e,f) { f.v.value = "[unset]"; },
	function (e,f) { if ((((f.v.f).type)) == (("yesno"))) f.pc=3; else f.pc=9; },
	function (e,f) { if (((f.v.value)) == (("1"))) f.pc=4; else f.pc=5; },
	function (e,f) {
		f.pc=8;
		f.s[0] = "Yes";
	},
/*5*/	function (e,f) { if (((f.v.value)) == (("0"))) f.pc=6; else f.pc=7; },
	function (e,f) {
		f.pc=8;
		f.s[0] = "No";
	},
	function (e,f) { f.s[0] = "[unset]"; },
	function (e,f) {
		f.pc=30;
		var t3917 = f.s[0]; f.v.value = t3917;
	},
	function (e,f) { if ((((f.v.f).type)) == (("gender"))) f.pc=10; else f.pc=16; },
/*10*/	function (e,f) { if (((f.v.value)) == (("M"))) f.pc=11; else f.pc=12; },
	function (e,f) {
		f.pc=15;
		f.s[0] = "Male";
	},
	function (e,f) { if (((f.v.value)) == (("F"))) f.pc=13; else f.pc=14; },
	function (e,f) {
		f.pc=15;
		f.s[0] = "Female";
	},
	function (e,f) { f.s[0] = "[unset]"; },
/*15*/	function (e,f) {
		f.pc=30;
		var t3919 = f.s[0]; f.v.value = t3919;
	},
	function (e,f) { if ((((f.v.f).type)) == (("date"))) f.pc=17; else f.pc=20; },
	function (e,f) { if (((f.v.value)) == ((0))) f.pc=18; else f.pc=19; },
	function (e,f) {
		f.pc=30;
		f.v.value = "[unset]";
	},
	function (e,f) {
		f.pc=30;
		f.v.value = builtin__date ("jS M Y",f.v.value);
	},
/*20*/	function (e,f) { if ((((f.v.f).type)) == (("enum"))) f.pc=21; else f.pc=25; },
	function (e,f) { f.v._k242 = e.enumkeys ((f.v.f).options); },
	function (e,f) { if (!((f.v._k242).length)) f.pc=30; },
	function (e,f) {
		f.v.opt = (f.v._k242).shift();
		f.v.text = ((f.v.f).options)[(f.v.opt)];
		if (((f.v.value)) == ((f.v.opt))) f.pc=24; else f.pc=22;
	},
	function (e,f) {
		f.pc=22;
		f.v.value = f.v.text;
	},
/*25*/	function (e,f) { if ((((f.v.f).type)) == (("user"))) f.pc=26; else f.pc=30; },
	function (e,f) { e.smcall (1, person,"fetch_by_id", ([f.v.value])); },
	function (e,f) {
		var t3927 = f.s[0]; f.v.creator = t3927;
		if (((f.v.creator)) == ((null))) f.pc=28; else f.pc=29;
	},
	function (e,f) {
		f.pc=30;
		f.v.value = "unknown";
	},
	function (e,f) { f.v.value = (f.v.creator).nicename; },
/*30*/	function (e,f) { window.__outbuffer += f.v.value; },
null	];

;
	c.pargs__set_mugshot =  ["ul"];
	c.pinst__set_mugshot =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["set_mugshot", ([f.v.ul])])); },
	function (e,f) { var t3930 = f.s[0]; e.return_pop (t3930); },
null	];

;
	c.pargs__delete_mugshot =  [];
	c.pinst__delete_mugshot =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["delete_mugshot", ([])])); },
	function (e,f) { var t3931 = f.s[0]; e.return_pop (t3931); },
null	];

;
	c.pargs__mugshot_button =  [];
	c.pinst__mugshot_button =  [
/*0*/	function (e,f) { e.smcall (1, popupmenu,"quick", ([(["Upload", "Delete"])])); },
	function (e,f) {
		var t3933 = f.s[0]; f.v.choice = t3933;
		if (((f.v.choice)) === (("Upload"))) f.pc=2; else f.pc=6;
	},
	function (e,f) {
		f.pc=5;
		f.v.ul = new uploader;
		e.mcall (2, f.v.ul, "run", ([]));
	},
	function (e,f) { e.mcall (3, f.v["this"], "set_mugshot", ([f.v.ul])); },
	function (e,f) {
		f.pc=-1;
		e.smcall (2, browser,"reload", ([({}), ([])]));
	},
/*5*/	function (e,f) { var t3935 = f.s[0]; if (t3935) f.pc=3; else f.pc=-1; },
	function (e,f) { if (((f.v.choice)) === (("Delete"))) f.pc=7; else f.pc=-1; },
	function (e,f) { e.mcall (2, f.v["this"], "delete_mugshot", ([])); },
	function (e,f) { e.smcall (2, browser,"reload", ([({}), ([])])); },
null	];

;
	c.args__create_new =  ["nname","sname","force"];
	c.inst__create_new =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_function_async", (["person", "create_new", ([f.v.nname, f.v.sname, f.v.force])])); },
	function (e,f) { var t3936 = f.s[0]; e.return_pop (t3936); },
null	];

;
	c.pargs__fill_new_family_member =  ["p","relation"];
	c.pinst__fill_new_family_member =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["fill_new_family_member", ([f.v.p, f.v.relation])])); },
	function (e,f) { var t3937 = f.s[0]; e.return_pop (t3937); },
null	];

;
	c.pargs__add_new_family_member =  ["el","relation","ev"];
	c.pinst__add_new_family_member =  [
/*0*/	function (e,f) { if ((((f.v["this"]).famref)) == ((""))) f.pc=1; else f.pc=3; },
	function (e,f) { e.smcall (1, popupokcancel,"run", (["No family reference"])); },
	function (e,f) { f.pc=-1; },
	function (e,f) { e.smcall (2, person,"add_new_person_helper", (["", (f.v["this"]).sname])); },
	function (e,f) {
		var t3939 = f.s[0]; f.v.p = t3939;
		if (((f.v.p)) !== ((null))) f.pc=5; else f.pc=-1;
	},
/*5*/	function (e,f) { e.mcall (4, f.v.p, "fill_new_family_member", ([f.v["this"], f.v.relation])); },
	function (e,f) { e.mcall (3, f.v.p, "people_manager_url", ([false])); },
	function (e,f) { var t3941 = f.s[0]; window.location = t3941; },
null	];

;
	c.pargs__get_family =  [];
	c.pinst__get_family =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["get_family", ([])])); },
	function (e,f) { var t3942 = f.s[0]; e.return_pop (t3942); },
null	];

;
	c.pargs__do_copy_to_family =  ["which"];
	c.pinst__do_copy_to_family =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["do_copy_to_family", ([f.v.which])])); },
	function (e,f) { var t3943 = f.s[0]; e.return_pop (t3943); },
null	];

;
	c.pargs__copy_address_to_family =  ["el","arg","ev"];
	c.pinst__copy_address_to_family =  [
/*0*/	function (e,f) { if ((((f.v["this"]).famref)) == ((""))) f.pc=1; else f.pc=3; },
	function (e,f) { e.smcall (1, popupokcancel,"run", (["No family reference"])); },
	function (e,f) { f.pc=-1; },
	function (e,f) { e.mcall (3, f.v["this"], "do_copy_to_family", (["address"])); },
	function (e,f) { e.mcall (3, f.v["this"], "people_manager_url", ([false])); },
/*5*/	function (e,f) { var t3945 = f.s[0]; window.location = t3945; },
null	];

;
	c.pargs__copy_phone_to_family =  ["el","arg","ev"];
	c.pinst__copy_phone_to_family =  [
/*0*/	function (e,f) { if ((((f.v["this"]).famref)) == ((""))) f.pc=1; else f.pc=3; },
	function (e,f) { e.smcall (1, popupokcancel,"run", (["No family reference"])); },
	function (e,f) { f.pc=-1; },
	function (e,f) { e.mcall (3, f.v["this"], "do_copy_to_family", (["phone"])); },
	function (e,f) { e.mcall (3, f.v["this"], "people_manager_url", ([false])); },
/*5*/	function (e,f) { var t3947 = f.s[0]; window.location = t3947; },
null	];

;
	c.pargs__do_deactivate =  [];
	c.pinst__do_deactivate =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["do_deactivate", ([])])); },
	function (e,f) { var t3948 = f.s[0]; e.return_pop (t3948); },
null	];

;
	c.pargs__deactivate =  ["el","arg","ev"];
	c.pinst__deactivate =  [
/*0*/	function (e,f) {
		f.pc=2;
		e.smcall (1, popupokcancel,"run", (["Delete this person?"]));
	},
	function (e,f) { f.pc=-1; },
	function (e,f) {
		var t3949 = f.s[0]; 
		if (!(t3949)) f.pc=1; else f.pc=3;
	},
	function (e,f) { e.mcall (2, f.v["this"], "do_deactivate", ([])); },
	function (e,f) { e.smcall (2, browser,"reload", ([([]), ([])])); },
null	];

;
	c.pargs__get_groups =  [];
	c.pinst__get_groups =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["get_groups", ([])])); },
	function (e,f) { var t3950 = f.s[0]; e.return_pop (t3950); },
null	];

;
	c.pargs__render_groups_table =  [];
	c.pinst__render_groups_table =  [
/*0*/	function (e,f) {
		window.__outbuffer += "\n<table class=\"resultsTable\">\n";
		e.mcall (2, f.v["this"], "get_groups", ([]));
	},
	function (e,f) {
		var t3952 = f.s[0]; f.v.groups = t3952;
		f.v.odd = true;
		f.v._k244 = e.enumkeys (f.v.groups);
	},
	function (e,f) {
		f.pc=4;
		if (!((f.v._k244).length)) f.pc=3;
	},
	function (e,f) {
		f.pc=12;
		window.__outbuffer += "\n</table>\n<button onclick=\"";
		e.mcall (4, f.v["this"], "render_start", (["select_group_and_add", 0]));
	},
	function (e,f) {
		f.v._i245 = (f.v._k244).shift();
		f.v.gr = (f.v.groups)[(f.v._i245)];
		if (((f.v.gr)) !== ((null))) f.pc=5; else f.pc=2;
	},
/*5*/	function (e,f) {
		f.s[0] = "\">";
		if (f.v.odd) f.pc=6; else f.pc=7;
	},
	function (e,f) {
		f.pc=8;
		f.s[1] = "odd";
	},
	function (e,f) { f.s[1] = "even"; },
	function (e,f) {
		var t3957 = f.s[1]; var t3958 = f.s[0]; 
		f.v.html = ("<tr class=\"") + ("" + (t3957) + (t3958));
		f.v.html = "" + (f.v.html) + (("<td><a href=\"/churchbuilder/group-wizard.php?gid=") + ("" + ((f.v.gr).rowid) + (("\">") + ("" + ((f.v.gr).menuname) + ("</a></td>")))));
		f.v.html = "" + (f.v.html) + ("<td>");
		if ((f.v.gr).i_can_remove_member) f.pc=9; else f.pc=11;
	},
	function (e,f) {
		f.s[0] = "\">Remove</a>";
		e.mcall (5, f.v["this"], "render_start", (["remove_from_group", f.v.gr]));
	},
/*10*/	function (e,f) {
		var t3962 = f.s[1]; var t3963 = f.s[0]; 
		f.v.html = "" + (f.v.html) + (("<a href=\"#\" onclick=\"") + ("" + (t3962) + (t3963)));
	},
	function (e,f) {
		f.pc=2;
		f.v.html = "" + (f.v.html) + ("</td>");
		f.v.html = "" + (f.v.html) + ("</tr>");
		window.__outbuffer += f.v.html;
		f.v.odd = !(f.v.odd);
	},
	function (e,f) {
		var t3968 = f.s[0]; window.__outbuffer += t3968;
		window.__outbuffer += "\">Add to Group</button>\n";
	},
null	];

;
	c.pargs__remove_from_group =  ["el","group","ev"];
	c.pinst__remove_from_group =  [
/*0*/	function (e,f) { e.mcall (3, f.v["this"], "do_remove_from_group", ([f.v.group])); },
	function (e,f) { e.mcall (4, f.v["this"], "send_msg", (["update_notification", null])); },
null	];

;
	c.pargs__select_group_and_add =  [];
	c.pinst__select_group_and_add =  [
/*0*/	function (e,f) { e.smcall (0, group_list,"choose_group_by_menu", ([])); },
	function (e,f) {
		var t3970 = f.s[0]; f.v.group = t3970;
		if (((f.v.group)) === ((null))) f.pc=2; else f.pc=3;
	},
	function (e,f) { f.pc=-1; },
	function (e,f) { e.mcall (3, f.v["this"], "do_add_to_group", ([f.v.group])); },
	function (e,f) { e.mcall (4, f.v["this"], "send_msg", (["update_notification", null])); },
null	];

;
	c.args__add_new_person_helper = c.pargs__add_new_person_helper =  ["nname","sname"];
	c.inst__add_new_person_helper = c.pinst__add_new_person_helper =  [
/*0*/	function (e,f) {
		f.v.pop = new popupform;
		f.v.fields = ([]);
		f.v.fields[f.v.fields.length] = ({type:"text", name:"nname", label:"Usual first name", focus:true, value:f.v.nname});
		f.v.fields[f.v.fields.length] = ({type:"text", name:"sname", label:"Surname", value:f.v.sname});
		e.mcall (6, f.v.pop, "initialise", ([0, 0, "Create new person entry", f.v.fields]));
	},
	function (e,f) { e.mcall (2, f.v.pop, "open", ([])); },
	function (e,f) { e.mcall (2, f.v.pop, "run", ([])); },
	function (e,f) {
		var t3976 = f.s[0]; f.v.event = t3976;
		f.v.action = (f.v.event).action;
		if (((f.v.action)) == (("cancel"))) f.pc=6; else f.pc=7;
	},
	function (e,f) { e.mcall (2, f.v.pop, "close", ([])); },
/*5*/	function (e,f) { e.return_pop (null); },
	function (e,f) {
		f.pc=8;
		f.s[0] = true;
	},
	function (e,f) { f.s[0] = ((f.v.action)) == (("cover")); },
	function (e,f) { var t3978 = f.s[0]; if (t3978) f.pc=4; else f.pc=9; },
	function (e,f) { if (((f.v.action)) == (("OK"))) f.pc=10; else f.pc=22; },
/*10*/	function (e,f) { e.mcall (2, f.v.pop, "get_form_fields", ([])); },
	function (e,f) {
		var t3980 = f.s[0]; f.v.vals = t3980;
		e.mcall (2, f.v.pop, "close", ([]));
	},
	function (e,f) { e.smcall (3, person,"create_new", ([(f.v.vals).nname, (f.v.vals).sname, false])); },
	function (e,f) {
		var t3982 = f.s[0]; f.v.res = t3982;
		if (builtin__is_array (f.v.res)) f.pc=14; else f.pc=21;
	},
	function (e,f) {
		f.v.fields = ([({name:"people", type:"person_array", label:"Maybe...", width:600}), ({name:"cancel", type:"button", label:"Create", action:"cancel"})]);
		e.smcall (3, form,"create", ([null, f.v.fields, ({people:f.v.res})]));
	},
/*15*/	function (e,f) {
		var t3985 = f.s[0]; f.v.f = t3985;
		e.mcall (5, f.v.f, "popup", ([0, 0, "Found similar person"]));
	},
	function (e,f) {
		var t3987 = f.s[0]; f.v.ok = t3987;
		if (((f.v.ok)) === ((null))) f.pc=17; else f.pc=19;
	},
	function (e,f) { e.smcall (3, person,"create_new", ([(f.v.vals).nname, (f.v.vals).sname, true])); },
	function (e,f) {
		f.pc=21;
		var t3989 = f.s[0]; f.v.res = t3989;
	},
	function (e,f) { e.mcall (3, f.v.f, "get_env", (["selected_person"])); },
/*20*/	function (e,f) { var t3991 = f.s[0]; f.v.res = t3991; },
	function (e,f) { e.return_pop (f.v.res); },
	function (e,f) { e.return_pop (null); },
null	];

;
	c.args__add_new_person = c.pargs__add_new_person =  ["el","arg","ev"];
	c.inst__add_new_person = c.pinst__add_new_person =  [
/*0*/	function (e,f) { e.smcall (2, person,"add_new_person_helper", (["", ""])); },
	function (e,f) {
		var t3993 = f.s[0]; f.v.p = t3993;
		if (((f.v.p)) !== ((null))) f.pc=2; else f.pc=-1;
	},
	function (e,f) { e.mcall (3, f.v.p, "people_manager_url", ([false])); },
	function (e,f) { var t3995 = f.s[0]; window.location = t3995; },
null	];

;
	c.pargs__school_year =  [];
	c.pinst__school_year =  [
/*0*/	function (e,f) { if ((((f.v["this"]).dob)) == ((0))) f.pc=1; else f.pc=2; },
	function (e,f) { e.return_pop (""); },
	function (e,f) {
		f.v.now = builtin__time ();
		f.v.years = parseInt((builtin__date ("Y",f.v.now)),10) - parseInt((builtin__date ("Y",(f.v["this"]).dob)),10);
		f.s[0] = 9;
		f.s[1] = parseInt (builtin__date ("m",(f.v["this"]).dob),10);
		e.php_two_op (2, ">=");
		var t3998 = f.s[0]; if (t3998) f.pc=3; else f.pc=4;
	},
	function (e,f) {
		e.php_push_var_lvalue (0, "years");
		e.php_postdec (1);
	},
	function (e,f) {
		f.s[0] = 9;
		f.s[1] = parseInt (builtin__date ("m",f.v.now),10);
		e.php_two_op (2, ">=");
		var t4000 = f.s[0]; if (t4000) f.pc=5; else f.pc=6;
	},
/*5*/	function (e,f) {
		e.php_push_var_lvalue (0, "years");
		e.php_postinc (1);
	},
	function (e,f) {
		f.v.years = parseInt((f.v.years),10) - parseInt((5),10);
		f.v.years = parseInt((f.v.years),10) + parseInt(((f.v["this"]).school_year_adjust),10);
		if (((f.v.years)) > ((13))) f.pc=8; else f.pc=9;
	},
	function (e,f) { e.return_pop (""); },
	function (e,f) {
		f.pc=10;
		f.s[0] = true;
	},
	function (e,f) { f.s[0] = ((f.v.years)) < ((0)); },
/*10*/	function (e,f) { var t4004 = f.s[0]; if (t4004) f.pc=7; else f.pc=11; },
	function (e,f) { e.return_pop (f.v.years); },
null	];

;
	c.pargs__age =  [];
	c.pinst__age =  [
/*0*/	function (e,f) { if ((((f.v["this"]).dob)) == ((0))) f.pc=1; else f.pc=2; },
	function (e,f) { e.return_pop (""); },
	function (e,f) {
		f.v.now = builtin__time ();
		f.v.years = parseInt((builtin__date ("Y",f.v.now)),10) - parseInt((builtin__date ("Y",(f.v["this"]).dob)),10);
		if (((builtin__date ("md",f.v.now))) < ((builtin__date ("md",(f.v["this"]).dob)))) f.pc=3; else f.pc=4;
	},
	function (e,f) {
		e.php_push_var_lvalue (0, "years");
		e.php_postdec (1);
	},
	function (e,f) { e.return_pop (f.v.years); },
null	];

;
	c.pargs__send_activation_email_button =  ["el","arg","ev"];
	c.pinst__send_activation_email_button =  [
/*0*/	function (e,f) { e.mcall (2, f.v["this"], "send_activation_email", ([])); },
	function (e,f) { e.smcall (1, popupok,"run", (["Done"])); },
null	];

;
	c.args__bulk_export = c.pargs__bulk_export =  ["el","arg","ev"];
	c.inst__bulk_export = c.pinst__bulk_export =  [
/*0*/	function (e,f) { e.smcall (3, page_dispatcher,"makelink", (["person", "bulk_export", ([])])); },
	function (e,f) { e.php_static_method_call (1, browser,"redirect", 1); },
null	];

;
	c.args__handle_bulk_upload =  ["ul"];
	c.inst__handle_bulk_upload =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_function_async", (["person", "handle_bulk_upload", ([f.v.ul])])); },
	function (e,f) { var t4009 = f.s[0]; e.return_pop (t4009); },
null	];

;
	c.args__bulk_import = c.pargs__bulk_import =  ["el","arg","ev"];
	c.inst__bulk_import = c.pinst__bulk_import =  [
/*0*/	function (e,f) {
		f.pc=4;
		f.v.ul = new uploader;
		e.mcall (2, f.v.ul, "run", ([]));
	},
	function (e,f) { e.smcall (1, person,"handle_bulk_upload", ([f.v.ul])); },
	function (e,f) {
		var t4012 = f.s[0]; f.v.msg = t4012;
		if (((f.v.msg)) !== ((null))) f.pc=3; else f.pc=-1;
	},
	function (e,f) {
		f.pc=-1;
		e.smcall (1, popupok,"run", ([f.v.msg]));
	},
	function (e,f) { var t4013 = f.s[0]; if (t4013) f.pc=1; else f.pc=-1; },
null	];

;
};
person.init_methods (person);
rpcclass.setup_class (person, "person",0, (["handle","active","linkref","salutation","fname","nname","sname","nicename","telephone","show_phone","mobile","show_mobile","work_phone","email","show_email","other_email","email_notify_type","allow_reminders","address1","address2","address3","address4","postalcode","adult","gender","dob","school_year_adjust","alergies","famref","relation","notes","mailbox_name","mailbox_aliases","my_group_membership","username","mugshot_available","occupation","website","added_on","added_by","matches_expr_cache","rowid","listeners"]), ([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2]));
function people_manager () { this.do_construct (arguments); }
people_manager.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
};
people_manager.init_methods (people_manager);
rpcclass.setup_class (people_manager, "people_manager",0, (["type","listeners"]), ([0,2]));
function group_list () { this.do_construct (arguments); }
group_list.codegroup = "admin";
group_list.init_methods = function (c) {
	popupmenutree.init_methods(c);
	var cp = c.prototype;
	c.pargs__create_tree =  null;
	c.pargs__create_new =  null;
	c.pargs__select_and_open =  null;
	c.args__create =  null;
	c.args__choose_group_by_menu = c.pargs__choose_group_by_menu =  null;
};
group_list.init_methods (group_list);
rpcclass.setup_class (group_list, "group_list",0, (["groups","tree","admin","listeners"]), ([0,0,0,2]));
function group_member_row () { this.do_construct (arguments); }
group_member_row.codegroup = "admin";
group_member_row.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
	c.pargs__get_row_fields =  null;
	c.pargs__get_row_style =  null;
	c.pargs__click_select =  null;
	c.args__create = c.pargs__create =  null;
};
group_member_row.init_methods (group_member_row);
rpcclass.setup_class (group_member_row, "group_member_row",0, (["person","is_selected","listeners"]), ([0,0,2]));
function group_editor () { this.do_construct (arguments); }
group_editor.codegroup = "admin";
group_editor.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
	c.pargs__on_drag_group_stop_handler =  null;
	cp.on_drag_group_stop =  function (x,y,payload)
	{
{
		this.gte.drag_move  (x,y);;
		this.is_dragging = false;;
		this.call_self_using_engine  ("on_drag_group_stop_handler",[payload]);;
		}
			}

;
	cp.on_drag_group_move =  function (x,y)
	{
{
		this.gte.drag_move  (x,y);;
		}
			}

;
	c.pargs__on_drag_group_start =  null;
	c.pargs__on_row_click =  null;
	c.pargs__get_row_fields =  null;
	c.pargs__get_row_style =  null;
	c.pargs__quick_report =  null;
	c.pargs__add_one_member =  null;
	c.pargs__add_member =  null;
	c.pargs__remove_member =  null;
	c.pargs__rerender_count =  null;
	c.pargs__move_complete =  null;
	c.pargs__render_editor =  null;
	c.args__create = c.pargs__create =  null;
};
group_editor.init_methods (group_editor);
rpcclass.setup_class (group_editor, "group_editor",0, (["group","gte","dtm","is_dragging","is_copy","listeners"]), ([0,0,0,0,0,2]));
function query_editor () { this.do_construct (arguments); }
query_editor.codegroup = "admin";
query_editor.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
	c.pargs__edit =  null;
	c.pargs__quick_report =  null;
	c.pargs__on_drag_group_stop_handler =  null;
	cp.on_drag_group_stop =  function (x,y,payload)
	{
{
		this.gte.drag_move  (x,y);;
		this.is_dragging = false;;
		this.call_self_using_engine  ("on_drag_group_stop_handler",[payload]);;
		}
			}

;
	cp.on_drag_group_move =  function (x,y)
	{
{
		this.gte.drag_move  (x,y);;
		}
			}

;
	c.pargs__on_drag_group_start =  null;
	c.pargs__on_row_click =  null;
	c.pargs__get_row_fields =  null;
	c.pargs__get_row_style =  null;
	c.pargs__rerender_count =  null;
	c.pargs__move_complete =  null;
	c.pargs__render_editor =  null;
	c.args__create = c.pargs__create =  null;
};
query_editor.init_methods (query_editor);
rpcclass.setup_class (query_editor, "query_editor",0, (["query","gte","dtm","need_reload","listeners"]), ([0,0,0,0,2]));
function group_tree_editor_item () { this.do_construct (arguments); }
group_tree_editor_item.codegroup = "admin";
group_tree_editor_item.init_methods = function (c) {
	tree_editor_item.init_methods(c);
	var cp = c.prototype;
	cp.can_drop =  function ()
	{
var obj;{
		obj = this.item_context  ();;
		if (obj === null)
		{return (false) }
		;
		return (builtin__get_class (obj) == "group" && obj.i_am_owner);
		}
			}

;
	c.pargs__open_document =  null;
	c.pargs__close_document =  null;
	c.pargs__fullname =  null;
	c.pargs__icon =  null;
	c.pargs__delete_group =  null;
	c.pargs__on_right_click =  null;
};
group_tree_editor_item.init_methods (group_tree_editor_item);
rpcclass.setup_class (group_tree_editor_item, "group_tree_editor_item",0, (["is_open","parent","is_leaf","name","context","children","tree","listeners"]), ([0,0,0,0,0,0,0,2]));
function group_tree_editor () { this.do_construct (arguments); }
group_tree_editor.codegroup = "admin";
group_tree_editor.init_methods = function (c) {
	tree_editor.init_methods(c);
	var cp = c.prototype;
	c.pargs__do_move =  null;
	c.pargs__handle_drag_and_drop =  null;
};
group_tree_editor.init_methods (group_tree_editor);
rpcclass.setup_class (group_tree_editor, "group_tree_editor",0, (["admin","current_hover","current_item","doc","root","itemclass","listeners"]), ([0,0,0,0,0,0,2]));
function group () { this.do_construct (arguments); }
group.init_methods = function (c) {
	dbclass.init_methods(c);
	var cp = c.prototype;
	c.args__get_all_readable =  [];
	c.inst__get_all_readable =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_function_async", (["group", "get_all_readable", ([])])); },
	function (e,f) { var t4290 = f.s[0]; e.return_pop (t4290); },
null	];

;
	c.pargs__do_save =  ["str"];
	c.pinst__do_save =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["do_save", ([f.v.str])])); },
	function (e,f) { var t4291 = f.s[0]; e.return_pop (t4291); },
null	];

;
	c.pargs__copy_group_or_query =  ["oldgroup"];
	c.pinst__copy_group_or_query =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["copy_group_or_query", ([f.v.oldgroup])])); },
	function (e,f) { var t4292 = f.s[0]; e.return_pop (t4292); },
null	];

;
	c.args__popupobjeditor_fields = c.pargs__popupobjeditor_fields =  [];
	c.inst__popupobjeditor_fields = c.pinst__popupobjeditor_fields =  [
/*0*/	function (e,f) { e.return_pop (([({name:"menuname", label:"Menuname", type:"text", width:300}), ({name:"description", label:"Description", type:"text", width:300}), ({name:"owners", label:"Owners", type:"query_expr"}), ({name:"readers", label:"Readers", type:"query_expr"}), ({name:"is_role", label:"Is Role", type:"yesno"}), ({name:"is_historical", label:"Is Historical Record", type:"yesno"}), ({name:"attributes", label:"Attributes", type:"text"})])); },
null	];

;
	c.pargs__edit_properties =  [];
	c.pinst__edit_properties =  [
/*0*/	function (e,f) {
		f.pc=4;
		e.smcall (2, popupobjeditor,"edit", ([f.v["this"], "Group properties"]));
	},
	function (e,f) { e.smcall (1, popupobjeditor,"to_struct", ([f.v["this"]])); },
	function (e,f) { var t4293 = f.s[0]; e.mcall (3, f.v["this"], "do_save", ([t4293])); },
	function (e,f) { e.return_pop (true); },
	function (e,f) { var t4294 = f.s[0]; if (t4294) f.pc=1; else f.pc=5; },
/*5*/	function (e,f) { e.return_pop (false); },
null	];

;
	c.pargs__get_members =  [];
	c.pinst__get_members =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["get_members", ([])])); },
	function (e,f) { var t4295 = f.s[0]; e.return_pop (t4295); },
null	];

;
	c.pargs__remove =  [];
	c.pinst__remove =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["remove", ([])])); },
	function (e,f) { var t4296 = f.s[0]; e.return_pop (t4296); },
null	];

;
	c.args__can_rename_all =  ["oldname","newname"];
	c.inst__can_rename_all =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_function_async", (["group", "can_rename_all", ([f.v.oldname, f.v.newname])])); },
	function (e,f) { var t4297 = f.s[0]; e.return_pop (t4297); },
null	];

;
	c.args__rename_all =  ["oldname","newname"];
	c.inst__rename_all =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_function_async", (["group", "rename_all", ([f.v.oldname, f.v.newname])])); },
	function (e,f) { var t4298 = f.s[0]; e.return_pop (t4298); },
null	];

;
	c.pargs__as_expr_str =  [];
	c.pinst__as_expr_str =  [
/*0*/	function (e,f) { e.return_pop (("G") + ("" + ((f.v["this"]).rowid) + ("."))); },
null	];

;
	c.args__create_new =  ["menuname"];
	c.inst__create_new =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_function_async", (["group", "create_new", ([f.v.menuname])])); },
	function (e,f) { var t4299 = f.s[0]; e.return_pop (t4299); },
null	];

;
};
group.init_methods (group);
rpcclass.setup_class (group, "group",1, (["menuname","description","owners","readers","is_role","is_historical","attributes","dtm","i_am_owner","i_can_remove_member","i_can_read","rowid","listeners"]), ([0,0,0,0,0,0,0,0,0,0,0,0,2]));
function string_stream () { this.do_construct (arguments); }
string_stream.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
	c.args__create = c.pargs__create =  ["str"];
	c.inst__create = c.pinst__create =  [
/*0*/	function (e,f) {
		f.v.res = new string_stream;
		f.v.res.string = f.v.str;
		e.mcall (2, f.v.res, "advance", ([]));
	},
	function (e,f) { e.return_pop (f.v.res); },
null	];

;
	c.pargs__advance =  [];
	c.pinst__advance =  [
/*0*/	function (e,f) { if (((f.v["this"]).string).length) f.pc=1; else f.pc=2; },
	function (e,f) {
		f.pc=-1;
		f.v["this"].ch = builtin__substr ((f.v["this"]).string,0,1);
		f.v["this"].string = builtin__substr ((f.v["this"]).string,1);
	},
	function (e,f) { f.v["this"].ch = ""; },
null	];

;
	c.pargs__ensure =  ["ch"];
	c.pinst__ensure =  [
/*0*/	function (e,f) { if ((((f.v["this"]).ch)) != ((f.v.ch))) f.pc=1; else f.pc=-1; },
	function (e,f) { f.s[0] = builtin__die (("expected ") + ("" + (f.v.ch) + ((" got ") + ((f.v["this"]).ch)))); },
null	];

;
	c.pargs__skip =  ["ch"];
	c.pinst__skip =  [
/*0*/	function (e,f) { e.mcall (3, f.v["this"], "ensure", ([f.v.ch])); },
	function (e,f) { e.mcall (2, f.v["this"], "advance", ([])); },
null	];

;
	c.pargs__read_int =  [];
	c.pinst__read_int =  [
/*0*/	function (e,f) { f.v.res = 0; },
	function (e,f) { if (!(builtin__preg_match ("/^[0-9]$/",(f.v["this"]).ch))) f.pc=2; else f.pc=3; },
	function (e,f) { e.return_pop (f.v.res); },
	function (e,f) {
		f.pc=1;
		f.v.res = parseInt((((f.v.res)) * ((10))),10) + parseInt(((f.v["this"]).ch),10);
		e.mcall (2, f.v["this"], "advance", ([]));
	},
null	];

;
};
string_stream.init_methods (string_stream);
rpcclass.setup_class (string_stream, "string_stream",0, (["string","ch","listeners"]), ([0,0,2]));
function query_node () { this.do_construct (arguments); }
query_node.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
	c.args__create = c.pargs__create =  ["nodetype","parm"];
	c.inst__create = c.pinst__create =  [
/*0*/	function (e,f) {
		f.v.qn = new query_node;
		f.v.qn.nodetype = f.v.nodetype;
		f.v.qn.children = ([]);
		f.v.qn.parm = f.v.parm;
		e.return_pop (f.v.qn);
	},
null	];

;
	c.pargs__add_child =  ["expr"];
	c.pinst__add_child =  [
/*0*/	function (e,f) { (f.v["this"]).children[(f.v["this"]).children.length] = f.v.expr; },
null	];

;
	c.args__parse_term = c.pargs__parse_term =  ["ss"];
	c.inst__parse_term = c.pinst__parse_term =  [
/*0*/	function (e,f) {
		f.v.ch = (f.v.ss).ch;
		e.mcall (2, f.v.ss, "advance", ([]));
	},
	function (e,f) { if (((f.v.ch)) == (("("))) f.pc=2; else f.pc=5; },
	function (e,f) { e.smcall (1, query_node,"parse_or", ([f.v.ss])); },
	function (e,f) {
		var t4314 = f.s[0]; f.v.res = t4314;
		e.mcall (3, f.v.ss, "skip", ([")"]));
	},
	function (e,f) { e.return_pop (f.v.res); },
/*5*/	function (e,f) { if (((f.v.ch)) == (("G"))) f.pc=6; else f.pc=10; },
	function (e,f) { e.mcall (2, f.v.ss, "read_int", ([])); },
	function (e,f) {
		var t4316 = f.s[0]; f.v.n = t4316;
		e.mcall (3, f.v.ss, "skip", (["."]));
	},
	function (e,f) { e.smcall (2, query_node,"create", (["gid", f.v.n])); },
	function (e,f) { var t4317 = f.s[0]; e.return_pop (t4317); },
/*10*/	function (e,f) { if (((f.v.ch)) == (("U"))) f.pc=11; else f.pc=15; },
	function (e,f) { e.mcall (2, f.v.ss, "read_int", ([])); },
	function (e,f) {
		var t4319 = f.s[0]; f.v.n = t4319;
		e.mcall (3, f.v.ss, "skip", (["."]));
	},
	function (e,f) { e.smcall (2, query_node,"create", (["uid", f.v.n])); },
	function (e,f) { var t4320 = f.s[0]; e.return_pop (t4320); },
/*15*/	function (e,f) { if (((f.v.ch)) == (("Q"))) f.pc=16; else f.pc=20; },
	function (e,f) { e.mcall (2, f.v.ss, "read_int", ([])); },
	function (e,f) {
		var t4322 = f.s[0]; f.v.n = t4322;
		e.mcall (3, f.v.ss, "skip", (["."]));
	},
	function (e,f) { e.smcall (2, query_node,"create", (["query", f.v.n])); },
	function (e,f) { var t4323 = f.s[0]; e.return_pop (t4323); },
/*20*/	function (e,f) { if (((f.v.ch)) == (("C"))) f.pc=21; else f.pc=23; },
	function (e,f) { e.smcall (2, query_node,"create", (["children", 0])); },
	function (e,f) { var t4324 = f.s[0]; e.return_pop (t4324); },
	function (e,f) { if (((f.v.ch)) == (("M"))) f.pc=24; else f.pc=26; },
	function (e,f) { e.smcall (2, query_node,"create", (["males", 0])); },
/*25*/	function (e,f) { var t4325 = f.s[0]; e.return_pop (t4325); },
	function (e,f) { if (((f.v.ch)) == (("F"))) f.pc=27; else f.pc=29; },
	function (e,f) { e.smcall (2, query_node,"create", (["females", 0])); },
	function (e,f) { var t4326 = f.s[0]; e.return_pop (t4326); },
	function (e,f) { if (((f.v.ch)) == (("S"))) f.pc=30; else f.pc=32; },
/*30*/	function (e,f) { e.smcall (2, query_node,"create", (["active", 0])); },
	function (e,f) { var t4327 = f.s[0]; e.return_pop (t4327); },
	function (e,f) { if (((f.v.ch)) == (("P"))) f.pc=33; else f.pc=35; },
	function (e,f) { e.smcall (2, query_node,"create", (["public", 0])); },
	function (e,f) { var t4328 = f.s[0]; e.return_pop (t4328); },
/*35*/	function (e,f) { if (((f.v.ch)) == (("Y"))) f.pc=36; else f.pc=40; },
	function (e,f) { e.mcall (2, f.v.ss, "read_int", ([])); },
	function (e,f) {
		var t4330 = f.s[0]; f.v.n = t4330;
		e.mcall (3, f.v.ss, "skip", (["."]));
	},
	function (e,f) { e.smcall (2, query_node,"create", (["year", f.v.n])); },
	function (e,f) { var t4331 = f.s[0]; e.return_pop (t4331); },
/*40*/	function (e,f) { if (((f.v.ch)) == (("A"))) f.pc=41; else f.pc=45; },
	function (e,f) { e.mcall (2, f.v.ss, "read_int", ([])); },
	function (e,f) {
		var t4333 = f.s[0]; f.v.n = t4333;
		e.mcall (3, f.v.ss, "skip", (["."]));
	},
	function (e,f) { e.smcall (2, query_node,"create", (["age", f.v.n])); },
	function (e,f) { var t4334 = f.s[0]; e.return_pop (t4334); },
/*45*/	function (e,f) {
		f.s[0] = builtin__error_log (("Bad query string element type = '") + ("" + (f.v.ch) + (("' followed by '") + ("" + ((f.v.ss).ch) + ("" + ((f.v.ss).string) + ("'"))))));
		f.s[0] = builtin__die (("Bad query string '") + ("" + ((f.v.ss).ch) + ("" + ((f.v.ss).string) + ("'"))));
	},
null	];

;
	c.args__parse_not = c.pargs__parse_not =  ["ss"];
	c.inst__parse_not = c.pinst__parse_not =  [
/*0*/	function (e,f) { if ((((f.v.ss).ch)) == (("!"))) f.pc=1; else f.pc=6; },
	function (e,f) { e.mcall (2, f.v.ss, "advance", ([])); },
	function (e,f) { e.smcall (2, query_node,"create", (["!", 0])); },
	function (e,f) {
		var t4336 = f.s[0]; f.v.res = t4336;
		e.smcall (1, query_node,"parse_not", ([f.v.ss]));
	},
	function (e,f) { var t4337 = f.s[0]; e.mcall (3, f.v.res, "add_child", ([t4337])); },
/*5*/	function (e,f) { e.return_pop (f.v.res); },
	function (e,f) { e.smcall (1, query_node,"parse_term", ([f.v.ss])); },
	function (e,f) { var t4338 = f.s[0]; e.return_pop (t4338); },
null	];

;
	c.args__parse_and = c.pargs__parse_and =  ["ss"];
	c.inst__parse_and = c.pinst__parse_and =  [
/*0*/	function (e,f) { e.smcall (1, query_node,"parse_not", ([f.v.ss])); },
	function (e,f) {
		var t4340 = f.s[0]; f.v.left = t4340;
		if ((((f.v.ss).ch)) == (("&"))) f.pc=2; else f.pc=10;
	},
	function (e,f) { e.smcall (2, query_node,"create", (["&", 0])); },
	function (e,f) {
		var t4342 = f.s[0]; f.v.res = t4342;
		e.mcall (3, f.v.res, "add_child", ([f.v.left]));
	},
	function (e,f) {  },
/*5*/	function (e,f) { e.mcall (2, f.v.ss, "advance", ([])); },
	function (e,f) { e.smcall (1, query_node,"parse_not", ([f.v.ss])); },
	function (e,f) { var t4343 = f.s[0]; e.mcall (3, f.v.res, "add_child", ([t4343])); },
	function (e,f) { if ((((f.v.ss).ch)) != (("&"))) f.pc=9; else f.pc=5; },
	function (e,f) { e.return_pop (f.v.res); },
/*10*/	function (e,f) { e.return_pop (f.v.left); },
null	];

;
	c.args__parse_or = c.pargs__parse_or =  ["ss"];
	c.inst__parse_or = c.pinst__parse_or =  [
/*0*/	function (e,f) { e.smcall (1, query_node,"parse_and", ([f.v.ss])); },
	function (e,f) {
		var t4345 = f.s[0]; f.v.left = t4345;
		if ((((f.v.ss).ch)) == (("|"))) f.pc=2; else f.pc=10;
	},
	function (e,f) { e.smcall (2, query_node,"create", (["|", 0])); },
	function (e,f) {
		var t4347 = f.s[0]; f.v.res = t4347;
		e.mcall (3, f.v.res, "add_child", ([f.v.left]));
	},
	function (e,f) {  },
/*5*/	function (e,f) { e.mcall (2, f.v.ss, "advance", ([])); },
	function (e,f) { e.smcall (1, query_node,"parse_and", ([f.v.ss])); },
	function (e,f) { var t4348 = f.s[0]; e.mcall (3, f.v.res, "add_child", ([t4348])); },
	function (e,f) { if ((((f.v.ss).ch)) != (("|"))) f.pc=9; else f.pc=5; },
	function (e,f) { e.return_pop (f.v.res); },
/*10*/	function (e,f) { e.return_pop (f.v.left); },
null	];

;
	c.args__parse = c.pargs__parse =  ["str"];
	c.inst__parse = c.pinst__parse =  [
/*0*/	function (e,f) { if (((f.v.str)) == ((""))) f.pc=1; else f.pc=2; },
	function (e,f) { e.return_pop (null); },
	function (e,f) { e.smcall (1, string_stream,"create", ([f.v.str])); },
	function (e,f) {
		var t4350 = f.s[0]; f.v.ss = t4350;
		e.smcall (1, query_node,"parse_or", ([f.v.ss]));
	},
	function (e,f) { var t4351 = f.s[0]; e.return_pop (t4351); },
null	];

;
	c.pargs__as_text =  [];
	c.pinst__as_text =  [
/*0*/	function (e,f) { /* This is a NOP */ },
null	];

;
};
query_node.init_methods (query_node);
rpcclass.setup_class (query_node, "query_node",0, (["nodetype","parm","children","listeners"]), ([0,0,0,2]));
function groupquerymenu () { this.do_construct (arguments); }
groupquerymenu.init_methods = function (c) {
	popupmenutree.init_methods(c);
	var cp = c.prototype;
	c.pargs__create_tree =  [];
	c.pinst__create_tree =  [
/*0*/	function (e,f) { e.mcall (2, f.v["this"], "initialise_tree", ([])); },
	function (e,f) { f.v._k260 = e.enumkeys ((f.v["this"]).groups); },
	function (e,f) {
		f.pc=4;
		if (!((f.v._k260).length)) f.pc=3;
	},
	function (e,f) {
		f.pc=5;
		f.v._k262 = e.enumkeys ((f.v["this"]).queries);
	},
	function (e,f) {
		f.pc=2;
		f.v._i261 = (f.v._k260).shift();
		f.v.group = ((f.v["this"]).groups)[(f.v._i261)];
		e.mcall (4, f.v["this"], "add_item_to_tree", ([(f.v.group).menuname, f.v.group]));
	},
/*5*/	function (e,f) {
		f.pc=7;
		if (!((f.v._k262).length)) f.pc=6;
	},
	function (e,f) {
		f.pc=-1;
		f.v["this"].admin = false;
	},
	function (e,f) {
		f.pc=5;
		f.v._i263 = (f.v._k262).shift();
		f.v.query = ((f.v["this"]).queries)[(f.v._i263)];
		e.mcall (4, f.v["this"], "add_item_to_tree", ([(f.v.query).name, f.v.query]));
	},
null	];

;
	c.pargs__select_and_open =  [];
	c.pinst__select_and_open =  [
/*0*/	function (e,f) { e.mcall (2, f.v["this"], "select", ([])); },
	function (e,f) {
		var t4360 = f.s[0]; f.v.group = t4360;
		if (((f.v.group)) !== ((null))) f.pc=2; else f.pc=-1;
	},
	function (e,f) { window.location = ("/churchbuilder/group-wizard.php?gid=") + ((f.v.group).rowid); },
null	];

;
	c.args__create =  [];
	c.inst__create =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_function_async", (["groupquerymenu", "create", ([])])); },
	function (e,f) { var t4362 = f.s[0]; e.return_pop (t4362); },
null	];

;
	c.args__choose_group_or_query_by_menu = c.pargs__choose_group_or_query_by_menu =  [];
	c.inst__choose_group_or_query_by_menu = c.pinst__choose_group_or_query_by_menu =  [
/*0*/	function (e,f) { e.smcall (0, groupquerymenu,"create", ([])); },
	function (e,f) {
		var t4364 = f.s[0]; f.v.gl = t4364;
		e.mcall (2, f.v.gl, "select", ([]));
	},
	function (e,f) { var t4365 = f.s[0]; e.return_pop (t4365); },
null	];

;
};
groupquerymenu.init_methods (groupquerymenu);
rpcclass.setup_class (groupquerymenu, "groupquerymenu",0, (["groups","queries","tree","admin","listeners"]), ([0,0,0,0,2]));
function query_expr () { this.do_construct (arguments); }
query_expr.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
	c.args__needs_term = c.pargs__needs_term =  ["expr"];
	c.inst__needs_term = c.pinst__needs_term =  [
/*0*/	function (e,f) { if (((f.v.expr)) == (("|"))) f.pc=1; else f.pc=2; },
	function (e,f) {
		f.pc=7;
		f.s[0] = true;
	},
	function (e,f) { if (((f.v.expr)) == (("&"))) f.pc=3; else f.pc=4; },
	function (e,f) {
		f.pc=7;
		f.s[0] = true;
	},
	function (e,f) { if (((f.v.expr)) == (("!"))) f.pc=5; else f.pc=6; },
/*5*/	function (e,f) {
		f.pc=7;
		f.s[0] = true;
	},
	function (e,f) { f.s[0] = ((f.v.expr)) == (("(")); },
	function (e,f) { var t4366 = f.s[0]; e.return_pop (t4366); },
null	];

;
	c.args__is_term = c.pargs__is_term =  ["expr"];
	c.inst__is_term = c.pinst__is_term =  [
/*0*/	function (e,f) {
		f.v.e0 = builtin__substr (f.v.expr,0,1);
		if (((f.v.e0)) == (("G"))) f.pc=1; else f.pc=2;
	},
	function (e,f) {
		f.pc=23;
		f.s[0] = true;
	},
	function (e,f) { if (((f.v.e0)) == (("U"))) f.pc=3; else f.pc=4; },
	function (e,f) {
		f.pc=23;
		f.s[0] = true;
	},
	function (e,f) { if (((f.v.e0)) == (("Q"))) f.pc=5; else f.pc=6; },
/*5*/	function (e,f) {
		f.pc=23;
		f.s[0] = true;
	},
	function (e,f) { if (((f.v.e0)) == (("("))) f.pc=7; else f.pc=8; },
	function (e,f) {
		f.pc=23;
		f.s[0] = true;
	},
	function (e,f) { if (((f.v.e0)) == (("!"))) f.pc=9; else f.pc=10; },
	function (e,f) {
		f.pc=23;
		f.s[0] = true;
	},
/*10*/	function (e,f) { if (((f.v.e0)) == (("C"))) f.pc=11; else f.pc=12; },
	function (e,f) {
		f.pc=23;
		f.s[0] = true;
	},
	function (e,f) { if (((f.v.e0)) == (("M"))) f.pc=13; else f.pc=14; },
	function (e,f) {
		f.pc=23;
		f.s[0] = true;
	},
	function (e,f) { if (((f.v.e0)) == (("F"))) f.pc=15; else f.pc=16; },
/*15*/	function (e,f) {
		f.pc=23;
		f.s[0] = true;
	},
	function (e,f) { if (((f.v.e0)) == (("S"))) f.pc=17; else f.pc=18; },
	function (e,f) {
		f.pc=23;
		f.s[0] = true;
	},
	function (e,f) { if (((f.v.el)) == (("P"))) f.pc=19; else f.pc=20; },
	function (e,f) {
		f.pc=23;
		f.s[0] = true;
	},
/*20*/	function (e,f) { if (((f.v.e0)) == (("Y"))) f.pc=21; else f.pc=22; },
	function (e,f) {
		f.pc=23;
		f.s[0] = true;
	},
	function (e,f) { f.s[0] = ((f.v.e0)) == (("A")); },
	function (e,f) { var t4368 = f.s[0]; e.return_pop (t4368); },
null	];

;
	c.args__enable_button = c.pargs__enable_button =  ["name","enabled"];
	c.inst__enable_button = c.pinst__enable_button =  [
/*0*/	function (e,f) { e.mcall (3, document, "getElementById", ([f.v.name])); },
	function (e,f) {
		var t4370 = f.s[0]; f.v.el = t4370;
		f.v.el.disabled = !(f.v.enabled);
	},
null	];

;
	c.pargs__insert_element =  ["expr_el","text_el"];
	c.pinst__insert_element =  [
/*0*/	function (e,f) {
		f.v["this"].expr_code = builtin__array_splice ((f.v["this"]).expr_code,(f.v["this"]).caret_pos,0,([f.v.expr_el]));
		f.v["this"].expr_text = builtin__array_splice ((f.v["this"]).expr_text,(f.v["this"]).caret_pos,0,([f.v.text_el]));
		f.v["this"].caret_pos = parseInt(((f.v["this"]).caret_pos),10) + parseInt((1),10);
		f.v["this"].changed = true;
	},
null	];

;
	c.pargs__edit =  [];
	c.pinst__edit =  [
/*0*/	function (e,f) { e.mcall (2, f.v["this"], "text_elements", ([])); },
	function (e,f) {
		var t4377 = f.s[0]; f.v["this"].expr_text = t4377;
		e.mcall (2, f.v["this"], "expr_elements", ([]));
	},
	function (e,f) {
		var t4379 = f.s[0]; f.v["this"].expr_code = t4379;
		f.v["this"].pop = new popup;
		e.mcall (3, (f.v["this"]).pop, "initialise", ([f.v["this"]]));
	},
	function (e,f) {
		f.v.html = "<h2>Edit Query</h2>";
		f.s[0] = "\">Group/Query</button>";
		e.mcall (5, f.v["this"], "render_resume", (["add_group", 0]));
	},
	function (e,f) {
		var t4382 = f.s[1]; var t4383 = f.s[0]; 
		f.v.html = "" + (f.v.html) + (("<button id=\"group-button\" onclick=\"") + ("" + (t4382) + (t4383)));
		f.s[0] = "\">User</button>";
		e.mcall (5, f.v["this"], "render_resume", (["add_user", 0]));
	},
/*5*/	function (e,f) {
		var t4385 = f.s[1]; var t4386 = f.s[0]; 
		f.v.html = "" + (f.v.html) + (("<button id=\"user-button\" onclick=\"") + ("" + (t4385) + (t4386)));
		f.s[0] = "\">Public</button>";
		e.mcall (5, f.v["this"], "render_resume", (["add_public", 0]));
	},
	function (e,f) {
		var t4388 = f.s[1]; var t4389 = f.s[0]; 
		f.v.html = "" + (f.v.html) + (("<button id=\"public-button\" onclick=\"") + ("" + (t4388) + (t4389)));
		f.s[0] = "\">Year</button>";
		e.mcall (5, f.v["this"], "render_resume", (["add_year", 0]));
	},
	function (e,f) {
		var t4391 = f.s[1]; var t4392 = f.s[0]; 
		f.v.html = "" + (f.v.html) + (("<button id=\"year-button\" onclick=\"") + ("" + (t4391) + (t4392)));
		f.s[0] = "\">Age</button>";
		e.mcall (5, f.v["this"], "render_resume", (["add_age", 0]));
	},
	function (e,f) {
		var t4394 = f.s[1]; var t4395 = f.s[0]; 
		f.v.html = "" + (f.v.html) + (("<button id=\"age-button\" onclick=\"") + ("" + (t4394) + (t4395)));
		f.s[0] = "\">Children</button>";
		e.mcall (5, f.v["this"], "render_resume", (["add_children", 0]));
	},
	function (e,f) {
		var t4397 = f.s[1]; var t4398 = f.s[0]; 
		f.v.html = "" + (f.v.html) + (("<button id=\"children-button\" onclick=\"") + ("" + (t4397) + (t4398)));
		f.s[0] = "\">Males</button>";
		e.mcall (5, f.v["this"], "render_resume", (["add_males", 0]));
	},
/*10*/	function (e,f) {
		var t4400 = f.s[1]; var t4401 = f.s[0]; 
		f.v.html = "" + (f.v.html) + (("<button id=\"males-button\" onclick=\"") + ("" + (t4400) + (t4401)));
		f.s[0] = "\">Females</button>";
		e.mcall (5, f.v["this"], "render_resume", (["add_females", 0]));
	},
	function (e,f) {
		var t4403 = f.s[1]; var t4404 = f.s[0]; 
		f.v.html = "" + (f.v.html) + (("<button id=\"females-button\" onclick=\"") + ("" + (t4403) + (t4404)));
		f.s[0] = "\">Active</button>";
		e.mcall (5, f.v["this"], "render_resume", (["add_active", 0]));
	},
	function (e,f) {
		var t4406 = f.s[1]; var t4407 = f.s[0]; 
		f.v.html = "" + (f.v.html) + (("<button id=\"active-button\" onclick=\"") + ("" + (t4406) + (t4407)));
		f.v.html = "" + (f.v.html) + ("<br/>");
		f.s[0] = "\">(</button>";
		e.mcall (5, f.v["this"], "render_resume", (["add_bra", 0]));
	},
	function (e,f) {
		var t4410 = f.s[1]; var t4411 = f.s[0]; 
		f.v.html = "" + (f.v.html) + (("<button id=\"bra-button\" onclick=\"") + ("" + (t4410) + (t4411)));
		f.s[0] = "\">)</button>";
		e.mcall (5, f.v["this"], "render_resume", (["add_ket", 0]));
	},
	function (e,f) {
		var t4413 = f.s[1]; var t4414 = f.s[0]; 
		f.v.html = "" + (f.v.html) + (("<button id=\"ket-button\" onclick=\"") + ("" + (t4413) + (t4414)));
		f.s[0] = "\">Or</button>";
		e.mcall (5, f.v["this"], "render_resume", (["add_or", 0]));
	},
/*15*/	function (e,f) {
		var t4416 = f.s[1]; var t4417 = f.s[0]; 
		f.v.html = "" + (f.v.html) + (("<button id=\"or-button\" onclick=\"") + ("" + (t4416) + (t4417)));
		f.s[0] = "\">And</button>";
		e.mcall (5, f.v["this"], "render_resume", (["add_and", 0]));
	},
	function (e,f) {
		var t4419 = f.s[1]; var t4420 = f.s[0]; 
		f.v.html = "" + (f.v.html) + (("<button id=\"and-button\" onclick=\"") + ("" + (t4419) + (t4420)));
		f.s[0] = "\">Not</button>";
		e.mcall (5, f.v["this"], "render_resume", (["add_not", 0]));
	},
	function (e,f) {
		var t4422 = f.s[1]; var t4423 = f.s[0]; 
		f.v.html = "" + (f.v.html) + (("<button id=\"not-button\" onclick=\"") + ("" + (t4422) + (t4423)));
		f.v.html = "" + (f.v.html) + ("<br/>");
		f.s[0] = "\">&lt;</button>";
		e.mcall (5, f.v["this"], "render_resume", (["move_left", 0]));
	},
	function (e,f) {
		var t4426 = f.s[1]; var t4427 = f.s[0]; 
		f.v.html = "" + (f.v.html) + (("<button id=\"left-button\" onclick=\"") + ("" + (t4426) + (t4427)));
		f.s[0] = "\">&gt;</button>";
		e.mcall (5, f.v["this"], "render_resume", (["move_right", 0]));
	},
	function (e,f) {
		var t4429 = f.s[1]; var t4430 = f.s[0]; 
		f.v.html = "" + (f.v.html) + (("<button id=\"right-button\" onclick=\"") + ("" + (t4429) + (t4430)));
		f.s[0] = "\">&lt;Del</button>";
		e.mcall (5, f.v["this"], "render_resume", (["delete_left", 0]));
	},
/*20*/	function (e,f) {
		var t4432 = f.s[1]; var t4433 = f.s[0]; 
		f.v.html = "" + (f.v.html) + (("<button id=\"del-button\" onclick=\"") + ("" + (t4432) + (t4433)));
		f.s[0] = "\">OK</button>";
		e.mcall (5, f.v["this"], "render_resume", (["OK", 0]));
	},
	function (e,f) {
		var t4435 = f.s[1]; var t4436 = f.s[0]; 
		f.v.html = "" + (f.v.html) + (("<button id=\"ok-button\" onclick=\"") + ("" + (t4435) + (t4436)));
		f.s[0] = "\">Cancel</button>";
		e.mcall (5, f.v["this"], "render_resume", (["cancel", 0]));
	},
	function (e,f) {
		var t4438 = f.s[1]; var t4439 = f.s[0]; 
		f.v.html = "" + (f.v.html) + (("<button id=\"cancel-button\" onclick=\"") + ("" + (t4438) + (t4439)));
		f.v.html = "" + (f.v.html) + ("<br/>");
		f.v.html = "" + (f.v.html) + ("<div style=\"border:solid black 1px; background: #cccccc; padding:3px; margin:10px; font-family:arial; font-size:11px\" id=\"fe-filter\"></div>");
		e.mcall (5, (f.v["this"]).pop, "open", ([0, 0, f.v.html]));
	},
	function (e,f) { e.mcall (3, document, "getElementById", (["fe-filter"])); },
	function (e,f) {
		var t4444 = f.s[0]; f.v.filter = t4444;
		f.v["this"].caret_pos = 0;
		f.v.caret_on = true;
		f.v["this"].changed = false;
	},
/*25*/	function (e,f) {
		f.pc=27;
		f.v.parse_fault = false;
		f.v.bracket_depth = 0;
		f.v.i = 0;
	},
	function (e,f) {
		f.pc=179;
		e.mcall (2, (f.v["this"]).pop, "close", ([]));
	},
	function (e,f) {
		f.pc=29;
		if (!(((f.v.i)) < ((builtin__count ((f.v["this"]).expr_code))))) f.pc=28;
	},
	function (e,f) { if (!(f.v.parse_fault)) f.pc=49; else f.pc=50; },
	function (e,f) { if (((((f.v["this"]).expr_code)[(f.v.i)])) == (("("))) f.pc=30; else f.pc=31; },
/*30*/	function (e,f) {
		e.php_push_var_lvalue (0, "bracket_depth");
		e.php_postinc (1);
	},
	function (e,f) { if (((((f.v["this"]).expr_code)[(f.v.i)])) == ((")"))) f.pc=32; else f.pc=33; },
	function (e,f) {
		e.php_push_var_lvalue (0, "bracket_depth");
		e.php_postdec (1);
	},
	function (e,f) { if (((f.v.i)) > ((0))) f.pc=34; else f.pc=47; },
	function (e,f) {
		f.pc=39;
		e.smcall (1, query_expr,"needs_term", ([((f.v["this"]).expr_code)[(parseInt((f.v.i),10) - parseInt((1),10))]]));
	},
/*35*/	function (e,f) {
		f.pc=41;
		f.v.parse_fault = true;
		f.v.parse_fault_pos = f.v.i;
	},
	function (e,f) { e.smcall (1, query_expr,"is_term", ([((f.v["this"]).expr_code)[(f.v.i)]])); },
	function (e,f) {
		f.pc=40;
		var t4455 = f.s[0]; f.s[0] = !(t4455);
	},
	function (e,f) {
		f.pc=40;
		f.s[0] = false;
	},
	function (e,f) { var t4456 = f.s[0]; if (t4456) f.pc=36; else f.pc=38; },
/*40*/	function (e,f) { var t4457 = f.s[0]; if (t4457) f.pc=35; else f.pc=41; },
	function (e,f) {
		f.pc=43;
		e.smcall (1, query_expr,"needs_term", ([((f.v["this"]).expr_code)[(parseInt((f.v.i),10) - parseInt((1),10))]]));
	},
	function (e,f) {
		f.pc=47;
		f.v.parse_fault = true;
		f.v.parse_fault_pos = f.v.i;
	},
	function (e,f) {
		var t4460 = f.s[0]; 
		if (!(t4460)) f.pc=44; else f.pc=45;
	},
	function (e,f) {
		f.pc=46;
		e.smcall (1, query_expr,"is_term", ([((f.v["this"]).expr_code)[(f.v.i)]]));
	},
/*45*/	function (e,f) { f.s[0] = false; },
	function (e,f) { var t4461 = f.s[0]; if (t4461) f.pc=42; else f.pc=47; },
	function (e,f) {
		f.pc=27;
		e.php_push_var_lvalue (0, "i");
		e.php_postinc (1);
	},
	function (e,f) {
		f.pc=52;
		f.v.parse_fault = true;
		f.v.parse_fault_pos = parseInt((f.v.i),10) - parseInt((1),10);
	},
	function (e,f) {
		f.pc=51;
		e.smcall (1, query_expr,"needs_term", ([((f.v["this"]).expr_code)[(parseInt((builtin__count ((f.v["this"]).expr_code)),10) - parseInt((1),10))]]));
	},
/*50*/	function (e,f) { f.s[0] = false; },
	function (e,f) { var t4465 = f.s[0]; if (t4465) f.pc=48; else f.pc=52; },
	function (e,f) { if (!(f.v.parse_fault)) f.pc=54; else f.pc=55; },
	function (e,f) {
		f.pc=57;
		f.v.parse_fault = true;
		f.v.parse_fault_pos = f.v.i;
	},
	function (e,f) {
		f.pc=56;
		f.s[0] = f.v.bracket_depth;
	},
/*55*/	function (e,f) { f.s[0] = false; },
	function (e,f) { var t4468 = f.s[0]; if (t4468) f.pc=53; else f.pc=57; },
	function (e,f) {
		f.v.html = "";
		f.v.i = 0;
	},
	function (e,f) {
		f.pc=60;
		if (!(((f.v.i)) < ((builtin__count ((f.v["this"]).expr_text))))) f.pc=59;
	},
	function (e,f) { if (((f.v.i)) == (((f.v["this"]).caret_pos))) f.pc=76; else f.pc=80; },
/*60*/	function (e,f) { if (((f.v.i)) == (((f.v["this"]).caret_pos))) f.pc=61; else f.pc=65; },
	function (e,f) { if (f.v.caret_on) f.pc=62; else f.pc=63; },
	function (e,f) {
		f.pc=64;
		f.s[0] = "|";
	},
	function (e,f) { f.s[0] = "<span style=\"color:white\">|</span>"; },
	function (e,f) {
		var t4471 = f.s[0]; 
		f.v.html = "" + (f.v.html) + (t4471);
	},
/*65*/	function (e,f) { if (f.v.parse_fault) f.pc=67; else f.pc=68; },
	function (e,f) {
		f.pc=70;
		f.v.html = "" + (f.v.html) + ("<span style=\"color:red\">");
	},
	function (e,f) {
		f.pc=69;
		f.s[0] = ((f.v.parse_fault_pos)) == ((f.v.i));
	},
	function (e,f) { f.s[0] = false; },
	function (e,f) { var t4474 = f.s[0]; if (t4474) f.pc=66; else f.pc=70; },
/*70*/	function (e,f) {
		f.v.html = "" + (f.v.html) + (((f.v["this"]).expr_text)[(f.v.i)]);
		if (f.v.parse_fault) f.pc=72; else f.pc=73;
	},
	function (e,f) {
		f.pc=75;
		f.v.html = "" + (f.v.html) + ("</span>");
	},
	function (e,f) {
		f.pc=74;
		f.s[0] = ((f.v.parse_fault_pos)) == ((f.v.i));
	},
	function (e,f) { f.s[0] = false; },
	function (e,f) { var t4477 = f.s[0]; if (t4477) f.pc=71; else f.pc=75; },
/*75*/	function (e,f) {
		f.pc=58;
		f.v.html = "" + (f.v.html) + (" ");
		e.php_push_var_lvalue (0, "i");
		e.php_postinc (1);
	},
	function (e,f) { if (f.v.caret_on) f.pc=77; else f.pc=78; },
	function (e,f) {
		f.pc=79;
		f.s[0] = "|";
	},
	function (e,f) { f.s[0] = "&nbsp;"; },
	function (e,f) {
		var t4480 = f.s[0]; 
		f.v.html = "" + (f.v.html) + (t4480);
	},
/*80*/	function (e,f) { if (f.v.parse_fault) f.pc=82; else f.pc=83; },
	function (e,f) {
		f.pc=85;
		f.v.html = "" + (f.v.html) + ("<span style=\"color:red\">?</span>");
	},
	function (e,f) {
		f.pc=84;
		f.s[0] = ((f.v.parse_fault_pos)) == ((f.v.i));
	},
	function (e,f) { f.s[0] = false; },
	function (e,f) { var t4483 = f.s[0]; if (t4483) f.pc=81; else f.pc=85; },
/*85*/	function (e,f) {
		f.v.filter.innerHTML = f.v.html;
		if ((((f.v["this"]).caret_pos)) > ((0))) f.pc=86; else f.pc=88;
	},
	function (e,f) { e.smcall (1, query_expr,"needs_term", ([((f.v["this"]).expr_code)[(parseInt(((f.v["this"]).caret_pos),10) - parseInt((1),10))]])); },
	function (e,f) {
		f.pc=89;
		var t4486 = f.s[0]; f.v.need_term = t4486;
	},
	function (e,f) { f.v.need_term = true; },
	function (e,f) { e.smcall (2, query_expr,"enable_button", (["public-button", ((builtin__count ((f.v["this"]).expr_code))) == ((0))])); },
/*90*/	function (e,f) { if (f.v.need_term) f.pc=91; else f.pc=104; },
	function (e,f) { e.smcall (2, query_expr,"enable_button", (["year-button", true])); },
	function (e,f) { e.smcall (2, query_expr,"enable_button", (["age-button", true])); },
	function (e,f) { e.smcall (2, query_expr,"enable_button", (["group-button", true])); },
	function (e,f) { e.smcall (2, query_expr,"enable_button", (["user-button", true])); },
/*95*/	function (e,f) { e.smcall (2, query_expr,"enable_button", (["children-button", true])); },
	function (e,f) { e.smcall (2, query_expr,"enable_button", (["males-button", true])); },
	function (e,f) { e.smcall (2, query_expr,"enable_button", (["females-button", true])); },
	function (e,f) { e.smcall (2, query_expr,"enable_button", (["active-button", true])); },
	function (e,f) { e.smcall (2, query_expr,"enable_button", (["bra-button", true])); },
/*100*/	function (e,f) { e.smcall (2, query_expr,"enable_button", (["ket-button", false])); },
	function (e,f) { e.smcall (2, query_expr,"enable_button", (["or-button", false])); },
	function (e,f) { e.smcall (2, query_expr,"enable_button", (["and-button", false])); },
	function (e,f) {
		f.pc=117;
		e.smcall (2, query_expr,"enable_button", (["not-button", true]));
	},
	function (e,f) { e.smcall (2, query_expr,"enable_button", (["year-button", false])); },
/*105*/	function (e,f) { e.smcall (2, query_expr,"enable_button", (["age-button", false])); },
	function (e,f) { e.smcall (2, query_expr,"enable_button", (["group-button", false])); },
	function (e,f) { e.smcall (2, query_expr,"enable_button", (["user-button", false])); },
	function (e,f) { e.smcall (2, query_expr,"enable_button", (["children-button", false])); },
	function (e,f) { e.smcall (2, query_expr,"enable_button", (["males-button", false])); },
/*110*/	function (e,f) { e.smcall (2, query_expr,"enable_button", (["females-button", false])); },
	function (e,f) { e.smcall (2, query_expr,"enable_button", (["active-button", false])); },
	function (e,f) { e.smcall (2, query_expr,"enable_button", (["bra-button", false])); },
	function (e,f) { e.smcall (2, query_expr,"enable_button", (["ket-button", ((f.v.bracket_depth)) != ((0))])); },
	function (e,f) { e.smcall (2, query_expr,"enable_button", (["or-button", true])); },
/*115*/	function (e,f) { e.smcall (2, query_expr,"enable_button", (["and-button", true])); },
	function (e,f) { e.smcall (2, query_expr,"enable_button", (["not-button", false])); },
	function (e,f) { e.smcall (2, query_expr,"enable_button", (["ok-button", !(f.v.parse_fault)])); },
	function (e,f) { e.smcall (2, rpcclass,"start_interval_timer", ([300, "blink"])); },
	function (e,f) {
		var t4489 = f.s[0]; f.v.it = t4489;
		e.php_builtin (0, "wait_for_input", 0);
	},
/*120*/	function (e,f) {
		var t4491 = f.s[0]; f.v.event = t4491;
		e.smcall (1, rpcclass,"stop_interval_timer", ([f.v.it]));
	},
	function (e,f) { if ((((f.v.event).action)) === (("cover"))) f.pc=122; else f.pc=123; },
	function (e,f) { if (!((f.v["this"]).changed)) f.pc=26; else f.pc=25; },
	function (e,f) { if ((((f.v.event).action)) == (("blink"))) f.pc=124; else f.pc=125; },
	function (e,f) {
		f.pc=25;
		f.v.caret_on = !(f.v.caret_on);
	},
/*125*/	function (e,f) { if ((((f.v.event).action)) == (("OK"))) f.pc=126; else f.pc=130; },
	function (e,f) {
		f.v["this"].expr_str = "";
		f.v._k264 = e.enumkeys ((f.v["this"]).expr_code);
	},
	function (e,f) {
		f.pc=129;
		if (!((f.v._k264).length)) f.pc=128;
	},
	function (e,f) { f.pc=26; },
	function (e,f) {
		f.pc=127;
		f.s[0] = f.v._i265 = (f.v._k264).shift();
		f.s[1] = f.v.code = ((f.v["this"]).expr_code)[(f.v._i265)];
		f.v["this"].expr_str = "" + ((f.v["this"]).expr_str) + (f.v.code);
	},
/*130*/	function (e,f) { if ((((f.v.event).action)) == (("cancel"))) f.pc=131; else f.pc=132; },
	function (e,f) { f.pc=26; },
	function (e,f) { if ((((f.v.event).action)) == (("move_left"))) f.pc=133; else f.pc=135; },
	function (e,f) { if ((((f.v["this"]).caret_pos)) > ((0))) f.pc=134; else f.pc=25; },
	function (e,f) {
		f.pc=25;
		f.v["this"].caret_pos = parseInt(((f.v["this"]).caret_pos),10) - parseInt((1),10);
	},
/*135*/	function (e,f) { if ((((f.v.event).action)) == (("delete_left"))) f.pc=136; else f.pc=138; },
	function (e,f) { if ((((f.v["this"]).caret_pos)) > ((0))) f.pc=137; else f.pc=25; },
	function (e,f) {
		f.pc=25;
		f.v["this"].expr_code = builtin__array_splice ((f.v["this"]).expr_code,parseInt(((f.v["this"]).caret_pos),10) - parseInt((1),10),1);
		f.v["this"].expr_text = builtin__array_splice ((f.v["this"]).expr_text,parseInt(((f.v["this"]).caret_pos),10) - parseInt((1),10),1);
		f.v["this"].caret_pos = parseInt(((f.v["this"]).caret_pos),10) - parseInt((1),10);
		f.v["this"].changed = true;
	},
	function (e,f) { if ((((f.v.event).action)) == (("move_right"))) f.pc=139; else f.pc=141; },
	function (e,f) { if ((((f.v["this"]).caret_pos)) < ((builtin__count ((f.v["this"]).expr_text)))) f.pc=140; else f.pc=25; },
/*140*/	function (e,f) {
		f.pc=25;
		f.v["this"].caret_pos = parseInt(((f.v["this"]).caret_pos),10) + parseInt((1),10);
	},
	function (e,f) { if ((((f.v.event).action)) == (("add_group"))) f.pc=142; else f.pc=147; },
	function (e,f) { e.smcall (0, groupquerymenu,"choose_group_or_query_by_menu", ([])); },
	function (e,f) {
		var t4505 = f.s[0]; f.v.gq = t4505;
		if (((f.v.gq)) !== ((null))) f.pc=144; else f.pc=25;
	},
	function (e,f) { if ((((f.v.gq).classname)) == (("group"))) f.pc=145; else f.pc=146; },
/*145*/	function (e,f) {
		f.pc=25;
		e.mcall (4, f.v["this"], "insert_element", ([("G") + ("" + ((f.v.gq).rowid) + (".")), ("(") + ("" + ((f.v.gq).menuname) + (")"))]));
	},
	function (e,f) {
		f.pc=25;
		e.mcall (4, f.v["this"], "insert_element", ([("Q") + ("" + ((f.v.gq).rowid) + (".")), ("(") + ("" + ((f.v.gq).name) + (")"))]));
	},
	function (e,f) { if ((((f.v.event).action)) == (("add_user"))) f.pc=148; else f.pc=151; },
	function (e,f) { e.smcall (0, person,"lookup", ([])); },
	function (e,f) {
		var t4507 = f.s[0]; f.v.p = t4507;
		if (((f.v.p)) !== ((null))) f.pc=150; else f.pc=25;
	},
/*150*/	function (e,f) {
		f.pc=25;
		e.mcall (4, f.v["this"], "insert_element", ([("U") + ("" + ((f.v.p).rowid) + (".")), ("(") + ("" + ((f.v.p).nicename) + (")"))]));
	},
	function (e,f) { if ((((f.v.event).action)) == (("add_children"))) f.pc=152; else f.pc=153; },
	function (e,f) {
		f.pc=25;
		e.mcall (4, f.v["this"], "insert_element", (["C", "(Children)"]));
	},
	function (e,f) { if ((((f.v.event).action)) == (("add_public"))) f.pc=154; else f.pc=155; },
	function (e,f) {
		f.pc=25;
		e.mcall (4, f.v["this"], "insert_element", (["P", "(Public)"]));
	},
/*155*/	function (e,f) { if ((((f.v.event).action)) == (("add_year"))) f.pc=156; else f.pc=159; },
	function (e,f) { e.smcall (1, popupmenu,"quick", ([(["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13"])])); },
	function (e,f) {
		var t4509 = f.s[0]; f.v.y = t4509;
		if (((f.v.y)) !== ((null))) f.pc=158; else f.pc=25;
	},
	function (e,f) {
		f.pc=25;
		e.mcall (4, f.v["this"], "insert_element", ([("Y") + ("" + (f.v.y) + (".")), ("(Year ") + ("" + (f.v.y) + (")"))]));
	},
	function (e,f) { if ((((f.v.event).action)) == (("add_age"))) f.pc=160; else f.pc=163; },
/*160*/	function (e,f) { e.smcall (1, popupmenu,"quick", ([(["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21"])])); },
	function (e,f) {
		var t4511 = f.s[0]; f.v.y = t4511;
		if (((f.v.y)) !== ((null))) f.pc=162; else f.pc=25;
	},
	function (e,f) {
		f.pc=25;
		e.mcall (4, f.v["this"], "insert_element", ([("A") + ("" + (f.v.y) + (".")), ("(Age ") + ("" + (f.v.y) + (")"))]));
	},
	function (e,f) { if ((((f.v.event).action)) == (("add_males"))) f.pc=164; else f.pc=165; },
	function (e,f) {
		f.pc=25;
		e.mcall (4, f.v["this"], "insert_element", (["M", "(Males)"]));
	},
/*165*/	function (e,f) { if ((((f.v.event).action)) == (("add_females"))) f.pc=166; else f.pc=167; },
	function (e,f) {
		f.pc=25;
		e.mcall (4, f.v["this"], "insert_element", (["F", "(Females)"]));
	},
	function (e,f) { if ((((f.v.event).action)) == (("add_active"))) f.pc=168; else f.pc=169; },
	function (e,f) {
		f.pc=25;
		e.mcall (4, f.v["this"], "insert_element", (["S", "(Active)"]));
	},
	function (e,f) { if ((((f.v.event).action)) == (("add_or"))) f.pc=170; else f.pc=171; },
/*170*/	function (e,f) {
		f.pc=25;
		e.mcall (4, f.v["this"], "insert_element", (["|", "or"]));
	},
	function (e,f) { if ((((f.v.event).action)) == (("add_and"))) f.pc=172; else f.pc=173; },
	function (e,f) {
		f.pc=25;
		e.mcall (4, f.v["this"], "insert_element", (["&", "and"]));
	},
	function (e,f) { if ((((f.v.event).action)) == (("add_not"))) f.pc=174; else f.pc=175; },
	function (e,f) {
		f.pc=25;
		e.mcall (4, f.v["this"], "insert_element", (["!", "not"]));
	},
/*175*/	function (e,f) { if ((((f.v.event).action)) == (("add_bra"))) f.pc=176; else f.pc=177; },
	function (e,f) {
		f.pc=25;
		e.mcall (4, f.v["this"], "insert_element", (["(", "("]));
	},
	function (e,f) { if ((((f.v.event).action)) == (("add_ket"))) f.pc=178; else f.pc=25; },
	function (e,f) {
		f.pc=25;
		e.mcall (4, f.v["this"], "insert_element", ([")", ")"]));
	},
	function (e,f) { if ((f.v["this"]).changed) f.pc=180; else f.pc=-1; },
/*180*/	function (e,f) { e.mcall (4, f.v["this"], "send_msg", (["update_notification", null])); },
null	];

;
	c.pargs__expr_elements =  [];
	c.pinst__expr_elements =  [
/*0*/	function (e,f) {
		f.v.res_expr = ([]);
		f.v.i = 0;
	},
	function (e,f) {
		f.pc=3;
		if (!(((f.v.i)) < ((((f.v["this"]).expr_str).length)))) f.pc=2;
	},
	function (e,f) { e.return_pop (f.v.res_expr); },
	function (e,f) {
		f.v.c = builtin__substr ((f.v["this"]).expr_str,f.v.i,1);
		if (((f.v.c)) == (("U"))) f.pc=11; else f.pc=12;
	},
	function (e,f) { f.v.n = 0; },
/*5*/	function (e,f) {
		e.php_push_var_lvalue (0, "i");
		e.php_postinc (1);
		f.v.nc = builtin__substr ((f.v["this"]).expr_str,f.v.i,1);
		if (((f.v.nc)) == ((""))) f.pc=6; else f.pc=7;
	},
	function (e,f) { e.return_pop (false); },
	function (e,f) { if (((f.v.nc)) == (("."))) f.pc=8; else f.pc=9; },
	function (e,f) {
		f.pc=20;
		f.v.res_expr[f.v.res_expr.length] = "" + (f.v.c) + ("" + (f.v.n) + ("."));
	},
	function (e,f) {
		f.pc=5;
		f.v.n = parseInt((((f.v.n)) * ((10))),10) + parseInt((f.v.nc),10);
	},
/*10*/	function (e,f) {
		f.pc=20;
		f.v.res_expr[f.v.res_expr.length] = f.v.c;
	},
	function (e,f) {
		f.pc=19;
		f.s[0] = true;
	},
	function (e,f) { if (((f.v.c)) == (("G"))) f.pc=13; else f.pc=14; },
	function (e,f) {
		f.pc=19;
		f.s[0] = true;
	},
	function (e,f) { if (((f.v.c)) == (("Q"))) f.pc=15; else f.pc=16; },
/*15*/	function (e,f) {
		f.pc=19;
		f.s[0] = true;
	},
	function (e,f) { if (((f.v.c)) == (("Y"))) f.pc=17; else f.pc=18; },
	function (e,f) {
		f.pc=19;
		f.s[0] = true;
	},
	function (e,f) { f.s[0] = ((f.v.c)) == (("A")); },
	function (e,f) { var t4521 = f.s[0]; if (t4521) f.pc=4; else f.pc=10; },
/*20*/	function (e,f) {
		f.pc=1;
		e.php_push_var_lvalue (0, "i");
		e.php_postinc (1);
	},
null	];

;
	c.pargs__text_elements =  [];
	c.pinst__text_elements =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["text_elements", ([])])); },
	function (e,f) { var t4523 = f.s[0]; e.return_pop (t4523); },
null	];

;
	c.pargs__as_text =  [];
	c.pinst__as_text =  [
/*0*/	function (e,f) { if ((((f.v["this"]).expr_str)) === ((false))) f.pc=2; else f.pc=3; },
	function (e,f) { e.return_pop (""); },
	function (e,f) {
		f.pc=4;
		f.s[0] = true;
	},
	function (e,f) { f.s[0] = (((f.v["this"]).expr_str)) == (("")); },
	function (e,f) { var t4524 = f.s[0]; if (t4524) f.pc=1; else f.pc=5; },
/*5*/	function (e,f) { e.mcall (2, f.v["this"], "text_elements", ([])); },
	function (e,f) {
		var t4526 = f.s[0]; f.v.res_text = t4526;
		f.v.flat_text = "";
		f.v.need_comma = false;
		f.v._k266 = e.enumkeys (f.v.res_text);
	},
	function (e,f) {
		f.pc=9;
		if (!((f.v._k266).length)) f.pc=8;
	},
	function (e,f) { e.return_pop (f.v.flat_text); },
	function (e,f) {
		f.v._i267 = (f.v._k266).shift();
		f.v.item = (f.v.res_text)[(f.v._i267)];
		if (f.v.need_comma) f.pc=10; else f.pc=11;
	},
/*10*/	function (e,f) { f.v.flat_text = "" + (f.v.flat_text) + (" "); },
	function (e,f) {
		f.pc=7;
		f.v.flat_text = "" + (f.v.flat_text) + (f.v.item);
		f.v.need_comma = true;
	},
null	];

;
	c.pargs__render_text =  [];
	c.pinst__render_text =  [
/*0*/	function (e,f) { e.mcall (2, f.v["this"], "as_text", ([])); },
	function (e,f) {
		var t4536 = f.s[0]; f.v.text = t4536;
		if (((f.v.text)) == ((""))) f.pc=2; else f.pc=3;
	},
	function (e,f) { f.v.text = "[empty]"; },
	function (e,f) { window.__outbuffer += f.v.text; },
null	];

;
	c.pargs__parse =  [];
	c.pinst__parse =  [
/*0*/	function (e,f) { e.smcall (1, query_node,"parse", ([(f.v["this"]).expr_str])); },
	function (e,f) { var t4538 = f.s[0]; e.return_pop (t4538); },
null	];

;
	c.args__create_from_string = c.pargs__create_from_string =  ["expr_str"];
	c.inst__create_from_string = c.pinst__create_from_string =  [
/*0*/	function (e,f) {
		f.v.qe = new query_expr;
		f.v.qe.expr_str = f.v.expr_str;
		e.return_pop (f.v.qe);
	},
null	];

;
	c.args__create_new = c.pargs__create_new =  [];
	c.inst__create_new = c.pinst__create_new =  [
/*0*/	function (e,f) {
		f.v.qe = new query_expr;
		f.v.qe.expr_str = "";
		e.return_pop (f.v.qe);
	},
null	];

;
	c.pargs__as_string =  [];
	c.pinst__as_string =  [
/*0*/	function (e,f) { e.return_pop ((f.v["this"]).expr_str); },
null	];

;
};
query_expr.init_methods (query_expr);
rpcclass.setup_class (query_expr, "query_expr",0, (["expr_str","expr_code","expr_text","caret_pos","changed","listeners"]), ([0,0,0,0,0,2]));
function stored_query () { this.do_construct (arguments); }
stored_query.init_methods = function (c) {
	dbclass.init_methods(c);
	var cp = c.prototype;
	c.args__popupobjeditor_fields = c.pargs__popupobjeditor_fields =  [];
	c.inst__popupobjeditor_fields = c.pinst__popupobjeditor_fields =  [
/*0*/	function (e,f) { e.return_pop (([({name:"name", label:"Menuname", type:"text", width:300}), ({name:"owners", label:"Owners", type:"query_expr"}), ({name:"readers", label:"Readers", type:"query_expr"})])); },
null	];

;
	c.pargs__do_save_properties =  ["str"];
	c.pinst__do_save_properties =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["do_save_properties", ([f.v.str])])); },
	function (e,f) { var t4543 = f.s[0]; e.return_pop (t4543); },
null	];

;
	c.pargs__edit_properties =  [];
	c.pinst__edit_properties =  [
/*0*/	function (e,f) {
		f.pc=4;
		e.smcall (2, popupobjeditor,"edit", ([f.v["this"], "Query properties"]));
	},
	function (e,f) { e.smcall (1, popupobjeditor,"to_struct", ([f.v["this"]])); },
	function (e,f) { var t4544 = f.s[0]; e.mcall (3, f.v["this"], "do_save_properties", ([t4544])); },
	function (e,f) { e.return_pop (true); },
	function (e,f) { var t4545 = f.s[0]; if (t4545) f.pc=1; else f.pc=5; },
/*5*/	function (e,f) { e.return_pop (false); },
null	];

;
	c.args__lookup_query1 =  ["queryname"];
	c.inst__lookup_query1 =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_function_async", (["stored_query", "lookup_query1", ([f.v.queryname])])); },
	function (e,f) { var t4546 = f.s[0]; e.return_pop (t4546); },
null	];

;
	c.args__lookup = c.pargs__lookup =  ["queryname"];
	c.inst__lookup = c.pinst__lookup =  [
/*0*/	function (e,f) {
		e.php_push_static_var (1, stored_query,"query_by_name_cache");
		var t4547 = f.s[1]; 
		if (!(((t4547)[(f.v.queryname)]) !== undefined)) f.pc=1; else f.pc=3;
	},
	function (e,f) { e.smcall (1, stored_query,"lookup_query1", ([f.v.queryname])); },
	function (e,f) {
		e.php_push_static_var (2, stored_query,"query_by_name_cache");
		var t4548 = f.s[2]; var t4550 = f.s[0]; t4548[f.v.queryname] = t4550;
	},
	function (e,f) {
		e.php_push_static_var (1, stored_query,"query_by_name_cache");
		var t4551 = f.s[1]; 
		e.return_pop ((t4551)[(f.v.queryname)]);
	},
null	];

;
	c.args__get_by_name =  ["name"];
	c.inst__get_by_name =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_function_async", (["stored_query", "get_by_name", ([f.v.name])])); },
	function (e,f) { var t4552 = f.s[0]; e.return_pop (t4552); },
null	];

;
	c.args__get_all_readable =  [];
	c.inst__get_all_readable =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_function_async", (["stored_query", "get_all_readable", ([])])); },
	function (e,f) { var t4553 = f.s[0]; e.return_pop (t4553); },
null	];

;
	c.pargs__do_save =  ["newpat","newexpr"];
	c.pinst__do_save =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["do_save", ([f.v.newpat, f.v.newexpr])])); },
	function (e,f) { var t4554 = f.s[0]; e.return_pop (t4554); },
null	];

;
	c.pargs__remove =  [];
	c.pinst__remove =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["remove", ([])])); },
	function (e,f) { var t4555 = f.s[0]; e.return_pop (t4555); },
null	];

;
	c.args__create_new =  ["name"];
	c.inst__create_new =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_function_async", (["stored_query", "create_new", ([f.v.name])])); },
	function (e,f) { var t4556 = f.s[0]; e.return_pop (t4556); },
null	];

;
	c.args__create_new_pattern =  ["name"];
	c.inst__create_new_pattern =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_function_async", (["stored_query", "create_new_pattern", ([f.v.name])])); },
	function (e,f) { var t4557 = f.s[0]; e.return_pop (t4557); },
null	];

;
	c.pargs__edit =  [];
	c.pinst__edit =  [
/*0*/	function (e,f) { if ((((f.v["this"]).pattern)) != ((""))) f.pc=1; else f.pc=6; },
	function (e,f) { e.smcall (4, popupeditbox,"run", ([0, 0, "Union of groups", (f.v["this"]).pattern])); },
	function (e,f) {
		var t4559 = f.s[0]; f.v.newpat = t4559;
		if (((f.v.newpat)) !== ((null))) f.pc=3; else f.pc=-1;
	},
	function (e,f) {
		f.v.newpat = builtin__trim (f.v.newpat);
		if (((f.v.newpat)) == ((""))) f.pc=4; else f.pc=5;
	},
	function (e,f) { f.v.newpat = " "; },
/*5*/	function (e,f) {
		f.pc=-1;
		e.mcall (4, f.v["this"], "do_save", ([f.v.newpat, (f.v["this"]).expr]));
	},
	function (e,f) { e.mcall (2, f.v["this"], "as_expr", ([])); },
	function (e,f) {
		var t4563 = f.s[0]; f.v.qe = t4563;
		e.mcall (2, f.v.qe, "edit", ([]));
	},
	function (e,f) { e.mcall (2, f.v.qe, "as_string", ([])); },
	function (e,f) {
		var t4565 = f.s[0]; f.v["this"].expr = t4565;
		e.mcall (4, f.v["this"], "do_save", ([(f.v["this"]).pattern, (f.v["this"]).expr]));
	},
null	];

;
	c.pargs__as_expr =  [];
	c.pinst__as_expr =  [
/*0*/	function (e,f) { e.smcall (1, query_expr,"create_from_string", ([(f.v["this"]).expr])); },
	function (e,f) { var t4566 = f.s[0]; e.return_pop (t4566); },
null	];

;
	c.pargs__get_members =  [];
	c.pinst__get_members =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["get_members", ([])])); },
	function (e,f) { var t4567 = f.s[0]; e.return_pop (t4567); },
null	];

;
	c.pargs__as_expr_str =  [];
	c.pinst__as_expr_str =  [
/*0*/	function (e,f) { e.return_pop ((f.v["this"]).expr); },
null	];

;
	c.args__can_rename_all =  ["oldname","newname"];
	c.inst__can_rename_all =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_function_async", (["stored_query", "can_rename_all", ([f.v.oldname, f.v.newname])])); },
	function (e,f) { var t4568 = f.s[0]; e.return_pop (t4568); },
null	];

;
	c.args__rename_all =  ["oldname","newname"];
	c.inst__rename_all =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_function_async", (["stored_query", "rename_all", ([f.v.oldname, f.v.newname])])); },
	function (e,f) { var t4569 = f.s[0]; e.return_pop (t4569); },
null	];

;
	c.args__do_fetch =  ["rowid"];
	c.inst__do_fetch =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_function_async", (["stored_query", "do_fetch", ([f.v.rowid])])); },
	function (e,f) { var t4570 = f.s[0]; e.return_pop (t4570); },
null	];

;
	c.args__find = c.pargs__find =  ["rowid"];
	c.inst__find = c.pinst__find =  [
/*0*/	function (e,f) { if (((f.v.rowid)) == ((0))) f.pc=2; else f.pc=3; },
	function (e,f) { e.return_pop (null); },
	function (e,f) {
		f.pc=4;
		f.s[0] = true;
	},
	function (e,f) { f.s[0] = ((f.v.rowid)) == (("")); },
	function (e,f) { var t4571 = f.s[0]; if (t4571) f.pc=1; else f.pc=5; },
/*5*/	function (e,f) { e.smcall (2, stored_query,"find_object", (["stored_query", f.v.rowid])); },
	function (e,f) {
		var t4573 = f.s[0]; f.v.m = t4573;
		if (((f.v.m)) !== ((null))) f.pc=7; else f.pc=8;
	},
	function (e,f) { e.return_pop (f.v.m); },
	function (e,f) { e.smcall (1, stored_query,"do_fetch", ([f.v.rowid])); },
	function (e,f) { var t4574 = f.s[0]; e.return_pop (t4574); },
null	];

;
};
stored_query.init_methods (stored_query);
rpcclass.setup_class (stored_query, "stored_query",1, (["name","expr","pattern","owners","readers","i_am_owner","i_can_read","rowid","listeners"]), ([0,0,0,0,0,0,0,0,2]));
function report () { this.do_construct (arguments); }
report.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
	c.args__get_templates =  [];
	c.inst__get_templates =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_function_async", (["report", "get_templates", ([])])); },
	function (e,f) { var t4575 = f.s[0]; e.return_pop (t4575); },
null	];

;
	c.args__get_reports_menu =  [];
	c.inst__get_reports_menu =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_function_async", (["report", "get_reports_menu", ([])])); },
	function (e,f) { var t4576 = f.s[0]; e.return_pop (t4576); },
null	];

;
	c.args__select_template = c.pargs__select_template =  [];
	c.inst__select_template = c.pinst__select_template =  [
/*0*/	function (e,f) { e.smcall (0, report,"get_reports_menu", ([])); },
	function (e,f) {
		var t4578 = f.s[0]; f.v.m = t4578;
		e.smcall (1, popupmenu,"run", ([f.v.m]));
	},
	function (e,f) {
		var t4580 = f.s[0]; f.v.p = t4580;
		e.return_pop (f.v.p);
	},
null	];

;
	c.args__create = c.pargs__create =  ["template","expr_str"];
	c.inst__create = c.pinst__create =  [
/*0*/	function (e,f) {
		f.v.r = new report;
		f.v.r.template = f.v.template;
		f.v.r.expr_str = f.v.expr_str;
		e.return_pop (f.v.r);
	},
null	];

;
	c.pargs__run =  [];
	c.pinst__run =  [
/*0*/	function (e,f) { if ((((f.v["this"]).template)) == ((""))) f.pc=3; else f.pc=4; },
	function (e,f) { e.smcall (1, popupok,"run", (["Please enter a query and a format"])); },
	function (e,f) { f.pc=-1; },
	function (e,f) {
		f.pc=9;
		f.s[0] = true;
	},
	function (e,f) { if ((((f.v["this"]).expr_str)) == ((""))) f.pc=5; else f.pc=6; },
/*5*/	function (e,f) {
		f.pc=9;
		f.s[0] = true;
	},
	function (e,f) { if ((((f.v["this"]).template)) === ((null))) f.pc=7; else f.pc=8; },
	function (e,f) {
		f.pc=9;
		f.s[0] = true;
	},
	function (e,f) { f.s[0] = (((f.v["this"]).expr_str)) === ((null)); },
	function (e,f) { var t4584 = f.s[0]; if (t4584) f.pc=1; else f.pc=10; },
/*10*/	function (e,f) { if ((((f.v["this"]).template)) == (("show_results"))) f.pc=11; else f.pc=12; },
	function (e,f) {
		f.pc=-1;
		e.mcall (3, window, "open", ([("/churchbuilder/report-wizard.php?show_results=1&mode=list&expr=") + ((encodeURIComponent ((f.v["this"]).expr_str)))]));
	},
	function (e,f) { if ((((f.v["this"]).template)) == (("show_results_simple"))) f.pc=13; else f.pc=14; },
	function (e,f) {
		f.pc=-1;
		e.mcall (3, window, "open", ([("/churchbuilder/report-wizard.php?show_results=1&mode=simple_list&expr=") + ((encodeURIComponent ((f.v["this"]).expr_str)))]));
	},
	function (e,f) { if ((((f.v["this"]).template)) == (("google_map"))) f.pc=15; else f.pc=16; },
/*15*/	function (e,f) {
		f.pc=-1;
		e.mcall (3, window, "open", ([("/churchbuilder/report-wizard.php?show_results=1&mode=map&expr=") + ((encodeURIComponent ((f.v["this"]).expr_str)))]));
	},
	function (e,f) { if ((((f.v["this"]).template)) == (("busyness"))) f.pc=17; else f.pc=18; },
	function (e,f) {
		f.pc=-1;
		e.mcall (3, window, "open", ([("/churchbuilder/report-wizard.php?show_results=1&mode=busyness&expr=") + ((encodeURIComponent ((f.v["this"]).expr_str)))]));
	},
	function (e,f) { if ((((f.v["this"]).template)) == (("mail"))) f.pc=19; else f.pc=21; },
	function (e,f) { e.mcall (2, f.v["this"], "mail_url", ([])); },
/*20*/	function (e,f) {
		f.pc=-1;
		var t4586 = f.s[0]; f.v.url = t4586;
		window.location = f.v.url;
	},
	function (e,f) { if ((((f.v["this"]).template)) == (("sms"))) f.pc=22; else f.pc=23; },
	function (e,f) {
		f.pc=-1;
		window.location = ("/churchbuilder/sms-manager.php?expr=") + ((encodeURIComponent ((f.v["this"]).expr_str)));
	},
	function (e,f) { window.location = ("/churchbuilder/report-output.php?expr_str=") + ("" + ((encodeURIComponent ((f.v["this"]).expr_str))) + (("&template=") + ((encodeURIComponent ((f.v["this"]).template))))); },
null	];

;
	c.pargs__mail_url =  [];
	c.pinst__mail_url =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["mail_url", ([])])); },
	function (e,f) { var t4590 = f.s[0]; e.return_pop (t4590); },
null	];

;
	c.pargs__choose_query =  ["el","arg","ev"];
	c.pinst__choose_query =  [
/*0*/	function (e,f) { e.smcall (0, groupquerymenu,"choose_group_or_query_by_menu", ([])); },
	function (e,f) {
		var t4592 = f.s[0]; f.v.gq = t4592;
		if (((f.v.gq)) !== ((null))) f.pc=2; else f.pc=5;
	},
	function (e,f) { if ((((f.v.gq).classname)) == (("group"))) f.pc=3; else f.pc=4; },
	function (e,f) {
		f.pc=5;
		f.v["this"].expr_str = ("G") + ("" + ((f.v.gq).rowid) + ("."));
	},
	function (e,f) { f.v["this"].expr_str = ("Q") + ("" + ((f.v.gq).rowid) + (".")); },
/*5*/	function (e,f) { e.mcall (3, document, "getElementById", (["report-query-id"])); },
	function (e,f) {
		var t4596 = f.s[0]; f.v.el = t4596;
		e.smcall (1, query_expr,"create_from_string", ([(f.v["this"]).expr_str]));
	},
	function (e,f) {
		var t4598 = f.s[0]; f.v.qe = t4598;
		e.mcall (2, f.v.qe, "as_text", ([]));
	},
	function (e,f) { var t4600 = f.s[0]; f.v.el.innerHTML = t4600; },
null	];

;
	c.pargs__write_query =  ["el","arg","ev"];
	c.pinst__write_query =  [
/*0*/	function (e,f) { e.smcall (0, query_expr,"create_new", ([])); },
	function (e,f) {
		var t4602 = f.s[0]; f.v.qe = t4602;
		e.mcall (2, f.v.qe, "edit", ([]));
	},
	function (e,f) { e.mcall (2, f.v.qe, "as_string", ([])); },
	function (e,f) {
		var t4604 = f.s[0]; f.v["this"].expr_str = t4604;
		e.mcall (3, document, "getElementById", (["report-query-id"]));
	},
	function (e,f) {
		var t4606 = f.s[0]; f.v.el = t4606;
		e.mcall (2, f.v.qe, "as_text", ([]));
	},
/*5*/	function (e,f) { var t4608 = f.s[0]; f.v.el.innerHTML = t4608; },
null	];

;
	c.pargs__choose_format =  ["el","arg","ev"];
	c.pinst__choose_format =  [
/*0*/	function (e,f) { e.smcall (0, report,"select_template", ([])); },
	function (e,f) {
		var t4610 = f.s[0]; f.v["this"].template = t4610;
		e.mcall (3, document, "getElementById", (["report-format-id"]));
	},
	function (e,f) {
		var t4612 = f.s[0]; f.v.el = t4612;
		f.v.el.innerHTML = (f.v["this"]).template;
	},
null	];

;
};
report.init_methods (report);
rpcclass.setup_class (report, "report",0, (["expr_str","template","listeners"]), ([0,0,2]));
function report_admin () { this.do_construct (arguments); }
report_admin.codegroup = "report_admin";
report_admin.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
	c.pargs__handle_uploaded_templates =  null;
	c.pargs__rename_template =  null;
	c.pargs__delete_template =  null;
	c.pargs__download_template =  null;
	c.pargs__edit_template =  null;
	c.pargs__get_fields =  null;
	c.pargs__run =  null;
	c.args__run_config = c.pargs__run_config =  null;
};
report_admin.init_methods (report_admin);
rpcclass.setup_class (report_admin, "report_admin",0, (["dt","listeners"]), ([0,2]));
function zone_hierarchy_editor () { this.do_construct (arguments); }
zone_hierarchy_editor.codegroup = "zone_admin";
zone_hierarchy_editor.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
	c.pargs__reorder_zones =  null;
	c.pargs__reorder =  null;
	c.pargs__drag_start =  null;
	c.pargs__get_row_fields =  null;
	c.pargs__reorder_children =  null;
};
zone_hierarchy_editor.init_methods (zone_hierarchy_editor);
rpcclass.setup_class (zone_hierarchy_editor, "zone_hierarchy_editor",0, (["dt","order","listeners"]), ([0,0,2]));
function zone () { this.do_construct (arguments); }
zone.codegroup = "zone_admin";
zone.init_methods = function (c) {
	dbclass.init_methods(c);
	var cp = c.prototype;
	c.pargs__get_children =  null;
	c.args__get_top =  null;
	c.args__get_zones_by_name =  null;
	c.args__get_zone_menu =  null;
	c.args__choose_zone = c.pargs__choose_zone =  null;
	c.args__get_this =  null;
	c.pargs__get_row_fields =  null;
	c.pargs__rezone_doc =  null;
	c.pargs__delete_reload =  null;
	c.pargs__edit_reload =  null;
	c.pargs__move_item =  null;
	c.pargs__do_set_zone_properties =  null;
	c.pargs__set_zone_properties =  null;
	c.pargs__set_zone_parent =  null;
	c.pargs__save_atypes =  null;
	c.pargs__create_zone =  null;
	c.pargs__destroy_zone =  null;
	c.pargs__delete_expired =  null;
	c.pargs__configure_zone =  null;
	c.pargs__set_moderators =  null;
	c.pargs__do_delete_doc =  null;
	c.pargs__delete_doc =  null;
	c.pargs__open_doc =  null;
	c.pargs__rerender_doc_summary =  null;
	c.pargs__new_name =  null;
	c.pargs__insert_row =  null;
	c.pargs__save_order =  null;
	c.pargs__reorder =  null;
	c.pargs__dragstart =  null;
};
zone.init_methods (zone);
rpcclass.setup_class (zone, "zone",1, (["name","shortname","fullname","moderators","weight","access","raw_atypes","dtm","d","rowid","listeners"]), ([0,0,0,0,0,0,0,2,0,0,2]));
function fieldspec () { this.do_construct (arguments); }
fieldspec.init_methods = function (c) {
	dbclass.init_methods(c);
	var cp = c.prototype;
	c.args__get_by_name = c.pargs__get_by_name =  ["fieldname"];
	c.inst__get_by_name = c.pinst__get_by_name =  [
/*0*/	function (e,f) { if (builtin__preg_match ("%(.*)\\\\(.*)%",f.v.fieldname,f.v.matches)) f.pc=1; else f.pc=4; },
	function (e,f) { e.smcall (1, activityType,"lookup", ([(f.v.matches)[(1)]])); },
	function (e,f) {
		var t4782 = f.s[0]; f.v.atype = t4782;
		e.mcall (3, f.v.atype, "get_fspec_by_name", ([(f.v.matches)[(2)]]));
	},
	function (e,f) { var t4783 = f.s[0]; e.return_pop (t4783); },
	function (e,f) {
		f.s[0] = builtin__debugout ("warning: used short name for field $fieldname");
		e.php_push_static_var (1, fieldspec,"cache_by_name");
		var t4784 = f.s[1]; 
		if (((t4784)[(f.v.fieldname)]) !== undefined) f.pc=5; else f.pc=6;
	},
/*5*/	function (e,f) {
		e.php_push_static_var (1, fieldspec,"cache_by_name");
		var t4785 = f.s[1]; 
		e.return_pop ((t4785)[(f.v.fieldname)]);
	},
	function (e,f) {
		f.s[0] = builtin__debugout ("failed to find field $fieldname");
		e.return_pop (null);
	},
null	];

;
	c.pargs__can_have_default_value =  [];
	c.pinst__can_have_default_value =  [
/*0*/	function (e,f) { if ((((f.v["this"]).fieldtype)) == (("text"))) f.pc=1; else f.pc=2; },
	function (e,f) {
		f.pc=3;
		f.s[0] = true;
	},
	function (e,f) { f.s[0] = (((f.v["this"]).fieldtype)) == (("series")); },
	function (e,f) { var t4786 = f.s[0]; e.return_pop (t4786); },
null	];

;
	c.pargs__do_get_grouphints =  [];
	c.pinst__do_get_grouphints =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["do_get_grouphints", ([])])); },
	function (e,f) { var t4787 = f.s[0]; e.return_pop (t4787); },
null	];

;
	c.pargs__get_grouphints =  [];
	c.pinst__get_grouphints =  [
/*0*/	function (e,f) { if (!(((f.v["this"]).grouphints) !== undefined)) f.pc=1; else f.pc=3; },
	function (e,f) { e.mcall (2, f.v["this"], "do_get_grouphints", ([])); },
	function (e,f) { var t4789 = f.s[0]; f.v["this"].grouphints = t4789; },
	function (e,f) { e.return_pop ((f.v["this"]).grouphints); },
null	];

;
	c.args__do_create =  ["atype","name","type","label"];
	c.inst__do_create =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_function_async", (["fieldspec", "do_create", ([f.v.atype, f.v.name, f.v.type, f.v.label])])); },
	function (e,f) { var t4790 = f.s[0]; e.return_pop (t4790); },
null	];

;
	c.pargs__do_save =  ["values","readers","writers","group"];
	c.pinst__do_save =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["do_save", ([f.v.values, f.v.readers, f.v.writers, f.v.group])])); },
	function (e,f) { var t4791 = f.s[0]; e.return_pop (t4791); },
null	];

;
	c.pargs__edit =  [];
	c.pinst__edit =  [
/*0*/	function (e,f) { e.smcall (1, query_expr,"create_from_string", ([(f.v["this"]).readers_expr])); },
	function (e,f) {
		var t4793 = f.s[0]; f.v.readers_qe = t4793;
		e.smcall (1, query_expr,"create_from_string", ([(f.v["this"]).writers_expr]));
	},
	function (e,f) {
		var t4795 = f.s[0]; f.v.writers_qe = t4795;
		e.smcall (1, query_expr,"create_from_string", ([(f.v["this"]).group_expr]));
	},
	function (e,f) {
		f.pc=5;
		var t4797 = f.s[0]; f.v.group_qe = t4797;
		f.v.fields = ([({name:"name", type:"label", label:"Name", value:(f.v["this"]).name}), ({name:"type", type:"label", label:"Type", value:(f.v["this"]).fieldtype}), ({name:"label", type:"text", label:"Label", focus:1, value:(f.v["this"]).label}), ({name:"readers", type:"query_expr", label:"Readers", value:f.v.readers_qe}), ({name:"writers", type:"query_expr", label:"Writers", value:f.v.writers_qe}), ({name:"inherited", type:"yesno", label:"Inherited", value:(f.v["this"]).inherited})]);
		e.mcall (2, f.v["this"], "can_have_default_value", ([]));
	},
	function (e,f) {
		f.pc=6;
		f.v.fields[f.v.fields.length] = ({name:"default_value", type:"text", label:"Default value", value:(f.v["this"]).default_value});
	},
/*5*/	function (e,f) { var t4800 = f.s[0]; if (t4800) f.pc=4; else f.pc=6; },
	function (e,f) { if ((((f.v["this"]).fieldtype)) == (("person"))) f.pc=7; else f.pc=8; },
	function (e,f) {
		f.v.fields[f.v.fields.length] = ({name:"group", type:"query_expr", label:"Usual Candidates", value:f.v.group_qe});
		f.v.fields[f.v.fields.length] = ({name:"send_reminders", type:"yesno", label:"Send Reminders", value:(f.v["this"]).send_reminders});
	},
	function (e,f) { if ((((f.v["this"]).fieldtype)) == (("text"))) f.pc=9; else f.pc=10; },
	function (e,f) { f.v.fields[f.v.fields.length] = ({name:"usual_values", type:"text", label:"Usual Values", value:builtin__implode (",",(f.v["this"]).usual_values)}); },
/*10*/	function (e,f) {
		f.v.pop = new popupform;
		e.mcall (6, f.v.pop, "initialise", ([0, 0, "Edit Field", f.v.fields]));
	},
	function (e,f) { e.mcall (2, f.v.pop, "open", ([])); },
	function (e,f) { e.mcall (2, f.v.pop, "run", ([])); },
	function (e,f) {
		var t4806 = f.s[0]; f.v.event = t4806;
		if ((((f.v.event).action)) == (("OK"))) f.pc=14; else f.pc=21;
	},
	function (e,f) { e.mcall (2, f.v.pop, "get_form_fields", ([])); },
/*15*/	function (e,f) {
		var t4808 = f.s[0]; f.v.values = t4808;
		e.mcall (2, f.v.readers_qe, "as_string", ([]));
	},
	function (e,f) {
		var t4810 = f.s[0]; f.v.readers = t4810;
		e.mcall (2, f.v.writers_qe, "as_string", ([]));
	},
	function (e,f) {
		var t4812 = f.s[0]; f.v.writers = t4812;
		e.mcall (2, f.v.group_qe, "as_string", ([]));
	},
	function (e,f) {
		var t4814 = f.s[0]; f.v.group = t4814;
		e.mcall (6, f.v["this"], "do_save", ([f.v.values, f.v.readers, f.v.writers, f.v.group]));
	},
	function (e,f) { e.mcall (2, f.v.pop, "close", ([])); },
/*20*/	function (e,f) { e.return_pop (f.v.fs); },
	function (e,f) { e.mcall (2, f.v.pop, "close", ([])); },
	function (e,f) { e.return_pop (null); },
null	];

;
	c.args__create_new = c.pargs__create_new =  ["atype"];
	c.inst__create_new = c.pinst__create_new =  [
/*0*/	function (e,f) {
		f.v.fields = ([({name:"label", type:"text", label:"Name", focus:1}), ({name:"type", type:"list", label:"Type", options:(["text", "person", "series", "bibleref", "hidden"]), value:"text"})]);
		f.v.pop = new popupform;
		e.mcall (6, f.v.pop, "initialise", ([0, 0, "Create Field", f.v.fields]));
	},
	function (e,f) { e.mcall (2, f.v.pop, "open", ([])); },
	function (e,f) { e.mcall (2, f.v.pop, "run", ([])); },
	function (e,f) {
		var t4818 = f.s[0]; f.v.event = t4818;
		if ((((f.v.event).action)) == (("OK"))) f.pc=4; else f.pc=10;
	},
	function (e,f) { e.mcall (2, f.v.pop, "get_form_fields", ([])); },
/*5*/	function (e,f) {
		var t4820 = f.s[0]; f.v.values = t4820;
		e.mcall (2, f.v.pop, "close", ([]));
	},
	function (e,f) { if ((((f.v.values).label)) == ((""))) f.pc=7; else f.pc=8; },
	function (e,f) {
		f.s[0] = builtin__alert ("Need a name");
		e.return_pop (null);
	},
	function (e,f) {
		f.v.name = builtin__preg_replace ("/[^a-z]/","-",builtin__strtolower ((f.v.values).label));
		e.smcall (4, fieldspec,"do_create", ([f.v.atype, f.v.name, (f.v.values).type, (f.v.values).label]));
	},
	function (e,f) { var t4822 = f.s[0]; e.return_pop (t4822); },
/*10*/	function (e,f) { e.mcall (2, f.v.pop, "close", ([])); },
	function (e,f) { e.return_pop (null); },
null	];

;
};
fieldspec.init_methods (fieldspec);
rpcclass.setup_class (fieldspec, "fieldspec",1, (["name","fullname","atype","fieldtype","description","label","readers_expr","writers_expr","owners_expr","inherited","group_expr","usual_values","default_value","send_reminders","can_read","can_write","can_add","in_group","rowid","listeners"]), ([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2]));
function field () { this.do_construct (arguments); }
field.init_methods = function (c) {
	dbclass.init_methods(c);
	var cp = c.prototype;
	c.pargs__initialise =  ["fieldspec","activity"];
	c.pinst__initialise =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["initialise", ([f.v.fieldspec, f.v.activity])])); },
	function (e,f) { var t4823 = f.s[0]; e.return_pop (t4823); },
null	];

;
	c.pargs__reload =  [];
	c.pinst__reload =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["reload", ([])])); },
	function (e,f) { var t4824 = f.s[0]; e.return_pop (t4824); },
null	];

;
	c.pargs__change_notification =  ["msg"];
	c.pinst__change_notification =  [
/*0*/	function (e,f) {
		f.v.flat = "";
		f.v._k278 = e.enumkeys ((f.v["this"]).values);
	},
	function (e,f) {
		f.pc=3;
		if (!((f.v._k278).length)) f.pc=2;
	},
	function (e,f) { if (((f.v.flat)) != ((f.v.msg))) f.pc=4; else f.pc=-1; },
	function (e,f) {
		f.pc=1;
		f.s[0] = f.v._i279 = (f.v._k278).shift();
		f.s[1] = f.v.value = ((f.v["this"]).values)[(f.v._i279)];
		f.v.flat = "" + (f.v.flat) + (("{") + ("" + (f.v.value) + ("}")));
	},
	function (e,f) { e.mcall (2, f.v["this"], "reload", ([])); },
/*5*/	function (e,f) { e.mcall (4, f.v["this"], "send_msg", (["update_notification", null])); },
null	];

;
	c.pargs__event_repeat_change =  ["msg"];
	c.pinst__event_repeat_change =  [
/*0*/	function (e,f) { f.s[0] = builtin__debugout ("RepeatOf has changed\n"); },
null	];

;
	c.pargs__master_change =  ["msg"];
	c.pinst__master_change =  [
/*0*/	function (e,f) {
		f.s[0] = builtin__debugout ("Master value has changed\n");
		e.mcall (4, f.v["this"], "send_msg", (["update_notification", null]));
	},
null	];

;
	c.pargs__create_watch =  [];
	c.pinst__create_watch =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["create_watch", ([])])); },
	function (e,f) { var t4830 = f.s[0]; e.return_pop (t4830); },
null	];

;
	c.args__get_fields_for_activity =  ["fieldspecs","activity","ensure_present"];
	c.inst__get_fields_for_activity =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_function_async", (["field", "get_fields_for_activity", ([f.v.fieldspecs, f.v.activity, f.v.ensure_present])])); },
	function (e,f) { var t4831 = f.s[0]; e.return_pop (t4831); },
null	];

;
	c.pargs__safe_save =  [];
	c.pinst__safe_save =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["safe_save", ([])])); },
	function (e,f) { var t4832 = f.s[0]; e.return_pop (t4832); },
null	];

;
	c.pargs__i_am_included =  [];
	c.pinst__i_am_included =  [
/*0*/	function (e,f) {
		f.pc=2;
		e.smcall (0, person,"logged_in", ([]));
	},
	function (e,f) { e.return_pop (false); },
	function (e,f) {
		var t4833 = f.s[0]; 
		if (!(t4833)) f.pc=1; else f.pc=3;
	},
	function (e,f) { f.v.i = 0; },
	function (e,f) {
		f.pc=6;
		if (!((((f.v["this"]).values)[(f.v.i)]) !== undefined)) f.pc=5;
	},
/*5*/	function (e,f) { e.return_pop (false); },
	function (e,f) { if (builtin__preg_match ("/^\\d+$/",((f.v["this"]).values)[(f.v.i)])) f.pc=8; else f.pc=10; },
	function (e,f) { e.return_pop (true); },
	function (e,f) { e.smcall (0, person,"my_uid", ([])); },
	function (e,f) {
		f.pc=11;
		var t4835 = f.s[0]; f.s[0] = ((((f.v["this"]).values)[(f.v.i)])) == ((t4835));
	},
/*10*/	function (e,f) { f.s[0] = false; },
	function (e,f) { var t4836 = f.s[0]; if (t4836) f.pc=7; else f.pc=12; },
	function (e,f) {
		f.pc=4;
		e.php_push_var_lvalue (0, "i");
		e.php_postinc (1);
	},
null	];

;
	c.pargs__sort_reminder =  ["oldval","newval"];
	c.pinst__sort_reminder =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["sort_reminder", ([f.v.oldval, f.v.newval])])); },
	function (e,f) { var t4838 = f.s[0]; e.return_pop (t4838); },
null	];

;
	c.pargs__do_save_value =  ["index","value","force"];
	c.pinst__do_save_value =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["do_save_value", ([f.v.index, f.v.value, f.v.force])])); },
	function (e,f) { var t4839 = f.s[0]; e.return_pop (t4839); },
null	];

;
	c.pargs__save_value =  ["index","value"];
	c.pinst__save_value =  [
/*0*/	function (e,f) { if (((((f.v["this"]).values)[(f.v.index)])) != ((f.v.value))) f.pc=1; else f.pc=-1; },
	function (e,f) { e.mcall (5, f.v["this"], "do_save_value", ([f.v.index, f.v.value, false])); },
	function (e,f) {
		var t4841 = f.s[0]; f.v.conf = t4841;
		if (((f.v.conf)) !== ((null))) f.pc=3; else f.pc=15;
	},
	function (e,f) {
		f.v.msg = "This person is already down for";
		f.v.need_comma = false;
		f.v._k280 = e.enumkeys (f.v.conf);
	},
	function (e,f) {
		f.pc=6;
		if (!((f.v._k280).length)) f.pc=5;
	},
/*5*/	function (e,f) {
		f.pc=14;
		f.v.msg = "" + (f.v.msg) + (". Do it anyway?");
		e.smcall (1, popupokcancel,"run", ([f.v.msg]));
	},
	function (e,f) {
		f.v._i281 = (f.v._k280).shift();
		f.v.f = (f.v.conf)[(f.v._i281)];
		if (f.v.need_comma) f.pc=7; else f.pc=8;
	},
	function (e,f) { f.v.msg = "" + (f.v.msg) + (","); },
	function (e,f) { if ((((f.v.f).activity)) != (((f.v["this"]).activity))) f.pc=9; else f.pc=10; },
	function (e,f) {
		f.pc=11;
		f.v.msg = "" + (f.v.msg) + ((" ") + ("" + ((((f.v.f).activity).atype).nicename) + ((":") + (((f.v.f).fieldspec).label))));
	},
/*10*/	function (e,f) { f.v.msg = "" + (f.v.msg) + ((" ") + (((f.v.f).fieldspec).label)); },
	function (e,f) {
		f.pc=4;
		f.v.need_comma = true;
	},
	function (e,f) { e.mcall (5, f.v["this"], "do_save_value", ([f.v.index, f.v.value, true])); },
	function (e,f) {
		f.pc=-1;
		e.mcall (4, f.v["this"], "send_msg", (["update_notification", null]));
	},
	function (e,f) { var t4852 = f.s[0]; if (t4852) f.pc=12; else f.pc=-1; },
/*15*/	function (e,f) { e.mcall (4, f.v["this"], "send_msg", (["update_notification", null])); },
null	];

;
	c.pargs__use_candidate =  ["val"];
	c.pinst__use_candidate =  [
/*0*/	function (e,f) { f.v._k282 = e.enumkeys ((f.v["this"]).values); },
	function (e,f) {
		f.pc=3;
		if (!((f.v._k282).length)) f.pc=2;
	},
	function (e,f) {
		f.pc=-1;
		e.mcall (4, f.v["this"], "save_value", ([0, f.v.val]));
	},
	function (e,f) {
		f.v.i = (f.v._k282).shift();
		f.v.value = ((f.v["this"]).values)[(f.v.i)];
		if (((f.v.value)) == ((0))) f.pc=6; else f.pc=7;
	},
	function (e,f) { e.mcall (4, f.v["this"], "save_value", ([f.v.i, f.v.val])); },
/*5*/	function (e,f) { f.pc=-1; },
	function (e,f) {
		f.pc=8;
		f.s[0] = true;
	},
	function (e,f) { f.s[0] = ((f.v.value)) == (("")); },
	function (e,f) { var t4856 = f.s[0]; if (t4856) f.pc=4; else f.pc=1; },
null	];

;
	c.pargs__use_volunteer =  ["el","uid"];
	c.pinst__use_volunteer =  [
/*0*/	function (e,f) { e.mcall (3, f.v["this"], "use_candidate", ([f.v.uid])); },
null	];

;
	c.pargs__choose_candidate =  ["for_duty"];
	c.pinst__choose_candidate =  [
/*0*/	function (e,f) { e.smcall (0, menu,"create", ([])); },
	function (e,f) {
		var t4858 = f.s[0]; f.v.menu = t4858;
		f.v.rd = (f.v["this"]).fieldspec;
		e.mcall (2, f.v.rd, "get_grouphints", ([]));
	},
	function (e,f) {
		var t4860 = f.s[0]; 
		f.v._k284 = e.enumkeys (t4860);
	},
	function (e,f) {
		f.pc=5;
		if (!((f.v._k284).length)) f.pc=4;
	},
	function (e,f) { if (f.v.for_duty) f.pc=16; else f.pc=18; },
/*5*/	function (e,f) {
		f.s[0] = f.v.i = (f.v._k284).shift();
		f.s[1] = f.v.i;
		e.mcall (4, f.v.rd, "get_grouphints", ([]));
	},
	function (e,f) {
		var t4863 = f.s[2]; var t4864 = f.s[1]; 
		f.v.hint = (t4863)[(t4864)];
		if (!(f.v.for_duty)) f.pc=13; else f.pc=14;
	},
	function (e,f) {
		f.v.text = "";
		if (f.v.for_duty) f.pc=9; else f.pc=10;
	},
	function (e,f) {
		f.pc=12;
		f.v.text = "" + (f.v.text) + ("*");
	},
	function (e,f) {
		f.pc=11;
		f.s[0] = builtin__in_array ((f.v.hint).rowid,(f.v["this"]).volunteers);
	},
/*10*/	function (e,f) { f.s[0] = false; },
	function (e,f) { var t4868 = f.s[0]; if (t4868) f.pc=8; else f.pc=12; },
	function (e,f) {
		f.pc=3;
		f.v.text = "" + (f.v.text) + ((f.v.hint).nicename);
		e.mcall (4, f.v.menu, "add_item", ([(f.v.hint).rowid, f.v.text]));
	},
	function (e,f) {
		f.pc=15;
		f.s[0] = true;
	},
	function (e,f) { f.s[0] = !(builtin__in_array ((f.v.hint).rowid,(f.v["this"]).refusals)); },
/*15*/	function (e,f) { var t4870 = f.s[0]; if (t4870) f.pc=7; else f.pc=3; },
	function (e,f) { e.mcall (4, f.v.menu, "add_item", ([parseInt((0),10) - parseInt((1),10), "Other church member..."])); },
	function (e,f) { e.mcall (4, f.v.menu, "add_item", ([parseInt((0),10) - parseInt((2),10), "Guest..."])); },
	function (e,f) { e.smcall (1, popupmenu,"run", ([f.v.menu])); },
	function (e,f) {
		var t4872 = f.s[0]; f.v.val = t4872;
		if (((f.v.val)) == ((parseInt((0),10) - parseInt((1),10)))) f.pc=20; else f.pc=23;
	},
/*20*/	function (e,f) { e.smcall (0, person,"lookup", ([])); },
	function (e,f) {
		var t4874 = f.s[0]; f.v.p = t4874;
		if (((f.v.p)) !== ((null))) f.pc=22; else f.pc=33;
	},
	function (e,f) { e.return_pop ((f.v.p).rowid); },
	function (e,f) { if (((f.v.val)) == ((parseInt((0),10) - parseInt((2),10)))) f.pc=24; else f.pc=31; },
	function (e,f) {
		f.v.oldvalue = "";
		if (((builtin__substr (((f.v["this"]).values)[(f.v.index)],0,1))) == (("\""))) f.pc=25; else f.pc=26;
	},
/*25*/	function (e,f) { f.v.oldvalue = builtin__substr (((f.v["this"]).values)[(f.v.index)],1,parseInt(((((f.v["this"]).values)[(f.v.index)]).length),10) - parseInt((2),10)); },
	function (e,f) { e.smcall (6, popupcombobox,"run", ([0, 0, "Enter person's name", ([]), true, f.v.oldvalue])); },
	function (e,f) {
		var t4878 = f.s[0]; f.v.val = t4878;
		if (((f.v.val)) == ((""))) f.pc=28; else f.pc=29;
	},
	function (e,f) { e.return_pop (0); },
	function (e,f) { if (((f.v.val)) != ((null))) f.pc=30; else f.pc=33; },
/*30*/	function (e,f) { e.return_pop (("\"") + ("" + (f.v.val) + ("\""))); },
	function (e,f) { if (((f.v.val)) != ((null))) f.pc=32; else f.pc=33; },
	function (e,f) { e.return_pop (f.v.val); },
	function (e,f) { e.return_pop (null); },
null	];

;
	c.pargs__change_value =  ["el","index"];
	c.pinst__change_value =  [
/*0*/	function (e,f) { if (((((f.v["this"]).fieldspec).fieldtype)) == (("text"))) f.pc=1; else f.pc=4; },
	function (e,f) { e.smcall (6, popupcombobox,"run", ([0, 0, ((f.v["this"]).fieldspec).label, ((f.v["this"]).fieldspec).usual_values, true, ((f.v["this"]).values)[(f.v.index)]])); },
	function (e,f) {
		var t4880 = f.s[0]; f.v.newval = t4880;
		if (((f.v.newval)) !== ((null))) f.pc=3; else f.pc=-1;
	},
	function (e,f) {
		f.pc=-1;
		e.mcall (4, f.v["this"], "save_value", ([f.v.index, f.v.newval]));
	},
	function (e,f) { if (((((f.v["this"]).fieldspec).fieldtype)) == (("bibleref"))) f.pc=5; else f.pc=8; },
/*5*/	function (e,f) { e.smcall (6, popupcombobox,"run", ([0, 0, ((f.v["this"]).fieldspec).label, ([]), true, ((f.v["this"]).values)[(f.v.index)]])); },
	function (e,f) {
		var t4882 = f.s[0]; f.v.newval = t4882;
		if (((f.v.newval)) !== ((null))) f.pc=7; else f.pc=-1;
	},
	function (e,f) {
		f.pc=-1;
		e.mcall (4, f.v["this"], "save_value", ([f.v.index, f.v.newval]));
	},
	function (e,f) { if (((((f.v["this"]).fieldspec).fieldtype)) == (("series"))) f.pc=9; else f.pc=13; },
	function (e,f) { e.mcall (2, f.v["this"], "recent_series", ([])); },
/*10*/	function (e,f) {
		var t4884 = f.s[0]; f.v.rs = t4884;
		e.smcall (6, popupcombobox,"run", ([0, 0, ((f.v["this"]).fieldspec).label, f.v.rs, true, ((f.v["this"]).values)[(f.v.index)]]));
	},
	function (e,f) {
		var t4886 = f.s[0]; f.v.newval = t4886;
		if (((f.v.newval)) !== ((null))) f.pc=12; else f.pc=-1;
	},
	function (e,f) {
		f.pc=-1;
		e.mcall (4, f.v["this"], "save_value", ([f.v.index, f.v.newval]));
	},
	function (e,f) { if (((((f.v["this"]).fieldspec).fieldtype)) == (("person"))) f.pc=14; else f.pc=17; },
	function (e,f) { e.mcall (3, f.v["this"], "choose_candidate", ([true])); },
/*15*/	function (e,f) {
		var t4888 = f.s[0]; f.v.val = t4888;
		if (((f.v.val)) !== ((null))) f.pc=16; else f.pc=-1;
	},
	function (e,f) {
		f.pc=-1;
		e.mcall (4, f.v["this"], "save_value", ([f.v.index, f.v.val]));
	},
	function (e,f) { e.smcall (1, popupokcancel,"run", ([("Don't know how to edit type ") + (((f.v["this"]).fieldspec).fieldtype)])); },
null	];

;
	c.pargs__do_delete_value =  ["index"];
	c.pinst__do_delete_value =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["do_delete_value", ([f.v.index])])); },
	function (e,f) { var t4889 = f.s[0]; e.return_pop (t4889); },
null	];

;
	c.pargs__do_add_value =  [];
	c.pinst__do_add_value =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["do_add_value", ([])])); },
	function (e,f) { var t4890 = f.s[0]; e.return_pop (t4890); },
null	];

;
	c.pargs__delete_value =  ["el","index"];
	c.pinst__delete_value =  [
/*0*/	function (e,f) { e.mcall (3, f.v["this"], "do_delete_value", ([f.v.index])); },
	function (e,f) { e.mcall (4, f.v["this"], "send_msg", (["update_notification", null])); },
null	];

;
	c.pargs__add_value =  [];
	c.pinst__add_value =  [
/*0*/	function (e,f) { e.mcall (2, f.v["this"], "do_add_value", ([])); },
	function (e,f) { e.mcall (4, f.v["this"], "send_msg", (["update_notification", null])); },
null	];

;
	c.pargs__find_index =  ["htmlid"];
	c.pinst__find_index =  [
/*0*/	function (e,f) {
		f.v.matches = ([]);
		f.s[0] = builtin__preg_match ("/\\:(\\d+)$/",f.v.htmlid,f.v.matches);
		e.return_pop ((f.v.matches)[(1)]);
	},
null	];

;
	c.pargs__do_change_volunteer_state =  ["uid","newstate"];
	c.pinst__do_change_volunteer_state =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["do_change_volunteer_state", ([f.v.uid, f.v.newstate])])); },
	function (e,f) { var t4892 = f.s[0]; e.return_pop (t4892); },
null	];

;
	c.pargs__change_volunteer_state =  ["newstate"];
	c.pinst__change_volunteer_state =  [
/*0*/	function (e,f) {
		f.s[0] = f.v.newstate;
		e.smcall (1, person,"my_uid", ([]));
	},
	function (e,f) { var t4893 = f.s[1]; var t4894 = f.s[0]; e.mcall (4, f.v["this"], "do_change_volunteer_state", ([t4893, t4894])); },
	function (e,f) { e.mcall (4, f.v["this"], "send_msg", (["update_notification", null])); },
null	];

;
	c.pargs__do_suggest =  ["val"];
	c.pinst__do_suggest =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["do_suggest", ([f.v.val])])); },
	function (e,f) { var t4895 = f.s[0]; e.return_pop (t4895); },
null	];

;
	c.pargs__do_unsuggest =  ["val"];
	c.pinst__do_unsuggest =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["do_unsuggest", ([f.v.val])])); },
	function (e,f) { var t4896 = f.s[0]; e.return_pop (t4896); },
null	];

;
	c.pargs__clear_suggestions =  [];
	c.pinst__clear_suggestions =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["clear_suggestions", ([])])); },
	function (e,f) { var t4897 = f.s[0]; e.return_pop (t4897); },
null	];

;
	c.pargs__suggest =  [];
	c.pinst__suggest =  [
/*0*/	function (e,f) { e.mcall (3, f.v["this"], "choose_candidate", ([true])); },
	function (e,f) {
		var t4899 = f.s[0]; f.v.val = t4899;
		if (((f.v.val)) !== ((null))) f.pc=2; else f.pc=-1;
	},
	function (e,f) { e.mcall (3, f.v["this"], "do_suggest", ([f.v.val])); },
	function (e,f) { e.mcall (4, f.v["this"], "send_msg", (["update_notification", null])); },
null	];

;
	c.pargs__proxy_menu =  [];
	c.pinst__proxy_menu =  [
/*0*/	function (e,f) { e.mcall (3, f.v["this"], "choose_candidate", ([false])); },
	function (e,f) {
		var t4901 = f.s[0]; f.v.uid = t4901;
		if (((f.v.uid)) !== ((null))) f.pc=2; else f.pc=-1;
	},
	function (e,f) { e.smcall (0, menu,"create", ([])); },
	function (e,f) {
		var t4903 = f.s[0]; f.v.menu = t4903;
		if (builtin__in_array (f.v.uid,(f.v["this"]).volunteers)) f.pc=4; else f.pc=6;
	},
	function (e,f) { e.mcall (4, f.v.menu, "add_item", (["available", "Unvolunteer"])); },
/*5*/	function (e,f) {
		f.pc=11;
		e.mcall (4, f.v.menu, "add_item", (["unavailable", "Unavailable"]));
	},
	function (e,f) { if (builtin__in_array (f.v.uid,(f.v["this"]).refusals)) f.pc=7; else f.pc=9; },
	function (e,f) { e.mcall (4, f.v.menu, "add_item", (["volunteer", "Volunteer"])); },
	function (e,f) {
		f.pc=11;
		e.mcall (4, f.v.menu, "add_item", (["available", "Available"]));
	},
	function (e,f) { e.mcall (4, f.v.menu, "add_item", (["volunteer", "Volunteer"])); },
/*10*/	function (e,f) { e.mcall (4, f.v.menu, "add_item", (["unavailable", "Unavailable"])); },
	function (e,f) { e.smcall (1, popupmenu,"run", ([f.v.menu])); },
	function (e,f) {
		var t4905 = f.s[0]; f.v.cmd = t4905;
		if (((f.v.cmd)) !== ((null))) f.pc=15; else f.pc=20;
	},
	function (e,f) { e.mcall (4, f.v["this"], "do_change_volunteer_state", ([f.v.uid, f.v.cmd])); },
	function (e,f) {
		f.pc=-1;
		e.mcall (4, f.v["this"], "send_msg", (["update_notification", null]));
	},
/*15*/	function (e,f) { if (((f.v.cmd)) == (("volunteer"))) f.pc=16; else f.pc=17; },
	function (e,f) {
		f.pc=21;
		f.s[0] = true;
	},
	function (e,f) { if (((f.v.cmd)) == (("unavailable"))) f.pc=18; else f.pc=19; },
	function (e,f) {
		f.pc=21;
		f.s[0] = true;
	},
	function (e,f) {
		f.pc=21;
		f.s[0] = ((f.v.cmd)) == (("available"));
	},
/*20*/	function (e,f) { f.s[0] = false; },
	function (e,f) { var t4906 = f.s[0]; if (t4906) f.pc=13; else f.pc=-1; },
null	];

;
	c.pargs__use_suggestion =  ["el","sug"];
	c.pinst__use_suggestion =  [
/*0*/	function (e,f) {
		f.v.fields = builtin__explode ("|",f.v.sug);
		if (((builtin__count (f.v.fields))) > ((1))) f.pc=1; else f.pc=2;
	},
	function (e,f) {
		f.pc=3;
		f.v.val = (f.v.fields)[(0)];
	},
	function (e,f) { f.v.val = f.v.sug; },
	function (e,f) {
		f.s[0] = builtin__error_log ("Using suggestion '$val'");
		e.mcall (3, f.v["this"], "use_candidate", ([f.v.val]));
	},
	function (e,f) { e.mcall (2, f.v["this"], "clear_suggestions", ([])); },
/*5*/	function (e,f) { e.mcall (4, f.v["this"], "send_msg", (["update_notification", null])); },
null	];

;
	c.pargs__right_click_sug =  ["el","sug"];
	c.pinst__right_click_sug =  [
/*0*/	function (e,f) { e.smcall (1, popupmenu,"quick", ([(["Use", "Cancel"])])); },
	function (e,f) {
		var t4911 = f.s[0]; f.v.choice = t4911;
		if (((f.v.choice)) === ((null))) f.pc=2; else f.pc=3;
	},
	function (e,f) { f.pc=-1; },
	function (e,f) { if (((f.v.choice)) == (("Use"))) f.pc=4; else f.pc=5; },
	function (e,f) {
		f.pc=-1;
		e.mcall (4, f.v["this"], "use_suggestion", ([f.v.el, f.v.sug]));
	},
/*5*/	function (e,f) { if (((f.v.choice)) == (("Cancel"))) f.pc=6; else f.pc=-1; },
	function (e,f) { e.mcall (3, f.v["this"], "do_unsuggest", ([f.v.sug])); },
	function (e,f) { e.mcall (4, f.v["this"], "send_msg", (["update_notification", null])); },
null	];

;
	c.pargs__right_click_vol =  ["el","vol"];
	c.pinst__right_click_vol =  [
/*0*/	function (e,f) { e.smcall (0, menu,"create", ([])); },
	function (e,f) {
		var t4913 = f.s[0]; f.v.menu = t4913;
		if (((f.v["this"]).fieldspec).in_group) f.pc=2; else f.pc=12;
	},
	function (e,f) {
		f.pc=11;
		f.s[0] = (f.v["this"]).volunteers;
		e.smcall (1, person,"my_uid", ([]));
	},
	function (e,f) { e.mcall (4, f.v.menu, "add_item", (["available", "Unvolunteer"])); },
	function (e,f) {
		f.pc=12;
		e.mcall (4, f.v.menu, "add_item", (["unavailable", "Unavailable"]));
	},
/*5*/	function (e,f) {
		f.pc=10;
		f.s[0] = (f.v["this"]).refusals;
		e.smcall (1, person,"my_uid", ([]));
	},
	function (e,f) { e.mcall (4, f.v.menu, "add_item", (["volunteer", "Volunteer"])); },
	function (e,f) {
		f.pc=12;
		e.mcall (4, f.v.menu, "add_item", (["available", "Available"]));
	},
	function (e,f) { e.mcall (4, f.v.menu, "add_item", (["volunteer", "Volunteer"])); },
	function (e,f) {
		f.pc=12;
		e.mcall (4, f.v.menu, "add_item", (["unavailable", "Unavailable"]));
	},
/*10*/	function (e,f) {
		var t4914 = f.s[1]; var t4915 = f.s[0]; 
		if (builtin__in_array (t4914,t4915)) f.pc=6; else f.pc=8;
	},
	function (e,f) {
		var t4916 = f.s[1]; var t4917 = f.s[0]; 
		if (builtin__in_array (t4916,t4917)) f.pc=3; else f.pc=5;
	},
	function (e,f) { e.smcall (1, popupmenu,"run", ([f.v.menu])); },
	function (e,f) {
		var t4919 = f.s[0]; f.v.cmd = t4919;
		if (((f.v.cmd)) == (("volunteer"))) f.pc=15; else f.pc=16;
	},
	function (e,f) {
		f.pc=-1;
		e.mcall (3, f.v["this"], "change_volunteer_state", ([f.v.cmd]));
	},
/*15*/	function (e,f) {
		f.pc=19;
		f.s[0] = true;
	},
	function (e,f) { if (((f.v.cmd)) == (("unavailable"))) f.pc=17; else f.pc=18; },
	function (e,f) {
		f.pc=19;
		f.s[0] = true;
	},
	function (e,f) { f.s[0] = ((f.v.cmd)) == (("available")); },
	function (e,f) { var t4920 = f.s[0]; if (t4920) f.pc=14; else f.pc=-1; },
null	];

;
	c.pargs__right_click =  ["el","id"];
	c.pinst__right_click =  [
/*0*/	function (e,f) { e.mcall (3, f.v["this"], "find_index", ([f.v.id])); },
	function (e,f) {
		var t4922 = f.s[0]; f.v.index = t4922;
		e.smcall (0, menu,"create", ([]));
	},
	function (e,f) {
		var t4924 = f.s[0]; f.v.menu = t4924;
		if (((((f.v["this"]).fieldspec).fieldtype)) == (("person"))) f.pc=4; else f.pc=9;
	},
	function (e,f) {
		f.pc=11;
		e.mcall (4, f.v.menu, "add_item", (["open", "Open"]));
	},
	function (e,f) { if (((((f.v["this"]).values)[(f.v.index)])) != (("0"))) f.pc=5; else f.pc=8; },
/*5*/	function (e,f) { if (((((f.v["this"]).values)[(f.v.index)])) != ((""))) f.pc=6; else f.pc=7; },
	function (e,f) {
		f.pc=10;
		f.s[0] = (((((f.v["this"]).values)[(f.v.index)])[(0)])) != (("\""));
	},
	function (e,f) {
		f.pc=10;
		f.s[0] = false;
	},
	function (e,f) {
		f.pc=10;
		f.s[0] = false;
	},
	function (e,f) { f.s[0] = false; },
/*10*/	function (e,f) { var t4925 = f.s[0]; if (t4925) f.pc=3; else f.pc=11; },
	function (e,f) { if (((f.v["this"]).fieldspec).can_write) f.pc=12; else f.pc=17; },
	function (e,f) { if (((((f.v["this"]).fieldspec).fieldtype)) == (("person"))) f.pc=13; else f.pc=15; },
	function (e,f) { e.mcall (4, f.v.menu, "add_item", (["suggest", "Suggest"])); },
	function (e,f) { e.mcall (4, f.v.menu, "add_item", (["proxy", "Proxy"])); },
/*15*/	function (e,f) { e.mcall (4, f.v.menu, "add_item", (["change", "Change"])); },
	function (e,f) { e.mcall (4, f.v.menu, "add_item", (["unset", "Unset"])); },
	function (e,f) { if (((f.v["this"]).fieldspec).can_add) f.pc=18; else f.pc=19; },
	function (e,f) { e.mcall (4, f.v.menu, "add_item", (["delete", "Delete"])); },
	function (e,f) { if (((f.v["this"]).fieldspec).in_group) f.pc=20; else f.pc=30; },
/*20*/	function (e,f) {
		f.pc=29;
		f.s[0] = (f.v["this"]).volunteers;
		e.smcall (1, person,"my_uid", ([]));
	},
	function (e,f) { e.mcall (4, f.v.menu, "add_item", (["available", "Unvolunteer"])); },
	function (e,f) {
		f.pc=30;
		e.mcall (4, f.v.menu, "add_item", (["unavailable", "Unavailable"]));
	},
	function (e,f) {
		f.pc=28;
		f.s[0] = (f.v["this"]).refusals;
		e.smcall (1, person,"my_uid", ([]));
	},
	function (e,f) { e.mcall (4, f.v.menu, "add_item", (["volunteer", "Volunteer"])); },
/*25*/	function (e,f) {
		f.pc=30;
		e.mcall (4, f.v.menu, "add_item", (["available", "Available"]));
	},
	function (e,f) { e.mcall (4, f.v.menu, "add_item", (["volunteer", "Volunteer"])); },
	function (e,f) {
		f.pc=30;
		e.mcall (4, f.v.menu, "add_item", (["unavailable", "Unavailable"]));
	},
	function (e,f) {
		var t4926 = f.s[1]; var t4927 = f.s[0]; 
		if (builtin__in_array (t4926,t4927)) f.pc=24; else f.pc=26;
	},
	function (e,f) {
		var t4928 = f.s[1]; var t4929 = f.s[0]; 
		if (builtin__in_array (t4928,t4929)) f.pc=21; else f.pc=23;
	},
/*30*/	function (e,f) { e.smcall (1, popupmenu,"run", ([f.v.menu])); },
	function (e,f) {
		var t4931 = f.s[0]; f.v.cmd = t4931;
		if (((f.v.cmd)) == (("open"))) f.pc=32; else f.pc=33;
	},
	function (e,f) {
		f.pc=-1;
		e.mcall (4, f.v["this"], "show_role", ([f.v.el, f.v.index]));
	},
	function (e,f) { if (((f.v.cmd)) == (("change"))) f.pc=34; else f.pc=35; },
	function (e,f) {
		f.pc=-1;
		e.mcall (4, f.v["this"], "change_value", ([f.v.el, f.v.index]));
	},
/*35*/	function (e,f) { if (((f.v.cmd)) == (("unset"))) f.pc=36; else f.pc=37; },
	function (e,f) {
		f.pc=-1;
		e.mcall (4, f.v["this"], "save_value", ([f.v.index, ""]));
	},
	function (e,f) { if (((f.v.cmd)) == (("delete"))) f.pc=38; else f.pc=39; },
	function (e,f) {
		f.pc=-1;
		e.mcall (4, f.v["this"], "delete_value", ([f.v.el, f.v.index]));
	},
	function (e,f) { if (((f.v.cmd)) == (("suggest"))) f.pc=40; else f.pc=41; },
/*40*/	function (e,f) {
		f.pc=-1;
		e.mcall (2, f.v["this"], "suggest", ([]));
	},
	function (e,f) { if (((f.v.cmd)) == (("proxy"))) f.pc=42; else f.pc=43; },
	function (e,f) {
		f.pc=-1;
		e.mcall (2, f.v["this"], "proxy_menu", ([]));
	},
	function (e,f) { if (((f.v.cmd)) == (("volunteer"))) f.pc=45; else f.pc=46; },
	function (e,f) {
		f.pc=-1;
		e.mcall (3, f.v["this"], "change_volunteer_state", ([f.v.cmd]));
	},
/*45*/	function (e,f) {
		f.pc=49;
		f.s[0] = true;
	},
	function (e,f) { if (((f.v.cmd)) == (("unavailable"))) f.pc=47; else f.pc=48; },
	function (e,f) {
		f.pc=49;
		f.s[0] = true;
	},
	function (e,f) { f.s[0] = ((f.v.cmd)) == (("available")); },
	function (e,f) { var t4932 = f.s[0]; if (t4932) f.pc=44; else f.pc=-1; },
null	];

;
	c.pargs__show_role =  ["el","i"];
	c.pinst__show_role =  [
/*0*/	function (e,f) { e.smcall (1, person,"fetch_by_id", ([((f.v["this"]).values)[(f.v.i)]])); },
	function (e,f) {
		var t4934 = f.s[0]; f.v.p = t4934;
		e.mcall (2, f.v.p, "popup_summary", ([]));
	},
null	];

;
	c.args__role_body_as_text = c.pargs__role_body_as_text =  ["person"];
	c.inst__role_body_as_text = c.pinst__role_body_as_text =  [
/*0*/	function (e,f) { if (((f.v.person)) == (("0"))) f.pc=6; else f.pc=7; },
	function (e,f) { e.return_pop ("[unset]"); },
	function (e,f) { if (((builtin__substr (f.v.person,0,1))) == (("\""))) f.pc=3; else f.pc=4; },
	function (e,f) { e.return_pop (builtin__substr (f.v.person,1,parseInt(((f.v.person).length),10) - parseInt((2),10))); },
	function (e,f) { e.smcall (1, person,"fetch_by_id", ([f.v.person])); },
/*5*/	function (e,f) {
		var t4936 = f.s[0]; f.v.po = t4936;
		e.return_pop ((f.v.po).nicename);
	},
	function (e,f) {
		f.pc=8;
		f.s[0] = true;
	},
	function (e,f) { f.s[0] = ((f.v.person)) == (("")); },
	function (e,f) { var t4937 = f.s[0]; if (t4937) f.pc=1; else f.pc=2; },
null	];

;
	c.pargs__role_body_as_string =  ["p"];
	c.pinst__role_body_as_string =  [
/*0*/	function (e,f) { if (((f.v.p)) == (("0"))) f.pc=11; else f.pc=12; },
	function (e,f) { e.return_pop ("<em style=\"color:red\">[unset]</em>"); },
	function (e,f) { if (((builtin__substr (f.v.p,0,1))) == (("\""))) f.pc=3; else f.pc=4; },
	function (e,f) { e.return_pop (builtin__substr (f.v.p,1,parseInt(((f.v.p).length),10) - parseInt((2),10))); },
	function (e,f) { e.smcall (1, person,"fetch_by_id", ([f.v.p])); },
/*5*/	function (e,f) {
		var t4939 = f.s[0]; f.v.po = t4939;
		if (((f.v.po)) === ((null))) f.pc=6; else f.pc=7;
	},
	function (e,f) { e.return_pop ("<span style=\"background:red\">Bad! [$p]</span>"); },
	function (e,f) {
		f.pc=10;
		e.smcall (0, person,"my_uid", ([]));
	},
	function (e,f) { e.return_pop (("<span style=\"background:yellow\">") + ("" + ((f.v.po).nicename) + ("</span>"))); },
	function (e,f) { e.return_pop ("" + ((f.v.po).nname) + ((" ") + ((f.v.po).sname))); },
/*10*/	function (e,f) {
		var t4940 = f.s[0]; 
		if ((((f.v.po).rowid)) == ((t4940))) f.pc=8; else f.pc=9;
	},
	function (e,f) {
		f.pc=13;
		f.s[0] = true;
	},
	function (e,f) { f.s[0] = ((f.v.p)) == (("")); },
	function (e,f) { var t4941 = f.s[0]; if (t4941) f.pc=1; else f.pc=2; },
null	];

;
	c.pargs__onclick =  ["el","id"];
	c.pinst__onclick =  [
/*0*/	function (e,f) { e.mcall (3, f.v["this"], "find_index", ([f.v.id])); },
	function (e,f) {
		var t4943 = f.s[0]; f.v.i = t4943;
		if (((((f.v["this"]).fieldspec).fieldtype)) == (("person"))) f.pc=5; else f.pc=8;
	},
	function (e,f) { if ((((((f.v["this"]).values)[(f.v.i)])[(0)])) != (("\""))) f.pc=3; else f.pc=4; },
	function (e,f) { e.mcall (4, f.v["this"], "show_role", ([f.v.el, f.v.i])); },
	function (e,f) { f.pc=-1; },
/*5*/	function (e,f) { if (((((f.v["this"]).values)[(f.v.i)])) != (("0"))) f.pc=6; else f.pc=7; },
	function (e,f) {
		f.pc=9;
		f.s[0] = ((((f.v["this"]).values)[(f.v.i)])) != ((""));
	},
	function (e,f) {
		f.pc=9;
		f.s[0] = false;
	},
	function (e,f) { f.s[0] = false; },
	function (e,f) { var t4944 = f.s[0]; if (t4944) f.pc=2; else f.pc=10; },
/*10*/	function (e,f) { if (((f.v["this"]).fieldspec).can_write) f.pc=11; else f.pc=-1; },
	function (e,f) { e.mcall (4, f.v["this"], "change_value", ([f.v.el, f.v.i])); },
null	];

;
	c.pargs__render_field_body =  [];
	c.pinst__render_field_body =  [
/*0*/	function (e,f) {
		window.__outbuffer += "\n<div style=\"float:left; clear:none\">\n";
		if (((((f.v["this"]).fieldspec).inherited)) != ((0))) f.pc=126; else f.pc=127;
	},
	function (e,f) { e.mcall (2, f.v["this"], "as_string", ([])); },
	function (e,f) {
		var t4946 = f.s[0]; f.v.text = t4946;
		if (((f.v.text)) == ((""))) f.pc=3; else f.pc=4;
	},
	function (e,f) { f.v.text = "[unset]"; },
	function (e,f) {
		f.pc=129;
		window.__outbuffer += ("<em>") + ("" + (f.v.text) + ("</em>"));
		window.__outbuffer += "</div>";
	},
/*5*/	function (e,f) { if (((((f.v["this"]).fieldspec).fieldtype)) == (("person"))) f.pc=6; else f.pc=26; },
	function (e,f) {
		f.v.am_volunteered = false;
		f.v._k286 = e.enumkeys ((f.v["this"]).volunteers);
	},
	function (e,f) {
		f.pc=9;
		if (!((f.v._k286).length)) f.pc=8;
	},
	function (e,f) {
		f.pc=12;
		f.v.i = 0;
		f.v._k288 = e.enumkeys ((f.v["this"]).values);
	},
	function (e,f) {
		f.pc=11;
		f.s[0] = f.v._i287 = (f.v._k286).shift();
		f.s[1] = f.v.vol = ((f.v["this"]).volunteers)[(f.v._i287)];
		e.smcall (2, person,"my_uid", ([]));
	},
/*10*/	function (e,f) {
		f.pc=7;
		f.v.am_volunteered = true;
	},
	function (e,f) {
		var t4955 = f.s[2]; 
		if (((f.v.vol)) == ((t4955))) f.pc=10; else f.pc=7;
	},
	function (e,f) { if (!((f.v._k288).length)) f.pc=50; },
	function (e,f) {
		f.v._i289 = (f.v._k288).shift();
		f.v.p = ((f.v["this"]).values)[(f.v._i289)];
		if (((f.v.i)) > ((0))) f.pc=14; else f.pc=15;
	},
	function (e,f) { window.__outbuffer += ",<br/>"; },
/*15*/	function (e,f) {
		f.s[0] = (":") + (f.v.i);
		e.mcall (3, f.v["this"], "get_id", ([]));
	},
	function (e,f) {
		var t4958 = f.s[1]; var t4959 = f.s[0]; 
		f.v.id = "" + (t4958) + (t4959);
		f.v.style = "";
		if (f.v.am_volunteered) f.pc=17; else f.pc=18;
	},
	function (e,f) { f.v.style = "background:#e0ffe0"; },
	function (e,f) {
		window.__outbuffer += "<a href=\"#\"";
		e.php_push_static_var (0, lib,"can_right_click");
		var t4963 = f.s[0]; if (t4963) f.pc=19; else f.pc=22;
	},
	function (e,f) {
		window.__outbuffer += "\noncontextmenu=\"";
		e.mcall (4, f.v["this"], "render_start", (["right_click", f.v.id]));
	},
/*20*/	function (e,f) {
		var t4964 = f.s[0]; window.__outbuffer += t4964;
		window.__outbuffer += "\"\nonclick=\"";
		e.mcall (4, f.v["this"], "render_start", (["onclick", f.v.id]));
	},
	function (e,f) {
		f.pc=24;
		var t4965 = f.s[0]; window.__outbuffer += t4965;
		window.__outbuffer += "\"\n";
	},
	function (e,f) {
		window.__outbuffer += "\nonclick=\"";
		e.mcall (4, f.v["this"], "render_start", (["right_click", f.v.id]));
	},
	function (e,f) {
		var t4966 = f.s[0]; window.__outbuffer += t4966;
		window.__outbuffer += "\"\n";
	},
	function (e,f) {
		window.__outbuffer += ">";
		window.__outbuffer += "<span style=\"";
		window.__outbuffer += f.v.style;
		window.__outbuffer += "\">";
		e.mcall (3, f.v["this"], "role_body_as_string", ([f.v.p]));
	},
/*25*/	function (e,f) {
		f.pc=12;
		var t4967 = f.s[0]; window.__outbuffer += t4967;
		window.__outbuffer += "</span></a>";
		e.php_push_var_lvalue (0, "i");
		e.php_postinc (1);
	},
	function (e,f) { if (!(((f.v["this"]).fieldspec).can_read)) f.pc=28; else f.pc=29; },
	function (e,f) {
		window.__outbuffer += "<em>Access Denied</em>";
		f.pc=-1;
	},
	function (e,f) {
		f.pc=30;
		f.s[0] = !(((f.v["this"]).fieldspec).can_write);
	},
	function (e,f) { f.s[0] = false; },
/*30*/	function (e,f) { var t4969 = f.s[0]; if (t4969) f.pc=27; else f.pc=31; },
	function (e,f) {
		f.v.i = 0;
		f.v._k290 = e.enumkeys ((f.v["this"]).values);
	},
	function (e,f) { if (!((f.v._k290).length)) f.pc=50; },
	function (e,f) {
		f.v._i291 = (f.v._k290).shift();
		f.v.xvalue = ((f.v["this"]).values)[(f.v._i291)];
		f.v.value = f.v.xvalue;
		if (((f.v.i)) > ((0))) f.pc=34; else f.pc=35;
	},
	function (e,f) { window.__outbuffer += ", "; },
/*35*/	function (e,f) {
		f.s[0] = (":") + (f.v.i);
		e.mcall (3, f.v["this"], "get_id", ([]));
	},
	function (e,f) {
		var t4975 = f.s[1]; var t4976 = f.s[0]; 
		f.v.id = "" + (t4975) + (t4976);
		if (((builtin__trim (f.v.value))) == ((""))) f.pc=37; else f.pc=38;
	},
	function (e,f) { f.v.value = "<em style=\"color:red\">[unset]</em>"; },
	function (e,f) { if (((f.v["this"]).fieldspec).can_write) f.pc=39; else f.pc=42; },
	function (e,f) {
		window.__outbuffer += "\n<a href=\"#\"\noncontextmenu=\"";
		e.mcall (4, f.v["this"], "render_start", (["right_click", f.v.id]));
	},
/*40*/	function (e,f) {
		var t4979 = f.s[0]; window.__outbuffer += t4979;
		window.__outbuffer += "\"\nonclick=\"";
		e.mcall (4, f.v["this"], "render_start", (["onclick", f.v.id]));
	},
	function (e,f) {
		f.pc=43;
		var t4980 = f.s[0]; window.__outbuffer += t4980;
		window.__outbuffer += "\"\n>";
		window.__outbuffer += f.v.value;
		window.__outbuffer += "</a>";
	},
	function (e,f) { window.__outbuffer += f.v.value; },
	function (e,f) { if (((((f.v["this"]).fieldspec).fieldtype)) == (("bibleref"))) f.pc=46; else f.pc=47; },
	function (e,f) {
		window.__outbuffer += "\n- <a href=\"#\" onclick=\"";
		e.mcall (4, f.v["this"], "render_start", (["lookup_reference", f.v.value]));
	},
/*45*/	function (e,f) {
		f.pc=49;
		var t4981 = f.s[0]; window.__outbuffer += t4981;
		window.__outbuffer += "\">Lookup</a>\n";
	},
	function (e,f) {
		f.pc=48;
		f.s[0] = ((f.v.xvalue)) != ((""));
	},
	function (e,f) { f.s[0] = false; },
	function (e,f) { var t4982 = f.s[0]; if (t4982) f.pc=44; else f.pc=49; },
	function (e,f) {
		f.pc=32;
		e.php_push_var_lvalue (0, "i");
		e.php_postinc (1);
	},
/*50*/	function (e,f) { if (((f.v["this"]).fieldspec).can_add) f.pc=51; else f.pc=53; },
	function (e,f) {
		window.__outbuffer += "\n<a href=\"#\" onClick=\"";
		e.mcall (4, f.v["this"], "render_start", (["add_value", 0]));
	},
	function (e,f) {
		var t4984 = f.s[0]; window.__outbuffer += t4984;
		window.__outbuffer += "\">(+)</a>\n";
	},
	function (e,f) { if (((((f.v["this"]).fieldspec).fieldtype)) == (("person"))) f.pc=54; else f.pc=125; },
	function (e,f) { if (((f.v["this"]).fieldspec).can_write) f.pc=55; else f.pc=67; },
/*55*/	function (e,f) { f.v._k292 = e.enumkeys ((f.v["this"]).suggestions); },
	function (e,f) { if (!((f.v._k292).length)) f.pc=67; },
	function (e,f) {
		f.v._i293 = (f.v._k292).shift();
		f.v.sug = ((f.v["this"]).suggestions)[(f.v._i293)];
		if (((f.v.sug)) !== ((""))) f.pc=64; else f.pc=65;
	},
	function (e,f) {
		f.v.fields = builtin__explode ("|",f.v.sug);
		if (((builtin__count (f.v.fields))) > ((1))) f.pc=59; else f.pc=60;
	},
	function (e,f) {
		f.pc=61;
		f.v.name = (f.v.fields)[(1)];
	},
/*60*/	function (e,f) { f.v.name = f.v.sug; },
	function (e,f) {
		window.__outbuffer += "<br/>";
		window.__outbuffer += "<a href=\"#\"";
		f.s[0] = "\"";
		e.mcall (5, f.v["this"], "render_start", (["use_suggestion", f.v.sug]));
	},
	function (e,f) {
		var t4991 = f.s[1]; var t4992 = f.s[0]; 
		window.__outbuffer += (" onclick=\"") + ("" + (t4991) + (t4992));
		f.s[0] = "\"";
		e.mcall (5, f.v["this"], "render_start", (["right_click_sug", f.v.sug]));
	},
	function (e,f) {
		f.pc=56;
		var t4993 = f.s[1]; var t4994 = f.s[0]; 
		window.__outbuffer += (" oncontextmenu=\"") + ("" + (t4993) + (t4994));
		window.__outbuffer += ">";
		window.__outbuffer += ("<em>[Suggest ") + ("" + (f.v.name) + ("]</em>"));
		window.__outbuffer += "</a>";
	},
	function (e,f) {
		f.pc=66;
		f.s[0] = ((f.v.sug)) != (("0"));
	},
/*65*/	function (e,f) { f.s[0] = false; },
	function (e,f) { var t4995 = f.s[0]; if (t4995) f.pc=58; else f.pc=56; },
	function (e,f) { if (((f.v["this"]).fieldspec).can_write) f.pc=122; else f.pc=123; },
	function (e,f) {
		f.v.found = false;
		f.v._k294 = e.enumkeys ((f.v["this"]).volunteers);
	},
	function (e,f) {
		f.pc=71;
		if (!((f.v._k294).length)) f.pc=70;
	},
/*70*/	function (e,f) {
		f.pc=73;
		f.v._k296 = e.enumkeys ((f.v["this"]).refusals);
	},
	function (e,f) {
		f.s[0] = f.v._i295 = (f.v._k294).shift();
		f.s[1] = f.v.vol = ((f.v["this"]).volunteers)[(f.v._i295)];
		if (((f.v.vol)) != ((0))) f.pc=72; else f.pc=69;
	},
	function (e,f) {
		f.pc=69;
		f.v.found = true;
	},
	function (e,f) {
		f.pc=75;
		if (!((f.v._k296).length)) f.pc=74;
	},
	function (e,f) { if (f.v.found) f.pc=77; else f.pc=125; },
/*75*/	function (e,f) {
		f.s[0] = f.v._i297 = (f.v._k296).shift();
		f.s[1] = f.v.ref = ((f.v["this"]).refusals)[(f.v._i297)];
		if (((f.v.ref)) != ((0))) f.pc=76; else f.pc=73;
	},
	function (e,f) {
		f.pc=73;
		f.v.found = true;
	},
	function (e,f) { f.v._k298 = e.enumkeys ((f.v["this"]).volunteers); },
	function (e,f) {
		f.pc=80;
		if (!((f.v._k298).length)) f.pc=79;
	},
	function (e,f) {
		f.pc=101;
		f.v._k302 = e.enumkeys ((f.v["this"]).refusals);
	},
/*80*/	function (e,f) {
		f.v._i299 = (f.v._k298).shift();
		f.v.vol = ((f.v["this"]).volunteers)[(f.v._i299)];
		f.v.name = "";
		e.mcall (2, (f.v["this"]).fieldspec, "get_grouphints", ([]));
	},
	function (e,f) {
		var t5010 = f.s[0]; 
		f.v._k300 = e.enumkeys (t5010);
	},
	function (e,f) {
		f.pc=84;
		if (!((f.v._k300).length)) f.pc=83;
	},
	function (e,f) { if (((f.v.name)) != ((""))) f.pc=87; else f.pc=78; },
	function (e,f) {
		f.s[0] = f.v._i301 = (f.v._k300).shift();
		f.s[1] = f.v._i301;
		e.mcall (4, (f.v["this"]).fieldspec, "get_grouphints", ([]));
	},
/*85*/	function (e,f) {
		var t5013 = f.s[2]; var t5014 = f.s[1]; 
		f.v.gh = (t5013)[(t5014)];
		if ((((f.v.gh).rowid)) == ((f.v.vol))) f.pc=86; else f.pc=82;
	},
	function (e,f) {
		f.pc=83;
		f.v.name = (f.v.gh).nicename;
	},
	function (e,f) {
		window.__outbuffer += "<br/>";
		if (((f.v["this"]).fieldspec).can_write) f.pc=91; else f.pc=92;
	},
	function (e,f) {
		window.__outbuffer += "<a href=\"#\"";
		f.s[0] = "\"";
		e.mcall (5, f.v["this"], "render_start", (["use_volunteer", f.v.vol]));
	},
	function (e,f) {
		var t5017 = f.s[1]; var t5018 = f.s[0]; 
		window.__outbuffer += (" onclick=\"") + ("" + (t5017) + (t5018));
		f.s[0] = "\"";
		e.mcall (5, f.v["this"], "render_start", (["right_click_vol", f.v.vol]));
	},
/*90*/	function (e,f) {
		f.pc=95;
		var t5019 = f.s[1]; var t5020 = f.s[0]; 
		window.__outbuffer += (" oncontextmenu=\"") + ("" + (t5019) + (t5020));
		window.__outbuffer += ">";
	},
	function (e,f) {
		f.pc=94;
		f.s[0] = true;
	},
	function (e,f) { e.smcall (0, person,"my_uid", ([])); },
	function (e,f) { var t5021 = f.s[0]; f.s[0] = ((f.v.vol)) == ((t5021)); },
	function (e,f) { var t5022 = f.s[0]; if (t5022) f.pc=88; else f.pc=95; },
/*95*/	function (e,f) {
		window.__outbuffer += ("<em>[Volunteer ") + ("" + (f.v.name) + ("]</em>"));
		if (((f.v["this"]).fieldspec).can_write) f.pc=97; else f.pc=98;
	},
	function (e,f) {
		f.pc=78;
		window.__outbuffer += "</a>";
	},
	function (e,f) {
		f.pc=100;
		f.s[0] = true;
	},
	function (e,f) { e.smcall (0, person,"my_uid", ([])); },
	function (e,f) { var t5023 = f.s[0]; f.s[0] = ((f.v.vol)) == ((t5023)); },
/*100*/	function (e,f) { var t5024 = f.s[0]; if (t5024) f.pc=96; else f.pc=78; },
	function (e,f) { if (!((f.v._k302).length)) f.pc=125; },
	function (e,f) {
		f.v._i303 = (f.v._k302).shift();
		f.v.ref = ((f.v["this"]).refusals)[(f.v._i303)];
		f.v.name = "";
		e.mcall (2, (f.v["this"]).fieldspec, "get_grouphints", ([]));
	},
	function (e,f) {
		var t5028 = f.s[0]; 
		f.v._k304 = e.enumkeys (t5028);
	},
	function (e,f) {
		f.pc=106;
		if (!((f.v._k304).length)) f.pc=105;
	},
/*105*/	function (e,f) { if (((f.v.name)) != ((""))) f.pc=109; else f.pc=101; },
	function (e,f) {
		f.s[0] = f.v._i305 = (f.v._k304).shift();
		f.s[1] = f.v._i305;
		e.mcall (4, (f.v["this"]).fieldspec, "get_grouphints", ([]));
	},
	function (e,f) {
		var t5031 = f.s[2]; var t5032 = f.s[1]; 
		f.v.gh = (t5031)[(t5032)];
		if ((((f.v.gh).rowid)) == ((f.v.ref))) f.pc=108; else f.pc=104;
	},
	function (e,f) {
		f.pc=105;
		f.v.name = (f.v.gh).nicename;
	},
	function (e,f) {
		window.__outbuffer += "<br/>";
		if (((f.v["this"]).fieldspec).can_write) f.pc=112; else f.pc=113;
	},
/*110*/	function (e,f) {
		window.__outbuffer += "<a href=\"#\"";
		window.__outbuffer += " onclick=\"return false;\"";
		f.s[0] = "\"";
		e.mcall (5, f.v["this"], "render_start", (["right_click_vol", f.v.ref]));
	},
	function (e,f) {
		f.pc=116;
		var t5035 = f.s[1]; var t5036 = f.s[0]; 
		window.__outbuffer += (" oncontextmenu=\"") + ("" + (t5035) + (t5036));
		window.__outbuffer += ">";
	},
	function (e,f) {
		f.pc=115;
		f.s[0] = true;
	},
	function (e,f) { e.smcall (0, person,"my_uid", ([])); },
	function (e,f) { var t5037 = f.s[0]; f.s[0] = ((f.v.ref)) == ((t5037)); },
/*115*/	function (e,f) { var t5038 = f.s[0]; if (t5038) f.pc=110; else f.pc=116; },
	function (e,f) {
		window.__outbuffer += ("[Unavailable: ") + ("" + (f.v.name) + ("]"));
		if (((f.v["this"]).fieldspec).can_write) f.pc=118; else f.pc=119;
	},
	function (e,f) {
		f.pc=101;
		window.__outbuffer += "</a>";
	},
	function (e,f) {
		f.pc=121;
		f.s[0] = true;
	},
	function (e,f) { e.smcall (0, person,"my_uid", ([])); },
/*120*/	function (e,f) { var t5039 = f.s[0]; f.s[0] = ((f.v.ref)) == ((t5039)); },
	function (e,f) { var t5040 = f.s[0]; if (t5040) f.pc=117; else f.pc=101; },
	function (e,f) {
		f.pc=124;
		f.s[0] = true;
	},
	function (e,f) { f.s[0] = ((f.v["this"]).fieldspec).in_group; },
	function (e,f) { var t5041 = f.s[0]; if (t5041) f.pc=68; else f.pc=125; },
/*125*/	function (e,f) {
		f.pc=129;
		window.__outbuffer += "\n</div>\n";
	},
	function (e,f) {
		f.pc=128;
		f.s[0] = ((((f.v["this"]).activity).repeatof)) != ((0));
	},
	function (e,f) { f.s[0] = false; },
	function (e,f) { var t5042 = f.s[0]; if (t5042) f.pc=1; else f.pc=5; },
	function (e,f) { window.__outbuffer += "\n<div style=\"clear:left\"></div>\n"; },
null	];

;
	c.pargs__render_field =  ["label_width"];
	c.pinst__render_field =  [
/*0*/	function (e,f) {
		window.__outbuffer += "\n<div>\n<div style=\"float:left; width:";
		window.__outbuffer += f.v.label_width;
		window.__outbuffer += "px; text-align:right\">";
		window.__outbuffer += ((f.v["this"]).fieldspec).label;
		window.__outbuffer += ":&nbsp;</div>\n";
		e.mcall (2, f.v["this"], "render_field_body", ([]));
	},
	function (e,f) { window.__outbuffer += "\n<div style=\"clear:left\"></div>\n</div>\n"; },
null	];

;
	c.pargs__render_field_nolabel =  [];
	c.pinst__render_field_nolabel =  [
/*0*/	function (e,f) {
		window.__outbuffer += "\n<div>\n";
		e.mcall (2, f.v["this"], "render_field_body", ([]));
	},
	function (e,f) { window.__outbuffer += "\n<div style=\"clear:left\"></div>\n</div>\n"; },
null	];

;
	c.pargs__set_raw =  ["arr"];
	c.pinst__set_raw =  [
/*0*/	function (e,f) {
		f.v["this"].values = f.v.arr;
		e.mcall (2, f.v["this"], "safe_save", ([]));
	},
null	];

;
	c.pargs__get_raw =  [];
	c.pinst__get_raw =  [
/*0*/	function (e,f) { e.return_pop ((f.v["this"]).values); },
null	];

;
	c.pargs__as_text =  [];
	c.pinst__as_text =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "as_text_ex", ([parseInt((0),10) - parseInt((1),10), ""])); },
	function (e,f) { var t5044 = f.s[0]; e.return_pop (t5044); },
null	];

;
	c.pargs__as_string =  [];
	c.pinst__as_string =  [
/*0*/	function (e,f) { if (((f.v["this"]).fieldspec).inherited) f.pc=9; else f.pc=10; },
	function (e,f) { e.smcall (1, activity,"find", ([((f.v["this"]).activity).repeatof])); },
	function (e,f) {
		var t5046 = f.s[0]; f.v.previous = t5046;
		if (((f.v.previous)) == ((null))) f.pc=3; else f.pc=4;
	},
	function (e,f) { e.return_pop ("[no previous]"); },
	function (e,f) { e.mcall (4, f.v.previous, "get_field", ([(f.v["this"]).fieldspec, false])); },
/*5*/	function (e,f) {
		var t5048 = f.s[0]; f.v.pfield = t5048;
		if (((f.v.pfield)) == ((null))) f.pc=6; else f.pc=7;
	},
	function (e,f) { e.return_pop ("[field not present]"); },
	function (e,f) { e.mcall (2, f.v.pfield, "as_string", ([])); },
	function (e,f) { var t5049 = f.s[0]; e.return_pop (t5049); },
	function (e,f) {
		f.pc=11;
		f.s[0] = ((((f.v["this"]).activity).repeatof)) != ((0));
	},
/*10*/	function (e,f) { f.s[0] = false; },
	function (e,f) { var t5050 = f.s[0]; if (t5050) f.pc=1; else f.pc=12; },
	function (e,f) {
		f.v.res = "";
		f.v.need_comma = false;
		f.v._k306 = e.enumkeys ((f.v["this"]).values);
	},
	function (e,f) {
		f.pc=15;
		if (!((f.v._k306).length)) f.pc=14;
	},
	function (e,f) { e.return_pop (f.v.res); },
/*15*/	function (e,f) {
		f.v._i307 = (f.v._k306).shift();
		f.v.value = ((f.v["this"]).values)[(f.v._i307)];
		if (f.v.need_comma) f.pc=16; else f.pc=17;
	},
	function (e,f) { f.v.res = "" + (f.v.res) + (", "); },
	function (e,f) { if (((((f.v["this"]).fieldspec).fieldtype)) == (("person"))) f.pc=18; else f.pc=20; },
	function (e,f) { e.mcall (3, f.v["this"], "role_body_as_string", ([f.v.value])); },
	function (e,f) {
		f.pc=21;
		var t5057 = f.s[0]; 
		f.v.res = "" + (f.v.res) + (t5057);
	},
/*20*/	function (e,f) { f.v.res = "" + (f.v.res) + (f.v.value); },
	function (e,f) {
		f.pc=13;
		f.v.need_comma = true;
	},
null	];

;
	c.pargs__lookup_reference =  ["el","val"];
	c.pinst__lookup_reference =  [
/*0*/	function (e,f) { e.smcall (1, bible,"lookup", ([f.v.val])); },
null	];

;
	c.pargs__recent_series =  [];
	c.pinst__recent_series =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["recent_series", ([])])); },
	function (e,f) { var t5061 = f.s[0]; e.return_pop (t5061); },
null	];

;
};
field.init_methods (field);
rpcclass.setup_class (field, "field",0, (["fieldspec","volunteers","event","activity","values","refusals","suggestions","group","watch","rowid","listeners"]), ([0,0,0,0,0,0,0,0,0,0,2]));
function generictableitemtabmanager () { this.do_construct (arguments); }
generictableitemtabmanager.init_methods = function (c) {
	tabmanager.init_methods(c);
	var cp = c.prototype;
	c.pargs__can_import =  [];
	c.pinst__can_import =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_method", ([(f.v["this"]).tabclass, "can_import", null])); },
	function (e,f) { var t5062 = f.s[0]; e.return_pop (t5062); },
null	];

;
	c.pargs__import =  ["namehint"];
	c.pinst__import =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_method", ([(f.v["this"]).tabclass, "import", ([(f.v["this"]).tabclass, f.v.namehint])])); },
	function (e,f) { var t5063 = f.s[0]; e.return_pop (t5063); },
null	];

;
	c.pargs__rating_field =  [];
	c.pinst__rating_field =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_method", ([(f.v["this"]).tabclass, "rating_field", null])); },
	function (e,f) { var t5064 = f.s[0]; e.return_pop (t5064); },
null	];

;
	c.pargs__rating_colour =  ["rating"];
	c.pinst__rating_colour =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_method", ([(f.v["this"]).tabclass, "rating_colour", f.v.rating])); },
	function (e,f) { var t5065 = f.s[0]; e.return_pop (t5065); },
null	];

;
	c.pargs__create_new =  ["namehint"];
	c.pinst__create_new =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_method", ([(f.v["this"]).tabclass, "create_new", null])); },
	function (e,f) { var t5066 = f.s[0]; e.return_pop (t5066); },
null	];

;
	c.pargs__fetch_tableitem_object =  ["itemref"];
	c.pinst__fetch_tableitem_object =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["fetch_tableitem_object", ([f.v.itemref])])); },
	function (e,f) { var t5067 = f.s[0]; e.return_pop (t5067); },
null	];

;
	c.pargs__find_tableitem_object =  ["itemref"];
	c.pinst__find_tableitem_object =  [
/*0*/	function (e,f) { if (((f.v.itemref)) == ((0))) f.pc=2; else f.pc=3; },
	function (e,f) { e.return_pop (null); },
	function (e,f) {
		f.pc=4;
		f.s[0] = true;
	},
	function (e,f) { f.s[0] = ((f.v.itemref)) == (("")); },
	function (e,f) { var t5068 = f.s[0]; if (t5068) f.pc=1; else f.pc=5; },
/*5*/	function (e,f) { e.smcall (2, dbclass,"find_object", ([(f.v["this"]).tabclass, f.v.itemref])); },
	function (e,f) {
		var t5070 = f.s[0]; f.v.res = t5070;
		if (((f.v.res)) === ((null))) f.pc=7; else f.pc=9;
	},
	function (e,f) { e.mcall (3, f.v["this"], "fetch_tableitem_object", ([f.v.itemref])); },
	function (e,f) { var t5072 = f.s[0]; f.v.res = t5072; },
	function (e,f) { e.return_pop (f.v.res); },
null	];

;
	c.pargs__open =  ["itemref","include_select"];
	c.pinst__open =  [
/*0*/	function (e,f) { e.mcall (3, f.v["this"], "find_tableitem_object", ([f.v.itemref])); },
	function (e,f) {
		var t5074 = f.s[0]; f.v.item = t5074;
		if (((f.v.item)) === ((null))) f.pc=2; else f.pc=3;
	},
	function (e,f) { f.pc=-1; },
	function (e,f) {
		f.v.p = new popup;
		e.mcall (2, f.v.p, "initialise", ([]));
	},
	function (e,f) {  },
/*5*/	function (e,f) {
		f.s[0] = builtin__ob_start ();
		e.mcall (2, f.v.item, "render_popup_contents", ([]));
	},
	function (e,f) {
		f.v.text = builtin__ob_get_clean ();
		f.v.text = "" + (f.v.text) + ("<div style=\"clear:both; text-align:right\">");
		if (f.v.include_select) f.pc=7; else f.pc=9;
	},
	function (e,f) {
		f.s[0] = "\">Select</button>";
		e.smcall (3, generictableitemtabmanager,"render_resume", (["select", 0]));
	},
	function (e,f) {
		var t5078 = f.s[1]; var t5079 = f.s[0]; 
		f.v.text = "" + (f.v.text) + (("<button onclick=\"") + ("" + (t5078) + (t5079)));
	},
	function (e,f) {
		f.s[0] = "\">Close</button>";
		e.smcall (3, generictableitemtabmanager,"render_resume", (["cancel", 0]));
	},
/*10*/	function (e,f) {
		f.pc=13;
		var t5081 = f.s[1]; var t5082 = f.s[0]; 
		f.v.text = "" + (f.v.text) + (("<button onclick=\"") + ("" + (t5081) + (t5082)));
		e.smcall (3, rpcclass,"call_static_method", ([(f.v["this"]).tabclass, "trusted", null]));
	},
	function (e,f) {
		f.s[0] = "\">Edit</button>";
		e.smcall (3, generictableitemtabmanager,"render_resume", (["edit", 0]));
	},
	function (e,f) {
		f.pc=14;
		var t5084 = f.s[1]; var t5085 = f.s[0]; 
		f.v.text = "" + (f.v.text) + (("<button onclick=\"") + ("" + (t5084) + (t5085)));
	},
	function (e,f) { var t5087 = f.s[0]; if (t5087) f.pc=11; else f.pc=14; },
	function (e,f) {
		f.v.text = "" + (f.v.text) + ("<hr/>");
		e.mcall (2, f.v.item, "get_history", ([]));
	},
/*15*/	function (e,f) {
		var t5089 = f.s[0]; 
		f.v.text = "" + (f.v.text) + (t5089);
		f.v.text = "" + (f.v.text) + ("</div>");
		e.mcall (5, f.v.p, "open", ([0, 0, f.v.text]));
	},
	function (e,f) { e.php_builtin (0, "wait_for_input", 0); },
	function (e,f) {
		var t5093 = f.s[0]; f.v.event = t5093;
		e.mcall (2, f.v.p, "close", ([]));
	},
	function (e,f) { if ((((f.v.event).action)) == (("select"))) f.pc=24; else f.pc=25; },
	function (e,f) { e.return_pop ((f.v.event).action); },
/*20*/	function (e,f) { if ((((f.v.event).action)) == (("edit"))) f.pc=21; else f.pc=22; },
	function (e,f) {
		f.pc=5;
		e.mcall (2, f.v.item, "open_editor", ([]));
	},
	function (e,f) { if ((((f.v.event).action)) == (("item_action"))) f.pc=23; else f.pc=5; },
	function (e,f) {
		f.pc=5;
		e.mcall (4, f.v.item, "popup_action", ([((f.v.event).parm)[(0)], ((f.v.event).parm)[(1)]]));
	},
	function (e,f) {
		f.pc=28;
		f.s[0] = true;
	},
/*25*/	function (e,f) { if ((((f.v.event).action)) == (("cancel"))) f.pc=26; else f.pc=27; },
	function (e,f) {
		f.pc=28;
		f.s[0] = true;
	},
	function (e,f) { f.s[0] = (((f.v.event).action)) == (("cover")); },
	function (e,f) { var t5094 = f.s[0]; if (t5094) f.pc=19; else f.pc=20; },
null	];

;
	c.args__create = c.pargs__create =  ["tabclass"];
	c.inst__create = c.pinst__create =  [
/*0*/	function (e,f) {
		f.v.tm = new generictableitemtabmanager;
		e.smcall (3, rpcclass,"call_static_method", ([f.v.tabclass, "search_fields", null]));
	},
	function (e,f) {
		var t5097 = f.s[0]; f.v.search_fields = t5097;
		e.smcall (3, rpcclass,"call_static_method", ([f.v.tabclass, "list_fields", null]));
	},
	function (e,f) {
		var t5099 = f.s[0]; f.v.list_fields = t5099;
		e.mcall (5, f.v.tm, "initialise", ([f.v.tabclass, f.v.list_fields, f.v.search_fields]));
	},
	function (e,f) { e.return_pop (f.v.tm); },
null	];

;
};
generictableitemtabmanager.init_methods (generictableitemtabmanager);
rpcclass.setup_class (generictableitemtabmanager, "generictableitemtabmanager",0, (["tabclass","list_fields","search_fields","listeners"]), ([0,0,0,2]));
function generictableitem () { this.do_construct (arguments); }
generictableitem.init_methods = function (c) {
	dbclass.init_methods(c);
	var cp = c.prototype;
	c.args__can_import = c.pargs__can_import =  [];
	c.inst__can_import = c.pinst__can_import =  [
/*0*/	function (e,f) { e.return_pop (false); },
null	];

;
	c.args__rating_field = c.pargs__rating_field =  [];
	c.inst__rating_field = c.pinst__rating_field =  [
/*0*/	function (e,f) { e.return_pop (null); },
null	];

;
	c.args__rating_colour = c.pargs__rating_colour =  ["rating"];
	c.inst__rating_colour = c.pinst__rating_colour =  [
/*0*/	function (e,f) { e.return_pop (null); },
null	];

;
	c.pargs__render_item_name =  ["serviceitem"];
	c.pinst__render_item_name =  [
/*0*/	function (e,f) { e.return_pop ((f.v["this"]).name); },
null	];

;
	c.pargs__render_item_notes =  ["serviceitem"];
	c.pinst__render_item_notes =  [
/*0*/	function (e,f) { e.return_pop (""); },
null	];

;
	c.args__add_generic_options = c.pargs__add_generic_options =  ["nicename"];
	c.inst__add_generic_options = c.pinst__add_generic_options =  [
/*0*/	function (e,f) {
		f.v.fields = ([]);
		f.v.fields[f.v.fields.length] = ([("Add ") + (f.v.nicename), ""]);
		e.return_pop (f.v.fields);
	},
null	];

;
	c.pargs__fill_from_fields =  ["fields"];
	c.pinst__fill_from_fields =  [
/*0*/	function (e,f) { e.mcall (2, f.v["this"], "fields", ([])); },
	function (e,f) {
		var t5103 = f.s[0]; f.v.flist = t5103;
		f.v._k308 = e.enumkeys (f.v.flist);
	},
	function (e,f) {
		f.pc=4;
		if (!((f.v._k308).length)) f.pc=3;
	},
	function (e,f) {
		f.pc=-1;
		e.mcall (2, f.v["this"], "save_edits", ([]));
	},
	function (e,f) {
		f.v._i309 = (f.v._k308).shift();
		f.v.f = (f.v.flist)[(f.v._i309)];
		f.v.fname = (f.v.f).name;
		if (((f.v.fields)[(f.v.fname)]) !== undefined) f.pc=5; else f.pc=2;
	},
/*5*/	function (e,f) {
		f.pc=2;
		f.v["this"][f.v.fname] = (f.v.fields)[(f.v.fname)];
	},
null	];

;
	c.args__create_new_generic_helper =  ["classname","fields"];
	c.inst__create_new_generic_helper =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_function_async", (["generictableitem", "create_new_generic_helper", ([f.v.classname, f.v.fields])])); },
	function (e,f) { var t5109 = f.s[0]; e.return_pop (t5109); },
null	];

;
	c.pargs__save_edits =  [];
	c.pinst__save_edits =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["save_edits", ([])])); },
	function (e,f) { var t5110 = f.s[0]; e.return_pop (t5110); },
null	];

;
	c.pargs__open_editor =  [];
	c.pinst__open_editor =  [
/*0*/	function (e,f) { e.mcall (2, f.v["this"], "fields", ([])); },
	function (e,f) {
		var t5112 = f.s[0]; f.v.fields = t5112;
		f.v.ffields = ([]);
		f.v._k310 = e.enumkeys (f.v.fields);
	},
	function (e,f) {
		f.pc=4;
		if (!((f.v._k310).length)) f.pc=3;
	},
	function (e,f) {
		f.pc=6;
		f.v.pop = new popupform;
		e.mcall (6, f.v.pop, "initialise", ([0, 0, "Edit", f.v.ffields]));
	},
	function (e,f) {
		f.v.n = (f.v._k310).shift();
		f.v.f = (f.v.fields)[(f.v.n)];
		if (((f.v.f).label) !== undefined) f.pc=5; else f.pc=2;
	},
/*5*/	function (e,f) {
		f.pc=2;
		f.v.fname = (f.v.f).name;
		f.v.ffields[f.v.n] = (f.v.fields)[(f.v.n)];
		(f.v.ffields)[(f.v.n)].value = (f.v["this"])[(f.v.fname)];
	},
	function (e,f) { e.mcall (2, f.v.pop, "open", ([])); },
	function (e,f) { e.mcall (2, f.v.pop, "run", ([])); },
	function (e,f) {
		var t5122 = f.s[0]; f.v.event = t5122;
		f.v.res = null;
		if ((((f.v.event).action)) == (("OK"))) f.pc=9; else f.pc=12;
	},
	function (e,f) { e.mcall (2, f.v.pop, "get_form_fields", ([])); },
/*10*/	function (e,f) {
		var t5125 = f.s[0]; f.v.f = t5125;
		e.mcall (3, f.v["this"], "fill_from_fields", ([f.v.f]));
	},
	function (e,f) { e.mcall (2, f.v["this"], "save_edits", ([])); },
	function (e,f) { e.mcall (2, f.v.pop, "close", ([])); },
null	];

;
	c.args__create_new_generic = c.pargs__create_new_generic =  ["nicename","classname"];
	c.inst__create_new_generic = c.pinst__create_new_generic =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_method", ([f.v.classname, "fields", null])); },
	function (e,f) {
		var t5127 = f.s[0]; f.v.fields = t5127;
		f.v.pop = new popupform;
		e.mcall (6, f.v.pop, "initialise", ([0, 0, ("Create ") + (f.v.nicename), f.v.fields]));
	},
	function (e,f) { e.mcall (2, f.v.pop, "open", ([])); },
	function (e,f) { e.mcall (2, f.v.pop, "run", ([])); },
	function (e,f) {
		var t5130 = f.s[0]; f.v.event = t5130;
		f.v.res = 0;
		if ((((f.v.event).action)) == (("OK"))) f.pc=5; else f.pc=8;
	},
/*5*/	function (e,f) { e.mcall (2, f.v.pop, "get_form_fields", ([])); },
	function (e,f) {
		var t5133 = f.s[0]; f.v.f = t5133;
		e.smcall (2, generictableitem,"create_new_generic_helper", ([f.v.classname, f.v.f]));
	},
	function (e,f) { var t5135 = f.s[0]; f.v.res = t5135; },
	function (e,f) { e.mcall (2, f.v.pop, "close", ([])); },
	function (e,f) { e.return_pop (f.v.res); },
null	];

;
	c.args__is_music = c.pargs__is_music =  [];
	c.inst__is_music = c.pinst__is_music =  [
/*0*/	function (e,f) { e.return_pop (false); },
null	];

;
	c.pargs__context_menu_items =  ["menu"];
	c.pinst__context_menu_items =  [
/*0*/	function (e,f) { /* This is a NOP */ },
null	];

;
	c.pargs__get_history =  [];
	c.pinst__get_history =  [
/*0*/	function (e,f) { if ((((f.v["this"]).history)) === ((null))) f.pc=1; else f.pc=3; },
	function (e,f) { e.mcall (2, f.v["this"], "do_get_history", ([])); },
	function (e,f) { var t5137 = f.s[0]; f.v["this"].history = t5137; },
	function (e,f) { e.return_pop ((f.v["this"]).history); },
null	];

;
	c.pargs__do_get_history =  [];
	c.pinst__do_get_history =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["do_get_history", ([])])); },
	function (e,f) { var t5138 = f.s[0]; e.return_pop (t5138); },
null	];

;
	c.pargs__open =  [];
	c.pinst__open =  [
/*0*/	function (e,f) { e.smcall (2, generictableitem,"open_item", ([(f.v["this"]).classname, (f.v["this"]).rowid])); },
	function (e,f) { var t5139 = f.s[0]; e.return_pop (t5139); },
null	];

;
	c.args__open_item = c.pargs__open_item =  ["tabclass","itemref"];
	c.inst__open_item = c.pinst__open_item =  [
/*0*/	function (e,f) { e.smcall (1, generictableitemtabmanager,"create", ([f.v.tabclass])); },
	function (e,f) {
		var t5141 = f.s[0]; f.v.tm = t5141;
		e.mcall (4, f.v.tm, "open", ([f.v.itemref, false]));
	},
	function (e,f) { var t5142 = f.s[0]; e.return_pop (t5142); },
null	];

;
	c.args__choose = c.pargs__choose =  ["tabclass","include_select"];
	c.inst__choose = c.pinst__choose =  [
/*0*/	function (e,f) { e.smcall (1, generictableitemtabmanager,"create", ([f.v.tabclass])); },
	function (e,f) {
		var t5144 = f.s[0]; f.v.tm = t5144;
		e.smcall (3, rpcclass,"call_static_method", ([f.v.tabclass, "service_builder_tag", null]));
	},
	function (e,f) {
		var t5146 = f.s[0]; f.v.tag = t5146;
		e.mcall (6, f.v.tm, "choose", (["" + (f.v.tag) + (" Search"), f.v.include_select, true, ""]));
	},
	function (e,f) { var t5147 = f.s[0]; e.return_pop (t5147); },
null	];

;
};
generictableitem.init_methods (generictableitem);
rpcclass.setup_class (generictableitem, "generictableitem",0, (["history","rowid","listeners"]), ([0,0,2]));
function genericliturgy () { this.do_construct (arguments); }
genericliturgy.init_methods = function (c) {
	generictableitem.init_methods(c);
	var cp = c.prototype;
	c.args__trusted = c.pargs__trusted =  [];
	c.inst__trusted = c.pinst__trusted =  [
/*0*/	function (e,f) {
		f.pc=3;
		e.smcall (1, person,"i_match_query", (["Web\\Liturgy Coordinators"]));
	},
	function (e,f) {
		f.pc=4;
		f.s[0] = true;
	},
	function (e,f) {
		f.pc=4;
		e.smcall (0, person,"is_webmaster", ([]));
	},
	function (e,f) { var t5148 = f.s[0]; if (t5148) f.pc=1; else f.pc=2; },
	function (e,f) { var t5149 = f.s[0]; e.return_pop (t5149); },
null	];

;
	c.pargs__fields =  [];
	c.pinst__fields =  [
/*0*/	function (e,f) {
		f.v.fields = ([]);
		f.v.fields[f.v.fields.length] = ({type:"text", name:"name", label:"Name", focus:true});
		f.v.fields[f.v.fields.length] = ({type:"text", name:"notes", label:"Notes"});
		f.v.fields[f.v.fields.length] = ({type:"textbox", name:"text", label:"", width:600, height:400});
		e.return_pop (f.v.fields);
	},
null	];

;
	c.pargs__render_popup_contents =  [];
	c.pinst__render_popup_contents =  [
/*0*/	function (e,f) {
		f.v.lines = builtin__explode ("\n",(f.v["this"]).text);
		f.v.text = "";
		f.v._k312 = e.enumkeys (f.v.lines);
	},
	function (e,f) {
		f.pc=3;
		if (!((f.v._k312).length)) f.pc=2;
	},
	function (e,f) {
		f.pc=-1;
		window.__outbuffer += "\n<h2>";
		window.__outbuffer += (f.v["this"]).name;
		window.__outbuffer += "</h2>\n<div style=\"margin-left:10%\">";
		window.__outbuffer += f.v.text;
		window.__outbuffer += "</div>\n";
	},
	function (e,f) {
		f.v._i313 = (f.v._k312).shift();
		f.v.line = (f.v.lines)[(f.v._i313)];
		f.v.line = builtin__trim (f.v.line);
		if (((builtin__substr (f.v.line,0,1))) == (("."))) f.pc=4; else f.pc=5;
	},
	function (e,f) { f.v.line = ("<strong>") + ("" + (builtin__substr (f.v.line,2,parseInt(((f.v.line).length),10) - parseInt((2),10))) + ("</strong>")); },
/*5*/	function (e,f) {
		f.pc=1;
		f.v.text = "" + (f.v.text) + ("" + (f.v.line) + ("<br/>"));
	},
null	];

;
	c.args__search_fields = c.pargs__search_fields =  [];
	c.inst__search_fields = c.pinst__search_fields =  [
/*0*/	function (e,f) { e.return_pop ((["name", "notes", "text"])); },
null	];

;
	c.args__list_fields = c.pargs__list_fields =  [];
	c.inst__list_fields = c.pinst__list_fields =  [
/*0*/	function (e,f) { e.return_pop ((["name", "notes"])); },
null	];

;
	c.args__create_new_generic_helper =  ["classname","fields"];
	c.inst__create_new_generic_helper =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_function_async", (["genericliturgy", "create_new_generic_helper", ([f.v.classname, f.v.fields])])); },
	function (e,f) { var t5162 = f.s[0]; e.return_pop (t5162); },
null	];

;
	c.pargs__open_editor =  [];
	c.pinst__open_editor =  [
/*0*/	function (e,f) {
		f.v.fields = ([]);
		f.v.fields[f.v.fields.length] = ({type:"text", name:"name", label:"Name", focus:true, value:(f.v["this"]).name});
		f.v.fields[f.v.fields.length] = ({type:"text", name:"notes", label:"Notes", value:(f.v["this"]).notes});
		f.v.fields[f.v.fields.length] = ({type:"textbox", name:"text", label:"", width:600, height:400, value:(f.v["this"]).text});
		f.v.pop = new popupform;
		e.mcall (6, f.v.pop, "initialise", ([0, 0, "Edit", f.v.fields]));
	},
	function (e,f) { e.mcall (2, f.v.pop, "open", ([])); },
	function (e,f) { e.mcall (2, f.v.pop, "run", ([])); },
	function (e,f) {
		var t5169 = f.s[0]; f.v.event = t5169;
		f.v.res = null;
		if ((((f.v.event).action)) == (("OK"))) f.pc=4; else f.pc=6;
	},
	function (e,f) { e.mcall (2, f.v.pop, "get_form_fields", ([])); },
/*5*/	function (e,f) {
		var t5172 = f.s[0]; f.v.f = t5172;
		f.v["this"].name = (f.v.f).name;
		f.v["this"].notes = (f.v.f).notes;
		f.v["this"].text = (f.v.f).text;
		e.mcall (2, f.v["this"], "save_edits", ([]));
	},
	function (e,f) { e.mcall (2, f.v.pop, "close", ([])); },
null	];

;
	c.args__create_new_generic = c.pargs__create_new_generic =  ["nicename","classname"];
	c.inst__create_new_generic = c.pinst__create_new_generic =  [
/*0*/	function (e,f) {
		f.v.fields = ([]);
		f.v.fields[f.v.fields.length] = ({type:"text", name:"name", label:"Name", focus:true});
		f.v.fields[f.v.fields.length] = ({type:"text", name:"notes", label:"Notes"});
		f.v.fields[f.v.fields.length] = ({type:"textbox", name:"text", label:"", width:600, height:400});
		f.v.pop = new popupform;
		e.mcall (6, f.v.pop, "initialise", ([0, 0, ("Create ") + (f.v.nicename), f.v.fields]));
	},
	function (e,f) { e.mcall (2, f.v.pop, "open", ([])); },
	function (e,f) { e.mcall (2, f.v.pop, "run", ([])); },
	function (e,f) {
		var t5182 = f.s[0]; f.v.event = t5182;
		f.v.res = null;
		if ((((f.v.event).action)) == (("OK"))) f.pc=4; else f.pc=7;
	},
	function (e,f) { e.mcall (2, f.v.pop, "get_form_fields", ([])); },
/*5*/	function (e,f) {
		var t5185 = f.s[0]; f.v.f = t5185;
		e.smcall (2, genericliturgy,"create_new_generic_helper", ([f.v.classname, f.v.f]));
	},
	function (e,f) { var t5187 = f.s[0]; f.v.res = t5187; },
	function (e,f) { e.mcall (2, f.v.pop, "close", ([])); },
	function (e,f) { e.return_pop (f.v.res); },
null	];

;
	c.args__do_upload =  ["ul"];
	c.inst__do_upload =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_function_async", (["genericliturgy", "do_upload", ([f.v.ul])])); },
	function (e,f) { var t5188 = f.s[0]; e.return_pop (t5188); },
null	];

;
	c.args__import = c.pargs__import =  ["el","arg","ev"];
	c.inst__import = c.pinst__import =  [
/*0*/	function (e,f) {
		f.pc=3;
		f.v.ul = new uploader;
		e.mcall (2, f.v.ul, "run", ([]));
	},
	function (e,f) { e.smcall (1, genericliturgy,"do_upload", ([f.v.ul])); },
	function (e,f) {
		f.pc=-1;
		var t5191 = f.s[0]; f.v.res = t5191;
		e.smcall (1, popupok,"run", ([f.v.res]));
	},
	function (e,f) { var t5192 = f.s[0]; if (t5192) f.pc=1; else f.pc=-1; },
null	];

;
};
genericliturgy.init_methods (genericliturgy);
rpcclass.setup_class (genericliturgy, "genericliturgy",0, (["name","notes","text","history","rowid","listeners"]), ([0,0,0,0,0,2]));
function musicpart () { this.do_construct (arguments); }
musicpart.init_methods = function (c) {
	dbclass.init_methods(c);
	var cp = c.prototype;
	c.pargs__open =  ["el","arg","ev"];
	c.pinst__open =  [
/*0*/	function (e,f) { window.location = ("/churchbuilder/sheetmusic-output.php?id=") + ("" + (((f.v["this"]).music).rowid) + (("&mode=sheetmusic&part=") + ((f.v["this"]).name))); },
null	];

;
	c.pargs__do_delete_row =  [];
	c.pinst__do_delete_row =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["do_delete_row", ([])])); },
	function (e,f) { var t5194 = f.s[0]; e.return_pop (t5194); },
null	];

;
};
musicpart.init_methods (musicpart);
rpcclass.setup_class (musicpart, "musicpart",0, (["name","music","rowid","listeners"]), ([0,0,0,2]));
function music () { this.do_construct (arguments); }
music.init_methods = function (c) {
	dbclass.init_methods(c);
	var cp = c.prototype;
	c.args__trusted = c.pargs__trusted =  [];
	c.inst__trusted = c.pinst__trusted =  [
/*0*/	function (e,f) {
		f.pc=3;
		e.smcall (1, person,"i_match_query", (["Web\\Music Coordinators"]));
	},
	function (e,f) {
		f.pc=4;
		f.s[0] = true;
	},
	function (e,f) {
		f.pc=4;
		e.smcall (0, person,"is_webmaster", ([]));
	},
	function (e,f) { var t5195 = f.s[0]; if (t5195) f.pc=1; else f.pc=2; },
	function (e,f) { var t5196 = f.s[0]; e.return_pop (t5196); },
null	];

;
	c.args__create =  ["name"];
	c.inst__create =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_function_async", (["music", "create", ([f.v.name])])); },
	function (e,f) { var t5197 = f.s[0]; e.return_pop (t5197); },
null	];

;
	c.pargs__grab_uploaded_sheetmusic =  ["ul","files"];
	c.pinst__grab_uploaded_sheetmusic =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["grab_uploaded_sheetmusic", ([f.v.ul, f.v.files])])); },
	function (e,f) { var t5198 = f.s[0]; e.return_pop (t5198); },
null	];

;
	c.pargs__get_songs_using_music =  [];
	c.pinst__get_songs_using_music =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["get_songs_using_music", ([])])); },
	function (e,f) { var t5199 = f.s[0]; e.return_pop (t5199); },
null	];

;
	c.pargs__do_delete_song =  [];
	c.pinst__do_delete_song =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["do_delete_song", ([])])); },
	function (e,f) { var t5200 = f.s[0]; e.return_pop (t5200); },
null	];

;
	c.pargs__open_music =  [];
	c.pinst__open_music =  [
/*0*/	function (e,f) {
		f.v.pop = new popup;
		e.mcall (2, f.v.pop, "initialise", ([]));
	},
	function (e,f) { e.mcall (5, f.v.pop, "open", ([0, 0, ""])); },
	function (e,f) {  },
	function (e,f) {
		f.pc=5;
		f.v.html = ("<h3>") + ("" + ((f.v["this"]).name) + ("</h3>"));
		f.v.html = "" + (f.v.html) + ("<fieldset><legend>In use by songs</legend>");
		e.mcall (2, f.v["this"], "get_songs_using_music", ([]));
	},
	function (e,f) {
		f.pc=-1;
		e.mcall (2, f.v.pop, "close", ([]));
	},
/*5*/	function (e,f) {
		var t5205 = f.s[0]; f.v.songs = t5205;
		f.v._k314 = e.enumkeys (f.v.songs);
	},
	function (e,f) {
		f.pc=8;
		if (!((f.v._k314).length)) f.pc=7;
	},
	function (e,f) {
		f.pc=9;
		f.v.html = "" + (f.v.html) + ("</fieldset>");
		f.v.html = "" + (f.v.html) + ("<fieldset><legend>Parts</legend><table>");
		f.v._k316 = e.enumkeys ((f.v["this"]).parts);
	},
	function (e,f) {
		f.pc=6;
		f.s[0] = f.v._i315 = (f.v._k314).shift();
		f.s[1] = f.v.name = (f.v.songs)[(f.v._i315)];
		f.v.html = "" + (f.v.html) + ("" + (f.v.name) + ("<br/>"));
	},
	function (e,f) {
		f.pc=11;
		if (!((f.v._k316).length)) f.pc=10;
	},
/*10*/	function (e,f) {
		f.pc=18;
		f.v.html = "" + (f.v.html) + ("</table>");
		e.smcall (0, music,"trusted", ([]));
	},
	function (e,f) {
		f.pc=14;
		f.v._i317 = (f.v._k316).shift();
		f.v.part = ((f.v["this"]).parts)[(f.v._i317)];
		f.v.html = "" + (f.v.html) + ("<tr>");
		f.v.html = "" + (f.v.html) + (("<td style=\"text-align:right\">") + ("" + ((f.v.part).name) + ("</td>")));
		f.v.html = "" + (f.v.html) + (("<td><a href=\"/churchbuilder/sheetmusic-output.php?id=") + ("" + ((f.v["this"]).rowid) + (("&mode=sheetmusic&part=") + ("" + ((f.v.part).name) + ("\">open</a></td>")))));
		e.smcall (0, music,"trusted", ([]));
	},
	function (e,f) {
		f.s[0] = "\">delete</a></td>";
		e.mcall (5, f.v["this"], "render_resume", (["delete_part", f.v.part]));
	},
	function (e,f) {
		f.pc=15;
		var t5219 = f.s[1]; var t5220 = f.s[0]; 
		f.v.html = "" + (f.v.html) + (("<td><a href=\"#\" onclick=\"") + ("" + (t5219) + (t5220)));
	},
	function (e,f) { var t5222 = f.s[0]; if (t5222) f.pc=12; else f.pc=15; },
/*15*/	function (e,f) {
		f.pc=9;
		f.v.html = "" + (f.v.html) + ("</tr>");
	},
	function (e,f) {
		f.s[0] = "\">Add part...</a></br>";
		e.mcall (5, f.v["this"], "render_resume", (["add_part", 0]));
	},
	function (e,f) {
		f.pc=19;
		var t5224 = f.s[1]; var t5225 = f.s[0]; 
		f.v.html = "" + (f.v.html) + (("<a href=\"#\" onclick=\"") + ("" + (t5224) + (t5225)));
	},
	function (e,f) { var t5227 = f.s[0]; if (t5227) f.pc=16; else f.pc=19; },
	function (e,f) {
		f.pc=22;
		f.v.html = "" + (f.v.html) + ("</fieldset>");
		e.smcall (0, music,"trusted", ([]));
	},
/*20*/	function (e,f) {
		f.s[0] = "\">Delete music...</a><br/>";
		e.mcall (5, f.v["this"], "render_resume", (["delete_music", 0]));
	},
	function (e,f) {
		f.pc=23;
		var t5229 = f.s[1]; var t5230 = f.s[0]; 
		f.v.html = "" + (f.v.html) + (("<a href=\"#\" onclick=\"") + ("" + (t5229) + (t5230)));
	},
	function (e,f) { var t5232 = f.s[0]; if (t5232) f.pc=20; else f.pc=23; },
	function (e,f) {
		f.s[0] = "\">Close</button>";
		e.mcall (5, f.v["this"], "render_resume", (["cancel", 0]));
	},
	function (e,f) {
		var t5233 = f.s[1]; var t5234 = f.s[0]; 
		f.v.html = "" + (f.v.html) + (("<button href=\"#\" onclick=\"") + ("" + (t5233) + (t5234)));
		e.mcall (3, f.v.pop, "set_content", ([f.v.html]));
	},
/*25*/	function (e,f) { e.php_builtin (0, "wait_for_input", 0); },
	function (e,f) {
		var t5237 = f.s[0]; f.v.event = t5237;
		if ((((f.v.event).action)) == (("cover"))) f.pc=28; else f.pc=29;
	},
	function (e,f) { if ((((f.v.event).action)) == (("add_part"))) f.pc=31; else f.pc=41; },
	function (e,f) {
		f.pc=30;
		f.s[0] = true;
	},
	function (e,f) { f.s[0] = (((f.v.event).action)) == (("cancel")); },
/*30*/	function (e,f) { var t5238 = f.s[0]; if (t5238) f.pc=4; else f.pc=27; },
	function (e,f) {
		f.pc=40;
		f.v.ul = new uploader;
		e.mcall (2, f.v.ul, "run", ([]));
	},
	function (e,f) { e.mcall (2, f.v.ul, "get_file_info", ([])); },
	function (e,f) {
		var t5241 = f.s[0]; f.v.files = t5241;
		f.v._k318 = e.enumkeys (f.v.files);
	},
	function (e,f) {
		f.pc=36;
		if (!((f.v._k318).length)) f.pc=35;
	},
/*35*/	function (e,f) {
		f.pc=3;
		e.mcall (4, f.v["this"], "grab_uploaded_sheetmusic", ([f.v.ul, f.v.files]));
	},
	function (e,f) {
		f.v.i = (f.v._k318).shift();
		f.v.file = (f.v.files)[(f.v.i)];
		e.smcall (6, popupcombobox,"run", ([0, 0, ("Part name for ") + ("" + ((f.v.file).name) + ("?")), (["generic", "vocal", "guitar", "flute", "sax", "cello", "bass"]), true, "generic"]));
	},
	function (e,f) {
		var t5246 = f.s[0]; f.v.partname = t5246;
		if (((f.v.partname)) === ((null))) f.pc=38; else f.pc=39;
	},
	function (e,f) { f.v.partname = "generic"; },
	function (e,f) {
		f.pc=34;
		(f.v.files)[(f.v.i)].partname = f.v.partname;
	},
/*40*/	function (e,f) { var t5249 = f.s[0]; if (t5249) f.pc=32; else f.pc=3; },
	function (e,f) { if ((((f.v.event).action)) == (("delete_part"))) f.pc=42; else f.pc=45; },
	function (e,f) {
		f.pc=44;
		f.v.part = (f.v.event).parm;
		e.smcall (1, popupokcancel,"run", ([("Sure you want to delete ") + ("" + ((f.v.part).name) + ((" part for ") + ("" + ((f.v["this"]).name) + ("?"))))]));
	},
	function (e,f) {
		f.pc=3;
		f.s[0] = (f.v.part).name;
		f.s[1] = (f.v["this"]).parts;
		e.php_index_lvalue (2);
		e.php_unset (1);
		e.mcall (2, f.v.part, "do_delete_row", ([]));
	},
	function (e,f) { var t5252 = f.s[0]; if (t5252) f.pc=43; else f.pc=3; },
/*45*/	function (e,f) { if ((((f.v.event).action)) == (("delete_music"))) f.pc=46; else f.pc=3; },
	function (e,f) {
		f.pc=49;
		e.smcall (1, popupokcancel,"run", ([("Sure you want to completely delete entire music ") + ("" + ((f.v["this"]).name) + ("?"))]));
	},
	function (e,f) { e.mcall (2, f.v["this"], "do_delete_song", ([])); },
	function (e,f) { f.pc=4; },
	function (e,f) { var t5253 = f.s[0]; if (t5253) f.pc=47; else f.pc=3; },
null	];

;
	c.pargs__open =  ["el","arg","ev"];
	c.pinst__open =  [
/*0*/	function (e,f) { e.mcall (2, f.v["this"], "open_music", ([])); },
null	];

;
	c.args__do_fetch =  ["rowid"];
	c.inst__do_fetch =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_function_async", (["music", "do_fetch", ([f.v.rowid])])); },
	function (e,f) { var t5254 = f.s[0]; e.return_pop (t5254); },
null	];

;
	c.args__find = c.pargs__find =  ["rowid"];
	c.inst__find = c.pinst__find =  [
/*0*/	function (e,f) { if (((f.v.rowid)) == ((0))) f.pc=2; else f.pc=3; },
	function (e,f) { e.return_pop (null); },
	function (e,f) {
		f.pc=4;
		f.s[0] = true;
	},
	function (e,f) { f.s[0] = ((f.v.rowid)) == (("")); },
	function (e,f) { var t5255 = f.s[0]; if (t5255) f.pc=1; else f.pc=5; },
/*5*/	function (e,f) { e.smcall (2, music,"find_object", (["music", f.v.rowid])); },
	function (e,f) {
		var t5257 = f.s[0]; f.v.m = t5257;
		if (((f.v.m)) !== ((null))) f.pc=7; else f.pc=8;
	},
	function (e,f) { e.return_pop (f.v.m); },
	function (e,f) { e.smcall (1, music,"do_fetch", ([f.v.rowid])); },
	function (e,f) { var t5258 = f.s[0]; e.return_pop (t5258); },
null	];

;
};
music.init_methods (music);
rpcclass.setup_class (music, "music",0, (["name","parts","rowid","listeners"]), ([0,0,0,2]));
function musictabmanager () { this.do_construct (arguments); }
musictabmanager.init_methods = function (c) {
	tabmanager.init_methods(c);
	var cp = c.prototype;
	c.pargs__create_new =  ["namehint"];
	c.pinst__create_new =  [
/*0*/	function (e,f) { e.smcall (4, popupeditbox,"run", ([0, 0, "Name that tune...", f.v.namehint])); },
	function (e,f) {
		var t5260 = f.s[0]; f.v.musicname = t5260;
		if (((f.v.musicname)) === ((null))) f.pc=2; else f.pc=3;
	},
	function (e,f) { e.return_pop (0); },
	function (e,f) {
		f.pc=14;
		f.v.ul = new uploader;
		e.mcall (2, f.v.ul, "run", ([]));
	},
	function (e,f) { e.mcall (2, f.v.ul, "get_file_info", ([])); },
/*5*/	function (e,f) {
		var t5263 = f.s[0]; f.v.files = t5263;
		f.v._k320 = e.enumkeys (f.v.files);
	},
	function (e,f) {
		f.pc=8;
		if (!((f.v._k320).length)) f.pc=7;
	},
	function (e,f) {
		f.pc=12;
		e.smcall (1, music,"create", ([f.v.musicname]));
	},
	function (e,f) {
		f.v.i = (f.v._k320).shift();
		f.v.file = (f.v.files)[(f.v.i)];
		e.smcall (6, popupcombobox,"run", ([0, 0, ("Part name for ") + ("" + ((f.v.file).name) + ("?")), (["generic", "vocal", "guitar", "flute", "sax", "cello", "bass"]), true, "generic"]));
	},
	function (e,f) {
		var t5268 = f.s[0]; f.v.partname = t5268;
		if (((f.v.partname)) === ((null))) f.pc=10; else f.pc=11;
	},
/*10*/	function (e,f) { f.v.partname = "generic"; },
	function (e,f) {
		f.pc=6;
		(f.v.files)[(f.v.i)].partname = f.v.partname;
	},
	function (e,f) {
		var t5272 = f.s[0]; f.v.m = t5272;
		e.mcall (4, f.v.m, "grab_uploaded_sheetmusic", ([f.v.ul, f.v.files]));
	},
	function (e,f) { e.return_pop ((f.v.m).rowid); },
	function (e,f) { var t5273 = f.s[0]; if (t5273) f.pc=4; else f.pc=15; },
/*15*/	function (e,f) { e.return_pop (0); },
null	];

;
	c.pargs__open =  ["rowid","include_select"];
	c.pinst__open =  [
/*0*/	function (e,f) { e.smcall (1, music,"find", ([f.v.rowid])); },
	function (e,f) {
		var t5275 = f.s[0]; f.v.music = t5275;
		e.mcall (2, f.v.music, "open_music", ([]));
	},
	function (e,f) { e.return_pop (null); },
null	];

;
	c.args__create = c.pargs__create =  [];
	c.inst__create = c.pinst__create =  [
/*0*/	function (e,f) {
		f.v.mtm = new musictabmanager;
		e.mcall (5, f.v.mtm, "initialise", (["music", (["name"]), (["name"])]));
	},
	function (e,f) { e.return_pop (f.v.mtm); },
null	];

;
};
musictabmanager.init_methods (musictabmanager);
rpcclass.setup_class (musictabmanager, "musictabmanager",0, (["tabclass","list_fields","search_fields","listeners"]), ([0,0,0,2]));
function music_manager () { this.do_construct (arguments); }
music_manager.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
	c.args__open_song = c.pargs__open_song =  ["el","cls","ev"];
	c.inst__open_song = c.pinst__open_song =  [
/*0*/	function (e,f) { e.smcall (2, generictableitem,"choose", ([f.v.cls, false])); },
null	];

;
	c.args__manage_music = c.pargs__manage_music =  ["el","arg","ev"];
	c.inst__manage_music = c.pinst__manage_music =  [
/*0*/	function (e,f) {
		f.v.mtm = new musictabmanager;
		e.mcall (5, f.v.mtm, "initialise", (["music", (["name"]), (["name"])]));
	},
	function (e,f) { e.mcall (6, f.v.mtm, "choose", (["Choose music", false, true, ""])); },
null	];

;
};
music_manager.init_methods (music_manager);
rpcclass.setup_class (music_manager, "music_manager",0, (["listeners"]), ([2]));
function song () { this.do_construct (arguments); }
song.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
	c.args__create = c.pargs__create =  [];
	c.inst__create = c.pinst__create =  [
/*0*/	function (e,f) {
		f.v.res = new song;
		f.v.res.title = "";
		f.v.res.subtitle = "";
		f.v.res.author = "";
		f.v.res.copyright = "";
		f.v.res.catalog = "";
		f.v.res.admin = "";
		f.v.res.bookname = "";
		f.v.res.songbookEntry = "";
		f.v.res.text = "";
		f.v.res.rawtext = "";
		f.v.res.ccl = "";
		f.v.res.url = "";
		f.v.res.block_order = ([]);
		f.v.res.blocks = ([]);
		f.v.res.vblocks = ([]);
		f.v.res.current_block = null;
		f.v.res.is_chorus = false;
		f.v.res.cn = 1;
		f.v.res.xn = 1;
		e.return_pop (f.v.res);
	},
null	];

;
	c.args__create_from_obj = c.pargs__create_from_obj =  ["src"];
	c.inst__create_from_obj = c.pinst__create_from_obj =  [
/*0*/	function (e,f) { e.mcall (2, f.v.src, "song_supported_fields", ([])); },
	function (e,f) {
		var t5299 = f.s[0]; f.v.fields = t5299;
		e.smcall (0, song,"create", ([]));
	},
	function (e,f) {
		var t5301 = f.s[0]; f.v.res = t5301;
		f.v._k322 = e.enumkeys (f.v.fields);
	},
	function (e,f) {
		f.pc=5;
		if (!((f.v._k322).length)) f.pc=4;
	},
	function (e,f) { e.return_pop (f.v.res); },
/*5*/	function (e,f) {
		f.pc=3;
		f.s[0] = f.v._i323 = (f.v._k322).shift();
		f.s[1] = f.v.field = (f.v.fields)[(f.v._i323)];
		f.v.res[f.v.field] = (f.v.src)[(f.v.field)];
	},
null	];

;
	c.args__create_from_struct = c.pargs__create_from_struct =  ["src","fields"];
	c.inst__create_from_struct = c.pinst__create_from_struct =  [
/*0*/	function (e,f) { e.smcall (0, song,"create", ([])); },
	function (e,f) {
		var t5307 = f.s[0]; f.v.res = t5307;
		f.v._k324 = e.enumkeys (f.v.fields);
	},
	function (e,f) {
		f.pc=4;
		if (!((f.v._k324).length)) f.pc=3;
	},
	function (e,f) { e.return_pop (f.v.res); },
	function (e,f) {
		f.pc=2;
		f.s[0] = f.v._i325 = (f.v._k324).shift();
		f.s[1] = f.v.field = (f.v.fields)[(f.v._i325)];
		f.v.res[f.v.field] = (f.v.src)[(f.v.field)];
	},
null	];

;
	c.args__create_from_obj_array = c.pargs__create_from_obj_array =  ["srcs"];
	c.inst__create_from_obj_array = c.pinst__create_from_obj_array =  [
/*0*/	function (e,f) {
		f.v.ares = ([]);
		f.v._k326 = e.enumkeys (f.v.srcs);
	},
	function (e,f) {
		f.pc=3;
		if (!((f.v._k326).length)) f.pc=2;
	},
	function (e,f) { e.return_pop (f.v.ares); },
	function (e,f) {
		f.s[0] = f.v._i327 = (f.v._k326).shift();
		f.s[1] = f.v.src = (f.v.srcs)[(f.v._i327)];
		e.smcall (3, song,"create_from_obj", ([f.v.src]));
	},
	function (e,f) {
		f.pc=1;
		var t5317 = f.s[2]; f.v.ares[f.v.ares.length] = t5317;
	},
null	];

;
	c.args__create_from_struct_array = c.pargs__create_from_struct_array =  ["srcs","fields"];
	c.inst__create_from_struct_array = c.pinst__create_from_struct_array =  [
/*0*/	function (e,f) {
		f.v.ares = ([]);
		f.v._k328 = e.enumkeys (f.v.srcs);
	},
	function (e,f) {
		f.pc=3;
		if (!((f.v._k328).length)) f.pc=2;
	},
	function (e,f) { e.return_pop (f.v.ares); },
	function (e,f) {
		f.s[0] = f.v._i329 = (f.v._k328).shift();
		f.s[1] = f.v.src = (f.v.srcs)[(f.v._i329)];
		e.smcall (4, song,"create_from_struct", ([f.v.src, f.v.fields]));
	},
	function (e,f) {
		f.pc=1;
		var t5323 = f.s[2]; f.v.ares[f.v.ares.length] = t5323;
	},
null	];

;
	c.pargs__parse =  [];
	c.pinst__parse =  [
/*0*/	function (e,f) {
		f.v.lines = builtin__explode ("\n",(f.v["this"]).text);
		f.v["this"].block_order = ([]);
		f.v["this"].blocks = ({});
		f.v["this"].vblocks = ({});
		if (((builtin__substr ((f.v["this"]).text,0,1))) == (("."))) f.pc=1; else f.pc=12;
	},
	function (e,f) { f.v._k330 = e.enumkeys (f.v.lines); },
	function (e,f) { if (!((f.v._k330).length)) f.pc=-1; },
	function (e,f) {
		f.v._i331 = (f.v._k330).shift();
		f.v.line = (f.v.lines)[(f.v._i331)];
		f.v.line = builtin__trim (f.v.line);
		if (((builtin__substr (f.v.line,0,1))) == (("."))) f.pc=4; else f.pc=6;
	},
	function (e,f) {
		f.v.tag = f.v.line;
		(f.v["this"]).block_order[(f.v["this"]).block_order.length] = f.v.tag;
		if (!((((f.v["this"]).blocks)[(f.v.tag)]) !== undefined)) f.pc=5; else f.pc=2;
	},
/*5*/	function (e,f) {
		f.pc=2;
		(f.v["this"]).blocks[f.v.tag] = ([]);
		(f.v["this"]).vblocks[f.v.tag] = ([]);
	},
	function (e,f) { if (((f.v.line)) == ((""))) f.pc=2; else f.pc=7; },
	function (e,f) { if (((builtin__trim (f.v.line))) != (("-"))) f.pc=8; else f.pc=9; },
	function (e,f) { ((f.v["this"]).blocks)[(f.v.tag)][((f.v["this"]).blocks)[(f.v.tag)].length] = builtin__str_replace ("|"," ",f.v.line); },
	function (e,f) {
		f.v.sublines = builtin__explode ("|",f.v.line);
		f.v._k332 = e.enumkeys (f.v.sublines);
	},
/*10*/	function (e,f) { if (!((f.v._k332).length)) f.pc=2; },
	function (e,f) {
		f.pc=10;
		f.s[0] = f.v._i333 = (f.v._k332).shift();
		f.s[1] = f.v.subline = (f.v.sublines)[(f.v._i333)];
		((f.v["this"]).vblocks)[(f.v.tag)][((f.v["this"]).vblocks)[(f.v.tag)].length] = f.v.subline;
	},
	function (e,f) {
		f.v.count = 0;
		f.v.open = false;
		f.v._k334 = e.enumkeys (f.v.lines);
	},
	function (e,f) { if (!((f.v._k334).length)) f.pc=-1; },
	function (e,f) {
		f.v._i335 = (f.v._k334).shift();
		f.v.line = (f.v.lines)[(f.v._i335)];
		f.v.line = builtin__trim (f.v.line);
		if (((f.v.line)) == ((""))) f.pc=15; else f.pc=17;
	},
/*15*/	function (e,f) { if (f.v.open) f.pc=16; else f.pc=13; },
	function (e,f) {
		f.pc=13;
		f.v.open = false;
	},
	function (e,f) { if (!(f.v.open)) f.pc=18; else f.pc=19; },
	function (e,f) {
		e.php_push_var_lvalue (0, "count");
		e.php_postinc (1);
		f.v.key = (".v") + (f.v.count);
		(f.v["this"]).block_order[(f.v["this"]).block_order.length] = f.v.key;
		(f.v["this"]).blocks[f.v.key] = ([]);
		(f.v["this"]).vblocks[f.v.key] = ([]);
	},
	function (e,f) { if (((builtin__trim (f.v.line))) != (("-"))) f.pc=20; else f.pc=21; },
/*20*/	function (e,f) { ((f.v["this"]).blocks)[(f.v.key)][((f.v["this"]).blocks)[(f.v.key)].length] = builtin__str_replace ("|"," ",f.v.line); },
	function (e,f) {
		f.v.sublines = builtin__explode ("|",f.v.line);
		f.v._k336 = e.enumkeys (f.v.sublines);
	},
	function (e,f) {
		f.pc=24;
		if (!((f.v._k336).length)) f.pc=23;
	},
	function (e,f) {
		f.pc=13;
		f.v.open = true;
	},
	function (e,f) {
		f.pc=22;
		f.s[0] = f.v._i337 = (f.v._k336).shift();
		f.s[1] = f.v.subline = (f.v.sublines)[(f.v._i337)];
		((f.v["this"]).vblocks)[(f.v.key)][((f.v["this"]).vblocks)[(f.v.key)].length] = f.v.subline;
	},
null	];

;
	c.pargs__do_share_markup =  [];
	c.pinst__do_share_markup =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["do_share_markup", ([])])); },
	function (e,f) { var t5361 = f.s[0]; e.return_pop (t5361); },
null	];

;
	c.pargs__render_popup_contents =  [];
	c.pinst__render_popup_contents =  [
/*0*/	function (e,f) { e.mcall (2, f.v["this"], "parse", ([])); },
	function (e,f) {
		f.v.text = "";
		f.v.seen = ({});
		f.v.need_break = false;
		f.v._k338 = e.enumkeys ((f.v["this"]).block_order);
	},
	function (e,f) {
		f.pc=4;
		if (!((f.v._k338).length)) f.pc=3;
	},
	function (e,f) {
		window.__outbuffer += "\n<h2>";
		window.__outbuffer += (f.v["this"]).title;
		window.__outbuffer += "</h2>\n<h3>";
		window.__outbuffer += (f.v["this"]).subtitle;
		window.__outbuffer += "</h3>\n<h4>";
		window.__outbuffer += (f.v["this"]).author;
		window.__outbuffer += "</h3>\n<h4>Copyright &copy; ";
		window.__outbuffer += (f.v["this"]).copyright;
		window.__outbuffer += "</h3>\n<div style=\"margin-left:10%\">";
		window.__outbuffer += f.v.text;
		window.__outbuffer += "</div>\n";
		if ((((f.v["this"]).ccl)) != ((""))) f.pc=17; else f.pc=18;
	},
	function (e,f) {
		f.v._i339 = (f.v._k338).shift();
		f.v.tag = ((f.v["this"]).block_order)[(f.v._i339)];
		if (((f.v.seen)[(f.v.tag)]) !== undefined) f.pc=5; else f.pc=8;
	},
/*5*/	function (e,f) {
		f.v.line = "" + (builtin__htmlentities ((((f.v["this"]).blocks)[(f.v.tag)])[(0)])) + ("...");
		if (((builtin__substr (f.v.tag,0,2))) == ((".c"))) f.pc=6; else f.pc=7;
	},
	function (e,f) { f.v.line = ("<em>") + ("" + (f.v.line) + ("</em>")); },
	function (e,f) {
		f.pc=2;
		f.v.text = "" + (f.v.text) + (("<blockquote>") + ("" + (f.v.line) + ("</blockquote>")));
	},
	function (e,f) { if (f.v.need_break) f.pc=9; else f.pc=10; },
	function (e,f) { f.v.text = "" + (f.v.text) + ("<br/>"); },
/*10*/	function (e,f) {
		f.v.block = "";
		f.v._k340 = e.enumkeys (((f.v["this"]).blocks)[(f.v.tag)]);
	},
	function (e,f) {
		f.pc=13;
		if (!((f.v._k340).length)) f.pc=12;
	},
	function (e,f) { if (((builtin__substr (f.v.tag,0,2))) == ((".c"))) f.pc=14; else f.pc=15; },
	function (e,f) {
		f.pc=11;
		f.v._i341 = (f.v._k340).shift();
		f.v.line = (((f.v["this"]).blocks)[(f.v.tag)])[(f.v._i341)];
		f.v.block = "" + (f.v.block) + ("" + (builtin__htmlentities (f.v.line)) + ("<br/>"));
	},
	function (e,f) { f.v.block = ("<blockquote><em>") + ("" + (f.v.block) + ("</em></blockquote>")); },
/*15*/	function (e,f) {
		f.pc=2;
		f.v.text = "" + (f.v.text) + (f.v.block);
		f.v.seen[f.v.tag] = true;
		f.v.need_break = true;
	},
	function (e,f) {
		f.pc=20;
		window.__outbuffer += ("<h4>CCL: <a href=\"http://www.ccli.com/songsearch/skins/visitor/song_detail.cfm?id=") + ("" + ((f.v["this"]).ccl) + (("&display_options=\" target=\"_blank\">") + ("" + ((f.v["this"]).ccl) + ("</a></h4>"))));
	},
	function (e,f) {
		f.pc=19;
		f.s[0] = (((f.v["this"]).ccl)) != (("unknown"));
	},
	function (e,f) { f.s[0] = false; },
	function (e,f) { var t5381 = f.s[0]; if (t5381) f.pc=16; else f.pc=20; },
/*20*/	function (e,f) { if ((((f.v["this"]).url)) != ((""))) f.pc=21; else f.pc=28; },
	function (e,f) {
		f.v.matches = ([]);
		if (builtin__preg_match ("%^([^:]+)://([^/]+)%",(f.v["this"]).url,f.v.matches)) f.pc=22; else f.pc=27;
	},
	function (e,f) {
		f.v.proto = (f.v.matches)[(1)];
		f.v.site = (f.v.matches)[(2)];
		window.__outbuffer += ("<a href=\"") + ("" + ((f.v["this"]).url) + (("\" target=\"_blank\">Find it at ") + ("" + (f.v.site) + ("</a><br/>"))));
		if ((((f.v["this"]).text)) == ((""))) f.pc=23; else f.pc=25;
	},
	function (e,f) {
		f.s[0] = "\">Web Import</a><br/>";
		e.mcall (5, f.v["this"], "render_resume", (["item_action", (["web_import", 0])]));
	},
	function (e,f) {
		f.pc=28;
		var t5385 = f.s[1]; var t5386 = f.s[0]; 
		window.__outbuffer += ("<a href=\"#\" onclick=\"") + ("" + (t5385) + (t5386));
	},
/*25*/	function (e,f) {
		f.s[0] = "\">Share markup with other churches</a><br/>";
		e.mcall (5, f.v["this"], "render_resume", (["item_action", (["share_markup", 0])]));
	},
	function (e,f) {
		f.pc=28;
		var t5387 = f.s[1]; var t5388 = f.s[0]; 
		window.__outbuffer += ("<a href=\"#\" onclick=\"") + ("" + (t5387) + (t5388));
	},
	function (e,f) { window.__outbuffer += ("<h4>") + ("" + ((f.v["this"]).url) + (" does not look like a URL</h4>")); },
	function (e,f) {
		f.v.where = "";
		if ((((f.v["this"]).bookname)) != ((""))) f.pc=29; else f.pc=30;
	},
	function (e,f) { window.__outbuffer += ("<h4>") + ("" + ((f.v["this"]).bookname) + ((":") + ("" + ((f.v["this"]).songbookEntry) + ("</h4>")))); },
/*30*/	function (e,f) { if ((((f.v["this"]).url)) != ((""))) f.pc=31; else f.pc=-1; },
	function (e,f) { window.__outbuffer += ("<h4><a href=\"") + ("" + ((f.v["this"]).url) + ("\" target=\"_blank\">Website</a></h4>")); },
null	];

;
	c.args__do_import =  ["words","target"];
	c.inst__do_import =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_function_async", (["song", "do_import", ([f.v.words, f.v.target])])); },
	function (e,f) { var t5390 = f.s[0]; e.return_pop (t5390); },
null	];

;
	c.args__import_words = c.pargs__import_words =  ["el","arg","ev"];
	c.inst__import_words = c.pinst__import_words =  [
/*0*/	function (e,f) { e.mcall (3, document, "getElementById", (["songwords"])); },
	function (e,f) {
		var t5392 = f.s[0]; f.v.obj = t5392;
		f.v.words = (f.v.obj).value;
		e.smcall (2, song,"do_import", ([f.v.words, f.v.arg]));
	},
null	];

;
};
song.init_methods (song);
rpcclass.setup_class (song, "song",0, (["title","subtitle","author","copyright","catalog","admin","bookname","songbookEntry","rawtext","text","markup","ccl","url","ssid","last_update","blocks","vblocks","block_order","current_block","is_chorus","cn","xn","listeners"]), ([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2]));
function genericsong () { this.do_construct (arguments); }
genericsong.init_methods = function (c) {
	generictableitem.init_methods(c);
	var cp = c.prototype;
	c.args__trusted = c.pargs__trusted =  [];
	c.inst__trusted = c.pinst__trusted =  [
/*0*/	function (e,f) {
		f.pc=3;
		e.smcall (1, person,"i_match_query", (["Web\\Music Coordinators"]));
	},
	function (e,f) {
		f.pc=4;
		f.s[0] = true;
	},
	function (e,f) {
		f.pc=4;
		e.smcall (0, person,"is_webmaster", ([]));
	},
	function (e,f) { var t5394 = f.s[0]; if (t5394) f.pc=1; else f.pc=2; },
	function (e,f) { var t5395 = f.s[0]; e.return_pop (t5395); },
null	];

;
	c.args__can_import = c.pargs__can_import =  [];
	c.inst__can_import = c.pinst__can_import =  [
/*0*/	function (e,f) { e.return_pop (true); },
null	];

;
	c.args__rating_field = c.pargs__rating_field =  [];
	c.inst__rating_field = c.pinst__rating_field =  [
/*0*/	function (e,f) { e.return_pop ("rating"); },
null	];

;
	c.args__rating_colour = c.pargs__rating_colour =  ["rating"];
	c.inst__rating_colour = c.pinst__rating_colour =  [
/*0*/	function (e,f) { if (((f.v.rating)) == (("0"))) f.pc=1; else f.pc=2; },
	function (e,f) {
		f.pc=5;
		f.s[0] = "red";
	},
	function (e,f) { if (((f.v.rating)) == (("1"))) f.pc=3; else f.pc=4; },
	function (e,f) {
		f.pc=5;
		f.s[0] = "#a77600";
	},
	function (e,f) { f.s[0] = "green"; },
/*5*/	function (e,f) { var t5396 = f.s[0]; e.return_pop (t5396); },
null	];

;
	c.args__import = c.pargs__import =  ["args"];
	c.inst__import = c.pinst__import =  [
/*0*/	function (e,f) {
		f.v.tabclass = (f.v.args)[(0)];
		f.v.namehint = (f.v.args)[(1)];
		e.smcall (1, sharedsong,"import", ([f.v.namehint]));
	},
	function (e,f) {
		var t5400 = f.s[0]; f.v.ssong = t5400;
		if (((f.v.ssong)) === ((null))) f.pc=2; else f.pc=3;
	},
	function (e,f) { e.return_pop (0); },
	function (e,f) {
		f.v.fields = ({name:(f.v.ssong).title, title:(f.v.ssong).title, subtitle:(f.v.ssong).subtitle, author:(f.v.ssong).author, copyright:(f.v.ssong).copyright, url:(f.v.ssong).url});
		e.smcall (2, genericsong,"create_new_generic_helper", ([f.v.tabclass, f.v.fields]));
	},
	function (e,f) { var t5402 = f.s[0]; e.return_pop (t5402); },
null	];

;
	c.args__song_supported_fields = c.pargs__song_supported_fields =  [];
	c.inst__song_supported_fields = c.pinst__song_supported_fields =  [
/*0*/	function (e,f) { e.return_pop ((["title", "subtitle", "author", "copyright", "bookname", "songbookEntry", "text", "ccl", "url", "ssid"])); },
null	];

;
	c.pargs__make_song =  [];
	c.pinst__make_song =  [
/*0*/	function (e,f) { e.mcall (2, f.v["this"], "song_supported_fields", ([])); },
	function (e,f) {
		f.s[1] = f.v["this"];
		e.php_static_method_call (2, song,"create_from_obj", 2);
	},
	function (e,f) { var t5404 = f.s[0]; e.return_pop (t5404); },
null	];

;
	c.pargs__save_music =  [];
	c.pinst__save_music =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["save_music", ([])])); },
	function (e,f) { var t5405 = f.s[0]; e.return_pop (t5405); },
null	];

;
	c.pargs__do_unlink_music =  ["music"];
	c.pinst__do_unlink_music =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["do_unlink_music", ([f.v.music])])); },
	function (e,f) { var t5406 = f.s[0]; e.return_pop (t5406); },
null	];

;
	c.pargs__popup_action =  ["name","arg"];
	c.pinst__popup_action =  [
/*0*/	function (e,f) { if (((f.v.name)) == (("open_music"))) f.pc=1; else f.pc=2; },
	function (e,f) {
		f.pc=-1;
		f.v.music = f.v.arg;
		e.mcall (2, f.v.music, "open_music", ([]));
	},
	function (e,f) { if (((f.v.name)) == (("unlink_music"))) f.pc=3; else f.pc=6; },
	function (e,f) {
		f.pc=5;
		f.v.music = f.v.arg;
		e.smcall (1, popupokcancel,"run", ([("Unlink ") + ("" + ((f.v.music).name) + (" from this song?"))]));
	},
	function (e,f) {
		f.pc=-1;
		e.mcall (3, f.v["this"], "do_unlink_music", ([f.v.music]));
	},
/*5*/	function (e,f) { var t5409 = f.s[0]; if (t5409) f.pc=4; else f.pc=-1; },
	function (e,f) { if (((f.v.name)) == (("add_music"))) f.pc=7; else f.pc=12; },
	function (e,f) { e.smcall (0, musictabmanager,"create", ([])); },
	function (e,f) {
		var t5411 = f.s[0]; f.v.mtm = t5411;
		e.mcall (6, f.v.mtm, "choose", (["Choose music", true, true, (f.v["this"]).name]));
	},
	function (e,f) {
		var t5413 = f.s[0]; f.v.musicid = t5413;
		if (((f.v.musicid)) !== ((0))) f.pc=10; else f.pc=-1;
	},
/*10*/	function (e,f) { e.smcall (1, music,"find", ([f.v.musicid])); },
	function (e,f) {
		f.pc=-1;
		var t5415 = f.s[0]; (f.v["this"]).music[(f.v["this"]).music.length] = t5415;
		e.mcall (2, f.v["this"], "save_music", ([]));
	},
	function (e,f) { if (((f.v.name)) == (("web_import"))) f.pc=13; else f.pc=14; },
	function (e,f) {
		f.pc=-1;
		e.mcall (2, f.v["this"], "do_web_import", ([]));
	},
	function (e,f) { if (((f.v.name)) == (("share_markup"))) f.pc=15; else f.pc=-1; },
/*15*/	function (e,f) { e.mcall (2, f.v["this"], "do_share_markup", ([])); },
null	];

;
	c.pargs__do_web_import =  [];
	c.pinst__do_web_import =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["do_web_import", ([])])); },
	function (e,f) { var t5416 = f.s[0]; e.return_pop (t5416); },
null	];

;
	c.pargs__render_popup_contents =  [];
	c.pinst__render_popup_contents =  [
/*0*/	function (e,f) { e.mcall (2, f.v["this"], "make_song", ([])); },
	function (e,f) {
		var t5418 = f.s[0]; f.v.s = t5418;
		e.mcall (2, f.v.s, "render_popup_contents", ([]));
	},
	function (e,f) { if ((((f.v["this"]).tune)) != ((""))) f.pc=3; else f.pc=4; },
	function (e,f) { window.__outbuffer += ("<h4>Tune: ") + ("" + ((f.v["this"]).tune) + ("</h4>")); },
	function (e,f) { if ((((f.v["this"]).wordsChecked)) == ((0))) f.pc=5; else f.pc=6; },
/*5*/	function (e,f) { window.__outbuffer += "<h4><span style='color:red'>WARNING: WORDS HAVE NOT BEEN CHECKED</span></h4>"; },
	function (e,f) {
		window.__outbuffer += "<fieldset><legend>Music</legend>";
		window.__outbuffer += "<table>";
		f.v._k342 = e.enumkeys ((f.v["this"]).music);
	},
	function (e,f) {
		f.pc=9;
		if (!((f.v._k342).length)) f.pc=8;
	},
	function (e,f) {
		f.pc=19;
		window.__outbuffer += "</table>";
		e.smcall (0, genericsong,"trusted", ([]));
	},
	function (e,f) {
		f.v._i343 = (f.v._k342).shift();
		f.v.music = ((f.v["this"]).music)[(f.v._i343)];
		f.v.name = (f.v.music).name;
		if (((f.v.name)) == ((""))) f.pc=10; else f.pc=11;
	},
/*10*/	function (e,f) { f.v.name = "[unset]"; },
	function (e,f) {
		window.__outbuffer += "<tr>";
		window.__outbuffer += ("<td style=\"text-align:right\">") + ("" + (f.v.name) + (":</a></td>"));
		f.s[0] = "\">open</a></td>";
		e.mcall (5, f.v["this"], "render_resume", (["item_action", (["open_music", f.v.music])]));
	},
	function (e,f) {
		f.pc=15;
		var t5424 = f.s[1]; var t5425 = f.s[0]; 
		window.__outbuffer += ("<td style=\"text-align:right\"><a href=\"#\" onclick=\"") + ("" + (t5424) + (t5425));
		e.smcall (0, genericsong,"trusted", ([]));
	},
	function (e,f) {
		f.s[0] = "\">remove</a></td>";
		e.mcall (5, f.v["this"], "render_resume", (["item_action", (["unlink_music", f.v.music])]));
	},
	function (e,f) {
		f.pc=16;
		var t5426 = f.s[1]; var t5427 = f.s[0]; 
		window.__outbuffer += ("<td style=\"text-align:right\"><a href=\"#\" onclick=\"") + ("" + (t5426) + (t5427));
	},
/*15*/	function (e,f) { var t5428 = f.s[0]; if (t5428) f.pc=13; else f.pc=16; },
	function (e,f) {
		f.pc=7;
		window.__outbuffer += "</tr>";
	},
	function (e,f) {
		f.s[0] = "\">Add new...</a></td>";
		e.mcall (5, f.v["this"], "render_resume", (["item_action", (["add_music", 0])]));
	},
	function (e,f) {
		f.pc=20;
		var t5429 = f.s[1]; var t5430 = f.s[0]; 
		window.__outbuffer += ("<a href=\"#\" onclick=\"") + ("" + (t5429) + (t5430));
	},
	function (e,f) { var t5431 = f.s[0]; if (t5431) f.pc=17; else f.pc=20; },
/*20*/	function (e,f) {
		window.__outbuffer += "</fieldset>";
		if ((((f.v["this"]).url)) != ((""))) f.pc=21; else f.pc=-1;
	},
	function (e,f) { window.__outbuffer += ("<h4><a href=\"") + ("" + ((f.v["this"]).url) + ("\" target=\"_blank\">Website</a></h4>")); },
null	];

;
	c.args__search_fields = c.pargs__search_fields =  [];
	c.inst__search_fields = c.pinst__search_fields =  [
/*0*/	function (e,f) {
		f.v.fields = ([]);
		f.v.fields[f.v.fields.length] = "name";
		f.v.fields[f.v.fields.length] = "title";
		f.v.fields[f.v.fields.length] = "subtitle";
		f.v.fields[f.v.fields.length] = "author";
		f.v.fields[f.v.fields.length] = "text";
		f.v.fields[f.v.fields.length] = "#keywords";
		e.return_pop (f.v.fields);
	},
null	];

;
	c.args__list_fields = c.pargs__list_fields =  [];
	c.inst__list_fields = c.pinst__list_fields =  [
/*0*/	function (e,f) {
		f.v.fields = ([]);
		f.v.fields[f.v.fields.length] = "name";
		f.v.fields[f.v.fields.length] = "subtitle";
		f.v.fields[f.v.fields.length] = "author";
		f.v.fields[f.v.fields.length] = "bookname";
		e.return_pop (f.v.fields);
	},
null	];

;
	c.args__fields = c.pargs__fields =  [];
	c.inst__fields = c.pinst__fields =  [
/*0*/	function (e,f) {
		f.v.fields = ([]);
		f.v.fields[f.v.fields.length] = ({type:"text", name:"name", label:"Name", focus:true, width:"300"});
		f.v.fields[f.v.fields.length] = ({type:"text", name:"title", label:"Title", width:"300"});
		f.v.fields[f.v.fields.length] = ({type:"text", name:"subtitle", label:"Subtitle"});
		f.v.fields[f.v.fields.length] = ({type:"text", name:"author", label:"Author"});
		f.v.fields[f.v.fields.length] = ({type:"text", name:"copyright", label:"Copyright"});
		f.v.fields[f.v.fields.length] = ({type:"text", name:"bookname", label:"Bookname"});
		f.v.fields[f.v.fields.length] = ({type:"text", name:"songbookEntry", label:"Book entry"});
		f.v.fields[f.v.fields.length] = ({type:"text", name:"tune", label:"Tune"});
		f.v.fields[f.v.fields.length] = ({type:"yesno", name:"wordsChecked", label:"Words Checked"});
		f.v.fields[f.v.fields.length] = ({type:"text", name:"keywords", label:"Keywords", width:"300"});
		f.v.fields[f.v.fields.length] = ({type:"text", name:"ssid"});
		f.v.fields[f.v.fields.length] = ({type:"text", name:"import_date"});
		f.v.fields[f.v.fields.length] = ({type:"text", name:"ccl", label:"CCLI song number"});
		f.v.fields[f.v.fields.length] = ({type:"text", name:"url", label:"Web address", width:"300"});
		f.v.fields[f.v.fields.length] = ({type:"enum", name:"rating", label:"Rating", width:"100", options:({"0":"Ignore", "1":"Normal", "2":"Approved"})});
		f.v.fields[f.v.fields.length] = ({type:"textbox", name:"text", label:"", width:500, height:400});
		e.return_pop (f.v.fields);
	},
null	];

;
	c.args__is_music = c.pargs__is_music =  [];
	c.inst__is_music = c.pinst__is_music =  [
/*0*/	function (e,f) { e.return_pop (true); },
null	];

;
	c.pargs__render_item_notes =  ["serviceitem"];
	c.pinst__render_item_notes =  [
/*0*/	function (e,f) { if (((builtin__count ((f.v["this"]).music))) > ((1))) f.pc=1; else f.pc=7; },
	function (e,f) { e.mcall (3, f.v.serviceitem, "get_property", (["tune"])); },
	function (e,f) {
		var t5462 = f.s[0]; f.v.tune = t5462;
		if (((f.v.tune)) != ((""))) f.pc=3; else f.pc=7;
	},
	function (e,f) { f.v._k344 = e.enumkeys ((f.v["this"]).music); },
	function (e,f) { if (!((f.v._k344).length)) f.pc=7; },
/*5*/	function (e,f) {
		f.v._i345 = (f.v._k344).shift();
		f.v.music = ((f.v["this"]).music)[(f.v._i345)];
		if ((((f.v.music).rowid)) == ((f.v.tune))) f.pc=6; else f.pc=4;
	},
	function (e,f) { e.return_pop (("tune ") + ((f.v.music).name)); },
	function (e,f) { e.return_pop (""); },
null	];

;
	c.pargs__context_menu_items =  ["menu"];
	c.pinst__context_menu_items =  [
/*0*/	function (e,f) { if (((builtin__count ((f.v["this"]).music))) > ((1))) f.pc=1; else f.pc=-1; },
	function (e,f) { e.smcall (0, menu,"create", ([])); },
	function (e,f) {
		var t5467 = f.s[0]; f.v.m = t5467;
		f.v.i = 0;
	},
	function (e,f) {
		f.pc=5;
		if (!(((f.v.i)) < ((builtin__count ((f.v["this"]).music))))) f.pc=4;
	},
	function (e,f) {
		f.pc=7;
		e.mcall (4, f.v.m, "add_item", (["set_music:", "&lt;none&gt;"]));
	},
/*5*/	function (e,f) { e.mcall (4, f.v.m, "add_item", ([("set_music:") + ((((f.v["this"]).music)[(f.v.i)]).rowid), (((f.v["this"]).music)[(f.v.i)]).name])); },
	function (e,f) {
		f.pc=3;
		e.php_push_var_lvalue (0, "i");
		e.php_postinc (1);
	},
	function (e,f) { e.mcall (4, f.v.menu, "add_submenu", (["Choose music", f.v.m])); },
null	];

;
	c.pargs__context_menu =  ["serviceitem","cmd"];
	c.pinst__context_menu =  [
/*0*/	function (e,f) {
		f.v.matches = ([]);
		if (builtin__preg_match ("/^set_music:(.*)$/",f.v.cmd,f.v.matches)) f.pc=1; else f.pc=-1;
	},
	function (e,f) { e.mcall (4, f.v.serviceitem, "set_property", (["tune", (f.v.matches)[(1)]])); },
null	];

;
};
genericsong.init_methods (genericsong);
rpcclass.setup_class (genericsong, "genericsong",0, (["name","title","subtitle","author","copyright","bookname","songbookEntry","text","tune","wordsChecked","musicInFolders","keywords","music","ssid","ccl","url","import_date","rating","blocks","block_order","history","rowid","listeners"]), ([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2]));
function songitem () { this.do_construct (arguments); }
songitem.init_methods = function (c) {
	genericsong.init_methods(c);
	var cp = c.prototype;
	c.args__itemtype = c.pargs__itemtype =  [];
	c.inst__itemtype = c.pinst__itemtype =  [
/*0*/	function (e,f) { e.return_pop ("songs"); },
null	];

;
	c.args__add_options = c.pargs__add_options =  [];
	c.inst__add_options = c.pinst__add_options =  [
/*0*/	function (e,f) {
		f.v.fields = ([]);
		f.v.fields[f.v.fields.length] = (["Add Song", ""]);
		e.return_pop (f.v.fields);
	},
null	];

;
	c.args__gif = c.pargs__gif =  [];
	c.inst__gif = c.pinst__gif =  [
/*0*/	function (e,f) { e.return_pop ("tableitem-songs.gif"); },
null	];

;
	c.args__service_builder_tag = c.pargs__service_builder_tag =  [];
	c.inst__service_builder_tag = c.pinst__service_builder_tag =  [
/*0*/	function (e,f) { e.return_pop ("Song: "); },
null	];

;
	c.args__create_new = c.pargs__create_new =  [];
	c.inst__create_new = c.pinst__create_new =  [
/*0*/	function (e,f) { e.smcall (2, songitem,"create_new_generic", (["Song", "songitem"])); },
	function (e,f) { var t5473 = f.s[0]; e.return_pop (t5473); },
null	];

;
};
songitem.init_methods (songitem);
rpcclass.setup_class (songitem, "songitem",0, (["name","title","subtitle","author","copyright","bookname","songbookEntry","text","tune","wordsChecked","musicInFolders","keywords","music","ssid","ccl","url","import_date","rating","blocks","block_order","history","rowid","listeners"]), ([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2]));
function ccli () { this.do_construct (arguments); }
ccli.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
};
ccli.init_methods (ccli);
rpcclass.setup_class (ccli, "ccli",0, (["listeners"]), ([2]));
function serviceItemTableLiturgy () { this.do_construct (arguments); }
serviceItemTableLiturgy.init_methods = function (c) {
	genericliturgy.init_methods(c);
	var cp = c.prototype;
	c.args__itemtype = c.pargs__itemtype =  [];
	c.inst__itemtype = c.pinst__itemtype =  [
/*0*/	function (e,f) { e.return_pop ("liturgy"); },
null	];

;
	c.args__add_options = c.pargs__add_options =  [];
	c.inst__add_options = c.pinst__add_options =  [
/*0*/	function (e,f) { e.smcall (1, serviceItemTableLiturgy,"add_generic_options", (["Liturgy"])); },
	function (e,f) {
		var t5475 = f.s[0]; f.v.fields = t5475;
		f.v.fields[f.v.fields.length] = (["Add Lord's Prayer", "Lord's Prayer"]);
		e.return_pop (f.v.fields);
	},
null	];

;
	c.args__create_new = c.pargs__create_new =  [];
	c.inst__create_new = c.pinst__create_new =  [
/*0*/	function (e,f) { e.smcall (2, serviceItemTableLiturgy,"create_new_generic", (["Liturgy", "serviceItemtableLiturgy"])); },
	function (e,f) { var t5477 = f.s[0]; e.return_pop (t5477); },
null	];

;
	c.args__gif = c.pargs__gif =  [];
	c.inst__gif = c.pinst__gif =  [
/*0*/	function (e,f) { e.return_pop ("tableitem-liturgy.gif"); },
null	];

;
	c.args__service_builder_tag = c.pargs__service_builder_tag =  [];
	c.inst__service_builder_tag = c.pinst__service_builder_tag =  [
/*0*/	function (e,f) { e.return_pop ("Liturgy: "); },
null	];

;
};
serviceItemTableLiturgy.init_methods (serviceItemTableLiturgy);
rpcclass.setup_class (serviceItemTableLiturgy, "serviceItemTableLiturgy",0, (["name","notes","text","history","rowid","listeners"]), ([0,0,0,0,0,2]));
function serviceItemTableAnthem () { this.do_construct (arguments); }
serviceItemTableAnthem.init_methods = function (c) {
	genericsong.init_methods(c);
	var cp = c.prototype;
	c.args__gif = c.pargs__gif =  [];
	c.inst__gif = c.pinst__gif =  [
/*0*/	function (e,f) { e.return_pop ("tableitem-anthems.gif"); },
null	];

;
	c.args__service_builder_tag = c.pargs__service_builder_tag =  [];
	c.inst__service_builder_tag = c.pinst__service_builder_tag =  [
/*0*/	function (e,f) { e.return_pop ("Anthem: "); },
null	];

;
	c.args__itemtype = c.pargs__itemtype =  [];
	c.inst__itemtype = c.pinst__itemtype =  [
/*0*/	function (e,f) { e.return_pop ("anthems"); },
null	];

;
	c.args__add_options = c.pargs__add_options =  [];
	c.inst__add_options = c.pinst__add_options =  [
/*0*/	function (e,f) { e.smcall (1, serviceItemTableAnthem,"add_generic_options", (["Anthem"])); },
	function (e,f) { var t5478 = f.s[0]; e.return_pop (t5478); },
null	];

;
	c.args__create_new = c.pargs__create_new =  [];
	c.inst__create_new = c.pinst__create_new =  [
/*0*/	function (e,f) { e.smcall (2, serviceItemTableAnthem,"create_new_generic", (["Anthem", "serviceItemTableAnthem"])); },
	function (e,f) { var t5479 = f.s[0]; e.return_pop (t5479); },
null	];

;
};
serviceItemTableAnthem.init_methods (serviceItemTableAnthem);
rpcclass.setup_class (serviceItemTableAnthem, "serviceItemTableAnthem",0, (["name","title","author","copyright","text","subtitle","bookname","songbookEntry","tune","wordsChecked","musicInFolders","keywords","music","ssid","ccl","url","import_date","rating","blocks","block_order","history","rowid","listeners"]), ([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2]));
function serviceItemTableCreed () { this.do_construct (arguments); }
serviceItemTableCreed.init_methods = function (c) {
	genericliturgy.init_methods(c);
	var cp = c.prototype;
	c.args__itemtype = c.pargs__itemtype =  [];
	c.inst__itemtype = c.pinst__itemtype =  [
/*0*/	function (e,f) { e.return_pop ("creeds"); },
null	];

;
	c.args__gif = c.pargs__gif =  [];
	c.inst__gif = c.pinst__gif =  [
/*0*/	function (e,f) { e.return_pop ("tableitem-creeds.gif"); },
null	];

;
	c.args__service_builder_tag = c.pargs__service_builder_tag =  [];
	c.inst__service_builder_tag = c.pinst__service_builder_tag =  [
/*0*/	function (e,f) { e.return_pop ("Creed: "); },
null	];

;
	c.args__fetch_by_name = c.pargs__fetch_by_name =  ["name"];
	c.inst__fetch_by_name = c.pinst__fetch_by_name =  [
/*0*/	function (e,f) { e.return_pop (null); },
null	];

;
	c.args__add_options = c.pargs__add_options =  [];
	c.inst__add_options = c.pinst__add_options =  [
/*0*/	function (e,f) { e.smcall (1, serviceItemTableCreed,"add_generic_options", (["Creed"])); },
	function (e,f) {
		var t5481 = f.s[0]; f.v.fields = t5481;
		f.v.fields[f.v.fields.length] = (["Add Creed 3 We", "Cr 3 We"]);
		e.return_pop (f.v.fields);
	},
null	];

;
	c.args__create_new = c.pargs__create_new =  [];
	c.inst__create_new = c.pinst__create_new =  [
/*0*/	function (e,f) { e.smcall (2, serviceItemTableCreed,"create_new_generic", (["Creed", "serviceItemtableCreed"])); },
	function (e,f) { var t5483 = f.s[0]; e.return_pop (t5483); },
null	];

;
};
serviceItemTableCreed.init_methods (serviceItemTableCreed);
rpcclass.setup_class (serviceItemTableCreed, "serviceItemTableCreed",0, (["name","notes","text","history","rowid","listeners"]), ([0,0,0,0,0,2]));
function serviceItemTableConfession () { this.do_construct (arguments); }
serviceItemTableConfession.init_methods = function (c) {
	genericliturgy.init_methods(c);
	var cp = c.prototype;
	c.args__itemtype = c.pargs__itemtype =  [];
	c.inst__itemtype = c.pinst__itemtype =  [
/*0*/	function (e,f) { e.return_pop ("confessions"); },
null	];

;
	c.args__gif = c.pargs__gif =  [];
	c.inst__gif = c.pinst__gif =  [
/*0*/	function (e,f) { e.return_pop ("tableitem-confessions.gif"); },
null	];

;
	c.args__service_builder_tag = c.pargs__service_builder_tag =  [];
	c.inst__service_builder_tag = c.pinst__service_builder_tag =  [
/*0*/	function (e,f) { e.return_pop ("Confession: "); },
null	];

;
	c.args__create_new = c.pargs__create_new =  [];
	c.inst__create_new = c.pinst__create_new =  [
/*0*/	function (e,f) { e.smcall (2, serviceItemTableConfession,"create_new_generic", (["Confession", "serviceItemtableConfession"])); },
	function (e,f) { var t5484 = f.s[0]; e.return_pop (t5484); },
null	];

;
	c.args__add_options = c.pargs__add_options =  [];
	c.inst__add_options = c.pinst__add_options =  [
/*0*/	function (e,f) { e.smcall (1, serviceItemTableConfession,"add_generic_options", (["Confession"])); },
	function (e,f) { var t5485 = f.s[0]; e.return_pop (t5485); },
null	];

;
};
serviceItemTableConfession.init_methods (serviceItemTableConfession);
rpcclass.setup_class (serviceItemTableConfession, "serviceItemTableConfession",0, (["name","notes","text","history","rowid","listeners"]), ([0,0,0,0,0,2]));
function mediafile () { this.do_construct (arguments); }
mediafile.init_methods = function (c) {
	dbclass.init_methods(c);
	var cp = c.prototype;
	c.args__release_state_names = c.pargs__release_state_names =  [];
	c.inst__release_state_names = c.pinst__release_state_names =  [
/*0*/	function (e,f) { e.return_pop ((["Private", "Public", "Request Publish", "Waiting Permission", "Hidden"])); },
null	];

;
	c.args__get_files_for_event =  ["mevent"];
	c.inst__get_files_for_event =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_function_async", (["mediafile", "get_files_for_event", ([f.v.mevent])])); },
	function (e,f) { var t5486 = f.s[0]; e.return_pop (t5486); },
null	];

;
	c.args__is_private_media =  ["mevent"];
	c.inst__is_private_media =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_function_async", (["mediafile", "is_private_media", ([f.v.mevent])])); },
	function (e,f) { var t5487 = f.s[0]; e.return_pop (t5487); },
null	];

;
	c.pargs__render_launch_link =  [];
	c.pinst__render_launch_link =  [
/*0*/	function (e,f) { if (builtin__preg_match ("/\\.mp3$/",(f.v["this"]).filename)) f.pc=21; else f.pc=22; },
	function (e,f) {
		f.v.fname = (f.v["this"]).filename;
		if (((builtin__substr (f.v.fname,0,1))) != (("/"))) f.pc=2; else f.pc=3;
	},
	function (e,f) { f.v.fname = ("/") + (f.v.fname); },
	function (e,f) { if (builtin__preg_match ("/\\.mp3$/",(f.v["this"]).filename)) f.pc=7; else f.pc=8; },
	function (e,f) {
		f.pc=12;
		window.__outbuffer += "\n<a href=\"/churchbuilder/xspf.php?file=";
		window.__outbuffer += (encodeURIComponent (f.v.fname));
		window.__outbuffer += "\">Play</a>\n";
	},
/*5*/	function (e,f) { if (builtin__preg_match ("/\\.wma/",builtin__strtolower ((f.v["this"]).filename))) f.pc=6; else f.pc=12; },
	function (e,f) {
		f.pc=12;
		window.__outbuffer += "\n<a href=\"/churchbuilder/asx.php?file=";
		window.__outbuffer += (encodeURIComponent (f.v.fname));
		window.__outbuffer += "\">Play</a>\n";
	},
	function (e,f) {
		f.pc=11;
		f.s[0] = true;
	},
	function (e,f) { if (builtin__preg_match ("/\\.mpg$/",(f.v["this"]).filename)) f.pc=9; else f.pc=10; },
	function (e,f) {
		f.pc=11;
		f.s[0] = true;
	},
/*10*/	function (e,f) { f.s[0] = builtin__preg_match ("/\\.avi$/",(f.v["this"]).filename); },
	function (e,f) { var t5490 = f.s[0]; if (t5490) f.pc=4; else f.pc=5; },
	function (e,f) {
		window.__outbuffer += "\n| <a href=\"/churchbuilder/download.php?file=";
		window.__outbuffer += (encodeURIComponent (f.v.fname));
		window.__outbuffer += "\">Download</a>\n";
		if (builtin__preg_match ("/\\.mpg$/",(f.v["this"]).filename)) f.pc=13; else f.pc=16;
	},
	function (e,f) {
		f.s[0] = "\">Download audio</a>";
		e.smcall (4, page_dispatcher,"makelink", (["mediafile", "extract_audio", ({fname:f.v.fname, rate:"full"})]));
	},
	function (e,f) {
		var t5491 = f.s[1]; var t5492 = f.s[0]; 
		window.__outbuffer += (" | <a href=\"") + ("" + (t5491) + (t5492));
		f.s[0] = "\">Download audio 32kbps</a>";
		e.smcall (4, page_dispatcher,"makelink", (["mediafile", "extract_audio", ({fname:f.v.fname, rate:"low"})]));
	},
/*15*/	function (e,f) {
		var t5493 = f.s[1]; var t5494 = f.s[0]; 
		window.__outbuffer += (" | <a href=\"") + ("" + (t5493) + (t5494));
	},
	function (e,f) { if ((((f.v["this"]).is_live)) != ((0))) f.pc=17; else f.pc=18; },
	function (e,f) {
		f.pc=-1;
		window.__outbuffer += "\n| <a href=\"/churchbuilder/xspf.php?file=";
		window.__outbuffer += (encodeURIComponent (("/churchbuilder/livestream.php?filename=") + ((encodeURIComponent (f.v.fname)))));
		window.__outbuffer += "\" style=\"background:yellow\">Play Live</a>\n";
	},
	function (e,f) { if (builtin__preg_match ("/\\.mp3$/",(f.v["this"]).filename)) f.pc=19; else f.pc=-1; },
	function (e,f) {
		f.pc=-1;
		window.__outbuffer += "\nor <object type=\"application/x-shockwave-flash\" data=\"/churchbuilder/player_mp3_maxi.swf\" width=\"200\" height=\"20\">\n<param name=\"movie\" value=\"/churchbuilder/player_mp3_maxi.swf\" />\n<param name=\"bgcolor\" value=\"#ffffff\" />\n<param name=\"FlashVars\" value=\"mp3=";
		window.__outbuffer += (encodeURIComponent (f.v.fname));
		window.__outbuffer += "&amp;showstop=1&amp;showvolume=1\" />\n</object>\n";
	},
/*20*/	function (e,f) {
		f.pc=-1;
		window.__outbuffer += "\n<a target=\"_new\" href=\"";
		window.__outbuffer += ("/") + ((f.v["this"]).filename);
		window.__outbuffer += "\">View</a><br/>\n";
	},
	function (e,f) {
		f.pc=27;
		f.s[0] = true;
	},
	function (e,f) { if (builtin__preg_match ("/\\.mpg$/",(f.v["this"]).filename)) f.pc=23; else f.pc=24; },
	function (e,f) {
		f.pc=27;
		f.s[0] = true;
	},
	function (e,f) { if (builtin__preg_match ("/\\.wma$/",(f.v["this"]).filename)) f.pc=25; else f.pc=26; },
/*25*/	function (e,f) {
		f.pc=27;
		f.s[0] = true;
	},
	function (e,f) { f.s[0] = builtin__preg_match ("/\\.avi$/",(f.v["this"]).filename); },
	function (e,f) { var t5495 = f.s[0]; if (t5495) f.pc=1; else f.pc=20; },
null	];

;
	c.pargs__do_delete =  [];
	c.pinst__do_delete =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["do_delete", ([])])); },
	function (e,f) { var t5496 = f.s[0]; e.return_pop (t5496); },
null	];

;
	c.pargs__save_properties =  [];
	c.pinst__save_properties =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["save_properties", ([])])); },
	function (e,f) { var t5497 = f.s[0]; e.return_pop (t5497); },
null	];

;
	c.pargs__edit =  [];
	c.pinst__edit =  [
/*0*/	function (e,f) {
		f.v.fields = ([({name:"notes", type:"text", label:"Notes", width:300, focus:true, value:(f.v["this"]).notes}), ({name:"expiry", type:"date", label:"Expiry", value:(f.v["this"]).expiry})]);
		f.v.pop = new popupform;
		e.mcall (6, f.v.pop, "initialise", ([0, 0, "Edit Media File Properties", f.v.fields]));
	},
	function (e,f) { e.mcall (2, f.v.pop, "open", ([])); },
	function (e,f) { e.mcall (2, f.v.pop, "run", ([])); },
	function (e,f) {
		var t5501 = f.s[0]; f.v.event = t5501;
		if ((((f.v.event).action)) == (("OK"))) f.pc=4; else f.pc=6;
	},
	function (e,f) { e.mcall (2, f.v.pop, "get_form_fields", ([])); },
/*5*/	function (e,f) {
		var t5503 = f.s[0]; f.v.values = t5503;
		f.v["this"].notes = (f.v.values).notes;
		f.v["this"].expiry = (f.v.values).expiry;
		e.mcall (2, f.v["this"], "save_properties", ([]));
	},
	function (e,f) { e.mcall (2, f.v.pop, "close", ([])); },
null	];

;
	c.pargs__save_release_state =  [];
	c.pinst__save_release_state =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["save_release_state", ([])])); },
	function (e,f) { var t5506 = f.s[0]; e.return_pop (t5506); },
null	];

;
	c.pargs__set_publish =  [];
	c.pinst__set_publish =  [
/*0*/	function (e,f) { e.smcall (0, mediafile,"release_state_names", ([])); },
	function (e,f) {
		var t5508 = f.s[0]; f.v.rsn = t5508;
		e.smcall (1, popupmenu,"quick", ([f.v.rsn]));
	},
	function (e,f) {
		var t5510 = f.s[0]; f.v.m = t5510;
		if (((f.v.m)) !== ((null))) f.pc=3; else f.pc=-1;
	},
	function (e,f) { f.v.i = 0; },
	function (e,f) {
		f.pc=6;
		if (!(((f.v.rsn)[(f.v.i)]) !== undefined)) f.pc=5;
	},
/*5*/	function (e,f) {
		f.pc=-1;
		e.mcall (2, f.v["this"], "save_release_state", ([]));
	},
	function (e,f) { if (((f.v.m)) == (((f.v.rsn)[(f.v.i)]))) f.pc=7; else f.pc=8; },
	function (e,f) {
		f.pc=5;
		f.v["this"].release_state = f.v.i;
	},
	function (e,f) {
		f.pc=4;
		e.php_push_var_lvalue (0, "i");
		e.php_postinc (1);
	},
null	];

;
};
mediafile.init_methods (mediafile);
rpcclass.setup_class (mediafile, "mediafile",0, (["mediaevent","filename","notes","release_state","expiry","is_live","rowid","listeners"]), ([0,0,0,0,0,0,0,2]));
function mediaevent () { this.do_construct (arguments); }
mediaevent.init_methods = function (c) {
	dbclass.init_methods(c);
	var cp = c.prototype;
	c.args__is_media_manager = c.pargs__is_media_manager =  [];
	c.inst__is_media_manager = c.pinst__is_media_manager =  [
/*0*/	function (e,f) {
		f.pc=3;
		e.smcall (1, person,"i_match_query", (["Web\\Media Managers"]));
	},
	function (e,f) {
		f.pc=4;
		f.s[0] = true;
	},
	function (e,f) {
		f.pc=4;
		e.smcall (0, person,"is_webmaster", ([]));
	},
	function (e,f) { var t5514 = f.s[0]; if (t5514) f.pc=1; else f.pc=2; },
	function (e,f) { var t5515 = f.s[0]; e.return_pop (t5515); },
null	];

;
	c.pargs__media_change =  ["arg"];
	c.pinst__media_change =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "send_msg", (["update_notification", 0])); },
null	];

;
	c.pargs__update_metadata_cache =  [];
	c.pinst__update_metadata_cache =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["update_metadata_cache", ([])])); },
	function (e,f) { var t5516 = f.s[0]; e.return_pop (t5516); },
null	];

;
	c.pargs__handle_uploaded_media =  ["ul","files"];
	c.pinst__handle_uploaded_media =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["handle_uploaded_media", ([f.v.ul, f.v.files])])); },
	function (e,f) { var t5517 = f.s[0]; e.return_pop (t5517); },
null	];

;
	c.pargs__upload_media =  ["el","arg","ev"];
	c.pinst__upload_media =  [
/*0*/	function (e,f) {
		f.pc=3;
		f.v.ul = new uploader;
		e.mcall (2, f.v.ul, "run", ([]));
	},
	function (e,f) { e.mcall (2, f.v.ul, "get_file_info", ([])); },
	function (e,f) {
		f.pc=-1;
		var t5520 = f.s[0]; f.v.files = t5520;
		e.mcall (4, f.v["this"], "handle_uploaded_media", ([f.v.ul, f.v.files]));
	},
	function (e,f) { var t5521 = f.s[0]; if (t5521) f.pc=1; else f.pc=-1; },
null	];

;
	c.pargs__update_metadata =  ["el","arg","ev"];
	c.pinst__update_metadata =  [
/*0*/	function (e,f) { e.mcall (2, f.v["this"], "update_metadata_cache", ([])); },
	function (e,f) { e.smcall (2, browser,"reload", ([([]), ({})])); },
null	];

;
	c.pargs__notify_change =  [];
	c.pinst__notify_change =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["notify_change", ([])])); },
	function (e,f) { var t5522 = f.s[0]; e.return_pop (t5522); },
null	];

;
	c.pargs__delete_media =  ["el","file","ev"];
	c.pinst__delete_media =  [
/*0*/	function (e,f) {
		f.pc=3;
		e.smcall (1, popupokcancel,"run", ([("Are you sure you want to delete ") + ("" + ((f.v.file).notes) + ("?"))]));
	},
	function (e,f) { e.mcall (2, f.v.file, "do_delete", ([])); },
	function (e,f) {
		f.pc=-1;
		e.mcall (2, f.v["this"], "notify_change", ([]));
	},
	function (e,f) { var t5523 = f.s[0]; if (t5523) f.pc=1; else f.pc=-1; },
null	];

;
	c.pargs__edit_media =  ["el","file","ev"];
	c.pinst__edit_media =  [
/*0*/	function (e,f) { e.mcall (2, f.v.file, "edit", ([])); },
	function (e,f) { e.mcall (2, f.v["this"], "notify_change", ([])); },
null	];

;
	c.pargs__set_publish =  ["el","file","ev"];
	c.pinst__set_publish =  [
/*0*/	function (e,f) { e.mcall (2, f.v.file, "set_publish", ([])); },
	function (e,f) { e.mcall (2, f.v["this"], "notify_change", ([])); },
null	];

;
	c.pargs__render_play_list_body =  [];
	c.pinst__render_play_list_body =  [
/*0*/	function (e,f) { e.smcall (1, mediafile,"get_files_for_event", ([f.v["this"]])); },
	function (e,f) {
		f.pc=3;
		var t5525 = f.s[0]; f.v.files = t5525;
		f.s[0] = 0;
		e.smcall (1, person,"my_uid", ([]));
	},
	function (e,f) {
		f.pc=7;
		window.__outbuffer += "There is private media available for this event, please log in.";
	},
	function (e,f) {
		var t5526 = f.s[1]; var t5527 = f.s[0]; 
		if (((t5526)) == ((t5527))) f.pc=4; else f.pc=5;
	},
	function (e,f) {
		f.pc=6;
		e.smcall (1, mediafile,"is_private_media", ([f.v["this"]]));
	},
/*5*/	function (e,f) { f.s[0] = false; },
	function (e,f) { var t5528 = f.s[0]; if (t5528) f.pc=2; else f.pc=7; },
	function (e,f) {
		window.__outbuffer += "<table>";
		f.v._k346 = e.enumkeys (f.v.files);
	},
	function (e,f) {
		f.pc=10;
		if (!((f.v._k346).length)) f.pc=9;
	},
	function (e,f) {
		f.pc=-1;
		window.__outbuffer += "</table>";
	},
/*10*/	function (e,f) {
		f.v._i347 = (f.v._k346).shift();
		f.v.file = (f.v.files)[(f.v._i347)];
		window.__outbuffer += "<tr>";
		window.__outbuffer += ("<td><b>") + ("" + ((f.v.file).notes) + ("</b></td>"));
		window.__outbuffer += "<td>";
		e.mcall (2, f.v.file, "render_launch_link", ([]));
	},
	function (e,f) {
		f.pc=19;
		window.__outbuffer += "</td>";
		e.smcall (0, mediaevent,"is_media_manager", ([]));
	},
	function (e,f) {
		f.s[0] = "\">Delete</a></td>";
		e.mcall (5, f.v["this"], "render_start", (["delete_media", f.v.file]));
	},
	function (e,f) {
		var t5532 = f.s[1]; var t5533 = f.s[0]; 
		window.__outbuffer += ("<td> | <a href=\"#\" onclick=\"") + ("" + (t5532) + (t5533));
		f.s[0] = "\">Edit</a></td>";
		e.mcall (5, f.v["this"], "render_start", (["edit_media", f.v.file]));
	},
	function (e,f) {
		var t5534 = f.s[1]; var t5535 = f.s[0]; 
		window.__outbuffer += ("<td> | <a href=\"#\" onclick=\"") + ("" + (t5534) + (t5535));
		window.__outbuffer += "<td>";
		e.smcall (0, mediafile,"release_state_names", ([]));
	},
/*15*/	function (e,f) {
		var t5537 = f.s[0]; f.v.rsn = t5537;
		f.s[0] = ("\">") + ("" + ((f.v.rsn)[((f.v.file).release_state)]) + ("</a>"));
		e.mcall (5, f.v["this"], "render_start", (["set_publish", f.v.file]));
	},
	function (e,f) {
		var t5538 = f.s[1]; var t5539 = f.s[0]; 
		window.__outbuffer += (" | <a href=\"#\" onclick=\"") + ("" + (t5538) + (t5539));
		if ((((f.v.file).expiry)) < ((builtin__mktime (0,0,0,1,1,2038)))) f.pc=17; else f.pc=18;
	},
	function (e,f) { window.__outbuffer += (", Expires ") + (builtin__date ("dS M Y",(f.v.file).expiry)); },
	function (e,f) {
		f.pc=20;
		window.__outbuffer += "</td>";
	},
	function (e,f) { var t5540 = f.s[0]; if (t5540) f.pc=12; else f.pc=20; },
/*20*/	function (e,f) {
		f.pc=8;
		window.__outbuffer += "</tr>";
	},
null	];

;
	c.args__edit_description = c.pargs__edit_description =  ["el","arg","ev"];
	c.inst__edit_description = c.pinst__edit_description =  [
/*0*/	function (e,f) { e.smcall (0, medialib_editor,"create", ([])); },
	function (e,f) {
		var t5542 = f.s[0]; f.v.ed = t5542;
		e.mcall (2, f.v.ed, "run", ([]));
	},
null	];

;
};
mediaevent.init_methods (mediaevent);
rpcclass.setup_class (mediaevent, "mediaevent",0, (["event","atype","author_name","author_email","series","theme","passage","rowid","listeners"]), ([0,0,0,0,0,0,0,0,2]));
function medialib_editor () { this.do_construct (arguments); }
medialib_editor.codegroup = "richtext_editor";
medialib_editor.init_methods = function (c) {
	simple_richtext_editor.init_methods(c);
	var cp = c.prototype;
	c.args__create =  null;
};
medialib_editor.init_methods (medialib_editor);
rpcclass.setup_class (medialib_editor, "medialib_editor",0, (["uniq","el","epel","renderer","divid","need_select_all","pop","editable_html","it","groups","node_list","actions_list","monitor_list","text_node_list","listeners"]), ([0,2,2,0,0,0,2,0,2,0,0,0,0,2,2]));
function activityType () { this.do_construct (arguments); }
activityType.init_methods = function (c) {
	dbclass.init_methods(c);
	var cp = c.prototype;
	c.pargs__is_owner =  [];
	c.pinst__is_owner =  [
/*0*/	function (e,f) { e.return_pop ((f.v["this"]).i_am_owner); },
null	];

;
	c.pargs__is_viewer =  [];
	c.pinst__is_viewer =  [
/*0*/	function (e,f) { e.return_pop ((f.v["this"]).i_am_viewer); },
null	];

;
	c.pargs__is_reader =  [];
	c.pinst__is_reader =  [
/*0*/	function (e,f) { e.return_pop ((f.v["this"]).i_am_reader); },
null	];

;
	c.pargs__is_writer =  [];
	c.pinst__is_writer =  [
/*0*/	function (e,f) { e.return_pop ((f.v["this"]).i_am_writer); },
null	];

;
	c.pargs__get_fspec_by_name =  ["fsname"];
	c.pinst__get_fspec_by_name =  [
/*0*/	function (e,f) { if ((((f.v["this"]).fieldspecs_by_name)[(f.v.fsname)]) !== undefined) f.pc=1; else f.pc=2; },
	function (e,f) { e.return_pop (((f.v["this"]).fieldspecs_by_name)[(f.v.fsname)]); },
	function (e,f) { e.return_pop (null); },
null	];

;
	c.args__get_owned_atypes = c.pargs__get_owned_atypes =  [];
	c.inst__get_owned_atypes = c.pinst__get_owned_atypes =  [
/*0*/	function (e,f) {
		e.php_push_static_var (1, activityType,"owned_atypes");
		var t5544 = f.s[1]; 
		if (((t5544)) === ((null))) f.pc=1; else f.pc=2;
	},
	function (e,f) { e.smcall (0, activityType,"preload", ([])); },
	function (e,f) {
		e.php_push_static_var (0, activityType,"owned_atypes");
		var t5545 = f.s[0]; e.return_pop (t5545);
	},
null	];

;
	c.args__get_readable_atypes = c.pargs__get_readable_atypes =  [];
	c.inst__get_readable_atypes = c.pinst__get_readable_atypes =  [
/*0*/	function (e,f) {
		e.php_push_static_var (1, activityType,"readable_atypes");
		var t5546 = f.s[1]; 
		if (((t5546)) === ((null))) f.pc=1; else f.pc=2;
	},
	function (e,f) { e.smcall (0, activityType,"preload", ([])); },
	function (e,f) {
		e.php_push_static_var (0, activityType,"readable_atypes");
		var t5547 = f.s[0]; e.return_pop (t5547);
	},
null	];

;
	c.args__get_all_atypes = c.pargs__get_all_atypes =  [];
	c.inst__get_all_atypes = c.pinst__get_all_atypes =  [
/*0*/	function (e,f) {
		e.php_push_static_var (1, activityType,"all_atypes");
		var t5548 = f.s[1]; 
		if (((t5548)) === ((null))) f.pc=1; else f.pc=2;
	},
	function (e,f) { e.smcall (0, activityType,"preload", ([])); },
	function (e,f) {
		e.php_push_static_var (0, activityType,"all_atypes");
		var t5549 = f.s[0]; e.return_pop (t5549);
	},
null	];

;
	c.args__get_by_id = c.pargs__get_by_id =  ["id"];
	c.inst__get_by_id = c.pinst__get_by_id =  [
/*0*/	function (e,f) {
		e.php_push_static_var (1, activityType,"all_atypes_by_id");
		var t5550 = f.s[1]; 
		if (((t5550)) === ((null))) f.pc=1; else f.pc=2;
	},
	function (e,f) { e.smcall (0, activityType,"preload", ([])); },
	function (e,f) {
		e.php_push_static_var (1, activityType,"all_atypes_by_id");
		var t5551 = f.s[1]; 
		if (!(((t5551)[(f.v.id)]) !== undefined)) f.pc=3; else f.pc=4;
	},
	function (e,f) { e.return_pop (null); },
	function (e,f) {
		e.php_push_static_var (1, activityType,"all_atypes_by_id");
		var t5552 = f.s[1]; 
		e.return_pop ((t5552)[(f.v.id)]);
	},
null	];

;
	c.args__get_multiple_by_id = c.pargs__get_multiple_by_id =  ["ids"];
	c.inst__get_multiple_by_id = c.pinst__get_multiple_by_id =  [
/*0*/	function (e,f) {
		e.php_push_static_var (1, activityType,"all_atypes_by_id");
		var t5553 = f.s[1]; 
		if (((t5553)) === ((null))) f.pc=1; else f.pc=2;
	},
	function (e,f) { e.smcall (0, activityType,"preload", ([])); },
	function (e,f) {
		f.v.res = ([]);
		f.v._k348 = e.enumkeys (f.v.ids);
	},
	function (e,f) {
		f.pc=5;
		if (!((f.v._k348).length)) f.pc=4;
	},
	function (e,f) { e.return_pop (f.v.res); },
/*5*/	function (e,f) {
		f.pc=3;
		f.s[0] = f.v._i349 = (f.v._k348).shift();
		f.s[1] = f.v.id = (f.v.ids)[(f.v._i349)];
		e.php_push_static_var (3, activityType,"all_atypes_by_id");
		var t5558 = f.s[3]; 
		f.v.res[f.v.res.length] = (t5558)[(f.v.id)];
	},
null	];

;
	c.args__lookup =  ["name"];
	c.inst__lookup =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_function_async", (["activityType", "lookup", ([f.v.name])])); },
	function (e,f) { var t5560 = f.s[0]; e.return_pop (t5560); },
null	];

;
	c.args__preload = c.pargs__preload =  [];
	c.inst__preload = c.pinst__preload =  [
/*0*/	function (e,f) { /* This is a NOP */ },
null	];

;
	c.pargs__really_do_save =  ["nicename","summary","owners_expr","viewers_expr","readers_expr","writers_expr","fieldspecs","defcounts","default_resources","default_instances"];
	c.pinst__really_do_save =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["really_do_save", ([f.v.nicename, f.v.summary, f.v.owners_expr, f.v.viewers_expr, f.v.readers_expr, f.v.writers_expr, f.v.fieldspecs, f.v.defcounts, f.v.default_resources, f.v.default_instances])])); },
	function (e,f) { var t5561 = f.s[0]; e.return_pop (t5561); },
null	];

;
	c.pargs__do_save =  [];
	c.pinst__do_save =  [
/*0*/	function (e,f) { e.mcall (12, f.v["this"], "really_do_save", ([(f.v["this"]).nicename, (f.v["this"]).summary, (f.v["this"]).owners_expr, (f.v["this"]).viewers_expr, (f.v["this"]).readers_expr, (f.v["this"]).writers_expr, (f.v["this"]).fieldspecs, (f.v["this"]).defcounts, (f.v["this"]).default_resources, (f.v["this"]).default_instances])); },
null	];

;
	c.pargs__allocate_default_resources =  ["act"];
	c.pinst__allocate_default_resources =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["allocate_default_resources", ([f.v.act])])); },
	function (e,f) { var t5562 = f.s[0]; e.return_pop (t5562); },
null	];

;
};
activityType.init_methods (activityType);
rpcclass.setup_class (activityType, "activityType",1, (["name","nicename","owners_expr","viewers_expr","readers_expr","writers_expr","summary","fieldspecs","defcounts","helperclass","default_resources","default_instances","i_am_owner","i_am_viewer","i_am_reader","i_am_writer","fieldspecs_by_name","rowid","listeners"]), ([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2]));
function activityType_admin_fields () { this.do_construct (arguments); }
activityType_admin_fields.codegroup = "activityType_admin";
activityType_admin_fields.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
	c.pargs__edit_row =  null;
	c.pargs__change_count =  null;
	c.pargs__reorder =  null;
	c.pargs__drag_fieldspec =  null;
	c.pargs__do_remove_fieldspec =  null;
	c.pargs__remove_fieldspec =  null;
	c.pargs__get_row_fields =  null;
	c.pargs__insert_row =  null;
};
activityType_admin_fields.init_methods (activityType_admin_fields);
rpcclass.setup_class (activityType_admin_fields, "activityType_admin_fields",0, (["atype","dtm","listeners"]), ([0,0,2]));
function activityType_admin_resource () { this.do_construct (arguments); }
activityType_admin_resource.codegroup = "activityType_admin";
activityType_admin_resource.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
	c.args__create = c.pargs__create =  null;
	c.pargs__as_string =  null;
	c.args__popupobjeditor_fields = c.pargs__popupobjeditor_fields =  null;
};
activityType_admin_resource.init_methods (activityType_admin_resource);
rpcclass.setup_class (activityType_admin_resource, "activityType_admin_resource",0, (["resource","preroll","duration","listeners"]), ([0,0,0,2]));
function activityType_admin_resource_editor () { this.do_construct (arguments); }
activityType_admin_resource_editor.codegroup = "activityType_admin";
activityType_admin_resource_editor.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
	c.pargs__save =  null;
	c.pargs__edit_row =  null;
	c.pargs__remove_resource =  null;
	c.pargs__get_row_fields =  null;
	c.pargs__insert_row =  null;
};
activityType_admin_resource_editor.init_methods (activityType_admin_resource_editor);
rpcclass.setup_class (activityType_admin_resource_editor, "activityType_admin_resource_editor",0, (["atype","dtm","listeners"]), ([0,0,2]));
function activityType_admin_instance () { this.do_construct (arguments); }
activityType_admin_instance.codegroup = "activityType_admin";
activityType_admin_instance.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
	c.pargs__as_text =  null;
	c.args__create = c.pargs__create =  null;
	c.pargs__as_string =  null;
	c.args__popupobjeditor_fields = c.pargs__popupobjeditor_fields =  null;
	c.args__popupobjeditor_create = c.pargs__popupobjeditor_create =  null;
};
activityType_admin_instance.init_methods (activityType_admin_instance);
rpcclass.setup_class (activityType_admin_instance, "activityType_admin_instance",0, (["day","week","offset","time","assoc","is_repeat","listeners"]), ([0,0,0,0,0,0,2]));
function activityType_admin_instance_editor () { this.do_construct (arguments); }
activityType_admin_instance_editor.codegroup = "activityType_admin";
activityType_admin_instance_editor.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
	c.pargs__save =  null;
	c.pargs__edit_row =  null;
	c.pargs__remove =  null;
	c.pargs__get_row_fields =  null;
	c.pargs__insert_row =  null;
};
activityType_admin_instance_editor.init_methods (activityType_admin_instance_editor);
rpcclass.setup_class (activityType_admin_instance_editor, "activityType_admin_instance_editor",0, (["atype","dtm","form","listeners"]), ([0,0,0,2]));
function activityType_admin () { this.do_construct (arguments); }
activityType_admin.codegroup = "activityType_admin";
activityType_admin.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
	c.pargs__edit =  null;
	c.pargs__do_add_helper =  null;
	c.pargs__add_helper =  null;
	c.args__create_new =  null;
	c.args__choose_act = c.pargs__choose_act =  null;
	c.args__do_fill_defaults =  null;
	c.args__fill_defaults = c.pargs__fill_defaults =  null;
};
activityType_admin.init_methods (activityType_admin);
rpcclass.setup_class (activityType_admin, "activityType_admin",0, (["atype","dtm","listeners"]), ([0,0,2]));
function resource_group () { this.do_construct (arguments); }
resource_group.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
	c.pargs__new_resource_booking =  ["el","arg","ev"];
	c.pinst__new_resource_booking =  [
/*0*/	function (e,f) { e.smcall (5, resource_booking,"new_booking", ([((f.v["this"]).atype).name, ((f.v["this"]).event).rowid, ((f.v["this"]).atype).rowid, ((f.v["this"]).event).datetime, parseInt((((f.v["this"]).event).datetime),10) + parseInt((3600),10)])); },
null	];

;
	c.pargs__render_resource_bookings =  [];
	c.pinst__render_resource_bookings =  [
/*0*/	function (e,f) { e.smcall (2, resource_booking,"search_for_event", ([((f.v["this"]).event).rowid, ((f.v["this"]).atype).rowid])); },
	function (e,f) {
		var t5753 = f.s[0]; f.v.rbs = t5753;
		f.v.need_comma = false;
		f.v._k366 = e.enumkeys (f.v.rbs);
	},
	function (e,f) {
		f.pc=4;
		if (!((f.v._k366).length)) f.pc=3;
	},
	function (e,f) {
		f.pc=10;
		e.mcall (2, (f.v["this"]).atype, "is_owner", ([]));
	},
	function (e,f) {
		f.v._i367 = (f.v._k366).shift();
		f.v.rb = (f.v.rbs)[(f.v._i367)];
		if (f.v.need_comma) f.pc=5; else f.pc=6;
	},
/*5*/	function (e,f) { window.__outbuffer += ",<br/>"; },
	function (e,f) { e.mcall (2, f.v.rb, "render_entry", ([])); },
	function (e,f) {
		f.pc=2;
		f.v.need_comma = true;
	},
	function (e,f) {
		f.s[0] = "\">(+)</a>";
		e.mcall (5, f.v["this"], "render_start", (["new_resource_booking", 0]));
	},
	function (e,f) {
		f.pc=-1;
		var t5759 = f.s[1]; var t5760 = f.s[0]; 
		window.__outbuffer += ("<a href=\"#\" onclick=\"") + ("" + (t5759) + (t5760));
	},
/*10*/	function (e,f) { var t5761 = f.s[0]; if (t5761) f.pc=8; else f.pc=-1; },
null	];

;
	c.pargs__resource_change =  ["arg"];
	c.pinst__resource_change =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "send_msg", (["update_notification", 0])); },
null	];

;
};
resource_group.init_methods (resource_group);
rpcclass.setup_class (resource_group, "resource_group",0, (["event","atype","listeners"]), ([0,0,2]));
function activity () { this.do_construct (arguments); }
activity.init_methods = function (c) {
	dbclass.init_methods(c);
	var cp = c.prototype;
	c.pargs__editor_url =  [];
	c.pinst__editor_url =  [
/*0*/	function (e,f) { e.return_pop (("/churchbuilder/eventBuilder.php?aid=") + ((f.v["this"]).rowid)); },
null	];

;
	c.pargs__nicename =  [];
	c.pinst__nicename =  [
/*0*/	function (e,f) { if (((((f.v["this"]).atype).helperclass)) != ((""))) f.pc=1; else f.pc=4; },
	function (e,f) { e.smcall (3, rpcclass,"call_static_method", ([((f.v["this"]).atype).helperclass, "get_summary", f.v["this"]])); },
	function (e,f) {
		var t5763 = f.s[0]; f.v.res = t5763;
		if (((f.v.res)) != ((""))) f.pc=3; else f.pc=11;
	},
	function (e,f) { e.return_pop (f.v.res); },
	function (e,f) { if (((((f.v["this"]).atype).summary)) != ((null))) f.pc=5; else f.pc=11; },
/*5*/	function (e,f) { e.mcall (4, f.v["this"], "get_field", ([((f.v["this"]).atype).summary, false])); },
	function (e,f) {
		var t5765 = f.s[0]; f.v.f = t5765;
		f.v.xres = "";
		if (((f.v.f)) !== ((null))) f.pc=7; else f.pc=9;
	},
	function (e,f) { e.mcall (2, f.v.f, "as_string", ([])); },
	function (e,f) { var t5768 = f.s[0]; f.v.xres = t5768; },
	function (e,f) { if (((f.v.xres)) != ((""))) f.pc=10; else f.pc=11; },
/*10*/	function (e,f) { e.return_pop (f.v.xres); },
	function (e,f) { e.return_pop (((f.v["this"]).atype).nicename); },
null	];

;
	c.pargs__do_set_repeat =  ["act","ripple"];
	c.pinst__do_set_repeat =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["do_set_repeat", ([f.v.act, f.v.ripple])])); },
	function (e,f) { var t5769 = f.s[0]; e.return_pop (t5769); },
null	];

;
	c.pargs__set_repeat =  ["el","act","ev"];
	c.pinst__set_repeat =  [
/*0*/	function (e,f) { if (((f.v.act)) == ((null))) f.pc=1; else f.pc=2; },
	function (e,f) {
		f.pc=3;
		f.v.msg = "Sure you want to unlink from previous activity?";
		f.v["new"] = null;
	},
	function (e,f) {
		f.v.msg = ("Sure you want to link to ") + ("" + (builtin__date ("H:i",((f.v.act).event).datetime)) + ("?"));
		f.v["new"] = f.v.act;
	},
	function (e,f) {
		f.pc=20;
		e.smcall (1, popupokcancel,"run", ([f.v.msg]));
	},
	function (e,f) {
		f.v.ripple = false;
		if (f.v["new"]) f.pc=5; else f.pc=6;
	},
/*5*/	function (e,f) {
		f.pc=7;
		f.s[0] = "1";
	},
	function (e,f) { f.s[0] = "0"; },
	function (e,f) {
		var t5776 = f.s[0]; f.v.new_flag = t5776;
		if (((f.v["this"]).event).schedule) f.pc=11; else f.pc=16;
	},
	function (e,f) {
		f.pc=10;
		e.smcall (1, popupyesno,"run", (["Do you want this to apply to future activities in the schedule?"]));
	},
	function (e,f) {
		f.pc=18;
		f.v.ripple = true;
	},
/*10*/	function (e,f) { var t5778 = f.s[0]; if (t5778) f.pc=9; else f.pc=18; },
	function (e,f) {
		f.pc=15;
		e.smcall (0, siteauth,"is_webmaster", ([]));
	},
	function (e,f) {
		f.s[0] = f.v.new_flag;
		e.mcall (4, ((f.v["this"]).event).schedule, "repeat_flag", ([(f.v["this"]).atype]));
	},
	function (e,f) {
		f.pc=17;
		var t5779 = f.s[1]; var t5780 = f.s[0]; f.s[0] = ((t5779)) != ((t5780));
	},
	function (e,f) {
		f.pc=17;
		f.s[0] = false;
	},
/*15*/	function (e,f) { var t5781 = f.s[0]; if (t5781) f.pc=12; else f.pc=14; },
	function (e,f) { f.s[0] = false; },
	function (e,f) { var t5782 = f.s[0]; if (t5782) f.pc=8; else f.pc=18; },
	function (e,f) { e.mcall (4, f.v["this"], "do_set_repeat", ([f.v["new"], f.v.ripple])); },
	function (e,f) {
		f.pc=-1;
		e.php_push_static_var (1, window,"location");
		var t5783 = f.s[1]; e.mcall (2, t5783, "reload", ([]));
	},
/*20*/	function (e,f) { var t5784 = f.s[0]; if (t5784) f.pc=4; else f.pc=-1; },
null	];

;
	c.args__find =  ["rowid"];
	c.inst__find =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_function_async", (["activity", "find", ([f.v.rowid])])); },
	function (e,f) { var t5785 = f.s[0]; e.return_pop (t5785); },
null	];

;
	c.pargs__get_fields =  ["fsl","ensure_present"];
	c.pinst__get_fields =  [
/*0*/	function (e,f) { e.smcall (3, field,"get_fields_for_activity", ([f.v.fsl, f.v["this"], f.v.ensure_present])); },
	function (e,f) { var t5786 = f.s[0]; e.return_pop (t5786); },
null	];

;
	c.pargs__get_field =  ["fs","ensure_present"];
	c.pinst__get_field =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "get_fields", ([([f.v.fs]), f.v.ensure_present])); },
	function (e,f) {
		var t5788 = f.s[0]; f.v.f_list = t5788;
		e.return_pop ((f.v.f_list)[(0)]);
	},
null	];

;
};
activity.init_methods (activity);
rpcclass.setup_class (activity, "activity",1, (["event","atype","repeatof","master","rowid","listeners"]), ([0,0,0,0,0,2]));
function activitybookingtemplate () { this.do_construct (arguments); }
activitybookingtemplate.init_methods = function (c) {
	dbclass.init_methods(c);
	var cp = c.prototype;
	c.pargs__is_admin =  [];
	c.pinst__is_admin =  [
/*0*/	function (e,f) {
		f.pc=3;
		e.smcall (1, person,"i_match_expr", ([((f.v["this"]).config).admins]));
	},
	function (e,f) {
		f.pc=4;
		f.s[0] = true;
	},
	function (e,f) {
		f.pc=4;
		e.smcall (0, person,"is_webmaster", ([]));
	},
	function (e,f) { var t5789 = f.s[0]; if (t5789) f.pc=1; else f.pc=2; },
	function (e,f) { var t5790 = f.s[0]; e.return_pop (t5790); },
null	];

;
	c.pargs__ref_prefix =  [];
	c.pinst__ref_prefix =  [
/*0*/	function (e,f) { if ((((f.v["this"]).config).ref_prefix) !== undefined) f.pc=1; else f.pc=2; },
	function (e,f) {
		f.pc=3;
		f.s[0] = ((f.v["this"]).config).ref_prefix;
	},
	function (e,f) { f.s[0] = ""; },
	function (e,f) { var t5791 = f.s[0]; e.return_pop (t5791); },
null	];

;
	c.args__is_field_ready = c.pargs__is_field_ready =  ["f","values"];
	c.inst__is_field_ready = c.pinst__is_field_ready =  [
/*0*/	function (e,f) { if (((f.v.f).required) !== undefined) f.pc=20; else f.pc=21; },
	function (e,f) {
		f.v.fname = (f.v.f).name;
		if ((((f.v.f).type)) == (("enum"))) f.pc=2; else f.pc=7;
	},
	function (e,f) { if (!(((f.v.values)[(f.v.fname)]) !== undefined)) f.pc=4; else f.pc=5; },
	function (e,f) { e.return_pop (false); },
	function (e,f) {
		f.pc=6;
		f.s[0] = true;
	},
/*5*/	function (e,f) { f.s[0] = (((f.v.values)[(f.v.fname)])) == (("")); },
	function (e,f) { var t5793 = f.s[0]; if (t5793) f.pc=3; else f.pc=23; },
	function (e,f) { if ((((f.v.f).type)) == (("text"))) f.pc=13; else f.pc=14; },
	function (e,f) { if (!(((f.v.values)[(f.v.fname)]) !== undefined)) f.pc=10; else f.pc=11; },
	function (e,f) { e.return_pop (false); },
/*10*/	function (e,f) {
		f.pc=12;
		f.s[0] = true;
	},
	function (e,f) { f.s[0] = (((f.v.values)[(f.v.fname)])) == (("")); },
	function (e,f) { var t5794 = f.s[0]; if (t5794) f.pc=9; else f.pc=23; },
	function (e,f) {
		f.pc=19;
		f.s[0] = true;
	},
	function (e,f) { if ((((f.v.f).type)) == (("yesno"))) f.pc=15; else f.pc=16; },
/*15*/	function (e,f) {
		f.pc=19;
		f.s[0] = true;
	},
	function (e,f) { if ((((f.v.f).type)) == (("dn"))) f.pc=17; else f.pc=18; },
	function (e,f) {
		f.pc=19;
		f.s[0] = true;
	},
	function (e,f) { f.s[0] = (((f.v.f).type)) == (("postcode")); },
	function (e,f) { var t5795 = f.s[0]; if (t5795) f.pc=8; else f.pc=23; },
/*20*/	function (e,f) {
		f.pc=22;
		f.s[0] = (((f.v.f).required)) != ((0));
	},
	function (e,f) { f.s[0] = false; },
	function (e,f) { var t5796 = f.s[0]; if (t5796) f.pc=1; else f.pc=23; },
	function (e,f) { e.return_pop (true); },
null	];

;
	c.pargs__do_create_booking =  ["name","email","handle","initial_state"];
	c.pinst__do_create_booking =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["do_create_booking", ([f.v.name, f.v.email, f.v.handle, f.v.initial_state])])); },
	function (e,f) { var t5797 = f.s[0]; e.return_pop (t5797); },
null	];

;
	c.pargs__create_new_booking =  ["name","email","handle","initial_state"];
	c.pinst__create_new_booking =  [
/*0*/	function (e,f) {
		f.v.name_label = "Name";
		if (((f.v.handle)) == ((""))) f.pc=1; else f.pc=2;
	},
	function (e,f) {
		f.pc=3;
		f.s[0] = "0";
	},
	function (e,f) { f.s[0] = "1"; },
	function (e,f) {
		var t5800 = f.s[0]; f.v.name_readonly = t5800;
		f.v.email_label = "Email";
		f.v.fields = ([({name:"name", label:f.v.name_label, type:"text", focus:1, required:"1", readonly:f.v.name_readonly}), ({name:"email", label:f.v.email_label, type:"email", required:"1"}), ({type:"ok"}), ({name:"cancel", type:"button", label:"Cancel", action:"cancel"})]);
		e.smcall (3, form,"create", ([f.v["this"], f.v.fields, ({name:f.v.name, email:f.v.email})]));
	},
	function (e,f) {
		var t5804 = f.s[0]; f.v.f = t5804;
		e.mcall (5, f.v.f, "popup", ([0, 0, "Create Booking"]));
	},
/*5*/	function (e,f) {
		var t5806 = f.s[0]; f.v.values = t5806;
		if (((f.v.values)) === ((null))) f.pc=6; else f.pc=7;
	},
	function (e,f) { f.pc=-1; },
	function (e,f) { e.mcall (6, f.v["this"], "do_create_booking", ([(f.v.values).name, (f.v.values).email, f.v.handle, f.v.initial_state])); },
	function (e,f) {
		var t5808 = f.s[0]; f.v.ab = t5808;
		e.mcall (2, f.v.ab, "editor_url", ([]));
	},
	function (e,f) { e.php_static_method_call (1, browser,"redirect", 1); },
null	];

;
	c.pargs__create_user_booking =  ["el","junk","ev"];
	c.pinst__create_user_booking =  [
/*0*/	function (e,f) {
		f.pc=3;
		e.smcall (0, auth,"logged_in", ([]));
	},
	function (e,f) {
		f.pc=4;
		e.php_push_static_var (1, person,"me");
		var t5810 = f.s[1]; 
		f.v.name = (t5810).nicename;
		e.php_push_static_var (1, person,"me");
		var t5812 = f.s[1]; 
		f.v.email = (t5812).email;
		e.php_push_static_var (1, person,"me");
		var t5814 = f.s[1]; 
		f.v.handle = (t5814).handle;
	},
	function (e,f) {
		f.pc=4;
		f.v.name = "";
		f.v.email = "";
		f.v.handle = "";
	},
	function (e,f) { var t5819 = f.s[0]; if (t5819) f.pc=1; else f.pc=2; },
	function (e,f) { e.mcall (6, f.v["this"], "create_new_booking", ([f.v.name, f.v.email, f.v.handle, 0])); },
null	];

;
	c.pargs__create_admin_booking =  ["el","initial_state","ev"];
	c.pinst__create_admin_booking =  [
/*0*/	function (e,f) { e.smcall (0, person,"lookup", ([])); },
	function (e,f) {
		var t5821 = f.s[0]; f.v.p = t5821;
		if (((f.v.p)) !== ((null))) f.pc=2; else f.pc=3;
	},
	function (e,f) {
		f.pc=4;
		f.v.name = (f.v.p).nicename;
		f.v.email = (f.v.p).email;
		f.v.handle = (f.v.p).handle;
	},
	function (e,f) {
		f.v.name = "";
		f.v.email = "";
		f.v.handle = "";
	},
	function (e,f) { e.mcall (6, f.v["this"], "create_new_booking", ([f.v.name, f.v.email, f.v.handle, f.v.initial_state])); },
null	];

;
	c.pargs__do_import_group =  ["gq"];
	c.pinst__do_import_group =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["do_import_group", ([f.v.gq])])); },
	function (e,f) { var t5828 = f.s[0]; e.return_pop (t5828); },
null	];

;
	c.pargs__import_group =  ["el","arg","ev"];
	c.pinst__import_group =  [
/*0*/	function (e,f) { e.smcall (0, groupquerymenu,"choose_group_or_query_by_menu", ([])); },
	function (e,f) {
		var t5830 = f.s[0]; f.v.gq = t5830;
		if (((f.v.gq)) !== ((null))) f.pc=2; else f.pc=-1;
	},
	function (e,f) { if ((f.v.gq).i_can_read) f.pc=3; else f.pc=5; },
	function (e,f) { e.mcall (3, f.v["this"], "do_import_group", ([f.v.gq])); },
	function (e,f) {
		f.pc=-1;
		e.smcall (2, browser,"reload", ([([]), ({})]));
	},
/*5*/	function (e,f) { e.smcall (1, popupok,"run", (["You don't have access to that group"])); },
null	];

;
	c.pargs__open_booking =  ["el","arg","ev"];
	c.pinst__open_booking =  [
/*0*/	function (e,f) { e.smcall (4, popupeditbox,"run", ([0, 0, "Enter Booking Reference", ""])); },
	function (e,f) {
		var t5832 = f.s[0]; f.v.bref = t5832;
		if (((f.v.bref)) !== ((null))) f.pc=2; else f.pc=-1;
	},
	function (e,f) {
		f.pc=6;
		e.smcall (1, activitybooking,"validate_booking_ref", ([f.v.bref]));
	},
	function (e,f) { e.smcall (1, activitybooking,"editor_url_by_ref", ([f.v.bref])); },
	function (e,f) {
		f.pc=-1;
		e.php_static_method_call (1, browser,"redirect", 1);
	},
/*5*/	function (e,f) {
		f.pc=-1;
		e.smcall (1, popupok,"run", (["Booking not found"]));
	},
	function (e,f) { var t5834 = f.s[0]; if (t5834) f.pc=3; else f.pc=5; },
null	];

;
	c.args__get_all =  [];
	c.inst__get_all =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_function_async", (["activitybookingtemplate", "get_all", ([])])); },
	function (e,f) { var t5835 = f.s[0]; e.return_pop (t5835); },
null	];

;
	c.args__get_all_active =  [];
	c.inst__get_all_active =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_function_async", (["activitybookingtemplate", "get_all_active", ([])])); },
	function (e,f) { var t5836 = f.s[0]; e.return_pop (t5836); },
null	];

;
	c.args__do_create_new_template =  ["name","from"];
	c.inst__do_create_new_template =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_function_async", (["activitybookingtemplate", "do_create_new_template", ([f.v.name, f.v.from])])); },
	function (e,f) { var t5837 = f.s[0]; e.return_pop (t5837); },
null	];

;
	c.args__create_new_template = c.pargs__create_new_template =  ["el","arg","ev"];
	c.inst__create_new_template = c.pinst__create_new_template =  [
/*0*/	function (e,f) { e.smcall (0, menu,"create", ([])); },
	function (e,f) {
		var t5839 = f.s[0]; f.v.menu = t5839;
		e.mcall (4, f.v.menu, "add_item", (["", "Blank"]));
	},
	function (e,f) { e.smcall (0, activitybookingtemplate,"get_all_active", ([])); },
	function (e,f) {
		var t5841 = f.s[0]; f.v.abtl = t5841;
		f.v._k368 = e.enumkeys (f.v.abtl);
	},
	function (e,f) {
		f.pc=6;
		if (!((f.v._k368).length)) f.pc=5;
	},
/*5*/	function (e,f) {
		f.pc=7;
		e.smcall (1, popupmenu,"run", ([f.v.menu]));
	},
	function (e,f) {
		f.pc=4;
		f.s[0] = f.v._i369 = (f.v._k368).shift();
		f.s[1] = f.v.abt = (f.v.abtl)[(f.v._i369)];
		e.mcall (6, f.v.menu, "add_item", ([f.v.abt, ("Copy of ") + ((f.v.abt).name)]));
	},
	function (e,f) {
		var t5846 = f.s[0]; f.v.choice = t5846;
		if (((f.v.choice)) !== ((null))) f.pc=8; else f.pc=-1;
	},
	function (e,f) { e.smcall (4, popupeditbox,"run", ([0, 0, "Event name", ""])); },
	function (e,f) {
		var t5848 = f.s[0]; f.v.name = t5848;
		if (((f.v.name)) !== ((null))) f.pc=14; else f.pc=15;
	},
/*10*/	function (e,f) { e.smcall (2, activitybookingtemplate,"do_create_new_template", ([f.v.name, f.v.choice])); },
	function (e,f) {
		var t5850 = f.s[0]; f.v.abt = t5850;
		if (((f.v.abt)) !== ((null))) f.pc=12; else f.pc=-1;
	},
	function (e,f) { e.mcall (2, f.v.abt, "admin_url", ([])); },
	function (e,f) {
		f.pc=-1;
		e.php_static_method_call (1, browser,"redirect", 1);
	},
	function (e,f) {
		f.pc=16;
		f.s[0] = ((f.v.name)) != ((""));
	},
/*15*/	function (e,f) { f.s[0] = false; },
	function (e,f) { var t5852 = f.s[0]; if (t5852) f.pc=10; else f.pc=-1; },
null	];

;
	c.args__view_retired = c.pargs__view_retired =  ["el","arg","ev"];
	c.inst__view_retired = c.pinst__view_retired =  [
/*0*/	function (e,f) { e.smcall (0, activitybookingtemplate,"overview_url_full", ([])); },
	function (e,f) { e.php_static_method_call (1, browser,"redirect", 1); },
null	];

;
	c.args__overview_url = c.pargs__overview_url =  [];
	c.inst__overview_url = c.pinst__overview_url =  [
/*0*/	function (e,f) { e.smcall (3, page_dispatcher,"makelink", (["activitybookingtemplate", "overview_page", ([])])); },
	function (e,f) { var t5854 = f.s[0]; e.return_pop (t5854); },
null	];

;
	c.args__overview_url_full = c.pargs__overview_url_full =  [];
	c.inst__overview_url_full = c.pinst__overview_url_full =  [
/*0*/	function (e,f) { e.smcall (3, page_dispatcher,"makelink", (["activitybookingtemplate", "overview_page", ({include_retired:"1"})])); },
	function (e,f) { var t5855 = f.s[0]; e.return_pop (t5855); },
null	];

;
	c.pargs__admin_url =  [];
	c.pinst__admin_url =  [
/*0*/	function (e,f) { e.smcall (3, page_dispatcher,"makelink", (["activitybookingtemplateadmin", "admin_page", ({abtid:(f.v["this"]).rowid})])); },
	function (e,f) { var t5856 = f.s[0]; e.return_pop (t5856); },
null	];

;
	c.pargs__booking_url =  [];
	c.pinst__booking_url =  [
/*0*/	function (e,f) { e.smcall (3, page_dispatcher,"makelink", (["activitybookingtemplate", "booking_page", ({abtid:(f.v["this"]).rowid})])); },
	function (e,f) { var t5857 = f.s[0]; e.return_pop (t5857); },
null	];

;
	c.pargs__view_booking =  ["el","act","ev"];
	c.pinst__view_booking =  [
/*0*/	function (e,f) { e.mcall (2, f.v["this"], "booking_url", ([])); },
	function (e,f) { e.php_static_method_call (1, browser,"redirect", 1); },
null	];

;
	c.pargs__download_all_bookings =  ["el","arg","ev"];
	c.pinst__download_all_bookings =  [
/*0*/	function (e,f) { e.smcall (0, menu,"create", ([])); },
	function (e,f) {
		var t5860 = f.s[0]; f.v.menu = t5860;
		e.mcall (4, f.v.menu, "add_item", ([8, "All"]));
	},
	function (e,f) { f.v.i = 0; },
	function (e,f) {
		f.pc=5;
		if (!(((f.v.i)) < ((8)))) f.pc=4;
	},
	function (e,f) {
		f.pc=8;
		e.smcall (1, popupmenu,"run", ([f.v.menu]));
	},
/*5*/	function (e,f) { e.smcall (1, activitybooking,"booking_state_name", ([f.v.i])); },
	function (e,f) { var t5862 = f.s[0]; e.mcall (4, f.v.menu, "add_item", ([f.v.i, t5862])); },
	function (e,f) {
		f.pc=3;
		e.php_push_var_lvalue (0, "i");
		e.php_postinc (1);
	},
	function (e,f) {
		var t5865 = f.s[0]; f.v.s = t5865;
		if (((f.v.s)) !== ((null))) f.pc=9; else f.pc=-1;
	},
	function (e,f) { e.smcall (3, page_dispatcher,"makelink", (["activitybookingtemplate", "download_all_bookings", ({abtid:(f.v["this"]).rowid, state:f.v.s})])); },
/*10*/	function (e,f) { e.php_static_method_call (1, browser,"redirect", 1); },
null	];

;
	c.pargs__make_one_time_email =  ["state"];
	c.pinst__make_one_time_email =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["make_one_time_email", ([f.v.state])])); },
	function (e,f) { var t5867 = f.s[0]; e.return_pop (t5867); },
null	];

;
	c.pargs__email_all_bookings =  ["el","arg","ev"];
	c.pinst__email_all_bookings =  [
/*0*/	function (e,f) { e.smcall (0, menu,"create", ([])); },
	function (e,f) {
		var t5869 = f.s[0]; f.v.menu = t5869;
		e.mcall (4, f.v.menu, "add_item", ([8, "All"]));
	},
	function (e,f) { f.v.i = 0; },
	function (e,f) {
		f.pc=5;
		if (!(((f.v.i)) < ((8)))) f.pc=4;
	},
	function (e,f) {
		f.pc=8;
		e.smcall (1, popupmenu,"run", ([f.v.menu]));
	},
/*5*/	function (e,f) { e.smcall (1, activitybooking,"booking_state_name", ([f.v.i])); },
	function (e,f) { var t5871 = f.s[0]; e.mcall (4, f.v.menu, "add_item", ([f.v.i, t5871])); },
	function (e,f) {
		f.pc=3;
		e.php_push_var_lvalue (0, "i");
		e.php_postinc (1);
	},
	function (e,f) {
		var t5874 = f.s[0]; f.v.s = t5874;
		if (((f.v.s)) !== ((null))) f.pc=9; else f.pc=-1;
	},
	function (e,f) { e.mcall (3, f.v["this"], "make_one_time_email", ([f.v.s])); },
/*10*/	function (e,f) {
		var t5876 = f.s[0]; f.v.addr = t5876;
		e.smcall (1, browser,"redirect", ([("mailto:") + (f.v.addr)]));
	},
null	];

;
	c.pargs__download_all_people =  ["el","arg","ev"];
	c.pinst__download_all_people =  [
/*0*/	function (e,f) { e.smcall (0, menu,"create", ([])); },
	function (e,f) {
		var t5878 = f.s[0]; f.v.menu = t5878;
		e.mcall (4, f.v.menu, "add_item", ([8, "All"]));
	},
	function (e,f) { f.v.i = 0; },
	function (e,f) {
		f.pc=5;
		if (!(((f.v.i)) < ((8)))) f.pc=4;
	},
	function (e,f) {
		f.pc=8;
		e.smcall (1, popupmenu,"run", ([f.v.menu]));
	},
/*5*/	function (e,f) { e.smcall (1, activitybooking,"booking_state_name", ([f.v.i])); },
	function (e,f) { var t5880 = f.s[0]; e.mcall (4, f.v.menu, "add_item", ([f.v.i, t5880])); },
	function (e,f) {
		f.pc=3;
		e.php_push_var_lvalue (0, "i");
		e.php_postinc (1);
	},
	function (e,f) {
		var t5883 = f.s[0]; f.v.s = t5883;
		if (((f.v.s)) !== ((null))) f.pc=9; else f.pc=-1;
	},
	function (e,f) { e.smcall (3, page_dispatcher,"makelink", (["activitybookingtemplate", "download_all_people", ({abtid:(f.v["this"]).rowid, state:f.v.s})])); },
/*10*/	function (e,f) { e.php_static_method_call (1, browser,"redirect", 1); },
null	];

;
	c.pargs__run_configure_page =  ["el","arg","ev"];
	c.pinst__run_configure_page =  [
/*0*/	function (e,f) { e.smcall (3, page_dispatcher,"makelink", (["activitybookingtemplateconfig", "render", ({abtid:(f.v["this"]).rowid})])); },
	function (e,f) { e.php_static_method_call (1, browser,"redirect", 1); },
null	];

;
	c.pargs__do_retire =  ["newval"];
	c.pinst__do_retire =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["do_retire", ([f.v.newval])])); },
	function (e,f) { var t5886 = f.s[0]; e.return_pop (t5886); },
null	];

;
	c.pargs__retire =  ["el","arg","ev"];
	c.pinst__retire =  [
/*0*/	function (e,f) { if (((f.v.arg)) == (("1"))) f.pc=1; else f.pc=2; },
	function (e,f) {
		f.pc=3;
		f.s[0] = "retire";
	},
	function (e,f) { f.s[0] = "unretire"; },
	function (e,f) {
		f.pc=7;
		var t5888 = f.s[0]; f.v.action = t5888;
		e.smcall (1, popupokcancel,"run", ([("Are you sure you want to ") + ("" + (f.v.action) + (" this template?"))]));
	},
	function (e,f) { e.mcall (3, f.v["this"], "do_retire", ([f.v.arg])); },
/*5*/	function (e,f) { e.smcall (0, activitybookingtemplate,"overview_url", ([])); },
	function (e,f) {
		f.pc=-1;
		e.php_static_method_call (1, browser,"redirect", 1);
	},
	function (e,f) { var t5890 = f.s[0]; if (t5890) f.pc=4; else f.pc=-1; },
null	];

;
};
activitybookingtemplate.init_methods (activitybookingtemplate);
rpcclass.setup_class (activitybookingtemplate, "activitybookingtemplate",1, (["name","retired","acts","choose_acts","raw_config","config","rowid","listeners"]), ([0,0,0,0,0,0,0,2]));
function activitybooking () { this.do_construct (arguments); }
activitybooking.init_methods = function (c) {
	dbclass.init_methods(c);
	var cp = c.prototype;
	c.pargs__is_admin =  [];
	c.pinst__is_admin =  [
/*0*/	function (e,f) { e.mcall (2, (f.v["this"]).abt, "is_admin", ([])); },
	function (e,f) { var t5891 = f.s[0]; e.return_pop (t5891); },
null	];

;
	c.pargs__editor_url =  [];
	c.pinst__editor_url =  [
/*0*/	function (e,f) { e.smcall (3, page_dispatcher,"makelink", (["activitybooking", "booking_page", ({abid:(f.v["this"]).ref})])); },
	function (e,f) { var t5892 = f.s[0]; e.return_pop (t5892); },
null	];

;
	c.args__editor_url_by_ref = c.pargs__editor_url_by_ref =  ["ref"];
	c.inst__editor_url_by_ref = c.pinst__editor_url_by_ref =  [
/*0*/	function (e,f) { e.smcall (3, page_dispatcher,"makelink", (["activitybooking", "booking_page", ({abid:f.v.ref})])); },
	function (e,f) { var t5893 = f.s[0]; e.return_pop (t5893); },
null	];

;
	c.args__booking_state_name = c.pargs__booking_state_name =  ["state"];
	c.inst__booking_state_name = c.pinst__booking_state_name =  [
/*0*/	function (e,f) { if (((f.v.state)) == ((0))) f.pc=1; else f.pc=2; },
	function (e,f) { e.return_pop ("under construction"); },
	function (e,f) { if (((f.v.state)) == ((1))) f.pc=3; else f.pc=4; },
	function (e,f) { e.return_pop ("submitted"); },
	function (e,f) { if (((f.v.state)) == ((2))) f.pc=5; else f.pc=6; },
/*5*/	function (e,f) { e.return_pop ("reserve list"); },
	function (e,f) { if (((f.v.state)) == ((3))) f.pc=7; else f.pc=8; },
	function (e,f) { e.return_pop ("accepted"); },
	function (e,f) { if (((f.v.state)) == ((4))) f.pc=9; else f.pc=10; },
	function (e,f) { e.return_pop ("cancelled"); },
/*10*/	function (e,f) { if (((f.v.state)) == ((5))) f.pc=11; else f.pc=12; },
	function (e,f) { e.return_pop ("preliminary"); },
	function (e,f) { if (((f.v.state)) == ((6))) f.pc=13; else f.pc=14; },
	function (e,f) { e.return_pop ("tentative"); },
	function (e,f) { if (((f.v.state)) == ((7))) f.pc=15; else f.pc=16; },
/*15*/	function (e,f) { e.return_pop ("declined"); },
	function (e,f) { e.return_pop ("unknown booking state"); },
null	];

;
	c.args__booking_state_notifiable = c.pargs__booking_state_notifiable =  ["state"];
	c.inst__booking_state_notifiable = c.pinst__booking_state_notifiable =  [
/*0*/	function (e,f) { if (((f.v.state)) == ((0))) f.pc=2; else f.pc=3; },
	function (e,f) { e.return_pop (true); },
	function (e,f) {
		f.pc=10;
		f.s[0] = true;
	},
	function (e,f) { if (((f.v.state)) == ((1))) f.pc=4; else f.pc=5; },
	function (e,f) {
		f.pc=10;
		f.s[0] = true;
	},
/*5*/	function (e,f) { if (((f.v.state)) == ((2))) f.pc=6; else f.pc=7; },
	function (e,f) {
		f.pc=10;
		f.s[0] = true;
	},
	function (e,f) { if (((f.v.state)) == ((3))) f.pc=8; else f.pc=9; },
	function (e,f) {
		f.pc=10;
		f.s[0] = true;
	},
	function (e,f) { f.s[0] = ((f.v.state)) == ((4)); },
/*10*/	function (e,f) { var t5894 = f.s[0]; if (t5894) f.pc=1; else f.pc=11; },
	function (e,f) { e.return_pop (false); },
null	];

;
	c.pargs__new_name =  [];
	c.pinst__new_name =  [
/*0*/	function (e,f) { if ((((((f.v["this"]).abt).config).needs_candidates)) == (("0"))) f.pc=1; else f.pc=2; },
	function (e,f) { e.return_pop (""); },
	function (e,f) { if ((((f.v["this"]).state)) == ((0))) f.pc=4; else f.pc=5; },
	function (e,f) { e.return_pop ("Add person"); },
	function (e,f) {
		f.pc=6;
		f.s[0] = true;
	},
/*5*/	function (e,f) { e.mcall (2, f.v["this"], "is_admin", ([])); },
	function (e,f) { var t5895 = f.s[0]; if (t5895) f.pc=3; else f.pc=7; },
	function (e,f) { e.return_pop (""); },
null	];

;
	c.pargs__get_add_menu =  [];
	c.pinst__get_add_menu =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["get_add_menu", ([])])); },
	function (e,f) { var t5896 = f.s[0]; e.return_pop (t5896); },
null	];

;
	c.pargs__insert_helper =  [];
	c.pinst__insert_helper =  [
/*0*/	function (e,f) { e.mcall (2, f.v["this"], "get_add_menu", ([])); },
	function (e,f) {
		var t5898 = f.s[0]; f.v.menu = t5898;
		if (((f.v.menu)) === ((null))) f.pc=2; else f.pc=5;
	},
	function (e,f) { e.smcall (1, activitybookingcandidate,"create_blank", ([f.v["this"]])); },
	function (e,f) {
		var t5900 = f.s[0]; f.v.res = t5900;
		e.mcall (2, f.v.res, "fill_defaults", ([]));
	},
	function (e,f) { e.return_pop (f.v.res); },
/*5*/	function (e,f) { e.smcall (1, popupmenu,"run", ([f.v.menu])); },
	function (e,f) {
		var t5902 = f.s[0]; f.v.p = t5902;
		if (((f.v.p)) === ((1))) f.pc=7; else f.pc=9;
	},
	function (e,f) { e.smcall (1, activitybookingcandidate,"create_blank", ([f.v["this"]])); },
	function (e,f) { var t5903 = f.s[0]; e.return_pop (t5903); },
	function (e,f) { if (((f.v.p)) === ((0))) f.pc=10; else f.pc=12; },
/*10*/	function (e,f) { e.smcall (0, person,"lookup", ([])); },
	function (e,f) { var t5905 = f.s[0]; f.v.p = t5905; },
	function (e,f) { if (((f.v.p)) !== ((null))) f.pc=13; else f.pc=15; },
	function (e,f) { e.smcall (2, activitybookingcandidate,"create_from_person", ([f.v["this"], f.v.p])); },
	function (e,f) { var t5906 = f.s[0]; e.return_pop (t5906); },
/*15*/	function (e,f) { e.return_pop (null); },
null	];

;
	c.pargs__insert_row =  [];
	c.pinst__insert_row =  [
/*0*/	function (e,f) { e.mcall (2, f.v["this"], "insert_helper", ([])); },
	function (e,f) {
		var t5908 = f.s[0]; f.v.abc = t5908;
		if (((f.v.abc)) !== ((null))) f.pc=2; else f.pc=-1;
	},
	function (e,f) {
		f.pc=5;
		e.mcall (2, f.v.abc, "edit_booking", ([]));
	},
	function (e,f) { e.mcall (3, (f.v["this"]).dtm, "append_row", ([f.v.abc])); },
	function (e,f) {
		f.pc=-1;
		e.mcall (2, f.v["this"], "update_total_bill", ([]));
	},
/*5*/	function (e,f) { var t5909 = f.s[0]; if (t5909) f.pc=3; else f.pc=-1; },
null	];

;
	c.args__calculate_bill_helper = c.pargs__calculate_bill_helper =  ["fields","values"];
	c.inst__calculate_bill_helper = c.pinst__calculate_bill_helper =  [
/*0*/	function (e,f) {
		f.v.total = 0;
		f.v._k370 = e.enumkeys (f.v.fields);
	},
	function (e,f) {
		f.pc=3;
		if (!((f.v._k370).length)) f.pc=2;
	},
	function (e,f) { e.return_pop (f.v.total); },
	function (e,f) {
		f.v._i371 = (f.v._k370).shift();
		f.v.fielddef = (f.v.fields)[(f.v._i371)];
		if ((((f.v.fielddef).type)) == (("price"))) f.pc=4; else f.pc=6;
	},
	function (e,f) { if (((f.v.values)[((f.v.fielddef).name)]) !== undefined) f.pc=5; else f.pc=1; },
/*5*/	function (e,f) {
		f.pc=1;
		f.v.total = parseInt((f.v.total),10) + parseInt(((f.v.values)[((f.v.fielddef).name)]),10);
	},
	function (e,f) { if ((((f.v.fielddef).type)) == (("price_enum"))) f.pc=7; else f.pc=14; },
	function (e,f) {
		f.v.fname = (f.v.fielddef).name;
		if (((builtin__count ((f.v.fielddef).options))) == ((1))) f.pc=8; else f.pc=9;
	},
	function (e,f) {
		f.pc=1;
		f.v.total = parseInt((f.v.total),10) + parseInt(((((f.v.fielddef).options)[(0)]).price),10);
	},
	function (e,f) { if (((f.v.values)[(f.v.fname)]) !== undefined) f.pc=10; else f.pc=1; },
/*10*/	function (e,f) { f.v._k372 = e.enumkeys ((f.v.fielddef).options); },
	function (e,f) { if (!((f.v._k372).length)) f.pc=1; },
	function (e,f) {
		f.v._i373 = (f.v._k372).shift();
		f.v.opt = ((f.v.fielddef).options)[(f.v._i373)];
		if ((((f.v.opt).name)) == (((f.v.values)[(f.v.fname)]))) f.pc=13; else f.pc=11;
	},
	function (e,f) {
		f.pc=1;
		f.v.total = parseInt((f.v.total),10) + parseInt(((f.v.opt).price),10);
	},
	function (e,f) { if ((((f.v.fielddef).type)) == (("priced_count"))) f.pc=15; else f.pc=1; },
/*15*/	function (e,f) {
		f.v.fname = (f.v.fielddef).name;
		f.v.cnt = 0;
		if (((f.v.values)[(f.v.fname)]) !== undefined) f.pc=16; else f.pc=17;
	},
	function (e,f) {
		f.pc=19;
		f.v.cnt = (f.v.values)[(f.v.fname)];
	},
	function (e,f) { if (((f.v.fielddef).definteger) !== undefined) f.pc=18; else f.pc=19; },
	function (e,f) { f.v.cnt = (f.v.fielddef).definteger; },
	function (e,f) {
		f.pc=1;
		f.v.total = parseInt((f.v.total),10) + parseInt((((f.v.cnt)) * (((f.v.fielddef).price))),10);
	},
null	];

;
	c.pargs__calculate_bill =  ["ref"];
	c.pinst__calculate_bill =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["calculate_bill", ([f.v.ref])])); },
	function (e,f) { var t5926 = f.s[0]; e.return_pop (t5926); },
null	];

;
	c.args__render_due = c.pargs__render_due =  ["due"];
	c.inst__render_due = c.pinst__render_due =  [
/*0*/	function (e,f) { if (((f.v.due)) < ((0))) f.pc=1; else f.pc=3; },
	function (e,f) {
		f.s[0] = " (refund)";
		e.smcall (2, lib,"render_price", ([f.v.due]));
	},
	function (e,f) {
		f.pc=4;
		var t5927 = f.s[1]; var t5928 = f.s[0]; f.s[0] = "" + (t5927) + (t5928);
	},
	function (e,f) { e.smcall (1, lib,"render_price", ([f.v.due])); },
	function (e,f) { var t5929 = f.s[0]; e.return_pop (t5929); },
null	];

;
	c.pargs__render_totals =  ["money"];
	c.pinst__render_totals =  [
/*0*/	function (e,f) {
		window.__outbuffer += "<table>";
		f.v.style = "text-align:right";
		f.s[0] = "</span></td></tr>";
		e.mcall (4, f.v["this"], "booking_state_name", ([(f.v["this"]).state]));
	},
	function (e,f) {
		var t5931 = f.s[1]; var t5932 = f.s[0]; 
		window.__outbuffer += ("<tr><td style=\"") + ("" + (f.v.style) + (("\">Booking state:</td><td><span style=\"font-weight:bold\">") + ("" + (t5931) + (t5932))));
		if ((((f.v.money).discount)) > ((0))) f.pc=2; else f.pc=8;
	},
	function (e,f) {
		f.s[0] = "</td></tr>";
		e.smcall (2, lib,"render_price", ([(f.v.money).full]));
	},
	function (e,f) {
		var t5933 = f.s[1]; var t5934 = f.s[0]; 
		window.__outbuffer += ("<tr><td style=\"") + ("" + (f.v.style) + (("\">Full Cost:</td><td>") + ("" + (t5933) + (t5934))));
		f.s[0] = "</td></tr>";
		e.smcall (2, lib,"render_price", ([(f.v.money).discount]));
	},
	function (e,f) {
		var t5935 = f.s[1]; var t5936 = f.s[0]; 
		window.__outbuffer += ("<tr><td style=\"") + ("" + (f.v.style) + (("\">Discount:</td><td>") + ("" + (t5935) + (t5936))));
		f.v._k374 = e.enumkeys ((f.v.money).discount_detail);
	},
/*5*/	function (e,f) { if (!((f.v._k374).length)) f.pc=8; },
	function (e,f) {
		f.s[0] = f.v._i375 = (f.v._k374).shift();
		f.s[1] = f.v.dd = ((f.v.money).discount_detail)[(f.v._i375)];
		f.s[2] = "</td></tr>";
		e.smcall (4, lib,"render_price", ([(f.v.dd).amount]));
	},
	function (e,f) {
		f.pc=5;
		var t5940 = f.s[3]; var t5941 = f.s[2]; 
		window.__outbuffer += ("<tr><td></td><td>") + ("" + ((f.v.dd).label) + (("</td><td>") + ("" + (t5940) + (t5941))));
	},
	function (e,f) {
		f.s[0] = "</td></tr>";
		e.smcall (2, lib,"render_price", ([(f.v.money).cost]));
	},
	function (e,f) {
		var t5942 = f.s[1]; var t5943 = f.s[0]; 
		window.__outbuffer += ("<tr><td style=\"") + ("" + (f.v.style) + (("\">Total cost:</td><td>") + ("" + (t5942) + (t5943))));
		f.s[0] = "</td></tr>";
		e.smcall (2, lib,"render_price", ([(f.v.money).paid]));
	},
/*10*/	function (e,f) {
		var t5944 = f.s[1]; var t5945 = f.s[0]; 
		window.__outbuffer += ("<tr><td style=\"") + ("" + (f.v.style) + (("\">Total paid:</td><td>") + ("" + (t5944) + (t5945))));
		f.s[0] = "</span></td></tr>";
		e.smcall (2, activitybooking,"render_due", ([(f.v.money).due]));
	},
	function (e,f) {
		var t5946 = f.s[1]; var t5947 = f.s[0]; 
		window.__outbuffer += ("<tr><td style=\"") + ("" + (f.v.style) + (("\">Total to pay:</td><td><span style=\"font-weight:bold\">") + ("" + (t5946) + (t5947))));
		window.__outbuffer += "</table>";
	},
null	];

;
	c.pargs__update_total_bill =  [];
	c.pinst__update_total_bill =  [
/*0*/	function (e,f) { e.mcall (3, f.v["this"], "calculate_bill", ([(f.v["this"]).ref])); },
	function (e,f) {
		var t5949 = f.s[0]; f.v.money = t5949;
		e.mcall (3, document, "getElementById", (["totals-table"]));
	},
	function (e,f) {
		var t5951 = f.s[0]; f.v.el = t5951;
		f.s[0] = builtin__ob_start ();
		e.mcall (3, f.v["this"], "render_totals", ([f.v.money]));
	},
	function (e,f) {
		f.v.el.innerHTML = builtin__ob_get_clean ();
		e.mcall (3, document, "getElementById", (["place-booking-button"]));
	},
	function (e,f) {
		var t5954 = f.s[0]; f.v.pbb = t5954;
		if (f.v.pbb) f.pc=5; else f.pc=-1;
	},
/*5*/	function (e,f) { e.mcall (2, f.v["this"], "grab_candidates", ([])); },
	function (e,f) {
		var t5956 = f.s[0]; f.v.cl = t5956;
		e.mcall (3, f.v["this"], "form_complete", ([f.v.cl]));
	},
	function (e,f) {
		var t5957 = f.s[0]; 
		f.v.pbb.disabled = !(t5957);
	},
null	];

;
	c.pargs__clear_subsidy =  ["pay"];
	c.pinst__clear_subsidy =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["clear_subsidy", ([f.v.pay])])); },
	function (e,f) { var t5959 = f.s[0]; e.return_pop (t5959); },
null	];

;
	c.pargs__make_payment =  ["prompt_if_nothing_to_pay"];
	c.pinst__make_payment =  [
/*0*/	function (e,f) { e.mcall (3, f.v["this"], "calculate_bill", ([(f.v["this"]).ref])); },
	function (e,f) {
		var t5961 = f.s[0]; f.v.money = t5961;
		e.mcall (2, f.v["this"], "is_admin", ([]));
	},
	function (e,f) {
		var t5963 = f.s[0]; f.v.negotiable = t5963;
		if ((((f.v.money).due)) == ((0))) f.pc=4; else f.pc=5;
	},
	function (e,f) { e.return_pop (true); },
	function (e,f) {
		f.pc=6;
		f.s[0] = !(f.v.prompt_if_nothing_to_pay);
	},
/*5*/	function (e,f) { f.s[0] = false; },
	function (e,f) { var t5964 = f.s[0]; if (t5964) f.pc=3; else f.pc=7; },
	function (e,f) { e.smcall (4, payment,"make_payment_dialog", ([f.v["this"], (f.v.money).due, (f.v["this"]).owner_name, f.v.negotiable])); },
	function (e,f) {
		var t5966 = f.s[0]; f.v.pay = t5966;
		if (((f.v.pay)) !== ((null))) f.pc=9; else f.pc=11;
	},
	function (e,f) { if ((((f.v.pay).paytype)) == (("subsidy"))) f.pc=10; else f.pc=11; },
/*10*/	function (e,f) { e.mcall (3, f.v["this"], "clear_subsidy", ([f.v.pay])); },
	function (e,f) { e.return_pop (f.v.pay); },
null	];

;
	c.pargs__make_payment_button =  ["el","arg","ev"];
	c.pinst__make_payment_button =  [
/*0*/	function (e,f) { e.mcall (3, f.v["this"], "make_payment", ([true])); },
	function (e,f) {
		var t5968 = f.s[0]; f.v.pay = t5968;
		if (((f.v.pay)) !== ((null))) f.pc=2; else f.pc=-1;
	},
	function (e,f) { e.mcall (2, f.v.pay, "run_payment", ([])); },
null	];

;
	c.pargs__render_payment_history =  [];
	c.pinst__render_payment_history =  [
/*0*/	function (e,f) { e.smcall (1, payment,"render_history", ([f.v["this"]])); },
	function (e,f) { var t5969 = f.s[0]; window.__outbuffer += t5969; },
null	];

;
	c.pargs__payment_change =  ["arg"];
	c.pinst__payment_change =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "send_msg", (["update_notification", 0])); },
	function (e,f) { e.mcall (2, f.v["this"], "update_total_bill", ([])); },
null	];

;
	c.pargs__lock_booking =  ["ref"];
	c.pinst__lock_booking =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["lock_booking", ([f.v.ref])])); },
	function (e,f) { var t5970 = f.s[0]; e.return_pop (t5970); },
null	];

;
	c.pargs__place_booking =  ["el","arg","ev"];
	c.pinst__place_booking =  [
/*0*/	function (e,f) { e.mcall (3, f.v["this"], "make_payment", ([false])); },
	function (e,f) {
		var t5972 = f.s[0]; f.v.pay = t5972;
		if (((f.v.pay)) !== ((null))) f.pc=2; else f.pc=-1;
	},
	function (e,f) { e.mcall (3, f.v["this"], "lock_booking", ([(f.v["this"]).ref])); },
	function (e,f) {
		f.pc=5;
		e.mcall (2, f.v.pay, "run_payment", ([]));
	},
	function (e,f) {
		f.pc=-1;
		e.smcall (0, browser,"reload", ([]));
	},
/*5*/	function (e,f) {
		var t5973 = f.s[0]; 
		if (!(t5973)) f.pc=4; else f.pc=-1;
	},
null	];

;
	c.pargs__set_booking_state =  ["s"];
	c.pinst__set_booking_state =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["set_booking_state", ([f.v.s])])); },
	function (e,f) { var t5974 = f.s[0]; e.return_pop (t5974); },
null	];

;
	c.pargs__change_state =  ["el","arg","ev"];
	c.pinst__change_state =  [
/*0*/	function (e,f) { e.smcall (0, menu,"create", ([])); },
	function (e,f) {
		var t5976 = f.s[0]; f.v.menu = t5976;
		f.v.i = 0;
	},
	function (e,f) {
		f.pc=6;
		if (!(((f.v.i)) < ((8)))) f.pc=3;
	},
	function (e,f) {
		f.pc=8;
		e.smcall (1, popupmenu,"run", ([f.v.menu]));
	},
	function (e,f) { e.mcall (3, f.v["this"], "booking_state_name", ([f.v.i])); },
/*5*/	function (e,f) {
		f.pc=7;
		var t5978 = f.s[0]; e.mcall (4, f.v.menu, "add_item", ([f.v.i, t5978]));
	},
	function (e,f) { if ((((f.v["this"]).state)) != ((f.v.i))) f.pc=4; else f.pc=7; },
	function (e,f) {
		f.pc=2;
		e.php_push_var_lvalue (0, "i");
		e.php_postinc (1);
	},
	function (e,f) {
		var t5981 = f.s[0]; f.v.s = t5981;
		if (((f.v.s)) !== ((null))) f.pc=9; else f.pc=-1;
	},
	function (e,f) {
		f.pc=12;
		f.s[0] = "?";
		e.mcall (4, f.v["this"], "booking_state_name", ([f.v.s]));
	},
/*10*/	function (e,f) { e.mcall (3, f.v["this"], "set_booking_state", ([f.v.s])); },
	function (e,f) {
		f.pc=-1;
		e.smcall (0, browser,"reload", ([]));
	},
	function (e,f) {
		var t5982 = f.s[1]; var t5983 = f.s[0]; 
		e.smcall (1, popupokcancel,"run", ([("Sure you want to change to ") + ("" + (t5982) + (t5983))]));
	},
	function (e,f) { var t5984 = f.s[0]; if (t5984) f.pc=10; else f.pc=-1; },
null	];

;
	c.pargs__grab_candidates =  [];
	c.pinst__grab_candidates =  [
/*0*/	function (e,f) { e.mcall (2, (f.v["this"]).dtm, "get_rows", ([])); },
	function (e,f) {
		var t5986 = f.s[0]; f.v.rows = t5986;
		f.v.res = ([]);
		f.v._k376 = e.enumkeys (f.v.rows);
	},
	function (e,f) {
		f.pc=4;
		if (!((f.v._k376).length)) f.pc=3;
	},
	function (e,f) { e.return_pop (f.v.res); },
	function (e,f) {
		f.s[0] = f.v._i377 = (f.v._k376).shift();
		f.s[1] = f.v.rowid = (f.v.rows)[(f.v._i377)];
		e.smcall (4, rpcclass,"get_object_by_id", (["activitybookingcandidate", f.v.rowid]));
	},
/*5*/	function (e,f) {
		f.pc=2;
		var t5992 = f.s[2]; f.v.res[f.v.res.length] = t5992;
	},
null	];

;
	c.pargs__form_complete =  ["candidates"];
	c.pinst__form_complete =  [
/*0*/	function (e,f) { if ((((((f.v["this"]).abt).config).needs_candidates)) == (("1"))) f.pc=2; else f.pc=3; },
	function (e,f) { e.return_pop (false); },
	function (e,f) {
		f.pc=4;
		f.s[0] = ((builtin__count (f.v.candidates))) == ((0));
	},
	function (e,f) { f.s[0] = false; },
	function (e,f) { var t5993 = f.s[0]; if (t5993) f.pc=1; else f.pc=5; },
/*5*/	function (e,f) { f.v._k378 = e.enumkeys (f.v.candidates); },
	function (e,f) {
		f.pc=8;
		if (!((f.v._k378).length)) f.pc=7;
	},
	function (e,f) { e.return_pop (true); },
	function (e,f) {
		f.v._i379 = (f.v._k378).shift();
		f.v.abc = (f.v.candidates)[(f.v._i379)];
		e.mcall (2, f.v.abc, "form_state", ([]));
	},
	function (e,f) {
		var t5998 = f.s[0]; f.v.state = t5998;
		if (((f.v.state)) !== ((null))) f.pc=10; else f.pc=6;
	},
/*10*/	function (e,f) { e.return_pop (false); },
null	];

;
	c.pargs__save_values =  ["values"];
	c.pinst__save_values =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["save_values", ([f.v.values])])); },
	function (e,f) { var t5999 = f.s[0]; e.return_pop (t5999); },
null	];

;
	c.pargs__form_changed =  ["key","value"];
	c.pinst__form_changed =  [
/*0*/	function (e,f) {
		(f.v["this"]).values[f.v.key] = f.v.value;
		e.mcall (3, f.v["this"], "save_values", ([(f.v["this"]).values]));
	},
	function (e,f) { e.mcall (2, f.v["this"], "update_total_bill", ([])); },
null	];

;
	c.args__validate_booking_ref =  ["ref"];
	c.inst__validate_booking_ref =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_function_async", (["activitybooking", "validate_booking_ref", ([f.v.ref])])); },
	function (e,f) { var t6001 = f.s[0]; e.return_pop (t6001); },
null	];

;
	c.pargs__do_remove_candidate =  ["abc"];
	c.pinst__do_remove_candidate =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["do_remove_candidate", ([f.v.abc])])); },
	function (e,f) { var t6002 = f.s[0]; e.return_pop (t6002); },
null	];

;
	c.pargs__remove_candidate =  ["el","abc","ev"];
	c.pinst__remove_candidate =  [
/*0*/	function (e,f) {
		f.pc=4;
		f.s[0] = "?";
		e.mcall (4, f.v.abc, "get_field_value", (["sname"]));
	},
	function (e,f) { e.mcall (3, f.v["this"], "do_remove_candidate", ([f.v.abc])); },
	function (e,f) { e.mcall (3, (f.v["this"]).dtm, "remove_row", ([f.v.abc])); },
	function (e,f) {
		f.pc=-1;
		e.mcall (2, f.v["this"], "update_total_bill", ([]));
	},
	function (e,f) {
		var t6003 = f.s[1]; var t6004 = f.s[0]; 
		f.s[0] = (" ") + ("" + (t6003) + (t6004));
		e.mcall (4, f.v.abc, "get_field_value", (["nname"]));
	},
/*5*/	function (e,f) {
		var t6005 = f.s[1]; var t6006 = f.s[0]; 
		e.smcall (1, popupokcancel,"run", ([("Delete ") + ("" + (t6005) + (t6006))]));
	},
	function (e,f) { var t6007 = f.s[0]; if (t6007) f.pc=1; else f.pc=-1; },
null	];

;
	c.pargs__can_edit =  [];
	c.pinst__can_edit =  [
/*0*/	function (e,f) {
		f.pc=2;
		e.mcall (2, (f.v["this"]).abt, "is_admin", ([]));
	},
	function (e,f) { e.return_pop (true); },
	function (e,f) { var t6008 = f.s[0]; if (t6008) f.pc=1; else f.pc=3; },
	function (e,f) { e.return_pop ((((f.v["this"]).state)) == ((0))); },
null	];

;
	c.pargs__edit_booking =  ["el","abc","ev"];
	c.pinst__edit_booking =  [
/*0*/	function (e,f) {
		f.pc=3;
		e.mcall (2, f.v.abc, "edit_booking", ([]));
	},
	function (e,f) { e.mcall (3, (f.v["this"]).dtm, "rerender_row", ([f.v.abc])); },
	function (e,f) {
		f.pc=-1;
		e.mcall (2, f.v["this"], "update_total_bill", ([]));
	},
	function (e,f) { var t6009 = f.s[0]; if (t6009) f.pc=1; else f.pc=-1; },
null	];

;
	c.pargs__get_row_style =  ["abc"];
	c.pinst__get_row_style =  [
/*0*/	function (e,f) { e.return_pop ("class=\"bookingformcandidaterow\""); },
null	];

;
	c.pargs__get_row_fields =  ["abc"];
	c.pinst__get_row_fields =  [
/*0*/	function (e,f) {
		f.pc=3;
		f.s[0] = "</a>";
		e.mcall (3, f.v["this"], "can_edit", ([]));
	},
	function (e,f) {
		f.pc=4;
		f.s[1] = "change";
	},
	function (e,f) {
		f.pc=4;
		f.s[1] = "view";
	},
	function (e,f) { var t6010 = f.s[1]; if (t6010) f.pc=1; else f.pc=2; },
	function (e,f) {
		var t6011 = f.s[1]; var t6012 = f.s[0]; 
		f.s[0] = ("\">") + ("" + (t6011) + (t6012));
		e.mcall (5, f.v["this"], "render_start", (["edit_booking", f.v.abc]));
	},
/*5*/	function (e,f) {
		f.pc=9;
		var t6013 = f.s[1]; var t6014 = f.s[0]; 
		f.v.changelink = ("<a href=\"#\" onclick=\"") + ("" + (t6013) + (t6014));
		e.mcall (2, f.v["this"], "can_edit", ([]));
	},
	function (e,f) {
		f.s[0] = "\">remove</a>";
		e.mcall (5, f.v["this"], "render_start", (["remove_candidate", f.v.abc]));
	},
	function (e,f) {
		f.pc=10;
		var t6016 = f.s[1]; var t6017 = f.s[0]; 
		f.s[0] = ("<a href=\"#\" onclick=\"") + ("" + (t6016) + (t6017));
	},
	function (e,f) {
		f.pc=10;
		f.s[0] = "";
	},
	function (e,f) { var t6018 = f.s[0]; if (t6018) f.pc=6; else f.pc=8; },
/*10*/	function (e,f) {
		var t6020 = f.s[0]; f.v.removelink = t6020;
		e.mcall (3, f.v.abc, "get_field_value", (["sname"]));
	},
	function (e,f) {
		var t6021 = f.s[0]; f.s[0] = (" ") + (t6021);
		e.mcall (4, f.v.abc, "get_field_value", (["nname"]));
	},
	function (e,f) {
		var t6022 = f.s[1]; var t6023 = f.s[0]; 
		f.v.name = "" + (t6022) + (t6023);
		e.mcall (2, f.v.abc, "form_state", ([]));
	},
	function (e,f) {
		var t6026 = f.s[0]; f.v.state = t6026;
		if (((f.v.state)) === ((null))) f.pc=14; else f.pc=15;
	},
	function (e,f) { f.v.state = "Form complete"; },
/*15*/	function (e,f) {
		f.s[0] = f.v.removelink;
		e.mcall (3, f.v.abc, "calculate_bill", ([]));
	},
	function (e,f) { e.php_static_method_call (2, lib,"render_price", 1); },
	function (e,f) {
		var t6029 = f.s[1]; var t6030 = f.s[0]; 
		e.return_pop (([f.v.name, "" + (f.v.state) + ((" ") + (f.v.changelink)), t6029, t6030]));
	},
null	];

;
	c.pargs__paycfg =  [];
	c.pinst__paycfg =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["paycfg", ([])])); },
	function (e,f) { var t6031 = f.s[0]; e.return_pop (t6031); },
null	];

;
};
activitybooking.init_methods (activitybooking);
rpcclass.setup_class (activitybooking, "activitybooking",1, (["abt","dt","owner_name","owner_email","owner_handle","ref","dtm","state","values_serialized","values","rowid","listeners"]), ([0,0,0,0,0,0,2,0,0,0,0,2]));
function activitybookingcandidate () { this.do_construct (arguments); }
activitybookingcandidate.init_methods = function (c) {
	dbclass.init_methods(c);
	var cp = c.prototype;
	c.pargs__get_field_value =  ["fname"];
	c.pinst__get_field_value =  [
/*0*/	function (e,f) { f.v._k380 = e.enumkeys (((((f.v["this"]).ab).abt).config).candidate_fields); },
	function (e,f) {
		f.pc=3;
		if (!((f.v._k380).length)) f.pc=2;
	},
	function (e,f) { e.return_pop ("[nofield]"); },
	function (e,f) {
		f.v._i381 = (f.v._k380).shift();
		f.v.f = (((((f.v["this"]).ab).abt).config).candidate_fields)[(f.v._i381)];
		if ((((f.v.f).name)) == ((f.v.fname))) f.pc=4; else f.pc=1;
	},
	function (e,f) { if (!((((f.v["this"]).values)[(f.v.fname)]) !== undefined)) f.pc=7; else f.pc=8; },
/*5*/	function (e,f) { e.return_pop ("[unset]"); },
	function (e,f) { e.return_pop (((f.v["this"]).values)[(f.v.fname)]); },
	function (e,f) {
		f.pc=9;
		f.s[0] = true;
	},
	function (e,f) { f.s[0] = ((((f.v["this"]).values)[(f.v.fname)])) == (("")); },
	function (e,f) { var t6035 = f.s[0]; if (t6035) f.pc=5; else f.pc=6; },
null	];

;
	c.pargs__field_ready =  ["f"];
	c.pinst__field_ready =  [
/*0*/	function (e,f) { if (((f.v.f).required) !== undefined) f.pc=6; else f.pc=7; },
	function (e,f) {
		f.v.fname = (f.v.f).name;
		if (!((((f.v["this"]).values)[(f.v.fname)]) !== undefined)) f.pc=3; else f.pc=4;
	},
	function (e,f) { e.return_pop (false); },
	function (e,f) {
		f.pc=5;
		f.s[0] = true;
	},
	function (e,f) { f.s[0] = ((((f.v["this"]).values)[(f.v.fname)])) == (("")); },
/*5*/	function (e,f) { var t6037 = f.s[0]; if (t6037) f.pc=2; else f.pc=9; },
	function (e,f) {
		f.pc=8;
		f.s[0] = (((f.v.f).required)) != ((0));
	},
	function (e,f) { f.s[0] = false; },
	function (e,f) { var t6038 = f.s[0]; if (t6038) f.pc=1; else f.pc=9; },
	function (e,f) { e.return_pop (true); },
null	];

;
	c.pargs__form_state =  [];
	c.pinst__form_state =  [
/*0*/	function (e,f) { f.v._k382 = e.enumkeys (((((f.v["this"]).ab).abt).config).candidate_fields); },
	function (e,f) {
		f.pc=3;
		if (!((f.v._k382).length)) f.pc=2;
	},
	function (e,f) { e.return_pop (null); },
	function (e,f) {
		f.pc=5;
		f.v._i383 = (f.v._k382).shift();
		f.v.f = (((((f.v["this"]).ab).abt).config).candidate_fields)[(f.v._i383)];
		e.mcall (3, f.v["this"], "field_ready", ([f.v.f]));
	},
	function (e,f) { e.return_pop ("<span style=\"color:red\">Form incomplete</span>"); },
/*5*/	function (e,f) {
		var t6042 = f.s[0]; 
		if (!(t6042)) f.pc=4; else f.pc=1;
	},
null	];

;
	c.pargs__save_values =  ["values"];
	c.pinst__save_values =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["save_values", ([f.v.values])])); },
	function (e,f) { var t6043 = f.s[0]; e.return_pop (t6043); },
null	];

;
	c.pargs__read_form_values =  ["pop"];
	c.pinst__read_form_values =  [
/*0*/	function (e,f) { e.mcall (2, f.v.pop, "get_form_fields", ([])); },
	function (e,f) {
		var t6045 = f.s[0]; f.v.values = t6045;
		f.v._k384 = e.enumkeys (((((f.v["this"]).ab).abt).config).candidate_fields);
	},
	function (e,f) { if (!((f.v._k384).length)) f.pc=-1; },
	function (e,f) {
		f.pc=2;
		f.v._i385 = (f.v._k384).shift();
		f.v.f = (((((f.v["this"]).ab).abt).config).candidate_fields)[(f.v._i385)];
		f.v.fname = (f.v.f).name;
		(f.v["this"]).values[f.v.fname] = (f.v.values)[(f.v.fname)];
	},
null	];

;
	c.pargs__edit_booking =  [];
	c.pinst__edit_booking =  [
/*0*/	function (e,f) {
		f.v.xfl = ((((f.v["this"]).ab).abt).config).candidate_fields;
		f.v.fl = ([]);
		f.v._k386 = e.enumkeys (f.v.xfl);
	},
	function (e,f) {
		f.pc=3;
		if (!((f.v._k386).length)) f.pc=2;
	},
	function (e,f) {
		f.pc=8;
		e.mcall (2, (f.v["this"]).ab, "can_edit", ([]));
	},
	function (e,f) {
		f.pc=5;
		f.v._i387 = (f.v._k386).shift();
		f.v.f = (f.v.xfl)[(f.v._i387)];
		e.mcall (2, (f.v["this"]).ab, "can_edit", ([]));
	},
	function (e,f) {
		f.pc=6;
		f.v.f.readonly = "1";
	},
/*5*/	function (e,f) {
		var t6057 = f.s[0]; 
		if (!(t6057)) f.pc=4; else f.pc=6;
	},
	function (e,f) {
		f.pc=1;
		f.v.fl[f.v.fl.length] = f.v.f;
	},
	function (e,f) {
		f.pc=9;
		f.v.fl[f.v.fl.length] = ({type:"ok"});
	},
	function (e,f) { var t6060 = f.s[0]; if (t6060) f.pc=7; else f.pc=9; },
	function (e,f) {
		f.v.fl[f.v.fl.length] = ({name:"cancel", type:"button", label:"Cancel", action:"cancel"});
		e.smcall (3, form,"create", ([f.v["this"], f.v.fl, (f.v["this"]).values]));
	},
/*10*/	function (e,f) {
		f.pc=12;
		var t6063 = f.s[0]; f.v.f = t6063;
		e.mcall (2, ((f.v["this"]).ab).abt, "is_admin", ([]));
	},
	function (e,f) {
		f.pc=13;
		e.mcall (4, f.v.f, "set_env", (["is_admin", true]));
	},
	function (e,f) { var t6064 = f.s[0]; if (t6064) f.pc=11; else f.pc=13; },
	function (e,f) {
		f.pc=16;
		e.mcall (2, (f.v["this"]).ab, "can_edit", ([]));
	},
	function (e,f) {
		f.pc=17;
		f.s[0] = "Change Booking";
	},
/*15*/	function (e,f) {
		f.pc=17;
		f.s[0] = "View Booking";
	},
	function (e,f) { var t6065 = f.s[0]; if (t6065) f.pc=14; else f.pc=15; },
	function (e,f) {
		var t6067 = f.s[0]; f.v.title = t6067;
		e.mcall (5, f.v.f, "popup", ([0, 0, f.v.title]));
	},
	function (e,f) {
		var t6069 = f.s[0]; f.v.new_values = t6069;
		if (((f.v.new_values)) === ((null))) f.pc=19; else f.pc=20;
	},
	function (e,f) { e.return_pop (false); },
/*20*/	function (e,f) { e.mcall (3, f.v["this"], "save_values", ([f.v.new_values])); },
	function (e,f) { e.return_pop (true); },
null	];

;
	c.pargs__calculate_bill =  [];
	c.pinst__calculate_bill =  [
/*0*/	function (e,f) { e.mcall (4, (f.v["this"]).ab, "calculate_bill_helper", ([((((f.v["this"]).ab).abt).config).candidate_fields, (f.v["this"]).values])); },
	function (e,f) { var t6070 = f.s[0]; e.return_pop (t6070); },
null	];

;
	c.args__create_blank =  ["ab"];
	c.inst__create_blank =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_function_async", (["activitybookingcandidate", "create_blank", ([f.v.ab])])); },
	function (e,f) { var t6071 = f.s[0]; e.return_pop (t6071); },
null	];

;
	c.args__create_from_person =  ["ab","p"];
	c.inst__create_from_person =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_function_async", (["activitybookingcandidate", "create_from_person", ([f.v.ab, f.v.p])])); },
	function (e,f) { var t6072 = f.s[0]; e.return_pop (t6072); },
null	];

;
	c.pargs__fill_defaults =  [];
	c.pinst__fill_defaults =  [
/*0*/	function (e,f) { e.mcall (2, (f.v["this"]).ab, "grab_candidates", ([])); },
	function (e,f) {
		var t6074 = f.s[0]; f.v.cl = t6074;
		if (((builtin__count (f.v.cl))) == ((0))) f.pc=2; else f.pc=3;
	},
	function (e,f) { f.pc=-1; },
	function (e,f) {
		f.v.c0 = (f.v.cl)[(parseInt((builtin__count (f.v.cl)),10) - parseInt((1),10))];
		f.v._k388 = e.enumkeys (((((f.v["this"]).ab).abt).config).candidate_fields);
	},
	function (e,f) { if (!((f.v._k388).length)) f.pc=-1; },
/*5*/	function (e,f) {
		f.v._i389 = (f.v._k388).shift();
		f.v.f = (((((f.v["this"]).ab).abt).config).candidate_fields)[(f.v._i389)];
		if (((f.v.f).same) !== undefined) f.pc=7; else f.pc=8;
	},
	function (e,f) {
		f.pc=4;
		f.v.fname = (f.v.f).name;
		(f.v["this"]).values[f.v.fname] = ((f.v.c0).values)[(f.v.fname)];
	},
	function (e,f) {
		f.pc=9;
		f.s[0] = (((f.v.f).same)) == (("1"));
	},
	function (e,f) { f.s[0] = false; },
	function (e,f) { var t6081 = f.s[0]; if (t6081) f.pc=6; else f.pc=4; },
null	];

;
};
activitybookingcandidate.init_methods (activitybookingcandidate);
rpcclass.setup_class (activitybookingcandidate, "activitybookingcandidate",1, (["ab","handle","attendance_map","values_serialized","values","rowid","listeners"]), ([0,0,0,0,0,0,2]));
function form_element_priced_count () { this.do_construct (arguments); }
form_element_priced_count.init_methods = function (c) {
	form_element_integer.init_methods(c);
	var cp = c.prototype;
	c.pargs__custom_label =  [];
	c.pinst__custom_label =  [
/*0*/	function (e,f) {
		f.s[0] = ": ";
		e.smcall (2, lib,"render_price", ([((f.v["this"]).fielddef).price]));
	},
	function (e,f) {
		var t6082 = f.s[1]; var t6083 = f.s[0]; 
		e.return_pop ("" + (((f.v["this"]).fielddef).label) + ((" @ ") + ("" + (t6082) + (t6083))));
	},
null	];

;
};
form_element_priced_count.init_methods (form_element_priced_count);
rpcclass.setup_class (form_element_priced_count, "form_element_priced_count",0, (["form","fielddef","raw_value","change_timer_handle","listeners"]), ([0,0,0,0,2]));
function form_element_price_enum () { this.do_construct (arguments); }
form_element_price_enum.init_methods = function (c) {
	form_element_enum.init_methods(c);
	var cp = c.prototype;
	c.pargs__option_label =  ["opt"];
	c.pinst__option_label =  [
/*0*/	function (e,f) { e.smcall (1, lib,"render_price", ([(f.v.opt).price])); },
	function (e,f) {
		var t6084 = f.s[0]; 
		e.return_pop ("" + ((f.v.opt).label) + ((" @ ") + (t6084)));
	},
null	];

;
};
form_element_price_enum.init_methods (form_element_price_enum);
rpcclass.setup_class (form_element_price_enum, "form_element_price_enum",0, (["options","form","fielddef","raw_value","change_timer_handle","listeners"]), ([0,0,0,0,0,2]));
function form_element_enable_type () { this.do_construct (arguments); }
form_element_enable_type.init_methods = function (c) {
	form_element_text.init_methods(c);
	var cp = c.prototype;
};
form_element_enable_type.init_methods (form_element_enable_type);
rpcclass.setup_class (form_element_enable_type, "form_element_enable_type",0, (["form","fielddef","raw_value","change_timer_handle","listeners"]), ([0,0,0,0,2]));
function form_element_option_array () { this.do_construct (arguments); }
form_element_option_array.init_methods = function (c) {
	form_element_array.init_methods(c);
	var cp = c.prototype;
	c.pargs__table_widths =  [];
	c.pinst__table_widths =  [
/*0*/	function (e,f) { e.return_pop ((["5%", "15%", "35%", "10%", "10%", "10%"])); },
null	];

;
	c.pargs__drag_image =  [];
	c.pinst__drag_image =  [
/*0*/	function (e,f) { e.return_pop ("/churchbuilder/graphics/circle-small.png"); },
null	];

;
	c.pargs__get_all_fields =  [];
	c.pinst__get_all_fields =  [
/*0*/	function (e,f) { e.mcall (2, ((f.v["this"]).form).parent, "get_all_rows", ([])); },
	function (e,f) { var t6085 = f.s[0]; e.return_pop (t6085); },
null	];

;
	c.pargs__run_editor =  ["title","row"];
	c.pinst__run_editor =  [
/*0*/	function (e,f) {
		f.v.fields = ([({name:"name", type:"text", label:"Name", required:"1"}), ({name:"label", type:"text", label:"Label", required:"1", width:"300"}), ({name:"enabled", type:"enable_type", label:"Enabled", required:"1"}), ({type:"ok"}), ({name:"cancel", type:"button", label:"Cancel", action:"cancel"})]);
		e.smcall (3, form,"create", ([f.v["this"], f.v.fields, f.v.row]));
	},
	function (e,f) {
		var t6088 = f.s[0]; f.v.f = t6088;
		e.mcall (5, f.v.f, "popup", ([0, 0, f.v.title]));
	},
	function (e,f) { var t6089 = f.s[0]; e.return_pop (t6089); },
null	];

;
	c.pargs__edit_element =  ["row"];
	c.pinst__edit_element =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "run_editor", (["Edit option", f.v.row])); },
	function (e,f) { var t6090 = f.s[0]; e.return_pop (t6090); },
null	];

;
	c.pargs__create_element =  [];
	c.pinst__create_element =  [
/*0*/	function (e,f) {
		f.v.row = ({name:"", label:""});
		e.mcall (4, f.v["this"], "run_editor", (["Create option", f.v.row]));
	},
	function (e,f) { var t6092 = f.s[0]; e.return_pop (t6092); },
null	];

;
	c.pargs__row_fields =  ["row"];
	c.pinst__row_fields =  [
/*0*/	function (e,f) {
		f.v.res = ([]);
		f.v.res[f.v.res.length] = (f.v.row).name;
		f.v.res[f.v.res.length] = (f.v.row).label;
		f.v.res[f.v.res.length] = (f.v.row).enabled;
		e.return_pop (f.v.res);
	},
null	];

;
};
form_element_option_array.init_methods (form_element_option_array);
rpcclass.setup_class (form_element_option_array, "form_element_option_array",0, (["dtm","form","fielddef","raw_value","change_timer_handle","listeners"]), ([0,0,0,0,0,2]));
function form_element_price_option_array () { this.do_construct (arguments); }
form_element_price_option_array.init_methods = function (c) {
	form_element_array.init_methods(c);
	var cp = c.prototype;
	c.pargs__table_widths =  [];
	c.pinst__table_widths =  [
/*0*/	function (e,f) { e.return_pop ((["5%", "15%", "35%", "10%", "10%", "10%", "10%"])); },
null	];

;
	c.pargs__drag_image =  [];
	c.pinst__drag_image =  [
/*0*/	function (e,f) { e.return_pop ("/churchbuilder/graphics/circle-small.png"); },
null	];

;
	c.pargs__get_all_fields =  [];
	c.pinst__get_all_fields =  [
/*0*/	function (e,f) { e.mcall (2, ((f.v["this"]).form).parent, "get_all_rows", ([])); },
	function (e,f) { var t6097 = f.s[0]; e.return_pop (t6097); },
null	];

;
	c.pargs__run_editor =  ["title","row"];
	c.pinst__run_editor =  [
/*0*/	function (e,f) {
		f.v.fields = ([({name:"name", type:"text", label:"Name", required:"1"}), ({name:"label", type:"text", label:"Label", required:"1", width:"300"}), ({name:"enabled", type:"enable_type", label:"Enabled", required:"1"}), ({name:"price", type:"price", label:"Price"}), ({type:"ok"}), ({name:"cancel", type:"button", label:"Cancel", action:"cancel"})]);
		e.smcall (3, form,"create", ([f.v["this"], f.v.fields, f.v.row]));
	},
	function (e,f) {
		var t6100 = f.s[0]; f.v.f = t6100;
		e.mcall (5, f.v.f, "popup", ([0, 0, f.v.title]));
	},
	function (e,f) { var t6101 = f.s[0]; e.return_pop (t6101); },
null	];

;
	c.pargs__edit_element =  ["row"];
	c.pinst__edit_element =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "run_editor", (["Edit option", f.v.row])); },
	function (e,f) { var t6102 = f.s[0]; e.return_pop (t6102); },
null	];

;
	c.pargs__create_element =  [];
	c.pinst__create_element =  [
/*0*/	function (e,f) {
		f.v.row = ({name:"", label:""});
		e.mcall (4, f.v["this"], "run_editor", (["Create option", f.v.row]));
	},
	function (e,f) { var t6104 = f.s[0]; e.return_pop (t6104); },
null	];

;
	c.pargs__row_fields =  ["row"];
	c.pinst__row_fields =  [
/*0*/	function (e,f) {
		f.v.res = ([]);
		f.v.res[f.v.res.length] = (f.v.row).name;
		f.v.res[f.v.res.length] = (f.v.row).label;
		f.v.res[f.v.res.length] = (f.v.row).enabled;
		e.smcall (1, lib,"render_price", ([(f.v.row).price]));
	},
	function (e,f) {
		var t6110 = f.s[0]; f.v.res[f.v.res.length] = t6110;
		e.return_pop (f.v.res);
	},
null	];

;
};
form_element_price_option_array.init_methods (form_element_price_option_array);
rpcclass.setup_class (form_element_price_option_array, "form_element_price_option_array",0, (["dtm","form","fielddef","raw_value","change_timer_handle","listeners"]), ([0,0,0,0,0,2]));
function form_element_discount_array () { this.do_construct (arguments); }
form_element_discount_array.init_methods = function (c) {
	form_element_array.init_methods(c);
	var cp = c.prototype;
	c.pargs__table_widths =  [];
	c.pinst__table_widths =  [
/*0*/	function (e,f) { e.return_pop ((["30%", "50%", "10%", "5%", "5%"])); },
null	];

;
	c.pargs__change_indication =  [];
	c.pinst__change_indication =  [
/*0*/	function (e,f) { e.mcall (2, f.v["this"], "get_all_rows", ([])); },
	function (e,f) {
		var t6112 = f.s[0]; f.v.f = t6112;
		e.mcall (4, ((f.v["this"]).form).parent, "save_fields", ([f.v.f, "discounts"]));
	},
null	];

;
	c.pargs__run_editor =  ["title","row"];
	c.pinst__run_editor =  [
/*0*/	function (e,f) {
		f.v.countable_items = ([]);
		f.s[0] = builtin__debugout (("template = ") + (((((f.v["this"]).form).parent).abt).name));
		f.v._k390 = e.enumkeys ((((((f.v["this"]).form).parent).abt).config).candidate_fields);
	},
	function (e,f) {
		f.pc=3;
		if (!((f.v._k390).length)) f.pc=2;
	},
	function (e,f) {
		f.pc=10;
		f.v._k392 = e.enumkeys ((((((f.v["this"]).form).parent).abt).config).booking_fields);
	},
	function (e,f) {
		f.v._i391 = (f.v._k390).shift();
		f.v.f = ((((((f.v["this"]).form).parent).abt).config).candidate_fields)[(f.v._i391)];
		if ((((f.v.f).type)) == (("priced_count"))) f.pc=5; else f.pc=6;
	},
	function (e,f) {
		f.pc=1;
		f.v.countable_items[f.v.countable_items.length] = ({name:(f.v.f).name, label:(f.v.f).label});
	},
/*5*/	function (e,f) {
		f.pc=9;
		f.s[0] = true;
	},
	function (e,f) { if ((((f.v.f).type)) == (("condition"))) f.pc=7; else f.pc=8; },
	function (e,f) {
		f.pc=9;
		f.s[0] = true;
	},
	function (e,f) { f.s[0] = (((f.v.f).type)) == (("condition_count")); },
	function (e,f) { var t6119 = f.s[0]; if (t6119) f.pc=4; else f.pc=1; },
/*10*/	function (e,f) {
		f.pc=12;
		if (!((f.v._k392).length)) f.pc=11;
	},
	function (e,f) {
		f.pc=14;
		f.v.fields = ([({name:"label", type:"text", label:"Label", required:"1", width:"300"}), ({name:"item", type:"enum", label:"Count", required:"1", options:f.v.countable_items}), ({name:"min", type:"integer", label:"Minimum", required:"1"}), ({name:"max", type:"integer", label:"Maximum", required:"1"}), ({name:"amount_abs", type:"price", label:"Fixed amount", required:"0"}), ({name:"amount_per", type:"price", label:"Per item amount", required:"0"}), ({type:"ok"}), ({name:"cancel", type:"button", label:"Cancel", action:"cancel"})]);
		e.smcall (3, form,"create", ([f.v["this"], f.v.fields, f.v.row]));
	},
	function (e,f) {
		f.v._i393 = (f.v._k392).shift();
		f.v.f = ((((((f.v["this"]).form).parent).abt).config).booking_fields)[(f.v._i393)];
		if ((((f.v.f).type)) == (("priced_count"))) f.pc=13; else f.pc=10;
	},
	function (e,f) {
		f.pc=10;
		f.v.countable_items[f.v.countable_items.length] = ({name:(f.v.f).name, label:(f.v.f).label});
	},
	function (e,f) {
		var t6125 = f.s[0]; f.v.f = t6125;
		e.mcall (5, f.v.f, "popup", ([0, 0, f.v.title]));
	},
/*15*/	function (e,f) { var t6126 = f.s[0]; e.return_pop (t6126); },
null	];

;
	c.pargs__create_element =  [];
	c.pinst__create_element =  [
/*0*/	function (e,f) {
		f.v.row = ({label:""});
		e.mcall (4, f.v["this"], "run_editor", (["Create discount", f.v.row]));
	},
	function (e,f) { var t6128 = f.s[0]; e.return_pop (t6128); },
null	];

;
	c.pargs__edit_element =  ["f"];
	c.pinst__edit_element =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "run_editor", (["Edit discount", f.v.f])); },
	function (e,f) { var t6129 = f.s[0]; e.return_pop (t6129); },
null	];

;
	c.pargs__row_fields =  ["row"];
	c.pinst__row_fields =  [
/*0*/	function (e,f) {
		f.v.res = ([]);
		f.v.res[f.v.res.length] = (f.v.row).label;
		f.v.res[f.v.res.length] = "" + ((f.v.row).min) + ((" <= ") + ("" + ((f.v.row).item) + ((" <= ") + ((f.v.row).max))));
		if ((((f.v.row).amount_abs)) == ((""))) f.pc=1; else f.pc=2;
	},
	function (e,f) {
		f.pc=3;
		f.s[0] = 0;
	},
	function (e,f) { f.s[0] = (f.v.row).amount_abs; },
	function (e,f) {
		var t6134 = f.s[0]; f.v.abs = t6134;
		e.smcall (1, lib,"render_price", ([f.v.abs]));
	},
	function (e,f) {
		var t6136 = f.s[0]; f.v.price = t6136;
		if ((((f.v.row).amount_per)) == ((""))) f.pc=5; else f.pc=6;
	},
/*5*/	function (e,f) {
		f.pc=7;
		f.s[0] = 0;
	},
	function (e,f) { f.s[0] = (f.v.row).amount_per; },
	function (e,f) {
		var t6138 = f.s[0]; f.v.per = t6138;
		e.smcall (1, lib,"render_price", ([f.v.per]));
	},
	function (e,f) {
		var t6139 = f.s[0]; 
		f.v.price = "" + (f.v.price) + ((" + Nx") + (t6139));
		f.v.res[f.v.res.length] = f.v.price;
		e.return_pop (f.v.res);
	},
null	];

;
};
form_element_discount_array.init_methods (form_element_discount_array);
rpcclass.setup_class (form_element_discount_array, "form_element_discount_array",0, (["dtm","form","fielddef","raw_value","change_timer_handle","listeners"]), ([0,0,0,0,0,2]));
function form_element_field_array () { this.do_construct (arguments); }
form_element_field_array.init_methods = function (c) {
	form_element_array.init_methods(c);
	var cp = c.prototype;
	c.pargs__table_widths =  [];
	c.pinst__table_widths =  [
/*0*/	function (e,f) { e.return_pop ((["5%", "15%", "30%", "20%", "15%", "5%", "5%"])); },
null	];

;
	c.pargs__drag_image =  [];
	c.pinst__drag_image =  [
/*0*/	function (e,f) { e.return_pop ("/churchbuilder/graphics/circle-small.png"); },
null	];

;
	c.pargs__get_all_fields =  [];
	c.pinst__get_all_fields =  [
/*0*/	function (e,f) { e.mcall (2, f.v["this"], "get_all_rows", ([])); },
	function (e,f) { var t6142 = f.s[0]; e.return_pop (t6142); },
null	];

;
	c.pargs__change_indication =  [];
	c.pinst__change_indication =  [
/*0*/	function (e,f) { e.mcall (2, f.v["this"], "get_all_rows", ([])); },
	function (e,f) {
		f.pc=4;
		var t6144 = f.s[0]; f.v.f = t6144;
		e.mcall (2, f.v["this"], "is_candidate_type", ([]));
	},
	function (e,f) {
		f.pc=5;
		f.s[0] = "candidate_fields";
	},
	function (e,f) {
		f.pc=5;
		f.s[0] = "booking_fields";
	},
	function (e,f) { var t6145 = f.s[0]; if (t6145) f.pc=2; else f.pc=3; },
/*5*/	function (e,f) {
		var t6147 = f.s[0]; f.v.fieldset = t6147;
		e.mcall (4, ((f.v["this"]).form).parent, "save_fields", ([f.v.f, f.v.fieldset]));
	},
null	];

;
	c.pargs__run_editor =  ["title","f"];
	c.pinst__run_editor =  [
/*0*/	function (e,f) { e.mcall (2, f.v["this"], "is_candidate_type", ([])); },
	function (e,f) {
		var t6149 = f.s[0]; f.v.is_candidate = t6149;
		f.v.readonly = (((f.v.f).prefill)) == (("1"));
		if (f.v.is_candidate) f.pc=2; else f.pc=3;
	},
	function (e,f) {
		f.pc=4;
		f.s[0] = "1";
	},
	function (e,f) { f.s[0] = "0"; },
	function (e,f) {
		var t6152 = f.s[0]; f.v.enable_same = t6152;
		f.v.fields = ([({name:"name", type:"text", label:"Name", required:"1", readonly:f.v.readonly}), ({name:"label", type:"text", label:"Label", required:"1", width:"300", readonly:f.v.readonly}), ({name:"type", type:"enum", label:"Type", required:"1", readonly:f.v.readonly, defoption:"text", options:([({name:"label", label:"Label"}), ({name:"text", label:"Text"}), ({name:"password", label:"Password"}), ({name:"dn", label:"Phone number"}), ({name:"postcode", label:"Postal Code"}), ({name:"yesno", label:"Yes or No"}), ({name:"enum", label:"Choice"}), ({name:"price_enum", label:"Choice with cost"}), ({name:"integer", label:"Number"}), ({name:"price", label:"Price"}), ({name:"priced_count", label:"Priced count"}), ({name:"condition", label:"Condition"}), ({name:"condition_count", label:"Condition Count"})])}), ({name:"required", type:"yesno", label:"Required", required:"1"}), ({name:"enabled", type:"enable_type", label:"Enabled", required:"1"}), ({name:"readonly", type:"yesno", label:"Read-only", required:"1", defoption:"0"}), ({name:"same", type:"yesno", label:"Same as first candidate", required:"1", enabled:f.v.enable_same}), ({name:"prefill", type:"yesno", label:"Prefill from people database", required:"1", readonly:"1"}), ({name:"options", type:"option_array", width:"800", label:"Options", enabled:"type=enum", readonly:f.v.readonly}), ({name:"options", type:"price_option_array", width:"800", label:"Options", enabled:"type=price_enum", readonly:f.v.readonly}), ({name:"price", type:"price", label:"Price", enabled:"type=priced_count"}), ({name:"definteger", type:"integer", label:"Default value", enabled:"type=priced_count"}), ({name:"mininteger", type:"integer", label:"Minimum value", enabled:"type=priced_count"}), ({name:"maxinteger", type:"integer", label:"Maximum value", enabled:"type=priced_count"}), ({name:"defprice", type:"price", label:"Default price", enabled:"type=price"}), ({name:"minprice", type:"price", label:"Minimum price", enabled:"type=price"}), ({name:"maxprice", type:"price", label:"Maximum price", enabled:"type=price"}), ({name:"definteger", type:"integer", label:"Default value", enabled:"type=integer"}), ({name:"mininteger", type:"integer", label:"Minimum value", enabled:"type=integer"}), ({name:"maxinteger", type:"integer", label:"Maximum value", enabled:"type=integer"}), ({name:"expr", type:"text", label:"Expression", enabled:"type=condition|type=condition_count"}), ({type:"ok"}), ({name:"cancel", type:"button", label:"Cancel", action:"cancel"})]);
		e.smcall (3, form,"create", ([f.v["this"], f.v.fields, f.v.f]));
	},
/*5*/	function (e,f) {
		var t6155 = f.s[0]; f.v.xform = t6155;
		e.mcall (5, f.v.xform, "popup", ([0, 0, f.v.title]));
	},
	function (e,f) { var t6156 = f.s[0]; e.return_pop (t6156); },
null	];

;
	c.pargs__create_element =  [];
	c.pinst__create_element =  [
/*0*/	function (e,f) {
		f.v.hintfields = (["nname", "sname", "telephone", "mobile", "email", "address1", "address2", "address3", "address4", "postalcode", "adult"]);
		e.smcall (0, menu,"create", ([]));
	},
	function (e,f) {
		var t6159 = f.s[0]; f.v.menu = t6159;
		e.mcall (4, f.v.menu, "add_item", (["custom", "Custom"]));
	},
	function (e,f) { f.v._k394 = e.enumkeys (f.v.hintfields); },
	function (e,f) {
		f.pc=5;
		if (!((f.v._k394).length)) f.pc=4;
	},
	function (e,f) {
		f.pc=7;
		e.smcall (1, popupmenu,"run", ([f.v.menu]));
	},
/*5*/	function (e,f) {
		f.v._i395 = (f.v._k394).shift();
		f.v.hf = (f.v.hintfields)[(f.v._i395)];
		e.smcall (1, person,"get_field_info", ([f.v.hf]));
	},
	function (e,f) {
		f.pc=3;
		var t6164 = f.s[0]; f.v.fi = t6164;
		e.mcall (4, f.v.menu, "add_item", ([f.v.hf, (f.v.fi).label]));
	},
	function (e,f) {
		var t6166 = f.s[0]; f.v.choice = t6166;
		if (((f.v.choice)) === ((null))) f.pc=8; else f.pc=9;
	},
	function (e,f) { e.return_pop (null); },
	function (e,f) { if (((f.v.choice)) == (("custom"))) f.pc=10; else f.pc=11; },
/*10*/	function (e,f) {
		f.pc=16;
		f.v.f = ({required:"1", same:"0", prefill:"0", enabled:"1"});
	},
	function (e,f) { e.smcall (1, person,"get_field_info", ([f.v.choice])); },
	function (e,f) {
		var t6169 = f.s[0]; f.v.fi = t6169;
		if (((f.v.choice)) == (("nname"))) f.pc=13; else f.pc=14;
	},
	function (e,f) {
		f.pc=15;
		f.s[0] = "0";
	},
	function (e,f) { f.s[0] = "1"; },
/*15*/	function (e,f) {
		var t6171 = f.s[0]; f.v.same = t6171;
		f.v.f = ({name:f.v.choice, label:(f.v.fi).label, type:(f.v.fi).type, same:f.v.same, prefill:"1", enabled:"1"});
	},
	function (e,f) { e.mcall (4, f.v["this"], "run_editor", (["Create New", f.v.f])); },
	function (e,f) { var t6173 = f.s[0]; e.return_pop (t6173); },
null	];

;
	c.pargs__edit_element =  ["f"];
	c.pinst__edit_element =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "run_editor", (["Edit Field", f.v.f])); },
	function (e,f) { var t6174 = f.s[0]; e.return_pop (t6174); },
null	];

;
	c.pargs__row_fields =  ["row"];
	c.pinst__row_fields =  [
/*0*/	function (e,f) {
		f.v.res = ([]);
		f.v.res[f.v.res.length] = (f.v.row).name;
		f.v.res[f.v.res.length] = (f.v.row).label;
		f.v.res[f.v.res.length] = (f.v.row).type;
		if (((f.v.row).required) !== undefined) f.pc=1; else f.pc=2;
	},
	function (e,f) {
		f.pc=3;
		f.s[0] = (((f.v.row).required)) == ((1));
	},
	function (e,f) { f.s[0] = false; },
	function (e,f) {
		var t6180 = f.s[0]; f.v.required = t6180;
		if (f.v.required) f.pc=4; else f.pc=5;
	},
	function (e,f) {
		f.pc=6;
		f.s[0] = "mandatory";
	},
/*5*/	function (e,f) { f.s[0] = "optional"; },
	function (e,f) {
		var t6182 = f.s[0]; f.v.res[f.v.res.length] = t6182;
		e.return_pop (f.v.res);
	},
null	];

;
};
form_element_field_array.init_methods (form_element_field_array);
rpcclass.setup_class (form_element_field_array, "form_element_field_array",0, (["dtm","form","fielddef","raw_value","change_timer_handle","listeners"]), ([0,0,0,0,0,2]));
function form_element_candidate_field_array () { this.do_construct (arguments); }
form_element_candidate_field_array.init_methods = function (c) {
	form_element_field_array.init_methods(c);
	var cp = c.prototype;
	c.pargs__is_candidate_type =  [];
	c.pinst__is_candidate_type =  [
/*0*/	function (e,f) { e.return_pop (true); },
null	];

;
};
form_element_candidate_field_array.init_methods (form_element_candidate_field_array);
rpcclass.setup_class (form_element_candidate_field_array, "form_element_candidate_field_array",0, (["dtm","form","fielddef","raw_value","change_timer_handle","listeners"]), ([0,0,0,0,0,2]));
function form_element_booking_field_array () { this.do_construct (arguments); }
form_element_booking_field_array.init_methods = function (c) {
	form_element_field_array.init_methods(c);
	var cp = c.prototype;
	c.pargs__is_candidate_type =  [];
	c.pinst__is_candidate_type =  [
/*0*/	function (e,f) { e.return_pop (false); },
null	];

;
};
form_element_booking_field_array.init_methods (form_element_booking_field_array);
rpcclass.setup_class (form_element_booking_field_array, "form_element_booking_field_array",0, (["dtm","form","fielddef","raw_value","change_timer_handle","listeners"]), ([0,0,0,0,0,2]));
function activitybookingtemplateconfig () { this.do_construct (arguments); }
activitybookingtemplateconfig.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
	c.pargs__save_fields =  ["res","fieldset"];
	c.pinst__save_fields =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["save_fields", ([f.v.res, f.v.fieldset])])); },
	function (e,f) { var t6183 = f.s[0]; e.return_pop (t6183); },
null	];

;
	c.pargs__save_config =  ["paycfg","ncev","emev"];
	c.pinst__save_config =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["save_config", ([f.v.paycfg, f.v.ncev, f.v.emev])])); },
	function (e,f) { var t6184 = f.s[0]; e.return_pop (t6184); },
null	];

;
	c.pargs__form_changed =  ["fname","value"];
	c.pinst__form_changed =  [
/*0*/	function (e,f) { e.mcall (2, (f.v["this"]).pf, "get_values", ([])); },
	function (e,f) {
		var t6186 = f.s[0]; f.v.paycfg = t6186;
		e.mcall (2, (f.v["this"]).nce, "get_values", ([]));
	},
	function (e,f) {
		var t6188 = f.s[0]; f.v.ncev = t6188;
		e.mcall (2, (f.v["this"]).eme, "get_values", ([]));
	},
	function (e,f) {
		var t6190 = f.s[0]; f.v.emev = t6190;
		e.mcall (5, f.v["this"], "save_config", ([f.v.paycfg, f.v.ncev, f.v.emev]));
	},
null	];

;
	c.pargs__make_editor =  ["context"];
	c.pinst__make_editor =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["make_editor", ([f.v.context])])); },
	function (e,f) { var t6191 = f.s[0]; e.return_pop (t6191); },
null	];

;
	c.pargs__edit_rich_text =  ["el","context","ev"];
	c.pinst__edit_rich_text =  [
/*0*/	function (e,f) { e.mcall (3, f.v["this"], "make_editor", ([f.v.context])); },
	function (e,f) {
		var t6193 = f.s[0]; f.v.ed = t6193;
		e.mcall (2, f.v.ed, "run", ([]));
	},
null	];

;
};
activitybookingtemplateconfig.init_methods (activitybookingtemplateconfig);
rpcclass.setup_class (activitybookingtemplateconfig, "activitybookingtemplateconfig",0, (["abt","bfe","cfe","nce","eme","pf","listeners"]), ([0,0,0,0,0,0,2]));
function activitybookingtemplateadmin () { this.do_construct (arguments); }
activitybookingtemplateadmin.init_methods = function (c) {
	hintedsearch.init_methods(c);
	var cp = c.prototype;
	c.pargs__open_record =  ["el","ab","ev"];
	c.pinst__open_record =  [
/*0*/	function (e,f) { e.mcall (2, f.v.ab, "editor_url", ([])); },
	function (e,f) { e.php_static_method_call (1, browser,"redirect", 1); },
null	];

;
	c.pargs__hint =  ["terms","opts"];
	c.pinst__hint =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["hint", ([f.v.terms, f.v.opts])])); },
	function (e,f) { var t6195 = f.s[0]; e.return_pop (t6195); },
null	];

;
	c.pargs__fetch_bookings_of_type =  ["el","arg","ev"];
	c.pinst__fetch_bookings_of_type =  [
/*0*/	function (e,f) { e.mcall (3, f.v["this"], "set_search", ([("state:") + (f.v.arg)])); },
null	];

;
};
activitybookingtemplateadmin.init_methods (activitybookingtemplateadmin);
rpcclass.setup_class (activitybookingtemplateadmin, "activitybookingtemplateadmin",0, (["searchval","abt","unique_result","allow_empty","timer_id","listeners"]), ([0,0,0,0,0,2]));
function payment () { this.do_construct (arguments); }
payment.init_methods = function (c) {
	dbclass.init_methods(c);
	var cp = c.prototype;
	c.args__create_new =  ["obj","amount","paytype","payer"];
	c.inst__create_new =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_function_async", (["payment", "create_new", ([f.v.obj, f.v.amount, f.v.paytype, f.v.payer])])); },
	function (e,f) { var t6196 = f.s[0]; e.return_pop (t6196); },
null	];

;
	c.args__payment_types = c.pargs__payment_types =  [];
	c.inst__payment_types = c.pinst__payment_types =  [
/*0*/	function (e,f) { e.return_pop (({cash:({label:"Cash", mechanism:"manual"}), cheque:({label:"Cheque", mechanism:"manual"}), bacs:({label:"Bank transfer", mechanism:"manual"}), card:({label:"Credit/Debit card", mechanism:"paypal"}), paypal:({label:"Paypal", mechanism:"paypal"}), subsidy:({label:"Subsidy", mechanism:"manual"})})); },
null	];

;
	c.pargs__payment_instructions =  [];
	c.pinst__payment_instructions =  [
/*0*/	function (e,f) { if ((((f.v["this"]).paytype)) == (("cash"))) f.pc=1; else f.pc=3; },
	function (e,f) {
		f.s[0] = "'";
		e.mcall (3, f.v["this"], "cbx", ([]));
	},
	function (e,f) {
		var t6197 = f.s[1]; var t6198 = f.s[0]; 
		e.return_pop (("Please mark your payment with reference '") + ("" + (t6197) + (t6198)));
	},
	function (e,f) { if ((((f.v["this"]).paytype)) == (("cheque"))) f.pc=4; else f.pc=6; },
	function (e,f) {
		f.s[0] = ("' on the back of the cheque<br/>Please make cheque payable to '") + ("" + (((f.v["this"]).cfg).cheque_payee) + ("'"));
		e.mcall (3, f.v["this"], "cbx", ([]));
	},
/*5*/	function (e,f) {
		var t6199 = f.s[1]; var t6200 = f.s[0]; 
		e.return_pop (("Please write reference '") + ("" + (t6199) + (t6200)));
	},
	function (e,f) { if ((((f.v["this"]).paytype)) == (("bacs"))) f.pc=7; else f.pc=9; },
	function (e,f) {
		f.s[0] = "'";
		e.mcall (3, f.v["this"], "cbx", ([]));
	},
	function (e,f) {
		var t6201 = f.s[1]; var t6202 = f.s[0]; 
		e.return_pop (("Please transfer money to '") + ("" + (((f.v["this"]).cfg).bacs_payee) + (("' using reference '") + ("" + (t6201) + (t6202)))));
	},
	function (e,f) { if ((((f.v["this"]).paytype)) == (("card"))) f.pc=10; else f.pc=11; },
/*10*/	function (e,f) { e.return_pop ("On the Paypal website click on 'Pay with card'<br/>You do not need a Paypal account<br/>Click OK to continue"); },
	function (e,f) { if ((((f.v["this"]).paytype)) == (("paypal"))) f.pc=12; else f.pc=13; },
	function (e,f) { e.return_pop (null); },
	function (e,f) { if ((((f.v["this"]).paytype)) == (("subsidy"))) f.pc=14; else f.pc=-1; },
	function (e,f) { e.return_pop (null); },
null	];

;
	c.pargs__payhelp =  [];
	c.pinst__payhelp =  [
/*0*/	function (e,f) { e.smcall (0, payment,"payment_types", ([])); },
	function (e,f) {
		var t6204 = f.s[0]; f.v.pts = t6204;
		e.mcall (2, f.v["this"], "payment_instructions", ([]));
	},
	function (e,f) {
		var t6205 = f.s[0]; 
		e.smcall (1, popupok,"run", (["" + (((f.v.pts)[((f.v["this"]).paytype)]).label) + ((" payment<br/>") + (t6205))]));
	},
null	];

;
	c.pargs__run_payment =  [];
	c.pinst__run_payment =  [
/*0*/	function (e,f) { e.smcall (0, payment,"payment_types", ([])); },
	function (e,f) {
		var t6207 = f.s[0]; f.v.pts = t6207;
		e.mcall (2, f.v["this"], "payment_instructions", ([]));
	},
	function (e,f) {
		var t6209 = f.s[0]; f.v.msg = t6209;
		if (((f.v.msg)) !== ((null))) f.pc=3; else f.pc=5;
	},
	function (e,f) { e.mcall (2, f.v["this"], "payment_instructions", ([])); },
	function (e,f) {
		var t6210 = f.s[0]; 
		e.smcall (1, popupok,"run", (["" + (((f.v.pts)[((f.v["this"]).paytype)]).label) + ((" payment<br/>") + (t6210))]));
	},
/*5*/	function (e,f) { if (((((f.v.pts)[((f.v["this"]).paytype)]).mechanism)) == (("paypal"))) f.pc=6; else f.pc=9; },
	function (e,f) { e.smcall (1, lib,"render_price_simple", ([(f.v["this"]).amount])); },
	function (e,f) {
		var t6212 = f.s[0]; f.v.num_amount = t6212;
		e.smcall (4, paypal,"go_pay", ([f.v["this"], ((f.v["this"]).cfg).title, f.v.num_amount, ((f.v["this"]).cfg).paypal_payee]));
	},
	function (e,f) { e.return_pop (true); },
	function (e,f) { e.return_pop (false); },
null	];

;
	c.pargs__paypal_retry =  ["el","arg","ev"];
	c.pinst__paypal_retry =  [
/*0*/	function (e,f) { e.mcall (2, f.v["this"], "run_payment", ([])); },
null	];

;
	c.args__make_payment_dialog = c.pargs__make_payment_dialog =  ["obj","due","payer","negotiable"];
	c.inst__make_payment_dialog = c.pinst__make_payment_dialog =  [
/*0*/	function (e,f) { e.mcall (2, f.v.obj, "paycfg", ([])); },
	function (e,f) {
		var t6214 = f.s[0]; f.v.cfg = t6214;
		f.v.opts = ({none:"[Choose]"});
		e.smcall (0, payment,"payment_types", ([]));
	},
	function (e,f) {
		var t6217 = f.s[0]; f.v.paytypes = t6217;
		f.v._k396 = e.enumkeys (f.v.paytypes);
	},
	function (e,f) {
		f.pc=5;
		if (!((f.v._k396).length)) f.pc=4;
	},
	function (e,f) {
		f.v.fields = ([]);
		if (f.v.negotiable) f.pc=10; else f.pc=12;
	},
/*5*/	function (e,f) {
		f.v.name = (f.v._k396).shift();
		f.v.spec = (f.v.paytypes)[(f.v.name)];
		if (((f.v.cfg)[(("can_use_") + (f.v.name))]) !== undefined) f.pc=7; else f.pc=8;
	},
	function (e,f) {
		f.pc=3;
		f.v.opts[f.v.name] = (f.v.spec).label;
	},
	function (e,f) {
		f.pc=9;
		f.s[0] = (((f.v.cfg)[(("can_use_") + (f.v.name))])) == (("1"));
	},
	function (e,f) { f.s[0] = false; },
	function (e,f) { var t6223 = f.s[0]; if (t6223) f.pc=6; else f.pc=3; },
/*10*/	function (e,f) { e.smcall (1, lib,"render_price_simple", ([f.v.due])); },
	function (e,f) {
		f.pc=14;
		var t6224 = f.s[0]; 
		f.v.fields[f.v.fields.length] = ({name:"amount", label:"Amount", type:"text", value:t6224});
	},
	function (e,f) { e.smcall (1, lib,"render_price", ([f.v.due])); },
	function (e,f) {
		var t6226 = f.s[0]; 
		f.v.fields[f.v.fields.length] = ({name:"amount", label:"Amount", type:"label", value:t6226});
	},
	function (e,f) {
		f.v.fields[f.v.fields.length] = ({name:"paytype", label:"Method", type:"enum", options:f.v.opts});
		f.v.pop = new popupform;
		e.mcall (6, f.v.pop, "initialise", ([0, 0, "Make payment", f.v.fields]));
	},
/*15*/	function (e,f) { e.mcall (2, f.v.pop, "open", ([])); },
	function (e,f) { f.v.res = null; },
	function (e,f) {
		f.pc=19;
		e.mcall (2, f.v.pop, "run", ([]));
	},
	function (e,f) {
		f.pc=41;
		e.mcall (2, f.v.pop, "close", ([]));
	},
	function (e,f) {
		var t6232 = f.s[0]; f.v.event = t6232;
		if ((((f.v.event).action)) == (("OK"))) f.pc=20; else f.pc=39;
	},
/*20*/	function (e,f) { e.mcall (2, f.v.pop, "get_form_fields", ([])); },
	function (e,f) {
		var t6234 = f.s[0]; f.v.values = t6234;
		if (f.v.negotiable) f.pc=22; else f.pc=24;
	},
	function (e,f) { e.smcall (1, lib,"parse_price_simple", ([(f.v.values).amount])); },
	function (e,f) {
		f.pc=25;
		var t6236 = f.s[0]; f.v.amount = t6236;
	},
	function (e,f) { f.v.amount = f.v.due; },
/*25*/	function (e,f) {
		f.v.paytype = (f.v.values).paytype;
		if (((f.v.paytype)) == (("none"))) f.pc=26; else f.pc=27;
	},
	function (e,f) {
		f.pc=17;
		e.smcall (1, popupok,"run", (["Choose payment method"]));
	},
	function (e,f) { if (((f.v.amount)) === ((null))) f.pc=31; else f.pc=32; },
	function (e,f) {
		f.pc=17;
		e.smcall (1, popupok,"run", (["Invalid amount"]));
	},
	function (e,f) { e.smcall (4, payment,"create_new", ([f.v.obj, f.v.amount, f.v.paytype, f.v.payer])); },
/*30*/	function (e,f) {
		f.pc=18;
		var t6240 = f.s[0]; f.v.res = t6240;
	},
	function (e,f) {
		f.pc=38;
		f.s[0] = true;
	},
	function (e,f) { if (((f.v.amount)) == ((0))) f.pc=33; else f.pc=34; },
	function (e,f) {
		f.pc=38;
		f.s[0] = true;
	},
	function (e,f) { if (((f.v.amount)) < ((0))) f.pc=35; else f.pc=37; },
/*35*/	function (e,f) { e.mcall (2, f.v.obj, "is_admin", ([])); },
	function (e,f) {
		f.pc=38;
		var t6241 = f.s[0]; f.s[0] = !(t6241);
	},
	function (e,f) { f.s[0] = false; },
	function (e,f) { var t6242 = f.s[0]; if (t6242) f.pc=28; else f.pc=29; },
	function (e,f) { if ((((f.v.event).action)) == (("cancel"))) f.pc=40; else f.pc=17; },
/*40*/	function (e,f) { f.pc=18; },
	function (e,f) { e.return_pop (f.v.res); },
null	];

;
	c.pargs__set_state =  ["newstate"];
	c.pinst__set_state =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["set_state", ([f.v.newstate])])); },
	function (e,f) { var t6243 = f.s[0]; e.return_pop (t6243); },
null	];

;
	c.pargs__change_payment_state =  ["el","newstate","ev"];
	c.pinst__change_payment_state =  [
/*0*/	function (e,f) {
		f.pc=2;
		e.smcall (1, payment,"state_name", ([f.v.newstate]));
	},
	function (e,f) {
		f.pc=-1;
		e.mcall (3, f.v["this"], "set_state", ([f.v.newstate]));
	},
	function (e,f) {
		var t6244 = f.s[0]; f.s[0] = (" to ") + (t6244);
		e.mcall (3, f.v["this"], "cbx", ([]));
	},
	function (e,f) {
		var t6245 = f.s[1]; var t6246 = f.s[0]; 
		e.smcall (1, popupokcancel,"run", ([("Change state of payment ") + ("" + (t6245) + (t6246))]));
	},
	function (e,f) { var t6247 = f.s[0]; if (t6247) f.pc=1; else f.pc=-1; },
null	];

;
	c.pargs__do_receive_money =  ["pnewamount","newstate"];
	c.pinst__do_receive_money =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["do_receive_money", ([f.v.pnewamount, f.v.newstate])])); },
	function (e,f) { var t6248 = f.s[0]; e.return_pop (t6248); },
null	];

;
	c.pargs__receive_money =  ["el","newstate","ev"];
	c.pinst__receive_money =  [
/*0*/	function (e,f) { e.smcall (1, lib,"render_price_simple", ([(f.v["this"]).amount])); },
	function (e,f) { var t6250 = f.s[0]; f.v.newamount = t6250; },
	function (e,f) {
		f.s[0] = f.v.newamount;
		f.s[1] = "'";
		e.smcall (3, payment,"state_name", ([f.v.newstate]));
	},
	function (e,f) {
		var t6251 = f.s[2]; var t6252 = f.s[1]; 
		f.s[1] = ("Set transaction to '") + ("" + (t6251) + (t6252));
		f.s[2] = 0;
		f.s[3] = 0;
		e.php_static_method_call (4, popupeditbox,"run", 4);
	},
	function (e,f) {
		var t6255 = f.s[0]; f.v.newamount = t6255;
		if (((f.v.newamount)) === ((null))) f.pc=-1; else f.pc=5;
	},
/*5*/	function (e,f) { e.smcall (1, lib,"parse_price_simple", ([f.v.newamount])); },
	function (e,f) {
		var t6257 = f.s[0]; f.v.pnewamount = t6257;
		if (((f.v.pnewamount)) !== ((null))) f.pc=7; else f.pc=2;
	},
	function (e,f) { e.mcall (4, f.v["this"], "do_receive_money", ([f.v.pnewamount, f.v.newstate])); },
	function (e,f) {  },
null	];

;
	c.pargs__cbx =  [];
	c.pinst__cbx =  [
/*0*/	function (e,f) { e.return_pop (("CBX") + ((f.v["this"]).rowid)); },
null	];

;
	c.args__state_name = c.pargs__state_name =  ["state"];
	c.inst__state_name = c.pinst__state_name =  [
/*0*/	function (e,f) { if (((f.v.state)) == ((0))) f.pc=1; else f.pc=2; },
	function (e,f) { e.return_pop ("Pending"); },
	function (e,f) { if (((f.v.state)) == ((1))) f.pc=3; else f.pc=4; },
	function (e,f) { e.return_pop ("Void"); },
	function (e,f) { if (((f.v.state)) == ((2))) f.pc=5; else f.pc=6; },
/*5*/	function (e,f) { e.return_pop ("Confirmed"); },
	function (e,f) { if (((f.v.state)) == ((4))) f.pc=7; else f.pc=8; },
	function (e,f) { e.return_pop ("Received"); },
	function (e,f) { if (((f.v.state)) == ((3))) f.pc=9; else f.pc=10; },
	function (e,f) { e.return_pop ("Refunded"); },
/*10*/	function (e,f) { e.return_pop ("undefined"); },
null	];

;
	c.args__is_end_state = c.pargs__is_end_state =  ["state"];
	c.inst__is_end_state = c.pinst__is_end_state =  [
/*0*/	function (e,f) { if (((f.v.state)) == ((0))) f.pc=2; else f.pc=3; },
	function (e,f) { e.return_pop (false); },
	function (e,f) {
		f.pc=4;
		f.s[0] = true;
	},
	function (e,f) { f.s[0] = ((f.v.state)) == ((4)); },
	function (e,f) { var t6258 = f.s[0]; if (t6258) f.pc=1; else f.pc=5; },
/*5*/	function (e,f) { e.return_pop (true); },
null	];

;
	c.pargs__export =  [];
	c.pinst__export =  [
/*0*/	function (e,f) {
		f.v.res = ([]);
		e.mcall (2, f.v["this"], "cbx", ([]));
	},
	function (e,f) {
		var t6261 = f.s[0]; f.v.res[f.v.res.length] = t6261;
		f.v.res[f.v.res.length] = builtin__date ("dS M Y H:i",(f.v["this"]).dt);
		e.smcall (0, payment,"payment_types", ([]));
	},
	function (e,f) {
		var t6264 = f.s[0]; f.v.pts = t6264;
		f.v.res[f.v.res.length] = ((f.v.pts)[((f.v["this"]).paytype)]).label;
		f.v.res[f.v.res.length] = (f.v["this"]).payer;
		e.smcall (1, lib,"render_price_simple", ([(f.v["this"]).amount]));
	},
	function (e,f) {
		var t6268 = f.s[0]; f.v.res[f.v.res.length] = t6268;
		f.v.res[f.v.res.length] = ((f.v["this"]).cfg).title;
		f.v.res[f.v.res.length] = (f.v["this"]).payref;
		e.smcall (1, payment,"state_name", ([(f.v["this"]).state]));
	},
	function (e,f) {
		var t6272 = f.s[0]; f.v.res[f.v.res.length] = t6272;
		e.return_pop (f.v.res);
	},
null	];

;
	c.pargs__render_row =  [];
	c.pinst__render_row =  [
/*0*/	function (e,f) {
		window.__outbuffer += "<tr>";
		f.v.style = "";
		if ((((f.v["this"]).state)) == ((0))) f.pc=1; else f.pc=2;
	},
	function (e,f) { f.v.style = "color:orange"; },
	function (e,f) { if ((((f.v["this"]).state)) == ((4))) f.pc=3; else f.pc=4; },
	function (e,f) {
		f.pc=11;
		f.v.style = "color:olive";
	},
	function (e,f) { if ((((f.v["this"]).state)) == ((2))) f.pc=5; else f.pc=6; },
/*5*/	function (e,f) {
		f.pc=11;
		f.v.style = "color:green";
	},
	function (e,f) { if ((((f.v["this"]).state)) == ((1))) f.pc=8; else f.pc=9; },
	function (e,f) {
		f.pc=11;
		f.v.style = "text-decoration:line-through";
	},
	function (e,f) {
		f.pc=10;
		f.s[0] = true;
	},
	function (e,f) { f.s[0] = (((f.v["this"]).state)) == ((3)); },
/*10*/	function (e,f) { var t6278 = f.s[0]; if (t6278) f.pc=7; else f.pc=11; },
	function (e,f) {
		f.s[0] = "</td>";
		e.mcall (3, f.v["this"], "cbx", ([]));
	},
	function (e,f) {
		var t6279 = f.s[1]; var t6280 = f.s[0]; 
		window.__outbuffer += ("<td>") + ("" + (t6279) + (t6280));
		window.__outbuffer += ("<td style=\"") + ("" + (f.v.style) + (("\">") + ("" + (builtin__date ("dS M Y H:i",(f.v["this"]).dt)) + ("</td>"))));
		e.smcall (0, payment,"payment_types", ([]));
	},
	function (e,f) {
		var t6282 = f.s[0]; f.v.pts = t6282;
		window.__outbuffer += ("<td style=\"") + ("" + (f.v.style) + (("\">") + ("" + (((f.v.pts)[((f.v["this"]).paytype)]).label) + ("</td>"))));
		window.__outbuffer += ("<td style=\"") + ("" + (f.v.style) + (("\">") + ("" + ((f.v["this"]).payer) + ("</td>"))));
		window.__outbuffer += ("<td style=\"") + ("" + (f.v.style) + ("\">"));
		f.s[0] = 0;
		f.s[1] = (f.v["this"]).amount;
		e.php_two_op (2, ">=");
		var t6283 = f.s[0]; if (t6283) f.pc=14; else f.pc=16;
	},
	function (e,f) { e.smcall (1, lib,"render_price", ([(f.v["this"]).amount])); },
/*15*/	function (e,f) {
		f.pc=18;
		var t6284 = f.s[0]; 
		window.__outbuffer += ("Payment of ") + (t6284);
	},
	function (e,f) { e.smcall (1, lib,"render_price", ([(f.v["this"]).amount])); },
	function (e,f) {
		var t6285 = f.s[0]; 
		window.__outbuffer += ("Refund of ") + (t6285);
	},
	function (e,f) {
		window.__outbuffer += "</td>";
		window.__outbuffer += ("<td style=\"") + ("" + (f.v.style) + (("\">") + ("" + (((f.v["this"]).cfg).title) + ("</td>"))));
		window.__outbuffer += ("<td style=\"") + ("" + (f.v.style) + ("\">"));
		if ((((f.v["this"]).payref)) != ((""))) f.pc=19; else f.pc=20;
	},
	function (e,f) { window.__outbuffer += ("(ref ") + ("" + ((f.v["this"]).payref) + (")")); },
/*20*/	function (e,f) {
		window.__outbuffer += "</td>";
		f.s[0] = "</td>";
		e.smcall (2, payment,"state_name", ([(f.v["this"]).state]));
	},
	function (e,f) {
		var t6286 = f.s[1]; var t6287 = f.s[0]; 
		window.__outbuffer += ("<td>") + ("" + (t6286) + (t6287));
		if ((((f.v["this"]).state)) == ((0))) f.pc=22; else f.pc=31;
	},
	function (e,f) {
		f.s[0] = "\">Void</a></td>";
		e.mcall (5, f.v["this"], "render_start", (["change_payment_state", 1]));
	},
	function (e,f) {
		f.pc=29;
		var t6288 = f.s[1]; var t6289 = f.s[0]; 
		window.__outbuffer += ("<td><a href=\"#\" onclick=\"") + ("" + (t6288) + (t6289));
		window.__outbuffer += "<td style=\"background:yellow\">";
		e.mcall (2, f.v["this"], "payment_instructions", ([]));
	},
	function (e,f) {
		f.s[0] = "\">How do I pay?</a>";
		e.mcall (5, f.v["this"], "render_start", (["payhelp", null]));
	},
/*25*/	function (e,f) {
		f.pc=30;
		var t6290 = f.s[1]; var t6291 = f.s[0]; 
		window.__outbuffer += ("<a href=\"#\" onclick=\"") + ("" + (t6290) + (t6291));
	},
	function (e,f) { if ((((f.v["this"]).paytype)) == (("paypal"))) f.pc=27; else f.pc=30; },
	function (e,f) {
		f.s[0] = "\">Retry</a>";
		e.mcall (5, f.v["this"], "render_start", (["paypal_retry", null]));
	},
	function (e,f) {
		f.pc=30;
		var t6292 = f.s[1]; var t6293 = f.s[0]; 
		window.__outbuffer += ("<a href=\"#\" onclick=\"") + ("" + (t6292) + (t6293));
	},
	function (e,f) { var t6294 = f.s[0]; if (t6294) f.pc=24; else f.pc=26; },
/*30*/	function (e,f) {
		f.pc=32;
		window.__outbuffer += "</td>";
	},
	function (e,f) { window.__outbuffer += "<td></td><td></td>"; },
	function (e,f) {
		f.pc=46;
		e.mcall (2, (f.v["this"]).obj, "is_admin", ([]));
	},
	function (e,f) { if ((((f.v["this"]).state)) == ((0))) f.pc=34; else f.pc=37; },
	function (e,f) {
		f.s[0] = "\">Receive</a></td>";
		e.mcall (5, f.v["this"], "render_start", (["receive_money", 4]));
	},
/*35*/	function (e,f) {
		var t6295 = f.s[1]; var t6296 = f.s[0]; 
		window.__outbuffer += ("<td><a href=\"#\" onclick=\"") + ("" + (t6295) + (t6296));
		f.s[0] = "\">Confirm</a></td>";
		e.mcall (5, f.v["this"], "render_start", (["receive_money", 2]));
	},
	function (e,f) {
		f.pc=44;
		var t6297 = f.s[1]; var t6298 = f.s[0]; 
		window.__outbuffer += ("<td><a href=\"#\" onclick=\"") + ("" + (t6297) + (t6298));
	},
	function (e,f) { if ((((f.v["this"]).state)) == ((4))) f.pc=38; else f.pc=41; },
	function (e,f) {
		f.s[0] = "\">Void</a></td>";
		e.mcall (5, f.v["this"], "render_start", (["change_payment_state", 1]));
	},
	function (e,f) {
		var t6299 = f.s[1]; var t6300 = f.s[0]; 
		window.__outbuffer += ("<td><a href=\"#\" onclick=\"") + ("" + (t6299) + (t6300));
		f.s[0] = "\">Confirm</a></td>";
		e.mcall (5, f.v["this"], "render_start", (["receive_money", 2]));
	},
/*40*/	function (e,f) {
		f.pc=44;
		var t6301 = f.s[1]; var t6302 = f.s[0]; 
		window.__outbuffer += ("<td><a href=\"#\" onclick=\"") + ("" + (t6301) + (t6302));
	},
	function (e,f) { if ((((f.v["this"]).state)) == ((2))) f.pc=42; else f.pc=44; },
	function (e,f) {
		f.s[0] = "\">Refund</a></td>";
		e.mcall (5, f.v["this"], "render_start", (["change_payment_state", 3]));
	},
	function (e,f) {
		var t6303 = f.s[1]; var t6304 = f.s[0]; 
		window.__outbuffer += ("<td><a href=\"#\" onclick=\"") + ("" + (t6303) + (t6304));
	},
	function (e,f) {
		f.s[0] = "\">Show audit</a></td>";
		e.mcall (5, f.v["this"], "render_start", (["show_audit", null]));
	},
/*45*/	function (e,f) {
		f.pc=47;
		var t6305 = f.s[1]; var t6306 = f.s[0]; 
		window.__outbuffer += ("<td><a href=\"#\" onclick=\"") + ("" + (t6305) + (t6306));
	},
	function (e,f) { var t6307 = f.s[0]; if (t6307) f.pc=33; else f.pc=47; },
	function (e,f) { window.__outbuffer += "</tr>"; },
null	];

;
	c.pargs__get_audit =  [];
	c.pinst__get_audit =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["get_audit", ([])])); },
	function (e,f) { var t6308 = f.s[0]; e.return_pop (t6308); },
null	];

;
	c.pargs__show_audit =  ["el","arg","ev"];
	c.pinst__show_audit =  [
/*0*/	function (e,f) { e.mcall (2, f.v["this"], "get_audit", ([])); },
	function (e,f) {
		var t6310 = f.s[0]; f.v.options = t6310;
		f.v.fields = ([({name:"list", type:"table", options:f.v.options, label:"", width:"800"})]);
		e.smcall (4, popupform,"quick", (["Payment Audit Log", f.v.fields, true, false]));
	},
null	];

;
	c.args__render_history =  ["obj"];
	c.inst__render_history =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_function_async", (["payment", "render_history", ([f.v.obj])])); },
	function (e,f) { var t6312 = f.s[0]; e.return_pop (t6312); },
null	];

;
};
payment.init_methods (payment);
rpcclass.setup_class (payment, "payment",1, (["dt","owner_class","owner_rowid","payer","amount","paytype","payref","state","obj","cfg","rowid","listeners"]), ([0,0,0,0,0,0,0,0,0,0,0,2]));
function paymentaudit () { this.do_construct (arguments); }
paymentaudit.init_methods = function (c) {
	dbclass.init_methods(c);
	var cp = c.prototype;
};
paymentaudit.init_methods (paymentaudit);
rpcclass.setup_class (paymentaudit, "paymentaudit",1, (["dt","p","ip","pay","msg","rowid","listeners"]), ([0,0,0,0,0,0,2]));
function paymentadmin () { this.do_construct (arguments); }
paymentadmin.init_methods = function (c) {
	hintedsearch.init_methods(c);
	var cp = c.prototype;
	c.pargs__open_record =  ["el","ab","ev"];
	c.pinst__open_record =  [
/*0*/	function (e,f) { /* This is a NOP */ },
null	];

;
	c.pargs__hint =  ["terms","options"];
	c.pinst__hint =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["hint", ([f.v.terms, f.v.options])])); },
	function (e,f) { var t6313 = f.s[0]; e.return_pop (t6313); },
null	];

;
	c.pargs__get_search_options =  ["form"];
	c.pinst__get_search_options =  [
/*0*/	function (e,f) {
		f.v.res = ({states:([])});
		f.v.i = 0;
	},
	function (e,f) {
		f.pc=4;
		if (!(((f.v.i)) < ((5)))) f.pc=2;
	},
	function (e,f) {
		f.v.res.paytype = ((f.v.form).paytype).value;
		e.return_pop (f.v.res);
	},
	function (e,f) {
		f.pc=5;
		(f.v.res).states[(f.v.res).states.length] = f.v.i;
	},
	function (e,f) { if (((f.v.form)[(("state_") + ("" + (f.v.i) + ("_enabled")))]).checked) f.pc=3; else f.pc=5; },
/*5*/	function (e,f) {
		f.pc=1;
		e.php_push_var_lvalue (0, "i");
		e.php_postinc (1);
	},
null	];

;
	c.pargs__export_all =  ["el","arg","ev"];
	c.pinst__export_all =  [
/*0*/	function (e,f) { e.mcall (2, f.v["this"], "form", ([])); },
	function (e,f) { var t6319 = f.s[0]; e.mcall (3, f.v["this"], "get_search_options", ([t6319])); },
	function (e,f) {
		var t6320 = f.s[0]; 
		f.v.options = builtin__serialize (t6320);
		e.mcall (2, f.v["this"], "searchbox", ([]));
	},
	function (e,f) {
		var t6323 = f.s[0]; f.v.searchbox = t6323;
		e.smcall (3, page_dispatcher,"makelink", (["paymentadmin", "export", ({options:f.v.options, terms:(f.v.searchbox).value})]));
	},
	function (e,f) { e.php_static_method_call (1, browser,"redirect", 1); },
null	];

;
	c.args__payment_url = c.pargs__payment_url =  [];
	c.inst__payment_url = c.pinst__payment_url =  [
/*0*/	function (e,f) { e.smcall (3, page_dispatcher,"makelink", (["paymentadmin", "handle_payment_page", ([])])); },
	function (e,f) { var t6325 = f.s[0]; e.return_pop (t6325); },
null	];

;
	c.args__handle_payments = c.pargs__handle_payments =  ["el","arg","ev"];
	c.inst__handle_payments = c.pinst__handle_payments =  [
/*0*/	function (e,f) { e.smcall (0, paymentadmin,"payment_url", ([])); },
	function (e,f) { e.php_static_method_call (1, browser,"redirect", 1); },
null	];

;
};
paymentadmin.init_methods (paymentadmin);
rpcclass.setup_class (paymentadmin, "paymentadmin",0, (["searchval","unique_result","allow_empty","timer_id","listeners"]), ([0,0,0,0,2]));
function serviceItem () { this.do_construct (arguments); }
serviceItem.codegroup = "serviceBuilder";
serviceItem.init_methods = function (c) {
	dbclass.init_methods(c);
	var cp = c.prototype;
	c.pargs__do_delete_row =  null;
	c.pargs__save_info =  null;
	c.pargs__save_properties =  null;
	c.pargs__change_notification =  null;
	c.pargs__explode_properties =  null;
	c.pargs__implode_properties =  null;
	c.pargs__get_property =  null;
	c.pargs__set_property =  null;
	c.args__watch_new_items =  null;
	c.args__create_tableitem =  null;
	c.args__create_reading =  null;
	c.args__create_other =  null;
	c.pargs__call_table_helper =  null;
	c.pargs__dragstart =  null;
	c.args__do_fetch_item =  null;
	c.args__fetch_item = c.pargs__fetch_item =  null;
	c.pargs__choose_tableitem =  null;
	c.pargs__onclick_tableitem =  null;
	c.pargs__choose_reading =  null;
	c.pargs__onclick_reading =  null;
	c.pargs__onclick_other =  null;
	c.pargs__set_work_done =  null;
	c.pargs__fetch_tableitem_object =  null;
	c.pargs__find_tableitem_object =  null;
	c.pargs__set_work_pending =  null;
	c.pargs__oncontextmenu =  null;
	c.pargs__get_row_fields =  null;
};
serviceItem.init_methods (serviceItem);
rpcclass.setup_class (serviceItem, "serviceItem",0, (["serviceId","atypeId","itemType","itemValue","itemRef","properties","owner","tabclass","rowid","listeners"]), ([0,0,0,0,0,0,0,0,0,2]));
function serviceTemplate () { this.do_construct (arguments); }
serviceTemplate.codegroup = "serviceBuilder";
serviceTemplate.init_methods = function (c) {
	dbclass.init_methods(c);
	var cp = c.prototype;
	c.args__get_templates =  null;
	c.args__save_template =  null;
	c.pargs__make_instance =  null;
	c.pargs__destroy =  null;
};
serviceTemplate.init_methods (serviceTemplate);
rpcclass.setup_class (serviceTemplate, "serviceTemplate",0, (["name","order","rowid","listeners"]), ([0,0,0,2]));
function service () { this.do_construct (arguments); }
service.codegroup = "serviceBuilder";
service.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
	c.args__helper_name = c.pargs__helper_name =  null;
	c.args__get_summary = c.pargs__get_summary =  null;
	c.pargs__reorder =  null;
	c.pargs__get_row_fields =  null;
	c.pargs__save_order =  null;
	c.args__add_menu_item = c.pargs__add_menu_item =  null;
	c.pargs__insert_row =  null;
	c.pargs__remove_row =  null;
	c.pargs__context_menu =  null;
	c.pargs__new_name =  null;
	c.pargs__get_service_items =  null;
	c.pargs__order_changed =  null;
	c.pargs__set_lock_safe =  null;
	c.pargs__set_lock =  null;
	c.pargs__is_locked =  null;
	c.pargs__can_write =  null;
	c.pargs__is_readonly =  null;
	c.pargs__template_button =  null;
	c.args__handle_uploaded_template =  null;
	c.args__upload_template = c.pargs__upload_template =  null;
	c.args__upload_oos_template = c.pargs__upload_oos_template =  null;
	c.args__upload_vid_template = c.pargs__upload_vid_template =  null;
};
service.init_methods (service);
rpcclass.setup_class (service, "service",0, (["order","order_array","locked","dtm","event","atype","activity","is_organiser","listeners"]), ([0,0,0,0,0,1,0,2,2]));
function calendar_entry_editor () { this.do_construct (arguments); }
calendar_entry_editor.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
	c.pargs__clicked =  ["action"];
	c.pinst__clicked =  [
/*0*/	function (e,f) { if (((f.v.action)) == (("fill_title"))) f.pc=1; else f.pc=-1; },
	function (e,f) { e.smcall (0, menu,"create", ([])); },
	function (e,f) {
		var t6583 = f.s[0]; f.v.m = t6583;
		f.v._k420 = e.enumkeys (((f.v["this"]).obj).atypes);
	},
	function (e,f) {
		f.pc=5;
		if (!((f.v._k420).length)) f.pc=4;
	},
	function (e,f) {
		f.pc=6;
		e.smcall (1, popupmenu,"run", ([f.v.m]));
	},
/*5*/	function (e,f) {
		f.pc=3;
		f.s[0] = f.v._i421 = (f.v._k420).shift();
		f.s[1] = f.v.atype = (((f.v["this"]).obj).atypes)[(f.v._i421)];
		e.mcall (6, f.v.m, "add_item", ([f.v.atype, (f.v.atype).nicename]));
	},
	function (e,f) {
		var t6588 = f.s[0]; f.v.atype = t6588;
		if (((f.v.atype)) !== ((null))) f.pc=7; else f.pc=-1;
	},
	function (e,f) { e.mcall (3, (f.v["this"]).form, "get_element", (["title"])); },
	function (e,f) {
		var t6590 = f.s[0]; f.v.el = t6590;
		e.smcall (1, calendarEvent,"proxy_title", ([f.v.atype]));
	},
	function (e,f) { var t6591 = f.s[0]; e.mcall (3, f.v.el, "set_current_value", ([t6591])); },
null	];

;
	c.pargs__run =  ["obj","dt","layer"];
	c.pinst__run =  [
/*0*/	function (e,f) { if (((f.v.obj)) === ((null))) f.pc=1; else f.pc=2; },
	function (e,f) {
		f.pc=4;
		f.v.title = "Create New Entry";
		f.v.v = ({time:f.v.dt, date:f.v.dt, layername:(f.v.layer).name});
		f.v.can_delete = false;
	},
	function (e,f) {
		f.v.title = "Edit entry";
		f.v.v = f.v.obj;
		f.v.v.layername = ((f.v.obj).layer).name;
		e.mcall (2, f.v.obj, "i_own_everything", ([]));
	},
	function (e,f) { var t6599 = f.s[0]; f.v.can_delete = t6599; },
	function (e,f) {
		f.v["this"].obj = f.v.obj;
		f.v.fields = ([({name:"layername", type:"label", label:"Calendar"}), ({name:"time", type:"time", label:"Time", required:"1"}), ({name:"date", type:"date", label:"Date", required:"1"}), ({name:"title", type:"text", label:"Title", required:"1", width:"400"})]);
		if (((f.v.obj)) !== ((null))) f.pc=6; else f.pc=7;
	},
/*5*/	function (e,f) {
		f.pc=9;
		f.v.fields[f.v.fields.length] = ({name:"fill_title", type:"button", label:"Act Title", action:"fill_title"});
	},
	function (e,f) {
		f.pc=8;
		f.s[0] = ((builtin__count ((f.v.obj).atypes))) > ((0));
	},
	function (e,f) { f.s[0] = false; },
	function (e,f) { var t6603 = f.s[0]; if (t6603) f.pc=5; else f.pc=9; },
	function (e,f) {
		f.v.fields[f.v.fields.length] = ({type:"ok"});
		f.v.fields[f.v.fields.length] = ({name:"cancel", type:"button", label:"Cancel", action:"cancel"});
		e.smcall (3, form,"create", ([f.v["this"], f.v.fields, f.v.v]));
	},
/*10*/	function (e,f) {
		var t6607 = f.s[0]; f.v["this"].form = t6607;
		e.mcall (3, (f.v["this"]).form, "focus", ([3]));
	},
	function (e,f) { e.mcall (5, (f.v["this"]).form, "popup", ([0, 0, f.v.title])); },
	function (e,f) {
		var t6609 = f.s[0]; f.v.vals = t6609;
		if (((f.v.vals)) === ((null))) f.pc=13; else f.pc=14;
	},
	function (e,f) { e.return_pop (null); },
	function (e,f) {
		f.v.vals.dt = builtin__mktime (builtin__date ("H",(f.v.vals).time),builtin__date ("i",(f.v.vals).time),0,builtin__date ("m",(f.v.vals).date),builtin__date ("d",(f.v.vals).date),builtin__date ("Y",(f.v.vals).date));
		e.smcall (3, calendarEvent,"modify_entry", ([(f.v["this"]).obj, f.v.vals, f.v.layer]));
	},
/*15*/	function (e,f) {
		var t6612 = f.s[0]; f.v.obj = t6612;
		if (((f.v.obj)) !== ((null))) f.pc=16; else f.pc=17;
	},
	function (e,f) { e.smcall (1, calendar,"cal_rerender_one_day", ([(f.v.vals).date])); },
	function (e,f) {
		f.v["this"].obj = f.v.obj;
		e.return_pop (f.v.vals);
	},
null	];

;
	c.args__run_dialog = c.pargs__run_dialog =  ["obj","dt","layer"];
	c.inst__run_dialog = c.pinst__run_dialog =  [
/*0*/	function (e,f) {
		f.v.ed = new calendar_entry_editor;
		e.mcall (5, f.v.ed, "run", ([f.v.obj, f.v.dt, f.v.layer]));
	},
	function (e,f) { var t6615 = f.s[0]; e.return_pop (t6615); },
null	];

;
};
calendar_entry_editor.init_methods (calendar_entry_editor);
rpcclass.setup_class (calendar_entry_editor, "calendar_entry_editor",0, (["obj","form","listeners"]), ([0,0,2]));
function calendarEvent () { this.do_construct (arguments); }
calendarEvent.init_methods = function (c) {
	dbclass.init_methods(c);
	var cp = c.prototype;
	c.args__proxy_title = c.pargs__proxy_title =  ["atype"];
	c.inst__proxy_title = c.pinst__proxy_title =  [
/*0*/	function (e,f) { e.return_pop (("{use title of ") + ("" + ((f.v.atype).nicename) + ((":") + ("" + ((f.v.atype).rowid) + ("}"))))); },
null	];

;
	c.pargs__set_schedule =  ["rt"];
	c.pinst__set_schedule =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["set_schedule", ([f.v.rt])])); },
	function (e,f) { var t6616 = f.s[0]; e.return_pop (t6616); },
null	];

;
	c.pargs__header_field_changed =  ["msg"];
	c.pinst__header_field_changed =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "send_msg", (["update_notification", null])); },
null	];

;
	c.args__find =  ["rowid"];
	c.inst__find =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_function_async", (["calendarEvent", "find", ([f.v.rowid])])); },
	function (e,f) { var t6617 = f.s[0]; e.return_pop (t6617); },
null	];

;
	c.pargs__previous_event =  ["atype"];
	c.pinst__previous_event =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["previous_event", ([f.v.atype])])); },
	function (e,f) { var t6618 = f.s[0]; e.return_pop (t6618); },
null	];

;
	c.pargs__get_recent_events =  ["atype"];
	c.pinst__get_recent_events =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["get_recent_events", ([f.v.atype])])); },
	function (e,f) { var t6619 = f.s[0]; e.return_pop (t6619); },
null	];

;
	c.pargs__get_nearby_events =  ["atype"];
	c.pinst__get_nearby_events =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["get_nearby_events", ([f.v.atype])])); },
	function (e,f) { var t6620 = f.s[0]; e.return_pop (t6620); },
null	];

;
	c.pargs__open_editor =  ["act"];
	c.pinst__open_editor =  [
/*0*/	function (e,f) { e.mcall (2, f.v.act, "editor_url", ([])); },
	function (e,f) { var t6622 = f.s[0]; window.location = t6622; },
null	];

;
	c.pargs__add_atype =  ["atype","repeating"];
	c.pinst__add_atype =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["add_atype", ([f.v.atype, f.v.repeating])])); },
	function (e,f) { var t6623 = f.s[0]; e.return_pop (t6623); },
null	];

;
	c.pargs__remove_atype =  ["atype","repeating"];
	c.pinst__remove_atype =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["remove_atype", ([f.v.atype, f.v.repeating])])); },
	function (e,f) { var t6624 = f.s[0]; e.return_pop (t6624); },
null	];

;
	c.pargs__includes_atype =  ["atype"];
	c.pinst__includes_atype =  [
/*0*/	function (e,f) { e.return_pop (builtin__in_array (f.v.atype,(f.v["this"]).atypes)); },
null	];

;
	c.pargs__get_fields =  ["fieldspecs","ensure_present"];
	c.pinst__get_fields =  [
/*0*/	function (e,f) {
		f.v.res = ([]);
		f.v.i = 0;
	},
	function (e,f) {
		f.pc=3;
		if (!(((f.v.fieldspecs)[(f.v.i)]) !== undefined)) f.pc=2;
	},
	function (e,f) { e.return_pop (f.v.res); },
	function (e,f) {
		f.v.first = f.v.i;
		f.v.atype = ((f.v.fieldspecs)[(f.v.first)]).atype;
		f.v.fsl = ([]);
	},
	function (e,f) { if (((f.v.fieldspecs)[(f.v.i)]) !== undefined) f.pc=6; else f.pc=7; },
/*5*/	function (e,f) {
		f.pc=10;
		e.mcall (3, f.v["this"], "get_activity", ([f.v.atype]));
	},
	function (e,f) {
		f.pc=8;
		f.s[0] = ((((f.v.fieldspecs)[(f.v.i)]).atype)) == ((f.v.atype));
	},
	function (e,f) { f.s[0] = false; },
	function (e,f) { var t6630 = f.s[0]; if (!(t6630)) f.pc=5; },
	function (e,f) {
		f.pc=4;
		f.v.fsl[f.v.fsl.length] = (f.v.fieldspecs)[(f.v.i)];
		e.php_push_var_lvalue (0, "i");
		e.php_postinc (1);
	},
/*10*/	function (e,f) {
		var t6634 = f.s[0]; f.v.act = t6634;
		if (((f.v.act)) === ((null))) f.pc=11; else f.pc=14;
	},
	function (e,f) {
		f.s[0] = builtin__error_log (("*** Failed to find activity object for activityType ") + ("" + ((f.v.atype).rowid) + ((" for event ") + ((f.v["this"]).rowid))));
		f.v._k422 = e.enumkeys (f.v.fsl);
	},
	function (e,f) { if (!((f.v._k422).length)) f.pc=1; },
	function (e,f) {
		f.pc=12;
		f.s[0] = f.v._i423 = (f.v._k422).shift();
		f.s[1] = f.v.fs = (f.v.fsl)[(f.v._i423)];
		f.v.res[f.v.res.length] = null;
	},
	function (e,f) { e.mcall (4, f.v.act, "get_fields", ([f.v.fsl, f.v.ensure_present])); },
/*15*/	function (e,f) {
		var t6640 = f.s[0]; f.v.xres = t6640;
		f.v._k424 = e.enumkeys (f.v.xres);
	},
	function (e,f) { if (!((f.v._k424).length)) f.pc=1; },
	function (e,f) {
		f.pc=16;
		f.s[0] = f.v._i425 = (f.v._k424).shift();
		f.s[1] = f.v.r = (f.v.xres)[(f.v._i425)];
		f.v.res[f.v.res.length] = f.v.r;
	},
null	];

;
	c.pargs__get_field =  ["fieldspec","ensure_present"];
	c.pinst__get_field =  [
/*0*/	function (e,f) {
		f.v.fieldspecs = ([]);
		f.v.fieldspecs[f.v.fieldspecs.length] = f.v.fieldspec;
		e.mcall (4, f.v["this"], "get_fields", ([f.v.fieldspecs, f.v.ensure_present]));
	},
	function (e,f) {
		var t6648 = f.s[0]; f.v.res = t6648;
		e.return_pop ((f.v.res)[(0)]);
	},
null	];

;
	c.args__my_upcoming_roles =  [];
	c.inst__my_upcoming_roles =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_function_async", (["calendarEvent", "my_upcoming_roles", ([])])); },
	function (e,f) { var t6649 = f.s[0]; e.return_pop (t6649); },
null	];

;
	c.pargs__get_activity =  ["atype"];
	c.pinst__get_activity =  [
/*0*/	function (e,f) { f.v._k426 = e.enumkeys ((f.v["this"]).activities); },
	function (e,f) {
		f.pc=3;
		if (!((f.v._k426).length)) f.pc=2;
	},
	function (e,f) { e.return_pop (null); },
	function (e,f) {
		f.s[0] = f.v._i427 = (f.v._k426).shift();
		f.s[1] = f.v.act = ((f.v["this"]).activities)[(f.v._i427)];
		if ((((f.v.act).atype)) == ((f.v.atype))) f.pc=4; else f.pc=1;
	},
	function (e,f) { e.return_pop (f.v.act); },
null	];

;
	c.pargs__oncalendarclick =  ["el","junk"];
	c.pinst__oncalendarclick =  [
/*0*/	function (e,f) { /* This is a NOP */ },
null	];

;
	c.pargs__oncalendarcontextmenu =  ["el","junk"];
	c.pinst__oncalendarcontextmenu =  [
/*0*/	function (e,f) { /* This is a NOP */ },
null	];

;
	c.pargs__nicename =  [];
	c.pinst__nicename =  [
/*0*/	function (e,f) {
		f.v.matches = ([]);
		if ((((f.v["this"]).title)) == ((""))) f.pc=1; else f.pc=9;
	},
	function (e,f) { if (builtin__count ((f.v["this"]).activities)) f.pc=2; else f.pc=8; },
	function (e,f) {
		f.v.act = ((f.v["this"]).activities)[(0)];
		f.v._k428 = e.enumkeys ((f.v["this"]).activities);
	},
	function (e,f) {
		f.pc=5;
		if (!((f.v._k428).length)) f.pc=4;
	},
	function (e,f) {
		f.pc=7;
		e.mcall (2, f.v.act, "nicename", ([]));
	},
/*5*/	function (e,f) {
		f.s[0] = f.v._i429 = (f.v._k428).shift();
		f.s[1] = f.v.xact = ((f.v["this"]).activities)[(f.v._i429)];
		if (((((f.v.xact).atype).helperclass)) != ((""))) f.pc=6; else f.pc=3;
	},
	function (e,f) {
		f.pc=3;
		f.v.act = f.v.xact;
	},
	function (e,f) { var t6659 = f.s[0]; e.return_pop (t6659); },
	function (e,f) { e.return_pop ("no title"); },
	function (e,f) { if (builtin__preg_match ("/^\\x7buse[^\\x7d]*\\:([0-9]+)\\x7d$/",(f.v["this"]).title,f.v.matches)) f.pc=10; else f.pc=18; },
/*10*/	function (e,f) { e.smcall (1, activityType,"get_by_id", ([(f.v.matches)[(1)]])); },
	function (e,f) {
		var t6661 = f.s[0]; f.v.atype = t6661;
		if (((f.v.atype)) === ((null))) f.pc=12; else f.pc=13;
	},
	function (e,f) { e.return_pop ("Bad title"); },
	function (e,f) { e.mcall (3, f.v["this"], "get_activity", ([f.v.atype])); },
	function (e,f) {
		var t6663 = f.s[0]; f.v.act = t6663;
		if (((f.v.act)) === ((null))) f.pc=15; else f.pc=16;
	},
/*15*/	function (e,f) { e.return_pop ("Bad title"); },
	function (e,f) { e.mcall (2, f.v.act, "nicename", ([])); },
	function (e,f) { var t6664 = f.s[0]; e.return_pop (t6664); },
	function (e,f) { e.return_pop ((f.v["this"]).title); },
null	];

;
	c.pargs__i_own_everything =  [];
	c.pinst__i_own_everything =  [
/*0*/	function (e,f) {
		f.pc=2;
		e.mcall (2, f.v["this"], "can_edit", ([]));
	},
	function (e,f) { e.return_pop (false); },
	function (e,f) {
		var t6665 = f.s[0]; 
		if (!(t6665)) f.pc=1; else f.pc=3;
	},
	function (e,f) { f.v._k430 = e.enumkeys ((f.v["this"]).activities); },
	function (e,f) {
		f.pc=6;
		if (!((f.v._k430).length)) f.pc=5;
	},
/*5*/	function (e,f) { e.return_pop (true); },
	function (e,f) {
		f.pc=8;
		f.s[0] = f.v._i431 = (f.v._k430).shift();
		f.s[1] = f.v.act = ((f.v["this"]).activities)[(f.v._i431)];
		e.mcall (4, (f.v.act).atype, "is_owner", ([]));
	},
	function (e,f) { e.return_pop (false); },
	function (e,f) {
		var t6669 = f.s[2]; 
		if (!(t6669)) f.pc=7; else f.pc=4;
	},
null	];

;
	c.pargs__delete_entry =  [];
	c.pinst__delete_entry =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["delete_entry", ([])])); },
	function (e,f) { var t6670 = f.s[0]; e.return_pop (t6670); },
null	];

;
	c.pargs__delete_dialog =  [];
	c.pinst__delete_dialog =  [
/*0*/	function (e,f) {
		f.pc=5;
		e.smcall (1, popupokcancel,"run", (["Are you sure you want to delete this?"]));
	},
	function (e,f) { e.mcall (2, f.v["this"], "delete_entry", ([])); },
	function (e,f) {
		var t6672 = f.s[0]; f.v.msg = t6672;
		if (((f.v.msg)) === ((null))) f.pc=3; else f.pc=4;
	},
	function (e,f) { e.return_pop (null); },
	function (e,f) {
		f.pc=-1;
		e.smcall (1, popupok,"run", ([f.v.msg]));
	},
/*5*/	function (e,f) { var t6673 = f.s[0]; if (t6673) f.pc=1; else f.pc=-1; },
null	];

;
	c.pargs__change_date =  ["d"];
	c.pinst__change_date =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["change_date", ([f.v.d])])); },
	function (e,f) { var t6674 = f.s[0]; e.return_pop (t6674); },
null	];

;
	c.pargs__copy_to =  ["d"];
	c.pinst__copy_to =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["copy_to", ([f.v.d])])); },
	function (e,f) { var t6675 = f.s[0]; e.return_pop (t6675); },
null	];

;
	c.args__modify_entry =  ["obj","res","layer"];
	c.inst__modify_entry =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_function_async", (["calendarEvent", "modify_entry", ([f.v.obj, f.v.res, f.v.layer])])); },
	function (e,f) { var t6676 = f.s[0]; e.return_pop (t6676); },
null	];

;
	c.pargs__can_edit =  [];
	c.pinst__can_edit =  [
/*0*/	function (e,f) { e.mcall (2, (f.v["this"]).layer, "can_write", ([])); },
	function (e,f) { var t6677 = f.s[0]; e.return_pop (t6677); },
null	];

;
	c.pargs__edit_dialog =  [];
	c.pinst__edit_dialog =  [
/*0*/	function (e,f) { e.smcall (3, calendar_entry_editor,"run_dialog", ([f.v["this"], 0, null])); },
null	];

;
	c.args__quick_create =  ["dt","atype","layer"];
	c.inst__quick_create =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_function_async", (["calendarEvent", "quick_create", ([f.v.dt, f.v.atype, f.v.layer])])); },
	function (e,f) { var t6678 = f.s[0]; e.return_pop (t6678); },
null	];

;
	c.pargs__popup =  [];
	c.pinst__popup =  [
/*0*/	function (e,f) {
		f.v.pop = new popup;
		e.mcall (2, f.v.pop, "initialise", ([]));
	},
	function (e,f) {
		f.s[0] = builtin__ob_start ();
		window.__outbuffer += "\n<div><div style=\"float:right\"><a href=\"#\" onclick=\"";
		e.mcall (4, f.v["this"], "render_resume", (["close", null]));
	},
	function (e,f) {
		var t6680 = f.s[0]; window.__outbuffer += t6680;
		window.__outbuffer += "\"><img style=\"border:none\" src=\"/churchbuilder/graphics/close-22.png\" alt=\"close\" /></a></div>\n<h3 style=\"clear:none\">";
		if (((((f.v["this"]).layer).name)) == (("Public"))) f.pc=3; else f.pc=4;
	},
	function (e,f) {
		f.pc=5;
		f.s[0] = "";
	},
	function (e,f) { f.s[0] = "" + (((f.v["this"]).layer).name) + (" "); },
/*5*/	function (e,f) {
		var t6681 = f.s[0]; window.__outbuffer += t6681;
		window.__outbuffer += "";
		window.__outbuffer += builtin__date ("dS M Y H:i",(f.v["this"]).datetime);
		window.__outbuffer += "</h3>\n<h2>";
		e.mcall (2, f.v["this"], "nicename", ([]));
	},
	function (e,f) {
		f.pc=9;
		var t6682 = f.s[0]; window.__outbuffer += t6682;
		window.__outbuffer += "</h2>\n";
		e.mcall (2, f.v["this"], "can_edit", ([]));
	},
	function (e,f) {
		window.__outbuffer += "\n<div><div style=\"float:right\"><a href=\"#\" onclick=\"";
		e.mcall (4, f.v["this"], "render_resume", (["edit", null]));
	},
	function (e,f) {
		f.pc=10;
		var t6683 = f.s[0]; window.__outbuffer += t6683;
		window.__outbuffer += "\">edit</a></div></div>\n";
	},
	function (e,f) { var t6684 = f.s[0]; if (t6684) f.pc=7; else f.pc=10; },
/*10*/	function (e,f) {
		window.__outbuffer += "\n</div>\n";
		f.v.html = builtin__ob_get_clean ();
		e.mcall (5, f.v.pop, "open", ([0, 0, f.v.html]));
	},
	function (e,f) {  },
	function (e,f) {
		f.pc=14;
		e.php_builtin (0, "wait_for_input", 0);
	},
	function (e,f) {
		f.pc=22;
		e.mcall (2, f.v.pop, "close", ([]));
	},
	function (e,f) {
		var t6687 = f.s[0]; f.v.event = t6687;
		if ((((f.v.event).action)) == (("edit"))) f.pc=15; else f.pc=17;
	},
/*15*/	function (e,f) { e.mcall (2, f.v["this"], "edit_dialog", ([])); },
	function (e,f) {
		f.pc=13;
		f.v.res = true;
	},
	function (e,f) { if ((((f.v.event).action)) == (("cover"))) f.pc=19; else f.pc=20; },
	function (e,f) {
		f.pc=13;
		f.v.res = false;
	},
	function (e,f) {
		f.pc=21;
		f.s[0] = true;
	},
/*20*/	function (e,f) { f.s[0] = (((f.v.event).action)) == (("close")); },
	function (e,f) { var t6690 = f.s[0]; if (t6690) f.pc=18; else f.pc=12; },
	function (e,f) { e.return_pop (f.v.res); },
null	];

;
	c.pargs__open =  [];
	c.pinst__open =  [
/*0*/	function (e,f) { e.smcall (0, menu,"create", ([])); },
	function (e,f) {
		var t6692 = f.s[0]; f.v.menu = t6692;
		e.smcall (0, activityType,"get_readable_atypes", ([]));
	},
	function (e,f) {
		var t6694 = f.s[0]; f.v.atypes = t6694;
		f.v.count = 0;
		f.v._k432 = e.enumkeys (f.v.atypes);
	},
	function (e,f) {
		f.pc=5;
		if (!((f.v._k432).length)) f.pc=4;
	},
	function (e,f) { if (((f.v.count)) == ((0))) f.pc=9; else f.pc=11; },
/*5*/	function (e,f) {
		f.v._i433 = (f.v._k432).shift();
		f.v.xatype = (f.v.atypes)[(f.v._i433)];
		e.mcall (3, f.v["this"], "get_activity", ([f.v.xatype]));
	},
	function (e,f) {
		var t6700 = f.s[0]; f.v.xact = t6700;
		if (((f.v.xact)) !== ((null))) f.pc=7; else f.pc=3;
	},
	function (e,f) {
		f.v.act = f.v.xact;
		e.mcall (4, f.v.menu, "add_item", ([f.v.act, ("Open ") + ((f.v.xatype).nicename)]));
	},
	function (e,f) {
		f.pc=3;
		e.php_push_var_lvalue (0, "count");
		e.php_postinc (1);
	},
	function (e,f) { e.mcall (2, f.v["this"], "popup", ([])); },
/*10*/	function (e,f) { var t6703 = f.s[0]; e.return_pop (t6703); },
	function (e,f) { if (((f.v.count)) == ((1))) f.pc=12; else f.pc=13; },
	function (e,f) {
		f.pc=-1;
		e.mcall (3, f.v["this"], "open_editor", ([f.v.act]));
	},
	function (e,f) { e.smcall (1, popupmenu,"run", ([f.v.menu])); },
	function (e,f) {
		var t6705 = f.s[0]; f.v.act = t6705;
		if (((f.v.act)) != ((null))) f.pc=15; else f.pc=-1;
	},
/*15*/	function (e,f) { e.mcall (3, f.v["this"], "open_editor", ([f.v.act])); },
null	];

;
};
calendarEvent.init_methods (calendarEvent);
rpcclass.setup_class (calendarEvent, "calendarEvent",1, (["date","time","atypes","activities","schedule","title","layer","datetime","reminder_pending","rowid","listeners"]), ([0,0,0,0,0,0,0,0,0,0,2]));
function calendar_drag () { this.do_construct (arguments); }
calendar_drag.init_methods = function (c) {
	dragndrop2.init_methods(c);
	var cp = c.prototype;
	c.pargs__drag_release =  ["d","is_copy"];
	c.pinst__drag_release =  [
/*0*/	function (e,f) { if (((f.v.d)) !== ((null))) f.pc=1; else f.pc=-1; },
	function (e,f) { if (f.v.is_copy) f.pc=2; else f.pc=4; },
	function (e,f) { e.mcall (3, (f.v["this"]).event, "copy_to", ([f.v.d])); },
	function (e,f) {
		f.pc=-1;
		e.mcall (3, (f.v["this"]).cal, "rerender_day", ([f.v.d]));
	},
	function (e,f) {
		f.v.od = ((f.v["this"]).event).date;
		e.mcall (3, (f.v["this"]).event, "change_date", ([f.v.d]));
	},
/*5*/	function (e,f) { e.mcall (3, (f.v["this"]).cal, "rerender_day", ([f.v.od])); },
	function (e,f) { e.mcall (3, (f.v["this"]).cal, "rerender_day", ([f.v.d])); },
null	];

;
	c.args__arm = c.pargs__arm =  ["delay","cal","event","el"];
	c.inst__arm = c.pinst__arm =  [
/*0*/	function (e,f) {
		f.v.cd = new calendar_drag;
		f.v.cd.cal = f.v.cal;
		e.php_push_static_var (0, rpcclass,"last_start_ctrlkey");
		var t6710 = f.s[0]; f.v.cd.drag_is_copy = t6710;
		f.v.cd.event = f.v.event;
		e.mcall (2, f.v.cal, "get_day_elements", ([]));
	},
	function (e,f) {
		var t6713 = f.s[0]; f.v.days = t6713;
		f.v.targets = ({});
		f.v._k434 = e.enumkeys (f.v.days);
	},
	function (e,f) {
		f.pc=4;
		if (!((f.v._k434).length)) f.pc=3;
	},
	function (e,f) {
		f.pc=-1;
		e.php_push_static_var (1, rpcclass,"last_start_ctrlkey");
		var t6716 = f.s[1]; e.mcall (5, f.v.cd, "arm_helper", ([f.v.el, t6716, f.v.targets]));
	},
	function (e,f) {
		f.v.d = (f.v._k434).shift();
		f.v.tel = (f.v.days)[(f.v.d)];
		if (((f.v.d)) != (((f.v.event).date))) f.pc=5; else f.pc=2;
	},
/*5*/	function (e,f) {
		f.pc=2;
		f.v.targets[f.v.d] = f.v.tel;
	},
null	];

;
};
calendar_drag.init_methods (calendar_drag);
rpcclass.setup_class (calendar_drag, "calendar_drag",0, (["cal","event","el","deltaX","deltaY","old_movehandler","old_uphandler","old_onselectstart","move_fn","up_fn","x","y","dragtimer","arm_el","nel","drag_is_copy","disarm_drag_thunk","arm_x","arm_y","drop_targets","last_hover","saved_style","listeners"]), ([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2]));
function calendar () { this.do_construct (arguments); }
calendar.init_methods = function (c) {
	genericcalendar.init_methods(c);
	var cp = c.prototype;
	c.pargs__add_item =  ["d"];
	c.pinst__add_item =  [
/*0*/	function (e,f) { e.smcall (0, calendarLayer,"writable_layers", ([])); },
	function (e,f) {
		var t6721 = f.s[0]; f.v.wl = t6721;
		if (((builtin__count (f.v.wl))) > ((1))) f.pc=2; else f.pc=9;
	},
	function (e,f) { e.smcall (0, menu,"create", ([])); },
	function (e,f) {
		var t6723 = f.s[0]; f.v.m = t6723;
		f.v._k436 = e.enumkeys (f.v.wl);
	},
	function (e,f) {
		f.pc=6;
		if (!((f.v._k436).length)) f.pc=5;
	},
/*5*/	function (e,f) {
		f.pc=7;
		e.smcall (1, popupmenu,"run", ([f.v.m]));
	},
	function (e,f) {
		f.pc=4;
		f.s[0] = f.v._i437 = (f.v._k436).shift();
		f.s[1] = f.v.layer = (f.v.wl)[(f.v._i437)];
		e.mcall (6, f.v.m, "add_item", ([f.v.layer, (f.v.layer).name]));
	},
	function (e,f) {
		var t6728 = f.s[0]; f.v.layer = t6728;
		if (((f.v.layer)) === ((null))) f.pc=8; else f.pc=10;
	},
	function (e,f) { f.pc=-1; },
	function (e,f) { f.v.layer = (f.v.wl)[(0)]; },
/*10*/	function (e,f) {
		e.php_push_static_var (0, calendar,"usual_times");
		var t6731 = f.s[0]; f.v.times = t6731;
		e.smcall (6, popupcombobox,"run", ([0, 0, "Add new entry - enter time", f.v.times, true, ""]));
	},
	function (e,f) {
		var t6733 = f.s[0]; f.v.time = t6733;
		if (((f.v.time)) === ((null))) f.pc=12; else f.pc=13;
	},
	function (e,f) { f.pc=-1; },
	function (e,f) {
		f.v.matches = ([]);
		if (!(builtin__preg_match ("/(\\d+)\\:(\\d+)/",f.v.time,f.v.matches))) f.pc=14; else f.pc=16;
	},
	function (e,f) { e.smcall (1, popupok,"run", (["Invalid time"])); },
/*15*/	function (e,f) { f.pc=-1; },
	function (e,f) {
		f.v.hours = parseInt ((f.v.matches)[(1)],10);
		f.v.mins = parseInt ((f.v.matches)[(2)],10);
		f.v.dt = builtin__mktime (f.v.hours,f.v.mins,0,builtin__date ("m",f.v.d),builtin__date ("d",f.v.d),builtin__date ("Y",f.v.d));
		e.smcall (0, activityType,"get_owned_atypes", ([]));
	},
	function (e,f) {
		var t6739 = f.s[0]; f.v.atypes = t6739;
		if (((builtin__count (f.v.atypes))) > ((0))) f.pc=18; else f.pc=25;
	},
	function (e,f) { e.smcall (0, menu,"create", ([])); },
	function (e,f) {
		var t6741 = f.s[0]; f.v.m = t6741;
		e.mcall (4, f.v.m, "add_item", (["", "Simple..."]));
	},
/*20*/	function (e,f) { f.v._k438 = e.enumkeys (f.v.atypes); },
	function (e,f) {
		f.pc=23;
		if (!((f.v._k438).length)) f.pc=22;
	},
	function (e,f) {
		f.pc=24;
		e.smcall (1, popupmenu,"run", ([f.v.m]));
	},
	function (e,f) {
		f.pc=21;
		f.s[0] = f.v._i439 = (f.v._k438).shift();
		f.s[1] = f.v.atype = (f.v.atypes)[(f.v._i439)];
		e.mcall (6, f.v.m, "add_item", ([f.v.atype, (f.v.atype).nicename]));
	},
	function (e,f) {
		f.pc=26;
		var t6746 = f.s[0]; f.v.atype = t6746;
	},
/*25*/	function (e,f) { f.v.atype = ""; },
	function (e,f) { if (((f.v.atype)) === ((null))) f.pc=27; else f.pc=28; },
	function (e,f) { f.pc=-1; },
	function (e,f) { if (((f.v.atype)) === ((""))) f.pc=29; else f.pc=31; },
	function (e,f) { e.smcall (3, calendar_entry_editor,"run_dialog", ([null, f.v.dt, f.v.layer])); },
/*30*/	function (e,f) {
		f.pc=33;
		var t6749 = f.s[0]; f.v.obj = t6749;
	},
	function (e,f) { e.smcall (3, calendarEvent,"quick_create", ([f.v.dt, f.v.atype, f.v.layer])); },
	function (e,f) { var t6751 = f.s[0]; f.v.obj = t6751; },
	function (e,f) { if (((f.v.obj)) !== ((null))) f.pc=34; else f.pc=-1; },
	function (e,f) { e.mcall (3, f.v["this"], "rerender_day", ([(f.v.obj).date])); },
null	];

;
	c.pargs__open_event =  ["event"];
	c.pinst__open_event =  [
/*0*/	function (e,f) {
		f.pc=4;
		f.v.d = (f.v.event).date;
		e.mcall (2, f.v.event, "open", ([]));
	},
	function (e,f) { e.mcall (3, f.v["this"], "rerender_day", ([(f.v.event).date])); },
	function (e,f) { if (((f.v.d)) != (((f.v.event).date))) f.pc=3; else f.pc=-1; },
	function (e,f) {
		f.pc=-1;
		e.mcall (3, f.v["this"], "rerender_day", ([f.v.d]));
	},
	function (e,f) { var t6753 = f.s[0]; if (t6753) f.pc=1; else f.pc=-1; },
null	];

;
	c.pargs__oncalendarclick =  ["el","event","ev"];
	c.pinst__oncalendarclick =  [
/*0*/	function (e,f) { e.mcall (3, f.v["this"], "open_event", ([f.v.event])); },
null	];

;
	c.pargs__oncalendarcontextmenu =  ["el","event","ev"];
	c.pinst__oncalendarcontextmenu =  [
/*0*/	function (e,f) { e.smcall (0, menu,"create", ([])); },
	function (e,f) {
		var t6755 = f.s[0]; f.v.m = t6755;
		e.mcall (4, f.v.m, "add_item", (["open", "Open..."]));
	},
	function (e,f) {
		f.pc=9;
		e.mcall (2, f.v.event, "i_own_everything", ([]));
	},
	function (e,f) { e.mcall (4, f.v.m, "add_item", (["edit", "Edit..."])); },
	function (e,f) { if ((((f.v.event).schedule)) === ((null))) f.pc=5; else f.pc=6; },
/*5*/	function (e,f) {
		f.pc=7;
		e.mcall (4, f.v.m, "add_item", (["schedule", "Schedule"]));
	},
	function (e,f) { e.mcall (4, f.v.m, "add_item", (["retire", "Retire"])); },
	function (e,f) {
		f.pc=10;
		e.mcall (4, f.v.m, "add_item", (["delete", "Delete"]));
	},
	function (e,f) {
		f.pc=10;
		e.mcall (4, f.v.m, "add_item", (["summary", "Summary..."]));
	},
	function (e,f) { var t6756 = f.s[0]; if (t6756) f.pc=3; else f.pc=8; },
/*10*/	function (e,f) {
		f.pc=30;
		e.mcall (2, f.v.event, "can_edit", ([]));
	},
	function (e,f) { e.smcall (0, menu,"create", ([])); },
	function (e,f) {
		var t6758 = f.s[0]; f.v.add_menu = t6758;
		e.smcall (0, activityType,"get_owned_atypes", ([]));
	},
	function (e,f) {
		var t6759 = f.s[0]; 
		f.v._k440 = e.enumkeys (t6759);
	},
	function (e,f) {
		f.pc=16;
		if (!((f.v._k440).length)) f.pc=15;
	},
/*15*/	function (e,f) {
		f.pc=20;
		e.mcall (2, f.v.add_menu, "length", ([]));
	},
	function (e,f) {
		f.s[0] = f.v._i441 = (f.v._k440).shift();
		f.s[1] = f.v._i441;
		e.smcall (2, activityType,"get_owned_atypes", ([]));
	},
	function (e,f) {
		var t6762 = f.s[2]; var t6763 = f.s[1]; 
		f.v.atype = (t6762)[(t6763)];
		if (!(builtin__in_array (f.v.atype,(f.v.event).atypes))) f.pc=18; else f.pc=14;
	},
	function (e,f) {
		f.pc=14;
		e.mcall (4, f.v.add_menu, "add_item", ([("add:") + ((f.v.atype).rowid), (f.v.atype).nicename]));
	},
	function (e,f) {
		f.pc=21;
		e.mcall (4, f.v.m, "add_submenu", (["Add activity", f.v.add_menu]));
	},
/*20*/	function (e,f) { var t6765 = f.s[0]; if (t6765) f.pc=19; else f.pc=21; },
	function (e,f) { e.smcall (0, menu,"create", ([])); },
	function (e,f) {
		var t6767 = f.s[0]; f.v.remove_menu = t6767;
		f.v._k442 = e.enumkeys ((f.v.event).atypes);
	},
	function (e,f) {
		f.pc=25;
		if (!((f.v._k442).length)) f.pc=24;
	},
	function (e,f) {
		f.pc=29;
		e.mcall (2, f.v.remove_menu, "length", ([]));
	},
/*25*/	function (e,f) {
		f.pc=27;
		f.v._i443 = (f.v._k442).shift();
		f.v.atype = ((f.v.event).atypes)[(f.v._i443)];
		e.mcall (2, f.v.atype, "is_owner", ([]));
	},
	function (e,f) {
		f.pc=23;
		e.mcall (4, f.v.remove_menu, "add_item", ([("remove:") + ((f.v.atype).rowid), (f.v.atype).nicename]));
	},
	function (e,f) { var t6771 = f.s[0]; if (t6771) f.pc=26; else f.pc=23; },
	function (e,f) {
		f.pc=31;
		e.mcall (4, f.v.m, "add_submenu", (["Remove activity", f.v.remove_menu]));
	},
	function (e,f) { var t6772 = f.s[0]; if (t6772) f.pc=28; else f.pc=31; },
/*30*/	function (e,f) { var t6773 = f.s[0]; if (t6773) f.pc=11; else f.pc=31; },
	function (e,f) { e.smcall (1, popupmenu,"run", ([f.v.m])); },
	function (e,f) {
		var t6775 = f.s[0]; f.v.res = t6775;
		if (((f.v.res)) === ((null))) f.pc=33; else f.pc=34;
	},
	function (e,f) { f.pc=-1; },
	function (e,f) { if (((f.v.res)) == (("open"))) f.pc=35; else f.pc=36; },
/*35*/	function (e,f) {
		f.pc=-1;
		e.mcall (3, f.v["this"], "open_event", ([f.v.event]));
	},
	function (e,f) { if (((f.v.res)) == (("summary"))) f.pc=37; else f.pc=38; },
	function (e,f) {
		f.pc=-1;
		e.mcall (2, f.v.event, "popup", ([]));
	},
	function (e,f) { if (((f.v.res)) == (("edit"))) f.pc=39; else f.pc=43; },
	function (e,f) {
		f.v.d = (f.v.event).date;
		e.mcall (2, f.v.event, "edit_dialog", ([]));
	},
/*40*/	function (e,f) { e.mcall (3, f.v["this"], "rerender_day", ([(f.v.event).date])); },
	function (e,f) { if (((f.v.d)) != (((f.v.event).date))) f.pc=42; else f.pc=-1; },
	function (e,f) {
		f.pc=-1;
		e.mcall (3, f.v["this"], "rerender_day", ([f.v.d]));
	},
	function (e,f) { if (((f.v.res)) == (("delete"))) f.pc=44; else f.pc=46; },
	function (e,f) {
		f.v.d = (f.v.event).date;
		e.mcall (2, f.v.event, "delete_dialog", ([]));
	},
/*45*/	function (e,f) {
		f.pc=-1;
		e.mcall (3, f.v["this"], "rerender_day", ([f.v.d]));
	},
	function (e,f) { if (((f.v.res)) == (("schedule"))) f.pc=47; else f.pc=48; },
	function (e,f) {
		f.pc=-1;
		e.smcall (1, calendarSchedule,"create_dialog", ([f.v.event]));
	},
	function (e,f) { if (((f.v.res)) == (("retire"))) f.pc=49; else f.pc=54; },
	function (e,f) { e.mcall (3, (f.v.event).schedule, "calculate_damage", ([f.v.event])); },
/*50*/	function (e,f) {
		f.pc=53;
		var t6779 = f.s[0]; f.v.damage = t6779;
		e.smcall (1, popupokcancel,"run", (["Are you sure you want to make this the last scheduled instance?"]));
	},
	function (e,f) { e.mcall (3, (f.v.event).schedule, "retire", ([f.v.event])); },
	function (e,f) {
		f.pc=-1;
		var t6781 = f.s[0]; f.v.adl = t6781;
		e.smcall (1, calendar,"cal_rerender_days", ([f.v.adl]));
	},
	function (e,f) { var t6782 = f.s[0]; if (t6782) f.pc=51; else f.pc=-1; },
	function (e,f) { e.smcall (0, activityType,"get_owned_atypes", ([])); },
/*55*/	function (e,f) {
		var t6783 = f.s[0]; 
		f.v._k444 = e.enumkeys (t6783);
	},
	function (e,f) { if (!((f.v._k444).length)) f.pc=-1; },
	function (e,f) {
		f.s[0] = f.v._i445 = (f.v._k444).shift();
		f.s[1] = f.v._i445;
		e.smcall (2, activityType,"get_owned_atypes", ([]));
	},
	function (e,f) {
		var t6786 = f.s[2]; var t6787 = f.s[1]; 
		f.v.atype = (t6786)[(t6787)];
		if (((f.v.res)) == ((("remove:") + ((f.v.atype).rowid)))) f.pc=59; else f.pc=65;
	},
	function (e,f) {
		f.v.repeating = false;
		if ((((f.v.event).schedule)) !== ((null))) f.pc=60; else f.pc=62;
	},
/*60*/	function (e,f) { e.smcall (1, popupyesno,"run", (["Retire this activity for all future entries?"])); },
	function (e,f) { var t6791 = f.s[0]; f.v.repeating = t6791; },
	function (e,f) { e.mcall (4, f.v.event, "remove_atype", ([f.v.atype, f.v.repeating])); },
	function (e,f) { e.mcall (3, f.v["this"], "rerender_day", ([(f.v.event).date])); },
	function (e,f) { f.pc=-1; },
/*65*/	function (e,f) { if (((f.v.res)) == ((("add:") + ((f.v.atype).rowid)))) f.pc=66; else f.pc=56; },
	function (e,f) {
		f.v.repeating = false;
		if ((((f.v.event).schedule)) !== ((null))) f.pc=67; else f.pc=69;
	},
	function (e,f) { e.smcall (1, popupyesno,"run", (["Add this activity for all future entries?"])); },
	function (e,f) { var t6794 = f.s[0]; f.v.repeating = t6794; },
	function (e,f) { e.mcall (5, f.v.event, "add_atype", ([f.v.atype, f.v.repeating, f.v.dl])); },
/*70*/	function (e,f) {
		var t6796 = f.s[0]; f.v.rdl = t6796;
		e.mcall (3, f.v["this"], "rerender_day", ([(f.v.event).date]));
	},
	function (e,f) {  },
null	];

;
	c.pargs__dragstart =  ["el","event","ev"];
	c.pinst__dragstart =  [
/*0*/	function (e,f) { e.smcall (4, calendar_drag,"arm", ([300, f.v["this"], f.v.event, f.v.el])); },
null	];

;
	c.args__cal_rerender_one_day = c.pargs__cal_rerender_one_day =  ["d"];
	c.inst__cal_rerender_one_day = c.pinst__cal_rerender_one_day =  [
/*0*/	function (e,f) {
		e.php_push_static_var (1, calendar,"cal");
		var t6797 = f.s[1]; 
		if (((t6797)) !== ((null))) f.pc=1; else f.pc=-1;
	},
	function (e,f) {
		e.php_push_static_var (2, calendar,"cal");
		var t6798 = f.s[2]; e.mcall (3, t6798, "rerender_day", ([f.v.d]));
	},
null	];

;
	c.args__cal_rerender_days = c.pargs__cal_rerender_days =  ["dl"];
	c.inst__cal_rerender_days = c.pinst__cal_rerender_days =  [
/*0*/	function (e,f) {
		e.php_push_static_var (1, calendar,"cal");
		var t6799 = f.s[1]; 
		if (((t6799)) !== ((null))) f.pc=1; else f.pc=-1;
	},
	function (e,f) {
		e.php_push_static_var (2, calendar,"cal");
		var t6800 = f.s[2]; e.mcall (3, t6800, "rerender_days", ([f.v.dl]));
	},
null	];

;
};
calendar.init_methods (calendar);
rpcclass.setup_class (calendar, "calendar",0, (["day_ids","listeners"]), ([0,2]));
function rota () { this.do_construct (arguments); }
rota.codegroup = "rota";
rota.init_methods = function (c) {
	dbclass.init_methods(c);
	var cp = c.prototype;
	c.args__is_allowed = c.pargs__is_allowed =  null;
	c.pargs__save_fieldspecs =  null;
	c.args__create_rota =  null;
	c.pargs__download_hardcopy =  null;
};
rota.init_methods (rota);
rpcclass.setup_class (rota, "rota",0, (["name","fieldspecs","template","atypes","dtm","hc_list","rowid","listeners"]), ([0,0,0,0,0,0,0,2]));
function rotawizardatype () { this.do_construct (arguments); }
rotawizardatype.codegroup = "rota";
rotawizardatype.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
	c.pargs__rewrite_fieldspecs =  null;
	c.pargs__reorder =  null;
	c.pargs__start_move =  null;
	c.pargs__checkbox_change =  null;
	c.pargs__get_row_fields =  null;
	c.pargs__open_list =  null;
};
rotawizardatype.init_methods (rotawizardatype);
rpcclass.setup_class (rotawizardatype, "rotawizardatype",0, (["dtmy","dtmn","atype","rota","listeners"]), ([0,0,0,0,2]));
function rotawizard () { this.do_construct (arguments); }
rotawizard.codegroup = "rota";
rotawizard.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
	c.pargs__handle_uploaded_hard =  null;
	c.pargs__upload_hard =  null;
	c.pargs__do_delete_template =  null;
	c.pargs__delete_template =  null;
	c.pargs__new_rota =  null;
};
rotawizard.init_methods (rotawizard);
rpcclass.setup_class (rotawizard, "rotawizard",0, (["rota","listeners"]), ([0,2]));
function resource () { this.do_construct (arguments); }
resource.init_methods = function (c) {
	dbclass.init_methods(c);
	var cp = c.prototype;
	c.args__get_all_resources =  [];
	c.inst__get_all_resources =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_function_async", (["resource", "get_all_resources", ([])])); },
	function (e,f) { var t6859 = f.s[0]; e.return_pop (t6859); },
null	];

;
	c.args__select = c.pargs__select =  [];
	c.inst__select = c.pinst__select =  [
/*0*/	function (e,f) { e.smcall (0, menu,"create", ([])); },
	function (e,f) {
		var t6861 = f.s[0]; f.v.m = t6861;
		e.smcall (0, resource,"get_all_resources", ([]));
	},
	function (e,f) {
		var t6863 = f.s[0]; f.v.rl = t6863;
		f.v._k450 = e.enumkeys (f.v.rl);
	},
	function (e,f) {
		f.pc=5;
		if (!((f.v._k450).length)) f.pc=4;
	},
	function (e,f) {
		f.pc=7;
		e.smcall (0, person,"is_webmaster", ([]));
	},
/*5*/	function (e,f) {
		f.pc=3;
		f.s[0] = f.v._i451 = (f.v._k450).shift();
		f.s[1] = f.v.r = (f.v.rl)[(f.v._i451)];
		e.mcall (6, f.v.m, "add_item", ([f.v.r, (f.v.r).name]));
	},
	function (e,f) {
		f.pc=8;
		e.mcall (4, f.v.m, "add_item", (["new", "Create new resource"]));
	},
	function (e,f) { var t6867 = f.s[0]; if (t6867) f.pc=6; else f.pc=8; },
	function (e,f) { e.smcall (1, popupmenu,"run", ([f.v.m])); },
	function (e,f) {
		var t6869 = f.s[0]; f.v.res = t6869;
		e.return_pop (f.v.res);
	},
null	];

;
	c.args__create_resource =  [];
	c.inst__create_resource =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_function_async", (["resource", "create_resource", ([])])); },
	function (e,f) { var t6870 = f.s[0]; e.return_pop (t6870); },
null	];

;
	c.pargs__save_resource =  [];
	c.pinst__save_resource =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["save_resource", ([])])); },
	function (e,f) { var t6871 = f.s[0]; e.return_pop (t6871); },
null	];

;
	c.args__popupobjeditor_create = c.pargs__popupobjeditor_create =  ["fields"];
	c.inst__popupobjeditor_create = c.pinst__popupobjeditor_create =  [
/*0*/	function (e,f) { if ((((f.v.fields).name)) == ((""))) f.pc=1; else f.pc=3; },
	function (e,f) { e.smcall (1, popupok,"run", (["Need a name"])); },
	function (e,f) { e.return_pop (null); },
	function (e,f) { e.smcall (0, resource,"create_resource", ([])); },
	function (e,f) { var t6872 = f.s[0]; e.return_pop (t6872); },
null	];

;
	c.args__popupobjeditor_fields = c.pargs__popupobjeditor_fields =  [];
	c.inst__popupobjeditor_fields = c.pinst__popupobjeditor_fields =  [
/*0*/	function (e,f) { e.return_pop (([({name:"name", label:"Name", type:"text"}), ({name:"owners", label:"Owners", type:"query_expr"}), ({name:"users", label:"Users", type:"query_expr"})])); },
null	];

;
	c.args__run_booking_wizard = c.pargs__run_booking_wizard =  ["el","arg","ev"];
	c.inst__run_booking_wizard = c.pinst__run_booking_wizard =  [
/*0*/	function (e,f) { e.smcall (0, resource,"select", ([])); },
	function (e,f) {
		var t6874 = f.s[0]; f.v.res = t6874;
		if (((f.v.res)) === (("new"))) f.pc=2; else f.pc=4;
	},
	function (e,f) { e.smcall (2, popupobjeditor,"create", (["resource", "Resource properties"])); },
	function (e,f) {
		var t6876 = f.s[0]; f.v.res = t6876;
		e.mcall (2, f.v.res, "save_resource", ([]));
	},
	function (e,f) { if (((f.v.res)) === ((null))) f.pc=5; else f.pc=6; },
/*5*/	function (e,f) { f.pc=-1; },
	function (e,f) { window.location = ("/churchbuilder/resource-wizard.php?rid=") + ((f.v.res).rowid); },
null	];

;
	c.pargs__edit_resource =  [];
	c.pinst__edit_resource =  [
/*0*/	function (e,f) {
		f.pc=2;
		e.smcall (2, popupobjeditor,"edit", ([f.v["this"], "Resource properties"]));
	},
	function (e,f) {
		f.pc=-1;
		e.mcall (2, f.v["this"], "save_resource", ([]));
	},
	function (e,f) { var t6878 = f.s[0]; if (t6878) f.pc=1; else f.pc=-1; },
null	];

;
};
resource.init_methods (resource);
rpcclass.setup_class (resource, "resource",0, (["name","owners","users","rowid","listeners"]), ([0,0,0,0,2]));
function resource_booking () { this.do_construct (arguments); }
resource_booking.init_methods = function (c) {
	dbclass.init_methods(c);
	var cp = c.prototype;
	c.args__search_for_event =  ["eventid","atypeid"];
	c.inst__search_for_event =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_function_async", (["resource_booking", "search_for_event", ([f.v.eventid, f.v.atypeid])])); },
	function (e,f) { var t6879 = f.s[0]; e.return_pop (t6879); },
null	];

;
	c.pargs__do_save =  [];
	c.pinst__do_save =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["do_save", ([])])); },
	function (e,f) { var t6880 = f.s[0]; e.return_pop (t6880); },
null	];

;
	c.pargs__confirm_booking =  [];
	c.pinst__confirm_booking =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["confirm_booking", ([])])); },
	function (e,f) { var t6881 = f.s[0]; e.return_pop (t6881); },
null	];

;
	c.pargs__delete_booking =  [];
	c.pinst__delete_booking =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["delete_booking", ([])])); },
	function (e,f) { var t6882 = f.s[0]; e.return_pop (t6882); },
null	];

;
	c.pargs__edit_booking =  [];
	c.pinst__edit_booking =  [
/*0*/	function (e,f) { e.smcall (2, resource_booking,"render_resume", (["delete", 0])); },
	function (e,f) {
		var t6883 = f.s[0]; f.s[0] = ({name:"delete", type:"button", label:"Delete", action:t6883});
		if ((((f.v["this"]).confirmed)) == ((1))) f.pc=2; else f.pc=3;
	},
	function (e,f) {
		f.pc=4;
		f.s[1] = "Confirmed";
	},
	function (e,f) { f.s[1] = "Provisional"; },
	function (e,f) {
		var t6884 = f.s[1]; 
		var t6885 = f.s[0]; 
		f.v.fields = ([({name:"title", type:"text", label:"Title", value:(f.v["this"]).title, width:250}), ({name:"start", type:"datetime", label:"Start", value:(f.v["this"]).start}), ({name:"end", type:"datetime", label:"End", value:(f.v["this"]).end}), ({name:"person", type:"label", label:"Booked by", value:((f.v["this"]).person).nicename}), ({name:"state", type:"label", label:"Booking state", value:t6884}), t6885]);
		f.v.pop = new popupform;
		e.mcall (6, f.v.pop, "initialise", ([0, 0, ("Edit ") + ("" + (((f.v["this"]).resource).name) + (" booking")), f.v.fields]));
	},
/*5*/	function (e,f) { e.mcall (2, f.v.pop, "open", ([])); },
	function (e,f) {  },
	function (e,f) {
		f.pc=9;
		e.mcall (2, f.v.pop, "run", ([]));
	},
	function (e,f) {
		f.pc=-1;
		e.mcall (2, f.v.pop, "close", ([]));
	},
	function (e,f) {
		var t6889 = f.s[0]; f.v.event = t6889;
		if ((((f.v.event).action)) == (("cancel"))) f.pc=11; else f.pc=12;
	},
/*10*/	function (e,f) { if ((((f.v.event).action)) == (("OK"))) f.pc=14; else f.pc=25; },
	function (e,f) {
		f.pc=13;
		f.s[0] = true;
	},
	function (e,f) { f.s[0] = (((f.v.event).action)) == (("cover")); },
	function (e,f) { var t6890 = f.s[0]; if (t6890) f.pc=8; else f.pc=10; },
	function (e,f) { e.mcall (2, f.v.pop, "get_form_fields", ([])); },
/*15*/	function (e,f) {
		var t6892 = f.s[0]; f.v.res = t6892;
		f.v["this"].title = (f.v.res).title;
		if ((((f.v.res).end)) < (((f.v.res).start))) f.pc=16; else f.pc=17;
	},
	function (e,f) {
		f.pc=7;
		e.smcall (1, popupokcancel,"run", (["end is before start"]));
	},
	function (e,f) { if (((builtin__date ("d-m-Y",(f.v["this"]).start))) != ((builtin__date ("d-m-Y",(f.v.res).start)))) f.pc=18; else f.pc=19; },
	function (e,f) {
		f.pc=20;
		f.s[0] = true;
	},
	function (e,f) { f.s[0] = ((builtin__date ("d-m-Y",(f.v["this"]).end))) != ((builtin__date ("d-m-Y",(f.v.res).end))); },
/*20*/	function (e,f) {
		var t6895 = f.s[0]; f.v.date_changed = t6895;
		f.v["this"].start = (f.v.res).start;
		f.v["this"].end = (f.v.res).end;
		e.mcall (2, f.v["this"], "do_save", ([]));
	},
	function (e,f) { if (f.v.date_changed) f.pc=22; else f.pc=23; },
	function (e,f) {
		f.pc=24;
		e.mcall (2, (window).location, "reload", ([]));
	},
	function (e,f) { e.mcall (4, f.v["this"], "send_msg", (["update_notification", 0])); },
	function (e,f) { f.pc=8; },
/*25*/	function (e,f) { if ((((f.v.event).action)) == (("delete"))) f.pc=26; else f.pc=7; },
	function (e,f) { e.mcall (2, f.v["this"], "delete_booking", ([])); },
	function (e,f) { e.mcall (4, f.v["this"], "send_msg", (["update_notification", 0])); },
	function (e,f) { f.pc=8; },
null	];

;
	c.pargs__open_calendar_entry =  ["el","arg","ev"];
	c.pinst__open_calendar_entry =  [
/*0*/	function (e,f) { e.mcall (2, f.v["this"], "edit_booking", ([])); },
null	];

;
	c.pargs__render_entry =  [];
	c.pinst__render_entry =  [
/*0*/	function (e,f) {
		f.s[0] = "\"";
		e.mcall (5, f.v["this"], "render_start", (["open_calendar_entry", 0]));
	},
	function (e,f) {
		var t6898 = f.s[1]; var t6899 = f.s[0]; 
		window.__outbuffer += ("<a href=\"#\" onclick=\"") + ("" + (t6898) + (t6899));
		if ((((f.v["this"]).confirmed)) == ((1))) f.pc=2; else f.pc=3;
	},
	function (e,f) {
		f.pc=4;
		window.__outbuffer += " style=\"color:green\"";
	},
	function (e,f) { window.__outbuffer += " style=\"color:orange\""; },
	function (e,f) {
		window.__outbuffer += ">";
		window.__outbuffer += ((f.v["this"]).resource).name;
		window.__outbuffer += "</a>";
	},
null	];

;
	c.pargs__render_calendar_entry =  ["d"];
	c.pinst__render_calendar_entry =  [
/*0*/	function (e,f) {
		f.v.start_date = builtin__mktime (0,0,0,builtin__date ("m",(f.v["this"]).start),builtin__date ("d",(f.v["this"]).start),builtin__date ("Y",(f.v["this"]).start));
		f.v.end_date = builtin__mktime (0,0,0,builtin__date ("m",(f.v["this"]).end),builtin__date ("d",(f.v["this"]).end),builtin__date ("Y",(f.v["this"]).end));
		if (((f.v.start_date)) > ((f.v.d))) f.pc=2; else f.pc=3;
	},
	function (e,f) { f.pc=-1; },
	function (e,f) {
		f.pc=4;
		f.s[0] = true;
	},
	function (e,f) { f.s[0] = ((f.v.end_date)) < ((f.v.d)); },
	function (e,f) { var t6902 = f.s[0]; if (t6902) f.pc=1; else f.pc=5; },
/*5*/	function (e,f) {
		f.s[0] = "\"";
		e.mcall (5, f.v["this"], "render_start", (["open_calendar_entry", 0]));
	},
	function (e,f) {
		var t6903 = f.s[1]; var t6904 = f.s[0]; 
		window.__outbuffer += ("<a href=\"#\" onclick=\"") + ("" + (t6903) + (t6904));
		if ((((f.v["this"]).confirmed)) == ((1))) f.pc=7; else f.pc=8;
	},
	function (e,f) {
		f.pc=9;
		window.__outbuffer += " style=\"color:green\"";
	},
	function (e,f) { window.__outbuffer += " style=\"color:orange\""; },
	function (e,f) {
		window.__outbuffer += ">";
		if (((f.v.start_date)) < ((f.v.d))) f.pc=22; else f.pc=23;
	},
/*10*/	function (e,f) {
		f.pc=25;
		window.__outbuffer += "All day";
	},
	function (e,f) { if (((f.v.start_date)) == ((f.v.d))) f.pc=19; else f.pc=20; },
	function (e,f) {
		f.pc=25;
		window.__outbuffer += "" + (builtin__date ("H:i",(f.v["this"]).start)) + (" onward");
	},
	function (e,f) { if (((f.v.start_date)) < ((f.v.d))) f.pc=16; else f.pc=17; },
	function (e,f) {
		f.pc=25;
		window.__outbuffer += ("until ") + (builtin__date ("H:i",(f.v["this"]).end));
	},
/*15*/	function (e,f) {
		f.pc=25;
		window.__outbuffer += "" + (builtin__date ("H:i",(f.v["this"]).start)) + ((" - ") + (builtin__date ("H:i",(f.v["this"]).end)));
	},
	function (e,f) {
		f.pc=18;
		f.s[0] = ((f.v.end_date)) == ((f.v.d));
	},
	function (e,f) { f.s[0] = false; },
	function (e,f) { var t6905 = f.s[0]; if (t6905) f.pc=14; else f.pc=15; },
	function (e,f) {
		f.pc=21;
		f.s[0] = ((f.v.end_date)) > ((f.v.d));
	},
/*20*/	function (e,f) { f.s[0] = false; },
	function (e,f) { var t6906 = f.s[0]; if (t6906) f.pc=12; else f.pc=13; },
	function (e,f) {
		f.pc=24;
		f.s[0] = ((f.v.end_date)) > ((f.v.d));
	},
	function (e,f) { f.s[0] = false; },
	function (e,f) { var t6907 = f.s[0]; if (t6907) f.pc=10; else f.pc=11; },
/*25*/	function (e,f) {
		window.__outbuffer += (": ") + ((f.v["this"]).title);
		window.__outbuffer += "</a>";
	},
null	];

;
	c.args__create =  ["resource","title","eventid","atypeid","start","end"];
	c.inst__create =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_function_async", (["resource_booking", "create", ([f.v.resource, f.v.title, f.v.eventid, f.v.atypeid, f.v.start, f.v.end])])); },
	function (e,f) { var t6908 = f.s[0]; e.return_pop (t6908); },
null	];

;
	c.args__new_booking = c.pargs__new_booking =  ["title","event","atype","start","end"];
	c.inst__new_booking = c.pinst__new_booking =  [
/*0*/	function (e,f) { e.smcall (0, resource,"select", ([])); },
	function (e,f) {
		var t6910 = f.s[0]; f.v.r = t6910;
		if (((f.v.r)) !== ((null))) f.pc=2; else f.pc=-1;
	},
	function (e,f) { e.smcall (6, resource_booking,"create", ([f.v.r, f.v.title, f.v.event, f.v.atype, f.v.start, f.v.end])); },
	function (e,f) {
		var t6912 = f.s[0]; f.v.booking = t6912;
		e.mcall (2, f.v.booking, "edit_booking", ([]));
	},
null	];

;
};
resource_booking.init_methods (resource_booking);
rpcclass.setup_class (resource_booking, "resource_booking",0, (["resource","title","start","end","person","confirmed","event","atype","rowid","listeners"]), ([0,0,0,0,0,0,0,0,0,2]));
function resource_manager () { this.do_construct (arguments); }
resource_manager.init_methods = function (c) {
	genericcalendar.init_methods(c);
	var cp = c.prototype;
	c.pargs__add_item =  ["d"];
	c.pinst__add_item =  [
/*0*/	function (e,f) { e.smcall (4, popupeditbox,"run", ([0, 0, "Title for booking", ""])); },
	function (e,f) {
		var t6914 = f.s[0]; f.v.title = t6914;
		if (((f.v.title)) !== ((null))) f.pc=2; else f.pc=-1;
	},
	function (e,f) { e.smcall (6, resource_booking,"create", ([(f.v["this"]).r, f.v.title, 0, 0, f.v.d, f.v.d])); },
	function (e,f) {
		var t6916 = f.s[0]; f.v.booking = t6916;
		e.mcall (2, f.v.booking, "edit_booking", ([]));
	},
	function (e,f) { e.mcall (2, (window).location, "reload", ([])); },
null	];

;
	c.pargs__configure_resource =  ["el","arg","ev"];
	c.pinst__configure_resource =  [
/*0*/	function (e,f) { e.mcall (2, (f.v["this"]).r, "edit_resource", ([])); },
null	];

;
};
resource_manager.init_methods (resource_manager);
rpcclass.setup_class (resource_manager, "resource_manager",0, (["r","day_ids","listeners"]), ([0,0,2]));
function websong_job () { this.do_construct (arguments); }
websong_job.init_methods = function (c) {
	dbclass.init_methods(c);
	var cp = c.prototype;
};
websong_job.init_methods (websong_job);
rpcclass.setup_class (websong_job, "websong_job",0, (["url","attempts","defer_until","to_class","rowid","listeners"]), ([0,0,0,0,0,2]));
function websong () { this.do_construct (arguments); }
websong.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
	c.args__do_import_all =  ["url"];
	c.inst__do_import_all =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_function_async", (["websong", "do_import_all", ([f.v.url])])); },
	function (e,f) { var t6917 = f.s[0]; e.return_pop (t6917); },
null	];

;
	c.args__import_all = c.pargs__import_all =  ["el","classname","ev"];
	c.inst__import_all = c.pinst__import_all =  [
/*0*/	function (e,f) { e.smcall (1, websong,"do_import_all", ([f.v.classname])); },
null	];

;
	c.args__do_run_import =  [];
	c.inst__do_run_import =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_function_async", (["websong", "do_run_import", ([])])); },
	function (e,f) { var t6918 = f.s[0]; e.return_pop (t6918); },
null	];

;
	c.args__do_run_import_many =  [];
	c.inst__do_run_import_many =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_function_async", (["websong", "do_run_import_many", ([])])); },
	function (e,f) { var t6919 = f.s[0]; e.return_pop (t6919); },
null	];

;
	c.args__run_import_many = c.pargs__run_import_many =  ["el","arg","ev"];
	c.inst__run_import_many = c.pinst__run_import_many =  [
/*0*/	function (e,f) { e.smcall (0, websong,"do_run_import_many", ([])); },
null	];

;
	c.args__run_import = c.pargs__run_import =  ["el","arg","ev"];
	c.inst__run_import = c.pinst__run_import =  [
/*0*/	function (e,f) { e.smcall (0, websong,"do_run_import", ([])); },
null	];

;
	c.args__do_authorize =  ["classname"];
	c.inst__do_authorize =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_function_async", (["websong", "do_authorize", ([f.v.classname])])); },
	function (e,f) { var t6920 = f.s[0]; e.return_pop (t6920); },
null	];

;
	c.args__authorize_site = c.pargs__authorize_site =  ["el","url","ev"];
	c.inst__authorize_site = c.pinst__authorize_site =  [
/*0*/	function (e,f) {
		e.php_push_static_var (1, websong,"providers");
		var t6921 = f.s[1]; 
		f.v.config = (t6921)[(f.v.url)];
		f.v.fields = ([({name:"text", type:"html", html:("Please read the terms and conditions at place <a href=\"") + ("" + ((f.v.config).base_url) + (("\" target=\"_blank\">") + ("" + ((f.v.config).base_url) + ("</a><br/>Do you accept them?"))))})]);
		f.v.pop = new popupform;
		e.mcall (6, f.v.pop, "initialise", ([0, 0, ("Authorize Import from ") + ((f.v.config).description), f.v.fields]));
	},
	function (e,f) { e.mcall (2, f.v.pop, "open", ([])); },
	function (e,f) { f.v.done = false; },
	function (e,f) {
		f.pc=5;
		e.mcall (2, f.v.pop, "run", ([]));
	},
	function (e,f) {
		f.pc=13;
		e.mcall (2, f.v.pop, "close", ([]));
	},
/*5*/	function (e,f) {
		var t6927 = f.s[0]; f.v.ev = t6927;
		if ((((f.v.ev).action)) == (("OK"))) f.pc=6; else f.pc=8;
	},
	function (e,f) { e.smcall (1, websong,"do_authorize", ([f.v.url])); },
	function (e,f) {
		f.pc=4;
		f.v.done = true;
	},
	function (e,f) { if ((((f.v.ev).action)) == (("cancel"))) f.pc=10; else f.pc=11; },
	function (e,f) { f.pc=4; },
/*10*/	function (e,f) {
		f.pc=12;
		f.s[0] = true;
	},
	function (e,f) { f.s[0] = (((f.v.ev).action)) == (("cover")); },
	function (e,f) { var t6929 = f.s[0]; if (t6929) f.pc=9; else f.pc=3; },
	function (e,f) { if (f.v.done) f.pc=14; else f.pc=-1; },
	function (e,f) { e.smcall (0, browser,"reload", ([])); },
null	];

;
	c.args__enable_site = c.pargs__enable_site =  ["el","url","ev"];
	c.inst__enable_site = c.pinst__enable_site =  [
/*0*/	function (e,f) { e.smcall (1, websong,"do_authorize", ([f.v.url])); },
	function (e,f) { e.smcall (0, browser,"reload", ([])); },
null	];

;
	c.args__handle_uploaded_files =  ["ul"];
	c.inst__handle_uploaded_files =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_function_async", (["websong", "handle_uploaded_files", ([f.v.ul])])); },
	function (e,f) { var t6930 = f.s[0]; e.return_pop (t6930); },
null	];

;
	c.args__upload_songbook = c.pargs__upload_songbook =  ["el","arg","ev"];
	c.inst__upload_songbook = c.pinst__upload_songbook =  [
/*0*/	function (e,f) {
		f.pc=5;
		f.v.ul = new uploader;
		e.mcall (2, f.v.ul, "run", ([]));
	},
	function (e,f) {
		f.pc=4;
		e.smcall (1, websong,"handle_uploaded_files", ([f.v.ul]));
	},
	function (e,f) {
		f.pc=-1;
		e.smcall (1, popupok,"run", (["File not recognised"]));
	},
	function (e,f) {
		f.pc=-1;
		e.smcall (0, browser,"reload", ([]));
	},
	function (e,f) {
		var t6932 = f.s[0]; 
		if (!(t6932)) f.pc=2; else f.pc=3;
	},
/*5*/	function (e,f) { var t6933 = f.s[0]; if (t6933) f.pc=1; else f.pc=-1; },
null	];

;
};
websong.init_methods (websong);
rpcclass.setup_class (websong, "websong",0, (["listeners"]), ([2]));
function songbookwords () { this.do_construct (arguments); }
songbookwords.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
	c.args__get_config = c.pargs__get_config =  [];
	c.inst__get_config = c.pinst__get_config =  [
/*0*/	function (e,f) { e.return_pop (({SOF12:({bookname:"VOLS1_2.RTF", md5:"9cdb7ca06d8b5c40fd38ace242d5147c", description:"Songs of Fellowship 1 and 2", base_url:"songbook://SOF2/", authtype:"book", bookparser:"sof2_parser"}), SOF3:({bookname:"sof3words.rtf", md5:"ad72a359dee2d498c7620132542560f3", description:"Songs of Fellowship 3", base_url:"songbook://SOF3/", authtype:"book", bookparser:"sof3_parser"}), SOF4:({bookname:"SP_SOF4Words.txt", md5:"207c8b035ee0fcda5a1d841ac3f0c716", description:"Songs of Fellowship 4", base_url:"songbook://SOF4/", authtype:"book", bookparser:"sof4_parser"})})); },
null	];

;
};
songbookwords.init_methods (songbookwords);
rpcclass.setup_class (songbookwords, "songbookwords",0, (["listeners"]), ([2]));
function kingsway () { this.do_construct (arguments); }
kingsway.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
	c.args__get_config = c.pargs__get_config =  [];
	c.inst__get_config = c.pinst__get_config =  [
/*0*/	function (e,f) { e.return_pop (([({base_url:"http://www.kingsway.co.uk/", description:"Kingsway's Website", authtype:"tandc"})])); },
null	];

;
};
kingsway.init_methods (kingsway);
rpcclass.setup_class (kingsway, "kingsway",0, (["listeners"]), ([2]));
function kendrick () { this.do_construct (arguments); }
kendrick.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
	c.args__get_config = c.pargs__get_config =  [];
	c.inst__get_config = c.pinst__get_config =  [
/*0*/	function (e,f) { e.return_pop (([({base_url:"http://www.grahamkendrick.co.uk/", description:"Graham Kendrick's Website", authtype:"tandc"})])); },
null	];

;
};
kendrick.init_methods (kendrick);
rpcclass.setup_class (kendrick, "kendrick",0, (["listeners"]), ([2]));
function emu () { this.do_construct (arguments); }
emu.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
	c.args__get_config = c.pargs__get_config =  [];
	c.inst__get_config = c.pinst__get_config =  [
/*0*/	function (e,f) { e.return_pop (([({base_url:"http://store.emumusic.co.uk/", description:"Emu Music's Website", authtype:"tandc"})])); },
null	];

;
};
emu.init_methods (emu);
rpcclass.setup_class (emu, "emu",0, (["listeners"]), ([2]));
function sharedsong () { this.do_construct (arguments); }
sharedsong.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
	c.args__do_search =  ["terms"];
	c.inst__do_search =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_function_async", (["sharedsong", "do_search", ([f.v.terms])])); },
	function (e,f) { var t6934 = f.s[0]; e.return_pop (t6934); },
null	];

;
	c.args__import = c.pargs__import =  ["namehint"];
	c.inst__import = c.pinst__import =  [
/*0*/	function (e,f) { e.smcall (4, popupeditbox,"run", ([0, 0, "Search imports", f.v.namehint])); },
	function (e,f) {
		var t6936 = f.s[0]; f.v.terms = t6936;
		e.smcall (1, sharedsong,"do_search", ([f.v.terms]));
	},
	function (e,f) {
		var t6938 = f.s[0]; f.v.entries = t6938;
		f.v.options = ([]);
		f.v.i = 0;
	},
	function (e,f) {
		f.pc=5;
		if (!(((f.v.entries)[(f.v.i)]) !== undefined)) f.pc=4;
	},
	function (e,f) {
		f.pc=7;
		f.v.fields = ([({name:"list", type:"table", label:"", options:f.v.options})]);
		f.v.pop = new popupform;
		e.mcall (6, f.v.pop, "initialise", ([0, 0, "Search results", f.v.fields]));
	},
/*5*/	function (e,f) {
		f.v.entry = (f.v.entries)[(f.v.i)];
		f.s[0] = "\">open</a></td>";
		e.smcall (3, sharedsong,"render_resume", (["select", f.v.i]));
	},
	function (e,f) {
		f.pc=3;
		var t6944 = f.s[1]; var t6945 = f.s[0]; 
		f.v.options[f.v.options.length] = ("<td>") + ("" + ((f.v.entry).title) + (("</td><td>") + ("" + ((f.v.entry).subtitle) + (("</td><td>") + ("" + ((f.v.entry).author) + (("</td><td><a href=\"#\" onclick=\"") + ("" + (t6944) + (t6945))))))));
		e.php_push_var_lvalue (0, "i");
		e.php_postinc (1);
	},
	function (e,f) { e.mcall (4, f.v.pop, "use_ok_cancel", ([false, true])); },
	function (e,f) { e.mcall (2, f.v.pop, "open", ([])); },
	function (e,f) {  },
/*10*/	function (e,f) {
		f.pc=12;
		e.mcall (2, f.v.pop, "run", ([]));
	},
	function (e,f) {
		f.pc=16;
		e.mcall (2, f.v.pop, "close", ([]));
	},
	function (e,f) {
		var t6949 = f.s[0]; f.v.event = t6949;
		if ((((f.v.event).action)) == (("select"))) f.pc=13; else f.pc=14;
	},
	function (e,f) {
		f.pc=11;
		f.v.res = (f.v.entries)[((f.v.event).parm)];
	},
	function (e,f) { if ((((f.v.event).action)) == (("cancel"))) f.pc=15; else f.pc=10; },
/*15*/	function (e,f) {
		f.pc=11;
		f.v.res = null;
	},
	function (e,f) { e.return_pop (f.v.res); },
null	];

;
};
sharedsong.init_methods (sharedsong);
rpcclass.setup_class (sharedsong, "sharedsong",0, (["title","subtitle","author","copyright","ccl","url","markup","listeners"]), ([0,0,0,0,0,0,0,2]));
function care_record () { this.do_construct (arguments); }
care_record.init_methods = function (c) {
	dbclass.init_methods(c);
	var cp = c.prototype;
	c.args__create =  ["case","description"];
	c.inst__create =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_function_async", (["care_record", "create", ([f.v["case"], f.v.description])])); },
	function (e,f) { var t6952 = f.s[0]; e.return_pop (t6952); },
null	];

;
	c.pargs__delete_record =  [];
	c.pinst__delete_record =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["delete_record", ([])])); },
	function (e,f) { var t6953 = f.s[0]; e.return_pop (t6953); },
null	];

;
};
care_record.init_methods (care_record);
rpcclass.setup_class (care_record, "care_record",0, (["case","owner","stamp","description","rowid","listeners"]), ([0,0,0,0,0,2]));
function care_case () { this.do_construct (arguments); }
care_case.init_methods = function (c) {
	dbclass.init_methods(c);
	var cp = c.prototype;
	c.args__create =  ["p"];
	c.inst__create =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_function_async", (["care_case", "create", ([f.v.p])])); },
	function (e,f) { var t6954 = f.s[0]; e.return_pop (t6954); },
null	];

;
	c.pargs__delete_case =  [];
	c.pinst__delete_case =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["delete_case", ([])])); },
	function (e,f) { var t6955 = f.s[0]; e.return_pop (t6955); },
null	];

;
	c.pargs__delete_record =  ["el","rec","ev"];
	c.pinst__delete_record =  [
/*0*/	function (e,f) {
		f.pc=3;
		e.smcall (1, popupokcancel,"run", (["Sure you want to delete record?"]));
	},
	function (e,f) { e.mcall (2, f.v.rec, "delete_record", ([])); },
	function (e,f) {
		f.pc=-1;
		e.mcall (3, (f.v["this"]).dtm, "remove_row", ([f.v.rec]));
	},
	function (e,f) { var t6956 = f.s[0]; if (t6956) f.pc=1; else f.pc=-1; },
null	];

;
	c.pargs__insert_row =  [];
	c.pinst__insert_row =  [
/*0*/	function (e,f) { e.smcall (4, popupeditbox,"run", ([0, 0, "Description", ""])); },
	function (e,f) {
		var t6958 = f.s[0]; f.v.desc = t6958;
		if (((f.v.desc)) !== ((null))) f.pc=2; else f.pc=-1;
	},
	function (e,f) { e.smcall (2, care_record,"create", ([f.v["this"], f.v.desc])); },
	function (e,f) {
		var t6960 = f.s[0]; f.v.rec = t6960;
		e.mcall (3, (f.v["this"]).dtm, "prepend_row", ([f.v.rec]));
	},
null	];

;
	c.pargs__get_row_fields =  ["rec"];
	c.pinst__get_row_fields =  [
/*0*/	function (e,f) {
		f.s[0] = "\">remove</a>";
		e.mcall (5, f.v["this"], "render_start", (["delete_record", f.v.rec]));
	},
	function (e,f) {
		var t6961 = f.s[1]; var t6962 = f.s[0]; 
		e.return_pop (([builtin__date ("jS M Y H:i",(f.v.rec).stamp), ("by ") + (((f.v.rec).owner).nicename), (f.v.rec).description, ("<a href=\"#\" onclick=\"") + ("" + (t6961) + (t6962))]));
	},
null	];

;
	c.pargs__save_trigger_date =  [];
	c.pinst__save_trigger_date =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["save_trigger_date", ([])])); },
	function (e,f) { var t6963 = f.s[0]; e.return_pop (t6963); },
null	];

;
	c.pargs__edit_trigger =  ["el","arg","ev"];
	c.pinst__edit_trigger =  [
/*0*/	function (e,f) { if ((((f.v["this"]).trigger_date)) == ((0))) f.pc=1; else f.pc=2; },
	function (e,f) { f.v["this"].trigger_date = builtin__mktime (0,0,0,builtin__date ("m"),parseInt((builtin__date ("d")),10) + parseInt((7),10),builtin__date ("Y")); },
	function (e,f) { e.mcall (4, f.v["this"], "render_resume", (["clear", null])); },
	function (e,f) {
		var t6965 = f.s[0]; 
		f.v.fields = ([({name:"date", type:"date", value:(f.v["this"]).trigger_date, label:"Date"}), ({name:"clear", type:"button", label:"Clear", action:t6965})]);
		f.v.pop = new popupform;
		e.mcall (6, f.v.pop, "initialise", ([0, 0, "Set reminder", f.v.fields]));
	},
	function (e,f) { e.mcall (2, f.v.pop, "open", ([])); },
/*5*/	function (e,f) {  },
	function (e,f) {
		f.pc=8;
		e.mcall (2, f.v.pop, "run", ([]));
	},
	function (e,f) {
		f.pc=-1;
		e.mcall (2, f.v.pop, "close", ([]));
	},
	function (e,f) {
		var t6969 = f.s[0]; f.v.ev = t6969;
		if ((((f.v.ev).action)) == (("cancel"))) f.pc=10; else f.pc=11;
	},
	function (e,f) { if ((((f.v.ev).action)) == (("clear"))) f.pc=13; else f.pc=16; },
/*10*/	function (e,f) {
		f.pc=12;
		f.s[0] = true;
	},
	function (e,f) { f.s[0] = (((f.v.ev).action)) == (("cover")); },
	function (e,f) { var t6970 = f.s[0]; if (t6970) f.pc=7; else f.pc=9; },
	function (e,f) {
		f.v["this"].trigger_date = 0;
		e.mcall (2, f.v["this"], "save_trigger_date", ([]));
	},
	function (e,f) { e.smcall (2, browser,"reload", ([([]), ([])])); },
/*15*/	function (e,f) { f.pc=7; },
	function (e,f) { if ((((f.v.ev).action)) == (("OK"))) f.pc=17; else f.pc=6; },
	function (e,f) { e.mcall (2, f.v.pop, "get_form_fields", ([])); },
	function (e,f) {
		var t6973 = f.s[0]; f.v.f = t6973;
		f.v["this"].trigger_date = (f.v.f).date;
		e.mcall (2, f.v["this"], "save_trigger_date", ([]));
	},
	function (e,f) { e.smcall (2, browser,"reload", ([([]), ([])])); },
/*20*/	function (e,f) { f.pc=7; },
null	];

;
	c.pargs__back_to_list =  ["el","arg","ev"];
	c.pinst__back_to_list =  [
/*0*/	function (e,f) { e.smcall (2, browser,"reload", ([(["case"]), ([])])); },
null	];

;
};
care_case.init_methods (care_case);
rpcclass.setup_class (care_case, "care_case",0, (["p","trigger_date","recs","dtm","rowid","listeners"]), ([0,0,0,0,0,2]));
function care_manager () { this.do_construct (arguments); }
care_manager.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
	c.args__handle_response =  ["resp"];
	c.inst__handle_response =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_function_async", (["care_manager", "handle_response", ([f.v.resp])])); },
	function (e,f) { var t6975 = f.s[0]; e.return_pop (t6975); },
null	];

;
	c.args__get_challenge =  [];
	c.inst__get_challenge =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_function_async", (["care_manager", "get_challenge", ([])])); },
	function (e,f) { var t6976 = f.s[0]; e.return_pop (t6976); },
null	];

;
	c.pargs__login =  ["el","arg","ev"];
	c.pinst__login =  [
/*0*/	function (e,f) { e.smcall (1, popup,"set_default_element", ([f.v.el])); },
	function (e,f) {
		f.v.pwd = ((f.v.el).care_password).value;
		e.smcall (0, care_manager,"get_challenge", ([]));
	},
	function (e,f) {
		var t6979 = f.s[0]; f.v.challenge = t6979;
		e.smcall (1, care_manager,"handle_response", (["" + (f.v.challenge) + (("|") + (builtin__md5 ("" + (f.v.challenge) + (("|") + (f.v.pwd)))))]));
	},
	function (e,f) {
		var t6981 = f.s[0]; f.v.res = t6981;
		if (((f.v.res)) == ((null))) f.pc=4; else f.pc=6;
	},
	function (e,f) { e.smcall (1, popupok,"run", (["Login failed"])); },
/*5*/	function (e,f) { f.pc=-1; },
	function (e,f) { e.smcall (2, browser,"reload", ([(["carekey"]), ({carekey:f.v.res})])); },
null	];

;
	c.pargs__open_case =  ["el","case","ev"];
	c.pinst__open_case =  [
/*0*/	function (e,f) { e.smcall (2, browser,"reload", ([([]), ({"case":(f.v["case"]).rowid})])); },
null	];

;
	c.pargs__delete_case =  ["el","case","ev"];
	c.pinst__delete_case =  [
/*0*/	function (e,f) { if ((((f.v["case"]).p)) === ((null))) f.pc=1; else f.pc=2; },
	function (e,f) {
		f.pc=3;
		f.s[0] = "";
	},
	function (e,f) { f.s[0] = (" for ") + (((f.v["case"]).p).nicename); },
	function (e,f) {
		f.pc=6;
		var t6983 = f.s[0]; f.v.name = t6983;
		e.smcall (1, popupokcancel,"run", ([("Sure you want to delete case") + ("" + (f.v.name) + ("?"))]));
	},
	function (e,f) { e.mcall (2, f.v["case"], "delete_case", ([])); },
/*5*/	function (e,f) {
		f.pc=-1;
		e.mcall (3, (f.v["this"]).dtm, "remove_row", ([f.v["case"]]));
	},
	function (e,f) { var t6984 = f.s[0]; if (t6984) f.pc=4; else f.pc=-1; },
null	];

;
	c.pargs__get_row_fields =  ["case"];
	c.pinst__get_row_fields =  [
/*0*/	function (e,f) { if (((builtin__count ((f.v["case"]).recs))) > ((0))) f.pc=1; else f.pc=2; },
	function (e,f) {
		f.pc=3;
		f.v.last = ((f.v["case"]).recs)[(0)];
		f.v.last_stamp = builtin__date ("jS M Y H:i",(f.v.last).stamp);
		f.v.last_owner = ("by ") + (((f.v.last).owner).nicename);
		f.v.last_description = (f.v.last).description;
	},
	function (e,f) {
		f.v.last_stamp = "";
		f.v.last_owner = "";
		f.v.last_description = "";
	},
	function (e,f) {
		f.s[0] = "\">remove</a>";
		e.mcall (5, f.v["this"], "render_start", (["delete_case", f.v["case"]]));
	},
	function (e,f) {
		var t6992 = f.s[1]; var t6993 = f.s[0]; 
		f.s[0] = ("<a href=\"#\" onclick=\"") + ("" + (t6992) + (t6993));
		f.s[1] = "\">open</a>";
		e.mcall (6, f.v["this"], "render_start", (["open_case", f.v["case"]]));
	},
/*5*/	function (e,f) {
		var t6994 = f.s[2]; var t6995 = f.s[1]; 
		f.s[1] = ("<a href=\"#\" onclick=\"") + ("" + (t6994) + (t6995));
		f.s[2] = f.v.last_description;
		f.s[3] = f.v.last_owner;
		f.s[4] = f.v.last_stamp;
		f.s[5] = ("\">") + ("" + (((f.v["case"]).p).nicename) + ("</a>"));
		e.mcall (10, (f.v["case"]).p, "render_start", (["popup_summary", null]));
	},
	function (e,f) {
		var t6996 = f.s[6]; var t6997 = f.s[5]; 
		var t6998 = f.s[4]; var t6999 = f.s[3]; var t7000 = f.s[2]; var t7001 = f.s[1]; var t7002 = f.s[0]; 
		e.return_pop (([("<a href=\"#\" onclick=\"") + ("" + (t6996) + (t6997)), t6998, t6999, t7000, t7001, t7002]));
	},
null	];

;
	c.pargs__insert_row =  [];
	c.pinst__insert_row =  [
/*0*/	function (e,f) { e.smcall (0, person,"lookup", ([])); },
	function (e,f) {
		var t7004 = f.s[0]; f.v.p = t7004;
		if (((f.v.p)) !== ((null))) f.pc=2; else f.pc=-1;
	},
	function (e,f) { e.smcall (1, care_case,"create", ([f.v.p])); },
	function (e,f) { var t7005 = f.s[0]; e.mcall (3, (f.v["this"]).dtm, "append_row", ([t7005])); },
null	];

;
};
care_manager.init_methods (care_manager);
rpcclass.setup_class (care_manager, "care_manager",0, (["dtm","listeners"]), ([0,2]));
function facebook () { this.do_construct (arguments); }
facebook.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
	c.args__do_send_sms =  ["p"];
	c.inst__do_send_sms =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_function_async", (["facebook", "do_send_sms", ([f.v.p])])); },
	function (e,f) { var t7006 = f.s[0]; e.return_pop (t7006); },
null	];

;
	c.args__send_sms = c.pargs__send_sms =  ["el","p","ev"];
	c.inst__send_sms = c.pinst__send_sms =  [
/*0*/	function (e,f) { e.smcall (1, facebook,"do_send_sms", ([f.v.p])); },
null	];

;
};
facebook.init_methods (facebook);
rpcclass.setup_class (facebook, "facebook",0, (["listeners"]), ([2]));
function reminder () { this.do_construct (arguments); }
reminder.init_methods = function (c) {
	dbclass.init_methods(c);
	var cp = c.prototype;
};
reminder.init_methods (reminder);
rpcclass.setup_class (reminder, "reminder",0, (["key","person","msg","owner","datetime","create_time","last_sent","ack","warn","role","activity","rowid","listeners"]), ([0,0,0,0,0,0,0,0,0,0,0,0,2]));
function sms () { this.do_construct (arguments); }
sms.init_methods = function (c) {
	rpcclass.init_methods(c);
	var cp = c.prototype;
	c.pargs__do_send_text =  ["payload"];
	c.pinst__do_send_text =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["do_send_text", ([f.v.payload])])); },
	function (e,f) { var t7007 = f.s[0]; e.return_pop (t7007); },
null	];

;
	c.pargs__send_text =  ["el","arg","ev"];
	c.pinst__send_text =  [
/*0*/	function (e,f) { e.mcall (3, document, "getElementById", (["payload"])); },
	function (e,f) {
		var t7009 = f.s[0]; f.v.plel = t7009;
		f.v.payload = (f.v.plel).value;
		if ((((f.v.payload).length)) > ((160))) f.pc=2; else f.pc=3;
	},
	function (e,f) {
		f.s[0] = builtin__alert (("Too long (") + ("" + ((f.v.payload).length) + (" > 160")));
		f.pc=-1;
	},
	function (e,f) { e.mcall (3, document, "getElementById", (["sendbutton"])); },
	function (e,f) {
		var t7012 = f.s[0]; f.v.sbel = t7012;
		e.mcall (3, (f.v.sbel).parentNode, "removeChild", ([f.v.sbel]));
	},
/*5*/	function (e,f) { e.mcall (3, document, "createTextNode", (["Sending...."])); },
	function (e,f) {
		var t7014 = f.s[0]; f.v.conf = t7014;
		e.mcall (4, (f.v.plel).parentNode, "insertBefore", ([f.v.conf, f.v.plel]));
	},
	function (e,f) { e.mcall (3, (f.v.plel).parentNode, "removeChild", ([f.v.plel])); },
	function (e,f) {
		f.v.plel = f.v.conf;
		e.mcall (3, f.v["this"], "do_send_text", ([f.v.payload]));
	},
	function (e,f) { e.mcall (3, document, "createTextNode", (["Your message has been sent"])); },
/*10*/	function (e,f) {
		var t7017 = f.s[0]; f.v.conf = t7017;
		e.mcall (4, (f.v.plel).parentNode, "insertBefore", ([f.v.conf, f.v.plel]));
	},
	function (e,f) { e.mcall (3, (f.v.plel).parentNode, "removeChild", ([f.v.plel])); },
null	];

;
};
sms.init_methods (sms);
rpcclass.setup_class (sms, "sms",0, (["expr_str","numbers","listeners"]), ([0,0,2]));
function form_element_query () { this.do_construct (arguments); }
form_element_query.init_methods = function (c) {
	form_element_line_base.init_methods(c);
	var cp = c.prototype;
	c.pargs__render =  [];
	c.pinst__render =  [
/*0*/	function (e,f) { e.smcall (1, query_expr,"create_from_string", ([(f.v["this"]).raw_value])); },
	function (e,f) {
		var t7019 = f.s[0]; f.v.qe = t7019;
		e.mcall (4, f.v["this"], "render_start", (["edit_field", null]));
	},
	function (e,f) { e.mcall (3, f.v.qe, "as_text", ([])); },
	function (e,f) { var t7020 = f.s[1]; var t7021 = f.s[0]; e.mcall (7, f.v["this"], "render_line_element_helper", (["", "span", ([]), t7020, t7021])); },
null	];

;
	c.pargs__edit_field =  ["el","args","ev"];
	c.pinst__edit_field =  [
/*0*/	function (e,f) { e.smcall (1, query_expr,"create_from_string", ([(f.v["this"]).raw_value])); },
	function (e,f) {
		var t7023 = f.s[0]; f.v.qe = t7023;
		e.mcall (2, f.v.qe, "edit", ([]));
	},
	function (e,f) { e.mcall (2, f.v.qe, "as_string", ([])); },
	function (e,f) {
		var t7025 = f.s[0]; f.v["this"].raw_value = t7025;
		e.mcall (2, f.v["this"], "data_el", ([]));
	},
	function (e,f) {
		var t7027 = f.s[0]; f.v.el = t7027;
		e.mcall (2, f.v.qe, "as_text", ([]));
	},
/*5*/	function (e,f) {
		var t7029 = f.s[0]; f.v.el.innerHTML = t7029;
		e.mcall (2, f.v["this"], "change_detected", ([]));
	},
null	];

;
};
form_element_query.init_methods (form_element_query);
rpcclass.setup_class (form_element_query, "form_element_query",0, (["form","fielddef","raw_value","change_timer_handle","listeners"]), ([0,0,0,0,2]));
function one_time_mail () { this.do_construct (arguments); }
one_time_mail.init_methods = function (c) {
	dbclass.init_methods(c);
	var cp = c.prototype;
};
one_time_mail.init_methods (one_time_mail);
rpcclass.setup_class (one_time_mail, "one_time_mail",0, (["handle","timeout","targets","rowid","listeners"]), ([0,0,0,0,2]));
function calendarSchedule () { this.do_construct (arguments); }
calendarSchedule.init_methods = function (c) {
	dbclass.init_methods(c);
	var cp = c.prototype;
	c.args__create_new =  ["dow","wom","offset","end_date","ev"];
	c.inst__create_new =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_function_async", (["calendarSchedule", "create_new", ([f.v.dow, f.v.wom, f.v.offset, f.v.end_date, f.v.ev])])); },
	function (e,f) { var t7030 = f.s[0]; e.return_pop (t7030); },
null	];

;
	c.pargs__calculate_damage =  ["ev"];
	c.pinst__calculate_damage =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["calculate_damage", ([f.v.ev])])); },
	function (e,f) { var t7031 = f.s[0]; e.return_pop (t7031); },
null	];

;
	c.pargs__retire =  ["ev"];
	c.pinst__retire =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["retire", ([f.v.ev])])); },
	function (e,f) { var t7032 = f.s[0]; e.return_pop (t7032); },
null	];

;
	c.pargs__repeat_flag =  ["atype"];
	c.pinst__repeat_flag =  [
/*0*/	function (e,f) {
		f.v.idx = builtin__array_search (f.v.atype,(f.v["this"]).atypes);
		e.return_pop (((f.v["this"]).rflags)[(f.v.idx)]);
	},
null	];

;
	c.args__lookup = c.pargs__lookup =  ["name","arr","def"];
	c.inst__lookup = c.pinst__lookup =  [
/*0*/	function (e,f) { f.v._k452 = e.enumkeys (f.v.arr); },
	function (e,f) {
		f.pc=3;
		if (!((f.v._k452).length)) f.pc=2;
	},
	function (e,f) { e.return_pop (f.v.def); },
	function (e,f) {
		f.s[0] = f.v._i453 = (f.v._k452).shift();
		f.s[1] = f.v.d = (f.v.arr)[(f.v._i453)];
		if ((((f.v.d).name)) == ((f.v.name))) f.pc=4; else f.pc=1;
	},
	function (e,f) { e.return_pop ((f.v.d).label); },
null	];

;
	c.args__days_of_week = c.pargs__days_of_week =  [];
	c.inst__days_of_week = c.pinst__days_of_week =  [
/*0*/	function (e,f) { e.return_pop (([({name:"0", label:"Sunday"}), ({name:"1", label:"Monday"}), ({name:"2", label:"Tuesday"}), ({name:"3", label:"Wednesday"}), ({name:"4", label:"Thursday"}), ({name:"5", label:"Friday"}), ({name:"6", label:"Saturday"})])); },
null	];

;
	c.args__day_name = c.pargs__day_name =  ["name"];
	c.inst__day_name = c.pinst__day_name =  [
/*0*/	function (e,f) {
		f.s[0] = "unknown day";
		e.smcall (1, calendarSchedule,"days_of_week", ([]));
	},
	function (e,f) {
		f.s[2] = f.v.name;
		e.php_static_method_call (3, calendarSchedule,"lookup", 3);
	},
	function (e,f) { var t7039 = f.s[0]; e.return_pop (t7039); },
null	];

;
	c.args__weeks_of_month = c.pargs__weeks_of_month =  [];
	c.inst__weeks_of_month = c.pinst__weeks_of_month =  [
/*0*/	function (e,f) { e.return_pop (([({name:"0", label:"All weeks"}), ({name:"1", label:"1st"}), ({name:"2", label:"2nd"}), ({name:"3", label:"3rd"}), ({name:"4", label:"4th"}), ({name:"5", label:"5th"})])); },
null	];

;
	c.args__offsets = c.pargs__offsets =  [];
	c.inst__offsets = c.pinst__offsets =  [
/*0*/	function (e,f) { e.return_pop (([({name:"-6", label:"6 days before"}), ({name:"-5", label:"5 days before"}), ({name:"-4", label:"4 days before"}), ({name:"-3", label:"3 days before"}), ({name:"-2", label:"2 days before"}), ({name:"-1", label:"The day before"}), ({name:"0", label:"On"}), ({name:"1", label:"The day after"}), ({name:"2", label:"2 days after"}), ({name:"3", label:"3 days after"}), ({name:"4", label:"4 days after"}), ({name:"5", label:"5 days after"}), ({name:"5", label:"7 days after"})])); },
null	];

;
	c.args__offset_name = c.pargs__offset_name =  ["name"];
	c.inst__offset_name = c.pinst__offset_name =  [
/*0*/	function (e,f) {
		f.s[0] = "unknown offset";
		e.smcall (1, calendarSchedule,"offsets", ([]));
	},
	function (e,f) {
		f.s[2] = f.v.name;
		e.php_static_method_call (3, calendarSchedule,"lookup", 3);
	},
	function (e,f) { var t7042 = f.s[0]; e.return_pop (t7042); },
null	];

;
	c.args__week_name = c.pargs__week_name =  ["name"];
	c.inst__week_name = c.pinst__week_name =  [
/*0*/	function (e,f) {
		f.s[0] = "unknown week";
		e.smcall (1, calendarSchedule,"weeks_of_month", ([]));
	},
	function (e,f) {
		f.s[2] = f.v.name;
		e.php_static_method_call (3, calendarSchedule,"lookup", 3);
	},
	function (e,f) { var t7045 = f.s[0]; e.return_pop (t7045); },
null	];

;
	c.args__edit = c.pargs__edit =  ["obj","this_date"];
	c.inst__edit = c.pinst__edit =  [
/*0*/	function (e,f) { if (((f.v.obj)) === ((null))) f.pc=1; else f.pc=2; },
	function (e,f) {
		f.pc=3;
		f.v.title = "Add Schedule";
		f.v.obj = ({end_date:builtin__mktime (0,0,0,1,1,2036), dow:builtin__date ("w",f.v.this_date), offset:"0"});
	},
	function (e,f) { f.v.title = "Edit Schedule"; },
	function (e,f) { e.smcall (0, calendarSchedule,"days_of_week", ([])); },
	function (e,f) {
		var t7050 = f.s[0]; f.v.days = t7050;
		e.smcall (0, calendarSchedule,"weeks_of_month", ([]));
	},
/*5*/	function (e,f) {
		var t7052 = f.s[0]; f.v.woms = t7052;
		e.smcall (0, calendarSchedule,"offsets", ([]));
	},
	function (e,f) {
		var t7054 = f.s[0]; f.v.offsets = t7054;
		f.v.fields = ([({name:"offset", type:"enum", options:f.v.offsets, label:"Offset", required:"1"}), ({name:"wom", type:"enum", options:f.v.woms, label:"Week of month", required:"1"}), ({name:"dow", type:"enum", options:f.v.days, label:"Day of week", required:"1"}), ({name:"end_date", type:"date", label:"End Date"}), ({type:"ok"}), ({name:"cancel", type:"button", label:"Cancel", action:"cancel"})]);
		e.smcall (3, form,"create", ([null, f.v.fields, f.v.obj]));
	},
	function (e,f) {
		var t7057 = f.s[0]; f.v.f = t7057;
		e.mcall (3, f.v.f, "focus", ([0]));
	},
	function (e,f) { e.mcall (5, f.v.f, "popup", ([0, 0, f.v.title])); },
	function (e,f) {
		var t7059 = f.s[0]; f.v.res = t7059;
		e.return_pop (f.v.res);
	},
null	];

;
	c.args__create_dialog = c.pargs__create_dialog =  ["ev"];
	c.inst__create_dialog = c.pinst__create_dialog =  [
/*0*/	function (e,f) { e.smcall (2, calendarSchedule,"edit", ([null, (f.v.ev).date])); },
	function (e,f) {
		var t7061 = f.s[0]; f.v.rt = t7061;
		if (((f.v.rt)) === ((null))) f.pc=2; else f.pc=3;
	},
	function (e,f) { f.pc=-1; },
	function (e,f) { e.smcall (5, calendarSchedule,"create_new", ([(f.v.rt).dow, (f.v.rt).wom, (f.v.rt).offset, (f.v.rt).end_date, f.v.ev])); },
	function (e,f) {
		var t7063 = f.s[0]; f.v.md = t7063;
		e.smcall (1, calendar,"cal_rerender_days", ([f.v.md]));
	},
null	];

;
};
calendarSchedule.init_methods (calendarSchedule);
rpcclass.setup_class (calendarSchedule, "calendarSchedule",1, (["layer","dow","wom","offset","end_date","fill_date","time","title","atypes","rflags","rowid","listeners"]), ([0,0,0,0,0,0,0,0,0,0,0,2]));
function calendarLayer () { this.do_construct (arguments); }
calendarLayer.init_methods = function (c) {
	dbclass.init_methods(c);
	var cp = c.prototype;
	c.pargs__can_read =  [];
	c.pinst__can_read =  [
/*0*/	function (e,f) { e.return_pop ((f.v["this"]).i_can_read); },
null	];

;
	c.pargs__can_write =  [];
	c.pinst__can_write =  [
/*0*/	function (e,f) { e.return_pop ((f.v["this"]).i_can_write); },
null	];

;
	c.args__create_new =  ["vals"];
	c.inst__create_new =  [
/*0*/	function (e,f) { e.smcall (3, rpcclass,"call_static_function_async", (["calendarLayer", "create_new", ([f.v.vals])])); },
	function (e,f) { var t7064 = f.s[0]; e.return_pop (t7064); },
null	];

;
	c.args__writable_layers = c.pargs__writable_layers =  [];
	c.inst__writable_layers = c.pinst__writable_layers =  [
/*0*/	function (e,f) {
		e.php_push_static_var (0, calendarLayer,"writable");
		var t7065 = f.s[0]; e.return_pop (t7065);
	},
null	];

;
	c.pargs__update =  ["vals"];
	c.pinst__update =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["update", ([f.v.vals])])); },
	function (e,f) { var t7066 = f.s[0]; e.return_pop (t7066); },
null	];

;
	c.args__run_config_dialog = c.pargs__run_config_dialog =  ["obj"];
	c.inst__run_config_dialog = c.pinst__run_config_dialog =  [
/*0*/	function (e,f) {
		f.v.fields = ([({name:"name", type:"text", label:"Name"}), ({name:"readers_expr", type:"query", label:"Readers"}), ({name:"writers_expr", type:"query", label:"Writers"}), ({type:"ok"}), ({name:"cancel", type:"button", label:"Cancel", action:"cancel"})]);
		e.smcall (3, form,"create", ([null, f.v.fields, f.v.obj]));
	},
	function (e,f) {
		var t7069 = f.s[0]; f.v.f = t7069;
		e.mcall (3, f.v.f, "focus", ([0]));
	},
	function (e,f) { e.mcall (5, f.v.f, "popup", ([0, 0, "Edit Calendar Layer"])); },
	function (e,f) {
		var t7071 = f.s[0]; f.v.vals = t7071;
		if (((f.v.vals)) === ((null))) f.pc=4; else f.pc=5;
	},
	function (e,f) { f.pc=-1; },
/*5*/	function (e,f) { if (((f.v.obj)) === ((null))) f.pc=6; else f.pc=7; },
	function (e,f) {
		f.pc=-1;
		e.smcall (1, calendarLayer,"create_new", ([f.v.vals]));
	},
	function (e,f) { e.mcall (3, f.v.obj, "update", ([f.v.vals])); },
null	];

;
	c.args__config_menu = c.pargs__config_menu =  [];
	c.inst__config_menu = c.pinst__config_menu =  [
/*0*/	function (e,f) { e.smcall (0, calendarLayer,"writable_layers", ([])); },
	function (e,f) {
		var t7073 = f.s[0]; f.v.ll = t7073;
		e.smcall (0, menu,"create", ([]));
	},
	function (e,f) {
		var t7075 = f.s[0]; f.v.m = t7075;
		f.v._k454 = e.enumkeys (f.v.ll);
	},
	function (e,f) {
		f.pc=5;
		if (!((f.v._k454).length)) f.pc=4;
	},
	function (e,f) {
		f.pc=6;
		e.mcall (4, f.v.m, "add_item", (["", "Create New..."]));
	},
/*5*/	function (e,f) {
		f.pc=3;
		f.s[0] = f.v._i455 = (f.v._k454).shift();
		f.s[1] = f.v.xl = (f.v.ll)[(f.v._i455)];
		e.mcall (6, f.v.m, "add_item", ([f.v.xl, (f.v.xl).name]));
	},
	function (e,f) { e.smcall (1, popupmenu,"run", ([f.v.m])); },
	function (e,f) {
		var t7080 = f.s[0]; f.v.l = t7080;
		if (((f.v.l)) === ((null))) f.pc=8; else f.pc=9;
	},
	function (e,f) { f.pc=-1; },
	function (e,f) { if (((f.v.l)) === ((""))) f.pc=10; else f.pc=11; },
/*10*/	function (e,f) { f.v.l = null; },
	function (e,f) { e.smcall (1, calendarLayer,"run_config_dialog", ([f.v.l])); },
	function (e,f) { e.smcall (2, browser,"reload", ([([]), ({})])); },
null	];

;
};
calendarLayer.init_methods (calendarLayer);
rpcclass.setup_class (calendarLayer, "calendarLayer",1, (["name","readers_expr","writers_expr","i_can_read","i_can_write","rowid","listeners"]), ([0,0,0,0,0,0,2]));
function survey () { this.do_construct (arguments); }
survey.init_methods = function (c) {
	dbclass.init_methods(c);
	var cp = c.prototype;
	c.pargs__post =  ["res"];
	c.pinst__post =  [
/*0*/	function (e,f) { e.mcall (4, f.v["this"], "call_function_async", (["post", ([f.v.res])])); },
	function (e,f) { var t7082 = f.s[0]; e.return_pop (t7082); },
null	];

;
	c.pargs__clicked =  ["action"];
	c.pinst__clicked =  [
/*0*/	function (e,f) { if (((f.v.action)) == (("OK"))) f.pc=1; else f.pc=-1; },
	function (e,f) { e.mcall (2, (f.v["this"]).f, "get_values", ([])); },
	function (e,f) { var t7083 = f.s[0]; e.mcall (3, f.v["this"], "post", ([t7083])); },
	function (e,f) {
		e.php_push_static_var (0, rpcclass,"last_start_el");
		var t7084 = f.s[0]; e.smcall (1, popup,"set_default_element", ([t7084]));
	},
	function (e,f) { e.smcall (1, popupok,"run", (["Your survey has been submitted"])); },
/*5*/	function (e,f) { e.smcall (2, browser,"reload", ([([]), ({})])); },
null	];

;
};
survey.init_methods (survey);
rpcclass.setup_class (survey, "survey",1, (["uid","raw_answers","answers","submitted","f","rowid","listeners"]), ([0,0,0,0,0,0,2]));

