common.js 121 KB
Newer Older
1
/**
2
 * ABook Viewer for WEB common package
3
 *
4
 * Copyright (C) Agentec Co, Ltd. All rights reserved.
5
 */
6

7
// グローバルの名前空間用のオブジェクトを用意する
Masaru Abe committed
8 9
var COMMON = {};

Masaru Abe committed
10 11 12
COMMON.resourceVersionArr = [];
COMMON.metaVersionArr = [];

13 14 15 16 17 18
COMMON.DEFAULT_IMG_OPTION_MEMO = 'img/list/icon_sticker.png';
COMMON.DEFAULT_IMG_OPTION_MARKING = 'img/list/icon_pen.png';
COMMON.DEFAULT_IMG_CONTENT_EDIT = 'img/common/band_updated.png';
COMMON.DEFAULT_IMG_CONTENT_NEW = 'img/common/band_new.png';

COMMON.ThumbnailForOtherType = {
19 20 21 22 23 24 25
    Thumbnail_ImageType : 'img/image_type.png',
    Thumbnail_VideoType : 'img/iPad_video.png',
    Thumbnail_MusicType : 'img/thumb_default_sound.png',
    Thumbnail_OthersType : 'img/thumb_default_other.png',
    Thumbnail_NoFileType : 'img/thumb_default_none.png',
    Thumbnail_HtmlType : 'img/thumb_default_html.png',
    Thumbnail_LinkType : 'img/thumb_default_link.png'
26 27
};

28 29 30
// =============================================================================================
// Constants [start]
// =============================================================================================
31
COMMON.Consts = {
32 33 34 35
    // Display mode: 1 -> Bookshelf
    ConstDisplayMode_BookShelf : 1,
    // Display mode: 0 -> List
    ConstDisplayMode_List : 2,
36

37 38
    // Order setting: 1 -> ascending
    ConstOrderSetting_Asc : 1,
39

40 41
    // Order setting: 0 -> descending
    ConstOrderSetting_Desc : 2,
42

43 44 45 46 47 48
    // Language: English
    ConstLanguage_En : "en",
    // Language: Japanese
    ConstLanguage_Ja : "ja",
    // Language: Korean
    ConstLanguage_Ko : "ko",
49

50 51 52 53
    // API result: success
    ConstAPI_SUCCESS : "success",
    // API result: fail
    ConstAPI_FAIL : "fail",
54

55 56 57 58 59 60
    // 初回ログイン時パスワード強制変更: 0:なし
    ConstServiceOption_NON : 0,
    // 初回ログイン時パスワード強制変更: 1:催促
    ConstServiceOption_REGULAR : 1,
    // 初回ログイン時パスワード強制変更: 2:強制
    ConstServiceOption_FORCE : 2,
61

62 63
    // Lock screen timer
    ConstLockScreenTime : 1800000
64

65 66
};

67
/* Content Type Keys */
68
COMMON.ContentTypeKeys = {
69 70 71 72 73 74 75 76 77
    Type_PDF : 'pdf',
    Type_Image : 'image',
    Type_Video : 'movie',
    Type_Music : 'music',
    Type_Others : 'other',
    Type_NoFile : 'none',
    Type_Html : 'html',
    Type_Enquete : 'enquete',
    Type_Exam : 'exam',
78
    Type_Link : 'url',
79
    Type_PanoImage : 'panoImage',
Masaru Abe committed
80 81
    Type_PanoMovie : 'panoMovie',
    Type_ObjectVR : 'objectvr'
82 83 84
};

/*
85 86
 * Define short keys for content view
 */
87
COMMON.ShortKeys = {
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109
    // Move previous: arrow left <-
    MovePrevious : 37,
    // Move next: arrow right ->
    MoveNext : 39,
    // Zoom in: ","
    ZoomIn : 188,
    // Zoom out: "."
    ZoomOut : 190,
    // Fit: Enter
    ZoomFit : 13,
    // Show, hide toolbar: "["
    ShowHideToolbar : 219,
    // Show, hide marking: "]"
    ShowHideMarking : 221,
    // Zoom out : "-"
    ZoomOutAlt : 189,
    // Zoom in: "+"
    ZoomInAlt : 187,
    // Zoom out: "-" firefox/opera
    ZoomOutAlt_Firefox : 173,
    // Zoom in : "+" firefox/opera
    ZoominAlt_Firefox : 59
110 111 112 113 114 115
};

// -------------------------------------------------
// Define all keys for local/session storage [start]
// -------------------------------------------------

116
COMMON.ScreenIds = {
117 118 119 120 121 122 123 124 125 126
    Login : './../login.html',
    Home : 'home.html?__UPDATEID__',
    ContentView : 'contentview.html?__UPDATEID__',
    Setting : 'settings.html?__UPDATEID__',
    BookmarkList : 'bookmark.html?__UPDATEID__',
    ContentSearch : 'contentsearch.html?__UPDATEID__',
    History : 'history.html?__UPDATEID__',
    ContentViewOpenUri : 'contentview_openuri.html?__UPDATEID__',
    ContentViewStreaming : 'contentview_streaming.html?__UPDATEID__',
    ContentViewGetits : 'contentview_getits.html?__UPDATEID__'
127 128
};

129
COMMON.Keys = {
130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375
    zoom_ratioPre : 'zoom_ratioPre',

    IsRefresh : 'IsRefresh',
    // Local
    BookmarkScreen : 'BookmarkScreen',
    // Local
    IsJumpBack : 'IsJumpBack',
    // Local:
    JumpQueue : 'JumpQueue',
    // Local
    ContentViewDetail : 'ContentViewDetail',
    // Session
    userInfo_userName : 'userInfo_userName',
    // Local
    ContentLogData : 'ContentLogData',
    // Session: true/false
    IsLocked : 'IsLocked',
    // Local: true/false
    IsHideToolbar : 'IsHideToolbar',
    // Local: true/false
    IsAddingMemo : 'IsAddingMemo',
    // Local: true/false
    IsAddingMarking : 'IsAddingMarking',
    // Local: true/false
    IsDisplayMarking : 'IsDisplayMarking',
    // Local: true/false
    IsDisplayMemo : 'IsDisplayMemo',
    // Local
    MarkingType : 'MarkingType',
    // Local
    ReadingContentIds : 'ReadingContentIds',
    // Local
    BookMarkData : 'BookMarkData',
    // Local
    MarkingData : 'MarkingData',
    // Local
    MemoData : 'MemoData',
    // Local
    ResourceVersion : 'ResourceVersion',
    // Local
    MetaVersion : 'MetaVersion',

    // Local :ユーザオプション(userOpt)_ログアウトモード: Interger(0:logout with backup,
    // 1:logout without backup)
    userOpt_logoutMode : 'logoutMode',

    // Session :コンテンツ詳細情報(contentInfo)_サムネール: String (base64string)
    contentInfo_contentThumbnail : 'contentInfo_contentThumbnail',

    // Local: isChangedMemo: boolean (true: changed, false: not change)
    isChangedMemo : 'isChangedMemo',
    // Local: isChangedMakingData: boolean (true: changed, false: not change)
    isChangedMarkingData : 'isChangedMarkingData',
    // Local: isChangedBookmark: boolean (true: changed, false: not change)
    isChangedBookmark : 'isChangedBookmark',

    // Session:パスワード要変更(requirePasswordChange):String (0:不要, 1:初回, 2:定期変更)
    requirePasswordChange : 'requirePasswordChange',

    /* -------------------------------------------------------------------------------- */
    // Session/local:ユーザ情報(userInfo)_セッションID:String
    userInfo_sid : 'sid',
    userInfo_sid_preview : 'sidPreview',
    // Session :事業者オプション(serviceOpt)_初回ログイン時パスワード強制変更:Integer(0:なし, 1:催促, 2:強制)
    serviceOpt_force_pw_change_on_login : 'force_pw_change_on_login',
    // Session :事業者オプション(serviceOpt)_定期ログイン時パスワード強制変更:Integer(0:なし, 1:催促, 2:強制)
    serviceOpt_force_pw_change_periodically : 'force_pw_change_periodically',
    // Session:事業者オプション(serviceOpt)_メモ・マーキングデータバックアップ使用:Char(Y:可能, N:不可)
    serviceOpt_user_data_backup : 'user_data_backup',
    // Session:事業者オプション(serviceOpt)_テキストコピー機能使用:Char(Y:可能, N:不能)
    serviceOpt_copy_text : 'copy_text',
    // Session :事業者オプション(serviceOpt)_マーキング機能使用:Char(Y:可能, N:不可)
    serviceOpt_marking : 'marking',
    // No.8: do not use this value: serviceOpt_force_login_periodically
    // Session :事業者オプション(serviceOpt)_一定期間経過後アプリロック:Char(Y:可能, N:不可)
    // serviceOpt_force_login_periodically: 'force_login_periodically',
    // No.8: スクリーンロック
    // Session :事業者オプション(serviceOpt)_スクリーンロック(Web版):Char(Y:可能, N:不可)
    serviceOpt_web_screen_lock : 'web_screen_lock',
    // Session :事業者オプション(serviceOpt)_スクリーンロック待ち時間:Interger
    serviceOpt_web_screen_lock_wait : 'web_screen_lock_wait',
    // Session :事業者オプション(serviceOpt)_GPS使用可:Char(Y:可能, N:不可)
    serviceOpt_usable_readinglog_gps : 'usable_readinglog_gps',
    // Session :事業者オプション(serviceOpt)_詳細ログ使用可:Char(Y:可能, N:不可)
    serviceOpt_usable_readinglog_object : 'usable_readinglog_object',
    // Session :事業者オプション(serviceOpt)_カタログエディション:Char(Y:可能, N:不可)
    serviceOpt_catalog_edition : 'catalog_edition',
    // Session :事業者オプション(serviceOpt)_日比谷カスタム:Char(Y:可能, N:不可)
    serviceOpt_hibiyakadan_catalog : 'hibiyakadan_catalog',
    // Session :事業者オプション(serviceOpt)_DHカスタム:Char(Y:可能, N:不可)
    serviceOpt_daihatsu : 'daihatsu',
    // Session :事業者オプション(serviceOpt)_getits向けGPS使用可:Char(Y:可能, N:不可)
    serviceOpt_reader_usable_readinglog_gps : 'reader_usable_readinglog_gps',
    // Session :事業者オプション(serviceOpt)_getits向け詳細ログ使用可:Char(Y:可能, N:不可)
    serviceOpt_reader_readinglog_object : 'reader_readinglog_object',
    // Session :事業者オプション(serviceOpt)_コンテンツ共有モード:Interger(0:なし , 1:ABook,
    // 2:getits)
    serviceOpt_content_share : 'content_share',
    // Session :事業者オプション(serviceOpt)_公開時プッシュメッセージ:Char(Y:可能, N:不可)
    serviceOpt_apns : 'apns',
    // Session :事業者オプション(serviceOpt)_任意のプッシュメッセージ:Char(Y:可能, N:不可)
    serviceOpt_usable_push_message : 'usable_push_message',
    // Session :暗号化対応:Char(Y:可能, N:不可)
    serviceOpt_encryption : 'encryption',
    // Session :HTMLカスタムログ:Char(Y:可能, N:不可)
    serviceOpt_html_custom_log : 'html_custom_log',
    // Session :共通(common)_コンテンツID:Integer
    common_contentId : 'common_contentId',
    // Local :共通(common)_コンテンツID:Integer
    common_preContentId : 'common_preContentId',
    // Session: 共通(common)_コンテンツデータチェックフラグ: Integer(true/false,
    // true:メモ、マーキング、しおりを削除する処理を行える false:メモ、マーキング、しおりを削除する処理をしない)
    common_contentDataChkFlg : 'common_contentDataChkFlg',
    // Session :ページ情報データ(pageInfo)_ページNo:Integer
    pageInfo_pageNo : 'pageInfo_pageNo',
    // Local :ページ情報データ(pageInfo)_ページNo:Integer
    common_prePageNo : 'common_prePageNo',
    // Session :ページ情報データ(pageInfo)_ページテキスト:String
    pageInfo_pageText : 'pageText',
    // Session :ページ情報データ(pageInfo)_コンテンツサムネイル:Integer
    pageInfo_pageImgResrcId : 'pageImgResrcId',
    // Session :コンテンツ内リンク(linkInfo)_リンク位置のx座標:Integer
    linkInfo_linkLocationX : 'linkLocationX',
    // Session :コンテンツ内リンク(linkInfo)_リンク位置のy座標:Integer
    linkInfo_linkLocationY : 'linkLocationY',
    // Session :コンテンツ内リンク(linkInfo)_リンク領域の幅:Integer
    linkInfo_linkLocationWidth : 'linkLocationWidth',
    // Session :コンテンツ内リンク(linkInfo)_リンク領域の高さ:Integer
    linkInfo_linkLocationHeight : 'linkLocationHeight',
    // Session :コンテンツ内リンク(linkInfo)_リンクタイプ:Integer(0/1)
    linkInfo_linkKind : 'linkKind',
    // Session :コンテンツ内リンク(linkInfo)_ターゲットURI:String(0/1)
    linkInfo_destURI : 'destURI',
    // Session :コンテンツ内リンク(linkInfo)_ターゲットページNo:Integer(0/1)
    linkInfo_destPageNumber : 'linkInfo_destPageNumber',
    // Session :閲覧ログ(log)_コンテンツ閲覧開始時刻:Datetime
    log_contentStartViewDt : 'contentStartViewDt',
    // Session :コンテンツ詳細情報(contentInfo)_コンテンツID:Integer
    contentInfo_contentId : 'contentInfo_contentId',
    // Session :コンテンツ詳細情報(contentInfo)_カテゴリID:Integer
    contentInfo_categoryId : 'categoryId',
    // Session :コンテンツ詳細情報(contentInfo)_コンテンツ名:String
    contentInfo_contentName : 'contentName',
    // Session :コンテンツ詳細情報(contentInfo)_コンテンツ名(カナ):String
    contentInfo_contentNameKana : 'contentNameKana',
    // Session :コンテンツ詳細情報(contentInfo)_コンテンツ詳細:String
    contentInfo_contentDetail : 'contentDetail',
    // Session :コンテンツ詳細情報(contentInfo)_公開開始日:Datetime
    contentInfo_deliveryStartDate : 'deliveryStartDate',
    // Session :コンテンツ詳細情報(contentInfo)_公開終了日:Datetime
    contentInfo_deliveryEndDate : 'deliveryEndDate',
    // Session :コンテンツ詳細情報(contentInfo)_本棚サムネール名:Interger
    contentInfo_thumbnailName : 'thumbnailName',
    // Session :コンテンツ詳細情報(contentInfo)_詳細画面サムネール名:Interger
    contentInfo_thumbnailBigName : 'thumbnailBigName',
    // Session :コンテンツ詳細情報(contentInfo)_メタ更新バージョン:Interger
    contentInfo_metaVersion : 'contentInfo_metaVersion',
    // Session :コンテンツ詳細情報(contentInfo)_リソース更新バージョン:Interger
    contentInfo_resourceVersion : 'contentInfo_resourceVersion',
    // Session :コンテンツ詳細情報(contentInfo)_PDF総ページ数:Interger
    contentInfo_allPageNum : 'contentInfo_allPageNum',
    // Session :(contentType):String
    contentInfo_contentType : 'contentInfo_contentType',
    // Session :検索条件(searchCond)_検索テキスト:String
    searchCond_searchText : 'searchText',
    // Session :検索条件(searchCond)_検索区分:Interger(1:コンテンツ検索, 2:タグ検索, 3:全文検索)
    searchCond_searchDivision : 'searchCond_searchDivision',
    // Session :検索条件(searchCond)_ソート基準:Interger(1:タイトル名, 2:タイトル名(かな), 3:公開順)
    searchCond_sortType : 'searchCond_sortType',
    // Session :検索条件(searchCond)_ソート方法:Interger(1:昇順, 2:降順)
    searchCond_sortOrder : 'sortOrder',
    // Session :検索条件(searchCond)_レコードFrom:Interger
    searchCond_recordFrom : 'recordFrom',
    // Session :検索条件(searchCond)_レコードTo:Interger
    searchCond_recordTo : 'recordTo',
    // Session :検索条件(searchCond)_カテゴリID:Interger
    searchCond_genreId : 'genreId',
    // Session :検索条件(searchCond)_グループID:Interger
    searchCond_groupId : 'groupId',
    // Session :通知情報(pushInfo)_新着件数:Interger
    pushInfo_newMsgNumber : 'pushInfo_newMsgNumber',
    // Local :ペン書式設定(penOpt)_色:String
    penOpt_color : 'penOpt_color',
    // Local :ペン書式設定(penOpt)_サイズ:Interger
    penOpt_size : 'penOpt_size',
    // Local :マーカ書式設定(maker)_色:String
    maker_color : 'maker_color',
    // Local :マーカ書式設定(maker)_サイズ:Interger
    maker_size : 'maker_size',
    // Local :消しゴム書式設定(erase)_色:String
    erase_color : 'erase_color',
    // Local :消しゴム書式設定(erase)_サイズ:Interger
    erase_size : 'erase_size',
    // Local :ユーザ情報(userInfo)_ログインID:String
    userInfo_loginId : 'loginId',
    // Local :ユーザ情報(userInfo)_アカウントパス:String
    userInfo_accountPath : 'accountPath',
    // Local :ユーザ情報(userInfo)_アカウント情報記憶フラグ:Char(Y:可能, N:不可)
    userInfo_rememberLogin : 'rememberLogin',
    // Local :ユーザ情報(userInfo)_最終ログイン日時:Datetime
    userInfo_lastLoginTime : 'lastLoginTime',
    // Local :ユーザ情報(userInfo)_パスワードスキップ日時:Datetime
    userInfo_pwdSkipDt : 'pwdSkipDt',
    // Local :ユーザオプション(userOpt)_動画繰り返しフラグ:Interger(0: 繰り返しなし, 1: 繰り返しあり)
    userOpt_videoMode : 'videoMode',
    // Local :ユーザオプション(userOpt)_音楽繰り返しフラグ:Interger(0: 繰り返しなし, 1: 繰り返しあり)
    userOpt_musicMode : 'musicMode',
    // Local :ユーザオプション(userOpt)_マーキング表示設定:Interger(0:表示しない, 1:表示する)
    userOpt_makingDsp : 'makingDsp',
    // Local :ユーザオプション(userOpt)_アラート表示設定:Interger(0:表示しない, 1:表示する)
    userOpt_closeOrRefreshAlert : 'userOpt_closeOrRefreshAlert',
    // Local :ユーザオプション(userOpt)_バックアップ確認フラグ:Interger(0:する, 1:しない)
    userOpt_bkConfirmFlg : 'bkConfirmFlg',
    // Local :並び順(sortOpt)_表示モード:Interger(0:本棚, 1:リスト)
    sortOpt_viewMode : 'viewMode',
    // Local :並び順(sortOpt)_表示区分:Interger(0:ジャンル, 1:グループ)
    sortOpt_viewType : 'viewType',
    // Local :並び順(sortOpt)_ソート基準:Interger(1:コンテンツ検索, 2:タグ検索, 3:全文検索)
    sortOpt_searchDivision : 'sortOpt_searchDivision',
    // Local: 並び順(sortOpt)_ソート方法:Interger(1:タイトル名, 2:タイトル名(かな), 3:公開順)
    sortOpt_sortType : 'sortOpt_sortType',
    // Local :しおりデータ(bookmark)_ページNo:Interger
    bookmark_pageNo : 'bookmark_pageNo',
    // Local :メモデータ(memo)_コンテンツID:Interger
    memo_contentNo : 'memo_contentNo',
    // Local :メモデータ(memo)_ページNo:Interger
    memo_pageNo : 'memo_pageNo',
    // Local :メモ(memo)_CopyText:String
    memo_copyText : 'memo_copyText',
    // Local :ユーザオプション(userOpt)_バックアップデフォルト_マーキング:Interger
    userOpt_bkMakingFlag : 'userOpt_bkMakingFlag',
    // Local :ユーザオプション(userOpt)_バックアップデフォルト_メモ:Interger
    userOpt_bkMemoFlag : 'userOpt_bkMemoFlag',
    // Local :ユーザオプション(userOpt)_バックアップデフォルト_しおり:Interger
    userOpt_bkShioriFlag : 'userOpt_bkShioriFlag',
    // Local :ユーザオプション(userOpt)_ビューのアニメーション種類:Interger
    userOpt_pageTransition : 'userOpt_pageTransition',
    // Local :ユーザオプション(userOpt)_アニメーション時間:Float
    userOpt_pageTransitionPeriod : 'userOpt_pageTransitionPeriod',

    isGetitsMode : 'isGetitsMode',
    isStreamingMode : 'isStreamingMode',
    conf_apiUrl : 'conf_apiUrl',
    conf_apiLoginUrl : 'conf_apiLoginUrl',
    conf_apiResourceDlUrl : 'conf_apiResourceDlUrl',
    storeUrl : 'storeUrl',
376
    siteUrl : 'siteUrl',
377 378 379 380 381 382

    latitude : 'latitude',
    longitude : 'longitude',

    // Local:セッションID:String
    userInfo_sid_bak : 'sid_bak'
383

384
/* -------------------------------------------------------------------------------- */
385

386 387 388 389
};

