
//名前空間用のオブジェクトを用意する
var CONTENTVIEW_GETDATA = {};

/* get url */
CONTENTVIEW_GETDATA.getURLPageImage = function(apiName) {

    var isStreaming = "false";
    if(ClientData.isStreamingMode()){
        isStreaming = "true";
    }

    var url = ClientData.conf_apiUrl();
    url = AVWEB.format(url, ClientData.userInfo_accountPath()) + '/' + apiName + '/?isStreaming=' + isStreaming;
    
    //オーサリングプレビュー対応
    if(COMMON.isAuthoringPreview() && CONTENTVIEW_GENERAL.pid != ''){
    	url = url + '&pid=' + CONTENTVIEW_GENERAL.pid;
    }
    
    return url;
};

CONTENTVIEW_GETDATA.getPageObjectsByPageIndex = function(contentData, nIndexPage) {
	CONTENTVIEW_GENERAL.pageObjects = [];

    var currentPageObjects;
    for (var nIndex = 0; nIndex < contentData.length; nIndex++) {
        if (contentData[nIndex].page == nIndexPage) {
            currentPageObjects = contentData[nIndex].objects;
            //Start Function: No.9 - Editor : Long - Summary :
            if(contentData[nIndex].contentDataSub != null && contentData[nIndex].contentDataSub.length > 0){
                //currentPageObjects["contentDataSub"] = contentData[nIndex].contentDataSub;
                for(var i = 0; i < currentPageObjects.length; i++){
                    var tempObj = currentPageObjects[i];
                    tempObj["contentDataSub"] = contentData[nIndex].contentDataSub;
                }
            }
            //End Function: No.9 - Editor : Long
            break;
        }
    }

    if (currentPageObjects != undefined) {
        for (var nIndex = 0; nIndex < currentPageObjects.length; nIndex++) {
            /*get object page*/
            if (currentPageObjects[nIndex].mediaType == 1) {/*media type = 1 */
                var pageObject = CONTENTVIEW_GETDATA.getMediaType1(currentPageObjects[nIndex]);
                /*add object to page */
                CONTENTVIEW_GENERAL.pageObjects.push(pageObject);
            } else if (currentPageObjects[nIndex].mediaType == 2) { /*mediaType = 2 */
                var pageObject = CONTENTVIEW_GETDATA.getMediaType2(currentPageObjects[nIndex]);
                /*add object to page */
                CONTENTVIEW_GENERAL.pageObjects.push(pageObject);
            } else if (currentPageObjects[nIndex].mediaType == 3) { /*mediaType = 3*/
                var pageObject = CONTENTVIEW_GETDATA.getMediaType3(currentPageObjects[nIndex]);
                /*add object to page */
                CONTENTVIEW_GENERAL.pageObjects.push(pageObject);
            } else if (currentPageObjects[nIndex].mediaType == 4) { /*mediaType = 4*/
                var pageObject = CONTENTVIEW_GETDATA.getMediaType4(currentPageObjects[nIndex]);
                /*add object to page */
                CONTENTVIEW_GENERAL.pageObjects.push(pageObject);
            } else if (currentPageObjects[nIndex].mediaType == 5) { /*mediaType = 5*/
                var pageObject = CONTENTVIEW_GETDATA.getMediaType5(currentPageObjects[nIndex]);
                /*add object to page */
                CONTENTVIEW_GENERAL.pageObjects.push(pageObject);
            } else if (currentPageObjects[nIndex].mediaType == 6) { /*mediaType = 6*/
                var pageObject = CONTENTVIEW_GETDATA.getMediaType6(currentPageObjects[nIndex]);
                /*add object to page */
                CONTENTVIEW_GENERAL.pageObjects.push(pageObject);
            } else if (currentPageObjects[nIndex].mediaType == 7) { /*mediaType = 7*/
                var pageObject = CONTENTVIEW_GETDATA.getMediaType7(currentPageObjects[nIndex]);
                /*add object to page */
                CONTENTVIEW_GENERAL.pageObjects.push(pageObject);
            } else if (currentPageObjects[nIndex].mediaType == 8) { /*mediaType = 8*/
                var pageObject = CONTENTVIEW_GETDATA.getMediaType8(currentPageObjects[nIndex]);
                /*add object to page */
                CONTENTVIEW_GENERAL.pageObjects.push(pageObject);
            } else if (currentPageObjects[nIndex].mediaType == 9) { /*mediaType = 9*/
                var pageObject = CONTENTVIEW_GETDATA.getMediaType9(currentPageObjects[nIndex]);
                /*add object to page */
                CONTENTVIEW_GENERAL.pageObjects.push(pageObject);
            } else if (currentPageObjects[nIndex].mediaType == 11) { /*mediaType = 11*/
                var pageObject = CONTENTVIEW_GETDATA.getMediaType11(currentPageObjects[nIndex]);
                /*add object to page */
                CONTENTVIEW_GENERAL.pageObjects.push(pageObject);
            } else if (currentPageObjects[nIndex].mediaType == 12) { /*mediaType = 12*/
                var pageObject = CONTENTVIEW_GETDATA.getMediaType12(currentPageObjects[nIndex]);
                /*add object to page */
                CONTENTVIEW_GENERAL.pageObjects.push(pageObject);
            } else if (currentPageObjects[nIndex].mediaType == 13) { /*mediaType = 13*/
                var pageObject = CONTENTVIEW_GETDATA.getMediaType13(currentPageObjects[nIndex]);
                /*add object to page */
                CONTENTVIEW_GENERAL.pageObjects.push(pageObject);
            }
        }
    }
};

