home *** CD-ROM | disk | FTP | other *** search
/ Computer Shopper 230 / DPCS0407.ISO / Assets / Interface / Main.dxr / Flash Components_1_Centre pane.swf / scripts / __Packages / SoftwarePage.as < prev    next >
Encoding:
Text File  |  2005-05-17  |  22.5 KB  |  568 lines

  1. class SoftwarePage extends mx.core.UIObject
  2. {
  3.    var __title;
  4.    var __column1Title;
  5.    var __column2Title;
  6.    var __description;
  7.    var __column1;
  8.    var __column2;
  9.    var __btnList;
  10.    var __titleRows;
  11.    var __column1Groups;
  12.    var __column2Groups;
  13.    var __btnListener;
  14.    var __columnBackground;
  15.    var dispatchEvent;
  16.    static var symbolName = "SoftwarePage";
  17.    static var symbolOwner = SoftwarePage;
  18.    var className = "SoftwarePage";
  19.    static var version = "0.0.0.1";
  20.    static var __maxPageHeight = 380;
  21.    static var __pageBorder = 5;
  22.    static var __vSpacing = 5;
  23.    static var __hSpacing = 5;
  24.    static var __headerBoxHeight = 23;
  25.    var __nextDepth = 3;
  26.    function SoftwarePage()
  27.    {
  28.       super();
  29.       mx.events.EventDispatcher.initialize(this);
  30.    }
  31.    function set enabled(activeStatus)
  32.    {
  33.       if(activeStatus == true)
  34.       {
  35.          var _loc5_ = new TextFormat();
  36.          _loc5_.color = 0;
  37.          var _loc6_ = "<headline>" + this.__title.htmlText.slice(18,this.__title.htmlText.length - 19) + "</headline>";
  38.          this.__title.setTextFormat(_loc5_);
  39.          this.__title.setNewTextFormat(_loc5_);
  40.          this.__title.htmlText = _loc6_;
  41.          var _loc4_ = this.__column1Title.text.slice("<columnboldwhitedisabled>".length,this.__column1Title.text.length - "</columnboldwhitedisabled>".length);
  42.          this.column1Title = "<columnboldwhite>" + _loc4_ + "</columnboldwhite>";
  43.          _loc4_ = this.__column2Title.text.slice("<columnboldgreydisabled>".length,this.__column2Title.text.length - "</columnboldgreydisabled>".length);
  44.          this.column2Title = "<columnboldgrey>" + _loc4_ + "</columnboldwhite>";
  45.       }
  46.       else
  47.       {
  48.          _loc5_ = new TextFormat();
  49.          _loc5_.color = 8421504;
  50.          _loc6_ = "<headlinedisabled>" + this.__title.htmlText.slice(10,this.__title.htmlText.length - 11) + "</headlinedisabled>";
  51.          this.__title.setTextFormat(_loc5_);
  52.          this.__title.setNewTextFormat(_loc5_);
  53.          this.__title.htmlText = _loc6_;
  54.          _loc4_ = this.__column1Title.text.slice("<columnboldwhite>".length,this.__column1Title.text.length - "</columnboldwhite>".length);
  55.          this.column1Title = "<columnboldwhitedisabled>" + _loc4_ + "</columnboldwhitedisabled>";
  56.          _loc4_ = this.__column2Title.text.slice("<columnboldgrey>".length,this.__column2Title.text.length - "</columnboldgrey>".length);
  57.          this.column2Title = "<columnboldgreydisabled>" + _loc4_ + "</columnboldgreydisabled>";
  58.       }
  59.       this.__description.enabled = this.__column1.enabled = this.__column2.enabled = activeStatus;
  60.       this.__description.label.selectable = this.__column1.label.selectable = this.__column2.label.selectable = false;
  61.       var _loc2_ = 0;
  62.       while(_loc2_ < this.__btnList.length)
  63.       {
  64.          this.__btnList[_loc2_].enabled = activeStatus;
  65.          _loc2_ = _loc2_ + 1;
  66.       }
  67.       if(activeStatus == true)
  68.       {
  69.          this.drawBackground("0x005BAB","0xE5F2FF","0xFFFFFF");
  70.       }
  71.       else
  72.       {
  73.          this.drawBackground("0xCCCCCC","0xDDDDDD","0xFFFFFF");
  74.       }
  75.    }
  76.    function init(Void)
  77.    {
  78.       super.init();
  79.       this.__titleRows = 0;
  80.       this.__column1Groups = this.__column2Groups = 0;
  81.       this.__btnList = new Array();
  82.       this.__btnListener = new Object();
  83.       this.__btnListener.click = function(evtObj)
  84.       {
  85.          if(typeof evtObj.target.target == "string")
  86.          {
  87.             _level0.getURL(evtObj.target.target);
  88.          }
  89.          else
  90.          {
  91.             _level0.gotoStepDialog(_level0.sections.selectedIndex,_level0.entries.selectedIndex,evtObj.target.target);
  92.          }
  93.       };
  94.    }
  95.    function size(Void)
  96.    {
  97.       super.size();
  98.    }
  99.    function doneSetting()
  100.    {
  101.       this.sendMessage("pageReady");
  102.    }
  103.    function set title(newTitle)
  104.    {
  105.       function workingLayout(bodyText, width, targetObject)
  106.       {
  107.          trace("--- SoftwarePage workingLayout received " + bodyText);
  108.          trace("targetObject: " + targetObject);
  109.          var titleFormat = _level0.styleSheetToTextFormat(_global.textStyles.getStyle("headline"));
  110.          targetObject.html = true;
  111.          with(targetObject)
  112.          {
  113.             embedFonts = true;
  114.             setTextFormat(titleFormat);
  115.             setNewTextFormat(titleFormat);
  116.             styleSheet = _global.textStyles;
  117.             border = false;
  118.             selectable = false;
  119.             autoSize = true;
  120.             borderColor = 13421772;
  121.             multiline = true;
  122.             wordWrap = true;
  123.          }
  124.          this.__title.setStyle("styleName","scrollTextAreaStyle");
  125.          var oneRowMetrics = titleFormat.getTextExtent("a",width);
  126.          var twoRowMetrics = titleFormat.getTextExtent("a\na",width);
  127.          var tfhIncrement = twoRowMetrics.textFieldHeight - oneRowMetrics.textFieldHeight;
  128.          var metrics = titleFormat.getTextExtent(bodyText,width);
  129.          var finalHtmlText = "<headline><textformat leading=\'" + myLeading + "\'>" + bodyText + "</textformat></headline>";
  130.          targetObject.htmlText = finalHtmlText;
  131.          var positiveLeading = myLeading >= 0 ? myLeading : - myLeading;
  132.          var calculatedHeight = targetObject._height;
  133.          targetObject.autoSize = false;
  134.          targetObject._height = metrics.textFieldHeight + 1;
  135.          metrics = titleFormat.getTextExtent("Aq",width);
  136.          targetObject.htmlText = "<headline><textformat leading=\'0\'>Aq</textformat></headline>";
  137.          var unleadedTextHeight1 = targetObject.textHeight;
  138.          var unleadedFieldHeight = metrics.textFieldHeight + 1;
  139.          targetObject.htmlText = "<headline><textformat leading=\'-1\'>Aq</textformat></headline>";
  140.          var unleadedTextHeight2 = targetObject.textHeight;
  141.          var numRows = unleadedTextHeight2 - unleadedTextHeight1;
  142.          numRows = numRows >= 0 ? numRows : - numRows;
  143.          trace("numRows: " + numRows);
  144.          trace("unleadedFieldHeight: " + unleadedFieldHeight);
  145.          targetObject.htmlText = "<headline><textformat leading=\'0\'>" + bodyText + "</textformat></headline>";
  146.          var unleadedTextHeight1 = targetObject.textHeight;
  147.          var unleadedFieldHeight = targetObject._height;
  148.          targetObject.htmlText = "<headline><textformat leading=\'-1\'>" + bodyText + "</textformat></headline>";
  149.          var unleadedTextHeight2 = targetObject.textHeight;
  150.          numRows = unleadedTextHeight2 - unleadedTextHeight1;
  151.          numRows = numRows >= 0 ? numRows : - numRows;
  152.          targetObject.htmlText = finalHtmlText;
  153.          trace("--- SoftwarePage setting finalHtmlText: " + finalHtmlText);
  154.          trace("targetObject: " + targetObject);
  155.          trace("__titleRows: " + targetObject._parent.__titleRows);
  156.          targetObject._parent.__titleRows = numRows;
  157.          trace("FINAL VALUE (numRows): " + numRows);
  158.          switch(numRows)
  159.          {
  160.             case 1:
  161.                targetObject._height = unleadedFieldHeight + (numRows - 1) * myLeading;
  162.                break;
  163.             case 2:
  164.                targetObject._height = unleadedFieldHeight + (numRows - 1) * myLeading;
  165.                break;
  166.             case 3:
  167.                targetObject._height = unleadedFieldHeight + (numRows - 1) * myLeading;
  168.                break;
  169.             default:
  170.                targetObject._height = 103;
  171.          }
  172.       }
  173.       trace("--- SoftwarePage.title received: " + newTitle);
  174.       var correctedTitle = _level0.replaceAll(newTitle,"1","l");
  175.       this.createTextField("__title",this.__nextDepth,SoftwarePage.__pageBorder,SoftwarePage.__pageBorder,365,50);
  176.       this.__nextDepth = this.__nextDepth + 1;
  177.       var myLeading = -9;
  178.       var titleFormat = _level0.styleSheetToTextFormat(_global.textStyles.getStyle("headline"));
  179.       trace("correctedTitle: " + correctedTitle);
  180.       workingLayout(correctedTitle,365,this.__title);
  181.       trace("FINAL VALUE (__title._height): " + this.__title._height);
  182.    }
  183.    function set description(newDesc)
  184.    {
  185.       if(this.__description == undefined)
  186.       {
  187.          this.__description = this.createClassObject(mx.controls.TextArea,"description",this.__nextDepth);
  188.          this.__description.editable = false;
  189.          this.__description.label.selectable = false;
  190.          this.__description.wordWrap = true;
  191.          this.__description.borderStyle = "none";
  192.          this.__description.html = true;
  193.          this.__description.embedFonts = true;
  194.          this.__description.styleSheet = _global.textStyles;
  195.          this.__description.setStyle("styleName","scrollTextAreaStyle");
  196.          this.__nextDepth = this.__nextDepth + 1;
  197.       }
  198.       if(this.__description.text != newDesc)
  199.       {
  200.          this.__description.text = "<pagebody>" + newDesc + "</pagebody>";
  201.          this.__description._x = SoftwarePage.__pageBorder;
  202.          this.__description._y = this.__title._y + this.__title._height + 2 * SoftwarePage.__vSpacing - 12;
  203.          var _loc3_ = undefined;
  204.          trace("__titleRows: " + this.__titleRows);
  205.          switch(this.__titleRows)
  206.          {
  207.             case 1:
  208.                trace("ONE ROW TITLE");
  209.                _loc3_ = 155;
  210.                break;
  211.             case 2:
  212.                trace("TWO ROW TITLE");
  213.                _loc3_ = 133;
  214.                break;
  215.             case 3:
  216.                trace("THREE ROW TITLE");
  217.                _loc3_ = 112;
  218.                break;
  219.             default:
  220.                trace("OTHER HEIGHT - DEFAULT TO THREE ROWS");
  221.                _loc3_ = 112;
  222.          }
  223.          this.__description.setSize(365,_loc3_);
  224.       }
  225.       trace("FINAL VALUE (__description._height): " + this.__description._height);
  226.    }
  227.    function set buttons(btns)
  228.    {
  229.       var _loc6_ = btns.length;
  230.       var _loc2_ = 0;
  231.       while(_loc2_ < _loc6_)
  232.       {
  233.          var _loc5_ = "btn" + (_loc2_ + 1);
  234.          var _loc4_ = null;
  235.          _loc4_ = this.attachMovie("Button",_loc5_,this.__nextDepth);
  236.          this.__btnList.push(_loc4_);
  237.          this.__nextDepth = this.__nextDepth + 1;
  238.          this.__btnList[_loc2_].label = btns[_loc2_].label.toUpperCase();
  239.          if(btns[_loc2_].target != undefined)
  240.          {
  241.             this.__btnList[_loc2_].target = btns[_loc2_].target;
  242.          }
  243.          else
  244.          {
  245.             this.__btnList[_loc2_].target = btns[_loc2_].linkNum;
  246.          }
  247.          this.__btnList[_loc2_].embedFonts = true;
  248.          this.__btnList[_loc2_].setStyle("styleName","buttonStyle");
  249.          this.__btnList[_loc2_].addEventListener("click",this.__btnListener);
  250.          _loc2_ = _loc2_ + 1;
  251.       }
  252.       var _loc8_ = (365 - 2 * SoftwarePage.__pageBorder - (_loc6_ - 1) * SoftwarePage.__hSpacing) / _loc6_;
  253.       _loc8_ = _loc8_ <= 125 ? _loc8_ : 125;
  254.       var _loc14_ = _loc6_ * _loc8_;
  255.       var _loc11_ = 365 - _loc14_;
  256.       var _loc15_ = _loc11_ / 2;
  257.       var _loc7_ = _loc15_;
  258.       var _loc10_ = 263;
  259.       var _loc9_ = this.__description._y + this.__description._height;
  260.       var _loc12_ = _loc9_ + this.__btnList[0].__height + SoftwarePage.__vSpacing + SoftwarePage.__vSpacing;
  261.       var _loc13_ = undefined;
  262.       if(_loc12_ >= _loc10_)
  263.       {
  264.          _loc13_ = _loc9_ + Math.floor((_loc10_ - _loc9_ - this.__btnList[0].__height) / 2);
  265.       }
  266.       else
  267.       {
  268.          _loc13_ = _loc9_ + SoftwarePage.__vSpacing;
  269.       }
  270.       _loc2_ = 0;
  271.       while(_loc2_ < _loc6_)
  272.       {
  273.          this.__btnList[_loc2_].move(_loc7_,236 - 2 * SoftwarePage.__vSpacing);
  274.          _loc7_ += _loc8_ + SoftwarePage.__hSpacing;
  275.          _loc2_ = _loc2_ + 1;
  276.       }
  277.    }
  278.    function set column1Groups(numGroups)
  279.    {
  280.       this.__column1Groups = numGroups;
  281.    }
  282.    function set column2Groups(numGroups)
  283.    {
  284.       this.__column2Groups = numGroups;
  285.    }
  286.    function set column1Title(titleText)
  287.    {
  288.       if(this.__column1Title == undefined)
  289.       {
  290.          this.__column1Title = this.createClassObject(mx.controls.TextArea,"footerCol1Title",this.__nextDepth);
  291.          this.__nextDepth = this.__nextDepth + 1;
  292.          this.__column1Title.editable = false;
  293.          this.__column1Title.label.selectable = false;
  294.          this.__column1Title.wordWrap = false;
  295.          this.__column1Title.hScrollPolicy = this.__column1Title.vScrollPolicy = "off";
  296.          this.__column1Title.borderStyle = "none";
  297.          this.__column1Title.html = true;
  298.          this.__column1Title.embedFonts = true;
  299.          this.__column1Title.styleSheet = _global.textStyles;
  300.       }
  301.       if(this.__column1Title.text != titleText)
  302.       {
  303.          this.__column1Title.text = titleText;
  304.          this.__column1Title._x = 2 * SoftwarePage.__pageBorder;
  305.          this.__column1Title._y = 252;
  306.          this.__column1Title.setSize(180,25);
  307.       }
  308.    }
  309.    function set column2Title(titleText)
  310.    {
  311.       if(this.__column2Title == undefined)
  312.       {
  313.          this.__column2Title = this.createClassObject(mx.controls.TextArea,"footerCol1Title",this.__nextDepth);
  314.          this.__nextDepth = this.__nextDepth + 1;
  315.          this.__column2Title.editable = false;
  316.          this.__column2Title.label.selectable = false;
  317.          this.__column2Title.wordWrap = false;
  318.          this.__column2Title.hScrollPolicy = this.__column2Title.vScrollPolicy = "off";
  319.          this.__column2Title.borderStyle = "none";
  320.          this.__column2Title.html = true;
  321.          this.__column2Title.embedFonts = true;
  322.          this.__column2Title.styleSheet = _global.textStyles;
  323.       }
  324.       if(this.__column2Title.text != titleText)
  325.       {
  326.          this.__column2Title.text = titleText;
  327.          this.__column2Title._x = 2 * SoftwarePage.__pageBorder + 180 + SoftwarePage.__hSpacing;
  328.          this.__column2Title._y = 252;
  329.          this.__column2Title.setSize(180,25);
  330.       }
  331.    }
  332.    function set column1(colText)
  333.    {
  334.       if(this.__column1 == undefined)
  335.       {
  336.          this.__column1 = this.createClassObject(mx.controls.TextArea,"footerCol1",this.__nextDepth);
  337.          this.__nextDepth = this.__nextDepth + 1;
  338.          this.__column1.editable = false;
  339.          this.__column1.label.selectable = false;
  340.          this.__column1.wordWrap = true;
  341.          this.__column1.hScrollPolicy = "off";
  342.          this.__column1.vScrollPolicy = "off";
  343.          this.__column1.borderStyle = "none";
  344.          this.__column1.html = true;
  345.          this.__column1.embedFonts = true;
  346.          this.__column1.styleSheet = _global.textStyles;
  347.       }
  348.       if(this.__column1.text != colText)
  349.       {
  350.          var _loc3_ = this.__description.styleSheet._styles.columnbold.getTextExtent(this.removeHTMLTags(colText),180);
  351.          var _loc5_ = this.removeHTMLTags(colText);
  352.          trace(_loc5_);
  353.          trace("  ascent: " + _loc3_.ascent + ", descent: " + _loc3_.descent + ", width: " + _loc3_.width + ", height: " + _loc3_.height + ", textFieldWidth: " + _loc3_.textFieldWidth + ", textFieldHeight: " + _loc3_.textFieldHeight);
  354.          var _loc6_ = 15;
  355.          var _loc7_ = _loc3_.textFieldHeight + 5;
  356.          this.__column1.text = colText;
  357.          this.__column1._x = 2 * SoftwarePage.__pageBorder;
  358.          trace("-------------------");
  359.          trace("__columnBackground._y: " + (this.__column1._y - SoftwarePage.__vSpacing));
  360.          trace("__headerBoxHeight: " + SoftwarePage.__headerBoxHeight);
  361.          trace("__vSpacing: " + SoftwarePage.__vSpacing);
  362.          this.__column1._y = 253 + SoftwarePage.__headerBoxHeight;
  363.          this.__column1.setSize(180,140);
  364.       }
  365.    }
  366.    function set column2(colText)
  367.    {
  368.       if(this.__column2 == undefined)
  369.       {
  370.          this.__column2 = this.createClassObject(mx.controls.TextArea,"footerCol1",this.__nextDepth);
  371.          this.__nextDepth = this.__nextDepth + 1;
  372.          this.__column2.editable = false;
  373.          this.__column2.label.selectable = false;
  374.          this.__column2.wordWrap = true;
  375.          this.__column2.hScrollPolicy = "off";
  376.          this.__column2.vScrollPolicy = "off";
  377.          this.__column2.borderStyle = "none";
  378.          this.__column2.html = true;
  379.          this.__column2.embedFonts = true;
  380.          this.__column2.styleSheet = _global.textStyles;
  381.       }
  382.       if(this.__column2.text != colText)
  383.       {
  384.          var _loc3_ = this.__description.styleSheet._styles.columnbold.getTextExtent(this.removeHTMLTags(colText),170);
  385.          var _loc5_ = this.removeHTMLTags(colText);
  386.          trace(_loc5_);
  387.          trace("  ascent: " + _loc3_.ascent + ", descent: " + _loc3_.descent + ", width: " + _loc3_.width + ", height: " + _loc3_.height + ", textFieldWidth: " + _loc3_.textFieldWidth + ", textFieldHeight: " + _loc3_.textFieldHeight);
  388.          var _loc6_ = 15;
  389.          var _loc7_ = _loc3_.textFieldHeight + 5;
  390.          this.__column2.text = colText;
  391.          this.__column2._x = this.__column1._x + this.__column1.width + SoftwarePage.__hSpacing;
  392.          this.__column2._y = 253 + SoftwarePage.__headerBoxHeight;
  393.          this.__column2.setSize(170,140);
  394.       }
  395.    }
  396.    function countReturns(columnText)
  397.    {
  398.       var _loc2_ = 0;
  399.       var _loc3_ = " ";
  400.       var _loc1_ = columnText.indexOf(" ",0);
  401.       while(_loc1_ != -1)
  402.       {
  403.          _loc2_ = _loc2_ + 1;
  404.          _loc1_ = columnText.indexOf(" ",_loc1_ + _loc3_.length);
  405.       }
  406.       return _loc2_;
  407.    }
  408.    function set columnBackground(showBackground)
  409.    {
  410.       if(showBackground == true)
  411.       {
  412.          this.drawBackground("0x005BAB","0xE5F2FF","0xFFFFFF");
  413.          this.__columnBackground.visible = true;
  414.       }
  415.    }
  416.    function drawBackground(darkCol, lightCol, midtoneCol)
  417.    {
  418.       if(this.__column1 != undefined)
  419.       {
  420.          trace("__column1: " + this.__column1);
  421.          this.__columnBackground = this.createEmptyMovieClip("columnBackground",0);
  422.          if(this.__column2 != undefined)
  423.          {
  424.             var backgroundWidth = 365;
  425.          }
  426.          else
  427.          {
  428.             var backgroundWidth = 365;
  429.          }
  430.          var greaterHeight = this.__column1.height <= this.__column2.height ? this.__column2.height : this.__column1.height;
  431.          var backgroundHeight = 147 + 2 * SoftwarePage.__vSpacing;
  432.          this.__columnBackground._x = SoftwarePage.__pageBorder;
  433.          this.__columnBackground._y = 253;
  434.          with(this.__columnBackground)
  435.          {
  436.             trace("HEADERBOXHEIGHT: " + __headerBoxHeight);
  437.             beginFill(lightCol,100);
  438.             moveTo(__pageBorder,0);
  439.             lineStyle(1,lightCol,100);
  440.             lineTo(backgroundWidth,0);
  441.             lineTo(backgroundWidth,backgroundHeight);
  442.             lineTo(__pageBorder,backgroundHeight);
  443.             lineTo(__pageBorder,0);
  444.             endFill;
  445.             beginFill(darkCol,100);
  446.             lineStyle(1,darkCol,100);
  447.             moveTo(__pageBorder,0);
  448.             lineTo(backgroundWidth,0);
  449.             lineTo(backgroundWidth,20);
  450.             lineTo(__pageBorder,20);
  451.             lineTo(__pageBorder,0);
  452.             endFill;
  453.          }
  454.          trace("__column2Groups: " + this.__column2Groups);
  455.          trace(this.__column1);
  456.          if(this.__column2Groups >= 1 && this.__column2Groups != undefined)
  457.          {
  458.             trace("DRAWING WHITE HEADER FOR COLUMN2");
  459.             with(this.__columnBackground)
  460.             {
  461.                beginFill(midtoneCol,100);
  462.                lineStyle(1,darkCol,100);
  463.                moveTo(backgroundWidth / 2,0);
  464.                lineTo(backgroundWidth,0);
  465.                lineTo(backgroundWidth,20);
  466.                lineTo(backgroundWidth / 2,20);
  467.                lineTo(backgroundWidth / 2,0);
  468.                endFill;
  469.                beginFill(darkCol,0);
  470.                lineStyle(1,darkCol,20);
  471.                moveTo(0,20);
  472.                lineTo(0,backgroundHeight);
  473.                lineTo(backgroundWidth,backgroundHeight);
  474.                lineTo(backgroundWidth,20);
  475.                moveTo(backgroundWidth / 2,20);
  476.                lineTo(backgroundWidth / 2,backgroundHeight);
  477.             }
  478.          }
  479.          else
  480.          {
  481.             trace("RESIZING COLUMN1 AND TITLE");
  482.             this.__column1.setSize(360,this.__column1.height);
  483.             this.__column1Title.setSize(360);
  484.             with(this.__columnBackground)
  485.             {
  486.                beginFill(darkCol,0);
  487.                lineStyle(1,darkCol,20);
  488.                moveTo(0,20);
  489.                lineTo(0,backgroundHeight);
  490.                lineTo(backgroundWidth,backgroundHeight);
  491.                lineTo(backgroundWidth,20);
  492.             }
  493.          }
  494.       }
  495.    }
  496.    function removeHTMLTags(htmlText)
  497.    {
  498.       var _loc6_ = function(txt, index)
  499.       {
  500.          return txt.indexOf("<",index);
  501.       };
  502.       var _loc8_ = function(txt, index)
  503.       {
  504.          return txt.indexOf(">",index);
  505.       };
  506.       var _loc2_ = new Array();
  507.       var _loc7_ = 0;
  508.       var _loc9_ = undefined;
  509.       var _loc10_ = undefined;
  510.       while(_loc7_ < htmlText.length)
  511.       {
  512.          _loc9_ = _loc6_(htmlText,_loc7_);
  513.          if(_loc9_ == -1)
  514.          {
  515.             break;
  516.          }
  517.          _loc10_ = _loc8_(htmlText,_loc9_);
  518.          var _loc3_ = _loc6_(htmlText,_loc10_);
  519.          while(_loc3_ == _loc10_ + 1)
  520.          {
  521.             _loc10_ = _loc8_(htmlText,_loc3_);
  522.             _loc3_ = _loc6_(htmlText,_loc10_);
  523.          }
  524.          _loc2_.push({start:_loc9_,end:_loc10_});
  525.          _loc7_ = _loc10_ + 1;
  526.       }
  527.       var _loc5_ = 0;
  528.       while(_loc5_ < _loc2_.length)
  529.       {
  530.          _loc9_ = _loc2_[_loc5_].start;
  531.          var _loc11_ = htmlText.charAt(_loc2_[_loc5_].start);
  532.          _loc10_ = _loc2_[_loc5_].end;
  533.          var _loc12_ = htmlText.charAt(_loc2_[_loc5_].end);
  534.          var _loc16_ = htmlText.substring(_loc9_ + 1,_loc10_);
  535.          _loc5_ = _loc5_ + 1;
  536.       }
  537.       if(_loc2_.length != 0)
  538.       {
  539.          var _loc18_ = "";
  540.          if(_loc2_[0].start > 0)
  541.          {
  542.             _loc18_ += htmlText.substring(0,_loc2_[0].start);
  543.          }
  544.          var _loc4_ = 0;
  545.          while(_loc4_ < _loc2_.length - 1)
  546.          {
  547.             var _loc13_ = _loc2_[_loc4_].end + 1;
  548.             var _loc15_ = _loc2_[_loc4_ + 1].start;
  549.             _loc18_ += htmlText.substring(_loc2_[_loc4_].end + 1,_loc2_[_loc4_ + 1].start);
  550.             _loc4_ = _loc4_ + 1;
  551.          }
  552.          if(_loc2_[_loc2_.length - 1].end < htmlText.length - 1)
  553.          {
  554.             _loc18_ += htmlText.substring(_loc2_[_loc2_.length - 1].end + 1);
  555.          }
  556.          return _loc18_;
  557.       }
  558.       return htmlText;
  559.    }
  560.    function sendMessage(p_msgtxt)
  561.    {
  562.       var _loc2_ = {target:this,type:"pageReady"};
  563.       _loc2_.msgtxt = p_msgtxt;
  564.       _loc2_.pageType = "SoftwarePage";
  565.       this.dispatchEvent(_loc2_);
  566.    }
  567. }
  568.