var MAIN_WINDOW = window;
var CONTENT_WIN = window;
var FLASH_CONTENT_URL = "content.htm";
var FLASH_PAGE_TYPE = 0;
var HTML_PAGE_TYPE = 1;

var NULL_AUDIO_TYPE = new AudioType(-1,"",false);
var FLASH_AUDIO_TYPE = new AudioType(0,"swf",false);
var WMA_AUDIO_TYPE = new AudioType(1,"wma",false);
var WMA_STREAM_AUDIO_TYPE = new AudioType(2,"wma",true);

function AudioType(value,ext,streaming) {
  this.value = value;
  this.ext = ext;
  this.streaming = streaming;
}

function loadKlo()  {
  if (!cwsObj.developmentMode)  {
    window.onerror = handleError;
  }
  cwsObj.contentFrameObj = contentFrame;
  cwsObj.kloFrameObj = kloFrame;
  if ((cwsObj.useFileDataInterface) && ((cwsObj.useFlashDataStorage) || (cwsObj.useAccessDataStorage)))  {
    cwsObj.dataFrameObj = dataFrame;
  }
  var klo = CwsUtil.getUrlValue("klo");
  var displayType = CwsUtil.getUrlValue("displayType");
  var pageNum = CwsUtil.getUrlValue("pageNum");
  var lcmsReviewMode = CwsUtil.getUrlValue("lcmsReviewMode");
  var devMode = CwsUtil.getUrlValue("devMode");

  if (window.location.href.indexOf("https://") > -1) {
    cwsObj.ssl = true;
    cwsObj.urlPrefix = "https://";
  }
  if (klo == "")  {
    kloNum = -1;
  }
  else  {
    kloNum = parseInt(klo,10);
  }
  if ((!isNaN(displayType)) && (displayType != "")) {
    if (displayType > -1) {
      if (displayType <= cwsObj.maxDisplayTypeNum)  {
        cwsObj.selectDisplayType = false;
        cwsObj.defaultDt = displayType;
        if ((!isNaN(pageNum)) && (pageNum != "")) {
          cwsObj.startKloPageNum = 0;
          if (pageNum > 0)  {
            cwsObj.startKloPageNum = pageNum;
          }
        }
      }
    }
  }
  cwsObj.lcmsReviewMode = false;
  if (lcmsReviewMode == "true")  {
    cwsObj.lcmsReviewMode = true;
    cwsObj.browse = true;
    cwsObj.runInNewWindow = true;
    if (kloNum > -1)  {
      while ((kloNum == cwsObj.menuKloNum) && (cwsObj.skipMenu))  {
        kloNum ++;
      }
    }
  }
  if (devMode == "true")  {
    cwsObj.developmentMode = true;
    cwsObj.browse = true;
    cwsObj.runInNewWindow = true;
    if (kloNum > -1)  {
      while ((kloNum == cwsObj.menuKloNum) && (cwsObj.skipMenu))  {
        kloNum ++;
      }
    }
  }
  if (kloNum < cwsObj.kloIds.length) {
    cwsObj.initializeCws(kloNum);
  }
  else  {
    alert("KLO not found.");
  }
}

function lcms_goto_page(pageNum)  {
  var kloObj = cwsObj.getCurrentKloObj();
  kloObj.gotoPageNum(pageNum);
}

function lcms_switch_display_type(displayTypeIndex) {
  var kloObj = cwsObj.getCurrentKloObj();
  kloObj.setDisplayTypeByUser(displayTypeIndex);
}

function lcms_exit()  {
  cwsObj.lcmsReviewMode = false;
  var kloObj = cwsObj.getCurrentKloObj();
  kloObj.exitKlo();
}