// Entity for Bookmark
function BookMarkEntity() {
390 391 392 393 394 395
    this.contentid = "";
    this.pageNo = 0;
    // More info
    this.contentTitle = "";
    this.contentTitleKana = "";
    this.registerDate = new Date();
396

397 398
    // Add for phase2
    this.bookmarkid = "";
399 400 401 402
};

// Entity for Memo
function MemoEntity() {
403 404 405 406 407
    this.contentid = "";
    this.pageNo = 0;
    this.posX = -1;
    this.posY = -1;
    this.Text = "";
408

409 410 411
    // Add for phase2
    this.memoid = "";
    this.registerDate = new Date();
412 413 414 415
};

// Entity for marking
function MarkingEntity() {
416 417 418
    this.contentid = "";
    this.pageNo = -1;
    this.content = "";
419

420 421 422
    // Add for phase2
    this.markingid = "";
    this.registerDate = new Date();
423 424 425
};
// Entity for log
function LogEntity() {
426 427 428 429 430 431 432 433 434 435 436 437 438 439
    this.contentid = "";
    this.readingStartDate = new Date();
    this.readingEndDate = null;
    this.readingTime = 0;
    this.deviceTypeId = 4;
    // GPS
    this.latitude = '';
    this.longitude = '';
    // ページログ配列
    this.pageLogArray = [];
    // 詳細ログ配列
    this.objectLogArray = [];
    // カスタムログ配列
    this.customLogArray = [];
440 441
};
// Entity for PageLog
442
function PageLogEntity() {
443 444 445 446 447
    this.contentid = "";
    this.pageNo = 1;
    this.readingStartDate = new Date();
    this.readingEndDate = null;
    this.readingTime = 0;
448
};
Masaru Abe committed
449
// Entity for ObjectLog
450
function ObjectLogEntity() {
451 452 453 454 455 456 457 458 459 460 461 462 463
    this.contentid = "";
    this.actionDate = new Date();
    this.pageNo = 1;
    this.objectId = "";
    this.resourceId = "";
    this.mediaType = "";
    this.actionType = "";
    this.actionValue = "";
    this.actionTime = "0";
    this.locationX = "";
    this.locationY = "";
    this.locationHeight = "";
    this.locationWidth = "";
vietdo committed
464
    this.eventType = 1;
Masaru Abe committed
465
};
466 467
//Entity for CustomLog
function CustomLogEntity() {
468 469 470 471 472 473 474
    this.contentid = "";
    this.actionDate = new Date();
    this.param1 = "";
    this.param2 = "";
    this.param3 = "";
    this.param4 = "";
    this.param5 = "";
475
};
476

477 478 479
/*
 * Extract memo data from result of API and merge with local memo
 */
Masaru Abe committed
480
COMMON.getDataMemo = function(jsonString) {
481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525
    var memoDataFromServer = jsonString.data;

    var arrLocalMemo = ClientData.MemoData();

    for ( var i = 0; i < memoDataFromServer.length; i++) {
        var objServerMemo = new MemoEntity();
        objServerMemo.contentid = memoDataFromServer[i].contentid;
        objServerMemo.pageNo = memoDataFromServer[i].pageNo;
        objServerMemo.posX = memoDataFromServer[i].posX;
        objServerMemo.posY = memoDataFromServer[i].posY;
        objServerMemo.Text = memoDataFromServer[i].Text;

        // Add for phase2
        objServerMemo.memoid = memoDataFromServer[i].memoid; // UUID
        objServerMemo.registerDate = memoDataFromServer[i].registerDate; // UTC+0

        // Searching memoid in local that is matching with memo of server
        var nIndexFoundLocalMemo = -1;
        for ( var nIndexLocalMemo = 0; nIndexLocalMemo < arrLocalMemo.length; nIndexLocalMemo++) {
            if (arrLocalMemo[nIndexLocalMemo].memoid == objServerMemo.memoid) {
                nIndexFoundLocalMemo = nIndexLocalMemo;
                break;
            }
        }
        // Found local memo that has memoid = memoid of server memo
        if (nIndexFoundLocalMemo >= 0) {

            // Local date is older than server date -> restore
            if (arrLocalMemo[nIndexFoundLocalMemo].registerDate < objServerMemo.registerDate) {

                arrLocalMemo[nIndexFoundLocalMemo].contentid = objServerMemo.contentid;
                arrLocalMemo[nIndexFoundLocalMemo].pageNo = objServerMemo.pageNo;
                arrLocalMemo[nIndexFoundLocalMemo].posX = objServerMemo.posX;
                arrLocalMemo[nIndexFoundLocalMemo].posY = objServerMemo.posY;
                arrLocalMemo[nIndexFoundLocalMemo].Text = objServerMemo.Text;
                arrLocalMemo[nIndexFoundLocalMemo].registerDate = objServerMemo.registerDate;
            }

        } else { // Not found: [local memo].memoid = [server memo].memoid
            // Merge server memo to local
            arrLocalMemo.push(objServerMemo);
        }

    }
    ClientData.MemoData(arrLocalMemo);
526 527 528 529 530
};

/*
 * Extract marking data from result of API and replace to local marking
 */
Masaru Abe committed
531
COMMON.getDataMarking = function(jsonString) {
532 533 534 535
    var data = jsonString.data;
    var arr = ClientData.MarkingData();
    arr.clear();
    ClientData.MarkingData(arr);
536

537 538 539 540 541 542
    var arrMarking = [];
    for ( var nIndex1 = 0; nIndex1 < data.length; nIndex1++) {
        var obj = new MarkingEntity();
        obj.contentid = data[nIndex1].contentid;
        obj.pageNo = data[nIndex1].pageNo;
        obj.content = data[nIndex1].content;
543

544 545 546
        // Add for phase2
        obj.markingid = data[nIndex1].markingid;
        obj.registerDate = data[nIndex1].registerDate;
547

548 549 550 551
        // Add object to client
        arrMarking.push(obj);
    }
    ClientData.MarkingData(arrMarking);
552 553 554 555 556
};

/*
 * Extract bookmark data from result of API and replace to local bookmark
 */
Masaru Abe committed
557
COMMON.getDataBookmark = function(jsonString) {
558 559 560 561
    var data = jsonString.data;
    var arr = ClientData.BookMarkData();
    arr.clear();
    ClientData.BookMarkData(arr);
562

563 564 565 566 567 568 569 570
    var arrBookmark = [];
    for ( var nIndex1 = 0; nIndex1 < data.length; nIndex1++) {
        var obj = new BookMarkEntity();
        obj.contentid = data[nIndex1].contentid;
        obj.pageNo = data[nIndex1].pageNo;
        obj.contentTitle = data[nIndex1].contentTitle;
        obj.contentTitleKana = data[nIndex1].contentTitleKana;
        obj.registerDate = data[nIndex1].registerDate;
571

572 573
        // Add for phase2
        obj.bookmarkid = data[nIndex1].bookmarkid;
574

575 576 577 578
        // Add object to client
        arrBookmark.push(obj);
    }
    ClientData.BookMarkData(arrBookmark);
579 580 581
};

/*
582 583 584 585 586
 * Get data from localstorage and sessionstorage synchronization If has any
 * param (args.length > 0) -> setter If has not param (args.length = 0) ->
 * getter . Get from session: + if it existed and key existed in localstorage ->
 * return result + else: set value from local to sessionstorage -> return value
 * of sessionstorage if value is not empty, otherwise, return default result.
587
 *
588
 */