/*get data mediaType = 1 */
CONTENTVIEW_GETDATA.getMediaType1 = function(iValueObj) {
    /*
    * Action Type = 1 : video
    * Action Type = 2 : music
    * Action Type = 3 : url
    * Action Type = 4 : image preview
    * Action Type = 5 : jump page
    * Action Type = 6 : email
    * Action Type = 7 :
    * Action Type = 8 : popup
    * Action Type = 9 : video
    * Action Type = 10 : content
    * Action Type = 11 : html
    */

    var pageObject = [];

    pageObject['mediaType'] = iValueObj.mediaType;
    pageObject['actionType'] = iValueObj.action.actionType;
    pageObject['visible'] = true;

    /*get location */
    pageObject['x'] = iValueObj.location.x;
    pageObject['y'] = iValueObj.location.y;
    pageObject['width'] = iValueObj.location.width;
    pageObject['height'] = iValueObj.location.height;
    pageObject['id'] = "MediaType1_" + iValueObj.action.actionType;

    //詳細ログ用
    try{
        pageObject["objectId"] = iValueObj.action.objectId;
    }catch(e){
        pageObject["objectId"] = "";
    }

    if (iValueObj.action.actionType == 0) {
        /*get mediaInfo */
        if (iValueObj.mediaInfo) {
            /* get image from Json */
            pageObject['imageUrl'] = AVWEB.getURL("webResourceDownload") + "&sid=" + CONTENTVIEW.getSessionId() + "&resourceId=" + iValueObj.mediaInfo.resourceId;
        } else {
            pageObject['imageUrl'] = null;
        }
    } else if (iValueObj.action.actionType == 1) {
        /*get mediaInfo */
        if (iValueObj.mediaInfo) {
            /* get image from Json */
            pageObject['imageUrl'] = AVWEB.getURL("webResourceDownload") + "&sid=" + CONTENTVIEW.getSessionId() + "&resourceId=" + iValueObj.mediaInfo.resourceId;
        } else {
            pageObject['imageUrl'] = null;
        }

        /*get video file */
        if (iValueObj.action.video) {
            pageObject['mediaFile'] = AVWEB.getURL("webResourceDownload") + "&sid=" + CONTENTVIEW.getSessionId() + "&resourceName=" + COMMON.removeExt(iValueObj.action.video);
            pageObject['media'] = iValueObj.action.video;
            pageObject['mediaResourceId'] = iValueObj.action.resourceId;
        } else {
            pageObject['mediaFile'] = '';
            pageObject['media'] = '';
            pageObject['mediaResourceId'] = '';
        }

    } else if (iValueObj.action.actionType == 2) {
        /*get mediaInfo */
        if (iValueObj.mediaInfo) {
            /* get image from Json */
            pageObject['imageUrl'] = AVWEB.getURL("webResourceDownload") + "&sid=" + CONTENTVIEW.getSessionId() + "&resourceId=" + iValueObj.mediaInfo.resourceId;
        } else {
            pageObject['imageUrl'] = null;
        }

        /*get video file */
        if (iValueObj.action.music) {
            if (CONTENTVIEW_GENERAL.avwUserEnvObj.browser == 'msie') {
                pageObject['audioFile'] = AVWEB.getURL("webResourceDownload") + "&sid=" + CONTENTVIEW.getSessionId() + "&resourceName=" + COMMON.removeExt(iValueObj.action.music) + "&isIE=true";
            } else {
                pageObject['audioFile'] = AVWEB.getURL("webResourceDownload") + "&sid=" + CONTENTVIEW.getSessionId() + "&resourceName=" + COMMON.removeExt(iValueObj.action.music);
            }
            pageObject['audio'] = iValueObj.action.music;
            pageObject['audioResourceId'] = iValueObj.action.resourceId;
        } else {
            pageObject['audioFile'] = '';
            pageObject['audio'] = "";
            pageObject['audioResourceId'] = "";
        }

    } else if (iValueObj.action.actionType == 3) {
        /*get browserType */
        if (iValueObj.action.browserType) {
            pageObject['browserType'] = iValueObj.action.browserType;
        } else {
            pageObject['browserType'] = '';
        }

        /*get browser */
        if (iValueObj.action.browser) {
            pageObject['browser'] = iValueObj.action.browser;
        } else {
            pageObject['browser'] = '';
        }

        /*get linkUrl */
        if (iValueObj.action.linkUrl) {
            pageObject['linkUrl'] = iValueObj.action.linkUrl;
        } else {
            pageObject['linkUrl'] = '';
        }

        /*get mediaInfo */
        if (iValueObj.mediaInfo) {
            /* get image from Json */
            pageObject['imageUrl'] = AVWEB.getURL("webResourceDownload") + "&sid=" + CONTENTVIEW.getSessionId() + "&resourceId=" + iValueObj.mediaInfo.resourceId;
        } else {
            pageObject['imageUrl'] = null;
        }

        /* action */
        pageObject['action'] = null;

    } else if (iValueObj.action.actionType == 4) {
        /*get mediaInfo */
        if (iValueObj.mediaInfo.resourceId) {
            /* get image from Json */
            pageObject['imageUrl'] = AVWEB.getURL("webResourceDownload") + "&sid=" + CONTENTVIEW.getSessionId() + "&resourceId=" + iValueObj.mediaInfo.resourceId;
        } else {
            pageObject['imageUrl'] = null;
        }

        /*get Image Preview */
        var dataResourceImage = iValueObj.action.preview;
        var dataImageFromResource = [];
        pageObject['imagePreviewResourceIds'] = [];
        //START TRB00077 - Editor : Long - Date: 09/24/2013- Summary : Display image preview no image
        if(dataResourceImage){
            for (var nIndex = 0; nIndex < dataResourceImage.length; nIndex++) {
                dataImageFromResource.push(AVWEB.getURL("webResourceDownload") + "&sid=" + CONTENTVIEW.getSessionId() + "&resourceName=" + COMMON.removeExt(dataResourceImage[nIndex]));
            }
            pageObject['imagePreviewResourceIds'] = iValueObj.action.resourceIds;
        }
        //END TRB00077 - Editor : Long - Date: 09/24/2013- Summary : Display image preview no image
        pageObject['imagePreview'] = dataImageFromResource;

    } else if (iValueObj.action.actionType == 5) {
        /*get mediaInfo */
        if (iValueObj.mediaInfo.resourceId) {
            /* get image from Json */
            pageObject['imageUrl'] = AVWEB.getURL("webResourceDownload") + "&sid=" + CONTENTVIEW.getSessionId() + "&resourceId=" + iValueObj.mediaInfo.resourceId;
        } else {
            pageObject['imageUrl'] = null;
        }

        /*get Image Preview */
        if (iValueObj.action.jumpPage) {
            pageObject['jumpPage'] = iValueObj.action.jumpPage;
        } else {
            pageObject['jumpPage'] = '';
        }

    }
    else if (iValueObj.action.actionType == 6) {
        /*get mediaInfo */
        if (iValueObj.mediaInfo.resourceId) {
            /* get image from Json */
            pageObject['imageUrl'] = AVWEB.getURL("webResourceDownload") + "&sid=" + CONTENTVIEW.getSessionId() + "&resourceId=" + iValueObj.mediaInfo.resourceId;
        } else {
            pageObject['imageUrl'] = null;
        }

        /*get emailSubject */
        if (iValueObj.action.emailSubject) {
            pageObject['emailSubject'] = iValueObj.action.emailSubject;
        } else {
            pageObject['emailSubject'] = '';
        }

        /*get emailAddress */
        if (iValueObj.action.emailAddress) {
            pageObject['emailAddress'] = iValueObj.action.emailAddress;
        } else {
            pageObject['emailAddress'] = '';
        }

    }
    else if (iValueObj.action.actionType == 8) {
        /*get mediaInfo */
        if (iValueObj.mediaInfo.resourceId) {
            /* get image from Json */
            pageObject['imageUrl'] = AVWEB.getURL("webResourceDownload") + "&sid=" + CONTENTVIEW.getSessionId() + "&resourceId=" + iValueObj.mediaInfo.resourceId;
        } else {
            pageObject['imageUrl'] = null;
        }

        /*get content */
        pageObject['content'] = iValueObj.action.content;
    }
    else if (iValueObj.action.actionType == 10) {
        /*get mediaInfo */
        if (iValueObj.mediaInfo.resourceId) {
            /* get image from Json */
            pageObject['imageUrl'] = AVWEB.getURL("webResourceDownload") + "&sid=" + CONTENTVIEW.getSessionId() + "&resourceId=" + iValueObj.mediaInfo.resourceId;
        } else {
            pageObject['imageUrl'] = null;
        }

        /*get contentId */
        pageObject['contentId'] = iValueObj.action.contentId;

        /*get pageNo */
        pageObject['pageNo'] = iValueObj.action.pageNo;

    }
    //Start Function : No.9 - Editor : Long - Date: 08/16/2013 - Summary :
    else if(iValueObj.action.actionType == 11){
        var resourceId = iValueObj.action.resourceId;
        var resourceUrl = "";

        //START TRB00093 - Editor : Long - Date: 09/26/2013 - Summary : Check undefine before get
        if(iValueObj.contentDataSub){

            for(var i = 0; i < iValueObj.contentDataSub.length; i++){
                var tempData = iValueObj.contentDataSub[i];

                if(tempData.resourceId == resourceId){

                    resourceUrl = tempData.resourceUrl;
                    //HTMLカスタムログオプション有り
                    if(ClientData.serviceOpt_html_custom_log() == 'Y'){
                        var apiUrl = AVWEB.getApiUrl(ClientData.userInfo_accountPath());
                        resourceUrl = resourceUrl + "?sid=" + CONTENTVIEW.getSessionId() + "&apiurl=" + apiUrl + "&cid=" + CONTENTVIEW_GENERAL.contentID;
                    }
                    break;
                }
            }
        }
        //END TRB00093 - Editor : Long - Date: 09/26/2013 - Summary : Check undefine before get

    	//CONTENTVIEW_STREAMING.debugLog("resourceUrl:" + obj.resourceUrl);

        pageObject["imageUrl"] = AVWEB.getURL("webResourceDownload") + "&sid=" + CONTENTVIEW.getSessionId() + "&resourceId=" + iValueObj.mediaInfo.resourceId;
        pageObject["resourceUrl"] = resourceUrl;
    }
    else if(iValueObj.action.actionType == 12){

        pageObject["imageUrl"] = AVWEB.getURL("webResourceDownload") + "&sid=" + CONTENTVIEW.getSessionId() + "&resourceId=" + iValueObj.mediaInfo.resourceId;
        pageObject["resourceUrl"] = resourceUrl;

        pageObject["questionNo"] = iValueObj.action.questionNo;
        pageObject["replyLimit"] = iValueObj.action.replyLimit;
        pageObject["fullScreen"] = iValueObj.action.fullScreen;
        pageObject["saveAs"] = iValueObj.action.saveAs;
        pageObject["resourceId"] = iValueObj.action.resourceId;
        pageObject["enquete"] = iValueObj.action.enquete;
        //pageObject["objectId"] = iValueObj.action.objectId;
    }
    else if(iValueObj.action.actionType == 14){

        pageObject["imageUrl"] = AVWEB.getURL("webResourceDownload") + "&sid=" + CONTENTVIEW.getSessionId() + "&resourceId=" + iValueObj.mediaInfo.resourceId;
        pageObject["resourceUrl"] = resourceUrl;

        pageObject["showResult"] = iValueObj.action.showResult;
        pageObject["sendResult"] = iValueObj.action.sendResult;
        pageObject["replyLimit"] = iValueObj.action.replyLimit;
        pageObject["fullScreen"] = iValueObj.action.fullScreen;
        pageObject["saveAs"] = iValueObj.action.saveAs;
        pageObject["resourceId"] = iValueObj.action.resourceId;
        pageObject["enquete"] = iValueObj.action.enquete;
        //pageObject["objectId"] = iValueObj.action.objectId;
    }
    else if(iValueObj.action.actionType == 15){

        pageObject["imageUrl"] = AVWEB.getURL("webResourceDownload") + "&sid=" + CONTENTVIEW.getSessionId() + "&resourceId=" + iValueObj.mediaInfo.resourceId;
        pageObject["resourceUrl"] = resourceUrl;

        pageObject["replyLimit"] = iValueObj.action.replyLimit;
        pageObject["fullScreen"] = iValueObj.action.fullScreen;
        pageObject["saveAs"] = iValueObj.action.saveAs;
        pageObject["resourceId"] = iValueObj.action.resourceId;
        pageObject["enquete"] = iValueObj.action.enquete;
        //pageObject["objectId"] = iValueObj.action.objectId;
    }
    //End Function : No.9 - Editor : Long - Date: 08/16/2013 - Summary :
    return pageObject;
};

CONTENTVIEW_GETDATA.getMediaType2 = function(iValueObj) {
    var pageObject = [];

    pageObject['mediaType'] = iValueObj.mediaType;

    /*get actionType*/
    if (iValueObj.action.actionType) {
        pageObject['actionType'] = iValueObj.action.actionType;
    } else {
        pageObject['actionType'] = '';
    }

    pageObject['id'] = "media" + iValueObj.mediaInfo.resourceId;

    /*get mediaInfo */
    if (iValueObj.mediaInfo.resourceId) {
        pageObject['mediaFile'] = AVWEB.getURL("webResourceDownload") + "&sid=" + CONTENTVIEW.getSessionId() + "&resourceId=" + iValueObj.mediaInfo.resourceId;
        pageObject['media'] = iValueObj.mediaInfo.resourceId; //video1のほうはリソース名で取得している。IDのほうが良いのでは。
    } else {
        pageObject['mediaFile'] = '';
        pageObject['media'] = '';
    }

    /*get mediaInfo */
    if (iValueObj.action.embed) {
        pageObject['embed'] = iValueObj.action.embed;
    } else {
        pageObject['embed'] = '';
    }

    pageObject['imageUrl'] = 'img/iPad_video.png';

    /*get location */
    pageObject['x'] = iValueObj.location.x;
    pageObject['y'] = iValueObj.location.y;
    pageObject['width'] = iValueObj.location.width;
    pageObject['height'] = iValueObj.location.height;
    pageObject['visible'] = true;

    //詳細ログ用
    try{
        pageObject["objectId"] = iValueObj.action.objectId;
    }catch(e){
        pageObject["objectId"] = "";
    }

    return pageObject;
};

