<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<Tease id="69023" scriptVersion="v0.1">
  <!-- Downloaded using Milovana Downloader version 0.97a by playfulguy -->
  <!-- See this thread: https://milovana.com/forum/viewtopic.php?f=26&t=24101 -->

<!--
    Playfulguy notes:

      The object "game" defined in the initializeScriptvars() was removed.
        It defined several properties and functions, but the only thing actually used was the game.random() function.
        The other properties were never referenced anywhere so were redundant.
      Added function getRandom() based on the game.random() function
      All calls to game.random() were replaced with calls to getRandom()

      The downloader corrupted a couple variable definitions in the init module.
        The original lines were
          var fighterload = "girlone,girltwo";
          var teaseload = "2fighttime,2fightspeed,2fightpattern";
        but the downloader screwed them up. I fixed those in this file but don't have time to
        figure out what happened and fix the downloader right now.

      The downloader broke several functions
        Several functions accept a "girllist" parameter (like getgirl(girllist) for example)
        The downloader added a getVariable() statement to the function that ended up redefining the list and broke the code.
        I updated the relevant functions and commented out that statement.

      Check setting of "ForceStartPage" (a few lines below here). Maybe it should be false so you can continue from where you left off?

      In function initializeScriptvars() maybe set initialize_on_every_load to false?
        Probably some stuff should be reset every time, but others maybe should not.
        The code defines many variables that are never actually used, like starttime, endtime, lengthmin and lengthmax for example.
        I assume the code was just copied from somewhere else and not cleaned up, so no big deal.
        There are too many so I didn't check them all.