Masaru Abe committed
589
COMMON.operateData = function(args, strKey, returnDefaultData) {
590

591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610
    if (args.length > 0) {
        var data = args[0];
        LocalStorageUtils.set(strKey, data);
        SessionStorageUtils.set(strKey, JSON.stringify(data));
    } else {
        if (SessionStorageUtils.get(strKey) != 'undefined' && SessionStorageUtils.get(strKey) != undefined && SessionStorageUtils.get(strKey) != '' && SessionStorageUtils.get(strKey) != null
                && SessionStorageUtils.get(strKey) != 'null') {
            if (LocalStorageUtils.existKey(strKey) == true) {
                return JSON.parse(SessionStorageUtils.get(strKey));
            } else {
                return returnDefaultData;
            }
        } else {
            if (LocalStorageUtils.existKey(strKey) == true) {
                SessionStorageUtils.set(strKey, JSON.stringify(LocalStorageUtils.get(strKey)));
                return JSON.parse(SessionStorageUtils.get(strKey));
            }
            return returnDefaultData;
        }
    }
611 612
};
var ClientData = {
613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712
    zoom_ratioPre : function(data) {
        if (arguments.length > 0) {
            SessionStorageUtils.set(COMMON.Keys.zoom_ratioPre, JSON.stringify(data));
        } else {
            if (SessionStorageUtils.get(COMMON.Keys.zoom_ratioPre) != 'undefined' && SessionStorageUtils.get(COMMON.Keys.zoom_ratioPre) != undefined
                    && SessionStorageUtils.get(COMMON.Keys.zoom_ratioPre) != '' && SessionStorageUtils.get(COMMON.Keys.zoom_ratioPre) != null
                    && SessionStorageUtils.get(COMMON.Keys.zoom_ratioPre) != 'null') {
                return JSON.parse(SessionStorageUtils.get(COMMON.Keys.zoom_ratioPre));
            }
            return 1;
        }
    },
    // Local :ユーザ情報(userInfo)_アカウントパス:String
    userInfo_accountPath : function(data) {
        if (arguments.length > 0) {
            AVWEB.avwUserSetting().set(COMMON.Keys.userInfo_accountPath, data);
        } else {
            return AVWEB.avwUserSetting().get(COMMON.Keys.userInfo_accountPath);
        }
    },
    // Local: ユーザ情報(userInfo)_セッションID:String
    userInfo_sid_local : function(data) {
        if (arguments.length > 0) {
            AVWEB.avwUserSetting().set(COMMON.Keys.userInfo_sid, data);
        } else {
            return AVWEB.avwUserSetting().get(COMMON.Keys.userInfo_sid);
        }
    },
    userInfo_sid_local_preview : function(data) {
        if (arguments.length > 0) {
            AVWEB.avwUserSetting().set(COMMON.Keys.userInfo_sid_preview, data);
        } else {
            return AVWEB.avwUserSetting().get(COMMON.Keys.userInfo_sid_preview);
        }
    },
    // Local :ユーザ情報(userInfo)_ログインID:String
    userInfo_loginId : function(data) {
        if (arguments.length > 0) {
            AVWEB.avwUserSetting().set(COMMON.Keys.userInfo_loginId, data);
        } else {
            return AVWEB.avwUserSetting().get(COMMON.Keys.userInfo_loginId);
        }
    },
    // Local :ユーザ情報(userInfo)_アカウント情報記憶フラグ:Char(Y:可能, N:不可)
    userInfo_rememberLogin : function(data) {
        if (arguments.length > 0) {
            AVWEB.avwUserSetting().set(COMMON.Keys.userInfo_rememberLogin, data);
        } else {
            return AVWEB.avwUserSetting().get(COMMON.Keys.userInfo_rememberLogin);
        }
    },

    // Local
    JumpQueue : function(data) {
        if (arguments.length > 0) {
            COMMON.operateData(arguments, COMMON.Keys.JumpQueue, []);
        } else {
            return COMMON.operateData(arguments, COMMON.Keys.JumpQueue, []);
        }
    },
    // Local
    ResourceVersion : function(data) {
        if (arguments.length > 0) {
            COMMON.operateData(arguments, COMMON.Keys.ResourceVersion, []);
        } else {
            return COMMON.operateData(arguments, COMMON.Keys.ResourceVersion, []);
        }
    },
    // Local
    ContentViewDetail : function(data) {
        if (arguments.length > 0) {
            COMMON.operateData(arguments, COMMON.Keys.ContentViewDetail, []);
        } else {
            return COMMON.operateData(arguments, COMMON.Keys.ContentViewDetail, []);
        }
    },
    // Local
    MetaVersion : function(data) {
        if (arguments.length > 0) {
            COMMON.operateData(arguments, COMMON.Keys.MetaVersion, []);
        } else {
            return COMMON.operateData(arguments, COMMON.Keys.MetaVersion, []);
        }
    },

    // Local
    ReadingContentIds : function(data) {
        if (arguments.length > 0) {
            COMMON.operateData(arguments, COMMON.Keys.ReadingContentIds, []);
        } else {
            return COMMON.operateData(arguments, COMMON.Keys.ReadingContentIds, []);
        }
    },

    // Local: Bookmark collection
    BookMarkData : function(data) {
        if (arguments.length > 0) {
            COMMON.operateData(arguments, COMMON.Keys.BookMarkData, []);
        } else {
            return COMMON.operateData(arguments, COMMON.Keys.BookMarkData, []);
        }
    },
    // Local: Marking collection
    MarkingData : function(data) {
        if (arguments.length > 0) {
            COMMON.operateData(arguments, COMMON.Keys.MarkingData, []);
        } else {
            return COMMON.operateData(arguments, COMMON.Keys.MarkingData, []);
        }
    },

    // Local: content log collection
    ContentLogData : function(data) {
        if (arguments.length > 0) {
            COMMON.operateData(arguments, COMMON.Keys.ContentLogData, []);
        } else {
            return COMMON.operateData(arguments, COMMON.Keys.ContentLogData, []);
        }
    },
    // Local: Memo collection
    MemoData : function(data) {
        if (arguments.length > 0) {
            COMMON.operateData(arguments, COMMON.Keys.MemoData, []);
        } else {
            return COMMON.operateData(arguments, COMMON.Keys.MemoData, []);
        }
    },
    // Local
    IsJumpBack : function(data) {
        if (arguments.length > 0) {
            COMMON.operateData(arguments, COMMON.Keys.IsJumpBack, undefined);
        } else {
            return COMMON.operateData(arguments, COMMON.Keys.IsJumpBack, undefined);
        }
    },
    // Local
    IsHideToolbar : function(data) {
        if (arguments.length > 0) {
            COMMON.operateData(arguments, COMMON.Keys.IsHideToolbar, undefined);
        } else {
            return COMMON.operateData(arguments, COMMON.Keys.IsHideToolbar, undefined);
        }
    },
    // Local
    IsAddingMarking : function(data) {
        if (arguments.length > 0) {
            COMMON.operateData(arguments, COMMON.Keys.IsAddingMarking, undefined);
        } else {
            return COMMON.operateData(arguments, COMMON.Keys.IsAddingMarking, undefined);
        }
    },
    // Local
    IsAddingMemo : function(data) {
        if (arguments.length > 0) {
            COMMON.operateData(arguments, COMMON.Keys.IsAddingMemo, undefined);
        } else {
            return COMMON.operateData(arguments, COMMON.Keys.IsAddingMemo, undefined);
        }
    },
    // Local
    IsDisplayMarking : function(data) {
        if (arguments.length > 0) {
            COMMON.operateData(arguments, COMMON.Keys.IsDisplayMarking, undefined);
        } else {
            return COMMON.operateData(arguments, COMMON.Keys.IsDisplayMarking, undefined);
        }
    },
    // Local
    IsDisplayMemo : function(data) {
        if (arguments.length > 0) {
            COMMON.operateData(arguments, COMMON.Keys.IsDisplayMemo, undefined);
        } else {
            return COMMON.operateData(arguments, COMMON.Keys.IsDisplayMemo, undefined);
        }
    },

    // Local
    MarkingType : function(data) {
        if (arguments.length > 0) {
            COMMON.operateData(arguments, COMMON.Keys.MarkingType, undefined);
        } else {
            return COMMON.operateData(arguments, COMMON.Keys.MarkingType, undefined);
        }
    },
    // Local :ユーザオプション(userOpt)_ログアウトモード: Interger(0:logout with backup,
    // 1:logout without backup)
    userOpt_logoutMode : function(data) {
        if (arguments.length > 0) {
            COMMON.operateData(arguments, COMMON.Keys.userOpt_logoutMode, undefined);
        } else {
            return COMMON.operateData(arguments, COMMON.Keys.userOpt_logoutMode, undefined);
        }
    },
    // Local
    BookmarkScreen : function(data) {
        if (arguments.length > 0) {
            COMMON.operateData(arguments, COMMON.Keys.BookmarkScreen, undefined);
        } else {
            return COMMON.operateData(arguments, COMMON.Keys.BookmarkScreen, undefined);
        }
    },
    // Local: isChangedMemo: boolean (true: changed, false: not change)
    isChangedMemo : function(data) {
        if (arguments.length > 0) {
            COMMON.operateData(arguments, COMMON.Keys.isChangedMemo, undefined);
        } else {
            return COMMON.operateData(arguments, COMMON.Keys.isChangedMemo, undefined);
        }
    },
    // Local: isChangedMakingData: boolean (true: changed, false: not change)
    isChangedMarkingData : function(data) {
        if (arguments.length > 0) {
            COMMON.operateData(arguments, COMMON.Keys.isChangedMarkingData, undefined);
        } else {
            return COMMON.operateData(arguments, COMMON.Keys.isChangedMarkingData, undefined);
        }
    },

    // Local: isChangedBookmark: boolean (true: changed, false: not change)
    isChangedBookmark : function(data) {
        if (arguments.length > 0) {
            COMMON.operateData(arguments, COMMON.Keys.isChangedBookmark, undefined);
        } else {
            return COMMON.operateData(arguments, COMMON.Keys.isChangedBookmark, undefined);
        }
    },

    // Local :共通(common)_コンテンツID:Integer
    common_preContentId : function(data) {
        if (arguments.length > 0) {
            COMMON.operateData(arguments, COMMON.Keys.common_preContentId, undefined);
        } else {
            return COMMON.operateData(arguments, COMMON.Keys.common_preContentId, undefined);
        }
    },
    // Local :ページ情報データ(common)_ページNo:Integer
    common_prePageNo : function(data) {
        if (arguments.length > 0) {
            COMMON.operateData(arguments, COMMON.Keys.common_prePageNo, undefined);
        } else {
            return COMMON.operateData(arguments, COMMON.Keys.common_prePageNo, undefined);
        }
    },
    // Local :ペン書式設定(penOpt)_色:String
    penOpt_color : function(data) {
        if (arguments.length > 0) {
            COMMON.operateData(arguments, COMMON.Keys.penOpt_color, undefined);
        } else {
            return COMMON.operateData(arguments, COMMON.Keys.penOpt_color, undefined);
        }
    },

    // Local :ペン書式設定(penOpt)_サイズ:Interger
    penOpt_size : function(data) {
        if (arguments.length > 0) {
            COMMON.operateData(arguments, COMMON.Keys.penOpt_size, undefined);
        } else {
            return COMMON.operateData(arguments, COMMON.Keys.penOpt_size, undefined);
        }
    },

    // Local :マーカ書式設定(maker)_色:String
    maker_color : function(data) {
        if (arguments.length > 0) {
            COMMON.operateData(arguments, COMMON.Keys.maker_color, undefined);
        } else {
            return COMMON.operateData(arguments, COMMON.Keys.maker_color, undefined);
        }
    },

    // Local :マーカ書式設定(maker)_サイズ:Interger
    maker_size : function(data) {
        if (arguments.length > 0) {
            COMMON.operateData(arguments, COMMON.Keys.maker_size, undefined);
        } else {
            return COMMON.operateData(arguments, COMMON.Keys.maker_size, undefined);
        }
    },

    // Local :消しゴム書式設定(erase)_色:String
    erase_color : function(data) {
        if (arguments.length > 0) {
            COMMON.operateData(arguments, COMMON.Keys.erase_color, undefined);
        } else {
            return COMMON.operateData(arguments, COMMON.Keys.erase_color, undefined);
        }
    },

    // Local :消しゴム書式設定(erase)_サイズ:Interger
    erase_size : function(data) {
        if (arguments.length > 0) {
            COMMON.operateData(arguments, COMMON.Keys.erase_size, undefined);
        } else {
            return COMMON.operateData(arguments, COMMON.Keys.erase_size, undefined);
        }
    },
    // Local :ユーザ情報(userInfo)_最終ログイン日時:Datetime
    userInfo_lastLoginTime : function(data) {
        if (arguments.length > 0) {
            COMMON.operateData(arguments, COMMON.Keys.userInfo_lastLoginTime, undefined);
        } else {
            return COMMON.operateData(arguments, COMMON.Keys.userInfo_lastLoginTime, undefined);
        }
    },

    // Local :ユーザ情報(userInfo)_パスワードスキップ日時:Datetime
    userInfo_pwdSkipDt : function(data) {
        if (arguments.length > 0) {
            COMMON.operateData(arguments, COMMON.Keys.userInfo_pwdSkipDt, undefined);
        } else {
            return COMMON.operateData(arguments, COMMON.Keys.userInfo_pwdSkipDt, undefined);
        }
    },
    // Local :ユーザオプション(userOpt)_動画繰り返しフラグ:Interger(0: 繰り返しなし, 1: 繰り返しあり)
    userOpt_videoMode : function(data) {
        if (arguments.length > 0) {
            COMMON.operateData(arguments, COMMON.Keys.userOpt_videoMode, undefined);
        } else {
            return COMMON.operateData(arguments, COMMON.Keys.userOpt_videoMode, undefined);
        }
    },
    // Local :ユーザオプション(userOpt)_音楽繰り返しフラグ:Interger(0: 繰り返しなし, 1: 繰り返しあり)
    userOpt_musicMode : function(data) {
        if (arguments.length > 0) {
            COMMON.operateData(arguments, COMMON.Keys.userOpt_musicMode, undefined);
        } else {
            return COMMON.operateData(arguments, COMMON.Keys.userOpt_musicMode, undefined);
        }
    },

    // Local :ユーザオプション(userOpt)_マーキング表示設定:Interger(0:表示しない, 1:表示する)
    userOpt_makingDsp : function(data) {
        if (arguments.length > 0) {
            COMMON.operateData(arguments, COMMON.Keys.userOpt_makingDsp, undefined);
        } else {
            return COMMON.operateData(arguments, COMMON.Keys.userOpt_makingDsp, undefined);
        }
    },
    // Local :ユーザオプション(userOpt)_アラート表示設定:Interger(0:表示しない, 1:表示する)
    userOpt_closeOrRefreshAlert : function(data) {
        if (arguments.length > 0) {
            COMMON.operateData(arguments, COMMON.Keys.userOpt_closeOrRefreshAlert, undefined);
        } else {
            return COMMON.operateData(arguments, COMMON.Keys.userOpt_closeOrRefreshAlert, undefined);
        }
    },
    // Local :ユーザオプション(userOpt)_バックアップ確認フラグ:Interger(0:する, 1:しない)
    userOpt_bkConfirmFlg : function(data) {
        if (arguments.length > 0) {
            COMMON.operateData(arguments, COMMON.Keys.userOpt_bkConfirmFlg, undefined);
        } else {
            return COMMON.operateData(arguments, COMMON.Keys.userOpt_bkConfirmFlg, undefined);
        }
    },
    // Local :並び順(sortOpt)_表示モード:Interger(0:本棚, 1:リスト)
    sortOpt_viewMode : function(data) {
        if (arguments.length > 0) {
            COMMON.operateData(arguments, COMMON.Keys.sortOpt_viewMode, undefined);
        } else {
            return COMMON.operateData(arguments, COMMON.Keys.sortOpt_viewMode, undefined);
        }
    },

    // Local :並び順(sortOpt)_表示区分:Interger(0:ジャンル, 1:グループ)
    sortOpt_viewType : function(data) {
        if (arguments.length > 0) {
            COMMON.operateData(arguments, COMMON.Keys.sortOpt_viewType, undefined);
        } else {
            return COMMON.operateData(arguments, COMMON.Keys.sortOpt_viewType, undefined);
        }
    },

    // Local :並び順(sortOpt)_ソート基準:Interger(1:コンテンツ検索, 2:タグ検索, 3:全文検索)
    sortOpt_searchDivision : function(data) {
        if (arguments.length > 0) {
            COMMON.operateData(arguments, COMMON.Keys.sortOpt_searchDivision, undefined);
        } else {
            return COMMON.operateData(arguments, COMMON.Keys.sortOpt_searchDivision, undefined);
        }
    },

    // Local: 並び順(sortOpt)_ソート方法:Interger(1:タイトル名, 2:タイトル名(かな), 3:公開順)
    sortOpt_sortType : function(data) {
        if (arguments.length > 0) {
            COMMON.operateData(arguments, COMMON.Keys.sortOpt_sortType, undefined);
        } else {
            return COMMON.operateData(arguments, COMMON.Keys.sortOpt_sortType, undefined);
        }
    },
    // Local :しおりデータ(bookmark)_ページNo:Interger
    bookmark_pageNo : function(data) {
        if (arguments.length > 0) {
            COMMON.operateData(arguments, COMMON.Keys.bookmark_pageNo, undefined);
        } else {
            return COMMON.operateData(arguments, COMMON.Keys.bookmark_pageNo, undefined);
        }
    },

    // Local :メモデータ(memo)_コンテンツID:Interger
    memo_contentNo : function(data) {
        if (arguments.length > 0) {
            COMMON.operateData(arguments, COMMON.Keys.memo_contentNo, undefined);
        } else {
            return COMMON.operateData(arguments, COMMON.Keys.memo_contentNo, undefined);
        }
    },

    // Local :メモデータ(memo)_ページNo:Interger
    memo_pageNo : function(data) {
        if (arguments.length > 0) {
            COMMON.operateData(arguments, COMMON.Keys.memo_pageNo, undefined);
        } else {
            return COMMON.operateData(arguments, COMMON.Keys.memo_pageNo, undefined);
        }
    },

    // Local :ユーザオプション(userOpt)_バックアップデフォルト_マーキング:Interger
    userOpt_bkMakingFlag : function(data) {
        if (arguments.length > 0) {
            COMMON.operateData(arguments, COMMON.Keys.userOpt_bkMakingFlag, undefined);
        } else {
            return COMMON.operateData(arguments, COMMON.Keys.userOpt_bkMakingFlag, undefined);
        }
    },

    // Local :ユーザオプション(userOpt)_バックアップデフォルト_メモ:Interger
    userOpt_bkMemoFlag : function(data) {
        if (arguments.length > 0) {
            COMMON.operateData(arguments, COMMON.Keys.userOpt_bkMemoFlag, undefined);
        } else {
            return COMMON.operateData(arguments, COMMON.Keys.userOpt_bkMemoFlag, undefined);
        }
    },

    // Local :ユーザオプション(userOpt)_バックアップデフォルト_しおり:Interger
    userOpt_bkShioriFlag : function(data) {
        if (arguments.length > 0) {
            COMMON.operateData(arguments, COMMON.Keys.userOpt_bkShioriFlag, undefined);
        } else {
            return COMMON.operateData(arguments, COMMON.Keys.userOpt_bkShioriFlag, undefined);
        }
    },

    // Local :ユーザオプション(userOpt)_ビューのアニメーション種類:Interger
    userOpt_pageTransition : function(data) {
        if (arguments.length > 0) {
            COMMON.operateData(arguments, COMMON.Keys.userOpt_pageTransition, undefined);
        } else {
            return COMMON.operateData(arguments, COMMON.Keys.userOpt_pageTransition, undefined);
        }
    },

    // Local :ユーザオプション(userOpt)_アニメーション時間:Float
    userOpt_pageTransitionPeriod : function(data) {
        if (arguments.length > 0) {
            COMMON.operateData(arguments, COMMON.Keys.userOpt_pageTransitionPeriod, undefined);
        } else {
            return COMMON.operateData(arguments, COMMON.Keys.userOpt_pageTransitionPeriod, undefined);
        }
    },

    // Session
    memo_copyText : function(data) {
        if (arguments.length > 0) {
            SessionStorageUtils.set(COMMON.Keys.memo_copyText, JSON.stringify(data));
        } else {
            if (SessionStorageUtils.get(COMMON.Keys.memo_copyText) != 'undefined' && SessionStorageUtils.get(COMMON.Keys.memo_copyText) != undefined
                    && SessionStorageUtils.get(COMMON.Keys.memo_copyText) != '' && SessionStorageUtils.get(COMMON.Keys.memo_copyText) != null
                    && SessionStorageUtils.get(COMMON.Keys.memo_copyText) != 'null') {
                return JSON.parse(SessionStorageUtils.get(COMMON.Keys.memo_copyText));
            }
            return null;
        }
    },
    // Session
    IsRefresh : function(data) {
        if (arguments.length > 0) {
            SessionStorageUtils.set(COMMON.Keys.IsRefresh, JSON.stringify(data));
        } else {
            if (SessionStorageUtils.get(COMMON.Keys.IsRefresh) != 'undefined' && SessionStorageUtils.get(COMMON.Keys.IsRefresh) != undefined && SessionStorageUtils.get(COMMON.Keys.IsRefresh) != ''
                    && SessionStorageUtils.get(COMMON.Keys.IsRefresh) != null && SessionStorageUtils.get(COMMON.Keys.IsRefresh) != 'null') {
                return JSON.parse(SessionStorageUtils.get(COMMON.Keys.IsRefresh));
            }
            return false;
        }
    },
    // Session
    userInfo_userName : function(data) {
        if (arguments.length > 0) {
            SessionStorageUtils.set(COMMON.Keys.userInfo_userName, data);
        } else {
            return SessionStorageUtils.get(COMMON.Keys.userInfo_userName);
        }
    },

    // Session :コンテンツ詳細情報(contentInfo)_サムネール: String (base64string)
    contentInfo_contentThumbnail : function(data) {
        if (arguments.length > 0) {
            SessionStorageUtils.set(COMMON.Keys.contentInfo_contentThumbnail, data);
        } else {
            return SessionStorageUtils.get(COMMON.Keys.contentInfo_contentThumbnail);
        }
    },

    // Session:パスワード要変更(requirePasswordChange):String (0:不要, 1:初回, 2:定期変更)
    requirePasswordChange : function(data) {
        if (arguments.length > 0) {
            SessionStorageUtils.set(COMMON.Keys.requirePasswordChange, data);
        } else {
            return SessionStorageUtils.get(COMMON.Keys.requirePasswordChange);
        }
    },

    // Session:ユーザ情報(userInfo)_セッションID:String
    userInfo_sid : function(data) {
        if (arguments.length > 0) {
            SessionStorageUtils.set(COMMON.Keys.userInfo_sid, data);
            // AVWEB.avwUserSetting().set(COMMON.Keys.userInfo_sid, data);
        } else {
            // return AVWEB.avwUserSetting().get(COMMON.Keys.userInfo_sid);
            if (AVWEB.avwUserSession()) {
                return SessionStorageUtils.get(COMMON.Keys.userInfo_sid);
            }
            return null;
        }
    },
    userInfo_sid_preview : function(data) {
        if (arguments.length > 0) {
            SessionStorageUtils.set(COMMON.Keys.userInfo_sid_preview, data);
            // AVWEB.avwUserSetting().set(COMMON.Keys.userInfo_sid, data);
        } else {
            // return AVWEB.avwUserSetting().get(COMMON.Keys.userInfo_sid);
            if (AVWEB.avwUserSession()) {
                return SessionStorageUtils.get(COMMON.Keys.userInfo_sid_preview);
            }
            return null;
        }
    },
    // Session :事業者オプション(serviceOpt)_初回ログイン時パスワード強制変更:Integer(0:なし, 1:催促, 2:強制)
    serviceOpt_force_pw_change_on_login : function(data) {
        if (arguments.length > 0) {
            SessionStorageUtils.set(COMMON.Keys.serviceOpt_force_pw_change_on_login, data);
        } else {
            return SessionStorageUtils.get(COMMON.Keys.serviceOpt_force_pw_change_on_login);
        }
    },

    // Session :事業者オプション(serviceOpt)_定期ログイン時パスワード強制変更:Integer(0:なし, 1:催促, 2:強制)
    serviceOpt_force_pw_change_periodically : function(data) {
        if (arguments.length > 0) {
            SessionStorageUtils.set(COMMON.Keys.serviceOpt_force_pw_change_periodically, data);
        } else {
            return SessionStorageUtils.get(COMMON.Keys.serviceOpt_force_pw_change_periodically);
        }
    },

    // Session:事業者オプション(serviceOpt)_メモ・マーキングデータバックアップ使用:Char(Y:可能, N:不可)
    serviceOpt_user_data_backup : function(data) {
        if (arguments.length > 0) {
            SessionStorageUtils.set(COMMON.Keys.serviceOpt_user_data_backup, data);
        } else {
            return SessionStorageUtils.get(COMMON.Keys.serviceOpt_user_data_backup);
        }
    },

    // Session:事業者オプション(serviceOpt)_テキストコピー機能使用:Char(Y:可能, N:不可)
    serviceOpt_copy_text : function(data) {
        if (arguments.length > 0) {
            SessionStorageUtils.set(COMMON.Keys.serviceOpt_copy_text, data);
        } else {
            return SessionStorageUtils.get(COMMON.Keys.serviceOpt_copy_text);
        }
    },
    // Session :事業者オプション(serviceOpt)_マーキング機能使用:Char(Y:可能, N:不可)
    serviceOpt_marking : function(data) {
        if (arguments.length > 0) {
            SessionStorageUtils.set(COMMON.Keys.serviceOpt_marking, data);
        } else {
            return SessionStorageUtils.get(COMMON.Keys.serviceOpt_marking);
        }
    },
    // No.8: do not use this value: serviceOpt_force_login_periodically
    // Session :事業者オプション(serviceOpt)_一定期間経過後アプリロック:Char(Y:可能, N:不可)
    // serviceOpt_force_login_periodically: function (data) {
    // if (arguments.length > 0) {
    // SessionStorageUtils.set(COMMON.Keys.serviceOpt_force_login_periodically,
    // data);
    // } else {
    // return
    // SessionStorageUtils.get(COMMON.Keys.serviceOpt_force_login_periodically);
    // }
    // },
    // Session :事業者オプション(serviceOpt)_GPS使用可:Char(Y:可能, N:不可)
    serviceOpt_usable_readinglog_gps : function(data) {
        if (arguments.length > 0) {
            SessionStorageUtils.set(COMMON.Keys.serviceOpt_usable_readinglog_gps, data);
        } else {
            return SessionStorageUtils.get(COMMON.Keys.serviceOpt_usable_readinglog_gps);
        }
    },
    // Session :事業者オプション(serviceOpt)_詳細ログ使用可:Char(Y:可能, N:不可)
    serviceOpt_usable_readinglog_object : function(data) {
        if (arguments.length > 0) {
            SessionStorageUtils.set(COMMON.Keys.serviceOpt_usable_readinglog_object, data);
        } else {
            return SessionStorageUtils.get(COMMON.Keys.serviceOpt_usable_readinglog_object);
        }
    },

    // Session :事業者オプション(serviceOpt)_getits_GPS使用可:Char(Y:可能, N:不可)
    serviceOpt_reader_usable_readinglog_gps : function(data) {
        if (arguments.length > 0) {
            SessionStorageUtils.set(COMMON.Keys.serviceOpt_reader_usable_readinglog_gps, data);
        } else {
            return SessionStorageUtils.get(COMMON.Keys.serviceOpt_reader_usable_readinglog_gps);
        }
    },
    // Session :事業者オプション(serviceOpt)_getits_詳細ログ使用可:Char(Y:可能, N:不可)
    serviceOpt_reader_readinglog_object : function(data) {
        if (arguments.length > 0) {
            SessionStorageUtils.set(COMMON.Keys.serviceOpt_reader_readinglog_object, data);
        } else {
            return SessionStorageUtils.get(COMMON.Keys.serviceOpt_reader_readinglog_object);
        }
    },

    // Session :事業者オプション(serviceOpt)_コンテンツ共有モード:Interger(0:なし , 1:ABook,
    // 2:getits)
    serviceOpt_content_share : function(data) {
        if (arguments.length > 0) {
            SessionStorageUtils.set(COMMON.Keys.serviceOpt_content_share, data);
        } else {
            return SessionStorageUtils.get(COMMON.Keys.serviceOpt_content_share);
        }
    },

    // Session :事業者オプション(serviceOpt)_公開時プッシュメッセージ:Char(Y:可能, N:不可)
    serviceOpt_apns : function(data) {
        if (arguments.length > 0) {
            SessionStorageUtils.set(COMMON.Keys.serviceOpt_apns, data);
        } else {
            return SessionStorageUtils.get(COMMON.Keys.serviceOpt_apns);
        }
    },

    // Session :事業者オプション(serviceOpt)_任意のプッシュメッセージ:Char(Y:可能, N:不可)
    serviceOpt_usable_push_message : function(data) {
        if (arguments.length > 0) {
            SessionStorageUtils.set(COMMON.Keys.serviceOpt_usable_push_message, data);
        } else {
            return SessionStorageUtils.get(COMMON.Keys.serviceOpt_usable_push_message);
        }
    },

    // Session :事業者オプション(serviceOpt)_任意のプッシュメッセージ:Char(Y:可能, N:不可)
    serviceOpt_encryption : function(data) {
        if (arguments.length > 0) {
            SessionStorageUtils.set(COMMON.Keys.serviceOpt_encryption, data);
        } else {
            return SessionStorageUtils.get(COMMON.Keys.serviceOpt_encryption);
        }
    },

    // Session :事業者オプション(serviceOpt)_HTMLカスタムログ:Char(Y:可能, N:不可)
    serviceOpt_html_custom_log : function(data) {
        if (arguments.length > 0) {
            SessionStorageUtils.set(COMMON.Keys.serviceOpt_html_custom_log, data);
        } else {
            return SessionStorageUtils.get(COMMON.Keys.serviceOpt_html_custom_log);
        }
    },

    // Session :事業者オプション(serviceOpt)_カタログエディション:Char(Y:可能, N:不可)
    serviceOpt_catalog_edition : function(data) {
        if (arguments.length > 0) {
            SessionStorageUtils.set(COMMON.Keys.serviceOpt_catalog_edition, data);
        } else {
            return SessionStorageUtils.get(COMMON.Keys.serviceOpt_catalog_edition);
        }
    },
    // Session :事業者オプション(serviceOpt)_日比谷対応:Char(Y:可能, N:不可)
    serviceOpt_hibiyakadan_catalog : function(data) {
        if (arguments.length > 0) {
            SessionStorageUtils.set(COMMON.Keys.serviceOpt_hibiyakadan_catalog, data);
        } else {
            return SessionStorageUtils.get(COMMON.Keys.serviceOpt_hibiyakadan_catalog);
        }
    },
    // Session :事業者オプション(serviceOpt)_DH対応:Char(Y:可能, N:不可)
    serviceOpt_daihatsu : function(data) {
        if (arguments.length > 0) {
            SessionStorageUtils.set(COMMON.Keys.serviceOpt_daihatsu, data);
        } else {
            return SessionStorageUtils.get(COMMON.Keys.serviceOpt_daihatsu);
        }
    },

    // Session :共通(common)_コンテンツID:Integer
    common_contentId : function(data) {
        if (arguments.length > 0) {
            SessionStorageUtils.set(COMMON.Keys.common_contentId, data);
        } else {
            return SessionStorageUtils.get(COMMON.Keys.common_contentId);
        }
    },

    // Session: 共通(common)_コンテンツデータチェックフラグ: Integer(true/false,
    // true:メモ、マーキング、しおりを削除する処理を行える false:メモ、マーキング、しおりを削除する処理をしない)
    common_contentDataChkFlg : function(data) {
        if (arguments.length > 0) {
            SessionStorageUtils.set(COMMON.Keys.common_contentDataChkFlg, data);
        } else {
            return SessionStorageUtils.get(COMMON.Keys.common_contentDataChkFlg);
        }
    },
    // Session :ページ情報データ(pageInfo)_ページNo:Integer
    pageInfo_pageNo : function(data) {
        if (arguments.length > 0) {
            SessionStorageUtils.set(COMMON.Keys.pageInfo_pageNo, data);
        } else {
            return SessionStorageUtils.get(COMMON.Keys.pageInfo_pageNo);
        }
    },

    // Session :ページ情報データ(pageInfo)_ページテキスト:String
    pageInfo_pageText : function(data) {
        if (arguments.length > 0) {
            SessionStorageUtils.set(COMMON.Keys.pageInfo_pageText, data);
        } else {
            return SessionStorageUtils.get(COMMON.Keys.pageInfo_pageText);
        }
    },

    // Session :ページ情報データ(pageInfo)_コンテンツサムネイル:Integer
    pageInfo_pageImgResrcId : function(data) {
        if (arguments.length > 0) {
            SessionStorageUtils.set(COMMON.Keys.pageInfo_pageImgResrcId, data);
        } else {
            return SessionStorageUtils.get(COMMON.Keys.pageInfo_pageImgResrcId);
        }
    },

    // Session :コンテンツ内リンク(linkInfo)_リンク位置のx座標:Integer
    linkInfo_linkLocationX : function(data) {
        if (arguments.length > 0) {
            SessionStorageUtils.set(COMMON.Keys.linkInfo_linkLocationX, data);
        } else {
            return SessionStorageUtils.get(COMMON.Keys.linkInfo_linkLocationX);
        }
    },

    // Session :コンテンツ内リンク(linkInfo)_リンク位置のy座標:Integer
    linkInfo_linkLocationY : function(data) {
        if (arguments.length > 0) {
            SessionStorageUtils.set(COMMON.Keys.linkInfo_linkLocationY, data);
        } else {
            return SessionStorageUtils.get(COMMON.Keys.linkInfo_linkLocationY);
        }
    },

    // Session :コンテンツ内リンク(linkInfo)_リンク領域の幅:Integer
    linkInfo_linkLocationWidth : function(data) {
        if (arguments.length > 0) {
            SessionStorageUtils.set(COMMON.Keys.linkInfo_linkLocationWidth, data);
        } else {
            return SessionStorageUtils.get(COMMON.Keys.linkInfo_linkLocationWidth);
        }
    },

    // Session :コンテンツ内リンク(linkInfo)_リンク領域の高さ:Integer
    linkInfo_linkLocationHeight : function(data) {
        if (arguments.length > 0) {
            SessionStorageUtils.set(COMMON.Keys.linkInfo_linkLocationHeight, data);
        } else {
            return SessionStorageUtils.get(COMMON.Keys.linkInfo_linkLocationHeight);
        }
    },

    // Session :コンテンツ内リンク(linkInfo)_リンクタイプ:Integer(0/1)
    linkInfo_linkKind : function(data) {
        if (arguments.length > 0) {
            SessionStorageUtils.set(COMMON.Keys.linkInfo_linkKind, data);
        } else {
            return SessionStorageUtils.get(COMMON.Keys.linkInfo_linkKind);
        }
    },

    // Session :コンテンツ内リンク(linkInfo)_ターゲットURI:String(0/1)
    linkInfo_destURI : function(data) {
        if (arguments.length > 0) {
            SessionStorageUtils.set(COMMON.Keys.linkInfo_destURI, data);
        } else {
            return SessionStorageUtils.get(COMMON.Keys.linkInfo_destURI);
        }
    },

    // Session :コンテンツ内リンク(linkInfo)_ターゲットページNo:Integer(0/1)
    linkInfo_destPageNumber : function(data) {
        if (arguments.length > 0) {
            SessionStorageUtils.set(COMMON.Keys.linkInfo_destPageNumber, data);
        } else {
            return SessionStorageUtils.get(COMMON.Keys.linkInfo_destPageNumber);
        }
    },

    // Session :閲覧ログ(log)_コンテンツ閲覧開始時刻:Datetime
    log_contentStartViewDt : function(data) {
        if (arguments.length > 0) {
            SessionStorageUtils.set(COMMON.Keys.log_contentStartViewDt, data);
        } else {
            return SessionStorageUtils.get(COMMON.Keys.log_contentStartViewDt);
        }
    },

    // Session :コンテンツ詳細情報(contentInfo)_コンテンツID:Integer
    contentInfo_contentId : function(data) {
        if (arguments.length > 0) {
            SessionStorageUtils.set(COMMON.Keys.contentInfo_contentId, data);
        } else {
            return SessionStorageUtils.get(COMMON.Keys.contentInfo_contentId);
        }
    },

    // Session :コンテンツ詳細情報(contentInfo)_カテゴリID:Integer
    contentInfo_categoryId : function(data) {
        if (arguments.length > 0) {
            SessionStorageUtils.set(COMMON.Keys.contentInfo_categoryId, data);
        } else {
            return SessionStorageUtils.get(COMMON.Keys.contentInfo_categoryId);
        }
    },

    // Session :コンテンツ詳細情報(contentInfo)_コンテンツ名:String
    contentInfo_contentName : function(data) {
        if (arguments.length > 0) {
            SessionStorageUtils.set(COMMON.Keys.contentInfo_contentName, data);
        } else {
            return SessionStorageUtils.get(COMMON.Keys.contentInfo_contentName);
        }
    },

    // Session :コンテンツ詳細情報(contentInfo)_コンテンツ名(カナ):String
    contentInfo_contentNameKana : function(data) {
        if (arguments.length > 0) {
            SessionStorageUtils.set(COMMON.Keys.contentInfo_contentNameKana, data);
        } else {
            return SessionStorageUtils.get(COMMON.Keys.contentInfo_contentNameKana);
        }
    },

    // Session :コンテンツ詳細情報(contentInfo)_コンテンツ詳細:String
    contentInfo_contentDetail : function(data) {
        if (arguments.length > 0) {
            SessionStorageUtils.set(COMMON.Keys.contentInfo_contentDetail, data);
        } else {
            return SessionStorageUtils.get(COMMON.Keys.contentInfo_contentDetail);
        }
    },

    // Session :コンテンツ詳細情報(contentInfo)_公開開始日:Datetime
    contentInfo_deliveryStartDate : function(data) {
        if (arguments.length > 0) {
            SessionStorageUtils.set(COMMON.Keys.contentInfo_deliveryStartDate, data);
        } else {
            return SessionStorageUtils.get(COMMON.Keys.contentInfo_deliveryStartDate);
        }
    },

    // Session :コンテンツ詳細情報(contentInfo)_公開終了日:Datetime
    contentInfo_deliveryEndDate : function(data) {
        if (arguments.length > 0) {
            SessionStorageUtils.set(COMMON.Keys.contentInfo_deliveryEndDate, data);
        } else {
            return SessionStorageUtils.get(COMMON.Keys.contentInfo_deliveryEndDate);
        }
    },

    // Session :コンテンツ詳細情報(contentInfo)_本棚サムネール名:Interger
    contentInfo_thumbnailName : function(data) {
        if (arguments.length > 0) {
            SessionStorageUtils.set(COMMON.Keys.contentInfo_thumbnailName, data);
        } else {
            return SessionStorageUtils.get(COMMON.Keys.contentInfo_thumbnailName);
        }
    },

    // Session :コンテンツ詳細情報(contentInfo)_詳細画面サムネール名:Interger
    contentInfo_thumbnailBigName : function(data) {
        if (arguments.length > 0) {
            SessionStorageUtils.set(COMMON.Keys.contentInfo_thumbnailBigName, data);
        } else {
            return SessionStorageUtils.get(COMMON.Keys.contentInfo_thumbnailBigName);
        }
    },

    // Session :コンテンツ詳細情報(contentInfo)_メタ更新バージョン:Interger
    contentInfo_metaVersion : function(data) {
        if (arguments.length > 0) {
            SessionStorageUtils.set(COMMON.Keys.contentInfo_metaVersion, data);
        } else {
            return SessionStorageUtils.get(COMMON.Keys.contentInfo_metaVersion);
        }
    },

    // Session :コンテンツ詳細情報(contentInfo)_リソース更新バージョン:Interger
    contentInfo_resourceVersion : function(data) {
        if (arguments.length > 0) {
            SessionStorageUtils.set(COMMON.Keys.contentInfo_resourceVersion, data);
        } else {
            return SessionStorageUtils.get(COMMON.Keys.contentInfo_resourceVersion);
        }
    },

    // Session :コンテンツ詳細情報(contentInfo)_PDF総ページ数:Interger
    contentInfo_allPageNum : function(data) {
        if (arguments.length > 0) {
            SessionStorageUtils.set(COMMON.Keys.contentInfo_allPageNum, data);
        } else {
            return SessionStorageUtils.get(COMMON.Keys.contentInfo_allPageNum);
        }
    },

    // Session :(contentType):String
    contentInfo_contentType : function(data) {
        if (arguments.length > 0) {
            SessionStorageUtils.set(COMMON.Keys.contentInfo_contentType, data);
        } else {
            return SessionStorageUtils.get(COMMON.Keys.contentInfo_contentType);
        }
    },
    // Session :検索条件(searchCond)_検索テキスト:String
    searchCond_searchText : function(data) {
        if (arguments.length > 0) {
            SessionStorageUtils.set(COMMON.Keys.searchCond_searchText, data);
        } else {
            return SessionStorageUtils.get(COMMON.Keys.searchCond_searchText);
        }
    },

    // Session :検索条件(searchCond)_検索区分:Interger(1:コンテンツ検索, 2:タグ検索, 3:全文検索)
    searchCond_searchDivision : function(data) {
        if (arguments.length > 0) {
            SessionStorageUtils.set(COMMON.Keys.searchCond_searchDivision, data);
        } else {
            return SessionStorageUtils.get(COMMON.Keys.searchCond_searchDivision);
        }
    },

    // Session :検索条件(searchCond)_ソート基準:Interger(1:タイトル名, 2:タイトル名(かな), 3:公開順)
    searchCond_sortType : function(data) {
        if (arguments.length > 0) {
            SessionStorageUtils.set(COMMON.Keys.searchCond_sortType, data);
        } else {
            return SessionStorageUtils.get(COMMON.Keys.searchCond_sortType);
        }
    },

    // Session :検索条件(searchCond)_ソート方法:Interger(1:昇順, 2:降順)
    searchCond_sortOrder : function(data) {
        if (arguments.length > 0) {
            SessionStorageUtils.set(COMMON.Keys.searchCond_sortOrder, data);
        } else {
            return SessionStorageUtils.get(COMMON.Keys.searchCond_sortOrder);
        }
    },

    // Session :検索条件(searchCond)_レコードFrom:Interger
    searchCond_recordFrom : function(data) {
        if (arguments.length > 0) {
            SessionStorageUtils.set(COMMON.Keys.searchCond_recordFrom, data);
        } else {
            return SessionStorageUtils.get(COMMON.Keys.searchCond_recordFrom);
        }
    },

    // Session :検索条件(searchCond)_レコードTo:Interger
    searchCond_recordTo : function(data) {
        if (arguments.length > 0) {
            SessionStorageUtils.set(COMMON.Keys.searchCond_recordTo, data);
        } else {
            return SessionStorageUtils.get(COMMON.Keys.searchCond_recordTo);
        }
    },

    // Session :検索条件(searchCond)_カテゴリID:Interger
    searchCond_genreId : function(data) {
        if (arguments.length > 0) {
            SessionStorageUtils.set(COMMON.Keys.searchCond_genreId, data);
        } else {
            return SessionStorageUtils.get(COMMON.Keys.searchCond_genreId);
        }
    },

    // Session :検索条件(searchCond)_グループID:Interger
    searchCond_groupId : function(data) {
        if (arguments.length > 0) {
            SessionStorageUtils.set(COMMON.Keys.searchCond_groupId, data);
        } else {
            return SessionStorageUtils.get(COMMON.Keys.searchCond_groupId);
        }
    },

    // Session :通知情報(pushInfo)_新着件数:Interger
    pushInfo_newMsgNumber : function(data) {
        if (arguments.length > 0) {
            SessionStorageUtils.set(COMMON.Keys.pushInfo_newMsgNumber, data);
        } else {
            return SessionStorageUtils.get(COMMON.Keys.pushInfo_newMsgNumber);
        }
    },

    // Session :ユーザ情報(userInfo)_ログインID:String
    userInfo_loginId_session : function(data) {
        if (arguments.length > 0) {
            SessionStorageUtils.set(COMMON.Keys.userInfo_loginId, data);
        } else {
            return SessionStorageUtils.get(COMMON.Keys.userInfo_loginId);
        }
    },

    // Session :ユーザ情報(userInfo)_アカウントパス:String
    userInfo_accountPath_session : function(data) {
        if (arguments.length > 0) {
            SessionStorageUtils.set(COMMON.Keys.userInfo_accountPath, data);
        } else {
            return SessionStorageUtils.get(COMMON.Keys.userInfo_accountPath);
        }
    },
    // Session :事業者オプション(serviceOpt)_スクリーンロック(Web版):Char(Y:可能, N:不可)
    serviceOpt_web_screen_lock : function(data) {
        if (arguments.length > 0) {
            SessionStorageUtils.set(COMMON.Keys.serviceOpt_web_screen_lock, data);
        } else {
            return SessionStorageUtils.get(COMMON.Keys.serviceOpt_web_screen_lock);
        }
    },
    // Session :事業者オプション(serviceOpt)_スクリーンロック待ち時間:Interger
    serviceOpt_web_screen_lock_wait : function(data) {
        if (arguments.length > 0) {
            SessionStorageUtils.set(COMMON.Keys.serviceOpt_web_screen_lock_wait, data);
        } else {
            return SessionStorageUtils.get(COMMON.Keys.serviceOpt_web_screen_lock_wait);
        }
    },

    isGetitsMode : function(data) {
        if (arguments.length > 0) {
            SessionStorageUtils.set(COMMON.Keys.isGetitsMode, JSON.stringify(data));
        } else {
            if (SessionStorageUtils.get(COMMON.Keys.isGetitsMode) != 'undefined' && SessionStorageUtils.get(COMMON.Keys.isGetitsMode) != undefined
                    && SessionStorageUtils.get(COMMON.Keys.isGetitsMode) != '' && SessionStorageUtils.get(COMMON.Keys.isGetitsMode) != null
                    && SessionStorageUtils.get(COMMON.Keys.isGetitsMode) != 'null') {
                return JSON.parse(SessionStorageUtils.get(COMMON.Keys.isGetitsMode));
            }
            return false;
        }
    },

    isStreamingMode : function(data) {
        if (arguments.length > 0) {
            SessionStorageUtils.set(COMMON.Keys.isStreamingMode, JSON.stringify(data));
        } else {
            if (SessionStorageUtils.get(COMMON.Keys.isStreamingMode) != 'undefined' && SessionStorageUtils.get(COMMON.Keys.isStreamingMode) != undefined
                    && SessionStorageUtils.get(COMMON.Keys.isStreamingMode) != '' && SessionStorageUtils.get(COMMON.Keys.isStreamingMode) != null
                    && SessionStorageUtils.get(COMMON.Keys.isStreamingMode) != 'null') {
                return JSON.parse(SessionStorageUtils.get(COMMON.Keys.isStreamingMode));
            }
            return false;
        }
    },

    conf_apiUrl : function(data) {
        if (arguments.length > 0) {
            SessionStorageUtils.set(COMMON.Keys.conf_apiUrl, data);
        } else {
            return SessionStorageUtils.get(COMMON.Keys.conf_apiUrl);
        }
    },
    conf_apiLoginUrl : function(data) {
        if (arguments.length > 0) {
            SessionStorageUtils.set(COMMON.Keys.conf_apiLoginUrl, data);
        } else {
            return SessionStorageUtils.get(COMMON.Keys.conf_apiLoginUrl);
        }
    },
    conf_apiResourceDlUrl : function(data) {
        if (arguments.length > 0) {
            SessionStorageUtils.set(COMMON.Keys.conf_apiResourceDlUrl, data);
        } else {
            return SessionStorageUtils.get(COMMON.Keys.conf_apiResourceDlUrl);
        }
    },

    storeUrl : function(data) {
        if (arguments.length > 0) {
            SessionStorageUtils.set(COMMON.Keys.storeUrl, data);
        } else {
            return SessionStorageUtils.get(COMMON.Keys.storeUrl);
        }
    },
1713 1714 1715 1716 1717 1718 1719 1720
    
    siteUrl : function(data) {
        if (arguments.length > 0) {
            SessionStorageUtils.set(COMMON.Keys.siteUrl, data);
        } else {
            return SessionStorageUtils.get(COMMON.Keys.siteUrl);
        }
    },
1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745

    latitude : function(data) {
        if (arguments.length > 0) {
            SessionStorageUtils.set(COMMON.Keys.latitude, data);
        } else {
            return SessionStorageUtils.get(COMMON.Keys.latitude);
        }
    },

    longitude : function(data) {
        if (arguments.length > 0) {
            SessionStorageUtils.set(COMMON.Keys.longitude, data);
        } else {
            return SessionStorageUtils.get(COMMON.Keys.longitude);
        }
    },

    // Local: セッションIDのバックアップ
    userInfo_sid_local_bak : function(data) {
        if (arguments.length > 0) {
            AVWEB.avwUserSetting().set(COMMON.Keys.userInfo_sid_bak, data);
        } else {
            return AVWEB.avwUserSetting().get(COMMON.Keys.userInfo_sid_bak);
        }
    }
1746

1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757
};