CONTENTVIEW_GETDATA.getMediaType3 = function(iValueObj) {
    var pageObject = [];

    pageObject['mediaType'] = iValueObj.mediaType;

    /*get actionType*/
    if (iValueObj.action.actionType) {
        pageObject['actionType'] = iValueObj.action.actionType;
    } else {
        pageObject['actionType'] = '';
    }

    pageObject['id'] = "audio" + iValueObj.mediaInfo.resourceId;

    /*get mediaInfo */
    if (iValueObj.mediaInfo.resourceId) {
        if (CONTENTVIEW_GENERAL.avwUserEnvObj.browser == 'msie') {
            pageObject['audioFile'] = AVWEB.getURL("webResourceDownload") + "&sid=" + CONTENTVIEW.getSessionId() + "&resourceId=" + iValueObj.mediaInfo.resourceId + "&isIE=true";
        } else {
            pageObject['audioFile'] = AVWEB.getURL("webResourceDownload") + "&sid=" + CONTENTVIEW.getSessionId() + "&resourceId=" + iValueObj.mediaInfo.resourceId;
        }
        pageObject['audioResourceId'] = iValueObj.mediaInfo.resourceId;
    } else {
        pageObject['audioFile'] = '';
        pageObject['audioResourceId'] = '';
    }

    /*get playtype */
    pageObject['playType'] = iValueObj.action.playType;

    pageObject['imageUrl'] = 'img/iPad_music.png';

    /*get location */
    pageObject['x'] = iValueObj.location.x;
    pageObject['y'] = iValueObj.location.y;
    pageObject['width'] = iValueObj.location.width;
    pageObject['height'] = iValueObj.location.height;
    pageObject['visible'] = true;

    //詳細ログ用
    try{
        pageObject["objectId"] = iValueObj.action.objectId;
    }catch(e){
        pageObject["objectId"] = "";
    }

    return pageObject;
};

CONTENTVIEW_GETDATA.getMediaType4 = function(iValueObj) {
    var pageObject = [];

    pageObject['mediaType'] = iValueObj.mediaType;

    pageObject['id'] = iValueObj.mediaInfo.id;

    /*get image List info */
    var imageObjects = iValueObj.mediaInfo.media;

    for (var nIndex = 0; nIndex < imageObjects.length; nIndex++) {
        /* get image from Json */
        imageObjects[nIndex].fileName = AVWEB.getURL("webResourceDownload") + "&sid=" + CONTENTVIEW.getSessionId() + "&resourceId=" + imageObjects[nIndex].resourceId;
    }

    pageObject['dataObjects'] = imageObjects;

    if (iValueObj.mediaInfo.triggerType) {
        pageObject['triggerType'] = iValueObj.mediaInfo.triggerType;
    } else {
        pageObject['triggerType'] = '';
    }

    /*get image url */
    if (imageObjects.length > 0) {
        pageObject['imageUrl'] = imageObjects[0].fileName;
    } else {
        pageObject['imageUrl'] = null;
    }


    /*get location */
    pageObject['x'] = iValueObj.location.x;
    pageObject['y'] = iValueObj.location.y;
    pageObject['width'] = iValueObj.location.width;
    pageObject['height'] = iValueObj.location.height;
    pageObject['visible'] = true;

    //詳細ログ用（使わない）
    try{
        pageObject["objectId"] = iValueObj.action.objectId;
    }catch(e){
        pageObject["objectId"] = "";
    }

    return pageObject;
};

CONTENTVIEW_GETDATA.getMediaType5 = function(iValueObj) {
    var pageObject = [];

    pageObject['mediaType'] = iValueObj.mediaType;

    pageObject['id'] = iValueObj.mediaInfo.id;

    /*get video List info */
    var videoObjects = iValueObj.mediaInfo.media;
    for (var nIndex = 0; nIndex < videoObjects.length; nIndex++) {
        /* get image from Json */
        videoObjects[nIndex].fileName = AVWEB.getURL("webResourceDownload") + "&sid=" + CONTENTVIEW.getSessionId() + "&resourceId=" + videoObjects[nIndex].resourceId;
    }

    pageObject['dataObjects'] = videoObjects;

    /*get image url */
    pageObject['imageUrl'] = '';

    /*get location */
    pageObject['x'] = iValueObj.location.x;
    pageObject['y'] = iValueObj.location.y;
    pageObject['width'] = iValueObj.location.width;
    pageObject['height'] = iValueObj.location.height;
    pageObject['visible'] = true;

    //詳細ログ用（使わない）
    try{
        pageObject["objectId"] = iValueObj.action.objectId;
    }catch(e){
        pageObject["objectId"] = "";
    }

    return pageObject;
};

CONTENTVIEW_GETDATA.getMediaType6 = function(iValueObj) {
    var pageObject = [];

    pageObject['mediaType'] = iValueObj.mediaType;

    /*get actionType*/
    if (iValueObj.action.actionType) {
        pageObject['actionType'] = iValueObj.action.actionType;
    } else {
        pageObject['actionType'] = '';
    }


    if(iValueObj.mediaInfo.resourceId){
        pageObject['id'] = "trigger" + iValueObj.mediaInfo.resourceId;
    }
    else if(iValueObj.mediaInfo.resourceThumbnailId){
        pageObject['id'] = "trigger" + iValueObj.mediaInfo.resourceThumbnailId;
    }

    /*get mediaInfo */
    if (iValueObj.mediaInfo) {

        if(iValueObj.mediaInfo.resourceId){
            /* get image from Json */
            pageObject['imageUrl'] = AVWEB.getURL("webResourceDownload") + "&sid=" + CONTENTVIEW.getSessionId() + "&resourceId=" + iValueObj.mediaInfo.resourceId;
        }
        else{
            pageObject['imageUrl'] = 'img/iPad_video.png';
        }

    }
    else {
        pageObject['imageUrl'] = null;
    }

    /*get index */
    if (iValueObj.action.index) {
        pageObject['index'] = iValueObj.action.index;
    }
    else {
        pageObject['index'] = '';
    }

    /*get target */
    if (iValueObj.action.target) {
        pageObject['target'] = iValueObj.action.target;
    }
    else {
        pageObject['target'] = '';
    }

    /*get location */
    pageObject['x'] = iValueObj.location.x;
    pageObject['y'] = iValueObj.location.y;
    pageObject['width'] = iValueObj.location.width;
    pageObject['height'] = iValueObj.location.height;
    pageObject['visible'] = true;

    //詳細ログ用
    try{
        pageObject["objectId"] = iValueObj.action.objectId;
    }catch(e){
        pageObject["objectId"] = "";
    }

    return pageObject;
};

CONTENTVIEW_GETDATA.getMediaType7 = function(iValueObj) {
    var pageObject = [];

    pageObject['mediaType'] = iValueObj.mediaType;

    /*get actionType*/
    if (iValueObj.action.actionType) {
        pageObject['actionType'] = iValueObj.action.actionType;
    } else {
        pageObject['actionType'] = '';
    }

    pageObject['id'] = "testText";

    /*get mediaInfo */
    if (iValueObj.mediaInfo.content) {
        pageObject['content'] = iValueObj.mediaInfo.content;
    } else {
        pageObject['content'] = '';
    }

    if (iValueObj.action) {
        pageObject['action'] = "";
    }

    /*get location */
    pageObject['x'] = iValueObj.location.x;
    pageObject['y'] = iValueObj.location.y;
    pageObject['width'] = iValueObj.location.width;
    pageObject['height'] = iValueObj.location.height;
    pageObject['visible'] = true;

    //詳細ログ用（使わない）
    try{
        pageObject["objectId"] = iValueObj.action.objectId;
    }catch(e){
        pageObject["objectId"] = "";
    }

    return pageObject;
};

//Start Function : No.9 - Editor : Long - Date : 08/15/2013 - Summary : Handle 3d object
CONTENTVIEW_GETDATA.getMediaType8 = function(iValueObj) {
    var pageObject = [];

    //Get object Info
    pageObject['mediaType'] = iValueObj.mediaType;
    pageObject['id'] = "MediaType8_" + iValueObj.mediaInfo.resourceId;
    pageObject['actionType'] = iValueObj.action.actionType;

    //Get object Location
    pageObject['x'] = iValueObj.location.x;
    pageObject['y'] = iValueObj.location.y;
    pageObject['width'] = iValueObj.location.width;
    pageObject['height'] = iValueObj.location.height;
    pageObject['visible'] = true;

    if(iValueObj.action.actionType == 9){

        pageObject['horizonCount'] = iValueObj.mediaInfo.horizonCount;
        pageObject['verticalCount'] = iValueObj.mediaInfo.verticalCount;
        pageObject['initImage'] = AVWEB.getURL("webResourceDownload") + "&sid=" + CONTENTVIEW.getSessionId() + "&resourceId=" + iValueObj.mediaInfo.resourceId;

        var _3dViewObject = [];
        var data3d = iValueObj.action["3dview"];

        var horizonCnt = 0;
        var verticalCnt = 1;


        while(verticalCnt <= iValueObj.mediaInfo.verticalCount){
             horizonCnt++;
             if(horizonCnt > iValueObj.mediaInfo.horizonCount){
                verticalCnt++;
                if(verticalCnt > iValueObj.mediaInfo.verticalCount){
                    break;
                }
                horizonCnt = 1;
             }

             _3dViewObject[CONTENTVIEW_GETDATA.convNumTo2Char(verticalCnt)+"-"+CONTENTVIEW_GETDATA.convNumTo2Char(horizonCnt)] =
                            AVWEB.getURL("webResourceDownload") + "&sid=" + CONTENTVIEW.getSessionId()
                            + "&resourceId=" + data3d[CONTENTVIEW_GETDATA.convNumTo2Char(verticalCnt) +"-"+ CONTENTVIEW_GETDATA.convNumTo2Char(horizonCnt)].resourceId;
        }

        pageObject['3dview'] = _3dViewObject;
    }

    //詳細ログ用
    try{
        pageObject["objectId"] = iValueObj.action.objectId;
    }catch(e){
        pageObject["objectId"] = "";
    }

    return pageObject;
};