function Cws(courseId,kloIds)  {
  this.kloIds = kloIds;
  this.description = "";
  this.kloDescriptions = new Array();
  this.maxSubKloNum = 0;
  this.currentKloNum = 0;
  this.defaultLang = "en";
  this.contentFrameObj = null;
  this.kloFrameObj = null;
  this.dataFrameObj = null;
  this.runInNewWindow = true;
  this.browse = false;
  this.autoRegistration = false;
  this.autoLogin = false;
  this.maxDisplayTypeNum = 1;
  this.dataExpireDays = 90;
  this.lang = this.defaultLang;
  this.rootPath = CwsUtil.pathChecker(CwsUtil.getUrlPath(window.location.href));
  this.imagePath = this.rootPath + "images/";
  this.width = 780;
  this.height = 540;
  this.menuKloNum = -1;
  this.user = new User(this);
  this.courseId = courseId;
  this.session = new Session(this);
  this.autoComplete = true;
  this.askMode = false;
  this.modeDisplayType = null;
  this.cdCompletionDisplayType = null;
  this.saveFurthestLocation = false;
  this.askBookmark = true;
  this.selectDisplayType = false;
  this.defaultDt = -1;
  this.startKloPageNum = 0;
  this.kloPrerequisites = false;
  this.askCDCompletion = false;
  this.singleContentSwf = "";
  this.autoFlashNext = true;
  this.exitOnNext = true;
  this.lcmsReview = false;
  this.lcmsReviewMode = false;
  this.lcmsReviewPath = "";
  this.lcmsReviewPage = "";
  this.lcmsReviewFinishPage = "";
  this.lcmsReviewExitPage = "";
  this.lcmsDisplayType = 0;
  this.lcmsHost = "";
  this.useFileDataInterface = false;
  this.useSCORMLessonMode = false;
  this.ssl = false;
  this.urlPrefix = "http://";
  this.useVolumeControl = false;
  this.masterVolume = null;
  this.developmentMode = false;
  this.childWindows = new Array();
  this.audioServers = new Array();
  this.flashMediaPlayerMenu = false;
  this.flashMediaAutoStart = false;
  this.useBookmark = true;
  this.useFlashAudioShell = false;
  this.useFlashAudioTimer = false;
  this.confirmExitMethod = "";
  this.pageLoadedMethod = "";
  this.dataEncUtilCode = "";
  this.kloLaunchFile = "start.htm";
  this.contentScroll = false;
  this.useFlashDataStorage = true;
  this.useAccessDataStorage = false;
  this.fsCommand = false;
  this.includeAllParamsInFlashVars = false;
  this.kloOnNext = false;
  this.gotoFirstPageOnComplete = true;
  this.clientName = "";
  this.useDefaultDisplayType = true;
  this.displayTypeIndex = -1;
  this.skipMenu = false;
  this.flashPlayerVersion = "7,0,0,0";
  this.runKloAsSco = false;
  this.qaMode = false;
  this.audioEnabled = true;
  this.reuseFlashMediaPlayer = false;
  this.cacheFlashMedia = false;
  this.flashMediaShell = this.rootPath + "data/mediaPlayer.swf";
  this.useFlashMediaShell = false;
  this.dataEncObj = null;
  this.monitorCaptionsWindow = false;
  this.useNavDelay = false;
  this.navDelayTimerInterval = 250;
  this.contentWindowTop = "";
  this.contentWindowLeft = "";
  this.useFlashCaptions = false;
  this.mediaUserInterfaceName = "media";
  this.usePopupBookmark = false;
  this.getScormApiFromTop = false;

  /*
  0 = initializing
  1 = running
  2 = finished
  3 = error
  4 = unloading
  */
  var sessionState = 0;

  this.childWindows["captions"] = new BrowserWindow();
  this.childWindows["captions"].name = "CAPTIONS_WINDOW";
  this.childWindows["captions"].setScroll(true);
  this.childWindows["captions"].setResizable(true);
  this.childWindows["captions"].setTop(0);
  this.childWindows["captions"].setLeft(0);

  this.childWindows["glossary"] = new BrowserWindow();
  this.childWindows["glossary"].name = "GLOSSARY_WINDOW";
  this.childWindows["glossary"].setScroll(true);
  this.childWindows["glossary"].setResizable(true);

  this.childWindows["refs"] = new BrowserWindow();
  this.childWindows["refs"].name = "REFS_WINDOW";
  this.childWindows["refs"].setScroll(true);
  this.childWindows["refs"].setResizable(true);

  this.childWindows["lcmsReview"] = new BrowserWindow();
  this.childWindows["lcmsReview"].name = "LCMS_REVIEW_WINDOW";
  this.childWindows["lcmsReview"].setScroll(true);
  this.childWindows["lcmsReview"].setResizable(true);
  this.childWindows["lcmsReview"].setWidth(990);
  this.childWindows["lcmsReview"].setHeight(670);
  this.childWindows["lcmsReview"].closeOnExit = false;

  this.childWindows["dev"] = new BrowserWindow();
  this.childWindows["dev"].name = "DEV_WINDOW";
  this.childWindows["dev"].setScroll(true);
  this.childWindows["dev"].setResizable(true);
  this.childWindows["dev"].setWidth(600);
  this.childWindows["dev"].setHeight(400);
  //this.childWindows["dev"].closeOnExit = false;

  this.childWindows["popup"] = new BrowserWindow();
  this.childWindows["popup"].name = "POPUP_WINDOW";

  this.childWindows["map"] = new BrowserWindow();
  this.childWindows["map"].name = "MAP_WINDOW";
  this.childWindows["map"].setScroll(true);
  this.childWindows["map"].setResizable(true);

  this.childWindows["search"] = new BrowserWindow();
  this.childWindows["search"].name = "SEARCH_WINDOW";
  this.childWindows["search"].setScroll(true);
  this.childWindows["search"].setResizable(true);

  this.childWindows["certificate"] = new BrowserWindow();
  this.childWindows["certificate"].name = "CERTIFICATE_WINDOW";
  this.childWindows["certificate"].setMenuBar(true);
  this.childWindows["certificate"].setScroll(false);
  this.childWindows["certificate"].setResizable(false);

  this.childWindows["help"] = new BrowserWindow();
  this.childWindows["help"].name = "HELP_WINDOW";
  this.childWindows["help"].setScroll(false);
  this.childWindows["help"].setResizable(true);
  this.childWindows["help"].setWidth(780);
  this.childWindows["help"].setHeight(540);

  this.contentWinObj = null;

  if (navigator.userAgent.indexOf("Windows") != -1) {
    if (window.ActiveXObject && (navigator.userAgent.indexOf("MSIE")!= -1) && (navigator.userAgent.indexOf("Windows") != -1)) {
      this.fsCommand = true;
    }
  }

  this.initializeCws = function(kloNum) {
    this.setSessionState(0);

    if (cwsObj.runInNewWindow)  {
      this.contentWinObj = new BrowserWindow();
    }
    else  {
      this.contentWinObj = new BrowserFrame();
      this.contentWinObj.win = this.contentFrameObj;
    }
    this.contentWinObj.name = "CONTENT_WINDOW";

    if ((this.useFileDataInterface) && (this.useFlashDataStorage))  {
      this.flashDataPlayer = new FlashMovie(this.rootPath + "data/fileData.swf");
      this.flashDataPlayer.id = "flashDataPlayer";
      this.flashDataPlayer.bgColor = "#FFFFFF";
      this.flashDataPlayer.width = "1";
      this.flashDataPlayer.height = "1";
      this.flashDataPlayer.params = "fsCommand=" + this.fsCommand;
      this.flashDataPlayer.urlPrefix = this.urlPrefix;
      this.flashDataPlayer.menu = false;
      this.flashDataPlayer.autoStart = true;
      this.dataFrameObj.document.write("<HTML><head><SCRIPT FOR=\"flashDataPlayer\" EVENT=\"FSCommand(cmd, param)\" LANGUAGE=\"javascript\"> parent.window.cwsObj.session.handleFlashData(param);</SCRIPT></head><body>" + this.flashDataPlayer.getHtml() + "</body></HTML>");
      this.flashDataPlayer.obj = eval("this.dataFrameObj." + CwsUtil.getHtmlObjText(this.flashDataPlayer.id));
    }
    else  {
      this.initializeSession();
    }
  }
  this.handleFlashDataPlayerReady = function() {
    this.flashDataPlayer.obj.SetVariable("initialized","true");
    this.initializeSession();
  }
  this.initializeSession = function()  {
    this.dataEncObj = new DataEncUtil(this.courseId,this.dataEncUtilCode);
    this.currentKloNum = kloNum;
    if (this.askCDCompletion) {
      this.cdCompletionDisplayType.loadUserInterface(this.cdCompletionDisplayType.userInterface);
      this.contentFrameObj.location.href = this.rootPath + "data/" + this.lang + "/askcdcompletion.htm";
    }
    else  {
      if (this.askMode) {
        this.modeDisplayType.loadUserInterface(this.modeDisplayType.userInterface);
        this.contentFrameObj.location.href = this.rootPath + "data/" + this.lang + "/mode.htm";
      }
      else  {
        this.session.initialize();
      }
    }
  }
  this.finished = function()  {
    this.closeChildWindows();
    this.setSessionState(4);
    if (this.lcmsReviewMode)  {
      var kloObj = this.getKloObj();
      if (kloObj != null) {
        var url = this.lcmsReviewPath + this.lcmsReviewFinishPage + "&displayTypeIndex=" + this.lcmsDisplayType;
        kloObj.openLcmsReview(url);
      }
    }
    this.session.finished();
  }
  this.setCdCompletionMode = function(doCdCompletion) {
    if (doCdCompletion) {
      if (this.session.intializeCdCompletion()) {
        this.contentFrameObj.location.href = this.rootPath + "data/" + this.lang + "/cdcompletion.htm";
      }
    }
    else  {
      this.askCDCompletion = false;
      this.initializeCws(this.currentKloNum);
    }
  }
  this.setMode = function(mode) {
    if (mode == "browse") {
      this.browse = true;
    }
    else  {
      this.browse = false;
    }
    this.askMode = false;
    this.initializeCws(this.currentKloNum);
  }
  this.getDefaultKloNum = function() {
    if (this.kloIds.length > 0)  {
      if (this.menuKloNum > -1) {
        return this.menuKloNum;
      }
      if (this.session.initialized) {
        if (!this.session.getCourseComplete()) {
          return this.user.kloNum;
        }
        else  {
          this.gotoFirstPageOnComplete = true;
        }
      }
      return 0;
    }
    return this.kloIds.length;
  }
  this.setSessionState = function(state)  {
    sessionState = state;
    if (state == 0) {
      //if (this.runInNewWindow)  {
        this.contentFrameObj.location.href = this.rootPath + "data/" + this.lang + "/loading.htm";
      //}
    }
    if (state == 1) {
      if (this.runInNewWindow)  {
        this.contentFrameObj.location.href = this.rootPath + "data/" + this.lang + "/active.htm";
      }
    }
    if (state == 2) {
      this.contentFrameObj.location.href = this.rootPath + "data/" + this.lang + "/finished.htm";
    }
    if (state == 3) {
      this.contentFrameObj.location.href = this.rootPath + "data/" + this.lang + "/error.htm";
    }
    if (state == 4) {
      this.contentFrameObj.location.href = this.rootPath + "data/" + this.lang + "/exiting.htm";
    }
    if (state == 5) {
      this.getCwsWin().location.href = this.lcmsReviewPath + this.lcmsReviewExitPage;
    }
  }
  this.getCurrentKloObj = function()  {
    return this.getKloObj(this.currentKloNum);
  }
  this.getKloObj = function(kloNum) {
    if (this.kloFrameObj && this.kloFrameObj.kloObj != null) {
      return this.kloFrameObj.kloObj;
    }
    return null;
  }
  this.getCurrentKloContentWin = function() {
    var kloObj = this.getKloObj(this.currentKloNum);
    if (kloObj != null) {
      return kloObj.contentWinObj.win;
    }
    return null;
  }
  this.launchKlo = function(kloNum) {
    if (kloNum == -1) {
      kloNum = this.getDefaultKloNum();
    }
    this.closeChildWindows();
    if (this.getCourseCompleted())  {
      this.session.setCourseComplete();
    }
    if (kloNum < this.kloIds.length)  {
      if (((this.kloPrerequisites) && ((kloNum == this.menuKloNum) || (this.getKloStatus(kloNum-1) == "c") || (this.getKloStatus(kloNum-1) == "p") || (kloNum == 0))) || (!this.kloPrerequisites) || (this.browse)) {
        this.setSessionState(0);
        kloId = this.kloIds[kloNum];
        url = this.rootPath + kloId + "/" + this.kloLaunchFile;
        this.kloFrameObj.location.href = url;
      }
      else  {
        var win = this.getCurrentKloContentWin();
        if (win == null)  {
          win = this.getCwsWin();
        }
        win.alert("You must complete the lessons in the order they are presented.");
      }
    }
    else  {
      this.setSessionState(3);
    }
  }
  this.getKloLocation = function(dt,kloNum) {
    if ((!this.browse) && (!isNaN(kloNum)) && (!isNaN(dt)) && (!this.getCurrentKloObj().isAssessment) && (((this.getKloStatus(kloNum) != "c") && (this.getKloStatus(kloNum) != "f") && (this.getKloStatus(kloNum) != "p")) || (kloNum == this.menuKloNum) || (!this.gotoFirstPageOnComplete))) {
      var location = this.user.kloLocation[dt][kloNum];
      if (location == 0)  {
        location = 1;
      }
      return location;
    }
    else  {
      return 1;
    }
  }
  this.setKloLocation = function(dt,kloNum,location) {
    if ((!this.browse) && (!isNaN(kloNum)) && (!isNaN(dt)) && (!isNaN(location))) {
      if (((this.saveFurthestLocation) && (this.getKloLocation(dt,kloNum) < location)) || (!this.saveFurthestLocation)) {
        this.user.kloLocation[dt][kloNum] = location;
      }
    }
  }
  this.getKloStatus = function(kloNum)  {
    if (!this.browse) {
      if (!isNaN(kloNum)) {
        return this.user.kloStatus[kloNum];
      }
      return "n";
    }
    return "c";
  }
  this.setKloStatus = function(kloNum,status)  {
    if ((!this.browse) && (!isNaN(kloNum))) {
      this.user.kloStatus[kloNum] = status;
      if ((this.runKloAsSco) && ((status == "c") || (status == "p"))) {
        this.session.setCourseComplete();
      }
    }
  }
  this.getCourseSuspendData = function()  {
    return this.user.courseSuspendData;
  }
  this.setCourseSuspendData = function(data)  {
    this.user.courseSuspendData = data;
  }
  this.getKloSuspendData = function(dt,kloNum)  {
    if ((!isNaN(kloNum)) && (!isNaN(dt))) {
      return this.user.kloSuspendData[dt][kloNum];
    }
    return "";
  }
  this.setKloSuspendData = function(dt,kloNum,data) {
    if ((!isNaN(kloNum)) && (!isNaN(dt))) {
      this.user.kloSuspendData[dt][kloNum] = data;
    }
  }
  this.getSubKloStatus = function(displayType,kloNum,subKloNum) {
    if (!this.browse) {
      if ((!isNaN(displayType)) && (!isNaN(kloNum)) && (!isNaN(subKloNum))) {
        return this.user.kloSubStatus[displayType][kloNum][subKloNum];
      }
      return "n";
    }
    return "c";
  }
  this.setSubKloStatus = function(displayType,kloNum,subKloNum,status)  {
    if ((!this.browse) && (!isNaN(displayType)) && (!isNaN(kloNum)) && (!isNaN(subKloNum))) {
      this.user.kloSubStatus[displayType][kloNum][subKloNum] = status;
    }
  }
  this.getSubKloLocation = function(displayType,kloNum,subKloNum) {
    if ((!this.browse) && (!isNaN(displayType)) && (!isNaN(kloNum)) && (!isNaN(subKloNum))) {
        return this.user.kloSubLocation[displayType][kloNum][subKloNum];
    }
    return 1;
  }
  this.setSubKloLocation = function(displayType,kloNum,subKloNum,location)  {
    if ((!this.browse) && (!isNaN(displayType)) && (!isNaN(kloNum)) && (!isNaN(subKloNum)) && (!isNaN(location))) {
      this.user.kloSubLocation[displayType][kloNum][subKloNum] = location;
    }
  }
  this.getSubKloStatusList = function(displayType,kloNum) {
    if (!this.browse) {
      if ((!isNaN(displayType)) && (!isNaN(kloNum))) {
        return this.user.getSubKloStatusListByKlo(displayType,kloNum);
      }
      else  {
        return this.user.generateDefaultSubList("n");
      }
    }
    else  {
      return this.user.generateDefaultSubList("c");
    }
  }
  this.getSubKloLocationList = function(displayType,kloNum) {
    if ((!this.browse) && (!isNaN(displayType)) && (!isNaN(kloNum))) {
        return this.user.getSubKloLocationListByKlo(displayType,kloNum);
    }
    else  {
      return this.user.generateDefaultSubList(1);
    }
  }
  this.setCourseScore = function(score) {
    if ((!this.browse) && (!isNaN(score))) {
      if (score > this.user.courseScore)  {
        this.user.courseScore = score;
      }
    }
  }
  this.getCourseScore = function()  {
    if (!this.browse) {
      return this.user.courseScore;
    }
    return 0;
  }
  this.setCourseStatus = function(status) {
    if ((this.user.courseStatus == "incomplete") || (this.user.courseStatus == "failed") || (this.user.courseStatus == "not attempted"))  {
      this.user.courseStatus = status;
    }
  }
  this.getCourseStatus = function() {
    if (isValidFunction(this.user)) {
      return this.user.courseStatus;
    }
  }
  this.getCourseCompleted = function() {
    for (i=0;i<this.kloIds.length;i++)  {
      if ((this.user.kloStatus[i] != "c") && (this.user.kloStatus[i] != "p")) {
        return false
      }
    }
    return true;
  }
  this.showCertificate = function() {
    alert("You completed this course!");
  }
  this.getBookmarkCode = function(displayType) {
    if (!this.browse) {
      var pKloNum = this.getCurrentKloNum();
      var bookmark = this.dataEncObj.generateBookmark(pKloNum,this.getKloLocation(displayType,pKloNum),this.session.getTotalTime());
      return this.dataEncObj.generateBookmarkCode(this.user.userName,bookmark);
    }
    return "";
  }
  this.setBookmarkCode = function(bookmarkCode,pDisplayType,returnKloNum) {
    if (!this.browse) {
      var bookmark = this.dataEncObj.decodeBookmarkCode(this.user.userName,bookmarkCode) + "";
      if (bookmark != "") {
        pKloNum = parseInt(bookmark.substring(0,2),10);
        pPageNum = parseInt(bookmark.substring(2,4),10);
        pTime = parseInt(bookmark.substring(4,bookmarkCode.length),10);
        for (i=0;i<pKloNum;i++)  {
          this.user.kloStatus[i] = "c";
          this.user.kloLocation[pDisplayType][i] = "1";
        }
        for (i=pKloNum;i<this.kloIds.length;i++)  {
          this.user.kloStatus[i] = "n";
          this.user.kloLocation[pDisplayType][i] = "0";
        }
        if (pPageNum > 0) {
          this.user.kloStatus[pKloNum] = "i";
          this.user.kloLocation[pDisplayType][pKloNum] = pPageNum;
        }
        this.user.sessionTime = pTime;
        this.launchKlo(returnKloNum);
      }
      else  {
        var win = this.getCurrentKloContentWin();
        if (win == null)  {
          win = this.getCwsWin();
        }
        win.alert("Unable to decode bookmark code. Please verify the code and try again.");
      }
    }
  }
  this.getCompletionCode = function() {
    if (!this.browse) {
      return this.dataEncObj.generateCompletionCode(this.user.userName,this.user.courseScore,this.session.getTotalTime());
    }
    return "";
  }
  this.submitCompletionCode = function(form)  {
    pUserName = form.userName.value;
    pCompletionCode = form.completionCode.value;
    pData = this.decodeCompletionCode(pUserName,pCompletionCode);
    if (pData > -1) {
      alert("Completion Code Valid.");
      this.setSessionState(4);
      pData = pData + "";
      this.user.courseScore = parseInt(pData.substring(1,4),10);
      this.user.sessionTime = parseInt(pData.substring(4,pData.length),10);
      this.session.setCourseComplete();
      var kObj = this.getCurrentKloObj();
      kObj.exitKlo();
    }
    else  {
      alert("The completion code you entered is invalid.\nPlease try again making sure you\nare using the correct Username.");
      form.userName.value = "";
      form.completionCode.value = "";
      form.userName.focus();
    }
  }
  this.decodeCompletionCode = function(userName,completionCode)  {
    return this.dataEncObj.decodeCompletionCode(userName,completionCode);
  }
  this.getCurrentKloNum = function()  {
    if (!this.browse) {
      for (i=0;i<this.kloIds.length;i++) {
        if (i != this.menuKloNum) {
          if ((this.getKloStatus(i) != "c" ) && (this.getKloStatus(i) != "p" )) {
            return i;
          }
        }
      }
      return this.kloIds.length;
    }
    return 0;
  }
  this.getCwsWin = function() {
    return MAIN_WINDOW;
  }
  this.closeChildWindows = function() {
    for (childWindow in this.childWindows)  {
      if (this.childWindows[childWindow].closeOnExit)  {
        this.childWindows[childWindow].closeWin();
      }
    }
  }
}