// -------------------------------------------------
// Define all keys for local/session storage [ end ]
// -------------------------------------------------

// =============================================================================================
// Constants [ end ]
// =============================================================================================

/*
1758 1759
 * Operations for local storage
 */
1760
var LocalStorageUtils = {
1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813
    getUniqueId : function() {
        var uniqueId = "";

        if (AVWEB.avwUserSetting().get(COMMON.Keys.userInfo_accountPath)) {
            uniqueId += AVWEB.avwUserSetting().get(COMMON.Keys.userInfo_accountPath);
        }
        if (AVWEB.avwUserSetting().get(COMMON.Keys.userInfo_loginId)) {
            uniqueId += "." + AVWEB.avwUserSetting().get(COMMON.Keys.userInfo_loginId);
        }
        if (uniqueId != "") {
            uniqueId += ".";
        }

        return uniqueId;
    },
    get : function(strKey) {
        var key = this.getUniqueId() + strKey;

        return AVWEB.avwUserSetting().get(key);
    },
    set : function(strKey, objValue) {
        var key = this.getUniqueId() + strKey;
        AVWEB.avwUserSetting().set(key, objValue);
    },
    remove : function(strKey) {
        var key = this.getUniqueId() + strKey;
        AVWEB.avwUserSetting().remove(key);
        SessionStorageUtils.remove(strKey);
    },
    clear : function() {
        var localStorageKeys = AVWEB.avwUserSetting().keys();
        for ( var nIndex = 0; nIndex < localStorageKeys.length; nIndex++) {
            var strKey = localStorageKeys[nIndex];

            if ((strKey + "").contains(this.getUniqueId())) {
                AVWEB.avwUserSetting().remove(strKey);
            }
        }
    },
    existKey : function(strKey) {
        var keys = AVWEB.avwUserSetting().keys();
        var findKey = this.getUniqueId() + strKey;
        var isExisted = false;
        if (keys != null && keys != undefined) {
            for ( var nIndex = 0; nIndex < keys.length; nIndex++) {
                if (keys[nIndex] == findKey) {
                    isExisted = true;
                    break;
                }
            }
        }
        return isExisted;
    }
1814 1815 1816 1817 1818 1819 1820
};