CONTENTVIEW_GETDATA.getMediaType9 = function(iValueObj) {
    var pageObject = [];

    //Get object Info
    pageObject['mediaType'] = iValueObj.mediaType;
    pageObject['id'] = "MediaType9_" + iValueObj.mediaInfo.resourceId;
    pageObject['actionType'] = iValueObj.action.actionType;

    //Get object Location
    pageObject['x'] = iValueObj.location.x;
    pageObject['y'] = iValueObj.location.y;
    pageObject['width'] = iValueObj.location.width;
    pageObject['height'] = iValueObj.location.height;
    pageObject['visible'] = true;

    //詳細ログ用
    try{
        pageObject["objectId"] = iValueObj.action.objectId;
    }catch(e){
        pageObject["objectId"] = "";
    }

    if(iValueObj.action.actionType == 11){
        var resourceId = iValueObj.mediaInfo.resourceId;
        var resourceUrl = "";

        //START TRB00093 - Editor : Long - Date: 09/26/2013 - Summary : Check undefine before get
        if(iValueObj.contentDataSub){
            for(var i = 0; i < iValueObj.contentDataSub.length; i++){
                var tempData = iValueObj.contentDataSub[i];

                if(tempData.resourceId == resourceId){
                    resourceUrl = tempData.resourceUrl;
                    //HTMLカスタムログオプション有り
                    if(ClientData.serviceOpt_html_custom_log() == 'Y'){
                        var apiUrl = AVWEB.getApiUrl(ClientData.userInfo_accountPath());
                        resourceUrl = resourceUrl + "?sid=" + CONTENTVIEW.getSessionId() + "&apiurl=" + apiUrl + "&cid=" + CONTENTVIEW_GENERAL.contentID;
                    }
                    break;
                }
            }
        }
        //START TRB00093 - Editor : Long - Date: 09/26/2013 - Summary : Check undefine before get

        pageObject["imageUrl"] = 'img/htmltype.png';
        pageObject["resourceUrl"] = resourceUrl;
    }

    return pageObject;
};

CONTENTVIEW_GETDATA.getMediaType11 = function(iValueObj) {
    var pageObject = [];
    //Get object Info
    pageObject['mediaType'] = iValueObj.mediaType;
    pageObject['id'] = "MediaType11_" + iValueObj.mediaInfo.resourceId;
    pageObject['actionType'] = iValueObj.action.actionType;

    //Get object Location
    pageObject['x'] = iValueObj.location.x;
    pageObject['y'] = iValueObj.location.y;
    pageObject['width'] = iValueObj.location.width;
    pageObject['height'] = iValueObj.location.height;
    pageObject['visible'] = true;

    //詳細ログ用
    try{
        pageObject["objectId"] = iValueObj.action.objectId;
    }catch(e){
        pageObject["objectId"] = "";
    }

    if(iValueObj.action.actionType == 12){
        var resourceId = iValueObj.mediaInfo.resourceId;

        pageObject["imageUrl"] = 'img/anket.jpg';

        pageObject["questionNo"] = iValueObj.action.questionNo;
        pageObject["replyLimit"] = iValueObj.action.replyLimit;
        pageObject["fullScreen"] = iValueObj.action.fullScreen;
        pageObject["saveAs"] = iValueObj.action.saveAs;
        pageObject["resourceId"] = resourceId;
        pageObject["enquete"] = iValueObj.action.enquete;
        //pageObject["objectId"] = iValueObj.action.objectId;
    }

    return pageObject;
};

CONTENTVIEW_GETDATA.getMediaType12 = function(iValueObj) {

	var pageObject = [];

	//Get object Info
	pageObject['mediaType'] = iValueObj.mediaType;
	pageObject['id'] = "MediaType12_" + iValueObj.mediaInfo.resourceId;
	pageObject['actionType'] = iValueObj.action.actionType;

	//Get object Location
	pageObject['x'] = iValueObj.location.x;
	pageObject['y'] = iValueObj.location.y;
	pageObject['width'] = iValueObj.location.width;
	pageObject['height'] = iValueObj.location.height;
	pageObject['visible'] = true;

	//詳細ログ用
    try{
        pageObject["objectId"] = iValueObj.action.objectId;
    }catch(e){
        pageObject["objectId"] = "";
    }

    if(iValueObj.action.actionType == 14){
    	var resourceId = iValueObj.mediaInfo.resourceId;

    	pageObject["imageUrl"] = 'img/test.png';

    	pageObject["replyLimit"] = iValueObj.action.replyLimit;
        pageObject["fullScreen"] = iValueObj.action.fullScreen;
        pageObject["saveAs"] = iValueObj.action.saveAs;
        pageObject["resourceId"] = resourceId;
        pageObject["enquete"] = iValueObj.action.enquete;
        pageObject["showResult"] = iValueObj.action.showResult;
        pageObject["sendResult"] = iValueObj.action.sendResult;
        //pageObject["objectId"] = iValueObj.action.objectId;
    }

    return pageObject;
};

CONTENTVIEW_GETDATA.getMediaType13 = function(iValueObj) {

	var pageObject = [];

	//Get object Info
	pageObject['mediaType'] = iValueObj.mediaType;
	pageObject['id'] = "MediaType12_" + iValueObj.mediaInfo.resourceId;
	pageObject['actionType'] = iValueObj.action.actionType;

	//Get object Location
	pageObject['x'] = iValueObj.location.x;
	pageObject['y'] = iValueObj.location.y;
	pageObject['width'] = iValueObj.location.width;
	pageObject['height'] = iValueObj.location.height;
	pageObject['visible'] = true;

	//詳細ログ用
    try{
        pageObject["objectId"] = iValueObj.action.objectId;
    }catch(e){
        pageObject["objectId"] = "";
    }

    if(iValueObj.action.actionType == 15){
    	var resourceId = iValueObj.mediaInfo.resourceId;

    	pageObject["imageUrl"] = 'img/quize.png';

    	pageObject["replyLimit"] = iValueObj.action.replyLimit;
        pageObject["fullScreen"] = iValueObj.action.fullScreen;
        pageObject["saveAs"] = iValueObj.action.saveAs;
        pageObject["resourceId"] = resourceId;
        pageObject["enquete"] = iValueObj.action.enquete;
        //pageObject["objectId"] = iValueObj.action.objectId;
    }

    return pageObject;
};

CONTENTVIEW_GETDATA.convNumTo2Char = function(num){
    var nRet = "";
    if(num < 10)
        nRet = "0" + num;
    else
        nRet =  "" + num;
    return nRet;
};
//End Function : No.9 - Editor : Long - Date : 08/15/2013 - Summary : Handle 3d object

/* get page index */
CONTENTVIEW_GETDATA.getPageIndex = function() {
    var content = CONTENTVIEW_GETDATA.getContent();
    return eval(content.pageIndex);
};

/* get data marking from local storage */
CONTENTVIEW_GETDATA.getDataClientStorage = function() {
    /*set default size and color */
    if (!ClientData.penOpt_size()) {
        ClientData.penOpt_size(5);
    }

    if (!ClientData.penOpt_color()) {
        ClientData.penOpt_color("fe0000");
    }

    if (!ClientData.maker_size()) {
        ClientData.maker_size(5);
    }

    if (!ClientData.maker_color()) {
        ClientData.maker_color("f8ff00");
    }

    if (!ClientData.erase_size()) {
        ClientData.erase_size(5);
    }

    CONTENTVIEW_GENERAL.isAddingMarking = ClientData.IsAddingMarking();
    CONTENTVIEW_GENERAL.penSize = ClientData.penOpt_size();
    CONTENTVIEW_GENERAL.penColor = ClientData.penOpt_color();
    CONTENTVIEW_GENERAL.makerSize = ClientData.maker_size();
    CONTENTVIEW_GENERAL.makerColor = ClientData.maker_color();
    CONTENTVIEW_GENERAL.eraseSize = ClientData.erase_size();
    CONTENTVIEW_GENERAL.markingType = ClientData.MarkingType();
};


/* get list bookmark of content */
CONTENTVIEW_GETDATA.getBookMarkListByContentID = function() {
    var bmList = [];
    var bmListResult = [];
    bmList = ClientData.BookMarkData();

    for (var nIndex = 0; nIndex < bmList.length; nIndex++) {
        if (bmList[nIndex].contentid == CONTENTVIEW_GENERAL.contentID) {
            bmListResult.push(bmList[nIndex]);
        }
    }

    return bmListResult;
};

/* get data load*/
CONTENTVIEW_GETDATA.getDataLoaded = function(data) {
    var isExist = false;

    for (var i = 0; i < data.length; i++) {
        isExist = false;
        for (var n = 0; n < CONTENTVIEW_GENERAL.arrThumbnailsLoaded.length; n++) {
            if (data[i].pageNo == CONTENTVIEW_GENERAL.arrThumbnailsLoaded[n].pageNo) {
                isExist = true;
                break;
            }
        }

        /* insert if not exist */
        if (isExist == false) {
        	CONTENTVIEW_GENERAL.arrThumbnailsLoaded.push(data[i]);
        }
    }

    /* sort data */
    CONTENTVIEW_GENERAL.arrThumbnailsLoaded.sort(function (a, b) {
        var a1 = a.pageNo, b1 = b.pageNo;
        if (a1 == b1) return 0;
        return a1 > b1 ? 1 : -1;
    });

};