-->
  <Title>Teasefight Invitational Cup [1.1]</Title>
  <Url>https://milovana.com/webteases/showtease.php?id=69023</Url>
  <Author id="109682">
    <Name>whdmusic</Name>
    <Url>https://milovana.com/webteases/?author=109682</Url>
  </Author>
  <MediaDirectory>Teasefight Invitational Cup [1.1]</MediaDirectory>
  <Settings>
    <AutoSetPageWhenSeen>false</AutoSetPageWhenSeen>
    <ForceStartPage>false</ForceStartPage>
  </Settings>
  <GlobalJavascript>
  <![CDATA[
      //---------------------- Start GuideMe EOS Lib ----------------------------------------------
      // Global javascript functions for GuideMe to support EOS teases
      // Last Modified: 2023-11-28 14:49:33    
      // The date and time last modified of GuideMe EOS Lib.js when it was inserted into this guide.
      //--------------------------------------------------------------------------------------------

      pages = {
        getPages:   function(pattern) {
                  // Get the list of pages, or optionally the list of pages that match pattern
                  var pages = scriptVars.get("PageList");
                  if ( ! pages || pages == undefined ) {
                    pages = [];
                  }
                  else {
                    // What happens if we just get a straight page name
                    // I'd expect a list of one entry back if the page exists, or an empty list otherwise
                    //if ( pattern !== undefined && pattern.indexOf("*") != -1) {
                    if ( pattern !== undefined ) {
                      // Convert the pattern to a proper regular expression by changing all occurences
                      // of "*" to ".*", and we add the "^" at the beginning and "$" at the end to force
                      // it to match the entire page name and not just part of it.
                      pattern = "^" + pattern.replace(/\*/g,".*") + "$";
                      if ( guide.isSet("DEBUG") == true ) jscriptLog("pages.getPages: searching for pattern \"" + pattern + "\"");
                      regex = new RegExp(pattern);  // Compile the pattern

                      // Now use that to filter the list of pages for ones that match
                      PageList = scriptVars.get("PageList");

                      // In testing, randomly going back to the current page caused dead end pages due to the way actions are handled.
                      // For now I have opted for the quick and easy fix of just not allowing the current page to match.
                      // BUT, you can change the filter used below to allow it. Use at your own risk :-)

                      // Filter for all matching pages.
                      pages = PageList.filter( function(item) { return regex.test(item);} );

                      // The following filter will drop pages that are disabled, and will NOT match the current page.
                      // pages = PageList.filter( function(item) { return regex.test(item) && ! guide.isSet(item) && item != guide.getCurrPage();} );

                      // The following filter will drop pages that are disabled, but WILL match the current page
                      // pages = PageList.filter( function(item) { return regex.test(item) && ! guide.isSet(item);} );

                    }
                  }
                  if ( guide.isSet("DEBUG") == true && pattern !== undefined ) jscriptLog("pages.getPages: found " + pages.length + " matches for " + pattern);
                  return pages;
        },
        enable:  function(pattern) {
            var pages = this.getPages(pattern)
            for ( page in pages ) {
              if ( guide.isSet("DEBUG") == true ) jscriptLog("pages.enable: enabling " + pages[page]);
              guide.unsetFlags(pages[page]);
            }
        },
        disable:  function(pattern) {
            var pages = this.getPages(pattern)
            for ( page in pages ) {
              if ( guide.isSet("DEBUG") == true ) jscriptLog("pages.disable: disabling " + pages[page]);
              guide.setFlags(pages[page]);
            }
        },
        isEnabled:  function(name) {
          if ( guide.isSet(name) ) return false
          else return true;
        },
        getCurrentPageId:  function() {
          return guide.getCurrPage()
        },
        getPreviousPageId:  function() {
          return guide.getPrevPage()
        },
        goto:   function(pattern) {
            var pages = this.getPages(pattern)
            var page;
            if ( pages.length == 0 ) {
              // It either doesn't exist, or it's a page that's not in the page list
              overRide.setPage(pattern);  // ToDo: In EOS what happens if you goto a page that does not exist?
            }
            else if ( pages.length == 1 ) {
              // It either doesn't exist, or it's a page that's not in the page list
              overRide.setPage(pages[0]);  // ToDo: In EOS what happens if you goto a page that does not exist?
            }
            else {  // Must be more than one match so pick one at random
              var rand = guide.getRandom(1,pages.length) - 1;
              page = pages[rand];
              if ( guide.isSet("DEBUG") == true ) jscriptLog("pages.goto(" + pattern + ") selected " + page);
              overRide.setPage(page);      // ToDo: In EOS what happens if you goto a page that does not exist?
            }
        },
        clearBubbles:   function() {
              var page = scriptVars.get("pageState");
              if ( ! page || page == null ) page = resetPageState();
              page.text = "";
              scriptVars.put("pageState",page);
        },
        exists: function(name) { // Returns true if a page of the given name exists, false otherwise
            // Does exact page names only - not wildcards
            return guide.getChapters().get("default").getPages().containsKey(name);
        },
      } // End pages module

      // ----------------------------------------------------------------------
      // Basic implementation of the sound module
      // The pause() and stop() functions have no equivalent in Guideme so they do nothing.
      // ----------------------------------------------------------------------
      // If a sound is started it is persistent across pages.
      // It's not perfect, but as close as we can make it.
      // ToDo:  Add support for seek - must be hh:mm:ss format
      Sound = {
        init:   function() {
                  // Initialize the sound module. The properties are saved to a scriptVar
                  // so they are persistent across pages. Used internally by the other Sound() functions.
                  var sound = scriptVars.get("_SOUND_");
                  if ( ! sound || sound == undefined ) {
                    sound = {};
                    sound.id = "";
                    sound.name = "";
                    sound.position = "";
                    sound.volume = 100;
                    sound.files = [];
                    scriptVars.put("_SOUND_", sound);
                  }
                  return sound;
                },
        get:    function(id) {
                  var sound = this.init();
                  if ( sound.files.hasOwnProperty(id) ) {
                    sound.id = id;
                    sound.name = sound.files[id].name;
                    sound.position = ""; // Assume we start at the beginning
                    sound.volume = sound.files[id].volume;
                    if ( guide.isSet("DEBUG") == true ) jscriptLog("Sound.get(): found ID " + id + " = " + sound.name + " with volume " + sound.volume);
                  }
                  else {
                    sound.id = "";
                    sound.name = "";
                    sound.position = "";
                    sound.volume = 100;
                    jscriptLog("Sound.get(): ID " + id + " not found");
                  }
                  scriptVars.put("_SOUND_", sound);
                  return this;
                },
        play:   function() {
                  // Here we just copy the current sound file name to the page state and
                  // then handleActions() does the rest when the page is displayed.
                  var sound = this.init();
                  var page = scriptVars.get("pageState");
                  if ( ! page || page == null ) page = resetPageState();
                  page.sound = sound.name;
                  page.soundPosition = sound.position;
                  page.soundVolume = sound.volume;
                  scriptVars.put("pageState",page);
                },
        load:   function(name, id, volume) {
                  // Simulates a load of a sound file. GuideMe doesn't actually have an
                  // equivalent to this feature so we just add the file name and id to our list for
                  // later reference by other Sound() actions.
                  var sound = this.init();
                  // Load it up
                  if ( volume === undefined ) volume = 100;
                  sound.files[id] = { name: name, volume: volume };
                  scriptVars.put("_SOUND_", sound);
                  if ( guide.isSet("DEBUG") == true ) jscriptLog("Sound() added entry " + id + " = " + sound.files[id].name + " with volume " + sound.files[id].volume);
                  return this;
                },
        seek:   function(pos) {
                  var sound = this.init();
                  var temp = parseInt(pos,10);
                  if ( ! isNaN(temp) ) {
                    sound.position = "" + temp; // ToDo: Convert the integer argument to the proper format - must be hh:mm:ss
                    scriptVars.put("_SOUND_", sound);
                  }
                  return this;
                },
        setVolume: function(value) {
                  var sound = this.init();
                  if ( isNaN(value) ) {
                    if ( guide.isSet("DEBUG") == true ) jscriptLog("Sound().setVolume(): " + value + " is not a number");
                  }
                  else {
                    if ( value <= 1 ) value = value * 100; // EOS uses 0 to 1, GuideMe uses 0 to 100
                    sound.files[sound.id].volume = value;
                    sound.volume = value;
                    if ( guide.isSet("DEBUG") == true ) jscriptLog("Sound().setVolume() set volume of " + sound.files[sound.id].name + " to " + sound.files[sound.id].volume);
                    scriptVars.put("_SOUND_", sound);
                    // If this is the active sound on the page change it there as well
                    var page = scriptVars.get("pageState");
                    if ( ! page || page == null ) page = resetPageState();
                    if ( page.soundID == sound.id ) {
                      // This is the active page sound
                      page.soundVolume = sound.volume;
                      scriptVars.put("pageState",page);
                    }
                    if ( guide.isSet("DEBUG") == true ) jscriptLog("Sound().setVolume() set page.soundVolume to " + page.soundVolume + ", page.soundID = " + page.soundID + ", page.sound = " + page.sound + ", page.audio = " + page.audio);
                  }
                  return this;
        },
        pause:    function() { this.stop(); },
        destroy:  function() { this.stop(); },
        stop:     function() {
                  // var sound = this.init();
                  var page = scriptVars.get("pageState");
                  if ( page && page.hasOwnProperty("sound") ) {
                    // page = resetPageState();
                    page.sound = "";
                    page.audio = "";      // In case it was started with an audio command
                    page.metronome = "";  // In case sounds were converted to metronome
                    // page.soundPosition = sound.position;
                    // page.soundVolume = sound.volume;
                    scriptVars.put("pageState",page);
                  }
        }
      }

      // ----------------------------------------------------------------------
      // the teaseStorage module for emulating what happens in EOS
      // ----------------------------------------------------------------------
      //      methods:
      //        load()                Used internally
      //        save()                used internally
      //        setItem(name, value)  Adds/updates a teaseStorage value
      //        getItem(name)         Get the current value of teaseStorage item
      //        clear()               Removes all teaseStorage values
      //
      teaseStorage = {
        name: "_TeaseStorage_",
        nameList: undefined, // Will be initialized by load()
        filename: "TeaseStorage.json",
        load:   function() {
                  // Initialize the teaseStorage module. The list of items is saved to a scriptVar
                  // so it's persistent across pages. load() is used internally by the other functions.
                  if ( this.nameList == undefined ) {
                    // Retrieve the teaseStorage data
                    this.nameList = scriptVars.get(this.name);
                    if ( ! this.nameList || this.nameList == undefined ) {
                      // If a previous teaseStorage file exists load that, so even if the user does
                      // a File/Restart in Guideme the teaseStorage is still persistent.
                      if ( guide.fileExists(this.filename) ) {
                        try {
                          this.nameList = JSON.parse(comonFunctions.jsReadFile(this.filename));
                          if ( guide.isSet("DEBUG") == true ) jscriptLog("teaseStorage.load(): Loaded nameList from " + this.filename);
                        }
                        catch(err) {
                          jscriptLog("teaseStorage.load(): Failed to load nameList from " + this.filename + ". Intialized to empty list.");
                          this.nameList = {};
                        }
                      }
                      else {
                        // Initialize to an empty list
                        this.nameList = {};
                      }
                      scriptVars.put(this.name, this.nameList);
                    }
                    else {
                      if ( guide.isSet("DEBUG") == true ) jscriptLog("teaseStorage.load(): Retrieved nameList from scriptVars!");
                    }
                  }
                  return this.nameList;
        },
        save:    function() {
                  // Save the current list to a scriptVar so it's persistent across pages
                  scriptVars.put(this.name, this.nameList);

                  // And save the current list to file so it's saved if the user does a File/Restart
                  try {
                    comonFunctions.jsWriteFile(this.filename, JSON.stringify(this.nameList,null,2));
                    jscriptLog("jsWriteFile() succeeded. TeaseStorage data saved to " + this.filename);
                  }
                  catch(err) {
              		  jscriptLog("jsWriteFile() failed. TeaseStorage data not saved to file");
                  }
        },
        setItem: function(name, value) {
                  this.load();
                  // Add "name" to the list if it's not already in the list, and set it's value
                  this.nameList[name] = value;
                  if ( guide.isSet("DEBUG") == true ) jscriptLog("teaseStorage.setItem(): set " + name + " to " + value);
                  this.save();
        },
        getItem: function(name) {  // Get the current value of an item.
                  this.load();
                  var value = undefined;
                  if ( this.nameList.hasOwnProperty(name) ) {
                    value = this.nameList[name];
                    if ( guide.isSet("DEBUG") == true ) jscriptLog("teaseStorage.getItem(): found " + name + " = " + value);
                  }
                  else {
                    if ( guide.isSet("DEBUG") == true ) jscriptLog("teaseStorage.getItem(): name " + name + " was not found ");
                  }
                  return value;
        },
        clear: function(id) {   // Clear the teaseStorage
            // ToDo: If there are names in the list we really should loop through them and do a scriptVars.remove()
                  this.nameList = {};
                  this.save();
        },
      }

      // ----------------------------------------------------------------------
      // A globalButtons module to make them a little easier and to work around
      // some issues, and add functionality to better emulate EOS
      // ----------------------------------------------------------------------
      //      methods:
      //        init()        Used internally
      //        active()      Returns number of active buttonss
      //        add(id)       Adds a new button to the list
      //        show()        Displays active global buttons
      //        clear()       Removes all active global buttons
      //        remove(id)    Remove a global button
      //        update()      Updates active buttons removing any timed buttons that have expired
      //

      var emulateGlobalButtons = true; // This value was updated by the downloader at the time of download.
      if ( emulateGlobalButtons == true ) {
          // This version emulates global buttons to avoid some bugs in GuideMe's global buttons that were present
          // up to and including at least version 4.5.
          // Unfortunately this creates other issues:
          //  All pages must either call handleActions() OR globalButtons.show() to show any global buttons defined
          //
        globalButtons = {
          name: "_GlobalButtons_",
          buttonList: undefined,  // Will be initialized by init()
          init:   function() {
                    // Initialize the globalButtons module. The list of buttons is saved to a scriptVar
                    // so it's persistent across pages. init() is used internally by the other functions.
                    // It retrieves the button list the first time any globalButtons function is called on a given page.
                    if ( this.buttonList == undefined ) {
                      this.buttonList = scriptVars.get(this.name);
                      if ( this.buttonList == undefined ) { // If it's still undefined...
                        this.buttonList = {};
                        this.save();
                      }
                      // if ( guide.isSet("DEBUG") == true ) jscriptLog("globalButtons.init(): buttonList = " + this.buttonList + " " + typeof(this.buttonList) );
                    }
          },
          save:    function() {
                    // Save the current list to a scriptVar so it's persistent across pages
                    scriptVars.put(this.name, this.buttonList);
          },
          add: function(id, label, placement, target, duration, timerTarget, jscript) {
                    this.init();  // Make sure the buttonList is initialised
                    // Adds a global button to the list. If the button is already in the list the
                    // existing button is redefined.
                    // The button is not yet displayed - call globalButtons.show to display them.
                    // See that function for more info.
                    if ( placement === undefined || placement === "" ) placement = "bottom";
                    if ( this.buttonList[id] !== undefined ) this.remove(id); // Quick hack to allow buttons to be redefined on the fly
                    if ( duration === undefined || duration == "" ) duration = 0; // 0 Means it's not timed
                    else {
                      duration = parseInt(duration,10); // make sure it's an int and not a string
                      if ( isNaN(duration) == true ) duration = 0;
                    }
                    if ( timerTarget === undefined ) timerTarget = "";

                    // We use Date.getTime() and the duration (assumed to be seconds) to calculate
                    // the timestamp of when this button expires.
                    expires = 0;
                    if ( duration != 0 ) expires = new Date().getTime() + (duration * 1000);

                    // If jscript is specified for the button that jscript should handle removing the button
                      // var jscript = "globalButtons.remove(" + id + ")";  // For some reason this fails with a function not found error
                      // var jscript = "removeGlobalButton(" + id + ")";       // but using a standalone function like this works? WTF?
                    if ( jscript === undefined || jscript === "" ) jscript = "removeGlobalButton(" + id + ")";
                    this.buttonList[id] = { label: label, placement: placement, target: target, expiry: expires, timerTarget: timerTarget, jscript: jscript};

                    if ( guide.isSet("DEBUG") == true ) jscriptLog("globalButtons.add(): Added button " + id + " with label " + label + ", target=" + target + ", jscript=" + jscript + ", expires = " + expires + ", timerTarget=" + timerTarget);
                    this.save();
          },
          show: function(placement) {
                    this.init();  // Make sure the buttonList is initialised
                    var now = new Date().getTime();  // Current date and time as timestamp
                    var duration = 0;
                    // Show all global buttons with the given placement.
                    // If placement is omitted or a null string all buttons are shown
                    // Typically you call globalButtons.show("top"), then add your local buttons, then call globalButtons.show("bottom")
                    if ( placement === undefined || placement === "" ) placement = "All";
                    var topSort = -(this.active());       // Top buttons get negative numbers for sort order
                    // var bottomSort = 100 + this.active(); // Bottom buttons get 1xx for sort order
                    var bottomSort = 100; // Bottom buttons get 1xx for sort order
                    var sortOrder;
                    if ( guide.isSet("DEBUG") == true ) jscriptLog("globalButtons.show(): placement " + placement);
                    for ( var id in this.buttonList) {
                      if ( placement == "All" || this.buttonList[id].placement == placement ) {
                        if ( this.buttonList[id].placement == "top" ) {
                          sortOrder = topSort;
                          topSort += 1;
                        }
                        else {
                          sortOrder = bottomSort;
                          bottomSort += 1;
                        }

                        // If this button has an expiry time calculate how much time it has left
                        if ( this.buttonList[id].expiry != 0 ) {
                          duration = Math.round( (this.buttonList[id].expiry - now) / 1000 );
                          if ( duration < 0 ) duration = 0;
                        }

                        // Display the button if it does not have an expiry, or if it has not yet expired
                        if ( this.buttonList[id].expiry == 0 || duration > 0 ) {
                            // addButton( target,  text,  set,  unSet,  jscript,  image,  hotKey,  sortOrder,  false,  id)
                            overRide.addButton( this.buttonList[id].target,  this.buttonList[id].label,  "",  "",  this.buttonList[id].jscript,  "",  "",  sortOrder,  false,  id)
                            if ( guide.isSet("DEBUG") == true ) jscriptLog("globalButtons.show(): Added button " + id + " with label " + this.buttonList[id].label + ", target=" + this.buttonList[id].target + ", jscript=" + this.buttonList[id].jscript + ", expires = " + this.buttonList[id].expiry + ", target=" + this.buttonList[id].timerTarget);
                        }

                        if ( this.buttonList[id].expiry != 0 &&  this.buttonList[id].timerTarget != "" ) {
                          // If the button has an expiry time, and a timerTarget set a timer to go to the target page if the timer expires
                          // If duration is zero this will execute immediately
                          //    addTimer(delay,    jscript, set, unSet, id, target)
                          //guide.addTimer(duration, this.buttonList[id].jscript, "",   "",   id, this.buttonList[id].timerTarget);
                          guide.addTimer(duration, "", "",   "",   id, this.buttonList[id].timerTarget);
                          if ( guide.isSet("DEBUG") == true ) jscriptLog("globalButtons.show(): Added timer " + id + " with duration " + duration + " and target=" + this.buttonList[id].timerTarget);
                        }
                      }
                    }
                    this.update();  // Drop any expired buttons
          },
          remove: function(id) {  // Remove a single global button by ID
                    this.init();
                    if ( guide.isSet("DEBUG") == true ) jscriptLog("globalButtons.remove(): Removing " + id);
                    guide.disableButton(id);          // Disable the button since it won't actually disappear until the next page change/refresh
                    overRide.removeGlobalButton(id);  // Remove the button
                    //guide.removeGlobalButton(id);     // Remove the button - DOES NOT WORK!!
                    if ( this.buttonList.hasOwnProperty(id) ) {
                      // if ( this.buttonList[id].expiry > 0 ) guide.cancelTimer(id);  // Is there a way to do this??
                      delete this.buttonList[id];
                      if ( guide.isSet("DEBUG") == true ) jscriptLog("globalButtons.remove(): Removed button " + id);
                    }
                    //else {
                    //  if ( guide.isSet("DEBUG") == true ) jscriptLog("globalButtons.remove(): Button " + id + " not found");
                    //}
                    this.save();
          },
          clear: function() {   // Remove all global buttons
                    this.init();
                    // if ( guide.isSet("DEBUG") == true ) jscriptLog("globalButtons.clear() clearing all buttons ");
                    for ( var id in this.buttonList) {
                      overRide.removeGlobalButton(id);  // Remove the button
                      if ( this.buttonList.hasOwnProperty(id) ) {
                        // if ( this.buttonList[id].expiry > 0 ) guide.cancelTimer(id);  // Is there a way to do this??
                      }
                      // if ( guide.isSet("DEBUG") == true ) jscriptLog("globalButtons.clear(): removed button" + id);
                    }
                    //overRide.clearGlobalButtons();  // Not working as of GuideMe 0.4.5
                    this.buttonList = {};
                    this.save();
          },
          active: function() {
                    // Returns the number of global buttons active
                    this.init();
                    return Object.keys(this.buttonList).length;
          },
          list: function() {   // List the active global buttons to the jscript log to help debug an issue
                    this.init();
                    jscriptLog("Global buttons active: " + globalButtons.active() + " (GuideMe says " + overRide.globalButtonCount() + ")");
                    for ( var id in this.buttonList) {
                      jscriptLog("globalButtons.list(): Button ID: " + id + ", Label: " + this.buttonList[id].label);
                    }
          },
          update: function() {   // Update timed global buttons and remove any that have expired
                    this.init();
                    // if ( guide.isSet("DEBUG") == true ) jscriptLog("globalButtons.update() Checking for expired buttons ");
                    var now = new Date().getTime();  // Current date and time as timestamp
                    //if ( guide.isSet("DEBUG") == true ) jscriptLog("globalButtons.update() Current datetime = " + now);
                    var expired = 0;
                    for ( var id in this.buttonList ) {
                      //if ( guide.isSet("DEBUG") == true ) jscriptLog("globalButtons.update() Checking button " + id);
                      if ( this.buttonList[id].expiry != 0 ) {
                        if ( this.buttonList[id].expiry <= now ) {
                          // The button has expired
                          // guide.cancelTimer(id);  // Is there a way to do this??
                          this.remove(id);  // Remove the button
                          if ( guide.isSet("DEBUG") == true ) jscriptLog("globalButtons removed expired button " + id);
                          expired += 1;
                        }
                        //else {
                        //  //  If the button has a duration set a timer to remove (or disable?) the button
                        //  //  using the expiration time we recorded to calculate how long the timer should be.
                        //  // var jscript = "globalButtons.remove(" + id + ")";  // For some reason this does not work
                        //  var jscript = "removeGlobalButton(" + id + ")";       // but using a standalone function like this does? WTF?
                        //  duration = Math.round( (this.buttonList[id].expiry - now) / 1000 );
                        //  if ( guide.isSet("DEBUG") == true ) jscriptLog("globalButtons.update() set new timer for button " + id + " for " + duration + " seconds from now, jscript = " + jscript + " and target = " + this.buttonList[id].timerTarget);
                        //  //    addTimer(delay,    jscript, set, unSet, id, target)
                        //  if ( duration > 0 ) guide.addTimer(duration, jscript, "", "", id, this.buttonList[id].timerTarget);
                        //}
                      }
                    }
                    if ( expired > 0 ) this.save(); // Save if we found expired buttons
          },
        }
      }
      else {
          // This version of global buttons uses GuideMe's built-in global buttons
          globalButtons = {
            init:   function() {
                      // Initialize the globalButtons module. The list of buttons is saved to a scriptVar
                      // so it's persistent across pages. init() is used internally by the other functions.
                      var buttonList = scriptVars.get("_GlobalButtons_");
                      if ( ! buttonList || buttonList == undefined ) {
                        buttonList = {};
                        scriptVars.put("_GlobalButtons_", buttonList);
                      }
                      // if ( guide.isSet("DEBUG") == true ) jscriptLog("globalButtons.init(): buttonList = " + buttonList + " " + typeof(buttonList) );
                      return buttonList;
            },
            add: function(id, label, target, duration, timerTarget, jscript) {
                      var buttonList = this.init();
                      // Add it to the list and create the button if it's not already in the list
                      if ( buttonList[id] === undefined ) {
                        if ( duration === undefined || duration == "" ) duration = 0; // 0 Means it's not timed
                        else {
                          duration = parseInt(duration,10); // make sure it's an int and not a string
                          if ( isNaN(duration) == true ) duration = 0;
                        }
                        if ( timerTarget === undefined ) timerTarget = "";

                        // We use Date.getTime() and the duration (assumed to be seconds) to calculate
                        // the timestamp of when this button expires.
                        expires = 0;
                        if ( duration != 0 ) expires = new Date().getTime() + (duration * 1000);
                        buttonList[id] = { expiry: expires, timerTarget: timerTarget};

                        // var jscript = "globalButtons.remove(" + id + ")";  // For some reason this fails with a function not found error
                        //var jscript = "removeGlobalButton(" + id + ")";       // but using a standalone function like this works? WTF?
                        // If jscript is specified that jscript should handle removing the button
                        if ( jscript === undefined || jscript === "" ) jscript = "removeGlobalButton(" + id + ")";
                        overRide.addGlobalButton(id, target, label, "", "", jscript, "", "");
                        if ( guide.isSet("DEBUG") == true ) jscriptLog("globalButtons.add(): Added button " + id + " with label " + label + ", target=" + target + ", jscript=" + jscript + ", expires = " + buttonList[id].expiry);

                        //  If the button has a duration set a timer to remove the button and go to the target page if any
                        //    addTimer(delay,    jScript, set, unSet, id, target)
                        if ( duration > 0 ) guide.addTimer(duration, jscript, "",   "",   id,  timerTarget);
                        scriptVars.put("_GlobalButtons_", buttonList);
                      }
            },
            remove: function(id) {  // Remove a single global button by ID
                      var buttonList = this.init();
                      if ( guide.isSet("DEBUG") == true ) jscriptLog("globalButtons.remove(): Removing " + id);
                      guide.disableButton(id);          // Disable the button since it won't actually disappear until the next page change/refresh
                      overRide.removeGlobalButton(id);  // Remove the button
                      // guide.removeGlobalButton(id);  // Remove the button - DOES NOT WORK!!
                      if ( buttonList.hasOwnProperty(id) ) {
                        // if ( buttonList[id].expiry > 0 ) guide.cancelTimer(id);  // Is there a way to do this??
                        delete buttonList[id];
                        if ( guide.isSet("DEBUG") == true ) jscriptLog("globalButtons.remove(): Removed button " + id);
                      }
                      scriptVars.put("_GlobalButtons_", buttonList);
            },
            clear: function(id) {   // Remove all global buttons
                      var buttonList = this.init();
                      // if ( guide.isSet("DEBUG") == true ) jscriptLog("globalButtons.clear() clearing all buttons ");
                      for ( id in buttonList) {
                        overRide.removeGlobalButton(id);  // Remove the button
                        if ( buttonList.hasOwnProperty(id) ) {
                          // if ( buttonList[id].expiry > 0 ) guide.cancelTimer(id);  // Is there a way to do this??
                        }
                        // if ( guide.isSet("DEBUG") == true ) jscriptLog("globalButtons.clear(): removed button" + id);
                      }
                      scriptVars.remove("_GlobalButtons_");
            },
            active: function() {
                      // Returns the number of global buttons active
                      var buttonList = this.init();
                      return Object.keys(buttonList).length;
            },
            update: function() {   // Refresh all global buttons
                      var buttonList = this.init();
                      // if ( guide.isSet("DEBUG") == true ) jscriptLog("globalButtons.update() Checking for expired buttons ");
                      var now = new Date().getTime();  // Current date and time as timestamp
                      //if ( guide.isSet("DEBUG") == true ) jscriptLog("globalButtons.update() Current datetime = " + now);
                      for ( id in buttonList ) {
                        //if ( guide.isSet("DEBUG") == true ) jscriptLog("globalButtons.update() Checking button " + id);

                        if ( buttonList[id].expiry != 0 ) {
                          if ( buttonList[id].expiry <= now ) {
                            // The button has expired
                            // guide.cancelTimer(id);  // Is there a way to do this??
                            overRide.removeGlobalButton(id);  // Remove the button
                            this.remove(id);  // Remove the button
                            if ( guide.isSet("DEBUG") == true ) jscriptLog("globalButtons removed expired button " + id);
                          }
                          else {
                            //  If the button has a duration set a timer to remove (or disable?) the button
                            //  using the expiration time we recorded to calculate how long the timer should be.
                            // var jscript = "globalButtons.remove(" + id + ")";  // For some reason this does not work
                            var jscript = "removeGlobalButton(" + id + ")";       // but using a standalone function like this does? WTF?
                            duration = Math.round( (buttonList[id].expiry - now) / 1000 );
                            if ( guide.isSet("DEBUG") == true ) jscriptLog("globalButtons.update() set new timer for button " + id + " for " + duration + " seconds from now");
                            //    addTimer(delay,    jScript, set, unSet, id, target)
                            if ( duration > 0 ) guide.addTimer(duration, jscript, "", "", id, buttonList[id].timerTarget);
                          }
                        }
                      }
            },
          }
      } // End of if ( emulateGlobalButtons )

      // This is a hack to fix a strange issue with the globalButtons module above.
      // Trying to automatically remove the button by adding a call to globalButtons.remove() fails
      // with a function not found error when you click the button, but using a standalone function
      // like this works just fine. Goofy shit man!
      function removeGlobalButton(id) {
        globalButtons.remove(id);
      }

      // ----------------------------------------------------------------------
      // A simple console object to handle console.log() calls often used in EOS
      // scripts for debugging.
      // ----------------------------------------------------------------------
      console = {
        log: function() {
          var i = 0;
          var result = "";
          while ( i < arguments.length ) {
            result += arguments[i];
            i++;
            // If there are more arguments add a space bewteen them
            if ( i < arguments.length ) result += " ";
          }
          // And log the result
          jscriptLog(result);
        },

        // Log a GuideMe scriptvar name and value
        //  console.logVar("hour");
        // Gives a log entry like
        //  hour: 13
        // This is just a convenient short form of console.log("hour:",hour)
        logVar: function(name) {
          jscriptLog(name + ": " + scriptVars.get(name));
        }
      }

      // ----------------------------------------------------------------------
      // Get an integer scriptVar and return it's value, or default_value if
      // the variable is not defined
      function getIntVariable(name, default_value) {
        var temp = parseInt(scriptVars.get(name),10);
        if ( guide.isSet("DEBUG") == true ) jscriptLog("getIntVariable("+name+") got " + temp + " (default value is " + default_value +")");
        if ( isNaN(temp) ) temp = default_value;
        return temp;
      }

      //----------------------------------------------------------------------------------
      function getTypeOf(variable) {  // Moved here from the Debug page (Aug 27/2023) and renamed from whatTheHeckIs()
        // A smarter version of javascripts typeof()
        var type = typeof(variable);
        //jscriptLog("getTypeOf: typeof returned " + type);
        if ( type == "object") {
          type = Object.prototype.toString.call(variable);
          //jscriptLog("getTypeOf: Specific type = " + type);
          if      ( type === '[object Array]' ) type = "array";
          else if ( type === '[object Date]')   type = "date";
          else if ( type === '[object JavaObject]')   type = "JavaObject";
          else {
            // Log the detailed type but just return "object"
            if ( type !== '[object Object]') jscriptLog("getTypeOf found " + type + " but returning \"object\"");
            type = "object";
          }
        }
        return type;
      }

      // ----------------------------------------------------------------------
      function getVariable(str, default_value) {
        // This function is used to perform variable substition in statements. It checks to see
        // if str is the name of a defined scriptVar, and if it is returns the value of the
        // scriptVar converted to the appropriate type (number, boolean etc)
        // If it is not found, and default_value is supplied it returns default_value,
        // otherwise it returns undefined.
        var myName = "getVariable: ";
        var temp;
        var result;
        var type;
        var debug = guide.isSet("DEBUG");
        //var debug = false;
        if ( debug == true ) jscriptLog(myName+"Checking for variable named " + str);
        if ( ! isNaN(str) ) {
          // It's a number so just return it in the proper form
          if ( parseInt(str) == parseFloat(str) ) result = parseInt(str); // Must be an int
          else result = parseFloat(str);  // It's a float. Not a root beer float, a number float.
        }
        else {
          // Str is a string like a variable name, or just a string.
          // Check to see if it's the name of a defined variable
          temp = scriptVars.get(str);
          type = getTypeOf(temp);
          if ( debug == true ) jscriptLog(myName+"scriptVars.get returned " + temp + " (" + type + ")" );
          if ( typeof(temp) == "object" ) {
            // Then we may have gotten a java object
            if ( String(temp) == "true"  ) temp =  true;
            else if ( String(temp) == "false" ) temp =  false;
            else if ( String(temp) == "null" )  temp =  null;
          }

          if ( temp !== null && temp !== undefined &&  temp !== "" ) { // temp != undefined fails if temp is 0 because 0 is == undefined, because javascript is stupid!
            // It was a defined scriptvar so return it's value
        	  if ( temp === true || temp === false ) {
              result = temp;  // It's a boolean value
              if ( debug == true ) jscriptLog(myName+"Found boolean value " + result );
            }
        	  else if ( type == "array" || type == "date" ) {  // Because a Date object and an _empty_ array are detected as numbers. Go figure.
              result = temp; // Just return it as-is
              if ( debug == true ) jscriptLog(myName+"Found scriptVar " + str + " of type " + type );
            }
        	  else if ( ! isNaN(temp) ) {
              // It's a number so return it as a number (rather than a string)
              if ( parseInt(temp) == parseFloat(temp) ) result = parseInt(temp); // Must be an int
              else result = parseFloat(temp);  // It's a float.
              if ( debug == true ) jscriptLog(myName+"Found number " + result );
            }
            else {
              result = temp; // Just return it as-is
              if ( debug == true ) jscriptLog(myName+"Found scriptVar " + str + " = " + result + " of type " + type );
            }
          }
        }
        if ( result === undefined ) {
          // Return default value if it was supplied, otherwise the result is undefined
          if ( default_value !== undefined ) result = default_value;
          if ( debug == true ) jscriptLog(myName+"returning default value " + result + "(" + type + ")" );
        }
        if ( debug == true ) jscriptLog(myName+"result = \"" + result + "\" (" + type + ")");
        return result
      }

      //------------------------------------------------------------------------------
      // For choice and prompt actions this function adds the users response (or button text) to
      // the ongoing page dialog to mimic EOS.
      // For special circumstances, such as a choice or if block that needs to skip some actions
      // the nextAction argument can be used to set the value of page.next.
      function addResponse(text, nextAction, use_tts) {
        var page = scriptVars.get("pageState");
        page.delay = "";    // If this was a timed action it is now complete
        page.done = false;  // So we resume processing actions
        // Arguments usually arrive converted to strings so check use_tts in detail
        if ( use_tts === undefined )    use_tts = false;
        else if ( use_tts === "true" )  use_tts = true;
        else if ( use_tts === "false" ) use_tts = false;
        if ( guide.isSet("DEBUG") == true ) jscriptLog("addResponse(): Got text >" + text + "<, nextAction = " + nextAction + ", use_tts = " + use_tts)
        text = text.replace(/^\"|\"\s*$/g,"");  // Strip quotes off text if present
        if ( text != "Continue" && use_tts == false) {
          // If this was not a simple "continue" button, and use_tts is off,  add the response
          page.text += "\n&gt; " + text + " &lt;<br/>\n";
        }
        page.buttons = [];  // Reset page buttons
        if ( nextAction !== undefined && nextAction != "" ) {
          page.prevAction.push(page.next);
          if ( guide.isSet("DEBUG") == true ) jscriptLog("addResponse(): Saved next action " + page.next)
          // Save the current page buttons onto another stack so we can
          // restore those when we finish executing the commands for this option.
          page.prevButtons.push(page.buttons);
          page.buttons = [];
          // And set the next action number
          scriptVars.put("pageState",page);
          continueActions(nextAction);  // We call continueActions to handle the special cases
//          page.next = parseInt(nextAction,10);
//          if ( guide.isSet("DEBUG") == true ) jscriptLog("addResponse(): Set next action to " + page.next)
        }
        scriptVars.put("pageState",page);
      }

      // --------------------------------------------------------------------------------------
      function timerExpired(nextAction) {
        var page = scriptVars.get("pageState");
        page.delay = "";        // The timed action is now complete
        page.allowSkip = false; // The timed action is now complete
        page.done = false;  // So we resume processing actions
        // nextAction is only ever supplied if the timer had embedded commands to process when
        // the timer expired. In this case we push the current value of page.next onta a stack and
        // jump to the timer actions. It's kind of like calling a subroutine or function.

        // Force nextAction to int or null string
        if ( nextAction !== undefined && nextAction != "" ) nextAction = parseInt(nextAction,10);
        else nextAction = "";

        if ( nextAction == -1 ) {
          // This is a special case indicating a timed reload of the current page
          // in which case we reset and restart, rather than continuing from where we were
          resetPageState();
        }
        else if ( nextAction != "" ) {
          // We interrupt our currently scheduled program for a special activity :-)
          page.prevAction.push(page.next);
          page.next = nextAction;
          if ( guide.isSet("DEBUG") == true ) jscriptLog("timerExpired(): Set next action to " + page.next)
        }
        else {
          if ( guide.isSet("DEBUG") == true ) jscriptLog("timerExpired(): Continuing with action " + page.next)
        }
        scriptVars.put("pageState",page);
      }

      // --------------------------------------------------------------------------------------
      function continueActions(nextAction) {
        var page = scriptVars.get("pageState");
        page.done = false;  // So we resume processing actions
        page.buttons = [];  // Reset page buttons

        // Force nextAction to int or null string
        if ( nextAction !== undefined && nextAction != "" ) nextAction = parseInt(nextAction,10);
        else nextAction = "";

        scriptVars.put("pageState",page); // Save changes made so far

        if ( nextAction != "" ) {
          if ( nextAction == -1 ) {
            // This is a special case indicating an explicit restart of the current page
            // so we reset and restart, rather than continuing from where we were
            resetPageState();
            if ( guide.isSet("DEBUG") == true ) jscriptLog("continueActions(): reset page ")
          }
          else {
            // Continue processing actions at the index supplied
            page.next = nextAction;
            scriptVars.put("pageState",page);
            if ( guide.isSet("DEBUG") == true ) jscriptLog("continueActions(): Set next action to " + page.next)
          }
        }
      }

      // --------------------------------------------------------------------------------------
      // Gets the value that was entered into the Prompt field and stores it in scriptVar "name"
      function getPrompt(name, use_tts) {
        var temp = guide.getFormField("Prompt");
        scriptVars.put(name,temp);
        // And add response to the page text
        addResponse(temp,undefined,use_tts);
        scriptVars.remove("Prompt");
      }

      //------------------------------------------------------------------------------
      // The first time resetPageState() is called it creates a new page object with everything set to
      // defaults, updates the pageState scriptVar and returns the new page object.
      // After that most things are reset when we move from page to page but some are not.
      function resetPageState(isChild) {
          // Resets page elements to defaults. If isChild is defined, and is true,
          // some items are inherited from the parent instead of being reset.
          page = scriptVars.get("pageState");
          if ( ! page || page == undefined || page == null ) {
            // This should only happen the first time we load the tease, and after that the
            // pageState scriptVar should always exist.
            page = {};  // New empty object
            // The following page elements are initialized here when we initially create the
            // page object, but do not get reset when we move from one page to another, so they
            // carry over from page to page.
            page.prevImage = "";    // The last used page image. Used as a workaround for a difference between EOS and Guideme
            page.sound = "";        // Start with no page sound (does not affect sounds started with sound.Play())
            page.soundID = "";
            page.soundVolume = 100; // Default volume
          }

          // Always reset these things
          page.next = 0;            // Next action to be handled
          page.done = false;        // Are we done processing actions for now?
          page.delay = "";          // No page delay
          page.delayJscript = "";   // jscript run when delay expires
          page.delayTarget = "";    // target page when delay expires (may be the current page)
          page.allowSkip = false;   // F0r the allowSkip option on custom mode say actions
          page.startAt = "";        // For the startAt parameter of the delay
          page.buttons = [];        // Any buttons (options) defined for the page
          page.prevAction = [];     // Reset "call" stack
          page.prevButtons = [];    // Reset the page buttons

          // And only reset these if this is NOT a child page
          if ( isChild === undefined || isChild === false ) {
              // Not a child page so reset everything
              if ( guide.isSet("DEBUG") == true ) jscriptLog("resetPageState: Resetting page state for new page...")
              page.image = "";        // The current page image
              page.text = "";         // The current page text
              page.style = "hidden";  // default timer style
              page.audio = "";        // Current page audio
              page.metronome = "";    // Current metronome value
              page.loops = 0;         // Used with audio and metronome
          }
          else {
              // This is a child page so inherit the parent's settings for some things, and initialize the rest
              if ( guide.isSet("DEBUG") == true ) jscriptLog("resetPageState: Reset page state for child page...")
          }

          scriptVars.put("pageState", page);
          return page;
      }

      //------------------------------------------------------------------------------
      function setCurrentImage(image) {
          // Used as a workaround for a difference in image handling between EOS and Guideme
          // The image specified is recorded in pageState.prevImage for use by pages called from
          // the current page. This lets one page set an image, and then call other pages and have
          // the same image there (see usePreviousImage() below).
          page = scriptVars.get("pageState");
          page.prevImage = image;
          scriptVars.put("pageState", page);
          return page;
      }

      //------------------------------------------------------------------------------
      function usePreviousImage() {
          // Used as a workaround for a difference in image handling between EOS and Guideme
          // On pages that do no include a page image you can just call this function to get the
          // last image used, or the one set by a call to setCurrentImage().
          page = scriptVars.get("pageState");
          overRide.setImage(page.prevImage);
      }

      //------------------------------------------------------------------------------
      function sanitize_label(button_label) {
          // Sanitize button labels to replace some common escape sequences for special characters
          // and to compensate for some bugs in Guideme
          button_label = button_label.replace(/&#x27;/g,"'");  // Put single quotes back for some common escape sequences
          button_label = button_label.replace(/&#39;/g,"'");   // Put single quotes back for some common escape sequences
          button_label = button_label.replace(/&#8217;/g,"'"); // Another code for single quote
          button_label = button_label.replace(/&#8230;/g,"..."); // Code for an ellipsis

          // And all other html codes like "&#nnnn;" just get removed
          button_label = button_label.replace(/&#\d+;/g,"");

          // Commas and parentheses in the button label cause problems due to some bugs in Guideme
          // up to and including version 4.3, so replace those with safe alternatives
          button_label = button_label.replace(/,/g,"...");  // Replace comma with an elipsis
          button_label = button_label.replace(/\(/g,"[");   // Replace round brackets with square bracket
          button_label = button_label.replace(/\)/g,"]");
          return button_label;
      }

      //------------------------------------------------------------------------------
      function restore_text(text) {
          // Special characters in page text sometimes get encoded during conversion, so put those back before display
          //  Q: Why do I do this? They'll display just fine anyway won't they?
          //  A: It's for when we're using tts - otherwise the tts reader reads out the xml code
          text = text.replace(/&#39;/g,"'");  // Single quotes
          text = text.replace(/&#x27;/g,"'");
          text = text.replace(/&#8217;/g,"'");
          return text;
      }

      //------------------------------------------------------------------------------
      function getElement(element) {
          // Used as a workaround for EOS elements that use expressions.
          // If the given element string starts with a dollar sign it is evaluated and the result returned,
          // otherwise it's checked for a wildcard page reference (contains an asterisk) and if so we
          // match that to a random page, otherwise the element is returned as-is.
          var result;

          // If handle_wildcards is false wildcard page targets must be handled by GuideMe,
          // otherwise we handle them here in javascript. 
          var handle_wildcards = true; // This value was updated by the downloader at the time of download.

          var pattern;
          var regex;
          var rand;
          var PageList;
          var pages;  // Pages that match a wildcard pattern
          if ( guide.isSet("DEBUG") == true ) jscriptLog("getElement: Starting with \"" + element + "\"" );

          if ( element && element.substr(0,1) == "$" ) {
            result = evaluate(element.substr(1))
            if ( guide.isSet("DEBUG") == true ) jscriptLog("getElement: evaluate returned \"" + result + "\"" );
            element = result;
          }
          else if ( handle_wildcards == true && element.indexOf("*") != -1) {
            // ToDo: Modify to use the pages module now that you've implemented it
            //      pages = pages.getpages(element);
            //      Should filtering of the current page and disabled pages be done here or there?
            //      How about modifying pages.getPages to be getPages(pattern, matchCurrent, matchDisabled)
            //      and then we can just say
            //        pagelist = pages.getPages(pattern,false,false) etc.

            // Convert the pattern to a proper regular expression by changing all occurences
            // of "*" to ".*", and we add the "^" at the beginning and "$" at the end to force
            // it to match the entire page name and not just part of it.
            pattern = "^" + element.replace(/\*/g,".*") + "$";
            if ( guide.isSet("DEBUG") == true ) jscriptLog("getElement: searching for pattern \"" + pattern + "\"");
            regex = new RegExp(pattern);  // Compile the pattern

            // Now use that to filter the list of pages for ones that match
            PageList = scriptVars.get("PageList");

            // In testing, randomly going back to the current page caused dead end pages due to the way actions are handled.
            // For now I have opted for the quick and easy fix of just not allowing the current page to match.
            // BUT, you can change the filter used below to allow it. Use at your own risk :-)

            // The following filter will drop pages that are disabled, and will NOT match the current page.
            pages = PageList.filter( function(item) { return regex.test(item) && ! guide.isSet(item) && item != guide.getCurrPage();} );

            // The following filter will drop pages that are disabled, but WILL match the current page
            // pages = PageList.filter( function(item) { return regex.test(item) && ! guide.isSet(item);} );

            if ( guide.isSet("DEBUG") == true ) jscriptLog("getElement: found " + pages.length + " matches for " + element);
            if ( pages.length > 0 ) {
              rand = guide.getRandom(1,pages.length) - 1;
              element = pages[rand];
              if ( guide.isSet("DEBUG") == true ) {
                jscriptLog("getElement: Matches " + pages);
                jscriptLog("getElement: selected number " + rand + " = " + element);
              }
            }
          }
          return element; // return the result
      }


      //------------------------------------------------------------------------------
      // Handles the next action(s) for the page
      function handleActions(actionList, isChild) {
        var myName = "handleActions: ";
        //
        //    If isChild is true then on our first visit this page inherits key dynamic elements from
        //      the previous page (image, text, etc.), and all other values are reset to defaults
        //    Otherwise everything is initialized to defaults
        //    The isChild argument is usually only present on child pages that are automatically generated
        //      by the tease downloader, but it may be useful to you for customizing the downloaded tease.
        //    You can also change this argument to false in a page to disable this so previous
        //      text gets cleared. Just be aware this may affect the page image and other elements too.

        // Are we using TTS with this tease? // DO NOT MODIFY THE FOLLOWING LINE - The downloader searches for that exact line to update it.
        var use_tts = false; // This value was updated by the downloader at the time of download.

        var defaultTextmode = "append";   // Each "say" on this page is added to the previous ones
        if ( use_tts == true ) defaultTextmode = "replace";  // Each "say" replaces previous text when using TTS
        // If the current action is a "say" action the textmode property determines if the text is
        // added to the text of previous "say" actions, or replaces it.
        // You can set your preferred default here, and then override that in specific say actions
        // as desired.
        // A value of "append" mimics what EOS does online. Using "replace" (actually anything other than append)
        //  makes the tease act more like a typical GuideMe tease, but may not produce the same visual results as EOS.

        var default_alignment = "center"; // You can use "left", "center", right" or "none".
                                          // Center matches the EOS default, but very few EOS teases use left and right
                                          // so often you can use "none" and not really notice the difference

        var page;           // The page state - initialized on first action and then retrieved on subsequent actions
        var action_type;    // The name of the current action we're handling
        var this_action;    // so we can use this_action instead of actionList[page.next] all the time
        var gotoPage = "";  // If we hit a goto command this is the page to go to
        var opt;
        var button_label;
        var target_level;
        var target_found;
        var done = false; // Are we done processing commands?
        var jscript = ""; // Javascript to be added to buttons, timers etc.
        var n;
        var textmode = defaultTextmode;
        var target;
        var visible;
        var userPrompt = ""; // Used when prompting the user for input
        var notification_text = "";
        var notification_duration = "";
        var nextAction;
        var temp;
        var temp2;
        var debug = guide.isSet("DEBUG");

        // Retrieve or initialize the current page state
        if ( guide.getCurrPage() == guide.getPrevPage() ) {
            // Reloading the current page
            if ( debug == true ) jscriptLog(myName+"Get current page state...")
            // Retrieve the current page state
            page = scriptVars.get("pageState");
            // The following will only happen the very first time we load this tease
            // or after a File/Restart in GuideMe
            if ( ! page || page == null || page.next == -1 ) page = resetPageState();
        }
        else {
            // Just coming to this page for the first time so initialize
            page = resetPageState(isChild);
        }

        if ( emulateGlobalButtons == false ) globalButtons.update();   // Check for timed global buttons that have expired

        if ( actionList !== undefined && actionList !== "" && actionList.length > 0 ) { // Main IF block
          // ------------------------------------
          // Handle the current action(s)
          // ------------------------------------
          done = page.done; // Should we continue proccessing actions?
          while ( done == false && page.next < actionList.length ) { // While loop to process actions
            jscript = ""; // We add jscript to some buttons for various reasons, like to handle "prompt" actions
            textmode = defaultTextmode;

            action_type = actionList[page.next].action;
            this_action = actionList[page.next]; // So we can use "this_action" instead of "actionList[page.next]" all the time

            if ( debug == true ) jscriptLog(myName+"page.next = " + page.next + ", action = " + action_type )

            if ( action_type == "say" || action_type == "prompt" ) {
                if ( this_action.hasOwnProperty("textmode") ) textmode = this_action.textmode;  // Allows indivdual "say" actions to specify the textmode
                // ToDo: For TTS support we may need to check for sequential "say" actions with mode "instant"
                temp = restore_text(this_action.text);

                if ( use_tts == false ) {
                  // If we're not using TTS the default text alignment (usually center) is set above.
                  // Here we either use that default, or whatever is specified in the say action.
                  temp2 = default_alignment;
                  if ( this_action.hasOwnProperty("align") ) temp2 = this_action.align;
                  if ( temp2 == "right" ) {
                    temp = "<div style='text-align: " + this_action['align'] + "; padding-left: 3em;'>" + temp + "</div>";
                  }
                  else if ( temp2 == "left" ) {
                    temp = "<div style='text-align: " + this_action['align'] + "; padding-right: 3em;'>" + temp + "</div>";
                  }
                  else if ( temp2 == "center" ) {
                    //temp = "<div style='text-align: center; padding-left: 3em; padding-right: 3em;'>" + temp + "</div>";
                    temp = "<div style='text-align: center;'>" + temp + "</div>";
                  }
                  // Otherwise we assume "none" and do nothing.
                  // This allows custom alignments to be coded directly in the say action text.
                }

                if ( use_tts == true || textmode != "append" ) {
                  page.text = temp    // Replace any previous text
                }
                else  {
                  page.text = page.text + temp;   // Append to existing text
                }

                // In EOS you don't have a continue button, you just click anywhere.
                // In Guideme we need a button and the button text defaults to "Continue"
                // You can customize individual say actions by adding a button_label property.
                button_label = "Continue";  // The default
                if ( this_action.hasOwnProperty("button_label") ) button_label = sanitize_label(this_action.button_label);
                jscript = "";
                userPrompt = "";
                if ( action_type == "prompt" ) {
                  userPrompt = addPrompt("<br/>",getVariable(this_action.variable,""));   // Starts with the current value of the variable if it exists
                  if ( this_action.hasOwnProperty("dontShow") ) jscript = "getPrompt(" + this_action.variable + ", true)"; // Response doesn't get shown
                  else jscript = "getPrompt(" + this_action.variable + "," + use_tts + ")";    // When button is clicked read the response

                }

                // Q: In EOS can a prompt have a target?  A: No they can't
                target = "";
                if ( this_action.hasOwnProperty("target") && this_action.target != "" ) target = getElement(this_action.target);

                // And when do we carry on?
                if ( this_action.mode == "pause" || this_action.mode === undefined ) {  // A prompt action will always be mode "pause"
                    if ( jscript == "" ) {
                      if ( target == "" ) {
                        // If we implicitly come back to this page we just continue processing actions from here
                        jscript = "continueActions()";
                      }
                      else {
                        // if we explicitly come back to this page or go to some other page we restart the actions
                        jscript = "continueActions(-1)"; // The "-1" argument resets next action to 0
                      }
                    }
                    if ( target == "" ) target = guide.getCurrPage(); // If target is still empty we default to coming back to this page
                    page.buttons[page.buttons.length] = { label: button_label, target: target, jscript: jscript, hotkey: this_action.hotkey }
                    if ( debug == true ) jscriptLog("Added button \"" + button_label + "\" with target = " + target + " and jscript = " + jscript);
                    done = true; // And pause here
                }
                else if ( this_action.mode == "timed" || this_action.mode == "timer" ) {
                    page.style = "hidden";  // Default timer style for timed say actions
                    if ( this_action.hasOwnProperty("style") ) page.style = this_action.style;

                    page.delay = getElement(this_action.duration);
                    if ( debug == true ) jscriptLog("Got duration \"" + page.delay + "\"");
                    if ( target == "" ) { // We stay on this page and continue processing
                      page.delayJscript = "timerExpired()";
                      target = guide.getCurrPage();
                    }
                    else {  // We go to some other page (or possibly reload this page)
                      page.delayJscript = "timerExpired(-1)"; // The -1 indicates a page reset
                    }
                    page.delayTarget = target;

                    // If allow skip is true we also add a "Continue" button
                    if ( this_action.hasOwnProperty("allowSkip") && ( this_action.allowSkip == "true" || this_action.allowSkip == true) ) page.allowSkip = true;
                    else page.allowSkip = false;
                    done = true; // Pause here until the timer expires
                }
                else if ( this_action.mode == "__end__" ) {
                  //  If the say mode is __end__ we stop here
                  done = true;                    // Stop now
                  page.next = actionList.length;  // And don't continue
                }
                else if ( this_action.mode != "choice" && this_action.mode != "instant" ) {
                  // Since we don't know what this mode is we flag it and stop processing
                  page.text += "<br/><br/>" + myName +"Say mode " + this_action.mode + " is not recognized.<br/>";
                  done = true;
                }
                // Other possible modes we don't handle explicitly:
                //  If the say mode is choice we expect one or more "option" actions to follow
                //  If the say mode is instant we continue processing actions
            }
            else if ( action_type == "image" ) {
              // Set the page image allowing for wildcard images
              page.image = matchFile(this_action.file);
            }
            else if ( action_type == "option" || action_type == "button" ) {
                // Found a single option (button) that's not part of a "choice"
                target = "";  // Assume we stay here to process more actions
                if ( this_action.hasOwnProperty("target") ) target = getElement(this_action.target);
                if ( target == "" ) target = guide.getCurrPage();

                button_label = sanitize_label(this_action.label);  // Sanitize label to compensate for some bugs in Guideme
                jscript = ""; // Start with an empty string
                if ( this_action.hasOwnProperty("eval") && this_action.eval.length > 0) {
                  // This button runs some javascript
                  jscript += this_action.eval +";";
                }
                // And add javascript to add the user response to the page dialog
                if ( this_action.hasOwnProperty("dontShow") || action_type == "button" ) jscript += "addResponse(\"" + button_label + "\",,true);"; // Passes use_tts = true to prevent adding the response to the text
                else jscript += "addResponse(\"" + button_label + "\",," + use_tts + ");";
                //  Add the button to the page state so it can be restored if we reload.
                page.buttons[page.buttons.length] = { label: button_label, target: target, jscript: jscript, hotkey: this_action.hotkey }
                if ( debug == true ) jscriptLog("Added option \"" + button_label + "\" with target = " + target + " and jscript = " + jscript);
                done = true;    // And always stop here and wait for a user response
            }
            else if ( action_type == "choice" ) {
                // We have one or more options that define buttons to be added
                // Scan through the action list and find the endChoice action with the same level number.
                nextAction = find_action_end(page.next, actionList);

                // Now add the options
                page.next += 1; // Skip the "choice" action
                this_action = actionList[page.next]; // So we can use "this_action" instead of "actionList[page.next]" all the time
                while ( page.next < actionList.length && this_action.action == "option" ) {
                  // An option action looks like { action: 'option', label: 'Yes', target: 'page3_1', hotkey: 'y' }
                  target = "";
                  if ( this_action.hasOwnProperty("target") && this_action.target != "" ) target = getElement(this_action.target);
                  if ( target == "" ) target = guide.getCurrPage();  // Assume we stay here to process more actions
                  button_label = sanitize_label(this_action.label);  // Sanitize label to compensate for some bugs in Guideme
                  jscript = ""; // Start with an empty string
                  if ( this_action.hasOwnProperty("eval") && this_action.eval.length > 0) {
                    // This button runs some javascript
                    jscript += this_action.eval+";";
                  }
                  // Sometimes options have a "visible" property
                  if ( this_action.hasOwnProperty("visible") ) {
                    visible = getElement(this_action.visible);
                    if ( visible == "True" ) visible = true;          // Convert text value to boolean
                    else if ( visible == "False" ) visible = false;   // Convert text value to boolean
                    jscriptLog(myName+"Got visible = " + visible + " on option " + button_label);
                  }
                  else visible = true;

                  // Add javascript to add the user response to the page dialog and set the next action properly
                  // If the button label is "Yes" and nextAction is 5 this results in a string like 'addResponse("Yes",5,false)'
                  // If this option has commands attached we execute those,
                  // Otherwise If this option has an explicit target we use nextAction = -1
                  // Otherwise we use the default nextAction we identified above
                  if ( this_action.hasOwnProperty("cmds") && this_action.cmds == "True" ) temp = page.next + 1;
                  else if ( this_action.hasOwnProperty("target") && this_action.target != "" ) temp = -1;
                  else temp = nextAction + 1;

                  //   jscript += "addResponse(\"" + button_label + "\"," + temp + "," + use_tts + ");";
                  if ( this_action.hasOwnProperty("dontShow") ) jscript += "addResponse(\"" + button_label + "\"," + temp + ",true);"; // Passes use_tts = true to prevent adding the response to the text
                  else jscript += "addResponse(\"" + button_label + "\"," + temp + "," + use_tts + ");";
                  //  We always stop after displaying the options so the user can make their choice.
                  //  If the user closes the tease and then reloads it at the same place later the
                  //  buttons will be missing. So, we add the buttons to an array in the page
                  // state so they can be restored too.
                  if ( visible == true ) page.buttons[page.buttons.length] = { label: button_label, target: target, jscript: jscript, hotkey: this_action.hotkey }
                  // if ( debug == true ) jscriptLog("Added option button \"" + button_label + "\" with target = " + target + " and jscript = " + jscript);

                  // If this option has commands attached skip over those to the next option, otherwise just advance to the next action
                  page.next = find_action_end(page.next, actionList) + 1;  // Plus 1 because we want the next action
                  if ( page.next < actionList.length ) this_action = actionList[page.next];
                }
                page.next = page.next - 1; // Because we want to start here after the user makes their choice
                // if ( debug == true ) jscriptLog(myName+"Finished processing choice at index " + page.next + ", action=" + actionList[page.next].action);
                done = true;    // Always stop after processing "choices" so they can make their choice
            }
            else if ( action_type == "timer" ) {
                // Record the timer delay, style and target so it gets saved with the current page status,
                // and display it later when we display the image etc.
                page.delay = getElement(this_action.duration);

                page.style = "normal";  // The default style for timer actions
                if ( this_action.hasOwnProperty("style") ) page.style = this_action.style;

                page.startAt = "";
                if ( this_action.hasOwnProperty("startAt") ) page.startAt = this_action.startAt;

                if ( this_action.hasOwnProperty("level") && this_action.level != "" ) {
                  page.delayTarget = guide.getCurrPage();  // We come back here to process more actions
                  temp = page.next + 1; // If/When the timer expires execute it's commands
                  page.delayJscript = "timerExpired(" + temp + ")"; // Count this timer as done when it expires and jump to it's commands

                  // When we start a timer with embedded commands save the current page buttons and reset to an empty list
                  // ToDo:  There may be cases where this will not work properly.
                  //        Like maybe if another button is clicked before the timer expires?
                  page.prevButtons.push(page.buttons);
                  page.buttons = [];

                  // Now skip over the embedded commands.
                  page.next = find_action_end(page.next, actionList);
                }
                else {
                  target = "";
                  if ( this_action.hasOwnProperty("target") ) target = getElement(this_action.target);
                  if ( target == "" ) { // We stay on this page and continue processing
                    page.delayJscript = "timerExpired()"; // To count this timer as done when it expires
                    target = guide.getCurrPage();  // Come back here to process more actions
                  }
                  else {  // We go to some other page (or possibly reload this page)
                    page.delayJscript = "timerExpired(-1)"; // The -1 indicates a page reset
                  }
                  page.delayTarget = target;
                }
                if ( this_action.hasOwnProperty("isAsync") && (this_action.isAsync == "True" || this_action.isAsync == true) )
                  done = false;           // Keep processing commands
                else
                  done = true;            // Pause here until the timer expires
            }
            else if ( action_type == "endTimer" || action_type == "endOption" ) {
                // We just finished processing the commands from a timer that triggered
                // or an option that was selected so go back to where we were before that
                page.next = page.prevAction.pop() - 1;  // We subtract 1 because right after this massive
                                                        // if/else block we add 1 which would make us skip a command
                page.buttons = page.prevButtons.pop();
                if ( debug == true ) jscriptLog(myName+"Returning to prevAction " + page.next);
                // done = true;
            }
            else if ( action_type == "endChoice" ) {
                // The user has made their choice and we have finished processing commands
                // attached to the selected option, so reset the page buttons
                page.buttons = [];
            }
            else if ( action_type == "audio" ) {
                // An audio command implies a Sound.load() and Sound.play() (unless background is true)
                // but an audio command differs from sound.play() in that it only plays while on this page.
                // Sound files started with Sound.play() will continue playing until explicitly stopped.
                temp = 100; // Default volume
                if ( this_action.hasOwnProperty("volume") ) temp = getElement(this_action.volume); // Added getElement() to allow for variable references in volume property
                page.loops = 0;  // Is this an appropriate default?
                if ( this_action.hasOwnProperty("loops") ) page.loops = this_action.loops;
                Sound.load(this_action.file, this_action.id, temp); // Q: Why did I do this? A: Because it seems that's what EOS does.

                // The following was modified in downloader version 0.93 to fix an issue in
                // tease Estim Challenge by lolol2 where the sounds didn't play.
                // The old code was left for reference in case the new method breaks some other tease.

                // Old code: If the audio background property is false do nothing
                //if ( this_action.background == "False" ) {
                //  // Then sound.play() is implied so...
                //  page.audio = this_action.file;
                //  page.soundVolume = temp;
                //  page.soundID = this_action.id;  // Record the id of the active sound in case a subsequent action alters the volume.
                //  if ( guide.isSet("DEBUG") == true ) jscriptLog(myName+"Set page.audio to " + page.audio + ", page.soundVolume = " + page.soundVolume + ", page.soundID = " + page.soundID + ", page.sound = " + page.sound );
                //}

                // New code in version 0.93: If the audio background property is true set the volume to zero but
                // set the sound and soundID properties appropriately
                // The page audio, soundVolume and soundID properties are always set.
                // If a tease tries to load multiple audio files in the background
                // the last one loaded will always start playing unless subsequent actions stop it.
                if ( this_action.background == "True" ) temp = 0;
                page.audio = this_action.file;
                page.soundVolume = temp;
                page.soundID = this_action.id;  // Record the id of the active sound in case a subsequent action alters the volume.

                if ( guide.isSet("DEBUG") == true ) jscriptLog(myName+"Set page.audio to " + page.audio + ", page.sound = " + page.sound + ", page.soundVolume = " + page.soundVolume + ", page.soundID = " + page.soundID);

            }
            else if ( action_type == "metronome" ) {
                // EOS doesn't actually have metronomes, so all metronomes are really audio
                // commands that were converted by the downloader, so we handle those basically
                // the same as audio, but instead of starting it with a Sound.play() we set it
                // in the page.metronome property and use GuideMe's built-in metronome feature
                if ( this_action.hasOwnProperty("background") == false || this_action.background == "False" ) {
                  page.loops = 0;  // Is this an appropriate default?
                  if ( this_action.hasOwnProperty("loops") ) page.loops = this_action.loops;
                  // If the value changes from non-zero to null or zero do we have to turn it off or stop it?
                  page.metronome = this_action.bpm; // You can use a value of "0" or "" to turn it off
                }
            }
            else if ( action_type == "eval" && this_action.statement.length > 0 ) {
              evaluate(this_action.statement)
            }
            else if ( action_type == "if" ) {          // ToDo: How about adding an "elseif" action? Will that impact find_action_end() or the code below to find the else?
              if ( debug == true ) jscriptLog("Found if block at index " + page.next );
              // If the condition is true we just continue with the next action (the first action in
              // the "true" block), otherwise we skip ahead to the matching "else" or "endif"
              if ( evaluate(this_action.condition) == false ) {
                  // The condition was false
                  // Skip ahead looking for an "else" or "endif" that is at the same "level"
                  // as this if, and then continue with the command after that.
                  // We can't use find_action_end() here since it will only look for the endif that
                  // matches this if, but we want to find the matching else or endif
                  target_level = 1;   // Start at 1
                  page.next += 1;     // Skip the "if" action.
                  if (debug == true) jscriptLog(myName+"Starting at index " + page.next + " and Looking for matching else or endif...");
                  // Now we scan the actions decreasing the level when we find an "endif"
                  // and increasing it when we find another "if".
                  // When we find an else or endif at the same level we've found the one we want
                  while ( page.next < actionList.length && target_level > 0 ) {
                    if ( actionList[page.next].action == "if" ) {
                      target_level += 1;
                    }
                    else if ( actionList[page.next].action == "else" ) {
                      if ( target_level <= 1 ) break;  // Found the action we want so quit looking
                    }
                    else if ( actionList[page.next].action == "endif" ) {
                      if ( target_level <= 1 ) break;  // Found the action we want so quit looking
                      target_level -= 1;  // Otherwise keep looking
                    }
                    page.next += 1; // Keep looking
                  }
                  if (debug == true) jscriptLog(myName+"Found an " + actionList[page.next].action + " at index " + page.next);
                  // page.next will now be pointing at the "else" or "endif" that matches this "if"
              }
            }
            else if ( action_type == "else" ) {
              page.next = find_action_end(page.next, actionList);
            }
            else if ( action_type == "globalButton" ) {
              if ( this_action.subAction == "add" ) {
                  // This adds a global button like a choice adds a local button
                  button_label = sanitize_label(this_action.label);  // Sanitize label to compensate for some bugs in Guideme

                  jscript = ""; // Javascript executed when button is clicked
                  if ( this_action.hasOwnProperty("eval") && this_action.eval != "" ) jscript = this_action.eval;

                  if ( this_action.hasOwnProperty("duration") && this_action.duration != "" ) {
                      // globalButton.add(id, label, target, duration, timerTarget, jscript)
                      globalButtons.add(this_action.id, button_label, this_action.placement, getElement(this_action.target), getElement(this_action.duration), getElement(this_action.timerTarget), jscript );
                      //if ( this_action.timerTarget != "" ) {
                      //  page.text += "<br/><br/>" + myName + "A timed GlobalButton specifies a target for the timer. This is not yet implemented.<br/>";
                      //}
                  }
                  else {
                      globalButtons.add(this_action.id, button_label, this_action.placement, getElement(this_action.target),"","",jscript );
                  }
              }
              else if ( this_action.subAction == "remove" ) {
                  // overRide.removeGlobalButton(this_action.id);
                  globalButtons.remove(this_action.id );
              }
              else if ( this_action.subAction == "clear" ) {
                  // overRide.removeGlobalButton(this_action.id);
                  globalButtons.clear();
              }
              else {  // WTF?
                page.text += "<br/><br/>" + myName + "GlobalButton action " + this_action.subAction + " is not recognized.<br/>";
              }
            }
            else if ( action_type == "notification" ) {
                // Displays a timed message at the bottom of the text area.
                // A notification action is created from a global button that had no actions attached to it.
                notification_text = "<strong>" + this_action.label.replace(/&#x27;/g,"'").replace(/&#39;/g,"'").replace(/&#8217;/g,"'") + "</strong>";
                notification_duration = getElement(this_action.duration);
            }
            else if ( action_type == "goto" ) {
              // Go to a new page and cancel everything else
              gotoPage = getElement(this_action.target);
              page.next = -1;     // So we start over if we happen to come back to this page
              page.text = "";     // And reset the page text
              done = true;        // And go there now
            }
            else if ( action_type == "set" ) {
              // Set a flag
              guide.setFlags(this_action.flag);
            }
            else if ( action_type == "unset" ) {
              // Unset a flag
              guide.unsetFlags(this_action.flag);
            }
            else if ( action_type == "noop" ) {
              // Ignore this action
              if (debug == true) jscriptLog(myName+" Skipping noop action")
              page.next = find_action_end(page.next, actionList);
            }
            else if ( action_type != "endif" ) {
              page.text += "<br/><br/>" + myName + "Action type " + this_action.action + " is not recognized.<br/>";
            }

            // And process the next action
            page.next += 1;
            if ( page.next >= actionList.length ) {
              done = true;
              temp = ""
            }
            else temp = ", action = " + actionList[page.next].action
            if (debug == true) jscriptLog(myName+"next action = " + page.next + ", done = " + done + temp)
          } // End of while loop to process actions
        } // End of Main IF block

        if ( page.image != "" ) {
            page.prevImage = page.image;  // Record last image specified
        }
        // When we get here we are done processing actions for now _unless_ page.next is 0
        // which means we probably got a goto command coming back to this page
        if ( page.next == 0 ) page.done = false;  // Continue processing actions
        else page.done = true;                    // Otherwise we're done for now
        scriptVars.put("pageState",page);

        if ( debug == true ) { // FOR DEBUGGING ONLY
          jscriptLog("Current page data:");
          jscriptLog("  gotoPage      = " + gotoPage       );
          jscriptLog("  prevImage     = " + page.prevImage );
          jscriptLog("  image         = " + page.image );
          jscriptLog("  audio         = " + page.audio     );
          jscriptLog("  sound         = " + page.sound     );
          jscriptLog("  soundID       = " + page.soundID   );
          jscriptLog("  soundVolume   = " + page.soundVolume );
          jscriptLog("  metronome     = " + page.metronome );
          jscriptLog("  delay         = " + page.delay     );
          jscriptLog("  delayTarget   = " + page.delayTarget );
          jscriptLog("  startAt       = " + page.startAt   );
          jscriptLog("  style         = " + page.style     );
          jscriptLog("  allowSkip     = " + page.allowSkip );
          jscriptLog("  delayJscript  = " + page.delayJscript );
          jscriptLog("  startAt       = " + page.startAt   );
          jscriptLog("  Buttons set   = " + page.buttons.length );
            for ( butt in page.buttons) {
              jscriptLog("      " + page.buttons[butt].label + ", target=" + page.buttons[butt].target + ", jscript=" + page.buttons[butt].jscript );
            }
          jscriptLog("  Global Buttons= " + globalButtons.active() );
          jscriptLog("  Next action is= " + page.next + " of " + actionList.length );
          jscriptLog("  Done actions  = " + page.done );
        }

        if ( gotoPage != "" ) {
          overRide.setPage(gotoPage);
        }
        else {
          if ( page.text != "" || userPrompt != "" ) {
              // To better emulate EOS the text is wrapped in some CSS and javascript so that it
              // always scrolls to the bottom so the most recently added text is always visible
              // temp = "<style>#container { height: 500px; overflow: auto; }</style>\n";
              if ( use_tts == true ) {
                  temp = "";
                  if ( page.text != "" ) temp = page.text + "\n";
                  if ( userPrompt != "" ) temp += userPrompt;
                  overRide.setHtml(temp);
              }
              else {
                  temp = "<style>#container { height: 100%; overflow: auto; }</style>\n";
                  temp += "<div id=\"container\">\n";
                  temp += page.text + "\n";
                  if ( userPrompt != "" ) temp += userPrompt;
                  temp2 = "</div>\n";
                  temp2 += "<script>document.getElementById(\"container\").scrollTop = document.getElementById(\"container\").scrollHeight;</script>\n";
                  overRide.setHtml(temp+notification_text+temp2);
                  // When a text notification is displayed set a timer to clear it
             			if ( notification_text != "" ) {
                    guide.addTimer(notification_duration,"", "", temp+temp2, "", "", "");
                    // if ( debug == true ) jscriptLog(myName+"Added timer to update page text with " + notification_duration + " second delay");
                  }
              }
          }
          if ( page.image != "" ) {
              overRide.setImage(page.image);
          }
          else if ( page.prevImage != "" ) {
              overRide.setImage(page.prevImage);
          }

          // Sound files triggered through the Sound() module override anything else in the page
          if ( page.hasOwnProperty("sound") && page.sound != "" && page.soundVolume > 0 ) { // Modified in downloader version 0.93 so sound only plays if volume is non-zero
            overRide.setAudio(page.sound, page.soundPosition, "", "", "", "", "", "", page.soundVolume);
          }
          else {
            // setAudio(id, startAt, stopAt, target, set, unset, repeat, jscript, volume)
            // The following was modified in downloader version 0.93 so sound only plays if volume is non-zero
            if ( page.audio != ""  && page.soundVolume > 0 )  overRide.setAudio(page.audio, "", "", "", "", "", page.loops, "", page.soundVolume);
            // Sounds converted to metronome always play
            if ( page.metronome != "" && page.metronome != "0" )  overRide.setMetronome(page.metronome, 4, page.loops, "");
          }

          if ( page.delay != "" ) {
            overRide.setDelay(page.delayTarget, page.delay, page.startAt, page.style, "", "", page.delayJscript);
            // if ( debug == true ) jscriptLog(myName+"Added " + page.delay + " second delay with target " + page.delayTarget + " and javascript " + page.delayJscript);
            if ( page.allowSkip == true ) {
              overRide.addButton(page.delayTarget, "Continue>>", "", "", page.delayJscript, "", "", "1", false, "");
              if ( debug == true ) jscriptLog("Added Skip button (default) with jscript " + jscript );
            }
          }

          if ( emulateGlobalButtons == true ) globalButtons.show(); // Display any global buttons

          if ( page.buttons.length > 0 ) {
              opt = 1;
              for ( n=0; n < page.buttons.length; n++ ) {
                // page buttons look like { label: button_label, target: target, jscript: jscript, hotkey: this_action.hotkey }
                overRide.addButton(page.buttons[n].target, page.buttons[n].label, "", "", page.buttons[n].jscript, "", page.buttons[n].hotkey, opt, false, "");
                opt++;
              }
          }
          else if ( page.delay == "" && globalButtons.active() == 0 && (actionList != undefined && page.next < actionList.length) ) {
              // If we have no buttons and no delay, and still have actions left to process
              // then add a default Continue button that just comes back here.
              // Otherwise we hit an end page or an unintentional dead end.
              if ( jscript == "" ) jscript = "continueActions()"; // So we continue processing actions
              overRide.addButton(guide.getCurrPage(), "Continue", "", "", jscript, "", "", "1", false, "");
              if ( debug == true ) jscriptLog("Added button Continue (default) with jscript " + jscript );
          }
        }
      }

      // ----------------------------------------------------------------------
      // Find the end of a block action in the action list.
      function find_action_end(start,action_list) {
          // start is the index of the action you need to find the end of.
          // If the current action is not a block action index start is returned unchanged since it is both
          // the start and end of the action
          // If the action at index start is a block action like a timer with embedded commands, an if action,
          // or a choice block, this function finds the end of the block and returns that index.
          // Note that for "if" actions this function always finds the matching "endif", ignoring "else" clauses.
          // If the start action is an "else" action, it also finds the matching "endif".

          // Q: What about globalbuttons and notifications with embedded commands?
          // A: They get moved to child pages so are not an issue
          var myName = "find_action_end: ";
          var i = start;
          var target_level = "";
          var this_action = action_list[i].action;  // The current action type
          if ( guide.isSet("DEBUG") == true ) jscriptLog(myName+"Looking for end of " + this_action + " action at index " + i)

          if ( this_action == "noop" && action_list[i].hasOwnProperty("original_action") ) this_action = action_list[i].original_action;

          if ( this_action == 'timer' && action_list[i].hasOwnProperty("level") ) {
              // It's a timer with embedded commands
              target_level = action_list[i].level;
              // Skip ahead to the matching endTimer
              i = i + 1;
              while ( i < action_list.length ) {
                if ( action_list[i].action == "endTimer" && action_list[i].level == target_level) break;
                else i = i + 1;
              }
              // i is now the index of the endTimer action
          }
          else if ( this_action == 'choice' ) {
              // It's a choice block - find the matching endChoice
              target_level = action_list[i].level;
              // Skip ahead to the matching endChoice
              i = i + 1;
              while ( i < action_list.length ) {
                if ( action_list[i].action == "endChoice" && action_list[i].level == target_level ) break;
                else i = i + 1;
              }
              // i is now the index of the endChoice action
          }
          else if ( this_action == 'option' && action_list[i].hasOwnProperty("cmds") && action_list[i].cmds == "True" ) {
              // It's an option in a choice that has commands in it - find the matching endOption
              target_level = action_list[i].level;
              // Skip ahead to the matching endChoice
              i = i + 1;
              while ( i < action_list.length ) {
                if ( action_list[i].action == "endOption" && action_list[i].level == target_level ) break;
                else i = i + 1;
              }
              // i is now the index of the endOption action
          }
          else if ( this_action == 'if' || this_action == 'else' ) {
              target_level = 1; // Start at 1
              i = i + 1;        // Skip the "if" or "else" action.
              // Now we scan the actions decreasing the level when we find an 'endif'
              // and increasing it when we find an "if".
              // When target_level goes to zero we've found the endif that matches this "if"
              while ( i < action_list.length && target_level > 0 ) {
                if ( action_list[i].action == "if" ) {
                  target_level += 1;
                  i += 1;  // Keep looking
                }
                else if ( action_list[i].action == "endif" ) {
                  target_level -= 1;
                  if ( target_level <= 0 ) break;  // Found the end
                  else i = i + 1; // Keep looking
                }
                else {
                  i = i + 1; // Keep looking
                }
              }
          }

          if ( guide.isSet("DEBUG") == true ) jscriptLog(myName+"Action ends at index " + i)
          return i;
      }

      // ----------------------------------------------------------------------
      // Modifies (increases or decreases) the integer number in the given scriptVar
      // by the amount specified
      function modifyVariable(variable,amount) {
        var value = parseInt(scriptVars.get(variable),10);
        amount = parseInt(amount,10);
         if ( guide.isSet("DEBUG") == true ) jscriptLog("modifyVariable(): Adding " + variable + " + " + value );
        if ( isNaN(value) ) {
          value = 0;
          if ( guide.isSet("DEBUG") == true ) jscriptLog(guide.getCurrPage()+": scriptVar " + variable + " initialized to 0");
        }
        if ( isNaN(amount) ) {
          if ( guide.isSet("DEBUG") == true ) jscriptLog(guide.getCurrPage()+": Amount " + amount + " specified on call to increaseVariable() is not a number");
        }
        else {
          value += amount;
        }
        scriptVars.put(variable, ""+value);
      }

      // ----------------------------------------------------------------------
      // Sets variable to value
      function setVariable(variable,value) {
        if ( guide.isSet("DEBUG") == true ) jscriptLog("setVariable(): Starting with variable=" + variable + ", value=" + value );
        variable = variable.replace(/^"|"$/gm,'');  // Remove leading and trailing quotes from variable name
        value    = value.replace(/^"|"$/gm,'');     // Remove leading and trailing quotes from value
        var intValue = parseInt(value,10);
        if ( guide.isSet("DEBUG") == true ) jscriptLog("setVariable(): Setting " + variable + " to " + value );
        if ( isNaN(intValue) ) {
          // It's a string so just save it
          scriptVars.put(variable, value);
        }
        else {
          // Save it as a numeric value
          scriptVars.put(variable, intValue);
        }
      }

      // ----------------------------------------------------------------------
      // Returns a text string that defines a form with a text box to get input
      // from the user.
      //  Caption is the prompt to the user
      //  Value is the initial value in the text box (may be empty)
      //  Width is the width of the text box
      function addPrompt(Caption, Value, Width) {
        var text = "";
        if ( Caption === undefined ) Caption = "Response: ";
        if ( Value === undefined ) Value = "";
        if ( Width === undefined ) Width = 10;
        text += "<form>\n";
        text += Caption + " <input type='text' name=\"Prompt\" ";
        text += "value=\"" + Value + "\" ";
        text += "size='" + Width + "'";
        text += " />";
        text += "</form>\n";
        return text;
      }

      // --------------------------------------------------------------------------------------
      // Evaluate simple javascript statements
      // It is assumed that the statements have already been converted to proper GuideMe syntax
      function evaluate(statement) {
        var myName = "evaluate: ";
        statement = statement.replace(/&#x27;/g,"'").replace(/&#39;/g,"'").replace(/&#8217;/g,"'").replace(/&quot;/g,'"'); // Fix quotes that got encoded
        if ( guide.isSet("DEBUG") == true ) jscriptLog(myName+"Evaluating \"" + statement + "\"");
        var result;
        var temp;

        // Check for "$variable". The $ will have been removed by the caller
        temp = getVariable(statement)
        if ( temp !== undefined ) return temp;

        // It wasn't a simple variable reference so...
        try {
          result = eval(statement);
          if ( guide.isSet("DEBUG") == true ) jscriptLog(myName+"Which evaluates to \"" + result +"\" (" + typeof(result) + ")");
        }
        catch(err) {
          jscriptLog("Evaluation of \"" + statement + "\" failed with error " + err.message);
          result = false;
        }
        if ( result == undefined ) result = false;
        return result;
      }

      // ----------------------------------------------------------------------
      function matchFile(file) {
        // Adpated from matchFile() from the GuideMe Script Engine by playfulguy
        // Take the supplied file spec and see if it resolves to a valid filename
        // allowing for wildcards (*)
        // The return value is the file spec if it matches something, or a null string otherwise
        var myName = "matchFile: ";
        var result;
        var temp = file;
        if ( guide.isSet("DEBUG") == true ) jscriptLog(myName+"Testing file \"" + temp + "\" type = " + typeof(temp));
        var i;

        // Check for wildcards like *, *.jpg, SomeImage* etc.
        if (temp.search(/\*/) == -1 ) {
          // Non wildcard file spec so just use it as is
          result = temp;
        }
        else {
          // Found a wildcard in the file spec
          // if ( guide.isSet("DEBUG") == true ) jscriptLog(myName+"Got wildcard file spec.");

          // In earlier versions of GuideMe there was a bug where GetRandomFile will return
          // folders as well as files, which of course doesn't work well if you're
          // trying to match a file.
          // On Windows systems it will also sometimes return the hidden system file thumbs.db.
          // To compensate for this we try up to 10 times to find a file, checking
          // each result to see if it's a folder, or the dreaded thumbs.db.

          var tries = 0;
          var done = false;
          while ( ! done ) {
            // comonFunctions.GetRandomFile() requires us to specify the path and
            // image portions separately so we have to sort that out.

            if ( temp.search(/\//) != -1 ) {
              // The file spec contains a path portion
              i = temp.lastIndexOf("/");  // Find last forward slash
              // if ( guide.isSet("DEBUG") == true ) jscriptLog(myName+"Splitting path and filename gives path=\"" + temp.substr(0,i) + "\" and file =\"" + temp.substr(i+1) + "\"");
              try {
                result = comonFunctions.GetRandomFile(temp.substr(i+1), temp.substr(0,i) );
              }
              catch (err) {
                result = "";
              }
            }
            else {
              // No path portion, just a wildcard name so use it as is
              // if ( guide.isSet("DEBUG") == true ) jscriptLog(myName+"No path portion found so trying \"" + temp + "\"");
              try {
                result = comonFunctions.GetRandomFile(temp, "");
              }
              catch (err) {
                result = "";
              }
            }
            // Did we get something valid?
            tries = tries + 1;
            done = true;
            if ( result.search(/thumbs\.db/i) != -1 ) {
              result = "";
              done = false;
            }
            else if ( comonFunctions.directoryExists(result) == true ) {
              result = "";
              done = false;
            }
            if ( tries >= 10 ) {
              done = true;
              if ( guide.isSet("DEBUG") == true ) jscriptLog(myName+" got " + result + " - max retries reached.");
            }
            if ( ! done && guide.isSet("DEBUG") == true ) jscriptLog(myName+" got " + result + " - trying again (" + tries + ")");
          }
        }

        result = "" + result; // Forces return value to be a javascript string
        if ( guide.isSet("DEBUG" ) == true) jscriptLog(myName+"Final result is \"" + result + "\"");
        return result;
      }
      //---------------------- End GuideMe EOS Lib ----------------------------------

      //-----------------------------------------------------------------------------
      // Functions specific to "Teasefight Invitational Cup [1.1]"
      //-----------------------------------------------------------------------------

      function initializeScriptVars() {
        // If ForceStartPage is true the start page will call this function every time you open the tease.
        // The following flags can be changed to adjust the tease behaviour.
      
        // If you change the following to false any initialization code defined in the 
        // original tease will only happen the first time you open the tease, or when
        // you do a File/Restart in GuideMe. 
        // The default is true to reflect what normally happens in EOS.
        initialize_on_every_load = true;
      
        // The following is normally true to have all pages automatically enabled when the tease loads.
        // This is what usually happens in EOS, but see the code following the list if you want to 
        // leave some, or all pages disabled.
        enable_all_pages = true;
      
        // This list is used to support wildcard targets in page actions.
        // MODIFYING THIS LIST COULD BREAK THE TEASE. Make sure you know what you are doing.
        var PageList = [
          "Aleksa-Slusarchi", "Anna-Aj", "Anita", "Divina", "Georgia-Jones",
          "Julie", "1roundfight", "1initcupround", "2fightspeed", "3winfight", 
          "2fighttime", "2fightpattern", "2fightedge", "0debuger", "3wincup", 
          "4finish", "Katya", "2fightedge2", "Caralyn", "Catie",
          "Franziska", "Elina", "Caitlin", "Alice", "Alysha", 
          "Ashley", "Ellison", "Guerlain", "Karissa", "Karla", 
          "Katya-P", "Kenna", "Kirika", "Kristy", "Lena",
          "Leona", "Malena-Fendi", "Melissa-Moore", "Vi-Shy", "Magen", 
          "Malena-Morgan", "Nika", "Red-Fox", "Sabrisse", "Sapphira", 
          "Sasha", "Talia", "Adelia", "Toxic", "Sheri-Vi", 
          "Sophia", "0-Intro-1", "0-Intro-0", "0-Intro-000", "0-Intro-00",
          "0-Intro-2", "0-Intro-5", "0-Intro-3", "0-Intro-3-1", "0-Intro-3-2", 
          "0-Intro-3-3", "0-Intro-4", "0-Intro-9", "Lyuda", "Amanda",
          "0-Intro-4-1", "0-Intro-4-3", "0-Intro-4-2", "0-Intro-6", "0-Intro-7", 
          "0opening", "0qualification", "4finish-2", "0start-1", "start",
          "4finish-3", "2fightedge1", "4finish-4", "4finish-5", "4finish-6", 
          "5before-end", "End", 
        ];
        scriptVars.put("PageList",PageList);

        if ( enable_all_pages == true ) {
          // To leave some pages disabled modify this code to check the
          // page name and skip ones you don't want to enable.
          for ( page in PageList) {
            guide.unsetFlags(PageList[page]);
          }
        }

    // Put stuff the SHOULD be initialized every time here

    // End of stuff that SHOULD be initialized every time

        // Things that do not need to be initialized every time should be left within this "if" clause
        if ( initialize_on_every_load == true || guide.isNotSet("_Initialized_")) {
          // This is initialization code from the original tease online
          scriptVars.put("starttime",2);
          scriptVars.put("endtime",1);
          scriptVars.put("length",8000);
          scriptVars.put("lengthmin",12);
          scriptVars.put("lengthmax",22);
          scriptVars.put("time",new Date());
          scriptVars.put("question",false);
          scriptVars.put("quessresult",false);
          scriptVars.put("framed",false);
          scriptVars.put("gallerypic",false);
          scriptVars.put("girllist",[]);    // PG mod: was scriptVars.put("girllist",Array);
          scriptVars.put("holding",false);
          scriptVars.put("holdingchance",0);
          scriptVars.put("contendermax",4);
          scriptVars.put("round",0);
          scriptVars.put("tofinal",false);
          var qualified = [];
          scriptVars.put("qualified",qualified);
          scriptVars.put("qualifiedstring","");
          scriptVars.put("cuproundstart",true);
          scriptVars.put("cuproundname","");
          scriptVars.put("cupround",1);
          scriptVars.put("winner","");
          scriptVars.put("newround",true);
          scriptVars.put("fought",false);
          scriptVars.put("foughtnumber",0);
          scriptVars.put("hardtime",false);
          scriptVars.put("roundend",false);
          scriptVars.put("teasefightseen",false);
          scriptVars.put("askquestions",0);
          scriptVars.put("askteasetarget",false);
          scriptVars.put("askwhatdoi",false);
          scriptVars.put("askqualify",false);
          scriptVars.put("askrounds",false);
          scriptVars.put("askcum",false);
          scriptVars.put("askfinished",false);
          scriptVars.put("cumbutton",false);
          var contenders = [];
          scriptVars.put("contenders",contenders);
          var fighters = [];
          scriptVars.put("fighters",fighters);
          var result = [];
          scriptVars.put("result",result);
          scriptVars.put("fighter","");
          scriptVars.put("teasetarget","");
          var girlthreeteases = [];
          scriptVars.put("girlthreeteases",girlthreeteases);
          var girlfourteases = [];
          scriptVars.put("girlfourteases",girlfourteases);
          var girloneteases = ["time","speed","pattern"];
          scriptVars.put("girloneteases",girloneteases);
          var girltwoteases = ["time","speed","pattern"];
          scriptVars.put("girltwoteases",girltwoteases);
          var refereeload = ["RefereeA","RefereeB","RefereeC","RefereeD"];
          scriptVars.put("refereeload",refereeload);
          scriptVars.put("referee","");
          scriptVars.put("fighterload","girlone,girltwo");
          scriptVars.put("teaseload","2fighttime,2fightspeed,2fightpattern");
          scriptVars.put("tease","");
          scriptVars.put("contendercount",0);
          scriptVars.put("finishcount",0);
          scriptVars.put("fightercount",0);
          scriptVars.put("final",false);
          scriptVars.put("contenderwaiting",0);
          scriptVars.put("qualifiedamount",0);
          scriptVars.put("round",0);
          scriptVars.put("cupstart",true);
          scriptVars.put("newgirl","");
          scriptVars.put("fightername","");
          scriptVars.put("girlone","");
          scriptVars.put("girltwo","");
          scriptVars.put("girlthree","");
          scriptVars.put("girlfour","");
          scriptVars.put("returnpage","");
          scriptVars.put("transfer","");
          scriptVars.put("index1",0);
          scriptVars.put("index2",0);
          scriptVars.put("tmp","");
          scriptVars.put("girlscount",0);
          scriptVars.put("level",0);

//          var game = {
//              length : 99,
//              punishednumbar : 0,
//              level : 0,
//              getlength: function(starttime, endtime) {
//                return (Math.floor((endtime - starttime) / 1000));
//                },
//              random: function(from, to) {
//                return (Math.floor(Math.random() * (to - from +1) + from))
//                }
//          scriptVars.put("game",game);
//              };

          scriptVars.put("girlonejoker",true);
          scriptVars.put("girltwojoker",true);
          scriptVars.put("jokerone",false);
          scriptVars.put("jokertwo",false);
      
          var models = [
          				"Aleksa-Slusarchi",
          				"Alice",
          				"Amanda",
          				"Alysha",
          				"Ashley",
          				"Caitlin",
          				"Caralyn",
          				"Catie",
          				"Elina",
          				"Ellison",
          				"Franziska",
          				"Guerlain",
          				"Julie",
          				"Karissa",
          				"Karla",
          				"Katya-P",
          				"Kenna",
          				"Kirika",
          				"Kristy",
          				"Lena",
          				"Lyuda",
          				"Leona",
          				"Malena-Fendi",
          				"Melissa-Moore",
          				"Vi-Shy",
          				"Anna-Aj",
          				"Anita",
          				"Divina",
          				"Georgia-Jones",
          				"Julie",
          				"Katya",
          				"Magen",
          				"Malena-Morgan",
          				"Nika",
          				"Red-Fox",
          				"Sabrisse",
          				"Sapphira",
          				"Sasha",
          				"Talia",
          				"Adelia",
          				"Toxic",
          				"Sheri-Vi",
          				"Sophia",
                  ];
          scriptVars.put("models",models);
          if ( initialize_on_every_load == false ) guide.setFlags("_Initialized_");  // So we only do this part once
        }   // End of if ( initialize_on_every_load == true ) 
      }   // End of initializeScriptVars()


      //-----------------------------------------------------------------------------
      function getRandom(from, to) {
        return (Math.floor(Math.random() * (to - from +1) + from))
      }

      //-----------------------------------------------------------------------------
      function getgirl(girllist) {
        //var girllist = getVariable("girllist");
        var game = getVariable("game");
        var length = girllist.length;
        index = getRandom(0,length-1);
        gottengirl = girllist[index];
        girllist[index] = girllist[length-1];
        girllist.pop();
//        scriptVars.put("girllist",girllist);
        scriptVars.put("gottengirl",gottengirl);
        return gottengirl;
      };

      //-----------------------------------------------------------------------------
      function mixarray(girllist) {
        //var girllist = getVariable("girllist");
        var length = getVariable("length");
        var index1 = getVariable("index1");
        var game = getVariable("game");
        var index2 = getVariable("index2");
        var tmp = getVariable("tmp");
        length = girllist.length;
        index1 = getRandom(0,length-1);
        index2 = getRandom(0,length-1);
        tmp = girllist[index1];
        girllist[index1] = girllist[index2];
        girllist[index2] = tmp;
        index1 = getRandom(0,length-1);
        index2 = getRandom(0,length-1);
        tmp = girllist[index1];
        girllist[index1] = girllist[index2];
        girllist[index2] = tmp;
        index1 = getRandom(0,length-1);
        index2 = getRandom(0,length-1);
        tmp = girllist[index1];
        girllist[index1] = girllist[index2];
        girllist[index2] = tmp;
        index1 = getRandom(0,length-1);
        index2 = getRandom(0,length-1);
        tmp = girllist[index1];
        girllist[index1] = girllist[index2];
        girllist[index2] = tmp;
        index1 = getRandom(0,length-1);
        index2 = getRandom(0,length-1);
        tmp = girllist[index1];
        girllist[index1] = girllist[index2];
        girllist[index2] = tmp;
        index1 = getRandom(0,length-1);
        index2 = getRandom(0,length-1);
        tmp = girllist[index1];
        girllist[index1] = girllist[index2];
        girllist[index2] = tmp;
        index1 = getRandom(0,length-1);
        index2 = getRandom(0,length-1);
        tmp = girllist[index1];
        girllist[index1] = girllist[index2];
        girllist[index2] = tmp;
        scriptVars.put("girllist",girllist);
        scriptVars.put("length",length);
        scriptVars.put("index1",index1);
        scriptVars.put("game",game);
        scriptVars.put("index2",index2);
        scriptVars.put("tmp",tmp);
        return;
        scriptVars.put("girllist",girllist);
        scriptVars.put("length",length);
        scriptVars.put("index1",index1);
        scriptVars.put("game",game);
        scriptVars.put("index2",index2);
        scriptVars.put("tmp",tmp);
      };
      
      //-----------------------------------------------------------------------------
      function deletegirl(girl, girllist) {
        //var girllist = getVariable("girllist");
        var length = getVariable("length");
        var index = getVariable("index");
        length = girllist.length;
        index = girllist.indexOf(girl-1);
        girllist[index] = girllist[length-1];
        girllist.pop();
        scriptVars.put("girllist",girllist);
        scriptVars.put("length",length);
        scriptVars.put("index",index);
        return;
        scriptVars.put("girllist",girllist);
        scriptVars.put("length",length);
        scriptVars.put("index",index);
      };
      
      //-----------------------------------------------------------------------------
      function transarray(sourcearray) {
        var transfer = getVariable("transfer");
        var result = getVariable("result");
        transfer = sourcearray.join(",");
        result = transfer.split(",");
        scriptVars.put("transfer",transfer);
        scriptVars.put("result",result);
        return result;
        scriptVars.put("transfer",transfer);
        scriptVars.put("result",result);
      };
      
      //-----------------------------------------------------------------------------
      function findgirl(girllist) {
        //var girllist = getVariable("girllist");
        var length = getVariable("length");
        var index = getVariable("index");
        var game = getVariable("game");
        var gottengirl = getVariable("gottengirl");
        length = girllist.length;
        index = getRandom(0,length-1);
        gottengirl = girllist[index];
        scriptVars.put("girllist",girllist);
        scriptVars.put("length",length);
        scriptVars.put("index",index);
        scriptVars.put("game",game);
        scriptVars.put("gottengirl",gottengirl);
        return gottengirl;
        scriptVars.put("girllist",girllist);
        scriptVars.put("length",length);
        scriptVars.put("index",index);
        scriptVars.put("game",game);
        scriptVars.put("gottengirl",gottengirl);
      };
      //-----------------------------------------------------------------------------
      function Aleksa_Slusarchi_func5() {
        var framed = getVariable("framed");
        var returnpage = getVariable("returnpage");
        framed = true;
        pages.goto(returnpage);
        scriptVars.put("framed",framed);
        scriptVars.put("returnpage",returnpage);
      }
      function page1roundfight_func0() {
        var fighters = getVariable("fighters");
        var girloneteases = getVariable("girloneteases");
        var fought = getVariable("fought");
        var fighterload = getVariable("fighterload");
        var roundend = getVariable("roundend");
        var round = getVariable("round");
        var teaseload = getVariable("teaseload");
        var girltwoteases = getVariable("girltwoteases");
        var girlthreeteases = getVariable("girlthreeteases");
        var girlfourteases = getVariable("girlfourteases");
        // check round state and set flags
        //
        remainingfight = fighters.length;
        remainingtease = girloneteases.length;
        if (remainingfight == 0) {
              fought = true;
              fighters = fighterload.split(",");
              if (remainingtease == 0) {
                    roundend = true;
                    round++ ;
                    girloneteases = teaseload.split(",");
                    mixarray(girloneteases);
                    girltwoteases = teaseload.split(",");
                    mixarray(girltwoteases);
                    girlthreeteases = teaseload.split(",");
                    mixarray(girlthreeteases);
                    girlfourteases = teaseload.split(",");
                    mixarray(girlfourteases);
              };
        };
        scriptVars.put("fighters",fighters);
        scriptVars.put("girloneteases",girloneteases);
        scriptVars.put("fought",fought);
        scriptVars.put("fighterload",fighterload);
        scriptVars.put("roundend",roundend);
        scriptVars.put("round",round);
        scriptVars.put("teaseload",teaseload);
        scriptVars.put("girltwoteases",girltwoteases);
        scriptVars.put("girlthreeteases",girlthreeteases);
        scriptVars.put("girlfourteases",girlfourteases);
        scriptVars.put("remainingfight",remainingfight);
        scriptVars.put("remainingtease",remainingtease);
      }

      function page1roundfight_func45() {
        var cumbutton = getVariable("cumbutton");
        var fought = getVariable("fought");
        var foughtnumber = getVariable("foughtnumber");
        var roundend = getVariable("roundend");
        var fighter = getVariable("fighter");
        var fighters = getVariable("fighters");
        var fightername = getVariable("fightername");
        var girlone = getVariable("girlone");
        var tease = getVariable("tease");
        var girloneteases = getVariable("girloneteases");
        var girltwo = getVariable("girltwo");
        var girltwoteases = getVariable("girltwoteases");
        var girlthree = getVariable("girlthree");
        var girlthreeteases = getVariable("girlthreeteases");
        var girlfour = getVariable("girlfour");
        var girlfourteases = getVariable("girlfourteases");
        var framed = getVariable("framed");
        // get a girl from fighters and choose a tease
        //
        cumbutton = true;
        fought = false;
        ++foughtnumber;
        roundend = false;
        fighter = getgirl(fighters);
        if (fighter == "girlone") {
              fightername = girlone;
              tease = getgirl(girloneteases);  //  choose tease
          } else {
              if (fighter == "girltwo") {
                fightername = girltwo;
                tease = getgirl(girltwoteases);  //  choose tease
            } else {
                if (fighter == "girlthree") {
                  fightername = girlthree;
                  tease = getgirl(girlthreeteases);  //  choose tease
              } else {
                  if (fighter == "girlfour") {
                    fightername = girlfour;
                    tease = getgirl(girlfourteases);  //  choose tease
        }}}};
        framed = false;
        gallery = true;
        pages.goto(tease);
        scriptVars.put("cumbutton",cumbutton);
        scriptVars.put("fought",fought);
        scriptVars.put("foughtnumber",foughtnumber);
        scriptVars.put("roundend",roundend);
        scriptVars.put("fighter",fighter);
        scriptVars.put("fighters",fighters);
        scriptVars.put("fightername",fightername);
        scriptVars.put("girlone",girlone);
        scriptVars.put("tease",tease);
        scriptVars.put("girloneteases",girloneteases);
        scriptVars.put("girltwo",girltwo);
        scriptVars.put("girltwoteases",girltwoteases);
        scriptVars.put("girlthree",girlthree);
        scriptVars.put("girlthreeteases",girlthreeteases);
        scriptVars.put("girlfour",girlfour);
        scriptVars.put("girlfourteases",girlfourteases);
        scriptVars.put("framed",framed);
        scriptVars.put("gallery",gallery);
      }
      function page1initcupround_func0() {
        var contenderwaiting = getVariable("contenderwaiting");
        var contenders = getVariable("contenders");
        var qualifiedamount = getVariable("qualifiedamount");
        var qualified = getVariable("qualified");
        var qualifiedstring = getVariable("qualifiedstring");
        var cuproundstart = getVariable("cuproundstart");
        var teaseload = getVariable("teaseload");
        var fighterload = getVariable("fighterload");
        var fighters = getVariable("fighters");
        var fightercount = getVariable("fightercount");
        var cuproundname = getVariable("cuproundname");
        var round = getVariable("round");
        var final = getVariable("final");
        var tofinal = getVariable("tofinal");
        var winner = getVariable("winner");
        var fightername = getVariable("fightername");
        var girlone = getVariable("girlone");
        var girltwo = getVariable("girltwo");
        var girlthree = getVariable("girlthree");
        var girlfour = getVariable("girlfour");
        var girloneteases = getVariable("girloneteases");
        var girltwoteases = getVariable("girltwoteases");
        var girlthreeteases = getVariable("girlthreeteases");
        var girlfourteases = getVariable("girlfourteases");
        var referee = getVariable("referee");
        var refereeload = getVariable("refereeload");
        // check cup state and set flags
        //
        contenderwaiting = contenders.length;
        qualifiedamount = qualified.length;
        qualifiedstring = qualified.join(", ");
        cuproundstart = false;
        if (contenderwaiting < 1) {
              // new cup round
              if (qualifiedamount == 32 ) {
                    teaseload = "2fighttime,2fightspeed,2fightpattern";
                    fighterload = "girlone,girltwo,girlthree,girlfour";
                    fighters = fighterload.split(",");
                    fightercount = 4;
                    cuproundname = "Qualification round";
                    cuproundstrength = 1;
                    cuproundstart = true;
                    round = 1;
                    contenders = transarray(qualified);
                    qualified = [];
                } else if (qualifiedamount == 16 ) {
                    teaseload = "2fighttime,2fightspeed,2fightpattern,2fightedge";
                    fighterload = "girlone,girltwo";
                    fighters = fighterload.split(",");
                    fightercount = 2;
                    cuproundname = "Last 16";
                    cuproundstrength = 1;
                    cuproundstart = true;
                    round = 1;
                    contenders = transarray(qualified);
                    qualified = [];
                } else if (qualifiedamount == 8 ) {
                    teaseload = "2fighttime,2fightspeed,2fightpattern,2fightedge";
                    fighterload = "girlone,girltwo";
                    fighters = fighterload.split(",");
                    fightercount = 2;
                    cuproundname = "Quarterfinal";
                    cuproundstrength = 2;
                    cuproundstart = true;
                    round = 1;
                    contenders = transarray(qualified);
                    qualified = [];
                } else if (qualifiedamount == 4 ) {
                    teaseload = "2fighttime,2fightspeed,2fightpattern,2fightedge";
                    fighterload = "girlone,girltwo";
                    fighters = fighterload.split(",");
                    fightercount = 2;
                    cuproundname = "Semifinal";
                    cuproundstrength = 3;
                    cuproundstart = true;
                    round = 1;
                    contenders = transarray(qualified);
                    qualified = [];
                } else if (qualifiedamount == 2 ) {
                    teaseload = "2fighttime,2fightspeed,2fightpattern,2fightedge";
                    fighterload = "girlone,girltwo";
                    fighters = fighterload.split(",");
                    fightercount = 2;
                    final = true;
                    tofinal = true;
                    cuproundstart = true;
                    cuproundstrength = 3;
                    cuproundname = "Final";
                    round = 1;
                    contenders = transarray(qualified);
                    qualified = [];
                } else if (qualifiedamount == 1 ) {
                    winner = fightername;
                    pages.goto("3wincup");
              };
        };
        // get fighters
        if (fightercount == 4) {
              girlone = getgirl(contenders);
              girltwo = getgirl(contenders);
              girlthree = getgirl(contenders);
              girlfour = getgirl(contenders);
              girloneteases = teaseload.split(",");
              mixarray(girloneteases);
              girltwoteases = teaseload.split(",");
              mixarray(girltwoteases);
              girlthreeteases = teaseload.split(",");
              mixarray(girlthreeteases);
              girlfourteases = teaseload.split(",");
              mixarray(girlfourteases);
              referee = findgirl(refereeload);
              } else {
              girlone = getgirl(contenders);
              girltwo = getgirl(contenders);
              girloneteases = teaseload.split(",");
              mixarray(girloneteases);
              girltwoteases = teaseload.split(",");
              mixarray(girltwoteases);
              referee = findgirl(refereeload);
            };
        round = 1;
        fighters = fighterload.split(",");
        scriptVars.put("contenderwaiting",contenderwaiting);
        scriptVars.put("contenders",contenders);
        scriptVars.put("qualifiedamount",qualifiedamount);
        scriptVars.put("qualified",qualified);
        scriptVars.put("qualifiedstring",qualifiedstring);
        scriptVars.put("cuproundstart",cuproundstart);
        scriptVars.put("teaseload",teaseload);
        scriptVars.put("fighterload",fighterload);
        scriptVars.put("fighters",fighters);
        scriptVars.put("fightercount",fightercount);
        scriptVars.put("cuproundname",cuproundname);
        scriptVars.put("round",round);
        scriptVars.put("final",final);
        scriptVars.put("tofinal",tofinal);
        scriptVars.put("winner",winner);
        scriptVars.put("fightername",fightername);
        scriptVars.put("girlone",girlone);
        scriptVars.put("girltwo",girltwo);
        scriptVars.put("girlthree",girlthree);
        scriptVars.put("girlfour",girlfour);
        scriptVars.put("girloneteases",girloneteases);
        scriptVars.put("girltwoteases",girltwoteases);
        scriptVars.put("girlthreeteases",girlthreeteases);
        scriptVars.put("girlfourteases",girlfourteases);
        scriptVars.put("referee",referee);
        scriptVars.put("refereeload",refereeload);
        scriptVars.put("cuproundstrength",cuproundstrength);
      }
      function page2fightspeed_func1() {
        var returnpage = getVariable("returnpage");
        var gallerypic = getVariable("gallerypic");
        var fightername = getVariable("fightername");
        returnpage = "2fightspeed"
        gallerypic = true;
        pages.goto(fightername);
        scriptVars.put("returnpage",returnpage);
        scriptVars.put("gallerypic",gallerypic);
        scriptVars.put("fightername",fightername);
      }
      function page2fightspeed_func3() {
        var framed = getVariable("framed");
        var game = getVariable("game");
        framed = false;
        randomnumber = getRandom(1,8);
        scriptVars.put("framed",framed);
        scriptVars.put("game",game);
        scriptVars.put("randomnumber",randomnumber);
      }
      function page3winfight_func1() {
        var final = getVariable("final");
        var returnpage = getVariable("returnpage");
        var foughtnumber = getVariable("foughtnumber");
        var hardtime = getVariable("hardtime");
        var gallerypic = getVariable("gallerypic");
        var qualified = getVariable("qualified");
        var fightername = getVariable("fightername");
        var qualifiedstring = getVariable("qualifiedstring");
        if (final) {
              pages.goto("3wincup");
        };
        returnpage = "3winfight"
        if (foughtnumber < 3){
              hardtime = true;
        };
        foughtnumber = 0;
        gallerypic = true;
        qualified.push(fightername);
        pages.goto(fightername);
        qualifiedstring = qualified.join(", ")
        scriptVars.put("final",final);
        scriptVars.put("returnpage",returnpage);
        scriptVars.put("foughtnumber",foughtnumber);
        scriptVars.put("hardtime",hardtime);
        scriptVars.put("gallerypic",gallerypic);
        scriptVars.put("qualified",qualified);
        scriptVars.put("fightername",fightername);
        scriptVars.put("qualifiedstring",qualifiedstring);
      }
      function page2fighttime_func1() {
        var returnpage = getVariable("returnpage");
        var gallerypic = getVariable("gallerypic");
        var fightername = getVariable("fightername");
        returnpage = "2fighttime"
        gallerypic = true;
        pages.goto(fightername);
        scriptVars.put("returnpage",returnpage);
        scriptVars.put("gallerypic",gallerypic);
        scriptVars.put("fightername",fightername);
      }
      function page2fighttime_func3() {
        var framed = getVariable("framed");
        var randomnumber = getVariable("randomnumber");
        var game = getVariable("game");
        framed = false;
        randomnumber = getRandom(1,3)
        scriptVars.put("framed",framed);
        scriptVars.put("randomnumber",randomnumber);
        scriptVars.put("game",game);
      }
      function page2fightpattern_func1() {
        var returnpage = getVariable("returnpage");
        var gallerypic = getVariable("gallerypic");
        var fightername = getVariable("fightername");
        returnpage = "2fightpattern"
        gallerypic = true;
        pages.goto(fightername);
        scriptVars.put("returnpage",returnpage);
        scriptVars.put("gallerypic",gallerypic);
        scriptVars.put("fightername",fightername);
      }
      function page2fightedge_func1() {
        var returnpage = getVariable("returnpage");
        var gallerypic = getVariable("gallerypic");
        var fightername = getVariable("fightername");
        returnpage = "2fightedge";
        gallerypic = true;
        pages.goto(fightername);
        scriptVars.put("returnpage",returnpage);
        scriptVars.put("gallerypic",gallerypic);
        scriptVars.put("fightername",fightername);
      }
      function page2fightedge_func17() {
        var girlone = getVariable("girlone");
        var fightername = getVariable("fightername");
        var girltwo = getVariable("girltwo");
        // opposition wins
        if (girlone == fightername) {
              fightername = girltwo
          } else {
              fightername = girlone
        };
        pages.goto("3winfight")
        scriptVars.put("girlone",girlone);
        scriptVars.put("fightername",fightername);
        scriptVars.put("girltwo",girltwo);
      }
      function page4finish_func1() {
        var returnpage = getVariable("returnpage");
        var fightername = getVariable("fightername");
        returnpage = "4finish"
        pages.goto(fightername);
        scriptVars.put("returnpage",returnpage);
        scriptVars.put("fightername",fightername);
      }
      function page4finish_func3() {
        var framed = getVariable("framed");
        var finishcount = getVariable("finishcount");
        framed = false;
        ++finishcount
        scriptVars.put("framed",framed);
        scriptVars.put("finishcount",finishcount);
      }
      function page2fightedge2_func1() {
        var returnpage = getVariable("returnpage");
        var gallerypic = getVariable("gallerypic");
        var fightername = getVariable("fightername");
        returnpage = "2fightedge2"
        gallerypic = true;
        pages.goto(fightername);
        scriptVars.put("returnpage",returnpage);
        scriptVars.put("gallerypic",gallerypic);
        scriptVars.put("fightername",fightername);
      }
      function page2fightedge2_func3() {
        var framed = getVariable("framed");
        var girlone = getVariable("girlone");
        var fightername = getVariable("fightername");
        var girlonejoker = getVariable("girlonejoker");
        var round = getVariable("round");
        var jokerone = getVariable("jokerone");
        var girltwo = getVariable("girltwo");
        var girltwojoker = getVariable("girltwojoker");
        var jokertwo = getVariable("jokertwo");
        framed = false
        if (girlone == fightername && girlonejoker && round < 3) {
              jokerone = true
        };
        if (girltwo == fightername && girltwojoker && round < 3) {
              jokertwo = true
        };
        scriptVars.put("framed",framed);
        scriptVars.put("girlone",girlone);
        scriptVars.put("fightername",fightername);
        scriptVars.put("girlonejoker",girlonejoker);
        scriptVars.put("round",round);
        scriptVars.put("jokerone",jokerone);
        scriptVars.put("girltwo",girltwo);
        scriptVars.put("girltwojoker",girltwojoker);
        scriptVars.put("jokertwo",jokertwo);
      }
      function page0_Intro_9_func24() {
        var framed = getVariable("framed");
        var models = getVariable("models");
        framed = false;
        allmodels = transarray(models);
        scriptVars.put("framed",framed);
        scriptVars.put("models",models);
        scriptVars.put("allmodels",allmodels);
      }
      function page0_Intro_6_func1() {
        Sound.get("270bpm").stop();
        Sound.get("patternslowfast").stop();
      }
      function page0qualification_func4() {
        var framed = getVariable("framed");
        //var newgirl = getVariable("newgirl");
        var models = getVariable("models");
        var qualified = getVariable("qualified");
        var qualifiedstring = getVariable("qualifiedstring");
        var contendercount = getVariable("contendercount");
        var gallerypic = getVariable("gallerypic");
        var returnpage = getVariable("returnpage");
        framed = true;
        newgirl = getgirl(models);
        qualified.push(newgirl);
        qualifiedstring = qualified.join(", ");
        contendercount = contendercount + 1;
        gallerypic = false;
        returnpage = "0qualification";
        pages.goto(newgirl);
        scriptVars.put("framed",framed);
        scriptVars.put("newgirl",newgirl);
        scriptVars.put("models",models);
        scriptVars.put("qualified",qualified);
        scriptVars.put("qualifiedstring",qualifiedstring);
        scriptVars.put("contendercount",contendercount);
        scriptVars.put("gallerypic",gallerypic);
        scriptVars.put("returnpage",returnpage);
      }
      function page0qualification_func12() {
        var contenderwaiting = getVariable("contenderwaiting");
        var contenders = getVariable("contenders");
        var qualifiedamount = getVariable("qualifiedamount");
        var qualified = getVariable("qualified");
        var qualifiedstring = getVariable("qualifiedstring");
        contenderwaiting = contenders.length;
        qualifiedamount = qualified.length;
        qualifiedstring = qualified.join(", ")
        scriptVars.put("contenderwaiting",contenderwaiting);
        scriptVars.put("contenders",contenders);
        scriptVars.put("qualifiedamount",qualifiedamount);
        scriptVars.put("qualified",qualified);
        scriptVars.put("qualifiedstring",qualifiedstring);
      }
      function page4finish_2_func1() {
        var returnpage = getVariable("returnpage");
        var fightername = getVariable("fightername");
        returnpage = "4finish-2"
        pages.goto(fightername);
        scriptVars.put("returnpage",returnpage);
        scriptVars.put("fightername",fightername);
      }
      function page4finish_3_func2() {
        var returnpage = getVariable("returnpage");
        var fightername = getVariable("fightername");
        returnpage = "4finish-3"
        pages.goto(fightername);
        scriptVars.put("returnpage",returnpage);
        scriptVars.put("fightername",fightername);
      }
      function page2fightedge1_func1() {
        var index = getVariable("index");
        var game = getVariable("game");
        var holdingchance = getVariable("holdingchance");
        var round = getVariable("round");
        var holding = getVariable("holding");
        index = getRandom(1,10);
        holdingchance = 3 * round;
        if (index < holdingchance) {
              holding = true;
          } else {
              holding = false;
        };
        scriptVars.put("index",index);
        scriptVars.put("game",game);
        scriptVars.put("holdingchance",holdingchance);
        scriptVars.put("round",round);
        scriptVars.put("holding",holding);
      }
      function page2fightedge1_func3() {
        var returnpage = getVariable("returnpage");
        var gallerypic = getVariable("gallerypic");
        var fightername = getVariable("fightername");
        returnpage = "2fightedge1";
        gallerypic = true;
        pages.goto(fightername);
        scriptVars.put("returnpage",returnpage);
        scriptVars.put("gallerypic",gallerypic);
        scriptVars.put("fightername",fightername);
      }
      function page4finish_4_func7() {
        var returnpage = getVariable("returnpage");
        var fightername = getVariable("fightername");
        returnpage = "4finish-4"
        pages.goto(fightername);
        scriptVars.put("returnpage",returnpage);
        scriptVars.put("fightername",fightername);
      }
      function page4finish_5_func1() {
        var returnpage = getVariable("returnpage");
        var fightername = getVariable("fightername");
        returnpage = "4finish-5"
        pages.goto(fightername);
        scriptVars.put("returnpage",returnpage);
        scriptVars.put("fightername",fightername);
      }
      function page4finish_6_func2() {
        var returnpage = getVariable("returnpage");
        var fightername = getVariable("fightername");
        returnpage = "4finish-6"
        pages.goto(fightername);
        scriptVars.put("returnpage",returnpage);
        scriptVars.put("fightername",fightername);
      }
      function page5before_end_func6() {
        var returnpage = getVariable("returnpage");
        var gallerypic = getVariable("gallerypic");
        var fightername = getVariable("fightername");
        returnpage = "5before-end"
        gallerypic = false;
        pages.goto(fightername);
        scriptVars.put("returnpage",returnpage);
        scriptVars.put("gallerypic",gallerypic);
        scriptVars.put("fightername",fightername);
      }
  ]]>
  </GlobalJavascript>
  <Pages>
      <Page id="start">
        <javascript>
        <![CDATA[
          function pageLoad() {
              if ( parseFloat(comonFunctions.getVersion().substr(2)) < 4.3 ) { overRide.setPage("GuideMeIncorrectVersion"); return;}
              actionList = [
                { action: 'eval', statement: 'Sound.stop()' },
                { action: 'globalButton', subAction: 'clear' },
                { action: 'unset', flag: 'DEBUG' },
                { action: 'eval', statement: 'if ( typeof(initializeScriptVars) === "function" ) initializeScriptVars();' },
                { action: 'eval', statement: 'scriptVars.remove("fastpass");' },
                { action: "image", file: "teasefight-invitational.jpg" },
                { action: 'say', text: "<p>Welcome to my first tease &quot;Teasefight Invitational&quot;</p><p>[V1.0 release after first feedbacks]</p><p>I do not own any of the images. I sincerely used them thinking they are free samples.</p><p>I encourage players to support the models, photographs and everyone who provides us with such high-quality material.</p><p>If you would like to see any pictures removed, please contact me via Milovana forum. </p><p></p><p>Feedback is welcome under https://milovana.com/forum/viewtopic.php?t=26816</p>", mode: 'choice' },
                { action: 'choice', level: '1' },
                  { action: 'option', label: 'Introduction', hotkey: '1', target: '0start-1', level: '1', color: '#9e9e9e' },
                  { action: 'option', label: 'Jump to registration', hotkey: '2', target: '', level: '1', color: '#9e9e9e', cmds: 'True', dontShow: '1' },
                    { action: 'prompt', text: "<p>Enter password:</p>", mode: 'pause', variable: 'fastpass', dontShow: '1' },
                    { action: 'if', condition: 'getVariable("fastpass") == "directfight"' },
                      { action: 'eval', statement: 'scriptVars.remove("fastpass");' },
                      { action: 'prompt', text: "<p>What's your name:</p>", mode: 'pause', variable: 'teasetarget' },
                      { action: 'goto', target: '0-Intro-9' },
                    { action: 'else' },
                      { action: 'say', text: "<p>Incorrect password.</p>", mode: 'timed', style: 'hidden', duration: '3', target: 'start' },
                    { action: 'endif' },
                  { action: 'endOption', level: '1' },
                { action: 'endChoice', level: '1' },
                { action: 'goto', target: '0start-1' }
              ];
              handleActions(actionList);
          }
        ]]>
        </javascript>
      </Page>

      <Page id="0-Intro-0">
        <Image id="story-pinwall-large.jpg"/>
        <javascript>
        <![CDATA[
          function pageLoad() {
              globalButtons.show();
          }
        ]]>
        </javascript>
        <Text>
            <p>
              It's packed with posters. Let's have a look.
            </p>
        </Text>
        <Delay seconds="3" target="0-Intro-00" style="hidden" />
      </Page>

      <Page id="0-Intro-000">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: "image", file: "story-pinwall-detail.jpg" },
                { action: 'choice', level: '1' },
                  { action: 'option', label: 'Tommy Stunson', hotkey: '1', target: '', level: '1', color: '#64b5f6', cmds: 'True' },
                    { action: 'say', text: "<p>Naa ... don't feel like this.</p>", mode: 'timed', style: 'hidden', duration: '3', target: '0-Intro-000' },
                  { action: 'endOption', level: '1' },
                  { action: 'option', label: 'Teasefight', hotkey: '2', target: '', level: '1', color: '#64b5f6', cmds: 'True' },
                    { action: 'say', text: "<p><span style=\"color: #90caf9\">Would be good, but this is too expensive.</span></p>", mode: 'timed', style: 'hidden', duration: '3' },
                    { action: 'eval', statement: 'scriptVars.put("teasefightseen", true)' },
                    { action: 'goto', target: '0-Intro-000' },
                  { action: 'endOption', level: '1' },
                  { action: 'option', label: 'Teasefight Volunteers', hotkey: '3', target: '', level: '1', color: '#64b5f6', visible: '$getVariable("teasefightseen")', cmds: 'True' },
                    { action: 'say', text: "<p><span style=\"color: #90caf9\">Wow, this could be the solution. </span></p><p><span style=\"color: #90caf9\">They are looking for volunteers.</span></p>", mode: 'timed', style: 'hidden', duration: '6' },
                    { action: 'say', text: "<p><span style=\"color: #90caf9\">As volunteer, you can be there for free.</span></p>", mode: 'timed', style: 'hidden', duration: '3' },
                    { action: 'say', text: "<p><span style=\"color: #90caf9\">There's even a reward.</span></p><p><span style=\"color: #90caf9\">They don't say what, but who cares.</span></p>", mode: 'timed', style: 'hidden', duration: '3' },
                    { action: 'say', text: "<p><span style=\"color: #90caf9\">Let's get there. It is down town.</span></p>", mode: 'timed', style: 'hidden', duration: '3', target: '0-Intro-1' },
                  { action: 'endOption', level: '1' },
                  { action: 'option', label: 'Ramones', hotkey: '4', target: '', level: '1', color: '#64b5f6', cmds: 'True' },
                    { action: 'say', text: "<p><span style=\"color: #90caf9\">No, don't feel like this.</span></p>", mode: 'timed', style: 'hidden', duration: '2', target: '0-Intro-000' },
                  { action: 'endOption', level: '1' },
                { action: 'endChoice', level: '1' },
                { action: 'say', text: "<p>&quot;Teasefight Invitational&quot;</p>", mode: 'timed', style: 'hidden', duration: '2' },
                { action: 'say', text: "<p>Let's look closer,</p>", mode: 'timed', style: 'hidden', duration: '2' },
                { action: "image", file: "story-pinwall-detail.jpg" },
                { action: 'say', text: "<p>volunteers.</p>", mode: 'timed', style: 'hidden', duration: '3', allowSkip: 'true' },
                { action: 'say', text: "<p>as tease target?</p>", mode: 'timed', style: 'hidden', duration: '3', allowSkip: 'true' },
                { action: 'say', text: "<p>Tease target?  Whats that again?</p>", mode: 'pause' },
                { action: 'say', text: "<p>I have no clue.</p>", mode: 'pause' },
                { action: 'say', text: "<p>It's written, that they give rewards, but the small text is not readable.</p>", mode: 'pause' },
                { action: 'say', text: "<p>Let's better check it out. The adress is down town.</p>", mode: 'timed', style: 'hidden', duration: '3', target: '0-Intro' }
              ];
              handleActions(actionList);
          }
        ]]>
        </javascript>
      </Page>

      <Page id="0-Intro-00">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: "image", file: "story-pinwall-large.jpg" },
                { action: 'choice', level: '1' },
                  { action: 'option', label: 'Tattoo Expo', hotkey: '1', target: '', level: '1', color: '#64b5f6', cmds: 'True' },
                    { action: 'say', text: "<p><span style=\"color: #90caf9\">Looks too expensive.</span></p>", mode: 'timed', style: 'hidden', duration: '2', target: '0-Intro-00' },
                  { action: 'endOption', level: '1' },
                  { action: 'option', label: 'Stoop sale', hotkey: '2', target: '', level: '1', color: '#64b5f6', cmds: 'True' },
                    { action: 'say', text: "<p><span style=\"color: #90caf9\">wtf...</span></p>", mode: 'timed', style: 'hidden', duration: '1', allowSkip: 'true' },
                    { action: 'say', text: "<p><span style=\"color: #90caf9\">never ever.</span></p>", mode: 'timed', style: 'hidden', duration: '1', allowSkip: 'true', target: '0-Intro-00' },
                  { action: 'endOption', level: '1' },
                  { action: 'option', label: 'Tommy Stunson', hotkey: '3', target: '', level: '1', color: '#64b5f6', cmds: 'True' },
                    { action: 'say', text: "<p>Let's look closer.</p>", mode: 'timed', style: 'hidden', duration: '2', target: '0-Intro-000' },
                  { action: 'endOption', level: '1' },
                  { action: 'option', label: 'Teasefight', hotkey: '4', target: '', level: '1', color: '#64b5f6', cmds: 'True' },
                    { action: 'say', text: "<p><span style=\"color: #90caf9\">This could be interesting.</span></p>", mode: 'timed', style: 'hidden', duration: '2' },
                    { action: 'say', text: "<p><span style=\"color: #90caf9\">Let's look closer</span></p>", mode: 'timed', style: 'hidden', duration: '2', target: '0-Intro-000' },
                  { action: 'endOption', level: '1' },
                  { action: 'option', label: 'Ramones', hotkey: '5', target: '', level: '1', color: '#64b5f6', cmds: 'True' },
                    { action: 'say', text: "<p><span style=\"color: #90caf9\">No, don't feel like this.</span></p>", mode: 'timed', style: 'hidden', duration: '2', target: '0-Intro-00' },
                  { action: 'endOption', level: '1' },
                  { action: 'option', label: 'Herbie Hancock', hotkey: '6', target: '', level: '1', color: '#64b5f6', cmds: 'True' },
                    { action: 'say', text: "<p><span style=\"color: #90caf9\">It's a long time ago, I heard him.</span></p>", mode: 'timed', style: 'hidden', duration: '3' },
                    { action: 'say', text: "<p><span style=\"color: #90caf9\">But I think, this isn't it yet.</span></p>", mode: 'timed', style: 'hidden', duration: '3', target: '0-Intro-00' },
                  { action: 'endOption', level: '1' },
                { action: 'endChoice', level: '1' }
              ];
              handleActions(actionList);
          }
        ]]>
        </javascript>
      </Page>

      <Page id="0-Intro-1">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: "image", file: "story-city-mall.jpg" },
                { action: 'say', text: "<p><span style=\"color: #9e9e9e\">30 Min. later...</span></p>", mode: 'timed', style: 'hidden', duration: '2' },
                { action: "image", file: "story-mall-entrance.jpg" },
                { action: 'say', text: "<p>There it is.</p><p>TEASEFIGHT INVITATIONAL</p>", mode: 'timed', style: 'hidden', duration: '7', allowSkip: 'true' },
                { action: 'say', text: "<p>Let's get inside.</p>", mode: 'timed', style: 'hidden', duration: '2', target: '0-Intro-2' }
              ];
              handleActions(actionList);
          }
        ]]>
        </javascript>
      </Page>

      <Page id="0-Intro-2">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: "image", file: "story-lift-mall.jpg" },
                { action: 'eval', statement: 'Sound.get("traffic").stop()' },
                { action: 'audio', file: 'shopping-mall-antwerp.mp3', loops: '0', background: 'False', bpm: '', id: 'mall' },
                { action: 'say', text: "<p>Somewhere in the mall, you find the...</p>", mode: 'timed', style: 'hidden', duration: '3' },
                { action: "image", file: "boxing-entrance1.jpg" },
                { action: 'say', text: "<p>Entrance to the boxing gym</p>", mode: 'timed', style: 'hidden', duration: '2' },
                { action: 'say', text: "<p>You open the door.</p>", mode: 'timed', style: 'hidden', duration: '2', target: '0-Intro-3' }
              ];
              handleActions(actionList);
          }
        ]]>
        </javascript>
      </Page>

      <Page id="0-Intro-3">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: "image", file: "boxing-bar.jpg" },
                { action: 'eval', statement: 'Sound.get("mall").stop()' },
                { action: 'say', text: "<p>There's nobody at the bar, right now.</p>", mode: 'timed', style: 'hidden', duration: '3' },
                { action: 'say', text: "<p>You go down the hallway through the door.</p>", mode: 'timed', style: 'hidden', duration: '3' },
                { action: 'audio', file: 'punching-bag-long.mp3', loops: '0', background: 'True', bpm: '', id: 'box' },
                { action: "image", file: "story-training7.jpg" },
                { action: 'say', text: "<p>You enter a boxing gym, where a girl does some sparring.</p>", mode: 'timed', style: 'hidden', duration: '6' },
                { action: 'say', text: "<p><span style=\"color: #90caf9\"><em>Wow, she looks hot.</em></span></p>", mode: 'timed', style: 'hidden', duration: '5', allowSkip: 'true' },
                { action: "image", file: "story-training8.jpg" },
                { action: 'eval', statement: 'Sound.get("box").stop()' },
                { action: 'say', text: "<p>She turns around.</p>", mode: 'timed', style: 'hidden', duration: '2' },
                { action: 'say', text: "<p>Maybe, you better not ask her.</p><p>She looks a bit tense.</p>", mode: 'timed', style: 'hidden', duration: '3' },
                { action: 'say', text: "<p><span style=\"color: #90caf9\"><em>Let's move on, then.</em></span></p>", mode: 'timed', style: 'hidden', duration: '5', allowSkip: 'true', target: '0-Intro-3-1' }
              ];
              handleActions(actionList);
          }
        ]]>
        </javascript>
      </Page>

      <Page id="0-Intro-3-1">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: 'audio', file: 'punching-bag-long.mp3', loops: '0', background: 'True', bpm: '', id: 'box' },
                { action: "image", file: "story-training4.jpg" },
                { action: 'say', text: "<p>You find another girl doing workout.</p>", mode: 'timed', style: 'hidden', duration: '3' },
                { action: 'audio', file: '0beat060.mp3', loops: '30', background: 'True', bpm: '', id: '60bpm' },
                { action: 'say', text: "<p>The heart starts pounding.</p>", mode: 'timed', style: 'hidden', duration: '2' },
                { action: 'say', text: "<p>Should you ask her?</p>", mode: 'timed', style: 'hidden', duration: '2' },
                { action: "image", file: "story-training5.jpg" },
                { action: 'say', text: "<p><span style=\"color: #ffffff\">Maybe better someone else.</span></p><p><span style=\"color: #ffffff\">She doesn't look like she wants to be disturbed.</span></p>", mode: 'timed', style: 'hidden', duration: '6' },
                { action: 'say', text: "<p>And so, you quickly move on.</p>", mode: 'timed', style: 'hidden', duration: '3', target: '0-Intro-3-2' }
              ];
              handleActions(actionList);
          }
        ]]>
        </javascript>
      </Page>

      <Page id="0-Intro-3-2">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: 'audio', file: 'speed-bag-training.mp3', loops: '0', background: 'False', bpm: '', id: 'speedbag' },
                { action: "image", file: "story-training0.jpg" },
                { action: 'eval', statement: 'Sound.get("box").stop()' },
                { action: 'say', text: "<p>The next girl is punching the speed ball.</p>", mode: 'timed', style: 'hidden', duration: '10', allowSkip: 'true' },
                { action: "image", file: "story-training1.jpg" },
                { action: 'eval', statement: 'Sound.get("speedbag").stop()' },
                { action: 'say', text: "<p>As you wanna pass,</p><p>she finishes the training and looks at you.</p>", mode: 'timed', style: 'hidden', duration: '6' },
                { action: 'eval', statement: 'Sound.get("60bpm").stop()' },
                { action: 'audio', file: '0beat090.mp3', loops: '30', background: 'True', bpm: '', id: '90bpm' },
                { action: 'say', text: "<p><span style=\"color: #ffffff\">With the girl looking at you, you </span>get nervous.</p>", mode: 'timed', style: 'hidden', duration: '3', target: '0-Intro-3-3' }
              ];
              handleActions(actionList);
          }
        ]]>
        </javascript>
      </Page>

      <Page id="0-Intro-3-3">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: "image", file: "story-training2.jpg" },
                { action: 'say', text: "<p><span style=\"color: #f8bbd0\">Are you looking for something?</span></p>", mode: 'timed', style: 'hidden', duration: '2' },
                { action: 'say', text: "<p>She sits down and cools herself with some water.</p>", mode: 'choice', style: 'hidden', duration: '3' },
                { action: 'choice', level: '1' },
                  { action: 'option', label: 'Yeah, where are the offices?', hotkey: '1', target: '', level: '1', color: '#64b5f6' },
                  { action: 'option', label: 'I am looking for Teasefight.', hotkey: '2', target: '', level: '1', color: '#64b5f6', cmds: 'True' },
                    { action: 'say', text: "<p><span style=\"color: #f8bbd0\">Haha ... I bed you do!</span></p>", mode: 'timed', style: 'hidden', duration: '3' },
                    { action: 'say', text: "<p><span style=\"color: #f8bbd0\">You need to go to the offices.</span></p>", mode: 'timed', style: 'hidden', duration: '3' },
                  { action: 'endOption', level: '1' },
                { action: 'endChoice', level: '1' },
                { action: "image", file: "story-training3.jpg" },
                { action: 'say', text: "<p><span style=\"color: #f8bbd0\">You can go straight ahead and behind the door over there, you turn left.</span></p>", mode: 'timed', style: 'hidden', duration: '6' },
                { action: 'say', text: "<p><span style=\"color: #f8bbd0\">You can't miss it.</span></p>", mode: 'timed', style: 'hidden', duration: '2' },
                { action: 'say', text: "<p><span style=\"color: #90caf9\">Thanks.</span></p>", mode: 'timed', style: 'hidden', duration: '2' },
                { action: 'eval', statement: 'Sound.get("90bpm").stop()' },
                { action: 'audio', file: '0beat060.mp3', loops: '0', background: 'True', bpm: '', id: '60bpm' },
                { action: 'say', text: "<p><span style=\"color: #ffffff\">As you move on, you can calm down a bit.</span></p>", mode: 'timed', style: 'hidden', duration: '5', allowSkip: 'true', target: '0-Intro-4' }
              ];
              handleActions(actionList);
          }
        ]]>
        </javascript>
      </Page>

      <Page id="0-Intro-4">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: "image", file: "story-office-test001.jpg" },
                { action: 'prompt', text: "<p><span style=\"color: #f8bbd0\">Hello handsome. My name is Cindy.</span></p><p><span style=\"color: #f8bbd0\">What's your name?</span></p>", mode: 'pause', variable: 'teasetarget' },
                { action: 'say', text: "<p><span style=\"color: #f8bbd0\">What can I do for you?</span></p>", mode: 'choice', style: 'hidden', duration: '3' },
                { action: 'option', label: 'I  saw an add about volunteers.', hotkey: '1', target: '', color: '#64b5f6' },
                { action: "image", file: "story-office-test003.jpg" },
                { action: 'say', text: "<p><span style=\"color: #f8bbd0\">You wanna apply as tease target?</span></p>", mode: 'choice', style: 'hidden', duration: '3' },
                { action: 'choice', level: '1' },
                  { action: 'option', label: 'Yes', hotkey: 'y', target: '', level: '1', color: '#64b5f6', cmds: 'True' },
                    { action: 'say', text: "<p><span style=\"color: #f8bbd0\">Good.</span></p>", mode: 'timed', style: 'hidden', duration: '2' },
                    { action: 'say', text: "<p><span style=\"color: #f8bbd0\">We do need good looking men.</span></p>", mode: 'timed', style: 'hidden', duration: '3' },
                  { action: 'endOption', level: '1' },
                  { action: 'option', label: 'How did you guess that?', hotkey: '2', target: '', level: '1', color: '#64b5f6', cmds: 'True' },
                    { action: 'say', text: "<p><span style=\"color: #f8bbd0\">You look alike.</span></p>", mode: 'timed', style: 'hidden', duration: '2' },
                    { action: 'say', text: "<p><span style=\"color: #f8bbd0\">And I actually hoped, that you wanna apply.</span></p>", mode: 'timed', style: 'hidden', duration: '3' },
                  { action: 'endOption', level: '1' },
                { action: 'endChoice', level: '1' },
                { action: "image", file: "story-office-test001.jpg" },
                { action: 'say', text: "<p><span style=\"color: #f8bbd0\">Do you like being teased?</span></p>", mode: 'choice', style: 'hidden', duration: '2' },
                { action: 'choice', level: '1' },
                  { action: 'option', label: 'Yes, of course!', hotkey: '1', target: '', level: '1', color: '#64b5f6', cmds: 'True' },
                    { action: 'say', text: "<p><span style=\"color: #f8bbd0\">Good, this is what's needed.</span></p>", mode: 'timed', style: 'hidden', duration: '2' },
                  { action: 'endOption', level: '1' },
                  { action: 'option', label: 'What a question. Who does not?', hotkey: '2', target: '', level: '1', color: '#64b5f6', cmds: 'True' },
                    { action: 'say', text: "<p><span style=\"color: #f8bbd0\">You are right, everybody does. </span></p>", mode: 'timed', style: 'hidden', duration: '2' },
                    { action: 'say', text: "<p><span style=\"color: #f8bbd0\">I just needed to confirm.</span></p>", mode: 'timed', style: 'hidden', duration: '2' },
                  { action: 'endOption', level: '1' },
                { action: 'endChoice', level: '1' },
                { action: "image", file: "story-office-test002.jpg" },
                { action: 'option', label: 'But I have some questions.', hotkey: '1', target: '', color: '#64b5f6' },
                { action: 'option', label: 'The girls in the gym looked rather tough. I don&#39;t know boxing or sparring.', hotkey: '1', target: '', color: '#64b5f6' },
                { action: "image", file: "story-office-test001.jpg" },
                { action: 'say', text: "<p><span style=\"color: #f8bbd0\">Haha...</span></p>", mode: 'timed', style: 'hidden', duration: '2' },
                { action: 'say', text: "<p><span style=\"color: #f8bbd0\"><span>teasetarget</span></span><span style=\"color: #f8bbd0\">, you are totally on the wrong path.</span></p>", mode: 'timed', style: 'hidden', duration: '3' },
                { action: 'say', text: "<p><span style=\"color: #f8bbd0\">This is not about fighting or boxing.</span></p>", mode: 'timed', style: 'hidden', duration: '3' },
                { action: 'say', text: "<p><span style=\"color: #f8bbd0\">But ask your questions first.</span></p>", mode: 'timed', style: 'hidden', duration: '2', target: '0-Intro-4-1' }
              ];
              handleActions(actionList);
          }
        ]]>
        </javascript>
      </Page>

      <Page id="0-Intro-4-1">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: "image", file: "story-office-test013.jpg" },
                { action: 'say', text: "<p><span style=\"color: #f8bbd0\">What questions do you have?</span></p>", mode: 'choice' },
                { action: 'choice', level: '1' },
                  { action: 'option', label: 'What is a Tease Target?', hotkey: '1', target: '', level: '1', color: '#64b5f6', cmds: 'True' },
                    { action: 'say', text: "<p><span style=\"color: #f8bbd0\"><strong>You </strong></span><span style=\"color: #f8bbd0\">are the Tease Target.</span></p><p><span style=\"color: #f8bbd0\">The girls fight each other in the discipline of teasing.</span></p><p><span style=\"color: #f8bbd0\">This means, they try to bring you, the target, out of control by teasing.</span></p><p><span style=\"color: #f8bbd0\"></span></p><p><span style=\"color: #f8bbd0\">You are not a contender, you're just the play ball.</span></p>", mode: 'pause', target: '0-Intro-4-2' },
                  { action: 'endOption', level: '1' },
                  { action: 'option', label: 'What rules to fight?', hotkey: '2', target: '', level: '1', color: '#64b5f6', cmds: 'True' },
                    { action: 'say', text: "<p><span style=\"color: #f8bbd0\">The girls compete in teasing.</span></p><p><span style=\"color: #f8bbd0\">They tease you by turns and try to bring you out of control.</span></p><p><span style=\"color: #f8bbd0\">If this happens, the teasing girl wins the fight.</span></p><p><span style=\"color: #f8bbd0\">She qualifies to the next round.</span></p>", mode: 'pause', target: '0-Intro-4-2' },
                  { action: 'endOption', level: '1' },
                  { action: 'option', label: 'How many girls?', hotkey: '3', target: '', level: '1', color: '#64b5f6', cmds: 'True' },
                    { action: 'say', text: "<p><span style=\"color: #f8bbd0\">It depends, how many signed in. It is an invitational cup. The highest possible number of girls is 32.</span></p><p><span style=\"color: #f8bbd0\">If there are 32 girls, the first round is qualification round, where four girls compete in one fight.</span></p><p><span style=\"color: #f8bbd0\">The eight winning girls qualify for quarterfinal, where two girls fight each other and so on...</span></p>", mode: 'pause', target: '0-Intro-4-2' },
                  { action: 'endOption', level: '1' },
                  { action: 'option', label: 'What do i have to do?', hotkey: '4', target: '', level: '1', color: '#64b5f6', cmds: 'True' },
                    { action: 'say', text: "<p><span style=\"color: #f8bbd0\">You only have to do, what they say.</span></p><p><span style=\"color: #f8bbd0\">You shall not cum during fight.</span></p><p><span style=\"color: #f8bbd0\">You are actually allowed to edge, but only, if you can still follow their orders.</span></p><p><span style=\"color: #f8bbd0\">If you cannot follow their orders, you tell this and stop stroking.</span></p><p><span style=\"color: #f8bbd0\">The teasing girl wins the fight and qualifies for the next round.</span></p>", mode: 'pause', target: '0-Intro-4-2' },
                  { action: 'endOption', level: '1' },
                  { action: 'option', label: 'Type of teasing?', hotkey: '5', target: '', level: '1', color: '#64b5f6', cmds: 'True' },
                    { action: 'say', text: "<p><span style=\"color: #f8bbd0\">The girls tease you and each gives following orders per fighting round:</span></p><p><span style=\"color: #f8bbd0\">- Stroking in different speeds. The girl wins, if you cannot follow.</span></p><p><span style=\"color: #f8bbd0\">- Stroking in patterns. The girl wins, if you cannot follow.</span></p><p><span style=\"color: #f8bbd0\">- Stroking a certain amount in a given time. The girl wins, if timer runs out.</span></p><p><span style=\"color: #f8bbd0\">- Edge in time. Here the girl loses, if you cannot edge in time.</span></p>", mode: 'timed', style: 'hidden', duration: '25', target: '0-Intro-4-2' },
                  { action: 'endOption', level: '1' },
                  { action: 'option', label: 'When I cum in fight?', hotkey: '6', target: '', level: '1', color: '#64b5f6', cmds: 'True' },
                    { action: 'say', text: "<p><span style=\"color: #f8bbd0\">This is, what the girls try to achieve.</span></p><p><span style=\"color: #f8bbd0\">If you are cumming in fight, </span></p><p><span style=\"color: #f8bbd0\">the teasing girl wins the </span><span style=\"color: #f8bbd0\"><strong>Teasefight Cup</strong></span><span style=\"color: #f8bbd0\"> directly and the cup is over.</span></p>", mode: 'timed', style: 'hidden', duration: '10', target: '0-Intro-4-2' },
                  { action: 'endOption', level: '1' },
                  { action: 'option', label: 'That&#39;s all.', hotkey: '7', target: '0-Intro-4-3', level: '1', color: '#64b5f6' },
                { action: 'endChoice', level: '1' }
              ];
              handleActions(actionList);
          }
        ]]>
        </javascript>
      </Page>

      <Page id="0-Intro-4-2">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: "image", file: "story-office-test0*.jpg" },
                { action: 'say', text: "<p><span style=\"color: #f8bbd0\">Further questions?</span></p>", mode: 'choice' },
                { action: 'choice', level: '1' },
                  { action: 'option', label: 'What is a Tease Target?', hotkey: '1', target: '', level: '1', color: '#64b5f6', cmds: 'True' },
                    { action: 'say', text: "<p><span style=\"color: #f8bbd0\"><strong>You </strong></span><span style=\"color: #f8bbd0\">are the Tease Target.</span></p><p><span style=\"color: #f8bbd0\">The girls fight each other in the discipline of teasing.</span></p><p><span style=\"color: #f8bbd0\">This means, they try to bring you, the target, out of control by teasing.</span></p><p><span style=\"color: #f8bbd0\"></span></p><p><span style=\"color: #f8bbd0\">You are not a contender, you're just the play ball.</span></p>", mode: 'pause', target: '0-Intro-4-2' },
                  { action: 'endOption', level: '1' },
                  { action: 'option', label: 'What rules to fight?', hotkey: '2', target: '', level: '1', color: '#64b5f6', cmds: 'True' },
                    { action: 'say', text: "<p><span style=\"color: #f8bbd0\">The girls compete in teasing.</span></p><p><span style=\"color: #f8bbd0\">They tease you by turns and try to bring you out of control.</span></p><p><span style=\"color: #f8bbd0\">If this happens, the teasing girl wins the fight.</span></p><p><span style=\"color: #f8bbd0\">She qualifies to the next round.</span></p>", mode: 'pause', target: '0-Intro-4-2' },
                  { action: 'endOption', level: '1' },
                  { action: 'option', label: 'How many girls?', hotkey: '3', target: '', level: '1', color: '#64b5f6', cmds: 'True' },
                    { action: 'say', text: "<p><span style=\"color: #f8bbd0\">It depends, how many signed in. It is an invitational cup. The highest possible number of girls is 32.</span></p><p><span style=\"color: #f8bbd0\">If there are 32 girls, the first round is qualification round, where four girls compete in one fight.</span></p><p><span style=\"color: #f8bbd0\">The eight winning girls qualify for quarterfinal, where two girls fight each other and so on...</span></p>", mode: 'pause', target: '0-Intro-4-2' },
                  { action: 'endOption', level: '1' },
                  { action: 'option', label: 'What do i have to do?', hotkey: '4', target: '', level: '1', color: '#64b5f6', cmds: 'True' },
                    { action: 'say', text: "<p><span style=\"color: #f8bbd0\">You only have to do, what they say.</span></p><p><span style=\"color: #f8bbd0\">You shall not cum during fight.</span></p><p><span style=\"color: #f8bbd0\">You are actually allowed to edge, but only, if you can still follow their orders.</span></p><p><span style=\"color: #f8bbd0\">If you cannot follow their orders, you tell this and stop stroking.</span></p><p><span style=\"color: #f8bbd0\">The teasing girl wins the fight and qualifies for the next round.</span></p>", mode: 'pause', target: '0-Intro-4-2' },
                  { action: 'endOption', level: '1' },
                  { action: 'option', label: 'Type of teasing?', hotkey: '5', target: '', level: '1', color: '#64b5f6', cmds: 'True' },
                    { action: 'say', text: "<p><span style=\"color: #f8bbd0\">The girls tease you and each gives following orders per fighting round:</span></p><p><span style=\"color: #f8bbd0\">- Stroking in different speeds. The girl wins, if you cannot follow.</span></p><p><span style=\"color: #f8bbd0\">- Stroking in patterns. The girl wins, if you cannot follow.</span></p><p><span style=\"color: #f8bbd0\">- Stroking a certain amount in a given time. The girl wins, if timer runs out.</span></p><p><span style=\"color: #f8bbd0\">- Edge in time. Here the girl loses, if you cannot edge in time.</span></p>", mode: 'timed', style: 'hidden', duration: '25', target: '0-Intro-4-2' },
                  { action: 'endOption', level: '1' },
                  { action: 'option', label: 'When I cum in fight?', hotkey: '6', target: '', level: '1', color: '#64b5f6', cmds: 'True' },
                    { action: 'say', text: "<p><span style=\"color: #f8bbd0\">This is, what the girls try to achieve.</span></p><p><span style=\"color: #f8bbd0\">If you are cumming in fight, </span></p><p><span style=\"color: #f8bbd0\">the teasing girl wins the </span><span style=\"color: #f8bbd0\"><strong>Teasefight Cup</strong></span><span style=\"color: #f8bbd0\"> directly and the cup is over.</span></p>", mode: 'timed', style: 'hidden', duration: '10', target: '0-Intro-4-2' },
                  { action: 'endOption', level: '1' },
                  { action: 'option', label: 'That&#39;s all.', hotkey: '7', target: '0-Intro-4-3', level: '1', color: '#64b5f6' },
                { action: 'endChoice', level: '1' }
              ];
              handleActions(actionList);
          }
        ]]>
        </javascript>
      </Page>

      <Page id="0-Intro-4-3">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: "image", file: "story-office-test101.jpg" },
                { action: 'say', text: "<p><span style=\"color: #f8bbd0\">Ok.</span></p><p><span style=\"color: #f8bbd0\">Since you don't have any questions anymore, it's my turn now, </span><span style=\"color: #f8bbd0\"><span>teasetarget</span></span><span style=\"color: #f8bbd0\">.</span></p>", mode: 'timed', style: 'hidden', duration: '6' },
                { action: 'say', text: "<p><span style=\"color: #f8bbd0\">It's nice, that you want to volunteer as tease target.</span></p><p><span style=\"color: #f8bbd0\">But not everybody qualifies to do it.</span></p><p><span style=\"color: #f8bbd0\">Hence, I have to check this before we can sign anything.</span></p>", mode: 'timed', style: 'hidden', duration: '10', target: '0-Intro-5' }
              ];
              handleActions(actionList);
          }
        ]]>
        </javascript>
      </Page>

      <Page id="0-Intro-5">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: "image", file: "story-office-test102.jpg" },
                { action: 'say', text: "<p><span style=\"color: #f8bbd0\">Stroke to the beat, </span><span style=\"color: #ffcdd2\"><span>teasetarget</span></span><span style=\"color: #f8bbd0\">.</span></p>", mode: 'timed', style: 'hidden', duration: '2' },
                { action: 'eval', statement: 'Sound.get("60bpm").stop()' },
                { action: 'audio', file: '1beat150.mp3', loops: '0', background: 'False', bpm: '', id: '150bpm' },
                { action: 'say', text: "<p><span style=\"color: #f8bbd0\">While you do it, I recapitulate to make sure, that you understood it properly.</span></p>", mode: 'timed', style: 'hidden', duration: '6' },
                { action: 'say', text: "<p><span style=\"color: #f8bbd0\"><strong>Teasefight Invitational Cup</strong></span><span style=\"color: #f8bbd0\"> is as it says a cup for girls who compete in teasing.</span></p>", mode: 'timed', style: 'hidden', duration: '10', allowSkip: 'true' },
                { action: 'say', text: "<p><span style=\"color: #f8bbd0\">They will tease you and your part is only, ...</span></p>", mode: 'timed', style: 'hidden', duration: '3' },
                { action: "image", file: "story-office-test105.jpg" },
                { action: 'say', text: "<p><span style=\"color: #f8bbd0\">... to do what they say.</span></p>", mode: 'choice', style: 'hidden', duration: '3' },
                { action: 'choice', level: '1' },
                  { action: 'option', label: 'Sounds easy.', hotkey: '1', target: '', level: '1', color: '#64b5f6', cmds: 'True' },
                    { action: 'say', text: "<p><span style=\"color: #f8bbd0\">It is.</span></p>", mode: 'timed', style: 'hidden', duration: '2' },
                    { action: 'say', text: "<p><span style=\"color: #f8bbd0\">But you have to be in control of yourself.</span></p>", mode: 'timed', style: 'hidden', duration: '3' },
                  { action: 'endOption', level: '1' },
                  { action: 'option', label: 'And is this any hard?', hotkey: '2', target: '', level: '1', color: '#64b5f6', cmds: 'True' },
                    { action: 'say', text: "<p><span style=\"color: #f8bbd0\">Not really.</span></p>", mode: 'timed', style: 'hidden', duration: '2' },
                    { action: 'say', text: "<p><span style=\"color: #f8bbd0\">But you have to be in control of yourself.</span></p>", mode: 'timed', style: 'hidden', duration: '3' },
                  { action: 'endOption', level: '1' },
                { action: 'endChoice', level: '1' },
                { action: 'choice', level: '1' },
                  { action: 'option', label: 'By the way, I forgot to ask about the reward.', hotkey: '1', target: '', level: '1', color: '#64b5f6', cmds: 'True' },
                    { action: 'say', text: "<p><span style=\"color: #f8bbd0\">???</span></p>", mode: 'timed', style: 'hidden', duration: '2' },
                    { action: 'say', text: "<p><span style=\"color: #f8bbd0\">Are you seriously asking this?</span></p>", mode: 'timed', style: 'hidden', duration: '2' },
                    { action: 'say', text: "<p><span style=\"color: #f8bbd0\">Beautiful girls will make you cum and you ask for your reward?</span></p>", mode: 'timed', style: 'hidden', duration: '6' },
                    { action: 'say', text: "<p><span style=\"color: #f8bbd0\">Isn't this reward enough?</span></p>", mode: 'timed', style: 'hidden', duration: '2' },
                  { action: 'endOption', level: '1' },
                { action: 'endChoice', level: '1' },
                { action: "image", file: "story-office-test104.jpg" },
                { action: 'say', text: "<p><span style=\"color: #f8bbd0\">To prevent more silly questions, we better speed up the beat!</span></p>", mode: 'instant' },
                { action: 'eval', statement: 'Sound.get("150bpm").stop()' },
                { action: 'audio', file: '1beat180.mp3', loops: '0', background: 'False', bpm: '', id: '180bpm' },
                { action: 'option', label: 'Ok. I admit, it is a good reward.', hotkey: '1', target: '', color: '#64b5f6' },
                { action: 'choice', level: '1' },
                  { action: 'option', label: 'And edging is ok?', hotkey: '1', target: '', level: '1', color: '#64b5f6', cmds: 'True' },
                    { action: 'say', text: "<p><span style=\"color: #f8bbd0\">Only, if you don't go over the edge. You shouldn't cum since the cup would end imidiately.</span></p>", mode: 'timed', style: 'hidden', duration: '6' },
                    { action: 'say', text: "<p><span style=\"color: #f8bbd0\">If you cannot follow the beat. Stop stroking and tell, that you cannot follow.</span></p>", mode: 'timed', style: 'hidden', duration: '6' },
                  { action: 'endOption', level: '1' },
                  { action: 'option', label: 'And what&#39;s the difficulty?', hotkey: '2', target: '', level: '1', color: '#64b5f6', cmds: 'True' },
                    { action: 'say', text: "<p><span style=\"color: #f8bbd0\">Don't go over the edge.</span></p>", mode: 'timed', style: 'hidden', duration: '2' },
                    { action: 'say', text: "<p><span style=\"color: #f8bbd0\">If you stop and tell, that you cannot follow the beat, everything is fine.</span></p>", mode: 'timed', style: 'hidden', duration: '6' },
                  { action: 'endOption', level: '1' },
                { action: 'endChoice', level: '1' },
                { action: "image", file: "story-office-test107.jpg" },
                { action: 'say', text: "<p><span style=\"color: #f8bbd0\">You also have to follow stroke patterns.</span></p>", mode: 'timed', style: 'hidden', duration: '3' },
                { action: 'eval', statement: 'Sound.get("180bpm").stop()' },
                { action: 'audio', file: '2pattern120-halfquartfast.mp3', loops: '0', background: 'False', bpm: '', id: 'patternslowfast' },
                { action: 'say', text: "<p><span style=\"color: #f8bbd0\">Let's try it out.</span></p>", mode: 'timed', style: 'hidden', duration: '5', allowSkip: 'true' },
                { action: 'say', text: "<p><span style=\"color: #f8bbd0\">Now, we want to check your behaviour, when you edge.</span></p>", mode: 'timed', style: 'hidden', duration: '3' },
                { action: 'globalButton', subAction: 'add', id: 'testedge', label: 'I edge!', target: '0-Intro-5_1', hotkey: '', placement: 'bottom' },
                { action: 'choice', level: '1' },
                  { action: 'option', label: '- (be silent)', hotkey: '1', target: '', level: '1', color: '#64b5f6', cmds: 'True' },
                    { action: 'timer', style: 'hidden', duration: '15' },
                    { action: 'say', text: "<p><span style=\"color: #f8bbd0\">How is it going?</span></p>", mode: 'timed', style: 'hidden', duration: '2' },
                    { action: 'say', text: "<p><span style=\"color: #f8bbd0\">Are you close to the edge?</span></p>", mode: 'timed', style: 'hidden', duration: '3' },
                  { action: 'endOption', level: '1' },
                  { action: 'option', label: 'Do you think, I am gonna edge like this?', hotkey: '2', target: '', level: '1', color: '#64b5f6', cmds: 'True' },
                    { action: 'say', text: "<p><span style=\"color: #f8bbd0\">Is it to easy?</span></p>", mode: 'timed', style: 'hidden', duration: '2' },
                    { action: 'say', text: "<p><span style=\"color: #f8bbd0\">We can change that!</span></p>", mode: 'timed', style: 'hidden', duration: '2' },
                  { action: 'endOption', level: '1' },
                { action: 'endChoice', level: '1' },
                { action: "image", file: "story-office-test106.jpg" },
                { action: 'eval', statement: 'Sound.get("patternslowfast").stop()' },
                { action: 'audio', file: '3beat270.mp3', loops: '0', background: 'False', bpm: '', id: '270bpm' },
                { action: 'say', text: "<p><span style=\"color: #f8bbd0\">Let's go to a higher speed.</span></p>", mode: 'timed', style: 'hidden', duration: '20', allowSkip: 'true' },
                { action: "image", file: "story-office-test109.jpg" },
                { action: 'say', text: "<p><span style=\"color: #f8bbd0\">How long will you last?</span></p>", mode: 'timed', style: 'hidden', duration: '60', allowSkip: 'true', target: '0-Intro-7' }
              ];
              handleActions(actionList);
          }
        ]]>
        </javascript>
      </Page>

      <Page id="0-Intro-5_1">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: 'globalButton', subAction: 'remove', id: 'testedge' },
                { action: 'goto', target: '0-Intro-6' }
              ];
              handleActions(actionList,true);
          }
        ]]>
        </javascript>
      </Page>

      <Page id="0-Intro-6">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: "image", file: "story-office-test112.jpg" },
                { action: 'eval', statement: 'page0_Intro_6_func1()' },
                { action: 'say', text: "<p><span style=\"color: #f8bbd0\">Stop stroking!</span></p>", mode: 'timed', style: 'hidden', duration: '2' },
                { action: 'say', text: "<p><span style=\"color: #f8bbd0\">Well. This is pretty much, what you are gonna do as a tease target.</span></p>", mode: 'timed', style: 'hidden', duration: '6' },
                { action: 'say', text: "<p><span style=\"color: #f8bbd0\">You passed the test.</span></p>", mode: 'timed', style: 'hidden', duration: '2' },
                { action: "image", file: "story-office-test013.jpg" },
                { action: 'say', text: "<p><span style=\"color: #f8bbd0\">That's it.</span></p>", mode: 'timed', style: 'hidden', duration: '2' },
                { action: 'say', text: "<p><span style=\"color: #f8bbd0\">It was nice to meet you.</span></p>", mode: 'timed', style: 'hidden', duration: '3' },
                { action: 'say', text: "<p><span style=\"color: #f8bbd0\">We are waiting for you on saturday 8 pm.</span></p>", mode: 'timed', style: 'hidden', duration: '3' },
                { action: 'say', text: "<p><span style=\"color: #f8bbd0\">Sharon will manage the cup. You will find her there.</span></p>", mode: 'timed', style: 'hidden', duration: '3' },
                { action: 'say', text: "<p><span style=\"color: #f8bbd0\">Have a nice day.</span></p>", mode: 'timed', style: 'hidden', duration: '2' },
                { action: "image", file: "story-bedroom-worn.jpg" },
                { action: 'globalButton', subAction: 'add', id: 'go-saturday', label: 'Wait until saturday.', target: '0-Intro-6_1', hotkey: '', placement: 'bottom' },
                { action: 'goto', target: '0-Intro-9' }
              ];
              handleActions(actionList);
          }
        ]]>
        </javascript>
      <!-- Info: Converted multiline eval to {'action': 'eval', 'statement': 'page0_Intro_6_func1()'} and created function page0_Intro_6_func1 -->
      </Page>

      <Page id="0-Intro-6_1">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: 'globalButton', subAction: 'remove', id: 'go-saturday' },
                { action: 'goto', target: '0-Intro-9' }
              ];
              handleActions(actionList,true);
          }
        ]]>
        </javascript>
      </Page>

      <Page id="0-Intro-7">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: "image", file: "story-office-test112.jpg" },
                { action: 'eval', statement: 'page0_Intro_6_func1()' },
                { action: 'say', text: "<p><span style=\"color: #f8bbd0\">Stop stroking.</span></p>", mode: 'timed', style: 'hidden', duration: '2' },
                { action: 'say', text: "<p><span style=\"color: #f8bbd0\">If you don't edge, this is not gonna work.</span></p>", mode: 'timed', style: 'hidden', duration: '3' },
                { action: "image", file: "story-office-test013.jpg" },
                { action: 'say', text: "<p><span style=\"color: #f8bbd0\">I am sorry, but you are not qualified.</span></p>", mode: 'timed', style: 'hidden', duration: '5' },
                { action: 'say', text: "<p><span style=\"color: #f8bbd0\">You won't get the job.</span></p>", mode: 'timed', style: 'hidden', duration: '2' },
                { action: 'say', text: "<p><span style=\"color: #f8bbd0\">Have a nice day.</span></p>", mode: 'timed', style: 'hidden', duration: '2', target: 'End' }
              ];
              handleActions(actionList);
          }
        ]]>
        </javascript>
      <!-- Info: Converted multiline eval to {'action': 'eval', 'statement': 'page0_Intro_6_func1()'} and created function page0_Intro_6_func1 -->
      </Page>

      <Page id="0-Intro-9">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: 'globalButton', subAction: 'remove', id: 'go-saturday' },
                { action: "image", file: "story-mall-entrance.jpg" },
                { action: 'say', text: "<p>Saturday, 8 pm.</p>", mode: 'timed', style: 'hidden', duration: '2' },
                { action: 'say', text: "<p>You arrive at the mall and go to the agreed office.</p>", mode: 'timed', style: 'hidden', duration: '7', allowSkip: 'true' },
                { action: "image", file: "office-sharon004.jpg" },
                { action: 'say', text: "<p><span style=\"color: #ffcdd2\">Hello, you are </span><span style=\"color: #ffcdd2\"><span>teasetarget</span></span><span style=\"color: #ffcdd2\">, right? Come in please.</span></p>", mode: 'timed', style: 'hidden', duration: '5', allowSkip: 'true' },
                { action: "image", file: "office-sharon001.jpg" },
                { action: 'say', text: "<p><span style=\"color: #ffcdd2\">To introduce myself. I am Sharon. I organize registration and allocation of fights.</span></p>", mode: 'timed', style: 'hidden', duration: '6' },
                { action: 'say', text: "<p><span style=\"color: #ffcdd2\">As a reminder: we don't like early cumming. The cup shall be finished and hence you have to control yourself.</span></p>", mode: 'timed', style: 'hidden', duration: '6' },
                { action: 'say', text: "<p><span style=\"color: #ffcdd2\">Hopefully, you are strong enough to endure the cup all the way through.</span></p>", mode: 'timed', style: 'hidden', duration: '6' },
                { action: "image", file: "office-sharon003.jpg" },
                { action: 'say', text: "<p><span style=\"color: #ffcdd2\">How many contenders did sign in this week?</span></p>", mode: 'choice' },
                { action: 'choice', level: '1' },
                  { action: 'option', label: 'The max, 32 girls', hotkey: '1', target: '', level: '1', color: '#64b5f6', cmds: 'True', dontShow: '1' },
                    { action: 'eval', statement: 'scriptVars.put("contendermax", 32)' },
                    { action: 'say', text: "<p><span style=\"color: #ffcdd2\">Nice, a complete tournement.</span></p><p><span style=\"color: #ffcdd2\">That will be fun.</span></p><p><span style=\"color: #ffcdd2\">Hopefully, you get through all rounds.</span></p>", mode: 'timed', style: 'hidden', duration: '6' },
                  { action: 'endOption', level: '1' },
                  { action: 'option', label: '16 girls', hotkey: '2', target: '', level: '1', color: '#64b5f6', cmds: 'True', dontShow: '1' },
                    { action: 'eval', statement: 'scriptVars.put("contendermax", 16)' },
                  { action: 'endOption', level: '1' },
                  { action: 'option', label: '8 girls', hotkey: '8', target: '', level: '1', color: '#64b5f6', cmds: 'True', dontShow: '1' },
                    { action: 'say', text: "<p>Only eight girls?</p><p>What a shame, this will be a very short cup.</p>", mode: 'timed', style: 'hidden', duration: '6' },
                    { action: 'eval', statement: 'scriptVars.put("contendermax", 8)' },
                  { action: 'endOption', level: '1' },
                { action: 'endChoice', level: '1' },
                { action: 'eval', statement: 'page0_Intro_9_func24()' },
                { action: "image", file: "office-sharon007.jpg" },
                { action: 'say', text: "<p><span style=\"color: #ffcdd2\">OK, </span><span style=\"color: #ffcdd2\"><span>teasetarget</span></span><span style=\"color: #ffcdd2\">.</span></p><p><span style=\"color: #ffcdd2\">You can go to the rink. </span></p><p><span style=\"color: #ffcdd2\">Good luck!</span></p>", mode: 'timed', style: 'hidden', duration: '3', target: '0opening' }
              ];
              handleActions(actionList);
          }
        ]]>
        </javascript>
      <!-- Info: Converted multiline eval to {'action': 'eval', 'statement': 'page0_Intro_9_func24()'} and created function page0_Intro_9_func24 -->
      </Page>

      <Page id="0debuger">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: "image", file: "numbergirl03.jpg" },
                { action: 'say', text: "<p>fightername = <span>fightername</span></p><p>contenders= <span>contenders</span></p><p>contenderwaiting = <span>contenderwaiting</span></p><p>qualified = <span>qualified</span></p>", mode: 'timed', style: 'hidden', duration: '3' },
                { action: 'say', text: "<p>round = <span>round</span></p><p>roundend = <span>roundend</span></p><p>fought = <span>fought</span></p><p>girloneteases = <span>girloneteases</span></p><p>remainingtease = <span>remainingtease</span></p><p>remainingfight = <span>remainingfight</span></p>", mode: 'pause' }
              ];
              handleActions(actionList);
          }
        ]]>
        </javascript>
      </Page>

      <Page id="0opening">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: "image", file: "numbergirl-preevent.jpg" },
                { action: 'say', text: "<p>As you go to the rink, you see a numbergirl represent</p><p><strong>Teasefight Invitational Cup</strong>.</p>", mode: 'timed', style: 'hidden', duration: '8', allowSkip: 'true' },
                { action: "image", file: "numbergirl-preevent1.jpg" },
                { action: 'say', text: "<p><span style=\"color: #90caf9\">Wow, they are pretty hot?</span></p><p><span style=\"color: #90caf9\">How will be the girls themselves, if already the numbergirls look like this?</span></p>", mode: 'timed', style: 'hidden', duration: '10', allowSkip: 'true' },
                { action: "image", file: "numbergirl-all.jpg" },
                { action: 'audio', file: 'long-applause.mp3', loops: '0', background: 'True', bpm: '' },
                { action: 'say', text: "<p></p><p>Welcome everybody to the </p><p><span style=\"color: #f9a825\"><strong></strong></span></p><p><span style=\"color: #f9a825\"><strong>Teasefight Invitational Cup</strong></span>.</p><p></p>", mode: 'timed', style: 'hidden', duration: '10', allowSkip: 'true' },
                { action: "image", file: "numbergirl-sing.jpg" },
                { action: 'say', text: "<p><span style=\"color: #f8bbd0\"></span></p><p><span style=\"color: #f8bbd0\">We are very pleased, to introduce the </span><span style=\"color: #f8bbd0\"><span>contendermax</span></span><span style=\"color: #f8bbd0\"> girls, who signed up.</span></p><p><span style=\"color: #f8bbd0\"></span></p><p><span style=\"color: #f8bbd0\">Let's give them a warm welcome!</span></p><p></p>", mode: 'timed', style: 'hidden', duration: '6' },
                { action: 'eval', statement: 'scriptVars.put("framed", false)' },
                { action: 'goto', target: '0qualification' }
              ];
              handleActions(actionList);
          }
        ]]>
        </javascript>
      </Page>

      <Page id="0qualification">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: 'if', condition: '!getVariable("framed")' },
                  { action: 'if', condition: 'getVariable("models").length == 0' },
                    { action: 'say', text: "<p>uups, not enough models availble.</p><p>We start with <span>contendercount</span> models.</p>", mode: 'timed', style: 'hidden', duration: '3', target: '1initcupround' },
                  { action: 'else' },
                    { action: 'eval', statement: 'page0qualification_func4()' },
                  { action: 'endif' },
                { action: 'else' },
                  { action: 'eval', statement: 'scriptVars.put("framed", false)' },
                  { action: 'say', text: "<p><span style=\"color: #ec407a\"><strong><span>newgirl</span></strong></span></p>", mode: 'timed', style: 'hidden', duration: '1' },
                  { action: 'if', condition: 'getVariable("contendercount") < getVariable("contendermax")' },
                    { action: 'goto', target: '0qualification' },
                  { action: 'else' },
                    { action: 'eval', statement: 'page0qualification_func12()' },
                    { action: 'goto', target: '1initcupround' },
                  { action: 'endif' },
                { action: 'endif' }
              ];
              handleActions(actionList);
          }
        ]]>
        </javascript>
      <!-- Info: Converted multiline eval to {'action': 'eval', 'statement': 'page0qualification_func4()'} and created function page0qualification_func4 -->
      <!-- Info: Converted multiline eval to {'action': 'eval', 'statement': 'page0qualification_func12()'} and created function page0qualification_func12 -->
      </Page>

      <Page id="0start-1">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: "image", file: "toronto.jpg" },
                { action: 'audio', file: 'traffic-urban.mp3', loops: '0', background: 'True', bpm: '', id: 'traffic' },
                { action: 'say', text: "<p>You walk through the streets without aim. </p><p>There's not much to do and you don't have any plans for the coming weekends either.</p>", mode: 'timed', style: 'hidden', duration: '10' },
                { action: 'say', text: "<p>You notice a bulletin board. There may be something interesting.</p>", mode: 'timed', style: 'hidden', duration: '3', target: '0-Intro-0' }
              ];
              handleActions(actionList);
          }
        ]]>
        </javascript>
      </Page>

      <Page id="1initcupround">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: 'eval', statement: 'page1initcupround_func0()' },
                { action: 'if', condition: 'getVariable("hardtime")' },
                  { action: 'eval', statement: 'scriptVars.put("hardtime", false)' },
                  { action: 'if', condition: 'getVariable("referee") == "RefereeA"' },
                    { action: "image", file: "referee-a*.jpg" },
                  { action: 'endif' },
                  { action: 'if', condition: 'getVariable("referee") == "RefereeB"' },
                    { action: "image", file: "referee-b*.jpg" },
                  { action: 'endif' },
                  { action: 'if', condition: 'getVariable("referee") == "RefereeC"' },
                    { action: "image", file: "referee-c*.jpg" },
                  { action: 'endif' },
                  { action: 'if', condition: 'getVariable("referee") == "RefereeD"' },
                    { action: "image", file: "referee-d*.jpg" },
                  { action: 'endif' },
                  { action: 'say', text: "<p><span style=\"color: #e0e0e0\"></span></p><p><span style=\"color: #e0e0e0\"></span></p><p><span style=\"color: #e0e0e0\"></span></p><p><span style=\"color: #e0e0e0\">This was early in the fight.</span></p><p><span style=\"color: #e0e0e0\">Are you struggling?</span></p><p><span style=\"color: #e0e0e0\">Let's give you some extra recovery time.</span></p><p><span style=\"color: #e0e0e0\"></span></p><p><span style=\"color: #e0e0e0\"></span></p>", mode: 'timed', style: 'hidden', duration: '7', allowSkip: 'true' },
                { action: 'endif' },
                { action: 'if', condition: 'getVariable("cuproundstart")' },
                  { action: "image", file: "office-sharon-congrat*.jpg" },
                  { action: 'if', condition: 'getVariable("cupstart")' },
                    { action: 'eval', statement: 'scriptVars.put("cupstart", false)' },
                  { action: 'else' },
                    { action: 'say', text: "<p></p><p></p><p>Congratulations, you made it to the <span style=\"color: #ffeb3b\"><strong><span>cuproundname</span></strong></span></p><p></p><p>Qualified are:</p><p><span style=\"color: #f8bbd0\"><span>qualifiedstring</span></span></p><p></p><p></p>", mode: 'timed', style: 'hidden', duration: '4' },
                  { action: 'endif' },
                  { action: 'eval', statement: 'scriptVars.put("cuproundstart", false)' },
                { action: 'endif' },
                { action: 'if', condition: 'getVariable("fightercount") == 4' },
                  { action: "image", file: "office-sharon-congrat*.jpg" },
                  { action: 'say', text: "<p></p><p></p><p>The next fighters are</p><p>Fighter one:  <span style=\"color: #ec407a\"><span>girlone</span></span><span style=\"color: #ec407a\"></span></p><p>Fighter two: <span style=\"color: #ec407a\"><span>girltwo</span></span></p><p>Fighter three: <span style=\"color: #ec407a\"><span>girlthree</span></span></p><p>Fighter four: <span style=\"color: #ec407a\"><span>girlfour</span></span></p><p></p>", mode: 'timed', style: 'hidden', duration: '4', allowSkip: 'true' },
                { action: 'else' },
                  { action: "image", file: "office-sharon-congrat*.jpg" },
                  { action: 'say', text: "<p></p><p></p><p></p><p>Prepare for the fight of</p><p> <span style=\"color: #ec407a\"><span>girlone</span></span><span style=\"color: #ec407a\"> </span> vs.<span style=\"color: #ec407a\"> </span> <span style=\"color: #ec407a\"><span>girltwo</span></span></p><p></p><p></p><p></p>", mode: 'timed', style: 'hidden', duration: '4', allowSkip: 'true' },
                { action: 'endif' },
                { action: "image", file: "numbergirl1*.jpg" },
                { action: 'say', text: "<p></p><p></p><p>First round</p><p></p><p></p>", mode: 'timed', style: 'hidden', duration: '4', allowSkip: 'true' },
                { action: 'audio', file: 'box-bell-short.mp3', loops: '0', background: 'True', bpm: '' },
                { action: 'goto', target: '1roundfight' }
              ];
              handleActions(actionList);
          }
        ]]>
        </javascript>
      <!-- Info: Converted multiline eval to {'action': 'eval', 'statement': 'page1initcupround_func0()'} and created function page1initcupround_func0 -->
      </Page>

      <Page id="1roundfight">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: 'eval', statement: 'page1roundfight_func0()' },
                { action: 'if', condition: 'getVariable("fought")' },
                  { action: 'if', condition: 'getVariable("roundend")' },
                    { action: 'if', condition: 'getVariable("round") == 1' },
                      { action: "image", file: "numbergirl1*.jpg" },
                      { action: 'say', text: "<p>First round</p>", mode: 'timed', style: 'hidden', duration: '3', allowSkip: 'true' },
                    { action: 'else' },
                      { action: 'if', condition: 'getVariable("round") == 2' },
                        { action: "image", file: "numbergirl2*.jpg" },
                        { action: 'say', text: "<p></p><p></p><p></p><p>Second round</p><p></p><p></p><p></p><p></p>", mode: 'timed', style: 'hidden', duration: '3', allowSkip: 'true' },
                      { action: 'else' },
                        { action: 'if', condition: 'getVariable("round") == 3' },
                          { action: "image", file: "numbergirl3*.jpg" },
                          { action: 'say', text: "<p></p><p></p><p></p><p>Third round</p><p></p><p></p><p></p><p></p>", mode: 'timed', style: 'hidden', duration: '3' },
                        { action: 'else' },
                          { action: 'if', condition: 'getVariable("round") == 4' },
                            { action: "image", file: "numbergirl4*.jpg" },
                            { action: 'say', text: "<p></p><p></p><p></p><p>Fourth round</p><p></p><p></p><p></p><p></p>", mode: 'timed', style: 'hidden', duration: '3' },
                          { action: 'else' },
                            { action: 'if', condition: 'getVariable("round") > 4' },
                              { action: "image", file: "numbergirl0*.jpg" },
                              { action: 'say', text: "<p></p><p></p><p></p><p>Next round</p><p></p><p></p><p></p><p></p>", mode: 'timed', style: 'hidden', duration: '3' },
                            { action: 'endif' },
                          { action: 'endif' },
                        { action: 'endif' },
                      { action: 'endif' },
                    { action: 'endif' },
                    { action: 'audio', file: 'box-bell-short.mp3', loops: '0', background: 'True', bpm: '' },
                  { action: 'else' },
                    { action: 'if', condition: 'getVariable("referee") == "RefereeA"' },
                      { action: "image", file: "referee-a*.jpg" },
                    { action: 'endif' },
                    { action: 'if', condition: 'getVariable("referee") == "RefereeB"' },
                      { action: "image", file: "referee-b*.jpg" },
                    { action: 'endif' },
                    { action: 'if', condition: 'getVariable("referee") == "RefereeC"' },
                      { action: "image", file: "referee-c*.jpg" },
                    { action: 'endif' },
                    { action: 'if', condition: 'getVariable("referee") == "RefereeD"' },
                      { action: "image", file: "referee-d*.jpg" },
                    { action: 'endif' },
                    { action: 'say', text: "<p></p><p></p><p><span style=\"color: #e0e0e0\">Short break before next battle.</span></p><p></p><p></p>", mode: 'timed', style: 'hidden', duration: '2', allowSkip: 'true' },
                  { action: 'endif' },
                { action: 'endif' },
                { action: 'globalButton', subAction: 'add', id: 'cumbutton', label: 'Cumming.', target: '1roundfight_1', hotkey: '', placement: 'bottom' },
                { action: 'eval', statement: 'page1roundfight_func45()' }
              ];
              handleActions(actionList);
          }
        ]]>
        </javascript>
      <!-- Info: Converted multiline eval to {'action': 'eval', 'statement': 'page1roundfight_func0()'} and created function page1roundfight_func0 -->
      <!-- Info: Converted multiline eval to {'action': 'eval', 'statement': 'page1roundfight_func45()'} and created function page1roundfight_func45 -->
      </Page>

      <Page id="1roundfight_1">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: 'eval', statement: 'scriptVars.put("cumbutton", false)' },
                { action: 'goto', target: '4finish-4' }
              ];
              handleActions(actionList,true);
          }
        ]]>
        </javascript>
      </Page>

      <Page id="2fightedge">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: 'if', condition: '!getVariable("framed")' },
                  { action: 'eval', statement: 'page2fightedge_func1()' },
                { action: 'endif' },
                { action: 'eval', statement: 'scriptVars.put("framed", false)' },
                { action: 'say', text: "<p><span style=\"color: #f06292\"><strong></strong></span><span style=\"color: #f06292\"><strong><span>fightername</span></strong></span><span style=\"color: #f06292\"><strong></strong></span></p><p>Edge within time limit.</p>", mode: 'instant' },
                { action: 'globalButton', subAction: 'add', id: 'edging-edged', label: 'Edged', target: '2fightedge_1', hotkey: '', placement: 'bottom' },
                { action: 'if', condition: '(getVariable("round") + getVariable("cuproundstrength") - 1) == 1' },
                  { action: 'timer', style: 'normal', duration: '(18..25)' },
                { action: 'else' },
                  { action: 'if', condition: '(getVariable("round") + getVariable("cuproundstrength") - 1) == 2' },
                    { action: 'timer', style: 'normal', duration: '(12..18)' },
                  { action: 'else' },
                    { action: 'timer', style: 'normal', duration: '(8..13)' },
                  { action: 'endif' },
                { action: 'endif' },
                { action: 'globalButton', subAction: 'remove', id: 'cumbutton' },
                { action: 'globalButton', subAction: 'remove', id: 'edging-edged' },
                { action: 'eval', statement: 'page2fightedge_func17()' }
              ];
              handleActions(actionList);
          }
        ]]>
        </javascript>
      <!-- Info: Converted multiline eval to {'action': 'eval', 'statement': 'page2fightedge_func1()'} and created function page2fightedge_func1 -->
      <!-- Info: Converted multiline eval to {'action': 'eval', 'statement': 'page2fightedge_func17()'} and created function page2fightedge_func17 -->
      </Page>

      <Page id="2fightedge1">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: 'if', condition: '!getVariable("framed")' },
                  { action: 'eval', statement: 'page2fightedge1_func1()' },
                  { action: 'if', condition: 'getVariable("holding")' },
                    { action: 'eval', statement: 'page2fightedge1_func3()' },
                  { action: 'else' },
                    { action: 'eval', statement: 'pages.goto("2fightedge2")' },
                  { action: 'endif' },
                { action: 'endif' },
                { action: 'eval', statement: 'scriptVars.put("framed", false)' },
                { action: 'say', text: "<p><span style=\"color: #f06292\"><strong></strong></span><span style=\"color: #f06292\"><strong><span>fightername</span></strong></span><span style=\"color: #f06292\"><strong></strong></span></p><p>Hold the edge.</p>", mode: 'instant' },
                { action: 'globalButton', subAction: 'add', id: 'edging-stop', label: 'I have to stop!', target: '2fightedge1_1', hotkey: '', placement: 'bottom' },
                { action: 'if', condition: '(getVariable("round") + getVariable("cuproundstrength") - 1) == 1' },
                  { action: 'timer', style: 'normal', duration: '(15..23)' },
                { action: 'else' },
                  { action: 'if', condition: '(getVariable("round") + getVariable("cuproundstrength") - 1) == 2' },
                    { action: 'timer', style: 'normal', duration: '(18..30)' },
                  { action: 'else' },
                    { action: 'timer', style: 'normal', duration: '(26..38)' },
                  { action: 'endif' },
                { action: 'endif' },
                { action: 'globalButton', subAction: 'remove', id: 'edging-stop' },
                { action: 'goto', target: '2fightedge2' }
              ];
              handleActions(actionList);
          }
        ]]>
        </javascript>
      <!-- Info: Converted multiline eval to {'action': 'eval', 'statement': 'page2fightedge1_func1()'} and created function page2fightedge1_func1 -->
      <!-- Info: Converted multiline eval to {'action': 'eval', 'statement': 'page2fightedge1_func3()'} and created function page2fightedge1_func3 -->
      </Page>

      <Page id="2fightedge1_1">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: 'say', text: "<p>STOP</p>", mode: 'instant' },
                { action: 'globalButton', subAction: 'remove', id: 'cumbutton' },
                { action: 'globalButton', subAction: 'remove', id: 'edging-stop' },
                { action: 'goto', target: '3winfight' }
              ];
              handleActions(actionList,true);
          }
        ]]>
        </javascript>
      </Page>

      <Page id="2fightedge2">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: 'if', condition: '!getVariable("framed")' },
                  { action: 'eval', statement: 'page2fightedge2_func1()' },
                { action: 'endif' },
                { action: 'eval', statement: 'page2fightedge2_func3()' },
                { action: 'say', text: "<p><span style=\"color: #f06292\"><strong><span>fightername</span></strong></span><span style=\"color: #f06292\"><strong></strong></span></p><p>Well done, let's rest a bit.</p>", mode: 'instant' },
                { action: 'if', condition: 'getVariable("jokerone")' },
                  { action: 'globalButton', subAction: 'add', id: 'joker1-set', label: 'I need a longer break.', target: '2fightedge2_1', hotkey: '', placement: 'bottom' },
                  { action: 'eval', statement: 'scriptVars.put("jokerone", false)' },
                { action: 'endif' },
                { action: 'if', condition: 'getVariable("jokertwo")' },
                  { action: 'globalButton', subAction: 'add', id: 'joker2-set', label: 'I need a longer break.', target: '2fightedge2_2', hotkey: '', placement: 'bottom' },
                  { action: 'eval', statement: 'scriptVars.put("jokertwo", false)' },
                { action: 'endif' },
                { action: 'if', condition: '(getVariable("round") + getVariable("cuproundstrength") - 1) == 1' },
                  { action: 'timer', style: 'normal', duration: '(8..14)' },
                { action: 'else' },
                  { action: 'if', condition: '(getVariable("round") + getVariable("cuproundstrength") - 1) == 2' },
                    { action: 'timer', style: 'normal', duration: '(5..10)' },
                  { action: 'else' },
                    { action: 'timer', style: 'normal', duration: '(3..8)' },
                  { action: 'endif' },
                { action: 'endif' },
                { action: 'globalButton', subAction: 'remove', id: 'joker1-set' },
                { action: 'globalButton', subAction: 'remove', id: 'joker2-set' },
                { action: 'goto', target: '1roundfight' }
              ];
              handleActions(actionList);
          }
        ]]>
        </javascript>
      <!-- Info: Converted multiline eval to {'action': 'eval', 'statement': 'page2fightedge2_func1()'} and created function page2fightedge2_func1 -->
      <!-- Info: Converted multiline eval to {'action': 'eval', 'statement': 'page2fightedge2_func3()'} and created function page2fightedge2_func3 -->
      </Page>

      <Page id="2fightedge2_1">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: 'say', text: "<p>Okay, let's pause another 10 s.</p>", mode: 'timed', style: 'hidden', duration: '10' },
                { action: 'eval', statement: 'scriptVars.put("girlonejoker", false)' }
              ];
              handleActions(actionList,true);
          }
        ]]>
        </javascript>
      </Page>

      <Page id="2fightedge2_2">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: 'say', text: "<p>Okay, let's pause another 10 s.</p>", mode: 'timed', style: 'hidden', duration: '10' },
                { action: 'eval', statement: 'scriptVars.put("girltwojoker", false)' }
              ];
              handleActions(actionList,true);
          }
        ]]>
        </javascript>
      </Page>

      <Page id="2fightedge_1">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: 'say', text: "<p>STOP</p>", mode: 'instant' },
                { action: 'globalButton', subAction: 'remove', id: 'edging-edged' },
                { action: 'goto', target: '2fightedge1' }
              ];
              handleActions(actionList,true);
          }
        ]]>
        </javascript>
      </Page>

      <Page id="2fightpattern">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: 'if', condition: '!getVariable("framed")' },
                  { action: 'eval', statement: 'page2fightpattern_func1()' },
                { action: 'endif' },
                { action: 'eval', statement: 'scriptVars.put("framed", false)' },
                { action: 'say', text: "<p><span style=\"color: #f06292\"><strong><span>fightername</span></strong></span><span style=\"color: #f06292\"><strong></strong></span></p><p>Stroke to the pattern.</p>", mode: 'instant' },
                { action: 'globalButton', subAction: 'add', id: 'edging-pattern', label: 'Edging, please stop.', target: '2fightpattern_1', hotkey: '', placement: 'bottom' },
                { action: 'if', condition: '(getVariable("round") + getVariable("cuproundstrength") - 1) == 1' },
                  { action: 'audio', file: '1pattern*.mp3', loops: '0', background: 'False', bpm: '' },
                  { action: 'timer', style: 'normal', duration: '(18..27)' },
                { action: 'else' },
                  { action: 'if', condition: '(getVariable("round") + getVariable("cuproundstrength") - 1) == 2' },
                    { action: 'audio', file: '2pattern*.mp3', loops: '0', background: 'False', bpm: '' },
                  { action: 'else' },
                    { action: 'audio', file: '3pattern*.mp3', loops: '0', background: 'False', bpm: '' },
                  { action: 'endif' },
                  { action: 'timer', style: 'normal', duration: '(23..34)' },
                { action: 'endif' },
                { action: 'globalButton', subAction: 'remove', id: 'cumbutton' },
                { action: 'globalButton', subAction: 'remove', id: 'edging-pattern' },
                { action: 'goto', target: '1roundfight' }
              ];
              handleActions(actionList);
          }
        ]]>
        </javascript>
      <!-- Info: Converted multiline eval to {'action': 'eval', 'statement': 'page2fightpattern_func1()'} and created function page2fightpattern_func1 -->
      </Page>

      <Page id="2fightpattern_1">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: 'globalButton', subAction: 'remove', id: 'cumbutton' },
                { action: 'globalButton', subAction: 'remove', id: 'edging-pattern' },
                { action: 'goto', target: '3winfight' }
              ];
              handleActions(actionList,true);
          }
        ]]>
        </javascript>
      </Page>

      <Page id="2fightspeed">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: 'if', condition: '!getVariable("framed")' },
                  { action: 'eval', statement: 'page2fightspeed_func1()' },
                { action: 'endif' },
                { action: 'eval', statement: 'page2fightspeed_func3()' },
                { action: 'say', text: "<p><span style=\"color: #f06292\"><strong><span>fightername</span></strong></span><span style=\"color: #f06292\"><strong></strong></span></p><p><span style=\"color: #ffffff\">Stroke to the beat.</span></p>", mode: 'instant' },
                { action: 'globalButton', subAction: 'add', id: 'edging-speed', label: 'Edging, please stop.', target: '2fightspeed_1', hotkey: '', placement: 'bottom' },
                { action: 'if', condition: '(getVariable("round") + getVariable("cuproundstrength") - 1) == 1' },
                  { action: 'audio', file: '1beat*.mp3', loops: '0', background: 'False', bpm: '' },
                  { action: 'timer', style: 'normal', duration: '(18..27)' },
                { action: 'else' },
                  { action: 'if', condition: '(getVariable("round") + getVariable("cuproundstrength") - 1) == 2' },
                    { action: 'audio', file: '2beat*.mp3', loops: '0', background: 'False', bpm: '' },
                  { action: 'else' },
                    { action: 'audio', file: '3beat*.mp3', loops: '0', background: 'False', bpm: '' },
                  { action: 'endif' },
                  { action: 'timer', style: 'normal', duration: '(20..30)' },
                { action: 'endif' },
                { action: 'globalButton', subAction: 'remove', id: 'cumbutton' },
                { action: 'globalButton', subAction: 'remove', id: 'edging-speed' },
                { action: 'goto', target: '1roundfight' }
              ];
              handleActions(actionList);
          }
        ]]>
        </javascript>
      <!-- Info: Converted multiline eval to {'action': 'eval', 'statement': 'page2fightspeed_func1()'} and created function page2fightspeed_func1 -->
      <!-- Info: Converted multiline eval to {'action': 'eval', 'statement': 'page2fightspeed_func3()'} and created function page2fightspeed_func3 -->
      </Page>

      <Page id="2fightspeed_1">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: 'globalButton', subAction: 'remove', id: 'cumbutton' },
                { action: 'globalButton', subAction: 'remove', id: 'edging-speed' },
                { action: 'goto', target: '3winfight' }
              ];
              handleActions(actionList,true);
          }
        ]]>
        </javascript>
      </Page>

      <Page id="2fighttime">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: 'if', condition: '!getVariable("framed")' },
                  { action: 'eval', statement: 'page2fighttime_func1()' },
                { action: 'endif' },
                { action: 'eval', statement: 'page2fighttime_func3()' },
                { action: 'globalButton', subAction: 'add', id: 'done-time', label: 'Done', target: '2fighttime_1', hotkey: '', placement: 'bottom' },
                { action: 'if', condition: 'getVariable("randomnumber") == 1' },
                  { action: 'say', text: "<p><span style=\"color: #f06292\"><strong><span>fightername</span></strong></span><span style=\"color: #f06292\"><strong></strong></span></p><p>Do 30 strokes within given time.</p>", mode: 'instant' },
                  { action: 'if', condition: '(getVariable("round") + getVariable("cuproundstrength") - 1) == 1' },
                    { action: 'timer', style: 'normal', duration: '(10..13)' },
                  { action: 'else' },
                    { action: 'timer', style: 'normal', duration: '(8..11)' },
                  { action: 'endif' },
                { action: 'else' },
                  { action: 'if', condition: 'getVariable("randomnumber") == 2' },
                    { action: 'say', text: "<p><span style=\"color: #f06292\"><strong><span>fightername</span></strong></span><span style=\"color: #f06292\"><strong></strong></span></p><p>Do 40 strokes within given time.</p>", mode: 'instant' },
                    { action: 'if', condition: '(getVariable("round") + getVariable("cuproundstrength") - 1) == 1' },
                      { action: 'timer', style: 'normal', duration: '(12..17)' },
                    { action: 'else' },
                      { action: 'timer', style: 'normal', duration: '(10..13)' },
                    { action: 'endif' },
                  { action: 'else' },
                    { action: 'if', condition: 'getVariable("randomnumber") == 3' },
                      { action: 'say', text: "<p><span style=\"color: #f06292\"><strong><span>fightername</span></strong></span><span style=\"color: #f06292\"><strong></strong></span></p><p>Do 50 strokes within given time.</p>", mode: 'instant' },
                      { action: 'if', condition: '(getVariable("round") + getVariable("cuproundstrength") - 1) == 1' },
                        { action: 'timer', style: 'normal', duration: '(15..22)' },
                      { action: 'else' },
                        { action: 'timer', style: 'normal', duration: '(13..17)' },
                      { action: 'endif' },
                    { action: 'endif' },
                  { action: 'endif' },
                { action: 'endif' },
                { action: 'globalButton', subAction: 'remove', id: 'cumbutton' },
                { action: 'globalButton', subAction: 'remove', id: 'done-time' },
                { action: 'goto', target: '3winfight' }
              ];
              handleActions(actionList);
          }
        ]]>
        </javascript>
      <!-- Info: Converted multiline eval to {'action': 'eval', 'statement': 'page2fighttime_func1()'} and created function page2fighttime_func1 -->
      <!-- Info: Converted multiline eval to {'action': 'eval', 'statement': 'page2fighttime_func3()'} and created function page2fighttime_func3 -->
      </Page>

      <Page id="2fighttime_1">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: 'globalButton', subAction: 'remove', id: 'cumbutton' },
                { action: 'globalButton', subAction: 'remove', id: 'done-time' },
                { action: 'goto', target: '1roundfight' }
              ];
              handleActions(actionList,true);
          }
        ]]>
        </javascript>
      </Page>

      <Page id="3wincup">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: "image", file: "numbergirl-final.jpg" },
                { action: 'audio', file: 'ending-applause.mp3', loops: '0', background: 'True', bpm: '' },
                { action: 'say', text: "<p><span style=\"color: #f8bbd0\">Congratulations!</span></p><p><span style=\"color: #f8bbd0\"></span><span style=\"color: #f8bbd0\"><strong><span>fightername</span></strong></span><span style=\"color: #f8bbd0\"> wins this tournement.</span></p><p><span style=\"color: #f8bbd0\"></span></p><p><span style=\"color: #ffcdd2\"><span>fightername</span></span><span style=\"color: #f8bbd0\">, you can now finish up </span><span style=\"color: #f8bbd0\"><span>teasetarget</span></span><span style=\"color: #f8bbd0\">, who performed well as tease target.</span></p>", mode: 'timed', style: 'hidden', duration: '7' },
                { action: 'eval', statement: 'scriptVars.put("framed", false)' },
                { action: 'goto', target: '4finish' }
              ];
              handleActions(actionList);
          }
        ]]>
        </javascript>
      </Page>

      <Page id="3winfight">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: 'if', condition: '!getVariable("framed")' },
                  { action: 'eval', statement: 'page3winfight_func1()' },
                { action: 'endif' },
                { action: 'say', text: "<p>Stop stroking.</p><p><span style=\"color: #f06292\"><strong><span>fightername</span></strong></span><span style=\"color: #f06292\"><strong> </strong></span>wins this fight.</p><p></p><p>qualified until now are <span style=\"color: #f8bbd0\"><span>qualifiedstring</span></span><span style=\"color: #f8bbd0\"></span></p>", mode: 'timed', style: 'hidden', duration: '5', target: '1initcupround' }
              ];
              handleActions(actionList);
          }
        ]]>
        </javascript>
      <!-- Info: Converted multiline eval to {'action': 'eval', 'statement': 'page3winfight_func1()'} and created function page3winfight_func1 -->
      </Page>

      <Page id="4finish">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: 'if', condition: '!getVariable("framed")' },
                  { action: 'eval', statement: 'page4finish_func1()' },
                { action: 'endif' },
                { action: 'eval', statement: 'page4finish_func3()' },
                { action: 'say', text: "<p><span style=\"color: #f48fb1\"><strong><span>fightername</span></strong></span></p><p><span style=\"color: #ffcdd2\"></span></p><p><span style=\"color: #ffcdd2\">OK </span><span style=\"color: #ffcdd2\"><span>teasetarget</span></span><span style=\"color: #ffcdd2\">, let's go.</span></p><p><span style=\"color: #ffcdd2\">Stroke to the beat.</span></p>", mode: 'instant' },
                { action: 'eval', statement: 'Sound.get("finishbeat").stop()' },
                { action: 'audio', file: '1*.mp3', loops: '0', background: 'False', bpm: '', id: 'finishbeat' },
                { action: 'globalButton', subAction: 'remove', id: 'cumbutton' },
                { action: 'globalButton', subAction: 'add', id: 'finishspeed', label: 'I came.', target: '5before-end', hotkey: '', placement: 'bottom' },
                { action: 'timer', style: 'hidden', duration: '10' },
                { action: 'globalButton', subAction: 'remove', id: 'finishspeed' },
                { action: 'if', condition: 'getVariable("finishcount") < 5' },
                  { action: 'goto', target: '4finish' },
                { action: 'else' },
                  { action: 'eval', statement: 'scriptVars.put("finishcount", 0)' },
                  { action: 'goto', target: '4finish-2' },
                { action: 'endif' }
              ];
              handleActions(actionList);
          }
        ]]>
        </javascript>
      <!-- Info: Converted multiline eval to {'action': 'eval', 'statement': 'page4finish_func1()'} and created function page4finish_func1 -->
      <!-- Info: Converted multiline eval to {'action': 'eval', 'statement': 'page4finish_func3()'} and created function page4finish_func3 -->
      </Page>

      <Page id="4finish-2">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: 'if', condition: '!getVariable("framed")' },
                  { action: 'eval', statement: 'page4finish_2_func1()' },
                { action: 'endif' },
                { action: 'eval', statement: 'page4finish_func3()' },
                { action: 'say', text: "<p><span style=\"color: #f48fb1\"><strong><span>fightername</span></strong></span></p><p></p><p><span style=\"color: #ffcdd2\">Let's speed it up, </span><span style=\"color: #ffcdd2\"><span>teasetarget</span></span><span style=\"color: #ffcdd2\">.</span></p>", mode: 'instant' },
                { action: 'eval', statement: 'Sound.get("finishbeat").stop()' },
                { action: 'audio', file: '2*.mp3', loops: '0', background: 'False', bpm: '', id: 'finishbeat' },
                { action: 'globalButton', subAction: 'add', id: 'finishspeed', label: 'I came.', target: '5before-end', hotkey: '', placement: 'bottom' },
                { action: 'timer', style: 'hidden', duration: '10' },
                { action: 'globalButton', subAction: 'remove', id: 'finishspeed' },
                { action: 'if', condition: 'getVariable("finishcount") < 4' },
                  { action: 'goto', target: '4finish-2' },
                { action: 'else' },
                  { action: 'goto', target: '4finish-3' },
                { action: 'endif' },
                { action: 'goto', target: '4finish-3' }
              ];
              handleActions(actionList);
          }
        ]]>
        </javascript>
      <!-- Info: Converted multiline eval to {'action': 'eval', 'statement': 'page4finish_2_func1()'} and created function page4finish_2_func1 -->
      <!-- Info: Converted multiline eval to {'action': 'eval', 'statement': 'page4finish_func3()'} and created function page4finish_func3 -->
      </Page>

      <Page id="4finish-3">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: 'globalButton', subAction: 'remove', id: 'cumbutton' },
                { action: 'if', condition: '!getVariable("framed")' },
                  { action: 'eval', statement: 'page4finish_3_func2()' },
                { action: 'endif' },
                { action: 'eval', statement: 'page4finish_func3()' },
                { action: 'say', text: "<p><span style=\"color: #f48fb1\"><strong><span>fightername</span></strong></span></p><p></p><p><span style=\"color: #ffcdd2\">Let's come to the end, </span><span style=\"color: #ffcdd2\"><span>teasetarget</span></span><span style=\"color: #ffcdd2\">.</span></p>", mode: 'instant' },
                { action: 'eval', statement: 'Sound.get("finishbeat").stop()' },
                { action: 'audio', file: '3*.mp3', loops: '0', background: 'False', bpm: '', id: 'finishbeat' },
                { action: 'globalButton', subAction: 'add', id: 'finishspeed', label: 'I came.', target: '5before-end', hotkey: '', placement: 'bottom' },
                { action: 'timer', style: 'hidden', duration: '4' },
                { action: 'globalButton', subAction: 'remove', id: 'finishspeed' },
                { action: 'goto', target: '4finish-3' }
              ];
              handleActions(actionList);
          }
        ]]>
        </javascript>
      <!-- Info: Converted multiline eval to {'action': 'eval', 'statement': 'page4finish_3_func2()'} and created function page4finish_3_func2 -->
      <!-- Info: Converted multiline eval to {'action': 'eval', 'statement': 'page4finish_func3()'} and created function page4finish_func3 -->
      </Page>

      <Page id="4finish-4">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: 'globalButton', subAction: 'remove', id: 'cumbutton' },
                { action: 'globalButton', subAction: 'remove', id: 'edging-pattern' },
                { action: 'globalButton', subAction: 'remove', id: 'edging-edged' },
                { action: 'globalButton', subAction: 'remove', id: 'edging-beat' },
                { action: 'globalButton', subAction: 'remove', id: 'done-time' },
                { action: 'globalButton', subAction: 'remove', id: 'edging-speed' },
                { action: 'if', condition: '!getVariable("framed")' },
                  { action: 'eval', statement: 'page4finish_4_func7()' },
                { action: 'endif' },
                { action: 'eval', statement: 'page4finish_func3()' },
                { action: 'say', text: "<p><span style=\"color: #f48fb1\"><strong><span>fightername</span></strong></span></p><p></p><p><span style=\"color: #ffcdd2\">Excellent, I have won the cup!</span></p>", mode: 'instant' },
                { action: 'eval', statement: 'Sound.get("finishbeat").stop()' },
                { action: 'audio', file: '3*.mp3', loops: '0', background: 'False', bpm: '', id: 'finishbeat' },
                { action: 'globalButton', subAction: 'add', id: 'finishspeed', label: 'I came.', target: '5before-end', hotkey: '', placement: 'bottom' },
                { action: 'timer', style: 'hidden', duration: '4' },
                { action: 'globalButton', subAction: 'remove', id: 'finishspeed' },
                { action: 'goto', target: '4finish-5' }
              ];
              handleActions(actionList);
          }
        ]]>
        </javascript>
      <!-- Info: Converted multiline eval to {'action': 'eval', 'statement': 'page4finish_4_func7()'} and created function page4finish_4_func7 -->
      <!-- Info: Converted multiline eval to {'action': 'eval', 'statement': 'page4finish_func3()'} and created function page4finish_func3 -->
      </Page>

      <Page id="4finish-5">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: 'if', condition: '!getVariable("framed")' },
                  { action: 'eval', statement: 'page4finish_5_func1()' },
                { action: 'endif' },
                { action: 'eval', statement: 'page4finish_func3()' },
                { action: 'say', text: "<p><span style=\"color: #f48fb1\"><strong><span>fightername</span></strong></span></p><p></p><p><span style=\"color: #ffcdd2\">I knew, you cannot stand against my tease.</span></p>", mode: 'instant' },
                { action: 'eval', statement: 'Sound.get("finishbeat").stop()' },
                { action: 'audio', file: '3*.mp3', loops: '0', background: 'False', bpm: '', id: 'finishbeat' },
                { action: 'globalButton', subAction: 'add', id: 'finishspeed', label: 'I came.', target: '5before-end', hotkey: '', placement: 'bottom' },
                { action: 'timer', style: 'hidden', duration: '4' },
                { action: 'globalButton', subAction: 'remove', id: 'finishspeed' },
                { action: 'goto', target: '4finish-6' }
              ];
              handleActions(actionList);
          }
        ]]>
        </javascript>
      <!-- Info: Converted multiline eval to {'action': 'eval', 'statement': 'page4finish_5_func1()'} and created function page4finish_5_func1 -->
      <!-- Info: Converted multiline eval to {'action': 'eval', 'statement': 'page4finish_func3()'} and created function page4finish_func3 -->
      </Page>

      <Page id="4finish-6">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: 'globalButton', subAction: 'remove', id: 'cumbutton' },
                { action: 'if', condition: '!getVariable("framed")' },
                  { action: 'eval', statement: 'page4finish_6_func2()' },
                { action: 'endif' },
                { action: 'eval', statement: 'page4finish_func3()' },
                { action: 'say', text: "<p><span style=\"color: #f48fb1\"><strong><span>fightername</span></strong></span></p><p></p><p><span style=\"color: #ffcdd2\">Let's come to the end, </span><span style=\"color: #ffcdd2\"><span>teasetarget</span></span><span style=\"color: #ffcdd2\">.</span></p>", mode: 'instant' },
                { action: 'eval', statement: 'Sound.get("finishbeat").stop()' },
                { action: 'audio', file: '3*.mp3', loops: '0', background: 'False', bpm: '', id: 'finishbeat' },
                { action: 'globalButton', subAction: 'add', id: 'finishspeed', label: 'I came.', target: '5before-end', hotkey: '', placement: 'bottom' },
                { action: 'timer', style: 'hidden', duration: '4' },
                { action: 'globalButton', subAction: 'remove', id: 'finishspeed' },
                { action: 'goto', target: '4finish-6' }
              ];
              handleActions(actionList);
          }
        ]]>
        </javascript>
      <!-- Info: Converted multiline eval to {'action': 'eval', 'statement': 'page4finish_6_func2()'} and created function page4finish_6_func2 -->
      <!-- Info: Converted multiline eval to {'action': 'eval', 'statement': 'page4finish_func3()'} and created function page4finish_func3 -->
      </Page>

      <Page id="5before-end">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: 'globalButton', subAction: 'remove', id: 'cumbutton' },
                { action: 'globalButton', subAction: 'remove', id: 'edging-pattern' },
                { action: 'globalButton', subAction: 'remove', id: 'edging-speed' },
                { action: 'globalButton', subAction: 'remove', id: 'done-time' },
                { action: 'globalButton', subAction: 'remove', id: 'edging-edged' },
                { action: 'if', condition: '!getVariable("framed")' },
                  { action: 'eval', statement: 'page5before_end_func6()' },
                { action: 'endif' },
                { action: 'eval', statement: 'scriptVars.put("framed", false)' },
                { action: 'if', condition: 'getVariable("tofinal")' },
                  { action: 'audio', file: 'ending-applause.mp3', loops: '0', background: 'False', bpm: '' },
                  { action: 'say', text: "<p>Congratulations. You made it to the final.</p><p>If you want to jump directly to registration next time, use the password <span style=\"color: #ff6f00\">directfight</span>.</p>", mode: 'pause' },
                { action: 'endif' },
                { action: 'if', condition: 'getVariable("tofinal") == false' },
                  { action: 'audio', file: 'crowd-booing-long.mp3', loops: '0', background: 'False', bpm: '' },
                  { action: 'say', text: "<p>Unfortunately, you didn't make it to the final.</p><p>The <span style=\"color: #f9a825\">Teasefight Cup</span> was too short. The audience is disappointed.</p><p>Shame on you.</p><p>Next time, keep yourself under better control.</p>", mode: 'pause' },
                { action: 'endif' }
              ];
              handleActions(actionList);
          }
        ]]>
        </javascript>
      <!-- Info: Converted multiline eval to {'action': 'eval', 'statement': 'page5before_end_func6()'} and created function page5before_end_func6 -->
      </Page>

      <Page id="Adelia">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: 'if', condition: 'getVariable("gallerypic")' },
                  { action: "image", file: "Adelia/*.jpg" },
                { action: 'else' },
                  { action: "image", file: "adelia.jpg" },
                { action: 'endif' },
                { action: 'eval', statement: 'Aleksa_Slusarchi_func5()' }
              ];
              handleActions(actionList);
          }
        ]]>
        </javascript>
      <!-- Info: Converted multiline eval to {'action': 'eval', 'statement': 'Aleksa_Slusarchi_func5()'} and created function Aleksa_Slusarchi_func5 -->
      </Page>

      <Page id="Aleksa-Slusarchi">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: 'if', condition: 'getVariable("gallerypic")' },
                  { action: "image", file: "Aleksa Slusarchi/*.jpg" },
                { action: 'else' },
                  { action: "image", file: "aleksa-slusarchi.jpg" },
                { action: 'endif' },
                { action: 'eval', statement: 'Aleksa_Slusarchi_func5()' }
              ];
              handleActions(actionList);
          }
        ]]>
        </javascript>
      <!-- Info: Converted multiline eval to {'action': 'eval', 'statement': 'Aleksa_Slusarchi_func5()'} and created function Aleksa_Slusarchi_func5 -->
      </Page>

      <Page id="Alice">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: 'if', condition: 'getVariable("gallerypic")' },
                  { action: "image", file: "Alice/*.jpg" },
                { action: 'else' },
                  { action: "image", file: "alice.jpg" },
                { action: 'endif' },
                { action: 'eval', statement: 'Aleksa_Slusarchi_func5()' }
              ];
              handleActions(actionList);
          }
        ]]>
        </javascript>
      <!-- Info: Converted multiline eval to {'action': 'eval', 'statement': 'Aleksa_Slusarchi_func5()'} and created function Aleksa_Slusarchi_func5 -->
      </Page>

      <Page id="Alysha">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: 'if', condition: 'getVariable("gallerypic")' },
                  { action: "image", file: "Alysha/*.jpg" },
                { action: 'else' },
                  { action: "image", file: "alysha.jpg" },
                { action: 'endif' },
                { action: 'eval', statement: 'Aleksa_Slusarchi_func5()' }
              ];
              handleActions(actionList);
          }
        ]]>
        </javascript>
      <!-- Info: Converted multiline eval to {'action': 'eval', 'statement': 'Aleksa_Slusarchi_func5()'} and created function Aleksa_Slusarchi_func5 -->
      </Page>

      <Page id="Amanda">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: 'if', condition: 'getVariable("gallerypic")' },
                  { action: "image", file: "Amanda/*.jpg" },
                { action: 'else' },
                  { action: "image", file: "amanda.jpg" },
                { action: 'endif' },
                { action: 'eval', statement: 'Aleksa_Slusarchi_func5()' }
              ];
              handleActions(actionList);
          }
        ]]>
        </javascript>
      <!-- Info: Converted multiline eval to {'action': 'eval', 'statement': 'Aleksa_Slusarchi_func5()'} and created function Aleksa_Slusarchi_func5 -->
      </Page>

      <Page id="Anita">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: 'if', condition: 'getVariable("gallerypic")' },
                  { action: "image", file: "Anita/*.jpg" },
                { action: 'else' },
                  { action: "image", file: "anita.jpg" },
                { action: 'endif' },
                { action: 'eval', statement: 'Aleksa_Slusarchi_func5()' }
              ];
              handleActions(actionList);
          }
        ]]>
        </javascript>
      <!-- Info: Converted multiline eval to {'action': 'eval', 'statement': 'Aleksa_Slusarchi_func5()'} and created function Aleksa_Slusarchi_func5 -->
      </Page>

      <Page id="Anna-Aj">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: 'if', condition: 'getVariable("gallerypic")' },
                  { action: "image", file: "Anna Aj/*.jpg" },
                { action: 'else' },
                  { action: "image", file: "anna-aj.jpg" },
                { action: 'endif' },
                { action: 'eval', statement: 'Aleksa_Slusarchi_func5()' }
              ];
              handleActions(actionList);
          }
        ]]>
        </javascript>
      <!-- Info: Converted multiline eval to {'action': 'eval', 'statement': 'Aleksa_Slusarchi_func5()'} and created function Aleksa_Slusarchi_func5 -->
      </Page>

      <Page id="Ashley">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: 'if', condition: 'getVariable("gallerypic")' },
                  { action: "image", file: "Ashley/*.jpg" },
                { action: 'else' },
                  { action: "image", file: "ashley2.jpg" },
                { action: 'endif' },
                { action: 'eval', statement: 'Aleksa_Slusarchi_func5()' }
              ];
              handleActions(actionList);
          }
        ]]>
        </javascript>
      <!-- Info: Converted multiline eval to {'action': 'eval', 'statement': 'Aleksa_Slusarchi_func5()'} and created function Aleksa_Slusarchi_func5 -->
      </Page>

      <Page id="Caitlin">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: 'if', condition: 'getVariable("gallerypic")' },
                  { action: "image", file: "Caitlin/*.jpg" },
                { action: 'else' },
                  { action: "image", file: "caitline-(12).jpg" },
                { action: 'endif' },
                { action: 'eval', statement: 'Aleksa_Slusarchi_func5()' }
              ];
              handleActions(actionList);
          }
        ]]>
        </javascript>
      <!-- Info: Converted multiline eval to {'action': 'eval', 'statement': 'Aleksa_Slusarchi_func5()'} and created function Aleksa_Slusarchi_func5 -->
      </Page>

      <Page id="Caralyn">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: 'if', condition: 'getVariable("gallerypic")' },
                  { action: "image", file: "Caralyn/*.jpg" },
                { action: 'else' },
                  { action: "image", file: "caralyn.jpg" },
                { action: 'endif' },
                { action: 'eval', statement: 'Aleksa_Slusarchi_func5()' }
              ];
              handleActions(actionList);
          }
        ]]>
        </javascript>
      <!-- Info: Converted multiline eval to {'action': 'eval', 'statement': 'Aleksa_Slusarchi_func5()'} and created function Aleksa_Slusarchi_func5 -->
      </Page>

      <Page id="Catie">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: 'if', condition: 'getVariable("gallerypic")' },
                  { action: "image", file: "Catie/*.jpg" },
                { action: 'else' },
                  { action: "image", file: "catie.jpg" },
                { action: 'endif' },
                { action: 'eval', statement: 'Aleksa_Slusarchi_func5()' }
              ];
              handleActions(actionList);
          }
        ]]>
        </javascript>
      <!-- Info: Converted multiline eval to {'action': 'eval', 'statement': 'Aleksa_Slusarchi_func5()'} and created function Aleksa_Slusarchi_func5 -->
      </Page>

      <Page id="Divina">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: 'if', condition: 'getVariable("gallerypic")' },
                  { action: "image", file: "Divina/*.jpg" },
                { action: 'else' },
                  { action: "image", file: "divina.jpg" },
                { action: 'endif' },
                { action: 'eval', statement: 'Aleksa_Slusarchi_func5()' }
              ];
              handleActions(actionList);
          }
        ]]>
        </javascript>
      <!-- Info: Converted multiline eval to {'action': 'eval', 'statement': 'Aleksa_Slusarchi_func5()'} and created function Aleksa_Slusarchi_func5 -->
      </Page>

      <Page id="Elina">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: 'if', condition: 'getVariable("gallerypic")' },
                  { action: "image", file: "Elina/*.jpg" },
                { action: 'else' },
                  { action: "image", file: "elina-love-luscious-life-playboy-plus-11.jpg" },
                { action: 'endif' },
                { action: 'eval', statement: 'Aleksa_Slusarchi_func5()' }
              ];
              handleActions(actionList);
          }
        ]]>
        </javascript>
      <!-- Info: Converted multiline eval to {'action': 'eval', 'statement': 'Aleksa_Slusarchi_func5()'} and created function Aleksa_Slusarchi_func5 -->
      </Page>

      <Page id="Ellison">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: 'if', condition: 'getVariable("gallerypic")' },
                  { action: "image", file: "Ellison/*.jpg" },
                { action: 'else' },
                  { action: "image", file: "ellison.jpg" },
                { action: 'endif' },
                { action: 'eval', statement: 'Aleksa_Slusarchi_func5()' }
              ];
              handleActions(actionList);
          }
        ]]>
        </javascript>
      <!-- Info: Converted multiline eval to {'action': 'eval', 'statement': 'Aleksa_Slusarchi_func5()'} and created function Aleksa_Slusarchi_func5 -->
      </Page>

      <Page id="End">
      <!-- Warning: **** Found a page with no actions, and Emulate Global Buttons is ON.