/*
 * Operations for session storage [start]
 */

var SessionStorageUtils = {
1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841
    login : function() {
        if (AVWEB.avwUserSession()) {
            // Skip this case
        } else {
            AVWEB.avwCreateUserSession();
        }
    },
    get : function(strKey) {
        return AVWEB.avwUserSession().get(strKey);
    },
    set : function(strKey, objValue) {
        AVWEB.avwUserSession().set(strKey, objValue);
    },
    clear : function() {
        if (AVWEB.avwUserSession()) {
            AVWEB.avwUserSession().destroy();
        }
    },
    remove : function(strKey) {
        AVWEB.avwUserSession().set(strKey, null);
    }
1842 1843 1844 1845 1846 1847 1848 1849 1850
};
/*
 * Operations for session storage [ end ]
 */

// =============================================================================================
// Utils for string, date, number [start]
// =============================================================================================
/*
1851 1852
 * Convert date to JP format date time [start]
 */
1853 1854

/*
1855 1856 1857
 * YYYY/MM/DD HH:MM:SS
 */
Date.prototype.jpDateTimeString = function() {
1858 1859 1860 1861 1862 1863 1864
    var strResult = "";
    var strYear = this.getFullYear() + "";
    var strMonth = (this.getMonth() + 1) + "";
    var strDayInMonth = this.getDate() + "";
    var strHour = this.getHours() + "";
    var strMinute = this.getMinutes() + "";
    var strSecond = this.getSeconds() + "";
1865

1866 1867 1868
    strResult += strYear.padLeft("0", 4) + "/" + strMonth.padLeft("0", 2) + "/" + strDayInMonth.padLeft("0", 2);
    strResult += " " + strHour.padLeft("0", 2) + ":" + strMinute.padLeft("0", 2) + ":" + strSecond.padLeft("0", 2);
    return strResult;
1869 1870 1871

};
/*
1872 1873 1874
 * YYYY-MM-DD HH:MM:SS
 */
Date.prototype.jpDateTimeString1 = function() {
1875 1876 1877 1878 1879 1880 1881
    var strResult = "";
    var strYear = this.getFullYear() + "";
    var strMonth = (this.getMonth() + 1) + "";
    var strDayInMonth = this.getDate() + "";
    var strHour = this.getHours() + "";
    var strMinute = this.getMinutes() + "";
    var strSecond = this.getSeconds() + "";
1882

1883 1884 1885
    strResult += strYear.padLeft("0", 4) + "-" + strMonth.padLeft("0", 2) + "-" + strDayInMonth.padLeft("0", 2);
    strResult += " " + strHour.padLeft("0", 2) + ":" + strMinute.padLeft("0", 2) + ":" + strSecond.padLeft("0", 2);
    return strResult;
1886 1887 1888

};
/*
1889 1890 1891
 * yyyy/MM/dd
 */
Date.prototype.jpDateString = function() {
1892 1893 1894 1895
    var strResult = "";
    var strYear = this.getFullYear() + "";
    var strMonth = (this.getMonth() + 1) + "";
    var strDayInMonth = this.getDate() + "";
1896

1897
    strResult += strYear.padLeft("0", 4) + "/" + strMonth.padLeft("0", 2) + "/" + strDayInMonth.padLeft("0", 2);
1898

1899
    return strResult;
1900 1901 1902

};
/*
1903 1904 1905
 * HH:mm:ss
 */
Date.prototype.jpTimeString = function() {
1906 1907 1908 1909
    var strResult = "";
    var strHour = this.getHours() + "";
    var strMinute = this.getMinutes() + "";
    var strSecond = this.getSeconds() + "";
1910

1911 1912
    strResult += " " + strHour.padLeft("0", 2) + ":" + strMinute.padLeft("0", 2) + ":" + strSecond.padLeft("0", 2);
    return strResult;
1913 1914 1915

};
/*
1916 1917 1918
 * HH:mm
 */
