home *** CD-ROM | disk | FTP | other *** search
/ Practice Anatomy Lab / PAL.ISO / pc / PAL.swf / scripts / __Packages / com / argosy / VamMain.as < prev   
Encoding:
Text File  |  2007-03-19  |  22.6 KB  |  518 lines

  1. class com.argosy.VamMain extends com.argosy.ui.baseUI
  2. {
  3.    var content_mc;
  4.    var quizWarning;
  5.    var module_array;
  6.    var welcome_str;
  7.    var tree_menu;
  8.    var breadcrumb_bar;
  9.    var volume_control;
  10.    var mask;
  11.    var xml_loader;
  12.    var background_mc;
  13.    var help_url;
  14.    var credit_url;
  15.    var title_tf;
  16.    var copyright_tf;
  17.    var menu_bar;
  18.    var menu_intv;
  19.    var selected_menu;
  20.    var menu_timeout;
  21.    var title_bar;
  22.    var top_links_tf;
  23.    static var normal_style;
  24.    static var over_style;
  25.    static var selected_style;
  26.    function VamMain()
  27.    {
  28.       super();
  29.    }
  30.    function go_home_helper(flag)
  31.    {
  32.       trace("hover_menu_selection_helper: " + arguments);
  33.       if(flag)
  34.       {
  35.          this.content_mc.isComplete = true;
  36.          this.content_mc.warnSummary = false;
  37.          this.goHome();
  38.       }
  39.    }
  40.    function goHome()
  41.    {
  42.       trace("home");
  43.       if(this.content_mc.isComplete == false)
  44.       {
  45.          this.quizWarning.setContent("Warning","If you exit this activity, all your answers will be lost. Do you still want to exit?<br/><br/>Press \"EXIT\" to stop working on the activity and discard your work.<br/>Press \"CANCEL\" to continue working on this activity.","EXIT","CANCEL",this,"go_home_helper");
  46.       }
  47.       else if(this.content_mc.warnSummary != undefined && this.content_mc.warnSummary == true)
  48.       {
  49.          this.quizWarning.setContent("Warning","If you exit this summary page, all your answers will be lost. Do you still want to exit?<br/><br/>Press \"EXIT\" to discard your answers.<br/>Press \"CANCEL\" to continue reviewing your work.","EXIT","CANCEL",this,"go_home_helper");
  50.       }
  51.       else
  52.       {
  53.          this.content_mc.removeMovieClip();
  54.          this.setMenuSelection(null);
  55.          this.tree_menu.setContent(this.module_array,this.welcome_str);
  56.          this.breadcrumb_bar.clearContent();
  57.          this.setTopLinks("toplevel");
  58.       }
  59.       this.volume_control.closeMenu();
  60.    }
  61.    function hover_menu_selection_helper(evt, flag)
  62.    {
  63.       trace("hover_menu_selection_helper: " + arguments);
  64.       if(flag)
  65.       {
  66.          this.content_mc.isComplete = true;
  67.          this.content_mc.warnSummary = false;
  68.          this.hover_menu_selection(evt);
  69.       }
  70.    }
  71.    function hover_menu_selection(evt)
  72.    {
  73.       if(this.content_mc.isComplete == false)
  74.       {
  75.          this.quizWarning.setContent("Warning","If you exit this activity, all your answers will be lost. Do you still want to exit?<br/><br/>Press \"EXIT\" to stop working on the activity and discard your work.<br/>Press \"CANCEL\" to continue working on this activity.","EXIT","CANCEL",this,"hover_menu_selection_helper",evt);
  76.       }
  77.       else if(this.content_mc.warnSummary != undefined && this.content_mc.warnSummary == true)
  78.       {
  79.          this.quizWarning.setContent("Warning","If you exit this summary page, all your answers will be lost. Do you still want to exit?<br/><br/>Press \"EXIT\" to discard your answers.<br/>Press \"CANCEL\" to continue reviewing your work.","EXIT","CANCEL",this,"hover_menu_selection_helper",evt);
  80.       }
  81.       else
  82.       {
  83.          trace("hover_menu_selection: " + arguments);
  84.          if(evt.target.type == "menu")
  85.          {
  86.             this.content_mc.removeMovieClip();
  87.             this.breadcrumb_bar.setContent(evt.target.pop_menu);
  88.             this.tree_menu.setContent(evt.target.pop_menu.menu_items,evt.target.pop_menu.instructions);
  89.          }
  90.          else if(evt.target.type == "activity")
  91.          {
  92.             this.load_activity(evt.target.activity_type,evt.target.activity_url);
  93.             this.breadcrumb_bar.setContent(evt.target);
  94.             this.tree_menu.clearContent();
  95.          }
  96.          evt.lastOwner.show(false);
  97.          this.setMenuSelection(evt.lastOwner._parent);
  98.          this.setTopLinks("lowerLevel");
  99.       }
  100.    }
  101.    function tree_selection_helper(evt, flag)
  102.    {
  103.       trace("tree_selection_helper: " + arguments);
  104.       if(flag)
  105.       {
  106.          this.content_mc.isComplete = true;
  107.          this.content_mc.warnSummary = false;
  108.          this.tree_selection(evt);
  109.       }
  110.    }
  111.    function tree_selection(evt)
  112.    {
  113.       trace("highlight:" + evt.target.mc_ref.pop_menu.top_parent);
  114.       _global.Xray.trace(evt);
  115.       if(this.content_mc.isComplete == false)
  116.       {
  117.          this.quizWarning.setContent("Warning","If you exit this activity, all your answers will be lost. Do you still want to exit?<br/><br/>Press \"EXIT\" to stop working on the activity and discard your work.<br/>Press \"CANCEL\" to continue working on this activity.","EXIT","CANCEL",this,"tree_selection_helper",evt);
  118.       }
  119.       else if(this.content_mc.warnSummary != undefined && this.content_mc.warnSummary == true)
  120.       {
  121.          this.quizWarning.setContent("Warning","If you exit this summary page, all your answers will be lost. Do you still want to exit?<br/><br/>Press \"EXIT\" to discard your answers.<br/>Press \"CANCEL\" to continue reviewing your work.","EXIT","CANCEL",this,"tree_selection_helper",evt);
  122.       }
  123.       else
  124.       {
  125.          evt.target.mc_ref.pop_menu.top_parent != undefined ? this.setMenuSelection(evt.target.mc_ref.pop_menu.top_parent) : this.setMenuSelection(evt.target.mc_ref.top_parent);
  126.          if(evt.target.type == "menu" || evt.target.type == "topmenu")
  127.          {
  128.             this.content_mc.removeMovieClip();
  129.             this.breadcrumb_bar.setContent(evt.target.mc_ref.pop_menu);
  130.             this.tree_menu.setContent(evt.target.pop_menu.menu_items,evt.target.pop_menu.instructions);
  131.          }
  132.          else if(evt.target.type == "activity")
  133.          {
  134.             this.load_activity(evt.target.activity_type,evt.target.activity_url);
  135.             this.breadcrumb_bar.setContent(evt.target.mc_ref);
  136.             this.tree_menu.clearContent();
  137.          }
  138.          this.setTopLinks("lowerLevel");
  139.       }
  140.       this.volume_control.closeMenu();
  141.    }
  142.    function bread_selection_helper(evt, flag)
  143.    {
  144.       trace("bread_selection_helper: " + arguments);
  145.       if(flag)
  146.       {
  147.          this.content_mc.isComplete = true;
  148.          this.content_mc.warnSummary = false;
  149.          this.bread_selection(evt);
  150.       }
  151.    }
  152.    function bread_selection(evt)
  153.    {
  154.       if(this.content_mc.isComplete == false)
  155.       {
  156.          this.quizWarning.setContent("Warning","If you exit this activity, all your answers will be lost. Do you still want to exit?<br/><br/>Press \"EXIT\" to stop working on the activity and discard your work.<br/>Press \"CANCEL\" to continue working on this activity.","EXIT","CANCEL",this,"bread_selection_helper",evt);
  157.       }
  158.       else if(this.content_mc.warnSummary != undefined && this.content_mc.warnSummary == true)
  159.       {
  160.          this.quizWarning.setContent("Warning","If you exit this summary page, all your answers will be lost. Do you still want to exit?<br/><br/>Press \"EXIT\" to discard your answers.<br/>Press \"CANCEL\" to continue reviewing your work.","EXIT","CANCEL",this,"bread_selection_helper",evt);
  161.       }
  162.       else
  163.       {
  164.          var _loc2_ = evt.target;
  165.          this.content_mc.removeMovieClip();
  166.          this.breadcrumb_bar.setContent(_loc2_);
  167.          this.tree_menu.setContent(_loc2_.menu_items,_loc2_.instructions);
  168.          this.setMenuSelection(evt.target.top_parent);
  169.       }
  170.       this.volume_control.closeMenu();
  171.    }
  172.    function load_activity(type, url)
  173.    {
  174.       trace("load_activity: " + arguments);
  175.       this.content_mc.stop_timer();
  176.       this.content_mc.removeMovieClip();
  177.       if(type == "self_review")
  178.       {
  179.          this.content_mc = this.attachMovie("LabelViewer","content_mc",100,{_x:this.mask._x,_y:this.mask._y,width:this.mask._width,height:this.mask._height});
  180.          this.content_mc.warnSummary = false;
  181.          this.content_mc.loadContent(url);
  182.       }
  183.       else if(type == "self_study")
  184.       {
  185.          this.content_mc = this.attachMovie("QuestionViewer","content_mc",100,{_x:this.mask._x,_y:this.mask._y,width:this.mask._width,height:this.mask._height});
  186.          this.content_mc.warnSummary = false;
  187.          this.content_mc.loadContent(url);
  188.       }
  189.       else if(type == "lab_practical")
  190.       {
  191.          this.content_mc = this.attachMovie("QuestionViewer","content_mc",100,{_x:this.mask._x,_y:this.mask._y,width:this.mask._width,height:this.mask._height});
  192.          this.content_mc.warnSummary = false;
  193.          this.content_mc.loadContent(url);
  194.       }
  195.       this.volume_control.closeMenu();
  196.    }
  197.    function xml_loaded(success)
  198.    {
  199.       if(success && this.xml_loader.status == 0)
  200.       {
  201.          this.background_mc.loadImage(this.xml_loader.firstChild.attributes.background);
  202.          var _loc3_ = 0;
  203.          while(_loc3_ < this.xml_loader.firstChild.childNodes.length)
  204.          {
  205.             var _loc2_ = this.xml_loader.firstChild.childNodes[_loc3_];
  206.             switch(_loc2_.nodeName)
  207.             {
  208.                case "title":
  209.                   this.help_url = _loc2_.attributes.help;
  210.                   this.credit_url = _loc2_.attributes.credit;
  211.                   this.title_tf.htmlText = "<p><title>" + _loc2_.firstChild.nodeValue + "</title></p>";
  212.                   break;
  213.                case "welcome":
  214.                   this.welcome_str = "<p>" + _loc2_.firstChild.nodeValue + "</p>";
  215.                   break;
  216.                case "copyright":
  217.                   this.copyright_tf.htmlText = "<p><copyright>" + _loc2_.firstChild.nodeValue + "</copyright></p>";
  218.                   break;
  219.                case "content":
  220.                   this.buildMenu(_loc2_);
  221.             }
  222.             _loc3_ = _loc3_ + 1;
  223.          }
  224.       }
  225.       else
  226.       {
  227.          trace("xml error: " + this.xml_loader.status);
  228.       }
  229.    }
  230.    function buildMenu(node)
  231.    {
  232.       this.module_array = [];
  233.       var _loc6_ = (Stage.width - 10) / node.childNodes.length;
  234.       var _loc5_ = 0;
  235.       while(_loc5_ < node.childNodes.length)
  236.       {
  237.          var _loc3_ = node.childNodes[_loc5_];
  238.          var _loc7_ = this.menu_bar.getNextHighestDepth();
  239.          var _loc2_ = this.menu_bar.createEmptyMovieClip("menu_" + _loc7_,_loc7_);
  240.          _loc2_.id = _loc3_.attributes.id;
  241.          _loc2_.color = _loc3_.attributes.color;
  242.          _loc2_.image_url = _loc3_.attributes.icon;
  243.          _loc2_.sideimage = _loc3_.attributes.sideimage;
  244.          _loc2_.title = _loc3_.attributes.title;
  245.          _loc2_.type = "topmenu";
  246.          _loc2_.label_tf = _loc2_.createTextField("title",10,0,10,_loc6_,12);
  247.          _loc2_.label_tf.selectable = false;
  248.          _loc2_.label_tf.html = true;
  249.          _loc2_.label_tf.embedFonts = true;
  250.          _loc2_.label_tf.styleSheet = com.argosy.VamMain.normal_style;
  251.          _loc2_.label_tf.htmlText = "<p>" + _loc2_.title + "</p>";
  252.          _loc2_.pop_menu = _loc2_.attachMovie("PopMenu","pop_menu",100);
  253.          _loc2_.pop_menu.addEventListener("selection",this,"hover_menu_selection");
  254.          _loc2_.pop_menu.top_parent = _loc2_;
  255.          _loc2_.pop_menu._y = 35;
  256.          _loc2_.pop_menu.width = _loc6_;
  257.          _loc2_._x = 5 + _loc6_ * _loc5_;
  258.          _loc2_.pop_menu.stage_x = _loc2_._x;
  259.          _loc2_.pop_menu.setContent(_loc3_);
  260.          _loc2_.bg = _loc2_.createEmptyMovieClip("bg",1);
  261.          _loc2_.bg.lineStyle(0,16711680,0);
  262.          _loc2_.bg.beginFill(16711680,0);
  263.          _loc2_.bg.lineTo(_loc6_,0);
  264.          _loc2_.bg.lineTo(_loc6_,35);
  265.          _loc2_.bg.lineTo(0,35);
  266.          _loc2_.bg.lineTo(0,0);
  267.          _loc2_.bg.endFill();
  268.          if(this.module_array.length > 0)
  269.          {
  270.             _loc2_.bg.lineStyle(2,16777215,100,true,"normal","square","miter",2);
  271.             _loc2_.bg.moveTo(0,6);
  272.             _loc2_.bg.lineTo(0,_loc2_.bg._height);
  273.          }
  274.          _loc2_.bg.onRollOver = ascb.util.Proxy.create(this,this.menuOver,_loc2_);
  275.          _loc2_.bg.onRollOut = ascb.util.Proxy.create(this,this.menuOut,_loc2_);
  276.          _loc2_.bg.onPress = ascb.util.Proxy.create(this,this.menuPress,_loc2_);
  277.          _loc2_.bg.onRelease = _loc2_.bg.onReleaseOutside = ascb.util.Proxy.create(this,this.menuRelease,_loc2_);
  278.          _loc2_.activity_text = [];
  279.          var _loc4_ = 0;
  280.          while(_loc4_ < _loc3_.childNodes.length)
  281.          {
  282.             if(_loc3_.childNodes[_loc4_].nodeName == "activityText")
  283.             {
  284.                _loc2_.activity_text[_loc3_.childNodes[_loc4_].attributes.type] = _loc3_.childNodes[_loc4_].firstChild.nodeValue;
  285.             }
  286.             _loc4_ = _loc4_ + 1;
  287.          }
  288.          this.module_array.push(_loc2_);
  289.          _loc5_ = _loc5_ + 1;
  290.       }
  291.       this.layout();
  292.       this.tree_menu.setContent(this.module_array,this.welcome_str);
  293.    }
  294.    function setMenuOver(mc)
  295.    {
  296.       clearInterval(this.menu_intv);
  297.       for(var _loc3_ in this.module_array)
  298.       {
  299.          this.module_array[_loc3_].pop_menu.show(false);
  300.          if(this.module_array[_loc3_] != this.selected_menu)
  301.          {
  302.             this.module_array[_loc3_].label_tf.styleSheet = com.argosy.VamMain.normal_style;
  303.             this.module_array[_loc3_].label_tf.htmlText = "<p>" + this.module_array[_loc3_].title + "</p>";
  304.          }
  305.       }
  306.       if(mc == undefined)
  307.       {
  308.          this.breadcrumb_bar.enableHover();
  309.       }
  310.       else
  311.       {
  312.          this.breadcrumb_bar.disableHover();
  313.       }
  314.       mc.pop_menu.show(true);
  315.       mc.label_tf.styleSheet = com.argosy.VamMain.over_style;
  316.       mc.label_tf.htmlText = "<p><font color=\'#" + mc.color + "\'>" + mc.title + "</font></p>";
  317.       this.selected_menu.label_tf.styleSheet = com.argosy.VamMain.selected_style;
  318.       this.selected_menu.label_tf.htmlText = "<p><font color=\'#" + this.selected_menu.color + "\'>" + this.selected_menu.title + "</font></p>";
  319.    }
  320.    function recursiveHitTest(mc, x, y, flag)
  321.    {
  322.       var _loc3_ = false;
  323.       for(var _loc7_ in mc)
  324.       {
  325.          if(typeof mc[_loc7_] == "movieclip" && mc[_loc7_]._visible)
  326.          {
  327.             if(_loc7_.toLowerCase().indexOf("parent") != -1)
  328.             {
  329.                continue;
  330.             }
  331.             if(this.recursiveHitTest(mc[_loc7_],x,y,flag))
  332.             {
  333.                return true;
  334.             }
  335.             if(mc[_loc7_].hitTest(x,y,flag) && !_loc3_ && _loc7_.toLowerCase().indexOf("bg") != -1)
  336.             {
  337.                _loc3_ = true;
  338.                return true;
  339.             }
  340.          }
  341.       }
  342.       return _loc3_;
  343.    }
  344.    function checkMenuOver(mc)
  345.    {
  346.       var _loc2_ = this.recursiveHitTest(mc,this._xmouse,this._ymouse,true);
  347.       if(!_loc2_)
  348.       {
  349.          clearInterval(this.menu_intv);
  350.          this.setMenuOver(null);
  351.       }
  352.    }
  353.    function checkMenuTimeOut(mc)
  354.    {
  355.       if(mc.hitTest(this._xmouse,this._ymouse,true))
  356.       {
  357.          this.setMenuOver(mc);
  358.       }
  359.       clearInterval(this.menu_timeout);
  360.    }
  361.    function setMenuSelection(mc)
  362.    {
  363.       clearInterval(this.menu_intv);
  364.       for(var _loc2_ in this.module_array)
  365.       {
  366.          this.module_array[_loc2_].pop_menu.show(false);
  367.          this.module_array[_loc2_].label_tf.styleSheet = com.argosy.VamMain.normal_style;
  368.          this.module_array[_loc2_].label_tf.htmlText = "<p>" + this.module_array[_loc2_].title + "</p>";
  369.       }
  370.       mc.label_tf.styleSheet = com.argosy.VamMain.selected_style;
  371.       mc.label_tf.htmlText = "<p><font color=\'#" + mc.color + "\'>" + mc.title + "</font></p>";
  372.       this.selected_menu = mc;
  373.       this.setTopLinks("lowerlevel");
  374.    }
  375.    function menuOver(mc)
  376.    {
  377.       clearInterval(this.menu_timeout);
  378.       this.menu_timeout = setInterval(this,"checkMenuTimeOut",100,mc);
  379.    }
  380.    function menuOut(mc)
  381.    {
  382.       clearInterval(this.menu_intv);
  383.       clearInterval(this.menu_timeout);
  384.       this.menu_intv = setInterval(this,"checkMenuOver",100,mc);
  385.    }
  386.    function menuPress(mc)
  387.    {
  388.       this.volume_control.closeMenu();
  389.    }
  390.    function menuRelease_helper(mc, flag)
  391.    {
  392.       trace("bread_selection_helper: " + arguments);
  393.       if(flag)
  394.       {
  395.          this.content_mc.isComplete = true;
  396.          this.content_mc.warnSummary = false;
  397.          this.menuRelease(mc);
  398.       }
  399.    }
  400.    function menuRelease(mc)
  401.    {
  402.       trace("menuRelease: " + mc + " " + mc.title);
  403.       if(this.content_mc.isComplete == false)
  404.       {
  405.          this.quizWarning.setContent("Warning","If you exit this activity, all your answers will be lost. Do you still want to exit?<br/><br/>Press \"EXIT\" to stop working on the activity and discard your work.<br/>Press \"CANCEL\" to continue working on this activity.","EXIT","CANCEL",this,"menuRelease_helper",mc);
  406.       }
  407.       else if(this.content_mc.warnSummary != undefined && this.content_mc.warnSummary == true)
  408.       {
  409.          this.quizWarning.setContent("Warning","If you exit this summary page, all your answers will be lost. Do you still want to exit?<br/><br/>Press \"EXIT\" to discard your work.<br/>Press \"CANCEL\" to continue reviewing your answers.","EXIT","CANCEL",this,"menuRelease_helper",mc);
  410.       }
  411.       else
  412.       {
  413.          this.content_mc.removeMovieClip();
  414.          this.tree_menu.setContent(mc.pop_menu.menu_items,mc.pop_menu.instructions);
  415.          this.breadcrumb_bar.setContent(mc.pop_menu);
  416.          this.setMenuSelection(mc);
  417.       }
  418.    }
  419.    function init()
  420.    {
  421.       this.xml_loader = new XML();
  422.       this.xml_loader.ignoreWhite = true;
  423.       this.xml_loader.onLoad = ascb.util.Proxy.create(this,this.xml_loaded);
  424.       var _loc4_ = _root.activity_xml == undefined ? "pal.xml" : _root.activity_xml;
  425.       this.xml_loader.load(_loc4_);
  426.       if(com.argosy.VamMain.normal_style == undefined)
  427.       {
  428.          com.argosy.VamMain.normal_style = new TextField.StyleSheet();
  429.          com.argosy.VamMain.normal_style.setStyle("p",{fontFamily:"Frutiger Bold",fontSize:"12",color:"#FFFFFF",textAlign:"center",textDecoration:"none",kerning:"true",letterSpacing:"0"});
  430.          com.argosy.VamMain.normal_style.setStyle("title",{fontFamily:"RotisSemiSerif",fontSize:"18",color:"#000000",textAlign:"left"});
  431.          com.argosy.VamMain.normal_style.setStyle("copyright",{fontFamily:"Frutiger Bold",fontSize:"9",color:"#77787b",textAlign:"center"});
  432.          com.argosy.VamMain.normal_style.setStyle("link",{fontFamily:"Frutiger Bold",fontSize:"14",color:"#000000",textAlign:"right"});
  433.          com.argosy.VamMain.normal_style.setStyle("a:link",{color:"#000000"});
  434.          com.argosy.VamMain.normal_style.setStyle("a:hover",{color:"#77787b"});
  435.          com.argosy.VamMain.over_style = new TextField.StyleSheet();
  436.          com.argosy.VamMain.over_style.setStyle("p",{fontFamily:"Frutiger Bold",fontSize:"12",color:"#438CB8",textAlign:"center",textDecoration:"none",kerning:"true",letterSpacing:"0"});
  437.          com.argosy.VamMain.selected_style = new TextField.StyleSheet();
  438.          com.argosy.VamMain.selected_style.setStyle("p",{fontFamily:"Frutiger Bold",fontSize:"12",color:"#0172A0",textAlign:"center",textDecoration:"none",kerning:"true",letterSpacing:"0"});
  439.       }
  440.       super.init();
  441.    }
  442.    function createChildren()
  443.    {
  444.       this.tree_menu = com.argosy.ui.TreeMenu(this.attachMovie("TreeMenu","tree_menu",3));
  445.       this.tree_menu.addEventListener("selection",this,"tree_selection");
  446.       this.breadcrumb_bar = com.argosy.ui.BreadcrumbMenu(this.attachMovie("BreadcrumbMenu","breadcrumb_bar",4));
  447.       this.breadcrumb_bar.addEventListener("selection",this,"bread_selection");
  448.       this.title_bar = this.createEmptyMovieClip("title_bar",5);
  449.       this.menu_bar = this.createEmptyMovieClip("menu_bar",1000);
  450.       this.title_tf = this.createTextField("title_tf",this.getNextHighestDepth(),this.mask._x + 60,10,this.mask._width,20);
  451.       this.title_tf.selectable = false;
  452.       this.title_tf.html = true;
  453.       this.title_tf.embedFonts = true;
  454.       this.title_tf.styleSheet = com.argosy.VamMain.normal_style;
  455.       this.title_tf.htmlText = "<p><title></title></p>";
  456.       this.copyright_tf = this.createTextField("copyright_tf",this.getNextHighestDepth(),this.mask._x,Stage.height - 30,this.mask._width,20);
  457.       this.copyright_tf.selectable = false;
  458.       this.copyright_tf.html = true;
  459.       this.copyright_tf.embedFonts = true;
  460.       this.copyright_tf.styleSheet = com.argosy.VamMain.normal_style;
  461.       this.copyright_tf.htmlText = "<p><copyright></copyright></p>";
  462.       this.top_links_tf = this.createTextField("top_links_tf",this.getNextHighestDepth(),this.mask._x + this.mask._width,10,1,20);
  463.       this.top_links_tf.autoSize = true;
  464.       this.top_links_tf.selectable = false;
  465.       this.top_links_tf.html = true;
  466.       this.top_links_tf.embedFonts = true;
  467.       this.top_links_tf.styleSheet = com.argosy.VamMain.normal_style;
  468.       this.volume_control = com.argosy.ui.VolumeControl(this.attachMovie("VolumeControl","volume_control",this.getNextHighestDepth()));
  469.       this.quizWarning = this.attachMovie("AlertBox","quizWarning",this.getNextHighestDepth());
  470.       this.setTopLinks("toplevel");
  471.       this.layout();
  472.    }
  473.    function setTopLinks(flag)
  474.    {
  475.       if(flag == "toplevel")
  476.       {
  477.          this.top_links_tf.htmlText = "<p><link>|  <a href=\'asfunction:externalLink,overview.html\'>PAL Overview</a>  |  <a href=\'asfunction:externalLink,credits.html\'>Credits</a>  |  <a href=\'asfunction:externalLink,help.html\'>Help</a></link></p>";
  478.       }
  479.       else
  480.       {
  481.          this.top_links_tf.htmlText = "<p><link>|  <a href=\'asfunction:goHome\'>Home</a>  |  <a href=\'asfunction:externalLink,help.html\'>Help</a></link></p>";
  482.       }
  483.       this.top_links_tf._x = this.mask._x + this.mask._width - this.top_links_tf._width;
  484.       this.volume_control._x = this.top_links_tf._x - 25;
  485.       this.volume_control.closeMenu();
  486.    }
  487.    function externalLink(url)
  488.    {
  489.       this.getURL(url,"_blank");
  490.    }
  491.    function layout()
  492.    {
  493.       var _loc2_ = new flash.geom.Matrix();
  494.       _loc2_.createGradientBox(Stage.width,45,-1.5707963267948966,0,0);
  495.       this.title_bar.lineStyle(1,16711680,0);
  496.       this.title_bar.beginGradientFill("linear",[7369332,2039584],[100,100],[0,255],_loc2_,"pad");
  497.       this.title_bar.moveTo(0,0);
  498.       this.title_bar.lineTo(Stage.width,0);
  499.       this.title_bar.lineTo(Stage.width,35);
  500.       this.title_bar.lineTo(0,35);
  501.       this.title_bar.lineTo(0,0);
  502.       this.title_bar.endFill();
  503.       this.title_bar.lineStyle(1,11185325,100);
  504.       this.title_bar.moveTo(0,35);
  505.       this.title_bar.lineTo(Stage.width,35);
  506.       this.title_bar._y = 45;
  507.       this.menu_bar._y = this.title_bar._y;
  508.       this.breadcrumb_bar._y = this.title_bar._y + this.title_bar._height;
  509.       this.breadcrumb_bar.height = 25;
  510.       this.breadcrumb_bar.width = this.width;
  511.       this.tree_menu._x = 0;
  512.       this.tree_menu._y = this.mask._y;
  513.       this.tree_menu.width = Stage.width;
  514.       this.tree_menu.height = this.mask._height;
  515.       this.volume_control._y = 10;
  516.    }
  517. }
  518.