/* get list info bookmark */
CONTENTVIEW_GETDATA.getBookmarklist = function(pos) {
    var isExistBookMarkInContent = false;
    CONTENTVIEW.sortBookmarkList();
    var bmList = [];
    bmList = ClientData.BookMarkData();

    for (var nIndex = 0; nIndex < bmList.length; nIndex++) {
        if (bmList[nIndex].contentid == CONTENTVIEW_GENERAL.contentID) {
            isExistBookMarkInContent = true;
            break;
        }
    }

    if (isExistBookMarkInContent == false) {
        $('#divListBookmark').children().remove();
        $('#divListBookmark').append('<span class="last">' + I18N.i18nText('msgShioriNotExists') + '</span>');

        //title start
        $('#bookmarkBoxHdBM').children().remove();
        $('#bookmarkBoxHdBM').html('<a id="bookmarkClosing" class="delete" > </a>');
        //$("#bookmarkClosing").click(CONTENTVIEW_EVENTS.closeBookmarkBox);
        $("#bookmarkClosing").on({
        	'click touchend': function(ev){
        		CONTENTVIEW_EVENTS.closeBookmarkBox(ev);
                return false;
        	},
        	'touchstart touchmove': function(){
        		//これを入れないと次にダイアログを開くと表示位置が大きくズレる
        		return false;
        	}
        });

        $('#bookmarkBoxHdBM').append(I18N.i18nText('txtShioriCtnLs'));
        //title end
        //COMMON.lockLayout();
        $('#boxBookMark').css('z-index', '101');
        $('#boxBookMark').css('display', 'block');
        $('#boxBookMark').draggable({ handle: "h1" });
        $("#boxBookMark").offset({ left: pos[0], top: pos[1] });
        $("#divListBookmark").show();
        $("#divListBookmark").offset({ left: pos[0], top: (pos[1] + $('#bookmarkBoxHdBM').height()) });
    }
    else {
    	CONTENTVIEW.handleAPIWebContentPage(CONTENTVIEW_GENERAL.dataWebContentPage, pos)
    }
};

/* get list info bookmark */
CONTENTVIEW_GETDATA.getPageIndexJson = function(pos) {
    if (CONTENTVIEW_GENERAL.dataJsonType5.length > 0) {
        $('#divListIndex').children().remove();

        // $("#divListIndex").dialog({
        // show: "blind",
        // modal: true,
        // width: CONTENTVIEW_GENERAL.WIDTH_DIALOG_INDEX,
        // height:CONTENTVIEW_GENERAL.HEIGHT_DIALOG_INDEX,
        // resizable:false,
        // closeOnEscape: false,
        // title: I18N.i18nText('txtIndex'),
        // position: pos});

        //title start
        $('#indexBoxHdIndex').children().remove();
        $('#indexBoxHdIndex').html('<a id="indexClosing" class="delete" > </a>');

        //$("#indexClosing").click(CONTENTVIEW_EVENTS.closeIndexBox);
        $("#indexClosing").on({
        	'click touchend': function(ev){
        		CONTENTVIEW_EVENTS.closeIndexBox(ev);
        		return false;
        	},
        	'touchstart touchmove': function(){
        		//これを入れないと次にダイアログを開くと表示位置が大きくズレる
        		return false;
        	}
        });

        $('#indexBoxHdIndex').append(I18N.i18nText('txtIndex'));
        //title end
        //COMMON.lockLayout();
        $('#boxIndex').css('z-index', '101');
        $('#boxIndex').css('display', 'block');
        $('#boxIndex').draggable({ handle: "h1" });
        $("#boxIndex").offset({ left: pos[0], top: pos[1] });
        $("#divListIndex").show();
        $("#divListIndex").offset({ left: pos[0], top: (pos[1] + $('#indexBoxHdIndex').height()) });

        //set data for dialog index
        var dataContent = CONTENTVIEW_GENERAL.dataJsonType5;
        var arrData = new Array();
        $.each(dataContent, function (i, value) {
            if (dataContent[i].level == 0) {
                //add parent node
                var node = new TreeNode();
                node.IsCategory = true;
                //node.Text = COMMON.htmlEncode(COMMON.truncateByBytes(dataContent[i].title, 30));
                /* check data text */
                if (COMMON.getBytes(dataContent[i].title) > 30) {
                    node.Text = COMMON.htmlEncode(COMMON.truncateByBytes(dataContent[i].title, 30)) + '...';
                } else {
                    node.Text = COMMON.htmlEncode(dataContent[i].title);
                }
                node.id = dataContent[i].ID;
                node.Value = dataContent[i].destPageNumber;
                CONTENTVIEW.AddChidrenNode(node, dataContent);

                arrData.push(node);
            }
        });

        var tree = new TreeViewIndex();
        tree.IsShowTotal = false;
        tree.Show("divListIndex", arrData, "CONTENTVIEW_EVENTS.listIndex_Callback");
        $("#divListIndex").treeview();
        $(".treeview, .treeview ul").css('padding', '0px 8px 0');
    } else {
        $('#divListIndex').children().remove();
        $('#divListIndex').append('<span class="no-item">' + I18N.i18nText('msgNoIndex') + '</span>');

        // //show dialog index
        // $("#divListIndex").dialog({
        // show: "blind",
        // modal: true,
        // resizable:false,
        // width: CONTENTVIEW_GENERAL.WIDTH_DIALOG_INDEX,
        // height:CONTENTVIEW_GENERAL.HEIGHT_DIALOG_INDEX_NO_INDEX,
        // title: I18N.i18nText('txtIndex'),
        // position: pos});

        //title start
        $('#indexBoxHdIndex').children().remove();
        $('#indexBoxHdIndex').html('<a id="indexClosing" class="delete" > </a>');

        //$("#indexClosing").click(CONTENTVIEW_EVENTS.closeIndexBox);
        $("#indexClosing").on({
        	'click touchend': function(ev){
        		CONTENTVIEW_EVENTS.closeIndexBox(ev);
                return false;
        	},
        	'touchstart touchmove': function(){
        		//これを入れないと次にダイアログを開くと表示位置が大きくズレる
        		return false;
        	}
        });

        $('#indexBoxHdIndex').append(I18N.i18nText('txtIndex'));
        //title end
        //COMMON.lockLayout();
        $('#boxIndex').css('z-index', '101');
        $('#boxIndex').css('display', 'block');
        $('#boxIndex').draggable({ handle: "h1" });
        $("#boxIndex").offset({ left: pos[0], top: pos[1] });
        $("#divListIndex").show();
        $("#divListIndex").offset({ left: pos[0], top: (pos[1] + $('#indexBoxHdIndex').height()) });

    }
};

CONTENTVIEW_GETDATA.getText = function() {
    /* init var page text */
    var data = CONTENTVIEW_GENERAL.dataWebContentPage.pages;
    var sPageText = '';
    var w = $("#wrapper").width() / 2 - $('#boxCopyText').width() / 2;
    var h = $("#wrapper").height() / 2 - $('#boxCopyText').height() / 2;

    for (var nIndex = 0; nIndex < data.length; nIndex++) {
        /* get text of current page */
        if (data[nIndex].pageNo == CONTENTVIEW.changePageIndex(CONTENTVIEW_GETDATA.getPageIndex())) {
            sPageText = COMMON.htmlEncode(data[nIndex].pageText);
            break;
        }
    }
    if (sPageText == '') {
        return { text: I18N.i18nText('txtNoTextCopy'), title: I18N.i18nText('txtTextCopy') + ' | ' + I18N.i18nText('sysAppTitle') };
    }
    else {
        var strPattern = "\n";
        var strTemp = sPageText;
        strTemp = strTemp.replaceAll(strPattern, "<br/>");
        strTemp += "<br/>";
        return { text: strTemp, title: I18N.i18nText('txtTextCopy') + ' | ' + I18N.i18nText('sysAppTitle') };
    }
};


/* get contentID */
CONTENTVIEW_GETDATA.getContentID = function() {
    /* init contentID */
    if (ClientData.common_preContentId()) {
    	CONTENTVIEW_GENERAL.contentID = ClientData.common_preContentId();
        ClientData.common_preContentId(null);
    } else if (ClientData.IsJumpBack() == true) {
        var dataJump = ClientData.JumpQueue();
        CONTENTVIEW_GENERAL.contentID = dataJump[dataJump.length - 1].oldContentID;

        //ストリーミングならデバイスに通知
        if(ClientData.isStreamingMode()){
        	CONTENTVIEW_STREAMING.moveContent(CONTENTVIEW_GENERAL.contentID);
        }

    } else {
    	CONTENTVIEW_GENERAL.contentID = ClientData.contentInfo_contentId();
    }
};

//Download resource
CONTENTVIEW_GETDATA.getResourceByIdFromAPI = function(resourceId){
    return AVWEB.getURL("webResourceDownload") + "&sid=" + CONTENTVIEW.getSessionId() + "&resourceId=" + resourceId;
};