Date.prototype.jpShortTimeString = function() {
1919 1920 1921 1922
    var strResult = "";
    var strHour = this.getHours() + "";
    var strMinute = this.getMinutes() + "";
    var strSecond = this.getSeconds() + "";
1923

1924 1925
    strResult += " " + strHour.padLeft("0", 2) + ":" + strMinute.padLeft("0", 2);
    return strResult;
1926 1927 1928

};
/*
1929 1930 1931
 * yyyyMMddHHmmss
 */
Date.prototype.toIdString = function() {
1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943
    var strResult = "";
    var strYear = this.getFullYear() + "";
    var strMonth = (this.getMonth() + 1) + "";
    var strDayInMonth = this.getDate() + "";
    var strHour = this.getHours() + "";
    var strMinute = this.getMinutes() + "";
    var strSecond = this.getSeconds() + "";
    var strMilisecond = this.getMilliseconds() + "";

    strResult += strYear.padLeft("0", 4) + strMonth.padLeft("0", 2) + strDayInMonth.padLeft("0", 2);
    strResult += strHour.padLeft("0", 2) + strMinute.padLeft("0", 2) + strSecond.padLeft("0", 2) + strMilisecond.padLeft("0", 3);
    return strResult;
1944 1945
};
// Subtract date to get days
1946
Date.prototype.subtractByDays = function(targetDate) {
1947 1948 1949
    var milis = Math.abs(this - targetDate);
    var days = Math.floor(milis / (60 * 60 * 24 * 1000));
    return days;
1950
};
1951
Date.prototype.addSeconds = function(plusSeconds) {
1952 1953
    var newDate = new Date(this.getTime() + plusSeconds * 1000);
    return newDate;
1954 1955 1956
};

// Subtract date to get days
1957
Date.prototype.subtractBySeconds = function(targetDate) {
1958 1959 1960
    var milis = Math.abs(this - targetDate);
    var days = Math.floor(milis / 1000);
    return days;
1961 1962 1963
};

/*
1964 1965
 * Convert date to JP format date time [ end ]
 */
1966

1967 1968
// trimming space from both side of the string
String.prototype.trim = function() {
1969
    return this.replace(/^\s+|\s+$/g, "");
1970 1971
};

1972 1973
// trimming space from left side of the string
String.prototype.trimLeft = function() {
1974
    return this.replace(/^\s+/, "");
1975 1976
};

1977 1978
// trimming space from right side of the string
String.prototype.trimRight = function() {
1979
    return this.replace(/\s+$/, "");
1980 1981
};

1982 1983
// String: pads left
String.prototype.padLeft = function(padString, length) {
1984 1985 1986 1987
    var str = this;
    while (str.length < length)
        str = padString + str;
    return str;
1988 1989
};

1990 1991
// String: pads right
String.prototype.padRight = function(padString, length) {
1992 1993 1994 1995
    var str = this;
    while (str.length < length)
        str = str + padString;
    return str;
1996 1997
};
// Check contain string
1998
String.prototype.contains = function(string) {
1999

2000 2001 2002 2003
    if (this.indexOf(string) != -1) {
        return true;
    }
    return false;
2004 2005
};

2006 2007
// Number: pads left
Number.prototype.padLeft = function(padString, length) {
2008 2009
    var str = this + "";
    return str.padLeft(padString, length);
2010 2011
};

2012 2013
// Number: pads right
Number.prototype.padRight = function(padString, length) {
2014 2015
    var str = this + "";
    return str.padRight(padString, length);
2016 2017
};
// Clear data of array
2018
Array.prototype.clear = function() {
2019
    this.splice(0, this.length);
2020 2021 2022
};

/*
2023 2024
 * Remove extension of specified name Ex: aaaa.mp3 -> aaa
 */
Masaru Abe committed
2025
COMMON.removeExt = function(strName) {
2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037
    if (strName) {
        var arrString = strName.split('.');
        var strResult = "";
        if (arrString.length > 1) {
            var nLastIndex = strName.lastIndexOf('.');
            strResult = strName.substr(0, nLastIndex);
        } else {
            strResult = strName;
        }
        return strResult;
    }
    return "";
2038 2039 2040
};

/*
2041 2042
 * String utilities [ end ]
 */
2043 2044 2045 2046 2047 2048

// =============================================================================================
// Utils for string, date, number [ end ]
// =============================================================================================
var ValidationUtil = {

2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162
    // 必須: Text
    CheckRequiredForText : function(value) {

        if (value == null || value == '') {
            return false;
        }
        return true;
    },

    // get byte count
    GetByteCount : function(value) {
        var escapedStr = encodeURI(value);
        if (escapedStr.indexOf("%") != -1) {
            var count = escapedStr.split("%").length - 1;
            if (count == 0)
                count++; // perverse case; can't happen with real UTF-8
            var tmp = escapedStr.length - (count * 3);
            count = count + tmp;
        } else {
            count = escapedStr.length;
        }
        return count;
    },

    // 最小文字数
    CheckMinLengthForByte : function(value, len) {
        if (this.GetByteCount(value) < len)
            return false;
        return true;
    },

    // 最大文字数
    CheckMaxLengthForByte : function(value, len) {

        if (this.GetByteCount(value) > len)
            return false;
        return true;
    },

    // 半数字
    IsNumber : function(value) {
        var reg = new RegExp("^[0-9]+$");
        return reg.test(value);
    },

    // 半英字
    IsAlphabet : function(value) {
        var reg = new RegExp("^[a-zA-Z]+$");
        return reg.test(value);
    },

    // 半記号
    IsSymbol : function(value) {
        var reg = new RegExp(
                "\u005b\u005e\u0027\u0060\u0027\u007e\u0027\u0021\u0027\u0040\u0027\u0023\u0027\u0024\u0027\u0025\u0027\u005e\u0027\u0026\u0027\u002a\u0027\u0028\u0027\u0029\u0027\u005f\u0027\u002b\u0027\u003d\u0027\u007b\u0027\u007d\u0027\u007c\u0027\u003a\u0027\u0022\u0027\u003b\u0027\u0027\u0027\u003c\u0027\u003e\u0027\u003f\u0027\u002f\u0027\u002e\u0027\u002c\u005c\u002d\u005b\u005c\u005d\u005c\u005c\u005d");
        return !reg.test(value);
    },

    // メール
    CheckEmailValid : function(value) {
        // Check if string is a valid email address
        var reg = new RegExp("^[0-9a-zA-Z]+@[0-9a-zA-Z]+[\\.]{1}[0-9a-zA-Z]+[\\.]?[0-9a-zA-Z]+$");
        return reg.test(value);
    },
    // Password
    CheckPasswordValid : function(value) {
        // Check if string is a valid email address
        var reg = new RegExp("^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[#+-\\./:_]).{1,47}$");
        return reg.test(value);
    },
    // Alphabet + Nunber + Symbol
    IsAlphabetOrNumberOrSymbol : function(value) {
        // Check if string is alphabet or number or symbol
        var reg = new RegExp(
                "\u005b\u005e\u0061\u002d\u007a\u0041\u002d\u005a\u0030\u002d\u0039\u0027\u0060\u0027\u007e\u0027\u0021\u0027\u0040\u0027\u0023\u0027\u0024\u0027\u0025\u0027\u005e\u0027\u0026\u0027\u002a\u0027\u0028\u0027\u0029\u0027\u005f\u0027\u002b\u0027\u003d\u0027\u007b\u0027\u007d\u0027\u007c\u0027\u003a\u0027\u0022\u0027\u003b\u0027\u0027\u0027\u003c\u0027\u003e\u0027\u003f\u0027\u002f\u0027\u002e\u0027\u002c\u005c\u002d\u005b\u005c\u005d\u005c\u005c\u005d");
        return !reg.test(value);
    },
    // Get the total of types in array
    CheckNumberOfTypeInString : function(value) {
        var list = new Array();
        var c;
        for ( var i = 0; i < value.length; i++) {
            c = value[i];
            for ( var j = i + 1; j < value.length; j++) {
                if (value[j] == c) {
                    value = value.slice(0, j) + value.slice(j + 1, value.len);
                    j = j - 1;
                }
            }
            list[i] = c;
        }
        var count = list.length;
        return count
    },
    // Special character: *
    IsCharacterSpecial : function(value) {
        for ( var i = 0; i < value.length; i++) {
            if (value[i] == '*')
                return true;
        }
        return false;
    },

    // 半記号
    IsPasswordSymbol : function(value) {
        var reg = new RegExp("\u005b\u005e\u0027\u0023\u0027\u002b\u005c\u002d\u0027\u002e\u0027\u002f\u0027\u003a\u0027\u005f\u005d");
        return !reg.test(value);
    },

    // 半記号
    IsPasswordAlphabetOrNumerOrSymbol : function(value) {
        var reg = new RegExp("\u005b\u005e\u0061\u002d\u007a\u0041\u002d\u005a\u0030\u002d\u0039\u0027\u0023\u0027\u002b\u005c\u002d\u0027\u002e\u0027\u002f\u0027\u003a\u0027\u005f\u005d");
        return !reg.test(value);
    }
2163 2164 2165
};

// Get format based64 string to show inline
Masaru Abe committed
2166
COMMON.getBase64Image = function(imgSource) {
2167
    return imgSource.replace(/^data:image\/(png|jpg);base64,/, "");
2168 2169 2170
};

// get time wait lockscreen
Masaru Abe committed
2171
COMMON.getTimeWaitLockScreen = function() {
2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187
    var timeWaitLockScreen = -1;
    if (ClientData.serviceOpt_web_screen_lock() == "Y") {
        var sysSettings = AVWEB.avwSysSetting();
        if (isNaN(ClientData.serviceOpt_web_screen_lock_wait())) {
            timeWaitLockScreen = sysSettings.screenlockTimeDefault * 60000;
        } else {
            var temp = ClientData.serviceOpt_web_screen_lock_wait();
            timeWaitLockScreen = temp * 60000; // time unit is minute
            if (timeWaitLockScreen < 0 || temp % 1 != 0) {
                timeWaitLockScreen = sysSettings.screenlockTimeDefault * 60000;
            } else if (timeWaitLockScreen == 0) { // no lockscreen
                timeWaitLockScreen = -1;
            }
        }
    }
    return timeWaitLockScreen;
2188 2189 2190
};

// Do locking screen after idle time
Masaru Abe committed
2191
COMMON.LockScreen = function() {
2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219
    if (AVWEB.avwUserSession()) {

        // no lockscreen for user anonymous
        if (COMMON.isAnonymousLogin()) {
            return;
        }
        // getitsでも発動しない
        if (ClientData.isGetitsMode() == true) {
            return;
        }
        // ストリーミングでも発動しない
        if (ClientData.isStreamingMode() == true) {
            return;
        }

        var timeWaitLockScreen = COMMON.getTimeWaitLockScreen();
        if (timeWaitLockScreen > 0) {
            // var message = I18N.i18nText("sysInfoScrLock01");
            SCREENLOCK.screenLock({
                timeout : timeWaitLockScreen,
                html : '<img src="img/1222.png" alt="Screen Lock" /><br />', // +
                                                                                // message,
                unlockFunc : COMMON.unlockFunction,
                errorMessage : I18N.i18nText('msgLoginErrWrong')
            });
        }

    }
2220 2221 2222
};

// The function will be called at the time: loading
2223 2224
$(function() {

2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287
    // Init setting values
    if (AVWEB.avwUserSession()) { // Logged

        // View mode default
        if (ClientData.sortOpt_viewMode() == null || ClientData.sortOpt_viewMode() == undefined) {
            ClientData.sortOpt_viewMode(COMMON.Consts.ConstDisplayMode_BookShelf); // Bookshelf
        }

        // 動画、音楽繰り返し
        if (ClientData.userOpt_musicMode() == null || ClientData.userOpt_musicMode() == undefined) {
            if (AVWEB.avwSysSetting().optMusicMode != undefined) {
                ClientData.userOpt_musicMode(AVWEB.avwSysSetting().optMusicMode);
            } else {
                ClientData.userOpt_musicMode(1);
            }
        }
        if (ClientData.userOpt_videoMode() == null || ClientData.userOpt_videoMode() == undefined) {
            ClientData.userOpt_videoMode(1);
        }

        // マーキング(コンテンツを開いた時に表示する)
        if (ClientData.userOpt_makingDsp() == null || ClientData.userOpt_makingDsp() == undefined) {
            ClientData.userOpt_makingDsp(1);
        }

        // 毎回ログアウトの時、バックアップするかどうかは必ず確認する
        if (ClientData.userOpt_bkConfirmFlg() == null || ClientData.userOpt_bkConfirmFlg() == undefined) {
            ClientData.userOpt_bkConfirmFlg(1);
        }

        // タブ・ブラウザ終了・F5時のアラートが表示する
        if (ClientData.userOpt_closeOrRefreshAlert() == null || ClientData.userOpt_closeOrRefreshAlert() == undefined) {
            ClientData.userOpt_closeOrRefreshAlert(1);
        }

        // Set default value for options backup: marking -> checked
        if (ClientData.userOpt_bkMakingFlag() == null || ClientData.userOpt_bkMakingFlag() == undefined) {
            ClientData.userOpt_bkMakingFlag(1);
        }
        // Set default value for options backup: memo -> checked
        if (ClientData.userOpt_bkMemoFlag() == null || ClientData.userOpt_bkMemoFlag() == undefined) {
            ClientData.userOpt_bkMemoFlag(1);
        }
        // Set default value for options backup: bookmark -> checked
        if (ClientData.userOpt_bkShioriFlag() == null || ClientData.userOpt_bkShioriFlag() == undefined) {
            ClientData.userOpt_bkShioriFlag(1);
        }

        // Set default value for logoutMode (backup auto and logout)
        if (ClientData.userOpt_logoutMode() == null || ClientData.userOpt_logoutMode() == undefined) {
            ClientData.userOpt_logoutMode(0);
        }

        // set default page transition No.4

        if (ClientData.userOpt_pageTransition() == null || ClientData.userOpt_logoutMode() == undefined) {
            ClientData.userOpt_pageTransition(0);
        }
        if (ClientData.userOpt_pageTransitionPeriod() == null || ClientData.userOpt_pageTransitionPeriod() == undefined) {
            ClientData.userOpt_pageTransitionPeriod(1);
        }

    }
2288 2289
});

2290 2291
// Unlock the locked screen by inputing password on screen to check
// authentication
2292
COMMON.unlockFunction = function(inputPass) {
2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354
    var forceUnlockFunc = arguments[1]; // added secret arguments :
                                        // forceUnlockFunction
    var result = false;
    var params = {
        previousSid : ClientData.userInfo_sid(),
        loginId : ClientData.userInfo_loginId_session(),
        password : inputPass,
        urlpath : ClientData.userInfo_accountPath()
    };

    // Get url to login
    // var sysSettings = AVWEB.avwSysSetting();
    var apiLoginUrl = ClientData.conf_apiLoginUrl(); // sysSettings.apiLoginUrl;
    var errorCode = '';
    AVWEB.avwCmsApiSyncWithUrl(apiLoginUrl, null, 'webClientLogin', 'GET', params, function(data) {
        if (data.result == 'success') {
            ClientData.userInfo_sid(data.sid);
            ClientData.userInfo_sid_local(data.sid);
            // バックアップにも保持
            ClientData.userInfo_sid_local_bak(data.sid);

            result = true;
            // forceUnlockFunc();

            // update status wait lockscreen
            var serviceOptionList = data.serviceOptionList;
            $.each(serviceOptionList, function(i, option) {

                if (option.serviceOptionId == 60) {
                    ClientData.serviceOpt_web_screen_lock(option.value);
                } else if (option.serviceOptionId == 61) {
                    ClientData.serviceOpt_web_screen_lock_wait(option.value);
                }
            });

        }
    }, function(xhr, statusText, errorThrown) {
        if (xhr.responseText && xhr.status != 0) {
            errorCode = JSON.parse(xhr.responseText);
        } else {
            errorCode = {
                errorMessage : "E001"
            };
        }
    });

    if (result == true) {
        // ビューア画面ならイベントのアンロック
        if ($("#viewer").length) {
            // 表示状態か
            if ($('#viewer').is(':visible')) {
                if (window.CONTENTVIEW_EVENTS) {
                    CONTENTVIEW_EVENTS.onUnlock();
                }
            }
        }
    }
    return {
        'result' : result,
        'errorCode' : errorCode,
        'newTimeout' : COMMON.getTimeWaitLockScreen()
    };
2355
};
2356 2357

/*
2358 2359
 * Set starting log for reading content
 */