The code to show global buttons on this page was not added. Should it be? **** -->
      </Page>

      <Page id="Franziska">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: 'if', condition: 'getVariable("gallerypic")' },
                  { action: "image", file: "Franziska/*.jpg" },
                { action: 'else' },
                  { action: "image", file: "franziska.jpg" },
                { action: 'endif' },
                { action: 'eval', statement: 'Aleksa_Slusarchi_func5()' }
              ];
              handleActions(actionList);
          }
        ]]>
        </javascript>
      <!-- Info: Converted multiline eval to {'action': 'eval', 'statement': 'Aleksa_Slusarchi_func5()'} and created function Aleksa_Slusarchi_func5 -->
      </Page>

      <Page id="Georgia-Jones">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: 'if', condition: 'getVariable("gallerypic")' },
                  { action: "image", file: "Georgia Jones/*.jpg" },
                { action: 'else' },
                  { action: "image", file: "Georgia-Jones.jpg" },
                { action: 'endif' },
                { action: 'eval', statement: 'Aleksa_Slusarchi_func5()' }
              ];
              handleActions(actionList);
          }
        ]]>
        </javascript>
      <!-- Info: Converted multiline eval to {'action': 'eval', 'statement': 'Aleksa_Slusarchi_func5()'} and created function Aleksa_Slusarchi_func5 -->
      </Page>

      <Page id="Guerlain">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: 'if', condition: 'getVariable("gallerypic")' },
                  { action: "image", file: "Guerlain/*.jpg" },
                { action: 'else' },
                  { action: "image", file: "guerlain.jpg" },
                { action: 'endif' },
                { action: 'eval', statement: 'Aleksa_Slusarchi_func5()' }
              ];
              handleActions(actionList);
          }
        ]]>
        </javascript>
      <!-- Info: Converted multiline eval to {'action': 'eval', 'statement': 'Aleksa_Slusarchi_func5()'} and created function Aleksa_Slusarchi_func5 -->
      </Page>

      <Page id="GuideMeIncorrectVersion">
        <javascript>
        <![CDATA[
          function pageLoad() {
              var pageText = "";
              pageText += "You are using Guideme version " + comonFunctions.getVersion() + "<br/><br />\n";
              pageText += "Guideme 4.3 or higher is required for this tease.<br />\n";
              overRide.setHtml(pageText);
          }
        ]]>
        </javascript>
      </Page>

      <Page id="Julie">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: 'if', condition: 'getVariable("gallerypic")' },
                  { action: "image", file: "Julie/*.jpg" },
                { action: 'else' },
                  { action: "image", file: "Julie.jpg" },
                { action: 'endif' },
                { action: 'eval', statement: 'Aleksa_Slusarchi_func5()' }
              ];
              handleActions(actionList);
          }
        ]]>
        </javascript>
      <!-- Info: Converted multiline eval to {'action': 'eval', 'statement': 'Aleksa_Slusarchi_func5()'} and created function Aleksa_Slusarchi_func5 -->
      </Page>

      <Page id="Karissa">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: 'if', condition: 'getVariable("gallerypic")' },
                  { action: "image", file: "Karissa/*.jpg" },
                { action: 'else' },
                  { action: "image", file: "karissa.jpg" },
                { action: 'endif' },
                { action: 'eval', statement: 'Aleksa_Slusarchi_func5()' }
              ];
              handleActions(actionList);
          }
        ]]>
        </javascript>
      <!-- Info: Converted multiline eval to {'action': 'eval', 'statement': 'Aleksa_Slusarchi_func5()'} and created function Aleksa_Slusarchi_func5 -->
      </Page>

      <Page id="Karla">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: 'if', condition: 'getVariable("gallerypic")' },
                  { action: "image", file: "Karla Kush/*.jpg" },
                { action: 'else' },
                  { action: "image", file: "karla-kush.jpg" },
                { action: 'endif' },
                { action: 'eval', statement: 'Aleksa_Slusarchi_func5()' }
              ];
              handleActions(actionList);
          }
        ]]>
        </javascript>
      <!-- Info: Converted multiline eval to {'action': 'eval', 'statement': 'Aleksa_Slusarchi_func5()'} and created function Aleksa_Slusarchi_func5 -->
      </Page>

      <Page id="Katya">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: 'if', condition: 'getVariable("gallerypic")' },
                  { action: "image", file: "Katya/*.jpg" },
                { action: 'else' },
                  { action: "image", file: "katya.jpg" },
                { action: 'endif' },
                { action: 'eval', statement: 'Aleksa_Slusarchi_func5()' }
              ];
              handleActions(actionList);
          }
        ]]>
        </javascript>
      <!-- Info: Converted multiline eval to {'action': 'eval', 'statement': 'Aleksa_Slusarchi_func5()'} and created function Aleksa_Slusarchi_func5 -->
      </Page>

      <Page id="Katya-P">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: 'if', condition: 'getVariable("gallerypic")' },
                  { action: "image", file: "Katya P/*.jpg" },
                { action: 'else' },
                  { action: "image", file: "katya-p.jpg" },
                { action: 'endif' },
                { action: 'eval', statement: 'Aleksa_Slusarchi_func5()' }
              ];
              handleActions(actionList);
          }
        ]]>
        </javascript>
      <!-- Info: Converted multiline eval to {'action': 'eval', 'statement': 'Aleksa_Slusarchi_func5()'} and created function Aleksa_Slusarchi_func5 -->
      </Page>

      <Page id="Kenna">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: 'if', condition: 'getVariable("gallerypic")' },
                  { action: "image", file: "Kenna James/*.jpg" },
                { action: 'else' },
                  { action: "image", file: "kenna-james.jpg" },
                { action: 'endif' },
                { action: 'eval', statement: 'Aleksa_Slusarchi_func5()' }
              ];
              handleActions(actionList);
          }
        ]]>
        </javascript>
      <!-- Info: Converted multiline eval to {'action': 'eval', 'statement': 'Aleksa_Slusarchi_func5()'} and created function Aleksa_Slusarchi_func5 -->
      </Page>

      <Page id="Kirika">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: 'if', condition: 'getVariable("gallerypic")' },
                  { action: "image", file: "Kirika/*.jpg" },
                { action: 'else' },
                  { action: "image", file: "kirika.jpg" },
                { action: 'endif' },
                { action: 'eval', statement: 'Aleksa_Slusarchi_func5()' }
              ];
              handleActions(actionList);
          }
        ]]>
        </javascript>
      <!-- Info: Converted multiline eval to {'action': 'eval', 'statement': 'Aleksa_Slusarchi_func5()'} and created function Aleksa_Slusarchi_func5 -->
      </Page>

      <Page id="Kristy">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: 'if', condition: 'getVariable("gallerypic")' },
                  { action: "image", file: "Kristy/*.jpg" },
                { action: 'else' },
                  { action: "image", file: "kristy.jpg" },
                { action: 'endif' },
                { action: 'eval', statement: 'Aleksa_Slusarchi_func5()' }
              ];
              handleActions(actionList);
          }
        ]]>
        </javascript>
      <!-- Info: Converted multiline eval to {'action': 'eval', 'statement': 'Aleksa_Slusarchi_func5()'} and created function Aleksa_Slusarchi_func5 -->
      </Page>

      <Page id="Lena">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: 'if', condition: 'getVariable("gallerypic")' },
                  { action: "image", file: "Lena/*.jpg" },
                { action: 'else' },
                  { action: "image", file: "lena.jpg" },
                { action: 'endif' },
                { action: 'eval', statement: 'Aleksa_Slusarchi_func5()' }
              ];
              handleActions(actionList);
          }
        ]]>
        </javascript>
      <!-- Info: Converted multiline eval to {'action': 'eval', 'statement': 'Aleksa_Slusarchi_func5()'} and created function Aleksa_Slusarchi_func5 -->
      </Page>

      <Page id="Leona">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: 'if', condition: 'getVariable("gallerypic")' },
                  { action: "image", file: "Leona/*.jpg" },
                { action: 'else' },
                  { action: "image", file: "leona.jpg" },
                { action: 'endif' },
                { action: 'eval', statement: 'Aleksa_Slusarchi_func5()' }
              ];
              handleActions(actionList);
          }
        ]]>
        </javascript>
      <!-- Info: Converted multiline eval to {'action': 'eval', 'statement': 'Aleksa_Slusarchi_func5()'} and created function Aleksa_Slusarchi_func5 -->
      </Page>

      <Page id="Lyuda">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: 'if', condition: 'getVariable("gallerypic")' },
                  { action: "image", file: "Lyuda/*.jpg" },
                { action: 'else' },
                  { action: "image", file: "lyuda.jpg" },
                { action: 'endif' },
                { action: 'eval', statement: 'Aleksa_Slusarchi_func5()' }
              ];
              handleActions(actionList);
          }
        ]]>
        </javascript>
      <!-- Info: Converted multiline eval to {'action': 'eval', 'statement': 'Aleksa_Slusarchi_func5()'} and created function Aleksa_Slusarchi_func5 -->
      </Page>

      <Page id="Magen">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: 'if', condition: 'getVariable("gallerypic")' },
                  { action: "image", file: "Magen/*.jpg" },
                { action: 'else' },
                  { action: "image", file: "magen2.jpg" },
                { action: 'endif' },
                { action: 'eval', statement: 'Aleksa_Slusarchi_func5()' }
              ];
              handleActions(actionList);
          }
        ]]>
        </javascript>
      <!-- Info: Converted multiline eval to {'action': 'eval', 'statement': 'Aleksa_Slusarchi_func5()'} and created function Aleksa_Slusarchi_func5 -->
      </Page>

      <Page id="Malena-Fendi">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: 'if', condition: 'getVariable("gallerypic")' },
                  { action: "image", file: "Malena Fendi/*.jpg" },
                { action: 'else' },
                  { action: "image", file: "malena-fendi.jpg" },
                { action: 'endif' },
                { action: 'eval', statement: 'Aleksa_Slusarchi_func5()' }
              ];
              handleActions(actionList);
          }
        ]]>
        </javascript>
      <!-- Info: Converted multiline eval to {'action': 'eval', 'statement': 'Aleksa_Slusarchi_func5()'} and created function Aleksa_Slusarchi_func5 -->
      </Page>

      <Page id="Malena-Morgan">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: 'if', condition: 'getVariable("gallerypic")' },
                  { action: "image", file: "Malena Morgan/*.jpg" },
                { action: 'else' },
                  { action: "image", file: "malena-morgan.jpg" },
                { action: 'endif' },
                { action: 'eval', statement: 'Aleksa_Slusarchi_func5()' }
              ];
              handleActions(actionList);
          }
        ]]>
        </javascript>
      <!-- Info: Converted multiline eval to {'action': 'eval', 'statement': 'Aleksa_Slusarchi_func5()'} and created function Aleksa_Slusarchi_func5 -->
      </Page>

      <Page id="Melissa-Moore">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: 'if', condition: 'getVariable("gallerypic")' },
                  { action: "image", file: "Melissa Moore/*.jpg" },
                { action: 'else' },
                  { action: "image", file: "melissa-moore.jpg" },
                { action: 'endif' },
                { action: 'eval', statement: 'Aleksa_Slusarchi_func5()' }
              ];
              handleActions(actionList);
          }
        ]]>
        </javascript>
      <!-- Info: Converted multiline eval to {'action': 'eval', 'statement': 'Aleksa_Slusarchi_func5()'} and created function Aleksa_Slusarchi_func5 -->
      </Page>

      <Page id="Nika">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: 'if', condition: 'getVariable("gallerypic")' },
                  { action: "image", file: "Nika/*.jpg" },
                { action: 'else' },
                  { action: "image", file: "nika.jpg" },
                { action: 'endif' },
                { action: 'eval', statement: 'Aleksa_Slusarchi_func5()' }
              ];
              handleActions(actionList);
          }
        ]]>
        </javascript>
      <!-- Info: Converted multiline eval to {'action': 'eval', 'statement': 'Aleksa_Slusarchi_func5()'} and created function Aleksa_Slusarchi_func5 -->
      </Page>

      <Page id="Red-Fox">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: 'if', condition: 'getVariable("gallerypic")' },
                  { action: "image", file: "redfox/*.jpg" },
                { action: 'else' },
                  { action: "image", file: "redfox.jpg" },
                { action: 'endif' },
                { action: 'eval', statement: 'Aleksa_Slusarchi_func5()' }
              ];
              handleActions(actionList);
          }
        ]]>
        </javascript>
      <!-- Info: Converted multiline eval to {'action': 'eval', 'statement': 'Aleksa_Slusarchi_func5()'} and created function Aleksa_Slusarchi_func5 -->
      </Page>

      <Page id="Sabrisse">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: 'if', condition: 'getVariable("gallerypic")' },
                  { action: "image", file: "Sabrisse/*.jpg" },
                { action: 'else' },
                  { action: "image", file: "sabrisse.jpg" },
                { action: 'endif' },
                { action: 'eval', statement: 'Aleksa_Slusarchi_func5()' }
              ];
              handleActions(actionList);
          }
        ]]>
        </javascript>
      <!-- Info: Converted multiline eval to {'action': 'eval', 'statement': 'Aleksa_Slusarchi_func5()'} and created function Aleksa_Slusarchi_func5 -->
      </Page>

      <Page id="Sapphira">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: 'if', condition: 'getVariable("gallerypic")' },
                  { action: "image", file: "Sapphira/*.jpg" },
                { action: 'else' },
                  { action: "image", file: "sapphira.jpg" },
                { action: 'endif' },
                { action: 'eval', statement: 'Aleksa_Slusarchi_func5()' }
              ];
              handleActions(actionList);
          }
        ]]>
        </javascript>
      <!-- Info: Converted multiline eval to {'action': 'eval', 'statement': 'Aleksa_Slusarchi_func5()'} and created function Aleksa_Slusarchi_func5 -->
      </Page>

      <Page id="Sasha">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: 'if', condition: 'getVariable("gallerypic")' },
                  { action: "image", file: "Sasha/*.jpg" },
                { action: 'else' },
                  { action: "image", file: "sasha.jpg" },
                { action: 'endif' },
                { action: 'eval', statement: 'Aleksa_Slusarchi_func5()' }
              ];
              handleActions(actionList);
          }
        ]]>
        </javascript>
      <!-- Info: Converted multiline eval to {'action': 'eval', 'statement': 'Aleksa_Slusarchi_func5()'} and created function Aleksa_Slusarchi_func5 -->
      </Page>

      <Page id="Sheri-Vi">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: 'if', condition: 'getVariable("gallerypic")' },
                  { action: "image", file: "Sheri Vi/*.jpg" },
                { action: 'else' },
                  { action: "image", file: "sheri-vi.jpg" },
                { action: 'endif' },
                { action: 'eval', statement: 'Aleksa_Slusarchi_func5()' }
              ];
              handleActions(actionList);
          }
        ]]>
        </javascript>
      <!-- Info: Converted multiline eval to {'action': 'eval', 'statement': 'Aleksa_Slusarchi_func5()'} and created function Aleksa_Slusarchi_func5 -->
      </Page>

      <Page id="Sophia">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: 'if', condition: 'getVariable("gallerypic")' },
                  { action: "image", file: "Sophia/*.jpg" },
                { action: 'else' },
                  { action: "image", file: "sophia.jpg" },
                { action: 'endif' },
                { action: 'eval', statement: 'Aleksa_Slusarchi_func5()' }
              ];
              handleActions(actionList);
          }
        ]]>
        </javascript>
      <!-- Info: Converted multiline eval to {'action': 'eval', 'statement': 'Aleksa_Slusarchi_func5()'} and created function Aleksa_Slusarchi_func5 -->
      </Page>

      <Page id="Talia">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: 'if', condition: 'getVariable("gallerypic")' },
                  { action: "image", file: "Talia/*.jpg" },
                { action: 'else' },
                  { action: "image", file: "talia.jpg" },
                { action: 'endif' },
                { action: 'eval', statement: 'Aleksa_Slusarchi_func5()' }
              ];
              handleActions(actionList);
          }
        ]]>
        </javascript>
      <!-- Info: Converted multiline eval to {'action': 'eval', 'statement': 'Aleksa_Slusarchi_func5()'} and created function Aleksa_Slusarchi_func5 -->
      </Page>

      <Page id="Toxic">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: 'if', condition: 'getVariable("gallerypic")' },
                  { action: "image", file: "Toxic/*.jpg" },
                { action: 'else' },
                  { action: "image", file: "toxic.jpg" },
                { action: 'endif' },
                { action: 'eval', statement: 'Aleksa_Slusarchi_func5()' }
              ];
              handleActions(actionList);
          }
        ]]>
        </javascript>
      <!-- Info: Converted multiline eval to {'action': 'eval', 'statement': 'Aleksa_Slusarchi_func5()'} and created function Aleksa_Slusarchi_func5 -->
      </Page>

      <Page id="Vi-Shy">
        <javascript>
        <![CDATA[
          function pageLoad() {
              actionList = [
                { action: 'if', condition: 'getVariable("gallerypic")' },
                  { action: "image", file: "Vi Shy/*.jpg" },
                { action: 'else' },
                  { action: "image", file: "vi-shy.jpg" },
                { action: 'endif' },
                { action: 'eval', statement: 'Aleksa_Slusarchi_func5()' }
              ];
              handleActions(actionList);
          }
        ]]>
        </javascript>
      <!-- Info: Converted multiline eval to {'action': 'eval', 'statement': 'Aleksa_Slusarchi_func5()'} and created function Aleksa_Slusarchi_func5 -->
      </Page>

    <!-- ************************************************************************ -->
    <!-- GuideMe Toolkit pages. Last Modified: 2023-11-29 11:56:42                -->
    <!-- ************************************************************************ -->

    <!-- ************************************************************************ -->
    <Page id="Debug">
    <!-- ************************************************************************ -->
    <!--
        This is a page I developed over time to help diagnose and troubleshoot issues in teases.
        Using Guideme's debug page you can jump to this page from any point in the tease.
        This page will remember what page you came from, you can do what you need to do and then
        resume the tease at the page you left from.

    -->
      <Text>
        <p>Something went wrong</p>
      </Text>
      <Button target="DebugResume" sortOrder="1" onclick="exitDebug()">Resume</Button>
      <Button target="Debug" sortOrder="2" onclick="getVars()"  >Refresh</Button>
      <Button target="Debug" sortOrder="5"     if-set="DEBUG" unset="DEBUG">Turn Debug Off</Button>
      <Button target="Debug" sortOrder="5" if-not-set="DEBUG"   set="DEBUG">Turn Debug On</Button>
      <Button target="Debug" sortOrder="7" onclick="setFlags()">Set flags</Button>
      <Button target="Debug" sortOrder="8" onclick="clearFlags()">Clear flags</Button>
      <Button target="start" sortOrder="9">Restart</Button>
  	  <javascript>
  		<![CDATA[
    		function pageLoad() {
          var myName = "Debug: ";
          var caller = scriptVars.get("DebugCaller");
          var flags  = scriptVars.get("debugFlags");
          var name1  = scriptVars.get("_name1_") || "";
          var name2  = scriptVars.get("_name2_") || "";
          var value1 = "";
          var value2 = "";

          if ( name1 != "" ) value1 = getVariable(name1,"");
          if ( name2 != "" ) value2 = getVariable(name2,"");

          // jscriptLog(myName+"Variable name1 is " + getTypeOf(name1) );
          // jscriptLog(myName+"Variable name2 is " + getTypeOf(name2) );
          // jscriptLog(myName+"Variable value1 is " + getTypeOf(value1) );
          // jscriptLog(myName+"Variable value2 is " + getTypeOf(value2) );

          // Always go back to the original calling page
          if ( ! caller || caller == "" || caller == undefined ) {
            // First time here so save the ID of the calling page
            caller = guideSettings.getPrevPage();
            scriptVars.put("DebugCaller",caller);
          }

          if ( ! flags || flags == undefined ) flags = ""

          var pText = "";
          // Generate a form with debugging options

          // Field for entering flags to set/clear
          pText += "<form>\n";
          pText += TextBox("debugFlags", "Enter a list of flags to set or unset below<br/>", flags, 40) + "<br/>then click Set Flags or Clear Flags<br/>";
          pText += "<br/>\n";

          // Add fields for setting the value of variables
          pText += "You can use the fields below to set and display the value of specific variables.<br/>";
          pText += "To see the current value enter the variable name but leave the value field empty, and hit Refresh.<br/><br/>";
          pText += "You can then change the value and hit Refresh (or Resume) to update it.<br/>";
          pText += TextBox("name1", "Set variable ", name1, 10) + TextBox("value1", " to ", value1, 10)+"<br/>\n";
          pText += TextBox("name2", "Set variable ", name2, 10) + TextBox("value2", " to ", value2, 10)+"<br/>\n";

          // Field for what page to go to next
          pText += "<br/><br/>\n";
          pText += TextBox("targetPage", "Resume on page ", caller, 15) + "<br/>\n";

          pText += "</form>\n";

          pText += "getgirl() returned " + getgirl(getVariable("models"));
          overRide.setHtml(pText);
        }
        //----------------------------------------------
        function setFlags() {
          // Set some flags
          var flags = guideSettings.getFormField("debugFlags");
          jscriptLog("setFlags: Got flags " + flags );
          comonFunctions.SetFlags(flags, guide.getFlags());
          scriptVars.remove("debugFlags");
        }
        //----------------------------------------------
        function clearFlags() {
          // Unset flags
          var flags = guideSettings.getFormField("debugFlags");
          jscriptLog("setFlags: Got flags " + flags );
          comonFunctions.UnsetFlags(flags, guide.getFlags());
          scriptVars.remove("debugFlags");
        }
        //----------------------------------------------
        function getVars() {
          // Set/check scriptvars
          var name1  = guideSettings.getFormField("name1");
          var name2  = guideSettings.getFormField("name2");
          var value1 = guideSettings.getFormField("value1");
          var value2 = guideSettings.getFormField("value2");
          var myName = "getVars(): ";
           jscriptLog(myName+"Variable name1 is " + getTypeOf(name1) );
           jscriptLog(myName+"Variable value1 is " + getTypeOf(value1) );
           jscriptLog(myName+"Variable name2 is " + getTypeOf(name2) );
           jscriptLog(myName+"Variable value2 is " + getTypeOf(value2) );

          // If we have a variable name and value update it
          if ( name1 !== undefined && name1 != "" && value1 !== "" ) {
            scriptVars.put(name1,value1);
            jscriptLog(myName+"Updated " + name1 + " to " + value1 + " (" + typeof(value1) + ")" );
          }
          else if ( name1 != "" ) {
            scriptVars.remove(name1);
            jscriptLog(myName+"Removed " + name1 );
          }

          // If we have a variable name and value update it
          if ( name2 !== undefined && name2 != "" && value2 != "" ) {
            scriptVars.put(name2,value2);
            jscriptLog(myName+"Updated " + name2 + " to " + value2 + " (" + typeof(value2) + ")" );
          }
          else if ( name2 != "" ) {
            scriptVars.remove(name2);
            jscriptLog(myName+"Removed " + name2 );
          }
        }
        //----------------------------------------------
        function exitDebug() {
          var caller = scriptVars.get("DebugCaller");
          var temp = guideSettings.getFormField("targetPage");
          if ( temp != undefined && temp != "" && temp != caller) {
            jscriptLog("Redirecting to page " + temp + " instead of original caller (" + caller + ")");
            scriptVars.put("DebugCaller",temp);
          }
          getVars();  // Update scriptVars from the form
          if ( guide.isSet("DEBUG") ) globalButtons.add("DEBUG", "Debug", "bottom", "Debug");
        }
        // -----------------------------------------------------------------------
        // Add a text box for the user to enter values or information
        function TextBox(Name, Caption, Value, Width) {
          vText = Caption + " <input type='text' name=\"" + Name + "\" ";
          vText += "value=\"" + Value + "\" ";
          vText += "size='" + Width + "'";
          vText += " />";
          return vText;
        }

  		]]>
  	  </javascript>
    </Page>

    <!-- ************************************************************************ -->
    <Page id="DebugResume">
    <!-- ************************************************************************ -->
      <Text>
        <p class="text">Something went wrong!</p>
      </Text>
      <Image id="*.jpg" />
  	  <javascript>
  		<![CDATA[
        function pageLoad() {
          // Retrieve the previously saved ID of the caller
          caller = scriptVars.get("DebugCaller");
          overRide.setDelay(caller,  "0",  "",  "hidden",  "",  "",  "");
          scriptVars.remove("DebugCaller");
          scriptVars.remove("name1");
          scriptVars.remove("name2");
          scriptVars.remove("debugFlags");
          scriptVars.remove("targetPage");
        }
  		]]>
  	  </javascript>
    </Page>
    
  </Pages>
</Tease>