//Get content info type Image
CONTENTVIEW_GETDATA.getContentInfoTypeImage = function(){

    var resourceUrl = CONTENTVIEW.downloadResourceById(CONTENTVIEW_GENERAL.contentID);

    CONTENTVIEW_GENERAL.resourceImage.onload = function(){
    	CONTENTVIEW_GENERAL.widthContentImage = CONTENTVIEW_GENERAL.resourceImage.width;
    	CONTENTVIEW_GENERAL.heightContentImage = CONTENTVIEW_GENERAL.resourceImage.height;

        CONTENTVIEW_GETDATA.getContent().setPageImages(1, resourceUrl).setUpPage(0);
        CONTENTVIEW.handleSliderBar();

        CONTENTVIEW_GETDATA.getContentDataForImageType();

        $('#lblSlider').text('/ ' + 1);

        //Start: TRB00019 - Editor : Long - Date : 28/08/2013 - Summary : Fix for android resize
        /* window resize event */
        $(window).resize(function () {

            if (COMMON.isTouchDevice() == true) {
                if (CONTENTVIEW_GENERAL.avwUserEnvObj.isAndroid()) {
                    var tempRatio = document.documentElement.clientWidth / window.innerWidth;
                    if (tempRatio <= 1) {
                        // Adjust position for toolbar and footer bar
                        var top = window.innerHeight - $("#footer_toolbar_1").height();
                        $("#wrapper").css("width", window.innerWidth);
                        $("#wrapper").css("height", window.innerHeight);
                        $("#footer_toolbar_1").css("top", top + "px");
                        $("#footer_toolbar_2").css("top", top + "px");
                    }
                    else {
                        var top = $(window).height() - $("#footer_toolbar_1").height();
                        $("#wrapper").css("width", $(window).width());
                        $("#wrapper").css("height", $(window).height());
                        $("#footer_toolbar_1").css("top", top + "px");
                        $("#footer_toolbar_2").css("top", top + "px");
                    }
                }
            }

            CONTENTVIEW.resizeScreen();
            CONTENTVIEW_GENERAL.isChangeSizeScreen = false;

            /* change position dialog */
            CONTENTVIEW.changePosDialog();

            /* close dialog popuptext */
            CONTENTVIEW.closeDialogResize();

        });

        /*init Image Bookmark */
        CONTENTVIEW_INITOBJECT.initImageBookmark();

        /* init image had draw */
        CONTENTVIEW_INITOBJECT.initDisplayMarking();

        /* check status */
        CONTENTVIEW.checkStatusImageMarking();

        CONTENTVIEW.trackTransforms(CONTENTVIEW_GENERAL.context_main);

        if (COMMON.isTouchDevice() == true) {
            if (CONTENTVIEW_GENERAL.avwUserEnvObj.isAndroid()) {
            	CONTENTVIEW_GENERAL.standardRatio = document.documentElement.clientWidth / window.innerWidth;
                ZOOM_DETECTOR.startDetectZoom({ time: 500,
                    callbackFunction: function (oldRatio, newRatio, oldW, oldH, newW, newH) {
                    	CONTENTVIEW_GENERAL.currentRatio = newRatio;

                    }
                });
                var top = window.innerHeight - $("#footer_toolbar_1").height();
                $("#wrapper").css("width", window.innerWidth);
                $("#wrapper").css("height", window.innerHeight);
                $("#footer_toolbar_1").css("top", top + "px");
                $("#footer_toolbar_2").css("top", top + "px");
                CONTENTVIEW.sizingScreen();
            }
        }

    };
    //End: TRB00019 - Editor : Long - Date : 28/08/2013 - Summary : Fix for android resize
    CONTENTVIEW_GENERAL.resourceImage.src = resourceUrl;
};

CONTENTVIEW_GETDATA.getContentDataForImageType = function(){
    var params = {
        sid: CONTENTVIEW.getSessionId(),
        contentId: CONTENTVIEW_GENERAL.contentID,
        getType: '1',
        isStreaming: ClientData.isStreamingMode()
    };

    CONTENTVIEW_CALLAPI.abapi('webGetContent', params, 'GET', function (data) {
    	CONTENTVIEW_GENERAL.imageTypeData = data.contentData;
        //Set default page No to image Type
    	CONTENTVIEW_GENERAL.imageTypeData["pageNo"] = 1;

        document.title = data.contentData.contentName + ' | ' + I18N.i18nText('sysAppTitle');
    });
};

/* grab viewer content object */
CONTENTVIEW_GETDATA.getContent = function() {
    return CONTENTVIEW.content;
};

/* get all memo on page */
CONTENTVIEW_GETDATA.getAllMemoOfPage = function() {
    if (ClientData.IsDisplayMemo() == true) {
    	CONTENTVIEW_CREATEOBJECT.memoObjects = [];

        /*get data memo */
        var memoData = ClientData.MemoData();

        for (var nIndex = 0; nIndex < memoData.length; nIndex++) {
            if (memoData[nIndex].contentid == CONTENTVIEW_GENERAL.contentID
            && memoData[nIndex].pageNo == CONTENTVIEW.changePageIndex(CONTENTVIEW_GETDATA.getPageIndex())) {
                /* create object of memo */
                var memoObject = null;

                if (memoData[nIndex].posY > CONTENTVIEW_GENERAL.heightEachPage - 50) {
                    memoData[nIndex].posY = CONTENTVIEW_GENERAL.heightEachPage - 50;
                }

                if (memoData[nIndex].posX > CONTENTVIEW_GENERAL.widthEachPage - 50) {
                    memoData[nIndex].posX = CONTENTVIEW_GENERAL.widthEachPage - 50;
                }
                memoObject = new CONTENTVIEW_CREATEOBJECT.memo(
                    nIndex,
                    memoData[nIndex].Text,
                    memoData[nIndex].posX,
                    memoData[nIndex].posY,
                    50,
                    50,
                    "img/memo.png"
                );

                CONTENTVIEW_CREATEOBJECT.memoObjects.push(memoObject);
            }
        }
    }
};

CONTENTVIEW_GETDATA.getPosVideo = function(px, py, width, height, scale) {
	CONTENTVIEW_GENERAL.pxVideo = px;
	CONTENTVIEW_GENERAL.pyVideo = py;
	CONTENTVIEW_GENERAL.wVideo = width;
	CONTENTVIEW_GENERAL.hVideo = height;
	CONTENTVIEW_GENERAL.videoScale = scale;
};

//Start Function: No.4 - Editor : Long - Summary : Render Next Page Content

//Render next Page Content
CONTENTVIEW_GETDATA.renderNextPage = function(){

    //Get next page Number
    var pageNo = parseInt(CONTENTVIEW.changePageIndex(CONTENTVIEW_GETDATA.getPageIndex())) + 1;

    //Get next page background image
    if(CONTENTVIEW_GENERAL.contentType == COMMON.ContentTypeKeys.Type_PDF){

    		//console.log("CONTENTVIEW_GETDATA.renderNextPage");
    		AVWEB.avwGrabContentPageImage(ClientData.userInfo_accountPath(),
            	{ contentId: CONTENTVIEW_GENERAL.contentID, sid: CONTENTVIEW.getSessionId(), pageNo: pageNo },
            	function (data) {
            		CONTENTVIEW_GENERAL.nextPageImage = data;

            		CONTENTVIEW_GENERAL.nextContent.setPageImages(CONTENTVIEW_GENERAL.totalPage, CONTENTVIEW_GENERAL.nextPageImage)
                                 .setPageObjects(CONTENTVIEW_GENERAL.nextPageObjects)
                                 .nextPage();

            	},
            	function (xmlHttpRequest, txtStatus, errorThrown) {
            		CONTENTVIEW.showErrorScreen();
            	}
            );

    }
    //Start Function : No.12 - Editor : Long - Date : 08/28/2013 - Summary : Render next page content image the same with the current one
    else if(CONTENTVIEW_GENERAL.contentType == COMMON.ContentTypeKeys.Type_NoFile){
    	CONTENTVIEW_GENERAL.nextPageImage = CONTENTVIEW_GENERAL.pageImages;
    	CONTENTVIEW_GENERAL.nextContent.setPageImages(CONTENTVIEW_GENERAL.totalPage, CONTENTVIEW_GENERAL.nextPageImage)
                                 .setPageObjects(CONTENTVIEW_GENERAL.nextPageObjects)
                                 .nextPage();
    }
    //End Function : No.12 - Editor : Long - Date : 08/28/2013 - Summary : Render next page content image the same with the current one

};

//Render prev Page Content
CONTENTVIEW_GETDATA.renderPrevPage = function(){

    //Get prev page Number
    var pageNo = parseInt(CONTENTVIEW.changePageIndex(CONTENTVIEW_GETDATA.getPageIndex())) - 1;

    //Get prev page background image
    if(CONTENTVIEW_GENERAL.contentType == COMMON.ContentTypeKeys.Type_PDF){

    		//console.log("CONTENTVIEW_GETDATA.renderPrevPage");
    		AVWEB.avwGrabContentPageImage(ClientData.userInfo_accountPath(),
        		{ contentId: CONTENTVIEW_GENERAL.contentID, sid: CONTENTVIEW.getSessionId(), pageNo: pageNo },
        		function (data) {
        			CONTENTVIEW_GENERAL.prevPageImage = data;
        			CONTENTVIEW_GENERAL.prevContent.setPageImages(CONTENTVIEW_GENERAL.totalPage, CONTENTVIEW_GENERAL.prevPageImage)
                             .setPageObjects(CONTENTVIEW_GENERAL.prevPageObjects)
                             .previousPage();
        		},
        		function (xmlHttpRequest, txtStatus, errorThrown) {
        			CONTENTVIEW.showErrorScreen();
        		}
        	);

     }
    else if(CONTENTVIEW_GENERAL.contentType == COMMON.ContentTypeKeys.Type_NoFile){
    	CONTENTVIEW_GENERAL.prevPageImage = CONTENTVIEW_GENERAL.pageImages;
    	CONTENTVIEW_GENERAL.prevContent.setPageImages(CONTENTVIEW_GENERAL.totalPage, CONTENTVIEW_GENERAL.prevPageImage)
                             .setPageObjects(CONTENTVIEW_GENERAL.prevPageObjects)
                             .previousPage();
    }

};