Masaru Abe committed
2360
COMMON.SetStartLog = function(strContentId) {
2361

2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407
    var isFound = false;
    var arrContentLogs = ClientData.ContentLogData();
    for ( var nIndex = 0; nIndex < arrContentLogs.length; nIndex++) {
        if (arrContentLogs[nIndex].contentid == strContentId) {

            if (!ClientData.isStreamingMode()) {
                arrContentLogs[nIndex].readingStartDate = new Date();
                arrContentLogs[nIndex].readingEndDate = (new Date()).addSeconds(1);
                // Reading time
                arrContentLogs[nIndex].readingTime = arrContentLogs[nIndex].readingEndDate.subtractBySeconds(arrContentLogs[nIndex].readingStartDate);
            }
            isFound = true;
            break;
        }
    }
    if (isFound == false) {
        var curr = new Date();
        var curr1 = new Date();
        var log = new LogEntity();
        log.readingStartDate = curr;
        log.contentid = strContentId;

        // Set 1 second
        curr1.setSeconds(curr.getSeconds() + 1);
        log.readingEndDate = curr1;
        // Reading time
        log.readingTime = log.readingEndDate.subtractBySeconds(log.readingStartDate);

        // デバイスタイプ判定
        var deviceType = 4;
        if (ClientData.isStreamingMode()) {
            if (CONTENTVIEW_GENERAL.avwUserEnvObj.os == "ipad") {
                deviceType = 1;
            } else if (CONTENTVIEW_GENERAL.avwUserEnvObj.os == "iphone") {
                deviceType = 2;
            } else if (CONTENTVIEW_GENERAL.avwUserEnvObj.os == "android") {
                deviceType = 3;
            }
        }
        log.deviceTypeId = deviceType;

        // GPS
        log.latitude = ClientData.latitude();
        log.longitude = ClientData.longitude();

        // PageLog 1ページ目セット(1レコードは必須)
vietdo committed
2408
        if(CONTENTVIEW_GENERAL.contentType == COMMON.ContentTypeKeys.Type_PDF || 
2409 2410
        		CONTENTVIEW_GENERAL.contentType == COMMON.ContentTypeKeys.Type_NoFile || 
        		CONTENTVIEW_GENERAL.contentType == COMMON.ContentTypeKeys.Type_PanoImage){
vietdo committed
2411 2412 2413 2414
        	var pageLog = new PageLogEntity();
            pageLog.contentid = strContentId;
            log.pageLogArray.push(pageLog);
        }
2415 2416 2417 2418 2419 2420
        // Add to storage
        arrContentLogs.push(log);
    }

    // Set back to storage
    ClientData.ContentLogData(arrContentLogs);
2421 2422
};

Masaru Abe committed
2423
/*
2424 2425
 * Set starting log for reading content
 */
Masaru Abe committed
2426 2427
COMMON.SetGpsLog = function(strContentId) {

2428
    var arrContentLogs = ClientData.ContentLogData();
Masaru Abe committed
2429

2430 2431 2432 2433 2434 2435 2436 2437 2438 2439
    for ( var nIndex = 0; nIndex < arrContentLogs.length; nIndex++) {
        if (arrContentLogs[nIndex].contentid == strContentId) {
            // GPS
            arrContentLogs[nIndex].latitude = ClientData.latitude();
            arrContentLogs[nIndex].longitude = ClientData.longitude();
            break;
        }
    }
    // Set back to storage
    ClientData.ContentLogData(arrContentLogs);
2440

Masaru Abe committed
2441 2442
};

2443
// Set ending log for reading content
Masaru Abe committed
2444
COMMON.SetEndLog = function(strContentId) {
2445

2446 2447
    // var log = new LogEntity(); //無駄なのでコメント
    var arrContentLogs = ClientData.ContentLogData();
2448

2449 2450 2451 2452 2453 2454
    for ( var nIndex = 0; nIndex < arrContentLogs.length; nIndex++) {
        if (arrContentLogs[nIndex].contentid == strContentId) {
            // Found content -> set ending date
            var dateEnd = new Date();
            var dateStart = new Date(arrContentLogs[nIndex].readingStartDate);
            arrContentLogs[nIndex].readingEndDate = dateEnd;
2455

2456 2457
            // Calculate to seconds
            arrContentLogs[nIndex].readingTime = dateEnd.subtractBySeconds(dateStart);
2458

2459 2460 2461
        }
    }
    ClientData.ContentLogData(arrContentLogs);
2462 2463
};

Masaru Abe committed
2464
// 1ページ分のページ閲覧ログを作成
2465
COMMON.SetPageLog = function(strContentId, strPageNo) {
2466
	
2467
    var arrContentLogs = ClientData.ContentLogData();
2468

2469 2470
    for ( var nIndex = 0; nIndex < arrContentLogs.length; nIndex++) {
        if (arrContentLogs[nIndex].contentid == strContentId) {
2471

2472 2473 2474
            // PageLog追加
            var pageLog = new PageLogEntity();
            pageLog.contentid = strContentId;
2475 2476
            if(CONTENTVIEW_GENERAL.contentType == COMMON.ContentTypeKeys.Type_PanoImage || 
            		CONTENTVIEW_GENERAL.contentType == COMMON.ContentTypeKeys.Type_PanoMovie || 
2477
            		CONTENTVIEW_GENERAL.contentType == COMMON.ContentTypeKeys.Type_ObjectVR){
vietdo committed
2478 2479 2480 2481
            	pageLog.pageNo = strPageNo;
            }else{
            	pageLog.pageNo = strPageNo + 1; // 0始まりのページ番号
            }            
2482
            arrContentLogs[nIndex].pageLogArray.push(pageLog);
2483

2484 2485 2486
        }
    }
    ClientData.ContentLogData(arrContentLogs);
2487

2488 2489 2490 2491
    // ストリーミングモード
    if (ClientData.isStreamingMode()) {
        CONTENTVIEW_STREAMING.movePage(strPageNo + 1);
    }
2492

Masaru Abe committed
2493
};
2494

Masaru Abe committed
2495
// 1アクションのオブジェクトログを作成
2496
COMMON.SetObjectLog = function(strContentId, objectLog) {
2497

2498 2499 2500 2501
    // オーサリングプレビューなら無視
    if (COMMON.isAuthoringPreview()) {
        return;
    }
2502

2503
    var arrContentLogs = ClientData.ContentLogData();
2504

2505 2506 2507 2508
    for ( var nIndex = 0; nIndex < arrContentLogs.length; nIndex++) {
        if (arrContentLogs[nIndex].contentid == strContentId) {
            // ObjectLog追加
            arrContentLogs[nIndex].objectLogArray.push(objectLog);
2509

2510 2511 2512
        }
    }
    ClientData.ContentLogData(arrContentLogs);
Masaru Abe committed
2513

Masaru Abe committed
2514
};
Masaru Abe committed
2515

Masaru Abe committed
2516
// 前回の1アクションのオブジェクトログの利用時間を設定
2517
COMMON.SetObjectLogActionTime = function(strContentId, objectId, actionTime) {
2518

2519
    var arrContentLogs = ClientData.ContentLogData();
2520

2521 2522 2523 2524 2525 2526 2527 2528 2529 2530
    for ( var nIndex = 0; nIndex < arrContentLogs.length; nIndex++) {
        if (arrContentLogs[nIndex].contentid == strContentId) {
            if (arrContentLogs[nIndex].objectLogArray.length > 0) {
                if (arrContentLogs[nIndex].objectLogArray[arrContentLogs[nIndex].objectLogArray.length - 1].objectId == objectId) {
                    arrContentLogs[nIndex].objectLogArray[arrContentLogs[nIndex].objectLogArray.length - 1].actionTime = actionTime;
                }
            }
        }
    }
    ClientData.ContentLogData(arrContentLogs);
Masaru Abe committed
2531

Masaru Abe committed
2532
};
Masaru Abe committed
2533

2534 2535 2536
//カスタムログを作成
COMMON.SetCustomLog = function(strContentId, customLog) {

2537 2538 2539 2540
    // オーサリングプレビューなら無視
    if (COMMON.isAuthoringPreview()) {
        return;
    }
2541

2542
    var arrContentLogs = ClientData.ContentLogData();
2543

2544 2545 2546 2547 2548 2549 2550
    for ( var nIndex = 0; nIndex < arrContentLogs.length; nIndex++) {
        if (arrContentLogs[nIndex].contentid == strContentId) {
            // ObjectLog追加
            arrContentLogs[nIndex].customLogArray.push(customLog);
        }
    }
    ClientData.ContentLogData(arrContentLogs);
2551 2552 2553

};

2554
/*
2555 2556
 * Register reading log of content to server by calling api
 */
Masaru Abe committed
2557
COMMON.RegisterLog = function(is) {
Masaru Abe committed
2558

2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581
    // オーサリングプレビューなら無視
    if (COMMON.isAuthoringPreview()) {
        return;
    }

    var arrContentLogs = ClientData.ContentLogData();
    var isError = false;

    for ( var nIndex = 0; nIndex < arrContentLogs.length; nIndex++) {
        var dateEnd = new Date(arrContentLogs[nIndex].readingEndDate);
        var dateStart = new Date(arrContentLogs[nIndex].readingStartDate);

        // ページログJSONデータの作成
        var pageLogJson = "";
        var objectLogJson = "";
        var customLogJson = "";

        // biz/adモードで詳細ログY か getitsでgetits詳細ログY の場合
        if ((ClientData.isGetitsMode() == false && ClientData.serviceOpt_usable_readinglog_object() == 'Y')
                || (ClientData.isGetitsMode() == true && ClientData.serviceOpt_reader_readinglog_object() == 'Y')) {
            var pageLogArray = arrContentLogs[nIndex].pageLogArray;
            // 詳細ログオプションが有効ならページ閲覧ログデータ作成
            if (pageLogArray != null && pageLogArray.length > 0) {
2582

2583 2584 2585 2586 2587
                var lines = [];
                // 終了時間と閲覧時間の設定
                var pageLogStart;
                var pageLogEnd;
                // 2レコード目からチェック
2588
                for ( var nIndex2 = 1; nIndex2 < pageLogArray.length; nIndex2++) {
2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795
                    // 一つ前のログの終了日時がnullなら次のレコードの開始日時をセット
                    if (pageLogArray[nIndex2 - 1].readingEndDate == null) {
                        pageLogArray[nIndex2 - 1].readingEndDate = pageLogArray[nIndex2].readingStartDate;
                    }
                    pageLogStart = new Date(pageLogArray[nIndex2 - 1].readingStartDate);
                    pageLogEnd = new Date(pageLogArray[nIndex2 - 1].readingEndDate);
                    // 時間差から閲覧秒セット
                    pageLogArray[nIndex2 - 1].readingTime = pageLogEnd.subtractBySeconds(pageLogStart);

                }
                // 最終レコードの処理
                if (pageLogArray[pageLogArray.length - 1].readingEndDate == null) {
                    pageLogArray[pageLogArray.length - 1].readingEndDate = new Date();
                }
                pageLogStart = new Date(pageLogArray[pageLogArray.length - 1].readingStartDate);
                pageLogEnd = new Date(pageLogArray[pageLogArray.length - 1].readingEndDate);
                // 時間差から閲覧秒セット
                pageLogArray[pageLogArray.length - 1].readingTime = pageLogEnd.subtractBySeconds(pageLogStart);

                // JSONデータ作成
                for ( var nIndex2 = 0; nIndex2 < pageLogArray.length; nIndex2++) {
                    pageLogStart = new Date(pageLogArray[nIndex2].readingStartDate);
                    pageLogEnd = new Date(pageLogArray[nIndex2].readingEndDate);
                    // 3秒以上なら記録する
                    if (pageLogArray[nIndex2].readingTime > 2) {
                        var line = [];
                        line.push(pageLogArray[nIndex2].pageNo);
                        line.push(pageLogStart.jpDateTimeString1());
                        line.push(pageLogEnd.jpDateTimeString1());
                        line.push(pageLogArray[nIndex2].readingTime);
                        lines.push(line);
                        // alert("PageLog Line:" + JSON.stringify( line ) );
                    }
                }
                // alert("PageLog Lines:" + JSON.stringify( lines ) );

                if (lines.length > 0) {
                    pageLogJson = "{ header:[\"pageNo\",\"readingStartDate\",\"readingEndDate\",\"readingTime\"],lines:";
                    pageLogJson = pageLogJson + JSON.stringify(lines);
                    pageLogJson = pageLogJson + "}";
                    // console.log("JSON:" + pageLogJson);
                }
            }

            var objectLogArray = arrContentLogs[nIndex].objectLogArray;
            // 詳細ログオプションが有効ならページ閲覧ログデータ作成
            if (objectLogArray != null && objectLogArray.length > 0) {

                var lines = [];
                var actionDate;

                // JSONデータ作成
                for ( var nIndex2 = 0; nIndex2 < objectLogArray.length; nIndex2++) {
                    actionDate = new Date(objectLogArray[nIndex2].actionDate);
                    var line = [];

                    if (objectLogArray[nIndex2].objectId != null) {
                        line.push(actionDate.jpDateTimeString1());
                        line.push(objectLogArray[nIndex2].pageNo);
                        line.push(objectLogArray[nIndex2].objectId);
                        line.push(objectLogArray[nIndex2].resourceId);
                        line.push(objectLogArray[nIndex2].mediaType);
                        line.push(objectLogArray[nIndex2].actionType);
                        line.push(objectLogArray[nIndex2].actionValue);
                        line.push(objectLogArray[nIndex2].actionTime);
                        line.push(objectLogArray[nIndex2].locationX);
                        line.push(objectLogArray[nIndex2].locationY);
                        line.push(objectLogArray[nIndex2].locationHeight);
                        line.push(objectLogArray[nIndex2].locationWidth);
                        if (objectLogArray[nIndex2].eventType != null) {
                            line.push(objectLogArray[nIndex2].eventType);
                        } else {
                            line.push("");
                        }

                        lines.push(line);
                        // console.log("ObjectLog Line:" + JSON.stringify( line
                        // ) );

                    }
                }
                // console.log("ObjectLog Lines:" + JSON.stringify( lines ) );

                if (lines.length > 0) {
                    objectLogJson = "{ header:[\"actionDate\",\"pageNo\",\"objectId\",\"resourceId\",\"mediaType\",\"actionType\",\"actionValue\",\"actionTime\",\"locationX\",\"locationY\",\"locationHeight\",\"locationWidth\",\"eventType\"],";
                    objectLogJson = objectLogJson + "lines:";
                    objectLogJson = objectLogJson + JSON.stringify(lines);
                    objectLogJson = objectLogJson + "}";
                    // console.log("JSON:" + objectLogJson);
                }

            }

        }

        //カスタムログが有効な場合
        if(ClientData.serviceOpt_html_custom_log() == 'Y'){

            var customLogArray = arrContentLogs[nIndex].customLogArray;
            // カスタムログオプションが有効ならログデータ作成
            if (customLogArray != null && customLogArray.length > 0) {

                var lines = [];
                var actionDate;

                // JSONデータ作成
                for ( var nIndex2 = 0; nIndex2 < customLogArray.length; nIndex2++) {
                    actionDate = new Date(customLogArray[nIndex2].actionDate);
                    var line = [];

                    line.push(actionDate.jpDateTimeString1());

                    if (customLogArray[nIndex2].param1 != null) {
                        line.push(customLogArray[nIndex2].param1);
                    } else {
                        line.push("");
                    }

                    if (customLogArray[nIndex2].param2 != null) {
                        line.push(customLogArray[nIndex2].param2);
                    } else {
                        line.push("");
                    }

                    if (customLogArray[nIndex2].param3 != null) {
                        line.push(customLogArray[nIndex2].param3);
                    } else {
                        line.push("");
                    }

                    if (customLogArray[nIndex2].param4 != null) {
                        line.push(customLogArray[nIndex2].param4);
                    } else {
                        line.push("");
                    }

                    if (customLogArray[nIndex2].param5 != null) {
                        line.push(customLogArray[nIndex2].param5);
                    } else {
                        line.push("");
                    }

                    lines.push(line);

                }

                if (lines.length > 0) {
                    customLogJson = "{ header:[\"actionDate\",\"param1\",\"param2\",\"param3\",\"param4\",\"param5\"],";
                    customLogJson = customLogJson + "lines:";
                    customLogJson = customLogJson + JSON.stringify(lines);
                    customLogJson = customLogJson + "}";
                }

            }
        }

        var params = {
            sid : ClientData.userInfo_sid(),
            contentId : arrContentLogs[nIndex].contentid,
            readingStartDate : dateStart.jpDateTimeString1(),
            readingEndDate : dateEnd.jpDateTimeString1(),
            readingTime : arrContentLogs[nIndex].readingTime,
            deviceTypeId : arrContentLogs[nIndex].deviceTypeId,
            latitude : arrContentLogs[nIndex].latitude,
            longitude : arrContentLogs[nIndex].longitude,
            pageLog : pageLogJson,
            objectLog : objectLogJson,
            customLog : customLogJson,
            isStreaming : ClientData.isStreamingMode()
        };
        // API送信結果判定
        arrContentLogs[nIndex].sendResult = false;
        AVWEB.avwCmsApiSync(ClientData.userInfo_accountPath(), "contentReadingLog", 'post', params, function(data) {
            if (data.result == 'success') {
                // 成功したログは削除
                arrContentLogs[nIndex].sendResult = true;
            }
        }, function(xhr, b, c) {
            if (xhr.status != 0) {
                isError = true;
                var xhrData = JSON.parse(xhr.responseText);
                if (xhrData && xhrData.httpStatus == 500) {
                    // なんらか不正なデータなので送信成功にして捨てる
                    arrContentLogs[nIndex].sendResult = true;
                }
            } else {
                AVWEB.showSystemError();
            }
        });
    }
    ;
    if (AVWEB.avwHasError()) {
        return;
    }
    // Clear logs in local
    if (!isError) {
        ClientData.ContentLogData([]);
    } else {
        // 送信成功したログは削除
        var arrTarget = [];
        for ( var nIndex = 0; nIndex < arrContentLogs.length; nIndex++) {
            if (arrContentLogs[nIndex].sendResult == false) {
                arrTarget.push(arrContentLogs[nIndex]);
            }
        }
        ClientData.ContentLogData(arrTarget);
    }
2796 2797 2798
};

