function FileDataInterface(cwsObj)  {
  var dataElements = new Array();
  var data = "";
  this.flashDataPlayer = null;

  this.initialize = function()  {
    if (cwsObj.useFlashDataStorage) {
      this.flashDataPlayer = cwsObj.flashDataPlayer;
      if (this.flashDataPlayer != null)  {
        if (isValidFunction(this.flashDataPlayer.obj)) {
          this.flashDataPlayer.obj.SetVariable("action","getData");
          this.flashDataPlayer.obj.SetVariable("paramsLoaded","true");
          this.flashDataPlayer.obj.GotoFrame(2);
          this.flashDataPlayer.obj.Play();
        }
      }
    }
    else  {
      if (cwsObj.useAccessDataStorage)  {
        cwsObj.dataFrameObj.location.href = cwsObj.rootPath + "data/fileData.asp?clientName=" + cwsObj.clientName + "&courseId=" + cwsObj.courseId + "&action=getData";
      }
      else  {
        data = document.cookie;
        cwsObj.session.fileDataInitializationComplete(false);
      }
    }
  }
  this.handleExternalData = function(extData)  {
    data = extData;
    if (cwsObj.useAccessDataStorage) {
      data = CwsUtil.convertStringFromHex(extData);
    }
    if (data == null) {
      data = "";
    }
    cwsObj.session.fileDataInitializationComplete(false);
  }
  this.setUserData = function(user) {
    var error = false;
    var userId = user.getUserId();
    var dataList = CwsUtil.getListValue(userId,data,"=",";");
    if (dataList != "") {
      if (!user.setUserData(dataList))  {
        error = true;
      }
      if (!user.setKloStatus(CwsUtil.getListValue(userId+"_ks",data,"=",";")))  {
        error = true;
      }
      if (!user.setCourseSuspendData(CwsUtil.getListValue(userId+"_csd",data,"=",";")))  {
        error = true;
      }
      for (z=0;z<cwsObj.maxDisplayTypeNum;z++)  {
        if (!user.setKloLocation(CwsUtil.getListValue(userId+"_kl"+z,data,"=",";"),z))  {
          error = true;
        }
        if (!user.setKloSuspendData(CwsUtil.getListValue(userId+"_ksd"+z,data,"=",";"),z))  {
          error = true;
        }
        if (!user.setSubKloLocation(CwsUtil.getListValue(userId+"_skl"+z,data,"=",";"),z))  {
          error = true;
        }
        if (!user.setSubKloStatus(CwsUtil.getListValue(userId+"_sks"+z,data,"=",";"),z))  {
          error = true;
        }
        user.setCourseParams(CwsUtil.getListValue(userId+"_cp"+z,data,"=",";"),z)
      }
    }
    else  {
      this.saveUserData(user);
    }
    return !error;
  }
  this.saveUserData = function(user)  {
    var userId = user.getUserId();
    var key = "";
    var value = "";

    if ((cwsObj.useFlashDataStorage) || (cwsObj.useAccessDataStorage)) {
      //user data
      key = userId;
      value = user.getUserDataList();
      data = CwsUtil.setListValue(key,value,data,"=",";");

      //klo status data
      key = userId + "_ks";
      value = user.getKloStatusList();
      data = CwsUtil.setListValue(key,value,data,"=",";");

      //course suspend data
      key = userId + "_csd";
      value = user.getCourseSuspendDataList();
      data = CwsUtil.setListValue(key,value,data,"=",";");

      //klo location, sub klo status and location data
      for (i=0;i<cwsObj.maxDisplayTypeNum;i++)  {
        key = userId + "_kl" + i;
        value = user.getKloLocationList(i);
        data = CwsUtil.setListValue(key,value,data,"=",";");
        key = userId + "_ksd" + i;
        value = user.getKloSuspendDataList(i);
        data = CwsUtil.setListValue(key,value,data,"=",";");
        key = userId + "_sks" + i;
        value = user.getSubKloStatusList(i);
        data = CwsUtil.setListValue(key,value,data,"=",";");
        key = userId + "_skl" + i;
        value = user.getSubKloLocationList(i);
        data = CwsUtil.setListValue(key,value,data,"=",";");
        key = userId + "_cp" + i;
        value = user.getCourseParamList(i);
        data = CwsUtil.setListValue(key,value,data,"=",";");
      }

      if ((cwsObj.useFlashDataStorage) && (this.flashDataPlayer != null))  {
        if (isValidFunction(this.flashDataPlayer.obj)) {
          this.flashDataPlayer.obj.SetVariable("action","setData");
          this.flashDataPlayer.obj.SetVariable("dataValue",data);
          this.flashDataPlayer.obj.SetVariable("paramsLoaded","true");
          this.flashDataPlayer.obj.GotoFrame(2);
          this.flashDataPlayer.obj.Play();
        }
      }

      if (cwsObj.useAccessDataStorage)  {
        var xmlHttp = cwsObj.dataFrameObj.xmlHttp;
        if (typeof xmlHttp != "undefined")  {
          xmlHttp.open("POST",cwsObj.rootPath + "data/fileData.asp", false);
          xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
          xmlHttp.send("clientName=" + cwsObj.clientName + "&courseId=" + cwsObj.courseId + "&action=saveData&data=" + CwsUtil.convertStringToHex(data));
        }
        else  {
          cwsObj.dataFrameObj.location.href = cwsObj.rootPath + "data/fileData.asp?clientName=" + cwsObj.clientName + "&courseId=" + cwsObj.courseId + "&action=saveData&data=" + CwsUtil.convertStringToHex(data);
        }
      }

    }
    else  {

      //user data
      key = userId;
      value = user.getUserDataList();
      CwsUtil.setCookieValue(key,value,cwsObj.dataExpireDays);

      //klo status data
      key = userId + "_ks";
      value = user.getKloStatusList();
      CwsUtil.setCookieValue(key,value,cwsObj.dataExpireDays);

      //course suspend data
      key = userId + "_csd";
      value = user.getCourseSuspendDataList();
      CwsUtil.setCookieValue(key,value,cwsObj.dataExpireDays);

      //klo location, sub klo status and location data
      for (i=0;i<cwsObj.maxDisplayTypeNum;i++)  {
        key = userId + "_kl" + i;
        value = user.getKloLocationList(i);
        CwsUtil.setCookieValue(key,value,cwsObj.dataExpireDays);
        key = userId + "_ksd" + i;
        value = user.getKloSuspendDataList(i);
        CwsUtil.setCookieValue(key,value,cwsObj.dataExpireDays);
        key = userId + "_sks" + i;
        value = user.getSubKloStatusList(i);
        CwsUtil.setCookieValue(key,value,cwsObj.dataExpireDays);
        key = userId + "_skl" + i;
        value = user.getSubKloLocationList(i);
        CwsUtil.setCookieValue(key,value,cwsObj.dataExpireDays);
        key = userId + "_cp" + i;
        value = user.getCourseParamList(i);
        CwsUtil.setCookieValue(key,value,cwsObj.dataExpireDays);
      }
    }
    return true;
  }
  this.clearData = function() {
    if (cwsObj.useFlashDataStorage) {
      if (this.flashDataPlayer != null)  {
        if (isValidFunction(this.flashDataPlayer.obj)) {
          this.flashDataPlayer.obj.SetVariable("action","clearData");
          this.flashDataPlayer.obj.SetVariable("paramsLoaded","true");
          this.flashDataPlayer.obj.GotoFrame(2);
          this.flashDataPlayer.obj.Play();
        }
      }
    }
  }
  this.savePerformanceData = function(user,commit) {
    //nothing - not supported in this interface
  }
  this.saveObjectiveData = function(index,objective,commit)  {
    //nothing - not supported in this interface
  }
  this.saveInteractionData = function(index,interaction,commit)  {
    //nothing - not supported in this interface
  }
  this.finished = function()  {
    //nothing
  }
}