//Get next page objects by page index
CONTENTVIEW_GETDATA.getNextPageObjectsByPageIndex = function(contentData, nIndexPage) {
	CONTENTVIEW_GENERAL.nextPageObjects = [];
    var currentPageObjects;
    for (var nIndex = 0; nIndex < contentData.length; nIndex++) {
        if (contentData[nIndex].page == nIndexPage) {
            currentPageObjects = contentData[nIndex].objects;
            //Start Function: No.9 - Editor : Long - Summary :
            if(contentData[nIndex].contentDataSub != null && contentData[nIndex].contentDataSub.length > 0){
                //currentPageObjects["contentDataSub"] = contentData[nIndex].contentDataSub;
                for(var i = 0; i < currentPageObjects.length; i++){
                    var tempObj = currentPageObjects[i];
                    tempObj["contentDataSub"] = contentData[nIndex].contentDataSub;
                }
            }
            //End Function: No.9 - Editor : Long
            break;
        }
    }


    if (currentPageObjects != undefined) {
        for (var nIndex = 0; nIndex < currentPageObjects.length; nIndex++) {
            /*get object page*/
            if (currentPageObjects[nIndex].mediaType == 1) {/*media type = 1 */
                var pageObject = CONTENTVIEW_GETDATA.getMediaType1(currentPageObjects[nIndex]);
            	/*add object to page */
            	CONTENTVIEW_GENERAL.nextPageObjects.push(pageObject);
            } else if (currentPageObjects[nIndex].mediaType == 2) { /*mediaType = 2 */
                var pageObject = CONTENTVIEW_GETDATA.getMediaType2(currentPageObjects[nIndex]);
                /*add object to page */
                CONTENTVIEW_GENERAL.nextPageObjects.push(pageObject);
            } else if (currentPageObjects[nIndex].mediaType == 3) { /*mediaType = 3*/
                var pageObject = CONTENTVIEW_GETDATA.getMediaType3(currentPageObjects[nIndex]);
                /*add object to page */
                CONTENTVIEW_GENERAL.nextPageObjects.push(pageObject);
            } else if (currentPageObjects[nIndex].mediaType == 4) { /*mediaType = 4*/
                var pageObject = CONTENTVIEW_GETDATA.getMediaType4(currentPageObjects[nIndex]);
                /*add object to page */
                CONTENTVIEW_GENERAL.nextPageObjects.push(pageObject);
            } else if (currentPageObjects[nIndex].mediaType == 5) { /*mediaType = 5*/
                var pageObject = CONTENTVIEW_GETDATA.getMediaType5(currentPageObjects[nIndex]);
                /*add object to page */
                CONTENTVIEW_GENERAL.nextPageObjects.push(pageObject);
            } else if (currentPageObjects[nIndex].mediaType == 6) { /*mediaType = 6*/
                var pageObject = CONTENTVIEW_GETDATA.getMediaType6(currentPageObjects[nIndex]);
                /*add object to page */
                CONTENTVIEW_GENERAL.nextPageObjects.push(pageObject);
            } else if (currentPageObjects[nIndex].mediaType == 7) { /*mediaType = 7*/
                var pageObject = CONTENTVIEW_GETDATA.getMediaType7(currentPageObjects[nIndex]);
                /*add object to page */
                CONTENTVIEW_GENERAL.nextPageObjects.push(pageObject);
            } else if (currentPageObjects[nIndex].mediaType == 8) { /*mediaType = 8*/
                var pageObject = CONTENTVIEW_GETDATA.getMediaType8(currentPageObjects[nIndex]);
                /*add object to page */
                CONTENTVIEW_GENERAL.nextPageObjects.push(pageObject);
            } else if (currentPageObjects[nIndex].mediaType == 9) { /*mediaType = 9*/
                var pageObject = CONTENTVIEW_GETDATA.getMediaType9(currentPageObjects[nIndex]);
                /*add object to page */
                CONTENTVIEW_GENERAL.nextPageObjects.push(pageObject);
            } else if (currentPageObjects[nIndex].mediaType == 11) { /*mediaType = 11*/
                var pageObject = CONTENTVIEW_GETDATA.getMediaType11(currentPageObjects[nIndex]);
                /*add object to page */
                CONTENTVIEW_GENERAL.nextPageObjects.push(pageObject);
            } else if (currentPageObjects[nIndex].mediaType == 12) { /*mediaType = 12*/
        		var pageObject = CONTENTVIEW_GETDATA.getMediaType12(currentPageObjects[nIndex]);
            	/*add object to page */
        		CONTENTVIEW_GENERAL.nextPageObjects.push(pageObject);
        	} else if (currentPageObjects[nIndex].mediaType == 13) { /*mediaType = 12*/
        		var pageObject = CONTENTVIEW_GETDATA.getMediaType13(currentPageObjects[nIndex]);
            	/*add object to page */
        		CONTENTVIEW_GENERAL.nextPageObjects.push(pageObject);
        	}

        }
    }
};

//Get prev page objects by page index
CONTENTVIEW_GETDATA.getPrevPageObjectsByPageIndex = function(contentData, nIndexPage) {

	CONTENTVIEW_GENERAL.prevPageObjects = [];

    var currentPageObjects;
    for (var nIndex = 0; nIndex < contentData.length; nIndex++) {
        if (contentData[nIndex].page == nIndexPage) {
            currentPageObjects = contentData[nIndex].objects;
            //Start Function: No.9 - Editor : Long - Summary :
            if(contentData[nIndex].contentDataSub != null && contentData[nIndex].contentDataSub.length > 0){
                //currentPageObjects["contentDataSub"] = contentData[nIndex].contentDataSub;
                for(var i = 0; i < currentPageObjects.length; i++){
                    var tempObj = currentPageObjects[i];
                    tempObj["contentDataSub"] = contentData[nIndex].contentDataSub;
                }
            }
            //End Function: No.9 - Editor : Long
            break;
        }
    }

    if (currentPageObjects != undefined) {
        for (var nIndex = 0; nIndex < currentPageObjects.length; nIndex++) {
            /*get object page*/
            if (currentPageObjects[nIndex].mediaType == 1) {/*media type = 1 */
                var pageObject = CONTENTVIEW_GETDATA.getMediaType1(currentPageObjects[nIndex]);
            	/*add object to page */
            	CONTENTVIEW_GENERAL.prevPageObjects.push(pageObject);
            } else if (currentPageObjects[nIndex].mediaType == 2) { /*mediaType = 2 */
                var pageObject = CONTENTVIEW_GETDATA.getMediaType2(currentPageObjects[nIndex]);
                /*add object to page */
                CONTENTVIEW_GENERAL.prevPageObjects.push(pageObject);
            } else if (currentPageObjects[nIndex].mediaType == 3) { /*mediaType = 3*/
                var pageObject = CONTENTVIEW_GETDATA.getMediaType3(currentPageObjects[nIndex]);
                /*add object to page */
                CONTENTVIEW_GENERAL.prevPageObjects.push(pageObject);
            } else if (currentPageObjects[nIndex].mediaType == 4) { /*mediaType = 4*/
                var pageObject = CONTENTVIEW_GETDATA.getMediaType4(currentPageObjects[nIndex]);
                /*add object to page */
                CONTENTVIEW_GENERAL.prevPageObjects.push(pageObject);
            } else if (currentPageObjects[nIndex].mediaType == 5) { /*mediaType = 5*/
                var pageObject = CONTENTVIEW_GETDATA.getMediaType5(currentPageObjects[nIndex]);
                /*add object to page */
                CONTENTVIEW_GENERAL.prevPageObjects.push(pageObject);
            } else if (currentPageObjects[nIndex].mediaType == 6) { /*mediaType = 6*/
                var pageObject = CONTENTVIEW_GETDATA.getMediaType6(currentPageObjects[nIndex]);
                /*add object to page */
                CONTENTVIEW_GENERAL.prevPageObjects.push(pageObject);
            } else if (currentPageObjects[nIndex].mediaType == 7) { /*mediaType = 7*/
                var pageObject = CONTENTVIEW_GETDATA.getMediaType7(currentPageObjects[nIndex]);
                /*add object to page */
                CONTENTVIEW_GENERAL.prevPageObjects.push(pageObject);
            } else if (currentPageObjects[nIndex].mediaType == 8) { /*mediaType = 8*/
                var pageObject = CONTENTVIEW_GETDATA.getMediaType8(currentPageObjects[nIndex]);
                /*add object to page */
                CONTENTVIEW_GENERAL.prevPageObjects.push(pageObject);
            } else if (currentPageObjects[nIndex].mediaType == 9) { /*mediaType = 9*/
                var pageObject = CONTENTVIEW_GETDATA.getMediaType9(currentPageObjects[nIndex]);
                /*add object to page */
                CONTENTVIEW_GENERAL.prevPageObjects.push(pageObject);
            } else if (currentPageObjects[nIndex].mediaType == 11) { /*mediaType = 11*/
                var pageObject = CONTENTVIEW_GETDATA.getMediaType11(currentPageObjects[nIndex]);
                /*add object to page */
                CONTENTVIEW_GENERAL.prevPageObjects.push(pageObject);
            } else if (currentPageObjects[nIndex].mediaType == 12) { /*mediaType = 12*/
            	var pageObject = CONTENTVIEW_GETDATA.getMediaType12(currentPageObjects[nIndex]);
            	/*add object to page */
            	CONTENTVIEW_GENERAL.prevPageObjects.push(pageObject);
        	} else if (currentPageObjects[nIndex].mediaType == 13) { /*mediaType = 12*/
            	var pageObject = CONTENTVIEW_GETDATA.getMediaType13(currentPageObjects[nIndex]);
            	/*add object to page */
            	CONTENTVIEW_GENERAL.prevPageObjects.push(pageObject);
        	}
        }
    }

};