// Disable specified objects
Masaru Abe committed
2799
COMMON.disable = function() {
2800 2801 2802 2803 2804
    for ( var nIndex = 0; nIndex < arguments.length; nIndex++) {
        if ($(arguments[nIndex])) {
            $(arguments[nIndex]).attr('disabled', 'disabled');
        }
    }
2805 2806
};
// Enable specified objects
Masaru Abe committed
2807
COMMON.enable = function() {
2808 2809 2810 2811 2812
    for ( var nIndex = 0; nIndex < arguments.length; nIndex++) {
        if ($(arguments[nIndex])) {
            $(arguments[nIndex]).removeAttr('disabled');
        }
    }
2813 2814 2815
};

// Stop waiting screen
Masaru Abe committed
2816
COMMON.StopWaitProcess = function() {
2817
    $('#avw-sys-modal-wait').hide();
2818 2819 2820
};

// Show waiting screen
Masaru Abe committed
2821
COMMON.WaitProcess = function() {
2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848
    if (document.getElementById('avw-sys-modal-wait')) {
        $('#avw-sys-modal-wait').show();
    } else {
        var tags = '<div id="avw-sys-modal-wait"><img id="avw-sys-modal-wait-img" src="img/data_loading.gif"/></div>';
        $('body').prepend(tags);
        $('#avw-sys-modal-wait').css({
            'opacity' : 0.7,
            'position' : 'fixed',
            'top' : '0',
            'left' : '0',
            'width' : $(window).width(),
            'height' : $(window).height(),
            'background' : '#999',
            'z-index' : 100
        });

        $("#avw-sys-modal-wait-img").center();

        // resize error page
        $(window).resize(function() {
            $('#avw-sys-modal-wait').css({
                'width' : $(window).width(),
                'height' : $(window).height()
            });
            $("#avw-sys-modal-wait-img").center();
        });
    }
2849 2850 2851
};

// Hide the locking layout
Masaru Abe committed
2852
COMMON.unlockLayout = function() {
2853
    $('#avw-sys-modal').hide();
2854 2855 2856
};

// Show the locking layout
Masaru Abe committed
2857
COMMON.lockLayout = function() {
2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880
    if (document.getElementById('avw-sys-modal')) {
        $('#avw-sys-modal').show();
    } else {
        var tags = '<div id="avw-sys-modal"></div>';
        $('body').prepend(tags);
        $('#avw-sys-modal').css({
            'opacity' : 0.7,
            'position' : 'fixed',
            'top' : '0',
            'left' : '0',
            'width' : $(window).width(),
            'height' : $(window).height(),
            'background' : '#999',
            'z-index' : 100
        });
        // resize error page
        $(window).resize(function() {
            $('#avw-sys-modal').css({
                'width' : $(window).width(),
                'height' : $(window).height()
            });
        });
    }
2881 2882 2883
};

// Function to set position of object to center
2884
jQuery.fn.center = function() {
2885
    this.css("position", "fixed");
2886

2887 2888
    this.css("top", (($(window).height() - this.height()) / 2) + "px");
    this.css("left", (($(window).width() - this.width()) / 2) + "px");
2889

2890
    return this;
2891 2892
};
// Function to set position of object to top
2893
jQuery.fn.top = function() {
2894 2895
    this.css("position", "absolute");
    this.css("top", ($(window).scrollTop() + 1) + "px");
2896

2897
    return this;
2898 2899
};
// Function to set position of object to right
2900
jQuery.fn.right = function() {
2901 2902
    this.css("position", "absolute");
    this.css("left", ($(window).width() - this.width() - 5) + $(window).scrollLeft() + "px");
2903

2904
    return this;
2905 2906
};
// Function to set position of object to bottom
2907
jQuery.fn.bottom = function() {
2908 2909
    this.css("position", "absolute");
    this.css("top", ($(window).height() - this.height() - 5) + $(window).scrollTop() + "px");
2910

2911
    return this;
2912 2913
};
// Replace all text by new text
2914
String.prototype.replaceAll = function(oldText, newText) {
2915 2916 2917 2918 2919
    var strResult = this;
    while (strResult.indexOf(oldText) >= 0) {
        strResult = strResult.replace(oldText, newText);
    }
    return strResult;
2920 2921 2922
};

/*
2923 2924
 * Get string by number of lines
 */
Masaru Abe committed
2925
COMMON.getLines = function(source, number) {
2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939
    var result = "";
    var arrSource = new Array();
    arrSource = source.split('\n');
    for ( var i = 0; i < number; i++) {
        if (i >= arrSource.length) {
            break;
        }
        // count \n character occured
        if (i < (source.split('\n').length) && i != 0) {
            result += "\n";
        }
        result += arrSource[i];
    }
    return result;
2940 2941 2942
};

/*
2943 2944
 * Convert yyyy-MM-dd hh:mm:ss.f to Date
 */
Masaru Abe committed
2945
COMMON.convertToDate = function(input) {
2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994
    var dateResult;
    var nYear = 0;
    var nMonth = 0;
    var nDay = 0;
    var nHour = 0;
    var nMinute = 0;
    var nSecond = 0;
    var strTemp = input;
    var nIndex;

    dateResult = new Date();
    try {

        // Get year
        nIndex = strTemp.indexOf("-");
        nYear = Number(strTemp.substr(0, nIndex));
        // Get month
        strTemp = strTemp.substr(nIndex + 1);
        nIndex = strTemp.indexOf("-");
        nMonth = Number(strTemp.substr(0, nIndex));
        // Get day
        strTemp = strTemp.substr(nIndex + 1);
        nIndex = strTemp.indexOf(" ");
        nDay = Number(strTemp.substr(0, nIndex));
        // Get hour
        strTemp = strTemp.substr(nIndex + 1);
        nIndex = strTemp.indexOf(":");
        nHour = Number(strTemp.substr(0, nIndex));
        // Get minute
        strTemp = strTemp.substr(nIndex + 1);
        nIndex = strTemp.indexOf(":");
        nMinute = Number(strTemp.substr(0, nIndex));
        // Get second
        strTemp = strTemp.substr(nIndex + 1);
        nIndex = strTemp.indexOf(".");
        nSecond = Number(strTemp.substr(0, nIndex));

        dateResult.setYear(nYear);
        dateResult.setMonth(nMonth - 1);
        dateResult.setDate(nDay);
        dateResult.setHours(nHour);
        dateResult.setMinutes(nMinute);
        dateResult.setSeconds(nSecond);

    } catch (e) {
        //
    }

    return dateResult;
2995

2996 2997 2998
};

/*
2999 3000
 * Escape html
 */
Masaru Abe committed
3001
COMMON.htmlEncode = function(value) {
3002
    return jQuery('<div/>').text(value || '').html();
3003 3004 3005
};

/*
3006 3007
 * Check if browser is on touch device
 */
Masaru Abe committed
3008
COMMON.isTouchDevice = function() {
3009 3010 3011 3012 3013
    var is_touch_device = 'ontouchstart' in document.documentElement;
    if (is_touch_device) {
        return true;
    }
    return false;
3014 3015 3016
};

/*
3017 3018
 * Get total bytes of jp chars
 */
Masaru Abe committed
3019
COMMON.getBytes = function(value) {
3020
    var escapedStr = encodeURI(value);
3021

3022 3023 3024 3025 3026 3027
    var count;
    if (escapedStr.indexOf("%") != -1) {
        count = escapedStr.split("%").length - 1;
        if (count == 0)
            count++; // perverse case; can't happen with real UTF-8
        var tmp = escapedStr.length - (count * 3);
3028

3029
        count = (count / 3) * 2 + tmp;
3030

3031 3032 3033 3034
    } else {
        count = escapedStr.length
    }
    return count;
3035 3036
};
/*
3037 3038
 * Truncate by bytes
 */
Masaru Abe committed
3039
COMMON.truncateByBytes = function(value, byteCount) {
3040 3041 3042 3043 3044 3045 3046 3047 3048
    var strResult = "";
    for ( var nIndex = 0; nIndex < value.length; nIndex++) {
        if (COMMON.getBytes(strResult + value[nIndex]) <= byteCount) {
            strResult += value[nIndex];
        } else {
            break;
        }
    }
    return strResult;
3049 3050 3051
};

COMMON.truncate = function(strInput, length) {
3052 3053 3054 3055 3056
    if (strInput.length <= length) {
        return strInput;
    } else {
        return strInput.substring(0, length) + "...";
    }
Masaru Abe committed
3057 3058 3059
};

COMMON.ToogleLogoutNortice = function() {
3060 3061 3062 3063 3064 3065 3066
    if (COMMON.isAnonymousLogin()) {
        return;
    }
    var isShow = false;
    if (ClientData.userOpt_closeOrRefreshAlert() == 1) { // Checked
        isShow = true;
    }
3067

3068 3069 3070 3071 3072
    if (isShow == false) {
        window.onbeforeunload = null;
    } else {
        AVWEB.avwSetLogoutNortice();
    }
3073 3074 3075
};

/*
3076 3077
 * Get UTC Time ( GMT + 0 )
 */
Masaru Abe committed
3078
COMMON.getUtcTime = function() {
3079
    var curTime = new Date();
3080

3081 3082
    /* get time zone */
    var timeZone = curTime.getTimezoneOffset();
3083

3084
    var resultTime = new Date(curTime.getTime() + (timeZone * 60000));
3085

3086
    return resultTime;
3087 3088 3089 3090

};

// Convert UTC time to Date object
Masaru Abe committed
3091
COMMON.convertUtcToDate = function(utcTime) {
3092
    return new Date(Number(utcTime));
3093 3094 3095
};

// Get UUID version 4
Masaru Abe committed
3096
COMMON.getUUID = function() {
3097
    return uuid.v4();
3098 3099 3100
};

/*
3101 3102
 * Check is anonymous user login
 */
Masaru Abe committed
3103
COMMON.isAnonymousLogin = function() {
3104
    return AVWEB.avwSysSetting().anonymousLoginFlg;
Masaru Abe committed
3105
};
3106 3107

/* Check if current browser is IE9 */
Masaru Abe committed
3108
COMMON.isIE9 = function() {
3109
    var ua = window.navigator.userAgent.toLowerCase();
3110

3111 3112 3113 3114
    if (/msie 9.0/.test(ua)) {
        return true;
    }
    return false;
3115 3116 3117
};

/* Check if current browser is IE10 */
Masaru Abe committed
3118
COMMON.isIE10 = function() {
3119 3120 3121 3122 3123
    var ua = window.navigator.userAgent.toLowerCase();
    if (/msie 10.0/.test(ua)) {
        return true;
    }
    return false;
3124
};
Masaru Abe committed
3125

3126 3127
// Check content type is pdf content
COMMON.isPdfContent = function(contentType) {
3128 3129 3130 3131 3132
    if (!(contentType == COMMON.ContentTypeKeys.Type_PDF)) {
        return false;
    } else {
        return true;
    }
Masaru Abe committed
3133 3134
};

3135
// set resource version data
Masaru Abe committed
3136
COMMON.setResourceVersionData = function(conId) {
3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185
    var tempResourceArr;
    var tempResource;
    // check if insert new or edit
    var flag = false;

    // if (ClientData.ResourceVersion().length <= 0 ||
    // ClientData.ResourceVersion() == null || ClientData.ResourceVersion() ==
    // 'undefined') {
    // tempResourceArr = [];
    // }
    // else {
    // tempResourceArr = ClientData.ResourceVersion();
    // }
    tempResourceArr = ClientData.ResourceVersion();

    for ( var i = 0; i < COMMON.resourceVersionArr.length; i++) {
        if (COMMON.resourceVersionArr[i].contentid == conId) {
            tempResource = COMMON.resourceVersionArr[i].resourceversion;
            break;
        }
    }

    if (tempResourceArr.length > 0) {
        for ( var j = 0; j < tempResourceArr.length; j++) {
            if (tempResourceArr[j].contentid == conId) {
                tempResourceArr[j].resourceversion = tempResource;
                flag = true;
                break;
            }
            // else {
            // flag = false;
            // }
        }

        if (!flag) {
            tempResourceArr.push({
                contentid : conId,
                resourceversion : tempResource
            });
        }

    } else {
        tempResourceArr.push({
            contentid : conId,
            resourceversion : tempResource
        });
    }

    ClientData.ResourceVersion(tempResourceArr);
3186 3187 3188
};

// set meta Version Data
Masaru Abe committed
3189 3190
COMMON.setMetaVersionData = function(conId) {

3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238
    var tempMetaArr;
    var tempMeta;
    // check if insert new or edit
    var flag = false;

    // if (ClientData.MetaVersion().length <= 0 || ClientData.MetaVersion() ==
    // null || ClientData.MetaVersion() == 'undefined') {
    // tempMetaArr = [];
    // }
    // else {
    // tempMetaArr = ClientData.MetaVersion();
    // }
    tempMetaArr = ClientData.MetaVersion();

    for ( var i = 0; i < COMMON.metaVersionArr.length; i++) {
        if (COMMON.metaVersionArr[i].contentid == conId) {
            tempMeta = COMMON.metaVersionArr[i].metaversion;
            break;
        }
    }

    if (tempMetaArr.length > 0) {
        for ( var j = 0; j < tempMetaArr.length; j++) {
            if (tempMetaArr[j].contentid == conId) {
                tempMetaArr[j].metaversion = tempMeta;
                flag = true;
                break;
            }
            // else {
            // flag = false;
            // }
        }

        if (!flag) {
            tempMetaArr.push({
                contentid : conId,
                metaversion : tempMeta
            });
        }

    } else {
        tempMetaArr.push({
            contentid : conId,
            metaversion : tempMeta
        });
    }

    ClientData.MetaVersion(tempMetaArr);
3239 3240 3241
};

// convert delivery Date
Masaru Abe committed
3242 3243
COMMON.formatDeliveryDate = function(date) {

3244 3245 3246
    var day = date.date;
    var month = eval(date.month) + 1;
    var year = eval(date.year) + 1900;
Masaru Abe committed
3247

3248
    var outputDate = year + '/' + (('' + month).length < 2 ? '0' : '') + month + '/' + (('' + day).length < 2 ? '0' : '') + day;
Masaru Abe committed
3249

3250
    return outputDate;
Masaru Abe committed
3251 3252
};

3253
// convert view Date
Masaru Abe committed
3254
COMMON.formatNormalDate = function(day, month, year) {
3255
    var outputDate = year + '/' + (('' + month).length < 2 ? '0' : '') + month + '/' + (('' + day).length < 2 ? '0' : '') + day;
Masaru Abe committed
3256

3257
    return outputDate;
Masaru Abe committed
3258 3259
};

3260
// format Image string
Masaru Abe committed
3261 3262
COMMON.formatStringBase64 = function(imgStr) {

3263
    var outputString = 'data:image/jpeg;base64,' + imgStr;
Masaru Abe committed
3264

3265
    return outputString;
Masaru Abe committed
3266 3267
};

3268 3269
// Get param url
COMMON.getUrlParam = function(name, url) {
3270

3271 3272 3273
    if (!url) {
        url = window.location.href;
    }
3274

3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285
    name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
    var regexS = "[\\?&]" + name + "=([^&#]*)";
    var regex = new RegExp(regexS);
    var results = regex.exec(url);
    if (results == null) {
        return "";
    } else {
        // alert("results[0]:" + results[0]);
        // alert("results[1]:" + results[1]);
        return results[1];
    }
Masaru Abe committed
3286 3287
};

3288 3289
// オーサリングプレビューモードか判定
COMMON.isAuthoringPreview = function() {
3290

3291 3292 3293 3294 3295
    if (AVWEB.avwSysSetting().previewFlg != undefined) {
        return AVWEB.avwSysSetting().previewFlg;
    } else {
        return false;
    }
3296

3297
};