//Switch canvas when flipping page
CONTENTVIEW_GETDATA.switchCanvas = function(nav){
    // change div id

    //console.log("bf widthEachPage:" + CONTENTVIEW_GENERAL.widthEachPage + " widthEachNextPage:" + CONTENTVIEW_GENERAL.widthEachNextPage + " widthEachPrevPage:" + CONTENTVIEW_GENERAL.widthEachPrevPage);
    //console.log("bf widthEachPageApi:" + CONTENTVIEW_GENERAL.widthEachPageApi + " CONTENTVIEW_GENERAL.widthEachNextPageApi:" + CONTENTVIEW_GENERAL.widthEachNextPageApi + " widthEachPrevPageApi:" + CONTENTVIEW_GENERAL.widthEachPrevPageApi);

    if(nav == 1){
        $('#mainPre').attr("id","mainPreBK");
        $('#main').attr("id","mainPre");
        $('#mainNext').attr("id","main");
        $('#mainPreBK').attr("id","mainNext");

        $('#offscreenPre').attr("id","mainPreBK");
        $('#offscreen').attr("id","offscreenPre");
        $('#offscreenNext').attr("id","offscreen");
        $('#mainPreBK').attr("id","offscreenNext");

        //START TRB00097 - Editor: Long - Date: 09/30/2013 - Summary : Get All Page size of content
        CONTENTVIEW_GENERAL.widthEachPrevPage = CONTENTVIEW_GENERAL.widthEachPage;
        CONTENTVIEW_GENERAL.widthEachPage = CONTENTVIEW_GENERAL.widthEachNextPage;
        //#11478
        CONTENTVIEW_GENERAL.widthEachPrevPageApi = CONTENTVIEW_GENERAL.widthEachPageApi;
        CONTENTVIEW_GENERAL.widthEachPageApi = CONTENTVIEW_GENERAL.widthEachNextPageApi;

        CONTENTVIEW_GENERAL.heightEachPrevPage = CONTENTVIEW_GENERAL.heightEachPage;
        CONTENTVIEW_GENERAL.heightEachPage = CONTENTVIEW_GENERAL.heightEachNextPage;
        //#11478
        CONTENTVIEW_GENERAL.heightEachPrevPageApi = CONTENTVIEW_GENERAL.heightEachPageApi;
        CONTENTVIEW_GENERAL.heightEachPageApi = CONTENTVIEW_GENERAL.heightEachNextPageApi;

        CONTENTVIEW.srcRectPrev = CONTENTVIEW.srcRect;
        CONTENTVIEW.srcRect = CONTENTVIEW.srcRectNext;

        CONTENTVIEW.destRectPrev = CONTENTVIEW.destRect;
        CONTENTVIEW.destRect = CONTENTVIEW.destRectNext;

        //#12373
        CONTENTVIEW.userScale = 1;
        CONTENTVIEW.changeScale(CONTENTVIEW.userScale);
        CONTENTVIEW.flip();
        //#12373
        //END TRB00097 - Editor: Long - Date: 09/30/2013 - Summary : Get All Page size of content
    }
    else{
        // change div id
        $('#mainNext').attr("id","mainNextBK");
        $('#main').attr("id","mainNext");
        $('#mainPre').attr("id","main");
        $('#mainNextBK').attr("id","mainPre");

        $('#offscreenNext').attr("id","mainNextBK");
        $('#offscreen').attr("id","offscreenNext");
        $('#offscreenPre').attr("id","offscreen");
        $('#mainNextBK').attr("id","offscreenPre");

        //START TRB00097 - Editor: Long - Date: 09/30/2013 - Summary : Get All Page size of content
        CONTENTVIEW_GENERAL.widthEachNextPage = CONTENTVIEW_GENERAL.widthEachPage;
        CONTENTVIEW_GENERAL.widthEachPage = CONTENTVIEW_GENERAL.widthEachPrevPage;
        //#11478
        CONTENTVIEW_GENERAL.widthEachNextPageApi = CONTENTVIEW_GENERAL.widthEachPageApi;
        CONTENTVIEW_GENERAL.widthEachPageApi = CONTENTVIEW_GENERAL.widthEachPrevPageApi;

        CONTENTVIEW_GENERAL.heightEachNextPage = CONTENTVIEW_GENERAL.heightEachPage;
        CONTENTVIEW_GENERAL.heightEachPage = CONTENTVIEW_GENERAL.heightEachPrevPage;
        //#11478
        CONTENTVIEW_GENERAL.heightEachNextPageApi = CONTENTVIEW_GENERAL.heightEachPageApi;
        CONTENTVIEW_GENERAL.heightEachPageApi = CONTENTVIEW_GENERAL.heightEachPrevPageApi;

        CONTENTVIEW.srcRectNext = CONTENTVIEW.srcRect;
        CONTENTVIEW.srcRect = CONTENTVIEW.srcRectPrev;

        CONTENTVIEW.destRectNext = CONTENTVIEW.destRect;
        CONTENTVIEW.destRect = CONTENTVIEW.destRectPrev;

        //#12373
        CONTENTVIEW.userScale = 1;
        //#12373
        CONTENTVIEW.changeScale(CONTENTVIEW.userScale);
        CONTENTVIEW.flip();
        //END TRB00097 - Editor: Long - Date: 09/30/2013 - Summary : Get All Page size of content
    }

    //console.log("af widthEachPage:" + CONTENTVIEW_GENERAL.widthEachPage + " widthEachNextPage:" + CONTENTVIEW_GENERAL.widthEachNextPage + " widthEachPrevPage:" + CONTENTVIEW_GENERAL.widthEachPrevPage);
    //console.log("af widthEachPageApi:" + CONTENTVIEW_GENERAL.widthEachPageApi + " widthEachNextPageApi:" + CONTENTVIEW_GENERAL.widthEachNextPageApi + " widthEachPrevPageApi:" + CONTENTVIEW_GENERAL.widthEachPrevPageApi);

};

//Assign content properties
CONTENTVIEW_GETDATA.assignCurrentContentPage = function(nav){

    if(nav == 1){

    	CONTENTVIEW_GENERAL.prevPageImage = CONTENTVIEW_GENERAL.pageImages;
        CONTENTVIEW_GENERAL.pageImages = CONTENTVIEW_GENERAL.nextPageImage;

        CONTENTVIEW_GENERAL.prevContent.currentPage = CONTENTVIEW.content.currentPage;
        CONTENTVIEW_GENERAL.prevContent.pageCount = CONTENTVIEW.content.pageCount;
        CONTENTVIEW_GENERAL.prevContent.pageImages = CONTENTVIEW.content.pageImages;
        CONTENTVIEW_GENERAL.prevContent.pageIndex = CONTENTVIEW.content.pageIndex;
        CONTENTVIEW_GENERAL.prevContent.pageObjects = CONTENTVIEW.content.pageObjects;

        CONTENTVIEW.content.currentPage = CONTENTVIEW_GENERAL.nextContent.currentPage;
        CONTENTVIEW.content.pageCount = CONTENTVIEW_GENERAL.nextContent.pageCount;
        CONTENTVIEW.content.pageImages = CONTENTVIEW_GENERAL.nextContent.pageImages;
        CONTENTVIEW.content.pageIndex = CONTENTVIEW_GENERAL.nextContent.pageIndex;
        CONTENTVIEW.content.pageObjects = CONTENTVIEW_GENERAL.nextContent.pageObjects;

        CONTENTVIEW_GENERAL.prevPageObjects = CONTENTVIEW_GENERAL.pageObjects;
        CONTENTVIEW_GENERAL.pageObjects = CONTENTVIEW_GENERAL.nextPageObjects;

    }
    else{
    	CONTENTVIEW_GENERAL.nextPageImage = CONTENTVIEW_GENERAL.pageImages;
        CONTENTVIEW_GENERAL.pageImages = CONTENTVIEW_GENERAL.prevPageImage;

        CONTENTVIEW_GENERAL.nextContent.currentPage = CONTENTVIEW.content.currentPage;
        CONTENTVIEW_GENERAL.nextContent.pageCount = CONTENTVIEW.content.pageCount;
        CONTENTVIEW_GENERAL.nextContent.pageImages = CONTENTVIEW.content.pageImages;
        CONTENTVIEW_GENERAL.nextContent.pageIndex = CONTENTVIEW.content.pageIndex;
        CONTENTVIEW_GENERAL.nextContent.pageObjects = CONTENTVIEW.content.pageObjects;

        CONTENTVIEW.content.currentPage = CONTENTVIEW_GENERAL.prevContent.currentPage;
        CONTENTVIEW.content.pageCount = CONTENTVIEW_GENERAL.prevContent.pageCount;
        CONTENTVIEW.content.pageImages = CONTENTVIEW_GENERAL.prevContent.pageImages;
        CONTENTVIEW.content.pageIndex = CONTENTVIEW_GENERAL.prevContent.pageIndex;
        CONTENTVIEW.content.pageObjects = CONTENTVIEW_GENERAL.prevContent.pageObjects;

        CONTENTVIEW_GENERAL.nextPageObjects = CONTENTVIEW_GENERAL.pageObjects;
        CONTENTVIEW_GENERAL.pageObjects = CONTENTVIEW_GENERAL.prevPageObjects;

    }

    //abe
    //alert("assignCurrentContentPage:" + content.currentPage);

};

//Correct Canvas Position
CONTENTVIEW_GETDATA.correctCanvasPosition = function(){
    //correct canvas position

    //   Set default value for moving3D object to prevent other object fired when
    //hold on 3d object and move next or prev page.
	CONTENTVIEW_EVENTS._3dAnimate = false;

    if(CONTENTVIEW_GENERAL.animateType == CONTENTVIEW_GENERAL.animateTypeKeys.Type_Slide){
        $('#canvasWrapper').css("left",'0px');
        $('#main').css("left",'13px');
        $('#mainNext').css("left", $("#canvasWrapper").width() +'px');
        $('#mainPre').css("left", '-' + $("#canvasWrapper").width() +'px');
        $('#mainNext').css("display", 'none');
        $('#mainPre').css("display", 'none');
    }
    else if(CONTENTVIEW_GENERAL.animateType == CONTENTVIEW_GENERAL.animateTypeKeys.Type_FadeIn){
       $('#mainNext').css("z-index",'0');
       $('#mainPre').css("z-index",'0');
       $('#mainNext').css("display", 'none');
       $('#mainPre').css("display", 'none');
    }

};

//Get Page Transition configuration
CONTENTVIEW_GETDATA.getPageTransitionConfig = function(){
	CONTENTVIEW_GENERAL.animateType = ClientData.userOpt_pageTransition();
	CONTENTVIEW_GENERAL.animatePeriod = eval(ClientData.userOpt_pageTransitionPeriod()) * 1000;
};
//End Function: No.4 - Editor : Long - Summary : Render Next Page Content

CONTENTVIEW_GETDATA.ready = function(){
};


