/*
@@@BUILDINFO@@@ st16AlertBox.jsx 466 16-March-2007
*/

/*************************************************************************
*
* ADOBE CONFIDENTIAL
* ___________________
*
*  Copyright 2005 Adobe Systems Incorporated
*  All Rights Reserved.
*
* NOTICE:  All information contained herein is, and remains
* the property of Adobe Systems Incorporated and its suppliers,
* if any.  The intellectual and technical concepts contained
* herein are proprietary to Adobe Systems Incorporated and its
* suppliers and may be covered by U.S. and Foreign Patents,
* patents in process, and are protected by trade secret or copyright law.
* Dissemination of this information or reproduction of this material
* is strictly forbidden unless prior written permission is obtained
* from Adobe Systems Incorporated.
**************************************************************************/

if( ( stockphoto.timeKeeperOn != undefined )&&( stockphoto.timeKeeperOn ) )
{
	stockphoto.timeKeeper.st16AlertBox        = {};
	stockphoto.timeKeeper.st16AlertBox.StTime = new Date();
}

// AlertBox namespace and zstringCache instance
stockphoto.alertBox = {};
stockphoto.alertBox.zc = new stockphoto.zstringCache("st16AlertBox");
stockphoto.alertBox.standardCntTab = {};
stockphoto.alertBox.locale = "";

stockphoto.alertBox.standardCntTab = {
	ALERT_DIALOG_SIZE                      : "[400, 100]",
	ALERT_DIALOG_OK_BUTTON                 : "[ 90,  20]",
	ALERT_DIALOG_CANCEL_BUTTON_SMALL       : "[ 90,  20]",
	ALERT_DIALOG_CANCEL_BUTTON_LARGE       : "[200,  20]",
	CONFIRMATION_BOUNDS                    : "[100, 100, 505, 270]",
	CONFIRMATION_BOUNDS_MULTIPLE           : "[100, 100, 505, 270]",
	CONFIRMATION_STATICTEXT                : "[ 80,  20, 350, 100]",
	CONFIRMATION_OK_BUTTON_WIN             : "[ 80, 140, 180, 160]",
	CONFIRMATION_OK_BUTTON_MAC             : "[280, 140, 390, 160]",
	CONFIRMATION_CANCEL_BUTTON_WIN         : "[195, 140, 380, 160]",
	CONFIRMATION_CANCEL_BUTTON_MAC         : "[ 75, 140, 265, 160]",
	CONFIRMATION_STATICTEXT_M              : "[ 80,  20, 350, 100]",
	CONFIRMATION_OK_BUTTON_WIN_M           : "[ 80, 140, 180, 160]",
	CONFIRMATION_OK_BUTTON_MAC_M           : "[280, 140, 390, 160]",
	CONFIRMATION_CANCEL_BUTTON_WIN_M       : "[195, 140, 380, 160]",
	CONFIRMATION_CANCEL_BUTTON_MAC_M       : "[ 75, 140, 265, 160]",
	CONFIRMATION_FILELIST_M				   : "[ 80, 105, 300, 130]",
	CONFIRMATION_CHECKBOX                  : "[ 80, 110, 300, 130]",
	CONFIRMATION_ICON_BOUNDS_WIN           : "[ 15,  15,  50,  50]",
	CONFIRMATION_ICON_BOUNDS_MAC           : "[ 15,  15,  80,  80]",
	CONFIRMATION_ICON_BOUNDS_WIN_M           : "[ 15,  15,  50,  50]",
	CONFIRMATION_ICON_BOUNDS_MAC_M           : "[ 15,  15,  80,  80]",
	DOWNLOAD_ALERT_BOUNDS                  : "[100, 100, 505, 330]",
	DOWNLOAD_ALERT_STATICTEXT              : "[ 80,  20, 370, 160]",
	DOWNLOAD_ALERT_OK_BUTTON_SINGLE_WIN    : "[160, 200, 250, 220]",
	DOWNLOAD_ALERT_OK_BUTTON_SINGLE_MAC    : "[300, 200, 390, 220]",
	DOWNLOAD_ALERT_OK_BUTTON_WIN           : "[210, 200, 300, 220]",
	DOWNLOAD_ALERT_OK_BUTTON_MAC           : "[300, 200, 390, 220]",
	DOWNLOAD_ALERT_CANCEL_BUTTON_WIN       : "[105, 200, 195, 220]",
	DOWNLOAD_ALERT_CANCEL_BUTTON_MAC       : "[200, 200, 290, 220]",
	DOWNLOAD_ALERT_LARGE_OK_BUTTON_WIN     : "[210, 200, 330, 220]",
	DOWNLOAD_ALERT_LARGE_OK_BUTTON_MAC     : "[270, 200, 390, 220]",
	DOWNLOAD_ALERT_LARGE_CANCEL_BUTTON_WIN : "[ 75, 200, 195, 220]",
	DOWNLOAD_ALERT_LARGE_CANCEL_BUTTON_MAC : "[135, 200, 255, 220]",
	DOWNLOAD_ALERT_CHECKBOX                : "[ 80, 170, 300, 190]",
	DOWNLOAD_ALERT_ICON_BOUNDS_WIN         : "[ 15,  15,  50,  50]",
	DOWNLOAD_ALERT_ICON_BOUNDS_MAC         : "[ 15,  15,  80,  80]"
};

stockphoto.alertBox.setStandardCnvTab=function() 
{
	if ( stockphoto.alertBox.locale != stockphoto.core.getValidLocale() ) 
	{
		if ( stockphoto.core.util.loadLocaleData( "st16AlertBox.par" ) )
			stockphoto.alertBox.locale = stockphoto.core.getValidLocale();
	};
}

stockphoto.alertBox.setStandardCnvTab();

stockphoto.alertBox.localizedStr4ErrMsg= {
    ERROR_CORE_KEYWORD_INVALID:  "$$$/AlertBox/ERROR_CORE_KEYWORD_INVALID=Keyword is invalid.",
    ERROR_CORE_FILENAME_INVALID:  "$$$/AlertBox/ERROR_CORE_FILENAME_INVALID=Filename is invalid." ,
    ERROR_CORE_ALLOCATION_FAILED:  "$$$/AlertBox/ERROR_CORE_ALLOCATION_FAILED=Memory allocation failed." ,
    ERROR_CORE_ADAPTER_LOAD_ERROR:  "$$$/AlertBox/ERROR_CORE_ADAPTER_LOAD_ERROR=Failed to load partner adapter." ,
    ERROR_CORE_SYSTEM_ERROR:  "$$$/AlertBox/ERROR_CORE_SYSTEM_ERROR=A system error occurred." ,
    ERROR_CORE_RESULTS_DIR_INVALID:  "$$$/AlertBox/ERROR_CORE_RESULTS_DIR_INVALID=The Results directory is invalid" ,
    ERROR_CORE_CANT_CREATE_DIR:  "$$$/AlertBox/ERROR_CORE_CANT_CREATE_DIR=Can not create directory." ,
    ERROR_CORE_READING_METADATA_ERROR:  "$$$/AlertBox/ERROR_CORE_READING_METADATA_ERROR=Could not read meta data in image file." ,
    ERROR_CORE_CANT_OPEN_IMAGE_FILE:  "$$$/AlertBox/ERROR_CORE_CANT_OPEN_IMAGE_FILE=Could not open image file." ,
    ERROR_CORE_CANT_FETCH_THUMBNAILS:  "$$$/AlertBox/ERROR_CORE_CANT_FETCH_THUMBNAILS=Could not fetch thumbnail files." ,
    ERROR_CORE_CANT_COPY_MOVE_DELETE_FILE:  "$$$/AlertBox/ERROR_CORE_CANT_COPY_MOVE_DELETE_FILE=Failed to copy file." ,
    ERROR_CORE_CANT_DELETE_FILE:  "$$$/AlertBox/ERROR_CORE_CANT_DELETE_FILE=Failed to delete file." ,
    ERROR_CORE_CANT_READ_XML_FILE:  "$$$/AlertBox/ERROR_CORE_CANT_READ_XML_FILE=Failed to read XML file." ,
    ERROR_CORE_CANT_FIND_XML_FILE:  "$$$/AlertBox/ERROR_CORE_CANT_FIND_XML_FILE=Failed to find XML file." ,
    ERROR_CORE_XML_PARSE_ERROR:  "$$$/AlertBox/ERROR_CORE_XML_PARSE_ERROR=Failed to parse XML file." ,
    ERROR_CORE_PARTNERS_XML_MISSING_ERROR:  "$$$/AlertBox/ERROR_CORE_PARTNERS_XML_MISSING_ERROR=The partners.xml file is missing." ,
    ERROR_CORE_CANT_INIT_ADAPTER:  "$$$/AlertBox/ERROR_CORE_CANT_INIT_ADAPTER=Could not initialize partner adapter." ,
    ERROR_CORE_SPWSADAPTER_ERR:  "$$$/AlertBox/ERROR_CORE_SPWSADAPTER_ERR=Stock Photos Partner Adapter error occurred." ,
    ERROR_CORE_SSL_CERT_FILE_MISSING_ERROR:  "$$$/AlertBox/ERROR_CORE_SSL_CERT_FILE_MISSING_ERROR=Failed to find SSL certificate file." ,
    ERROR_CORE_PARNTER_NOT_LOADED:  "$$$/AlertBox/ERROR_CORE_PARNTER_NOT_LOADED=Images from this provider are no longer available. " ,
    ERROR_CORE_PARNTER_NOT_LOADED_HIREZ:  "$$$/AlertBox/ERROR_CORE_PARNTER_NOT_LOADED_HIREZ=The provider of the image %1 is no longer in service. The image may be available on the provider's web site." ,
    ERROR_CORE_MORE_RESULTS_NOT_AVAIL:  "$$$/AlertBox/ERROR_CORE_MORE_RESULTS_NOT_AVAIL=There are no additional search results to display (some images may have been removed by the image providers). Try the search again using the same keywords" , 
    ERROR_CORE_MORE_RESULTS_FAIL:  "$$$/AlertBox/ERROR_CORE_MORE_RESULTS_FAIL=Error retrieving additional results. Try the search again using the same keywords." ,
    ERROR_CORE_CLOSING_CONNECTION:  "$$$/AlertBox/ERROR_CORE_CLOSING_CONNECTION=Stock Photos is waiting for server messages before it can close down." ,
    ERROR_CORE_PROXY_AUTHORIZE:  "$$$/AlertBox/ERROR_CORE_PROXY_AUTHORIZE=Cannot access the Internet due to proxy server authorization problems. Check with your network administrator to resolve this problem." ,
    ERROR_CORE_NOT_ALL_RESULTS_FOUND:  "$$$/AlertBox/ERROR_CORE_NOT_ALL_RESULTS_FOUND=Not all result from partners were available" ,
    ERROR_CORE_ADV_SRC_NO_RESULTS:  "$$$/AlertBox/ERROR_CORE_ADV_SRC_NO_RESULTS=Not all of the image providers are currently available. Searching again later may provide more results." ,
    ERROR_CORE_PROXY_RETRIES_OVER:  "$$$/AlertBox/ERROR_CORE_PROXY_RETRIES_OVER=Incorrect Credentials. You have exceeded the number of logins." ,
    ERROR_CORE_SAVEAS_DEST_INVALID: "$$$/AlertBox/ERROR_CORE_SAVEAS_DEST_INVALID=Cannot save file(s). Destination Path not found.",
    ERROR_CORE_SAVEAS_INVALID_CUSTOMNAME: "$$$/AlertBox/ERROR_CORE_SAVEAS_INVALID_CUSTOMNAME=Cannot save file(s). Invalid File Name.",
    ERROR_CORE_SAVEAS_CANNOTSAVE: "$$$/AlertBox/ERROR_CORE_SAVEAS_CANNOTSAVE=Error in saving File %1.",

    ERROR_ADAPTER_SYSTEM_ERROR:  "$$$/AlertBox/ERROR_ADAPTER_SYSTEM_ERROR=A system error occurred." ,
    ERROR_ADAPTER_CONNECTION_ERROR:  "$$$/AlertBox/ERROR_ADAPTER_CONNECTION_ERROR=Connection error. Please check your network and Internet settings and try again." ,
    ERROR_ADAPTER_SEARCHREQUEST_INVALID:  "$$$/AlertBox/ERROR_ADAPTER_SEARCHREQUEST_INVALID=The search request is invalid." ,
    ERROR_ADAPTER_FILEPATH_INVALID:  "$$$/AlertBox/ERROR_ADAPTER_FILEPATH_INVALID=The filepath is invalid." ,
    ERROR_ADAPTER_BASENAME_INVALID:  "$$$/AlertBox/ERROR_ADAPTER_BASENAME_INVALID=The base filename is invalid." ,
    ERROR_ADAPTER_MEDIAXML_INVALID:  "$$$/AlertBox/ERROR_ADAPTER_MEDIAXML_INVALID=The media XML file is invalid." ,
    ERROR_ADAPTER_DOWNLOAD_ERROR:  "$$$/AlertBox/ERROR_ADAPTER_DOWNLOAD_ERROR=Failed to download the image." ,
    ERROR_ADAPTER_MEDIASIZE_INVALID:  "$$$/AlertBox/ERROR_ADAPTER_MEDIASIZE_INVALID=Cannot find the high-res version of %1. Please contact customer service to retrieve the purchased image." ,
    ERROR_ADAPTER_HIREZ_ERR_MEDIASIZE: "$$$/AlertBox/ERROR_ADAPTER_HIREZ_ERR_MEDIASIZE=The downloaded high resolution Image does not match expected size.",
    ERROR_ADAPTER_HAS_URL_NO_IMAGE:  "$$$/AlertBox/ERROR_ADAPTER_HAS_URL_NO_IMAGE=Failed to find the image on the provider's website." ,
    ERROR_ADAPTER_NO_DISK_ACCESS:  "$$$/AlertBox/ERROR_ADAPTER_NO_DISK_ACCESS=Cannot write to the filename %1. The file may be locked or in use, the disk may be full, or you may not have access privileges." ,
    ERROR_ADAPTER_NO_FOLDER_ACCESS:  "$$$/AlertBox/ERROR_ADAPTER_NO_FOLDER_ACCESS=Cannot write to the folder %1. The folder may be locked or in use, the disk may be full, or you may not have access privileges.\n\n%2" ,

    ERROR_WEBSERVICE_ERROR:  "$$$/AlertBox/ERROR_WEBSERVICE_ERROR=Unknown web service error." ,
    ERROR_WEBSERVICE_SERVERBUSY:  "$$$/AlertBox/ERROR_WEBSERVICE_SERVERBUSY=The image provider's server is too busy to handle the request." ,
    ERROR_WEBSERVICE_NOTFOUND:  "$$$/AlertBox/ERROR_WEBSERVICE_NOTFOUND=Image provider cannot find image or resolution information. Please try again later." ,
    ERROR_WEBSERVICE_INVALIDSIGNATURE:  "$$$/AlertBox/ERROR_WEBSERVICE_INVALIDSIGNATURE=Digital Signature is invalid." ,
    ERROR_WEBSERVICE_DOWNLOADNOTAUTHORIZED:  "$$$/AlertBox/ERROR_WEBSERVICE_DOWNLOADNOTAUTHORIZED=Download was not authorized with e-commerce." ,
    ERROR_WEBSERVICE_UNSUPPORTEDCOUNTRY:  "$$$/AlertBox/ERROR_WEBSERVICE_UNSUPPORTEDCOUNTRY=The specified country is not supported." ,
    
    ERROR_ECOM_SYSTEM_ERROR:  "$$$/AlertBox/ERROR_ECOM_SYSTEM_ERROR=A system error occurred." ,
    ERROR_ECOM_CONNECTION_ERROR:  "$$$/AlertBox/ERROR_ECOM_CONNECTION_ERROR=Failed to connect to the e-commerce service. Please try again.  Contact customer service if the problem persists." ,
    ERROR_ECOM_FILEPATH_INVALID:  "$$$/AlertBox/ERROR_ECOM_FILEPATH_INVALID=The filepath is invalid." ,
    ERROR_ECOM_BASENAME_INVALID:  "$$$/AlertBox/ERROR_ECOM_BASENAME_INVALID=The base filename is invalid." ,
    ERROR_ECOM_UNABLE_TO_OPEN_SHOPPING_CART:  "$$$/AlertBox/ERROR_ECOM_UNABLE_TO_OPEN_SHOPPING_CART=The image %1 appears to be damaged. Remove the item from the shopping cart and then add it again." ,
    ERROR_ECOM_TARGET_PATH_INVALID:  "$$$/AlertBox/ERROR_ECOM_TARGET_PATH_INVALID=Target file path is invalid." ,
    ERROR_ECOM_SSL_AUTHENTICATE_ERROR:  "$$$/AlertBox/ERROR_ECOM_SSL_AUTHENTICATE_ERROR=Unable to establish a secure connection to the Adobe Stock Photos store. Please contact Customer Service." ,
    ERROR_ECOM_AUTHENTICATE_ERROR:  "$$$/AlertBox/ERROR_ECOM_AUTHENTICATE_ERROR=The Adobe Stock Photos store is currently busy or otherwise unavailable. Please try again later, and contact Customer Service if the problem persists." ,
    ERROR_ECOM_NOORDERID_ERROR:  "$$$/AlertBox/ERROR_ECOM_NOORDERID_ERROR=Unable to process the items in your shopping cart. Please contact Customer Service." ,
    ERROR_ECOM_ORDERSTATUS_ERROR:  "$$$/AlertBox/ERROR_ECOM_ORDERSTATUS_ERROR=Unable to process the items in your shopping cart. Please contact Customer Service." ,
    ERROR_ECOM_PARAMETER_ERROR:  "$$$/AlertBox/ERROR_ECOM_PARAMETER_ERROR=An unidentified error has occurred." ,
    
    MESSAGE_ES_CLEAR_IMAGE_LIST :  "$$$/AlertDialog/Dialog/ClearingList=Are you sure that you want the images you purchased to be cleared from the list?" ,
    MESSAGE_ES_MISSING_RES:  "$$$/AlertDialog/Dialog/NOResolution=Cannot get resolution or other data for %1. The image provider's data may have changed since the image was first displayed.",
    MESSAGE_ES_MULTI_HIRES_ERRORS:  "$$$/AlertDialog/Dialog/MULTI_HIRES_ERRORS=%1 images appears to be missing or damaged. Please contact customer services to retrieve the purchased images.",
    MESSAGE_ES_CORRUPTED_FILE:  "$$$/AlertDialog/Dialog/CORRUPTED_FILE=%1 appears to be damaged. Please contact customer service to retrieve the purchased image.",
    MESSAGE_ES_CORRUPTED_FILE_MULTI:  "$$$/AlertDialog/Dialog/CORRUPTED_FILE_MULTI=%1 images appear to be damaged. Please contact customer service to retrieve the purchased images.",
    MESSAGE_ES_COMP_LATE:  "$$$/AlertDialog/Dialog/MESSAGE_ES_COMP_LATE=The server may be busy. Please click Get Price and Keywords to try again.",
    MESSAGE_ES_COMP_NO_IMG_RES:  "$$$/AlertDialog/Dialog/COMP_NO_IMG_RES=Cannot find Comp Image on the server. Unable to get price and keywords.",
    MESSAGE_ES_OVERWRITE_FILE:  "$$$/AlertDialog/Dialog/OVERWRITE_FILE=A file with this name already exists in this location. Would you like to ovewrite it?",
    MESSAGE_ES_SEARCH_IN_PROGRESS:  "$$$/AlertDialog/Dialog/IN_PROGRESS=Search in Progress",
    MESSAGE_ES_SELECT_ONE_IMAGE:  "$$$/AlertDialog/Dialog/SELECT_ONE_IMAGE=Select at least one image.",
    MESSAGE_ES_WAITING:  "$$$/AlertDialog/Dialog/MESSAGE_ES_WAITING=Waiting...",
    MESSAGE_ES_TRYING:  "$$$/AlertDialog/Dialog/MESSAGE_ES_TRYING=In progress...",
    MESSAGE_ES_PLEASE_WAIT:  "$$$/AlertDialog/Dialog/MESSAGE_ES_PLEASE_WAIT=Please wait",
    MESSAGE_ES_ERROR_OCCURED:  "$$$/AlertDialog/Dialog/MESSAGE_ES_ERROR_OCCURED=An error occurred.",
    MESSAGE_ES_PRESS_CONTIUE:  "$$$/AlertDialog/Dialog/PRESS_ANY_KEY=Press any key to continue.",
    MESSAGE_ES_TRY_AGAIN_1:  "$$$/AlertDialog/Dialog/MESSAGE_ES_TRY_AGAIN_1=Please try again.",
    MESSAGE_ES_TRY_AGAIN_2:  "$$$/AlertDialog/Dialog/MESSAGE_ES_TRY_AGAIN_2=Please try again later.",
    MESSAGE_ES_CHECK_HOME_UPDATE:  "$$$/AlertDialog/Dialog/MESSAGE_ES_CHECK_HOME_UPDATE=Please check www.adobe.com for updates.",
    MESSAGE_ES_ASK_HELP:  "$$$/AlertDialog/Dialog/MESSAGE_ES_ASK_HELP=Please contact Adobe Technical Support.",
    MESSAGE_ES_CANNT_FIND:  "$$$/AlertDialog/Dialog/MESSAGE_ES_CANNT_FIND=Cannot find",
    MESSAGE_ES_CANNT_OPEN:  "$$$/AlertDialog/Dialog/MESSAGE_ES_CANNT_OPEN=Cannot open",
    MESSAGE_ES_RESTART_BRIDGE_1:  "$$$/AlertDialog/Dialog/MESSAGE_ES_RESTART_BRIDGE_1=Please restart Adobe Bridge.",
    MESSAGE_ES_RESTART_BRIDGE_2:  "$$$/AlertDialog/Dialog/MESSAGE_ES_RESTART_BRIDGE_2=Please restart Adobe Bridge and try again.",
    MESSAGE_ES_CK_PREF:  "$$$/AlertDialog/Dialog/MESSAGE_ES_CK_PREF=Please check Adobe Stock Photos preferences.",
    MESSAGE_ES_MULTI_MEDIASIZE_INVALID:  "$$$/AlertBox/MESSAGE_ES_MULTI_MEDIASIZE_INVALID=Cannot find the high-res files for %1 of images. Please contact customer service to retrieve the purchased image.",
    MESSAGE_ES_DISK_ACCESS:  "$$$/AlertBox/MESSAGE_ES_DISK_ACCESS=Cannot access to %1. It may be locked or in use, the disk may be full, or you may not have access privileges.",
    
    
    MESSAGE_ES_NO_SRCH_KEYWORD: "$$$/AlertBox/MESSAGE_ES_NO_SRCH_KEYWORD=Please enter one or more keywords into the Search field.",
    MESSAGE_ES_NO_ORIENT_SEL: "$$$/AlertBox/MESSAGE_ES_NO_ORIENT_SEL=Please select one or more Orientations in Advanced Search.",
    MESSAGE_ES_NO_TINT_SEL: "$$$/AlertBox/MESSAGE_ES_NO_TINT_SEL=Please select one or more Tints in Advanced Search.",
    MESSAGE_ES_NO_SETTINGS_SEL: "$$$/AlertBox/MESSAGE_ES_NO_SETTINGS_SEL=Please select one or more options from each of the following categories in Advanced Search: Content, Tint, Orientations, Collections.",
    MESSAGE_ES_NO_COLL_SEL: "$$$/AlertBox/MESSAGE_ES_NO_COLL_SEL=Please select one or more Collections in Advanced Search.",
    MESSAGE_ES_TWO_NOT_SEL: "$$$/AlertBox/MESSAGE_ES_TWO_NOT_SEL=Please select one or more options from each of the following categories in Advanced Search:",
    
    // added as of 11/23/2005
    MESSAGE_ES_NO_CONTENT_SEL: "$$$/AlertBox/MESSAGE_ES_NO_CONTENT_SEL=Please select one or more Contents in Advanced Search.",
    //KR to make Localization strings.
    MESSAGE_AUTH_PROXY_INFO1: "$$$/AlertBox/MESSAGE_AUTH_PROXY_INFO1=You are attempting to access Adobe Stock Photos from a network server that requires you to log in to access the Internet.",
    MESSAGE_AUTH_PROXY_INFO2: "$$$/AlertBox/MESSAGE_AUTH_PROXY_INFO2=You must enter your login credentials in this dialog. You will then be prompted in a separate dialog to enter the same credentials.",
    MESSAGE_AUTH_PROXY_LINK: "$$$/AlertBox/MESSAGE_AUTH_PROXY_LINK01=Click on the icon for more details.",
    
};

stockphoto.alertBox.sProxyHeaderWarning = "";
stockphoto.alertBox.sProxyHeaderNext = "";
stockphoto.alertBox.sProxyIconDetails = "";

stockphoto.alertBox.PopulateProxyStrings = function()
{
	var zc = stockphoto.alertBox.zc;
	stockphoto.alertBox.sProxyHeaderWarning = zc.get("$$$/AlertBox/MESSAGE_AUTH_PROXY_INFO1=You are attempting to access Adobe Stock Photos from a network server that requires you to log in to access the Internet.");
	stockphoto.alertBox.sProxyHeaderNext =  zc.get("$$$/AlertBox/MESSAGE_AUTH_PROXY_INFO2=You must enter your login credentials in this dialog. You will then be prompted in a separate dialog to enter the same credentials.");
	stockphoto.alertBox.sProxyIconDetails = zc.get("$$$/AlertBox/MESSAGE_AUTH_PROXY_LINK01=Click on the icon for more details.");
}
///////////////////////////////////////////////////////////////////
// Error message arrays that appear below must be kept parallel
// to the error code enumerated lists kept in the C source file
// named SPSErrorCodes.h.
///////////////////////////////////////////////////////////////////

stockphoto.alertBox.coreComponentID = 1000;
stockphoto.alertBox.coreErrors =
[
/*ERROR_CORE_KEYWORD_INVALID*/{userMsgTag:"ERROR_CORE_KEYWORD_INVALID", logMsg: "Keyword is invalid.", showErrCode: false, icon: 1 },
/*ERROR_CORE_FILENAME_INVALID*/{userMsgTag:"ERROR_CORE_FILENAME_INVALID", logMsg: "Filename is invalid.",  showErrCode: false, icon: 1 },
/*ERROR_CORE_ALLOCATION_FAILE*/{userMsgTag:"ERROR_CORE_ALLOCATION_FAILED", logMsg: "Memory allocation failed.",  showErrCode: false, icon: 1 },
/*ERROR_CORE_ADAPTER_LOAD_ERROR*/{userMsgTag:"ERROR_CORE_ADAPTER_LOAD_ERROR", logMsg: "Failed to load partner adapter.",  showErrCode: false, icon: 1 },
/*ERROR_CORE_SYSTEM_ERROR*/{userMsgTag:"ERROR_CORE_SYSTEM_ERROR", logMsg: "A system error occurred.",  showErrCode: false, icon: 1 },
/*ERROR_CORE_RESULTS_DIR_INVALID*/{userMsgTag:"ERROR_CORE_RESULTS_DIR_INVALID", logMsg: "The Results directory is invalid",  showErrCode: false, icon: 1 },
/*ERROR_CORE_CANT_CREATE_DIR*/{userMsgTag:"ERROR_CORE_CANT_CREATE_DIR", logMsg: "Can not create directory.",  showErrCode: false, icon: 1 },
/*ERROR_CORE_READING_METADATA_ERROR*/{userMsgTag:"ERROR_CORE_READING_METADATA_ERROR", logMsg: "Could not read meta data in image file.",  showErrCode: false, icon: 1 },
/*ERROR_CORE_CANT_OPEN_IMAGE_FILE*/{userMsgTag:"ERROR_CORE_CANT_OPEN_IMAGE_FILE", logMsg: "Could not open image file.",  showErrCode: false, icon: 1 },
/*ERROR_CORE_CANT_FETCH_THUMBNAILS*/{userMsgTag:"ERROR_CORE_CANT_FETCH_THUMBNAILS", logMsg: "Could not fetch thumbnail files.",  showErrCode: false, icon: 1 },
/*ERROR_CORE_CANT_COPY_MOVE_DELETE_FILE*/{userMsgTag:"ERROR_CORE_CANT_COPY_MOVE_DELETE_FILE", logMsg: "Failed to copy file.",  showErrCode: false, icon: 1 },
/*ERROR_CORE_CANT_DELETE_FILE*/{userMsgTag:"ERROR_CORE_CANT_DELETE_FILE", logMsg: "Failed to delete file.",  showErrCode: false, icon: 1 },
/*ERROR_CORE_CANT_READ_XML_FILE*/{userMsgTag:"ERROR_CORE_CANT_READ_XML_FILE", logMsg: "Failed to read XML file.",  showErrCode: false, icon: 1 },
/*ERROR_CORE_CANT_FIND_XML_FILE*/{userMsgTag:"ERROR_CORE_CANT_FIND_XML_FILE", logMsg: "Failed to find XML file.",  showErrCode: false, icon: 1 },
/*ERROR_CORE_XML_PARSE_ERROR*/{userMsgTag:"ERROR_CORE_XML_PARSE_ERROR", logMsg: "Failed to parse XML file.",  showErrCode: false, icon: 1 },
/*ERROR_CORE_PARTNERS_XML_MISSING_ERROR*/{userMsgTag:"ERROR_CORE_PARTNERS_XML_MISSING_ERROR", logMsg: "The partners.xml file is missing.",  showErrCode: false, icon: 1 },
/*ERROR_CORE_SSL_CERT_FILE_MISSING_ERROR*/{userMsgTag:"ERROR_CORE_SSL_CERT_FILE_MISSING_ERROR", logMsg: "Failed to find SSL certificate file.",  showErrCode: false, icon: 1 },
/*ERROR_CORE_CANT_INIT_ADAPTER*/{userMsgTag:"ERROR_CORE_SYSTEM_ERROR", logMsg: "Could not initialize partner adapter.",  showErrCode: false, icon: 1 },
/*ERROR_CORE_SPWSADAPTER_ERR*/{userMsgTag:"ERROR_CORE_SYSTEM_ERROR", logMsg: "Stock Photos Partner Adapter error occurred.",  showErrCode: false, icon: 1 },
/*ERROR_CORE_AXE_DOM*/{userMsgTag:"ERROR_CORE_SYSTEM_ERRORM", logMsg: "AXE DOM error occurred.",  showErrCode: false, icon: 1 },
/*ERROR_CORE_BOOST_EXCEPTION*/{userMsgTag:"ERROR_CORE_SYSTEM_ERROR", logMsg: "BOOST error occurred.",  showErrCode: false, icon: 1 },
/*ERROR_CORE_UNKNOWN_EXCEPTION*/{userMsgTag:"ERROR_CORE_SYSTEM_ERROR", logMsg: "Unknown error occurred.",  showErrCode: false, icon: 1 },
/*ERROR_CORE_PARNTER_NOT_LOADED*/{userMsgTag:"ERROR_CORE_PARNTER_NOT_LOADED", logMsg: "Partner is not in the XML file Comp or info.",  showErrCode: false, icon: 2 }, 
/*ERROR_CORE_PARNTER_NOT_LOADED_HIREZ*/{userMsgTag:"ERROR_CORE_PARNTER_NOT_LOADED_HIREZ", logMsg: "Partner is not in the XML file HIREZ.",  showErrCode: false, icon: 2 },
/*ERROR_CORE_NO_DISK_ACCESS*/{userMsgTag:"ERROR_ADAPTER_NO_DISK_ACCESS", logMsg: "",  showErrCode: false, icon: 1 },
/*ERROR_CORE_MORE_RESULTS_NOT_AVAIL*/{userMsgTag:"ERROR_CORE_MORE_RESULTS_NOT_AVAIL", logMsg: "",  showErrCode: false, icon: 1 },
/*ERROR_CORE_MORE_RESULTS_FAIL*/{userMsgTag:"ERROR_CORE_MORE_RESULTS_FAIL", logMsg: "",  showErrCode: false, icon: 1 },
/*ERROR_CORE_CLOSING_CONNECTION*/{userMsgTag:"ERROR_CORE_CLOSING_CONNECTION", logMsg: "",  showErrCode: false, icon: 1 },
/*ERROR_CORE_PROXY_AUTHORIZE*/{userMsgTag:"ERROR_CORE_PROXY_AUTHORIZE", logMsg: "",  showErrCode: false, icon: 2 },
/*ERROR_CORE_NOT_ALL_RESULTS_FOUND*/{userMsgTag:"ERROR_CORE_NOT_ALL_RESULTS_FOUND", logMsg: "",  showErrCode: false, icon: 1 },
/*ERROR_CORE_ADV_SRC_NO_RESULTS*/{userMsgTag:"ERROR_CORE_ADV_SRC_NO_RESULTS", logMsg: "",  showErrCode: false, icon: 1 },
/*ERROR_CORE_PROXY_RETRIES_OVER*/{userMsgTag:"ERROR_CORE_PROXY_RETRIES_OVER", logMsg: "",  showErrCode: false, icon: 1 },
/*ERROR_CORE_SAVEAS_DEST_INVALID*/{userMsgTag:"ERROR_CORE_SAVEAS_DEST_INVALID", logMsg: "Cannot save file(s). Destination Path not found.",  showErrCode: false, icon: 2 },
/*ERROR_CORE_SAVEAS_INVALID_CUSTOMNAME*/{userMsgTag:"ERROR_CORE_SAVEAS_INVALID_CUSTOMNAME", logMsg: "Cannot save file(s). Invalid File Name.",  showErrCode: false, icon: 2 },
/*ERROR_CORE_SAVEAS_CANNOTSAVE*/{userMsgTag:"ERROR_CORE_SAVEAS_CANNOTSAVE", logMsg: "Error in saving File %1.",  showErrCode: false, icon: 2 },
];

stockphoto.alertBox.adapterComponentID = 2000;
stockphoto.alertBox.adapterErrors =
[
/*ERROR_ADAPTER_SYSTEM_ERROR*/{userMsgTag:"ERROR_ADAPTER_SYSTEM_ERROR", logMsg: "A system error occurred",  showErrCode: false, icon: 1 }, 
/*ERROR_ADAPTER_CONNECTION_ERROR*/{userMsgTag:"ERROR_ADAPTER_CONNECTION_ERROR", logMsg: "Failed to connect to web server.",  showErrCode: false, icon: 2 },
/*ERROR_ADAPTER_SEARCHREQUEST_INVALID*/{userMsgTag:"ERROR_ADAPTER_SEARCHREQUEST_INVALID", logMsg: "The search request is invalid.",  showErrCode: false, icon: 1 },
/*ERROR_ADAPTER_FILEPATH_INVALID*/{userMsgTag:"ERROR_ADAPTER_FILEPATH_INVALID", logMsg: "The filepath is invalid.",  showErrCode: false, icon: 1 },
/*ERROR_ADAPTER_BASENAME_INVALID*/{userMsgTag:"ERROR_ADAPTER_BASENAME_INVALID", logMsg: "The base filename is invalid.",  showErrCode: false, icon: 1 },
/*ERROR_ADAPTER_MEDIAXML_INVALID*/{userMsgTag:"ERROR_ADAPTER_MEDIAXML_INVALID", logMsg: "The media XML file is invalid.",  showErrCode: false, icon: 1 },
/*ERROR_ADAPTER_DOWNLOAD_ERROR*/{userMsgTag:"ERROR_ADAPTER_DOWNLOAD_ERROR", logMsg: "Failed to download the image.",  showErrCode: false, icon: 1 },
/*ERROR_ADAPTER_SIZECODE_INVALID*/{userMsgTag:undefined, logMsg: "The requested file size is 0 byte.",  showErrCode: false, icon: 1 },
/*ERROR_ADAPTER_MEDIASIZE_INVALID*/{userMsgTag:"ERROR_ADAPTER_MEDIASIZE_INVALID", logMsg: "HiRez Image cannot be found on Service Provider Website",  showErrCode: false, icon: 2 },
/*ERROR_ADAPTER_SOAP_ERROR*/{userMsgTag:"ERROR_ADAPTER_SYSTEM_ERROR", logMsg: "Soap error.",  showErrCode: false, icon: 1 },
/*ERROR_ADAPTER_BAD_OBJECT*/{userMsgTag:"ERROR_ADAPTER_SYSTEM_ERROR", logMsg: "ExceptionBadObject. ",  showErrCode: false, icon: 1 },
/*ERROR_ADAPTER_UNKNOWN_EXCEPTION*/{userMsgTag:"ERROR_ADAPTER_SYSTEM_ERROR", logMsg: "ExceptionBadObject. ",  showErrCode: false, icon: 1 },
/*ERROR_ADAPTER_HIREZ_ERR_MEDIASIZE*/{userMsgTag:"ERROR_ADAPTER_HIREZ_ERR_MEDIASIZE", logMsg: "The downloaded HiRez Image does not match expected size.",  showErrCode: false, icon: 1 },
/*ERROR_ADAPTER_HAS_URL_NO_IMAGE*/{userMsgTag:"ERROR_ADAPTER_HAS_URL_NO_IMAGE", logMsg: "Failed to find the image on providers website.",  showErrCode: false, icon: 1 },
/*ERROR_ADAPTER_NO_DISK_ACCESS*/{userMsgTag:"ERROR_ADAPTER_NO_DISK_ACCESS", logMsg: "HiRez download. Fail to write to disk.",  showErrCode: false, icon: 1 },
/*ERROR_ADAPTER_HIREZ_INVALID_IMAGE*/{userMsgTag:"MESSAGE_ES_CORRUPTED_FILE", logMsg: "HiRez image corrupted. File deleted",  showErrCode: false, icon: 1 },
/*ERROR_ADAPTER_PROXY_AUTH_REQUIRED*/{userMsgTag:"ERROR_CORE_PROXY_AUTHORIZE", logMsg: "Adapter Proxy Auth Required",  showErrCode: false, icon: 1 },
/*ERROR_ADAPTER_NO_FOLDER_ACCESS*/{userMsgTag:"ERROR_ADAPTER_NO_FOLDER_ACCESS", logMsg: "",  showErrCode: false, icon: 1 },
];

stockphoto.alertBox.webServiceComponentID = 2500;
stockphoto.alertBox.webServiceErrors =
[
/*ERROR_WEBSERVICE_ERROR*/{userMsgTag:"ERROR_WEBSERVICE_ERROR", logMsg: "Unknown web service error.",  showErrCode: false, icon: 1 },
/*ERROR_WEBSERVICE_INVALIDUSER*/{userMsgTag:undefined, logMsg: "Invalid user name or password.",  showErrCode: false, icon: 1 },
/*ERROR_WEBSERVICE_SERVERBUSY*/{userMsgTag:"ERROR_WEBSERVICE_SERVERBUSY", logMsg: "Server is too busy to handle the request.",  showErrCode: false, icon: 2 },
/*ERROR_WEBSERVICE_INVALIDSECURITYID*/{userMsgTag:undefined, logMsg: "Invalid securityID.",  showErrCode: false, icon: 1 },
/*ERROR_WEBSERVICE_INVALIDSEARCHREQUEST*/{userMsgTag:undefined, logMsg: "Invalid securityRequestXML.",  showErrCode: false, icon: 1 },
/*ERROR_WEBSERVICE_NOMORESEARCHRESULT*/{userMsgTag:undefined, logMsg: "No more search result.",  showErrCode: false, icon: 1 },
/*ERROR_WEBSERVICE_INVALIDSEARCHID*/{userMsgTag:undefined, logMsg: "Invalid searchID.",  showErrCode: false, icon: 1 },
/*ERROR_WEBSERVICE_INVALIDMEDIAXML*/{userMsgTag:undefined, logMsg: "Invalid mediaXML.",  showErrCode: false, icon: 1 },
/*ERROR_WEBSERVICE_INVALIDPURCHASEID*/{userMsgTag:undefined, logMsg: "The requested Image is not available for download",  showErrCode: false, icon: 1 },
/*ERROR_WEBSERVICE_UNSUPPORTEDLANGUAGE*/{userMsgTag:undefined, logMsg: "Unsupported language.",  showErrCode: false, icon: 1 },
/*ERROR_WEBSERVICE_SESSIONTIMEOUT*/{userMsgTag:undefined, logMsg: "Client.Login session timeout.",  showErrCode: false, icon: 1 },
/*ERROR_WEBSERVICE_NOTFOUND*/{userMsgTag:"ERROR_WEBSERVICE_NOTFOUND", logMsg: "The requested item cannot be found.",  showErrCode: false, icon: 2 },
/*ERROR_WEBSERVICE_OUTOFBOUNDSSTARTPOS*/{userMsgTag:undefined, logMsg: "Starting position for a search is out of bounds.",  showErrCode: false, icon: 1 },
/*ERROR_WEBSERVICE_INVALIDSIGNATURE*/{userMsgTag:"ERROR_WEBSERVICE_INVALIDSIGNATURE", logMsg: "Digital Signature is invalid.",  showErrCode: false, icon: 1 },
/*ERROR_WEBSERVICE_DOWNLOADNOTAUTHORIZED*/{userMsgTag:"ERROR_WEBSERVICE_DOWNLOADNOTAUTHORIZED", logMsg: "Download was not authorized with e-commerce.",  showErrCode: false, icon: 1 },
/*ERROR_WEBSERVICE_UNSUPPORTEDCOUNTRY*/{userMsgTag:"ERROR_WEBSERVICE_UNSUPPORTEDCOUNTRY", logMsg: "The specified country is not supported.",  showErrCode: false, icon: 1 }
];

stockphoto.alertBox.eCommerceComponentID = 3000;
stockphoto.alertBox.eCommerceErrors =
[
/*ERROR_ECOM_SYSTEM_ERROR*/{userMsgTag:"ERROR_ECOM_SYSTEM_ERROR", logMsg: "A system error occurred.",  showErrCode: false, icon: 1 },
/*ERROR_ECOM_CONNECTION_ERROR*/{userMsgTag:"ERROR_ECOM_CONNECTION_ERROR", logMsg: "Failed to connect to e-commerce web server.",  showErrCode: false, icon: 2 },
/*ERROR_ECOM_FILEPATH_INVALID*/{userMsgTag:"ERROR_ECOM_FILEPATH_INVALID", logMsg: "The filepath is invalid.",  showErrCode: false, icon: 1 },
/*ERROR_ECOM_BASENAME_INVALID*/{userMsgTag:"ERROR_ECOM_BASENAME_INVALID", logMsg: "The base filename is invalid.",  showErrCode: false, icon: 1 },
/*ERROR_ECOM_UNABLE_TO_OPEN_SHOPPING_CART*/{userMsgTag:"ERROR_ECOM_UNABLE_TO_OPEN_SHOPPING_CART", logMsg: "Unable to open the shopping cart.",  showErrCode: false, icon: 1 },
/*ERROR_ECOM_TARGET_PATH_INVALID*/{userMsgTag:"ERROR_ECOM_TARGET_PATH_INVALID", logMsg: "Target file path is invalid.",  showErrCode: false, icon: 1 },
/*ERROR_ECOM_SSL_AUTHENTICATE_ERROR*/{userMsgTag:"ERROR_ECOM_SSL_AUTHENTICATE_ERROR", logMsg: "Unable to establish a secure connection to the Adobe Stock Photos store. Please contact customer Service.",  showErrCode: false, icon: 1 },
/*ERROR_ECOM_AUTHENTICATE_ERROR*/{userMsgTag:"ERROR_ECOM_AUTHENTICATE_ERROR", logMsg: "The Adobe Stock Photos store is currently unavailable. Please try again later.",  showErrCode: false, icon: 1 },
/*ERROR_ECOM_NOORDERID_ERROR*/{userMsgTag:"ERROR_ECOM_NOORDERID_ERROR", logMsg: "Unable to process the items in your shopping cart. Please contact customer service.",  showErrCode: false, icon: 1 },
/*ERROR_ECOM_ORDERSTATUS_ERROR*/{userMsgTag:"ERROR_ECOM_ORDERSTATUS_ERROR", logMsg: "Unable to process your order. Please contact customer service.",  showErrCode: false, icon: 1 },
/*ERROR_ECOM_LOGDLCOMPLETE_ERROR*/{userMsgTag:undefined, logMsg: "LogDownloadComplete failed.",  showErrCode: false, icon: 1 }, // no user message should be associated with this error.
/*ERROR_ECOM_PARAMETER_ERROR*/{userMsgTag:"ERROR_ECOM_PARAMETER_ERROR", logMsg: "Parameter error",  showErrCode: false, icon: 1 },
/*ERROR_ECOM_PROXY_AUTH_REQUIRED*/{userMsgTag:"ERROR_CORE_PROXY_AUTHORIZE", logMsg: "eCom Proxy Auth Required",  showErrCode: false, icon: 1 }
];
 
stockphoto.alertBox.extendScriptComponentID = 5000;
stockphoto.alertBox.extendScriptErrors =
[
/*MESSAGE_ES_CLEAR_IMAGE_LIST*/{userMsgTag:"MESSAGE_ES_CLEAR_IMAGE_LIST", logMsg: "",  showErrCode: false, icon: 1 },
/*MESSAGE_ES_MISSING_RES*/{userMsgTag:"MESSAGE_ES_MISSING_RES", logMsg: "No resolution.",  showErrCode: false, icon: 2 },
/*MESSAGE_ES_MULTI_HIRES_ERRORS*/{userMsgTag:"MESSAGE_ES_MULTI_HIRES_ERRORS", logMsg: "Multiple Hi rez errors",  showErrCode: false, icon: 2 },
/*MESSAGE_ES_CORRUPTED_FILE*/{userMsgTag:"MESSAGE_ES_CORRUPTED_FILE", logMsg: "bad file.",  showErrCode: false, icon: 2 },
/*MESSAGE_ES_COMP_LATE*/{userMsgTag:"MESSAGE_ES_COMP_LATE", logMsg: "Comp slow.",  showErrCode: false, icon: 1 },
/*MESSAGE_ES_COMP_NO_IMG_RES*/{userMsgTag:"MESSAGE_ES_COMP_NO_IMG_RES", logMsg: "No resolution info for image.",  showErrCode: false, icon: 1 },
/*MESSAGE_ES_OVERWRITE_FILE*/{userMsgTag:"MESSAGE_ES_OVERWRITE_FILE", logMsg: "overwrite?",  showErrCode: false, icon: 1 },
/*MESSAGE_ES_SEARCH_IN_PROGRESS*/{userMsgTag:"MESSAGE_ES_SEARCH_IN_PROGRESS", logMsg: "",  showErrCode: false, icon: 1 },
/*MESSAGE_ES_SELECT_ONE_IMAGE*/{userMsgTag:"MESSAGE_ES_SELECT_ONE_IMAGE", logMsg: "",  showErrCode: false, icon: 1 },
/*MESSAGE_ES_WAITING*/{userMsgTag:"MESSAGE_ES_WAITING", logMsg: "",  showErrCode: false, icon: 1 },
/*MESSAGE_ES_TRYING*/{userMsgTag:"MESSAGE_ES_TRYING", logMsg: "",  showErrCode: false, icon: 1 },
/*MESSAGE_ES_PLEASE_WAIT*/{userMsgTag:"MESSAGE_ES_PLEASE_WAIT", logMsg: "",  showErrCode: false, icon: 1 },
/*MESSAGE_ES_ERROR_OCCURED*/{userMsgTag:"MESSAGE_ES_ERROR_OCCURED", logMsg: "",  showErrCode: false, icon: 1 },
/*MESSAGE_ES_PRESS_CONTIUE*/{userMsgTag:"SELECT_ONE_IMAGE", logMsg: "",  showErrCode: false, icon: 1 },
/*MESSAGE_ES_TRY_AGAIN_1*/{userMsgTag:"MESSAGE_ES_TRY_AGAIN_1", logMsg: "",  showErrCode: false, icon: 1 },
/*MESSAGE_ES_TRY_AGAIN_2*/{userMsgTag:"MESSAGE_ES_TRY_AGAIN_2", logMsg: "",  showErrCode: false, icon: 1 },
/*MESSAGE_ES_CHECK_HOME_UPDATE*/{userMsgTag:"MESSAGE_ES_CHECK_HOME_UPDATE", logMsg: "",  showErrCode: false, icon: 1 },
/*MESSAGE_ES_ASK_HELP*/{userMsgTag:"MESSAGE_ES_ASK_HELP", logMsg: "",  showErrCode: false, icon: 1 },
/*MESSAGE_ES_CANNT_FIND*/{userMsgTag:"MESSAGE_ES_CANNT_FIND", logMsg: "",  showErrCode: false, icon: 1 },
/*MESSAGE_ES_CANNT_OPEN*/{userMsgTag:"MESSAGE_ES_CANNT_OPEN", logMsg: "",  showErrCode: false, icon: 1 },
/*MESSAGE_ES_RESTART_BRIDGE_1*/{userMsgTag:"MESSAGE_ES_RESTART_BRIDGE_1", logMsg: "",  showErrCode: false, icon: 1 },
/*MESSAGE_ES_RESTART_BRIDGE_2*/{userMsgTag:"MESSAGE_ES_RESTART_BRIDGE_2", logMsg: "",  showErrCode: false, icon: 1 },
/*MESSAGE_ES_CK_PREF*/{userMsgTag:"MESSAGE_ES_CK_PREF", logMsg: "",  showErrCode: false, icon: 1 },
/*MESSAGE_ES_CORRUPTED_FILE_MULTI*/{userMsgTag:"MESSAGE_ES_CORRUPTED_FILE_MULTI", logMsg: "bad files.",  showErrCode: false, icon: 2 },
/*MESSAGE_ES_MULTI_MEDIASIZE_INVALID*/{userMsgTag:"MESSAGE_ES_MULTI_MEDIASIZE_INVALID", logMsg: "Multiple HiRez Image cannot be found on Service Provider Website",  showErrCode: false, icon: 2 },
/*MESSAGE_ES_DISK_ACCESS*/{userMsgTag:"MESSAGE_ES_DISK_ACCESS", logMsg: "",  showErrCode: false, icon: 2 },
/*MESSAGE_ES_NO_SRCH_KEYWORD*/{userMsgTag:"MESSAGE_ES_NO_SRCH_KEYWORD", logMsg: "No Search keyword",  showErrCode: false, icon: 2 },
/*MESSAGE_ES_NO_ORIENT_SEL*/{userMsgTag:"MESSAGE_ES_NO_ORIENT_SEL", logMsg: "No Orientation were selected",  showErrCode: false, icon: 1 },
/*MESSAGE_ES_NO_TINT_SEL*/{userMsgTag:"MESSAGE_ES_NO_TINT_SEL", logMsg: "No Tint were selected",  showErrCode: false, icon: 1 },
/*MESSAGE_ES_NO_SETTINGS_SEL*/{userMsgTag:"MESSAGE_ES_NO_SETTINGS_SEL", logMsg: "No Settings were selected",  showErrCode: false, icon: 1 },
/*MESSAGE_ES_NO_COLL_SEL*/{userMsgTag:"MESSAGE_ES_NO_COLL_SEL", logMsg: "No Collections were selected",  showErrCode: false, icon: 1 },
/*MESSAGE_ES_TWO_NOT_SEL*/{userMsgTag:"MESSAGE_ES_TWO_NOT_SEL", logMsg: "Two of the settings were not selected",  showErrCode: false, icon: 1 },
/*MESSAGE_ES_NO_CONTENT_SEL*/{userMsgTag:"MESSAGE_ES_NO_CONTENT_SEL", logMsg: "No Contents were selected",  showErrCode: false, icon: 1 }
];

stockphoto.alertBox.makeAlertIconPath= function(type, doubleUp)
{
	// The input parameter type is a number indicating which icon to display (0: note, 1: caution, 2: stop, 3: sm_yellow info)
	// The doubleUp flag indicates that backslashes in win filepaths should be doubled up.
	var iconPath;
	var iconExt;
	var baseName;
	var result;
	
	if (type == 0)
		baseName = "note";
	else if (type == 1)
		baseName = "caution";
	else if (type == 3)
		baseName = "smYellowInfo";
	else 
		baseName = "stop";	// defaults to "stop"
		
	if (File.fs == "Windows")
	{
		iconPath = Folder.startup + "/../"+stockphoto.core.installFolder+"/Icons/";
		iconExt = "_win.png";
		var iconFile = new File(iconPath + baseName + iconExt);
		result = iconFile.fsName;

		if (iconFile.exists)
		{
		
			if (doubleUp)
			{
				var finalStr = "";
				var arr = result.split("\\");
				for (i = 0; i < arr.length; i++)
				{
					finalStr += arr[i];
					if (i+1 < arr.length)	// filepath never ends with slash
						finalStr += "\\\\";
				}
					result = finalStr;
			}
		}
		else
		{
			result = "";
		}
		return result;
	}
	else
	{
		iconPath = stockphoto.startUpFolderForMac + "/Resources/Icons/";
		iconExt = "_mac.png";
		result = iconPath + baseName + iconExt;
		
		return result;
	}
}

stockphoto.alertBox.getErrorCodeMessage=function (errorCode, errAlertObj )
{
	var idx;
	
	//by default show the error code.
	errAlertObj.showUserMsg = true;
	errAlertObj.showErrCode = true;	
	errAlertObj.icon = 1;	

	//order matters when checking for which error component.
    
	if (errorCode >= stockphoto.alertBox.extendScriptComponentID)
	{
		idx = errorCode - stockphoto.alertBox.extendScriptComponentID;
 		if (idx < stockphoto.alertBox.extendScriptErrors.length)
		{
			errAlertObj.logMsg = stockphoto.alertBox.extendScriptErrors[idx].logMsg;
			errAlertObj.showErrCode  = stockphoto.alertBox.extendScriptErrors[idx].showErrCode;
			errAlertObj.icon  = stockphoto.alertBox.extendScriptErrors[idx].icon;
			if (stockphoto.alertBox.extendScriptErrors[idx].userMsgTag != undefined)
			{
				errAlertObj.message = eval ("stockphoto.alertBox.localizedStr4ErrMsg." + stockphoto.alertBox.extendScriptErrors[idx].userMsgTag);
				errAlertObj.showUserMsg  = true;
			}
		}
	
	}
	else if (errorCode >= stockphoto.alertBox.eCommerceComponentID)
	{
		idx = errorCode - stockphoto.alertBox.eCommerceComponentID;
		if (idx < stockphoto.alertBox.eCommerceErrors.length)
		{
			errAlertObj.logMsg = stockphoto.alertBox.eCommerceErrors[idx].logMsg;
			errAlertObj.showErrCode  = stockphoto.alertBox.eCommerceErrors[idx].showErrCode;
			errAlertObj.icon  = stockphoto.alertBox.eCommerceErrors[idx].icon;
			if (stockphoto.alertBox.eCommerceErrors[idx].userMsgTag != undefined)
			{
				errAlertObj.message = eval ("stockphoto.alertBox.localizedStr4ErrMsg." + stockphoto.alertBox.eCommerceErrors[idx].userMsgTag);
				errAlertObj.showUserMsg  = true;
			}
		}
	
	}
	else if (errorCode >= stockphoto.alertBox.webServiceComponentID)
	{
		idx = errorCode - stockphoto.alertBox.webServiceComponentID;
		if (idx < stockphoto.alertBox.webServiceErrors.length)
		{
			errAlertObj.logMsg = stockphoto.alertBox.webServiceErrors[idx].logMsg;
			errAlertObj.showErrCode  = stockphoto.alertBox.webServiceErrors[idx].showErrCode;
			errAlertObj.icon  = stockphoto.alertBox.webServiceErrors[idx].icon;
			if (stockphoto.alertBox.webServiceErrors[idx].userMsgTag != undefined)
			{
				errAlertObj.message = eval ("stockphoto.alertBox.localizedStr4ErrMsg." + stockphoto.alertBox.webServiceErrors[idx].userMsgTag);
				errAlertObj.showUserMsg  = true;
			}
		}
	}
	else if (errorCode >= stockphoto.alertBox.adapterComponentID)
	{
		idx = errorCode - stockphoto.alertBox.adapterComponentID;
 		if (idx < stockphoto.alertBox.adapterErrors.length)
		{
			errAlertObj.logMsg = stockphoto.alertBox.adapterErrors[idx].logMsg;
			errAlertObj.showErrCode  = stockphoto.alertBox.adapterErrors[idx].showErrCode;
			errAlertObj.icon  = stockphoto.alertBox.adapterErrors[idx].icon;
			if ( stockphoto.alertBox.adapterErrors[idx].userMsgTag != undefined)
			{
			    errAlertObj.message = eval ("stockphoto.alertBox.localizedStr4ErrMsg." + stockphoto.alertBox.adapterErrors[idx].userMsgTag);
		   	 errAlertObj.showUserMsg  = true;;
			}
		}
	}
	else if (errorCode >= stockphoto.alertBox.coreComponentID)
	{
		idx = errorCode - stockphoto.alertBox.coreComponentID;
 		if (idx < stockphoto.alertBox.coreErrors.length)
		{
			errAlertObj.logMsg = stockphoto.alertBox.coreErrors[idx].logMsg;
			errAlertObj.showErrCode  = stockphoto.alertBox.coreErrors[idx].showErrCode;
			errAlertObj.icon  = stockphoto.alertBox.coreErrors[idx].icon;
			if (stockphoto.alertBox.coreErrors[idx].userMsgTag != undefined)
			{
				errAlertObj.message = eval ("stockphoto.alertBox.localizedStr4ErrMsg." + stockphoto.alertBox.coreErrors[idx].userMsgTag);
				errAlertObj.showUserMsg  = true;
			}
		}
	}

	return errAlertObj;
}

stockphoto.alertBox.alertBox = function( errorCode, arg1, arg2, sAppendMessage )
{
	var zc = stockphoto.alertBox.zc;
	var optionalErrorCodeString = "";	//do we want to display error codes
	var messageString; 		// the string that gets displayed.
	var errrorCodeUnused = 0;	// not used since messageString is defined
	var iconType;  			//which icon to use
	var buttonType;			//which button to use
	var dialogShowResult;		//did the dialog box actually displayed. 


	// get the correct message.  and log error.
	var errAlertObj = new Object();

	// init to default values.	
	errAlertObj.message = "$$$/AlertBox/Dialog/ErrorMessage/AnUnknownErrorOccurred=An unknown error occurred.";
	errAlertObj.showUserMsg = false;
	errAlertObj.showErrCode = false;
	errAlertObj.icon = 1;	// warning icon
	errAlertObj.logMsg = zc.get(errAlertObj.message);
    
	if (errorCode != undefined)
	{
		errAlertObj = stockphoto.alertBox.getErrorCodeMessage(errorCode, errAlertObj);
	}
	
	// regardless if there is a user message.  Log the error.
	stockphoto.core.log.logString( 0, "Err: " + errorCode + " = " + errAlertObj.logMsg );
	
	if (errAlertObj.showUserMsg == false)
	{
		return false;    // no alert box shown then do nothing.
	}

	if (errAlertObj.showErrCode == true)
	{
		optionalErrorCodeString = zc.get("$$$/AlertBox/Dialog/ErrorMessage/ErrorCode=Error code: ") + errorCode;
	}

	//determine if there are arguements to the error message.
	if ((arg2 != undefined) && (arg1 != undefined))
	{
		messageString = zc.get2Arg(errAlertObj.message, arg1, arg2);
	}	
	else if ((arg1 != undefined))
	{
		messageString = zc.get1Arg(errAlertObj.message, arg1);	
	}
	else
	{
		messageString = zc.get(errAlertObj.message);
	}	

	if (optionalErrorCodeString.length > 0)
	{
		messageString = messageString + "\\n\\n" + optionalErrorCodeString;	// use double backslash since we create dialog with auto-layout
    	}
	
	iconType = errAlertObj.icon; //set icon Type

	delete errAlertObj;  //done with object.
    
    // <BoxCar3>
    if (sAppendMessage != undefined)
    {
        messageString = messageString + sAppendMessage;
    }
    
	// call dialog creation function.  Look of dialog depends on the error Code.
	switch (errorCode)
	{
		case 2008: //ERROR_ADAPTER_MEDIASIZE_INVALID
		case 2015: //ERROR_ADAPTER_HIREZ_INVALID_IMAGE
		case 5003: //MESSAGE_ES_MULTI_HIRES_ERRORS
		case 5004: //MESSAGE_ES_CORRUPTED_FILE
			iconType = 2;	// force the Stop icon
			buttonType = 3;	// OK and Customer Service buttons
			dialogShowResult = stockphoto.alertBox.alertDialog(errrorCodeUnused, iconType, buttonType, messageString);
			if (dialogShowResult == 2)
			{
				// go to customer service web page
				stockphoto.alertBox.gotoCustomerServiceURL();
			}
			break;
		// <BoxCar3>
		case 5027:
		case 5028:
		case 5029:
		case 5030:
		case 5031:
		case 5032:
		    
			iconType = 1;	// force the Caution icon
			buttonType = 0;	// OK button
			dialogShowResult = stockphoto.alertBox.alertDialog(errrorCodeUnused, iconType, buttonType, messageString);
			break;
		// </BoxCar3>	
		default:
			{
				buttonType = 0;	// OK button only
				dialogShowResult = stockphoto.alertBox.alertDialog(errrorCodeUnused, iconType, buttonType, messageString);
			}
				break;
	}

	return true;   // show alert box.    
}

////////////////////////////////////////////////////////////////
// Note: st16_ConfirmationBox_Body and st16_DownloadAlertBox_Body
//       have a common input parameter named alertType.
//       This parameter should be unique for each type of dialog.
////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////
// Confirmation Box
// 		Types of confirmation boxes [alertType parameter]:
//			0 = Add to Cart
//			1 = Save Comp Image
//			5 = AlreadyInShoppingCart
//			9 = Save Purchased Images.

stockphoto.alertBox.confirmationBox = function(alertType, imageCount, imageTitlePassed, onCompleteConfirm, addedCount, addedTitle, doc_id, reqIndex)
{
    // Do not display the confirmation box if user preference is set for "do not (false)".
	var prefValue = true; // show by default
	var imageTitle = imageTitlePassed;

    // make sure empty strings do not get displayed (set them to undefined)
    if (imageCount == 1)
    {
    	if (imageTitle != undefined)
    	{
    		if (imageTitle.length == 0)
    		{
    			imageTitle = undefined;
    		}
    	}
	}
    
	switch(alertType)
	{
	case 0:
		prefValue = stockphoto.core.ui.getAlertDisplayPrefs("MessageAfterAddingImageToCart");
		break;
	case 1:
		if(imageCount <= 1)	// KR in case of multiple images always display the dialog.
		{
			prefValue = stockphoto.core.ui.getAlertDisplayPrefs("MessageAfterDownloadComp");
		}
		break;
	case 5:
		prefValue = stockphoto.core.ui.getAlertDisplayPrefs("MessageIfImageAlreadyInCart");
		break;
	case 9:
		if(imageCount <= 1)
		{
			prefValue = false; // Never display Dlg in case of Single Hi-Rez Download because of intermediate Dlg in C++.
		}
		break;
	default:
		// Unknown alertType.
		return;
	}

	if (!prefValue)
		return;

    var zc = stockphoto.alertBox.zc;

    var cancelButtonTitle = "";
	var msgtail = "";
	
	var st16_AlertBoxType = alertType;
	var st16_FolderName = "";
	
	function st16_ConfirmationBox_okBtnClicked()
	{
		var oParent = this.parent;
		
		if( ! (oParent instanceof Window) )
		{
			oParent = oParent.parent;
		}
		
		oParent.close();
				
		if (st16_AlertBoxType == 0 || (st16_AlertBoxType == 1 && 1 == imageCount )|| st16_AlertBoxType == 5)
		{
			// Store user preference.
			var key = stockphoto.alertBox.confirmationBoxTypeToAlertDisplayKey(st16_AlertBoxType);
			if (key != undefined)
				stockphoto.core.ui.setAlertDisplayPrefs(key, oParent.donotShowAgainCheckbox.value ? false : true);
		}

		if (oParent.onComplete != undefined)
				oParent.onComplete.confirmDone("ok");
		app.scheduleTask( "stockphoto.core.util.bringParentToFront("+(oParent.doc_id)+");", 200, false );
	}

	function st16_ConfirmationBox_goToShoppingCartBtnClicked()
	{
		if (st16_AlertBoxType == 0 || st16_AlertBoxType == 1 || st16_AlertBoxType == 5) // Don't need check for st16_AlertBoxType == 1
		{
			// Store user preference.
			var key = stockphoto.alertBox.confirmationBoxTypeToAlertDisplayKey(st16_AlertBoxType);
			if (key != undefined)
				stockphoto.core.ui.setAlertDisplayPrefs(key, this.parent.donotShowAgainCheckbox.value ? false : true);
		}

		if (this.parent.onComplete != undefined)
			this.parent.onComplete.confirmDone("goToShoppingCart");

		// browse to shopping cart
		this.parent.close();
		//execStr = "glb_isSCart = true;";
		//app.scheduleTask("app.document.execJS(" + execStr + ")");
		app.scheduleTask( "stockphoto.core.util.bringParentToFront("+(this.parent.doc_id)+");", 0, false );
		stockphoto.DL.imgDetail.getPriceFin( this.parent.doc_id );
		app.scheduleTask("stockphoto.DL.doShoppingCart(" + this.parent.doc_id + ");", 0, false);
	}

	function st16_ConfirmationBox_goToLowResImageFolderBtnClicked()
	{
		var oParent = this.parent;
		if( ! (oParent instanceof Window) )
		{
			oParent = oParent.parent;
		}
	
		oParent.close();

		if (st16_AlertBoxType == 0 || (st16_AlertBoxType == 1 && 1 == imageCount )|| st16_AlertBoxType == 5)
		{
			// Store user preference.
			var key = stockphoto.alertBox.confirmationBoxTypeToAlertDisplayKey(st16_AlertBoxType);
			if (key != undefined)
				stockphoto.core.ui.setAlertDisplayPrefs(key, oParent.donotShowAgainCheckbox.value ? false : true);
		}

		if (oParent.onComplete != undefined)
			oParent.onComplete.confirmDone("goToLowResImage");

		// browse to Saved Comps folder in original window, if possible
		var doc = stockphoto.documents[oParent.doc_id].document;
		if ((1 == st16_AlertBoxType) && ("" != st16_FolderName) && (File(st16_FolderName)).exists)
		{
		   var oCurrentCompLocation  = new Thumbnail(File(st16_FolderName));
		}
		else
		{
			var oCurrentCompLocation  = new Thumbnail(File(stockphoto.core.GetCurrentCompFolder()));;
		}
		
		if (doc != undefined)
		{
            // If the doc was minimized in the mean time, bring it back to life
			doc.minimized = false;
			doc.thumbnail = oCurrentCompLocation;
		}
		else
		{
			//app.document.thumbnail = stockphoto.places.comps;
			app.document.thumbnail = oCurrentCompLocation;
		}
		stockphoto.DL.imgDetail.getPriceFin( oParent.doc_id );
		app.scheduleTask( "stockphoto.core.util.bringParentToFront("+(oParent.doc_id)+");", 200, false );
	}

    if (alertType == 0)
    {
		cancelButtonTitle = zc.get("$$$/ConfirmationBox/Dialog/ViewShoppingCart=View Shopping Cart");
		msgBody = "";
		msgBody1 = "";
		if (imageCount == 1)
		{
			if( imageTitlePassed.length > 125 )
			{
				imageTitle = stockphoto.core.util.shortenString( imageTitlePassed, 126, 3 );
			}
			msgBody= "$$$/ConfirmationBox/Dialog/OneAddedToYourShoppingCart=^Q%1^Q has been added to your Stock Photos shopping cart.\n\n";
		}
		else if (imageCount > 1)
			msgBody = "$$$/ConfirmationBox/Dialog/MultiAddedToYourShoppingCart=%1 images have been added to your Stock Photos shopping cart.\n\n";

		if (addedCount > 0)
			msgBody1 = "$$$/ConfirmationBox/Dialog/ImagesSkipped=One or more images were being added for the second time, and were skipped.";

	}
    else if ( (1 == alertType) || (9 == alertType) )	// Both comp & Hi-Rez Download..
    {
		if(1 == alertType)
		{
			cancelButtonTitle = zc.get("$$$/ConfirmationBox/Dialog/ViewSavedLowRes=View Folder");
		}
		
		if (imageCount == 1)	// This case will never come in case of Hi-Rez.
		{
			if (imageTitle == undefined)
			{
				msgBody= "$$$/ConfirmationBox/Dialog/OneAddedToYourLowResFolderNoTitle=%1 file has been saved to the following location: \n\n";
			}
			else
			{
				if( imageTitlePassed.length > 36 )
				{
					imageTitle = stockphoto.core.util.shortenString( imageTitlePassed, 36, 3 );
				}
				msgBody= "$$$/ConfirmationBox/Dialog/OneAddedToYourLowResFolder=^Q%1^Q has been saved to the following location: \n";
			}
		}
		else
		{
		// KR Changes .. This message will be used for confirmation of both Multiple & Hi-Rez.
// 		   msgBody = "$$$/ConfirmationBox/Dialog/MultiAddedToYourLowResFolder=%1 files have been saved to the following location: \n";
 		   msgBody = "$$$/ConfirmationBox/Dialog/MultiAddedToYourLowResFolderNew=%1 files have been saved in location %2 with the following names: \n"
 		}  

	}
    else if (alertType == 5)
    {
		cancelButtonTitle = zc.get("$$$/ConfirmationBox/Dialog/ViewShoppingCart=View Shopping Cart");
		if (imageCount == 1)
		   msgBody= "$$$/ConfirmationBox/Dialog/ImageInCartAlready=You have already added ^Q%1^Q to your Stock Photos Shopping Cart.";
		else
 		   msgBody = "$$$/ConfirmationBox/Dialog/MultiImageInCartAlready=You have already added these %1 images to your Stock Photos Shopping Cart.";
	}

    // create dialog
    var valeq = "val=";
    var val = valeq + stockphoto.alertBox.standardCntTab.CONFIRMATION_BOUNDS;
    eval(val);

	// only windows dialogs have a title
    var alert_dialogTitle;
    if (File.fs == "Windows")
		alert_dialogTitle = zc.get("$$$/AlertBox/Dialog/Title=Adobe Stock Photos");
	else
		alert_dialogTitle = "";

  	var aImagesSaved;
	if ( ("undefined" != typeof reqIndex) && (reqIndex >= 0) && ("undefined" != typeof stockphoto.getComp.requests) 
	     && ("undefined" != typeof stockphoto.getComp.requests[ reqIndex ]) 
	     && ("undefined" != typeof stockphoto.getComp.requests[ reqIndex ].SavedFileNames) 
	     && ("undefined" != typeof stockphoto.getComp.requests[ reqIndex ].SavedFileCounter) )
  	{
  	   aImagesSaved = (1 == alertType)? stockphoto.getComp.requests[reqIndex].SavedFileNames: stockphoto.core.SaveComp.aImagesSavedHiRez ;
  	}
  	else
  	{
  	   aImagesSaved = (1 == alertType)? stockphoto.core.SaveComp.aImagesSavedComp: stockphoto.core.SaveComp.aImagesSavedHiRez ;
  	}  	
	var iIMAGESWITHOUTSCROLL = 2;
	// KR For purchase image & Multiple Comp Confirmation Dialog..
    if(9 == alertType || (1 == alertType && imageCount > 1))
    {
    	// No Confirmation Dialog in case of single image purchase...
		if(imageCount <= 1)
		{
			return;
		}
		
		var oConfDlg = new Window('dialog', alert_dialogTitle, undefined, { resizable: true, orientation: "row", closeButton:false } );

		oConfDlg.gpButtonsTop = oConfDlg.add('group');

		// add icon
		if (File.fs == "Windows")
    		val = valeq + valeq + "[ 15,  10,  50,  50]"; 
		else
    		val = valeq + valeq + "[ 15,  10,  80,  80]"; 
    		
		eval(val);

		var iconPath = stockphoto.alertBox.makeAlertIconPath(0, false);
		if (iconPath != "")
		{
			oConfDlg.gpButtonsTop.add('image', val, iconPath);
		}

		var sFolderName;

  		if ("undefined" != typeof reqIndex)
  		{
  		   sFolderName = (9 == alertType)? stockphoto.core.GetCurrentPurchaseFolder() : stockphoto.getComp.requests[reqIndex].DownloadFolder;
  		   if (1 == alertType)
  		   {
  			 st16_FolderName = sFolderName;
  		   }
  		}
  		else
  		{
  		   sFolderName = (9 == alertType)? stockphoto.core.GetCurrentPurchaseFolder() : stockphoto.core.GetCurrentCompFolder();
  		}

		sFolderName = stockphoto.alertBox.trimFolderName(sFolderName, 80, imageCount);
       	// Creating the message
       	var sTopMessage =  zc.get2Arg(msgBody, imageCount, "\""+sFolderName+"\"");
			
//		val = valeq + stockphoto.alertBox.standardCntTab.CONFIRMATION_STATICTEXT_M;
		if(File.fs == "windows")
			val = valeq + "[ 80,  20, 450, 78]";
		else
			val = valeq + "[ 80,  20, 450, 90]";
		eval(val);

       oConfDlg.gpButtonsTop.add('statictext', val, sTopMessage, {name:'alertMessageStatic', multiline:true} );
		
  		var sListOfFiles = "";

		if("undefined" != typeof aImagesSaved)
		{
			var iTotal=0;
			if ( ("undefined" != typeof reqIndex) && (reqIndex >= 0) && (1 == alertType) )
			{
				iTotal = stockphoto.getComp.requests[ reqIndex ].SavedFileCounter;
			}
			else
			{
				iTotal =  aImagesSaved.length;
			}
			for(var iImageNum = 0; iImageNum < iTotal; iImageNum++)
			{
				// Only 40 'W' can fit in a single line..
				if(aImagesSaved.length <= iIMAGESWITHOUTSCROLL)
				{
					aImagesSaved[iImageNum] = stockphoto.alertBox.trimFileName(aImagesSaved[iImageNum]);
				}
				sListOfFiles += aImagesSaved[iImageNum];
				if(File.fs == "Windows")
					sListOfFiles += "\r\n";
				else
					sListOfFiles += "\n";
			}
			// Will add scroll bar only of there are more than 3 images..
			val = valeq + stockphoto.alertBox.standardCntTab.CONFIRMATION_FILELIST_M;
			if(aImagesSaved.length > iIMAGESWITHOUTSCROLL)
				val = valeq + "[135, 40, 460, 137]";
			else
				val = valeq + "[135, 40, 460, 95]";
			eval(val);
		
			if(aImagesSaved.length > iIMAGESWITHOUTSCROLL)
				oConfDlg.add('edittext', val, sListOfFiles, { multiline: true, readonly: true } );
			else
				oConfDlg.add('statictext', val, sListOfFiles, { multiline: true, readonly: true } );
		}
       
       if(9 == alertType)
       {
       		oConfDlg.okBtn = oConfDlg.add( 'button', undefined, zc.get("$$$/ConfirmationBox/Dialog/Btn/OK/Text=OK"));
       		
       		oConfDlg.okBtn.onClick = function()
       		{
       			this.parent.close();
       		}
		}
		else       
       {
			oConfDlg.gpButtons = oConfDlg.add('group');
       
	   		if (File.fs == "Windows")
			{
    			val = valeq + "[ 80, 100, 180, 120]";
    		}
			else
			{
    			val = valeq + "[80, 100, 265, 120]";
    		}		
			eval(val);
    
    		if ("Windows" == File.fs)
    		{
				oConfDlg.okBtn = oConfDlg.gpButtons.add( 'button',val , zc.get("$$$/ConfirmationBox/Dialog/Btn/OK/Text=OK"));
       			oConfDlg.onComplete = onCompleteConfirm;
				oConfDlg.doc_id = doc_id;
				oConfDlg.okBtn.onClick = st16_ConfirmationBox_okBtnClicked;
       		}
     		else
       		{
       			oConfDlg.cancelBtn = oConfDlg.gpButtons.add( 'button',val , zc.get("$$$/ConfirmationBox/Dialog/ViewSavedLowRes=View Folder"));
		    	oConfDlg.cancelBtn.onClick = st16_ConfirmationBox_goToLowResImageFolderBtnClicked;
		    }
       

			if ("Windows" == File.fs)
			{
    			val = valeq + "[195, 100, 380, 120]";
    		}
			else
			{
    			val = valeq + "[280, 100, 380, 120]";
			}   					
			eval(val);
		
			if ("Windows" == File.fs)
			{
				oConfDlg.cancelBtn = oConfDlg.gpButtons.add( 'button',val , zc.get("$$$/ConfirmationBox/Dialog/ViewSavedLowRes=View Folder"));
		    	oConfDlg.cancelBtn.onClick = st16_ConfirmationBox_goToLowResImageFolderBtnClicked;
		    }
		    else
		    {
		    	oConfDlg.okBtn = oConfDlg.gpButtons.add( 'button',val , zc.get("$$$/ConfirmationBox/Dialog/Btn/OK/Text=OK"));
       			oConfDlg.onComplete = onCompleteConfirm;
				oConfDlg.doc_id = doc_id;
				oConfDlg.okBtn.onClick = st16_ConfirmationBox_okBtnClicked;
			}			   
			   
			if (( stockphoto.gpk3 != undefined ) && (stockphoto.gpk3.gpk3Sys[ doc_id ] != undefined))
			{
				stockphoto.gpk3.KWSpiningWheel( doc_id, false /* turmimg OFF */, true /* not to schedule */, stockphoto.gpk3.KWSpiningWheel_unknown /* OFF */ ); 
			}

			
	   }
	   
       oConfDlg.center();
       oConfDlg.show();
       return;
	}
    alert_dlg = new Window('dialog', alert_dialogTitle, val, {closeButton:false});

    alert_dlg.onComplete = onCompleteConfirm;
    alert_dlg.doc_id = doc_id;
    
    // add message box
    val = valeq + stockphoto.alertBox.standardCntTab.CONFIRMATION_STATICTEXT;
    eval(val);

    var fullMessage = "";
    if(1 != alertType)
    {
    //KR for WATSON # 1462938 
		if( ("undefined" != typeof imageTitle )
			&& (imageTitle.length > 35) 
			&& (addedCount > 0)
			&& (imageCount == 1))
		{
			imageTitle = stockphoto.alertBox.trimFolderName(imageTitle, 36, imageCount, true);
		}
		
		if ((imageCount == 1) && (imageTitle != undefined))
			fullMessage =  zc.get1Arg(msgBody, imageTitle);
		else if (imageCount > 0)
			fullMessage =  zc.get1Arg(msgBody, imageCount);

		if (addedCount > 0)
		fullMessage +=  zc.get(msgBody1);
	}      
    else
    {
		var sCompFolderName = stockphoto.core.GetCurrentCompFolder();
    
		if (imageCount == 1)
		{
			if("undefined" != typeof imageTitle)
			{
				fullMessage =  zc.get1Arg(msgBody, imageTitle);
			}
			else
			{
				fullMessage =  zc.get1Arg(msgBody, imageCount);
			} 
			
			if("undefined" != typeof aImagesSaved)
			{
				if (File.fs == "Windows")
					sCompFolderName += "\\"; 
				else
					sCompFolderName += "/" ;
				sCompFolderName +=  aImagesSaved[0];
			}
			sCompFolderName = stockphoto.alertBox.trimFolderName(sCompFolderName, 42, imageCount);
				
			fullMessage += "\n" + sCompFolderName;
		}
		else if (imageCount > 1)
		{
			fullMessage =  zc.get2Arg(msgBody, imageCount, "\""+sCompFolderName+"\"");
			
			if("undefined" != typeof aImagesSaved)
			{
				for(var iImageNum = 0; iImageNum < aImagesSaved.length; iImageNum++)
				{
					fullMessage += "\n" + aImagesSaved[iImageNum];
				}
			}
		}
    }
    
    alert_dlg.add( 'statictext', val, fullMessage, { name:'alertMessageStatic', multiline:true } );
    
    // add icon
    if (File.fs == "Windows")
    	val = valeq + stockphoto.alertBox.standardCntTab.CONFIRMATION_ICON_BOUNDS_WIN;
    else
    	val = valeq + stockphoto.alertBox.standardCntTab.CONFIRMATION_ICON_BOUNDS_MAC;
    eval(val);

	var type = 0;	// always use a note icon
	var iconPath = stockphoto.alertBox.makeAlertIconPath(type, false);
	if (iconPath != "")
	{
		alert_dlg.add('image', val, iconPath);
	}
    
    // add ok button
    if (File.fs == "Windows")
    	val = valeq + stockphoto.alertBox.standardCntTab.CONFIRMATION_OK_BUTTON_WIN;
    else	// mac
    	val = valeq + stockphoto.alertBox.standardCntTab.CONFIRMATION_OK_BUTTON_MAC;
    eval(val);

    var okBtnTitle = zc.get("$$$/ConfirmationBox/Dialog/Btn/OK/Text=OK");
    alert_dlg.okBtn = alert_dlg.add( 'button', val, okBtnTitle, { alignment:['center','top'] } );
    alert_dlg.defaultElement = alert_dlg.okBtn;

	alert_dlg.okBtn.onClick = st16_ConfirmationBox_okBtnClicked;
    // add cancel button
	if (File.fs == "Windows")
    	val = valeq + stockphoto.alertBox.standardCntTab.CONFIRMATION_CANCEL_BUTTON_WIN;
	else	// mac
    	val = valeq + stockphoto.alertBox.standardCntTab.CONFIRMATION_CANCEL_BUTTON_MAC;
	eval(val);

	alert_dlg.cancelBtn = alert_dlg.add( 'button', val, cancelButtonTitle, { alignment:['center','top'] } );
	alert_dlg.cancelElement = alert_dlg.cancelBtn;
    
	if (( stockphoto.gpk3 != undefined ) && (stockphoto.gpk3.gpk3Sys[ doc_id ] != undefined))
		stockphoto.gpk3.KWSpiningWheel( doc_id, false /* turmimg OFF */, true /* not to schedule */, stockphoto.gpk3.KWSpiningWheel_unknown /* OFF */ ); 

    // cancel button action differs based on where ConfirmationBox is called
    if (alertType == 0)
		alert_dlg.cancelBtn.onClick = st16_ConfirmationBox_goToShoppingCartBtnClicked;
    else if (alertType == 1)
		alert_dlg.cancelBtn.onClick = st16_ConfirmationBox_goToLowResImageFolderBtnClicked;
    else if (alertType == 5)
		alert_dlg.cancelBtn.onClick = st16_ConfirmationBox_goToShoppingCartBtnClicked;
    
    // Do Not Add Checkbox in case of multiple comp/Hi-Rez download.
    if( (1 != alertType) || (1 == imageCount))
    {
		// add checkbox
		val = valeq + stockphoto.alertBox.standardCntTab.CONFIRMATION_CHECKBOX;
		eval(val);
		var checkboxTitle;
		checkboxTitle = zc.get("$$$/DownloadAlertBox/Dialog/DonotShowAgain=Don't Show Again");

		alert_dlg.donotShowAgainCheckbox = alert_dlg.add( 'checkbox', val, checkboxTitle);
		alert_dlg.donotShowAgainCheckbox.value = false;
    }
    
    // display the dialog
    alert_dlg.center();
    alert_dlg.show();
}

stockphoto.alertBox.trimFolderName = function(sFolderName, iLen, imageCount, isFile)
{
	var MAX_WORD_LEN = 22;
	if("en_US" == stockphoto.core.getValidLocale())
		MAX_WORD_LEN = 24;
	
	if(true == isFile)
		MAX_WORD_LEN = 35;
	
	if("undefined" != typeof imageCount && imageCount > 1)
		MAX_WORD_LEN = 30;
	
	if( sFolderName.length > iLen)
	{
		var chSeparater = (File.fs == "Windows") ? '\\' : '/';
		if(true == isFile)
		{
			chSeparater = ' ';
		}
		var sLastFolder = sFolderName.substring(sFolderName.lastIndexOf(chSeparater));
		var sFirstFolder = sFolderName.substring(0, sFolderName.indexOf(chSeparater) + 1);
		if(undefined == typeof sFirstFolder)
		{
			sFirstFolder = "";
		}
		
		if(sLastFolder != sFolderName && sLastFolder.length <= (0.9 * iLen) )
		{
			sFolderName = sFolderName.substr(0, (iLen - sLastFolder.length) ) + "..." + sLastFolder;
		}
		else if("" != sFirstFolder && sFirstFolder.length <= (0.9 * iLen) )
		{
			sFolderName = sFirstFolder + "..." + sFolderName.substr(sFolderName.length-(iLen-sFirstFolder.length)); 
		}
		else
		{
			sFolderName = sFolderName.substr(0, iLen/4) + " ... " + sFolderName.substr((sFolderName.length - (3*iLen)/4));
		}
	}
	// Checking for each word length to be less that MAX_WORD_LEN
	var iCounter = 0;
	var iWordLen = 0;
	for(iCounter=0; iCounter<sFolderName.length; iCounter++, iWordLen++)
	{
		if( (' ' == sFolderName.charAt(iCounter)) || ('\t' == sFolderName.charAt(iCounter)) || ('\n' == sFolderName.charAt(iCounter)) )
		{
			iWordLen = 0;
		}
		// Break the word becoz it is too long
		if(iWordLen > MAX_WORD_LEN)
		{
			sFolderName = sFolderName.substr(0, iCounter) + "\n" + sFolderName.substr(iCounter);
			iWordLen = 0;
		}
	}
	
	return sFolderName;
}

stockphoto.alertBox.trimFileName = function(sFileName)
{
    var sFileExtention = sFileName.substring(sFileName.lastIndexOf(".") +1);
    	
    if(sFileExtention == sFileName || sFileExtention.length > 4) // Not an Extention
    {
    	sFileExtention = "";
    }

    if("en_US" == stockphoto.core.getValidLocale())
    {
	    if(stockphoto.alertBox.numberOfWM(sFileName) > 15)
		{
			iLength = 29;
		}
		else
		{
			iLength  = 38;
		}
	}
	else
	{
		iLength = 25;
	}
    
	if( sFileName.length > iLength )
	{
		sFileName = sFileName.substr(0, (iLength - 4 - sFileExtention.length)) + "..." + sFileName.substr(sFileName.length -(4 + sFileExtention.length));
	}
	return sFileName;
}

stockphoto.alertBox.numberOfWM = function(strInput)
{
	var iNumberOfW = 0;
	var iPosW = -1;
	var iPosM = -1;
	while( ((iPosW=strInput.indexOf('W', iPosW+1))!= -1) || ((iPosM=strInput.indexOf('M', iPosM+1))!= -1) )
	{
		iNumberOfW++;
	}
	
	return iNumberOfW;
}

stockphoto.alertBox.confirmationBoxTypeToAlertDisplayKey = function(type)
{
	var key = undefined;

	switch(type)
	{
	case 0:
		key = "MessageAfterAddingImageToCart";
		break;
	case 1:
		key = "MessageAfterDownloadComp";
		break;
	case 5:
		key = "MessageIfImageAlreadyInCart";
		break;
	}

	return key;
}

////////////////////////////////////////////////////////////////
// Download Alert Box
// 		Types of download alert boxes (sent from st15):
//			0 = OnBridgeLaunch
//			1 = OnBridgeQuit
//			2 = DownloadInBackground

stockphoto.alertBox.downloadAlertBox = function(alertType, messageStr)
{
	var st16_DownloadAlertBoxResult = 2;	// default to cancel button
	var st16_AlertBoxType = alertType;

	switch (alertType)
	{
	case 0:
		{
			if (!stockphoto.core.ui.getAlertDisplayPrefs("ResumeDownloadsWhenBridgeStarts"))
				return 2; // return button 2: "Later"
		}
		break;
	case 1:
		{
			if (!stockphoto.core.ui.getAlertDisplayPrefs("AlertDownloadsOnQuit"))
				return 1; // return button 1: "Yes for quit"
		}
		break;
	case 2:
		{
			if (!stockphoto.core.ui.getAlertDisplayPrefs("MessageDownloadsInBackground"))
				return 1; // return button 1: "Yes for close"
		}
		break;
	}

    var zc = stockphoto.alertBox.zc;

    var buttonOneTitle = "";
    var buttonTwoTitle = "";
    var buttonOneDim = "";
    var buttonTwoDim = "";
    var msg = "";
    var msgOnBridgeLaunch = zc.get("$$$/DownloadAlertBox/Dialog/BridgeLaunchMessage=One or more purchased images have not been downloaded.\nYou can start downloading immediately, or delay downloading until you choose Window > Download Status.");
    var msgOnBridgeQuit = zc.get("$$$/DownloadAlertBox/Dialog/BridgeQuitMessage=One or more purchased images are still being downloaded.\nQuitting from Adobe Bridge will stop the download.\n\nAre you sure you want to quit?");
	var msgDwnldInBkgrnd = messageStr;

	// only windows dialogs have a title
	var alertDialogTitle;
    if (File.fs == "Windows")
    	alertDialogTitle = zc.get("$$$/AlertBox/Dialog/Title=Adobe Stock Photos");
    else
    	alertDialogTitle = "";
    
    if (alertType == 0)
    {
		buttonOneTitle = zc.get("$$$/DownloadAlertBox/Dialog/NowButton=Download Now");
		buttonTwoTitle = zc.get("$$$/DownloadAlertBox/Dialog/LaterButton=Download Later");
		msg = msgOnBridgeLaunch;
		if (File.fs == "Windows")
		{
			buttonOneDim = stockphoto.alertBox.standardCntTab.DOWNLOAD_ALERT_LARGE_OK_BUTTON_WIN;
			buttonTwoDim = stockphoto.alertBox.standardCntTab.DOWNLOAD_ALERT_LARGE_CANCEL_BUTTON_WIN;
		}
		else
		{
			buttonOneDim = stockphoto.alertBox.standardCntTab.DOWNLOAD_ALERT_LARGE_OK_BUTTON_MAC;
			buttonTwoDim = stockphoto.alertBox.standardCntTab.DOWNLOAD_ALERT_LARGE_CANCEL_BUTTON_MAC;
		}
	}
    else if (alertType == 1)
    {
		buttonOneTitle = zc.get("$$$/DownloadAlertBox/Dialog/YesButton=Yes");
		buttonTwoTitle = zc.get("$$$/DownloadAlertBox/Dialog/NoButton=No");
		msg = msgOnBridgeQuit;
		if (File.fs == "Windows")
		{
			buttonOneDim = stockphoto.alertBox.standardCntTab.DOWNLOAD_ALERT_OK_BUTTON_WIN;
			buttonTwoDim = stockphoto.alertBox.standardCntTab.DOWNLOAD_ALERT_CANCEL_BUTTON_WIN;
		}
		else
		{
			buttonOneDim = stockphoto.alertBox.standardCntTab.DOWNLOAD_ALERT_OK_BUTTON_MAC;
			buttonTwoDim = stockphoto.alertBox.standardCntTab.DOWNLOAD_ALERT_CANCEL_BUTTON_MAC;
		}
	}
    else if (alertType == 2)
    {
		buttonOneTitle = zc.get("$$$/DownloadAlertBox/Dialog/OkButton=OK");
		buttonTwoTitle = "";
		msg = msgDwnldInBkgrnd;
		if (File.fs == "Windows")
		{
			buttonOneDim = stockphoto.alertBox.standardCntTab.DOWNLOAD_ALERT_OK_BUTTON_SINGLE_WIN;
		}
		else
		{
			buttonOneDim = stockphoto.alertBox.standardCntTab.DOWNLOAD_ALERT_OK_BUTTON_SINGLE_MAC;
		}
	}
    
	// first button handler
	function st16_DownloadAlertBox_BtnOneClicked()
	{
		this.parent.close();
		st16_DownloadAlertBoxResult = 1;

		var key = stockphoto.alertBox.alertBoxTypeToAlertDisplayKey(st16_AlertBoxType);
		if (key != undefined)
			stockphoto.core.ui.setAlertDisplayPrefs(key, this.parent.donotShowAgainCheckbox.value ? false : true);

		app.scheduleTask( "stockphoto.core.util.bringParentToFront("+(this.parent.doc_id)+");", 200, false );
	}

	// second button handler
	function st16_DownloadAlertBox_BtnTwoClicked()
	{
		this.parent.close();
		st16_DownloadAlertBoxResult = 2;

		var key = stockphoto.alertBox.alertBoxTypeToAlertDisplayKey(st16_AlertBoxType);
		if (key != undefined)
			stockphoto.core.ui.setAlertDisplayPrefs(key, this.parent.donotShowAgainCheckbox.value ? false : true);
		app.scheduleTask( "stockphoto.core.util.bringParentToFront("+(this.parent.doc_id)+");", 200, false );
	}

    // create dialog
    var valeq = "val=";
    var val = valeq + stockphoto.alertBox.standardCntTab.DOWNLOAD_ALERT_BOUNDS;
    eval(val);

    alert_dlg = new Window('dialog', alertDialogTitle, val, {closeButton:false}); 
    
    // add message box
    val = valeq + stockphoto.alertBox.standardCntTab.DOWNLOAD_ALERT_STATICTEXT;
    eval(val);
    alert_dlg.add( 'statictext', val, msg, { name:'alertMessageStatic', multiline:true } );
    
    // add icon
    if (File.fs == "Windows")
    	val = valeq + stockphoto.alertBox.standardCntTab.DOWNLOAD_ALERT_ICON_BOUNDS_WIN;
    else
    	val = valeq + stockphoto.alertBox.standardCntTab.DOWNLOAD_ALERT_ICON_BOUNDS_MAC;
    eval(val);

	var type = 0;	// always use a note icon
	var iconPath = stockphoto.alertBox.makeAlertIconPath(type, false);
	if (iconPath != "")
	{
		alert_dlg.add('image', val, iconPath);
	}
    
    // add ok button
    val = valeq + buttonOneDim;
    eval(val);

    alert_dlg.okBtn = alert_dlg.add( 'button', val, buttonOneTitle, { alignment:['center','top'] } );
    alert_dlg.defaultElement = alert_dlg.okBtn;
    alert_dlg.okBtn.onClick = st16_DownloadAlertBox_BtnOneClicked;
	
	// only display second button if it has a title
	if (buttonTwoTitle.length > 0)
	{
    	// add cancel button
    	val = valeq + buttonTwoDim;
    	eval(val);
    	alert_dlg.cancelBtn = alert_dlg.add( 'button', val, buttonTwoTitle, { alignment:['center','top'] } );
    	alert_dlg.cancelElement = alert_dlg.cancelBtn;
		alert_dlg.cancelBtn.onClick = st16_DownloadAlertBox_BtnTwoClicked;
	}
	
	val = valeq + stockphoto.alertBox.standardCntTab.DOWNLOAD_ALERT_CHECKBOX;
	eval(val);
	var checkboxTitle = zc.get("$$$/DownloadAlertBox/Dialog/DontShowAgain=Don't Show Again");

	alert_dlg.donotShowAgainCheckbox = alert_dlg.add( 'checkbox', val, checkboxTitle);
	alert_dlg.donotShowAgainCheckbox.value = false;

    // display the dialog
    alert_dlg.center();
    alert_dlg.show();
    
    return st16_DownloadAlertBoxResult;
}

stockphoto.alertBox.alertBoxTypeToAlertDisplayKey = function(type)
{
	var key = undefined;

	switch (type)
	{
	case 0:
		key = "ResumeDownloadsWhenBridgeStarts";
		break;
	case 1:
		key = "AlertDownloadsOnQuit";
		break;
	case 2:
		key = "MessageDownloadsInBackground";
		break;
	}

	return key;
}

////////////////////////////////////////////////////////////////
// Alert Dialog
// 
//	errorCode:		number that maps to string to display in alert box
//	iconType:		number indicating which icon to display (0: note, 1: caution, 2: stop)
//	buttonType:		number indicating which buttons to display (0: [OK], 1: [OK, Cancel],
//							2: [Yes, No], 3: [OK, Contact Customer Service])
//	messageString:	string to display in alert box (overrides errorCode parameter)
//					note: if errorCode field is used, the iconType field is ignored
//						and the icon value associated with errorCode is used.
//
stockphoto.alertBox.alertDialog = function(errorCode, iconType, buttonType, messageString)
{
	var alert_dlg;
	var st16_AlertDialogResult = 2;	// default to cancel button
	
	function st16_AlertDialog_BtnOneClicked()
	{
		alert_dlg.close();
		st16_AlertDialogResult = 1;
		app.scheduleTask( "stockphoto.core.util.bringParentToFront("+(alert_dlg.doc_id)+");", 200, false );
	}

	function st16_AlertDialog_BtnTwoClicked()
	{
		alert_dlg.close();
		st16_AlertDialogResult = 2;
		app.scheduleTask( "stockphoto.core.util.bringParentToFront("+(alert_dlg.doc_id)+");", 200, false );
	}

    var zc = stockphoto.alertBox.zc;

	// only use the errorcode if the messageString is undefined
	var msg;
	if (messageString != undefined)
	{
		msg = messageString;
	}
	else
	{
		// get the correct message.  and log error.
		var errAlertObj = new Object();
	
		//init to default values.	
		errAlertObj.message = zc.get("$$$/AlertBox/Dialog/ErrorMessage/AnUnknownErrorOccurred=An unknown error occurred.") + 
					zc.get("$$$/AlertBox/GetErrorCodeMessage/ErrorCode=Error code: ") + errorCode;
		errAlertObj.showUserMsg = false;
		errAlertObj.showErrCode = false;
		errAlertObj.icon = 1;	// warning icon
		errAlertObj.logMsg = errAlertObj.message;
		
		if (errorCode != undefined)
		   errAlertObj = stockphoto.alertBox.getErrorCodeMessage(errorCode, errAlertObj);
		
		if (errAlertObj.showUserMsg == false)
			return;
		
		msg = zc.get(errAlertObj.message);
		iconType = errAlertObj.icon;
	}
	
	// only windows dialogs have a title
	var alertDialogTitle;
    if (File.fs == "Windows")
    	alertDialogTitle = zc.get("$$$/AlertBox/Dialog/Title=Adobe Stock Photos");
    else
    	alertDialogTitle = "";
    
    var buttonOneTitle = "";
    var buttonTwoTitle = "";
	
    if (buttonType == 0)
    {
		buttonOneTitle = zc.get("$$$/AlertDialog/Dialog/OKButton=OK");
		buttonTwoTitle = "";
    }
    else if (buttonType == 1)
    {
		buttonOneTitle = zc.get("$$$/AlertDialog/Dialog/OKButton=OK");
		buttonTwoTitle = zc.get("$$$/AlertDialog/Dialog/CancelButton=Cancel");
    }
    else if (buttonType == 2)
    {
		buttonOneTitle = zc.get("$$$/AlertDialog/Dialog/YesButton=Yes");
		buttonTwoTitle = zc.get("$$$/AlertDialog/Dialog/NoButton=No");
    }
    else if (buttonType == 3)
    {
		buttonOneTitle = zc.get("$$$/AlertDialog/Dialog/OKButton=OK");
		buttonTwoTitle = zc.get("$$$/AlertDialog/Dialog/CustomerServiceButton=Contact Customer Service");
    }
   
	var doubleUp = (File.fs == "Windows");
	var iconPath = stockphoto.alertBox.makeAlertIconPath(iconType, doubleUp);
 
	// create dialog
	var res = "group { margins:0, alignment:'fill', orientation:'column', alignChildren:'center', ";
	res += "TopGroup: Group {alignment:'left', orientation:'row', alignChildren:'left', ";
	if (iconPath != "")
	{
		res += " AlertIcon: Image { ";
		res += "icon:'";
		res += iconPath;
		res += "' },"
	}
	res += " MessageBox: StaticText { preferredSize: ";
	res += stockphoto.alertBox.standardCntTab.ALERT_DIALOG_SIZE;
	res += ", properties: {multiline:true}, text:''}}, ButtonGroup: Group {alignment:'";
    if (File.fs == "Windows")
		res += "center";
	else
		res += "right";
	res += "', orientation:'row', alignChildren:'";
    if (File.fs == "Windows")
		res += "center";
	else
		res += "right";
	res += "', ";
    
    // add cancel button
	if (buttonTwoTitle.length > 0)
	{
		res += "CancelBtn: Button { preferredSize: ";
		if (buttonType == 3)
			res += stockphoto.alertBox.standardCntTab.ALERT_DIALOG_CANCEL_BUTTON_LARGE;
		else
			res += stockphoto.alertBox.standardCntTab.ALERT_DIALOG_CANCEL_BUTTON_SMALL;
		res += ", text:'";
		res += buttonTwoTitle;
		res += "' }, ";
	}
	res += "OkBtn: Button { preferredSize: ";
	res += stockphoto.alertBox.standardCntTab.ALERT_DIALOG_OK_BUTTON;
	res += ", text:'";
	res += buttonOneTitle;
	res += "' }}}";
	
	//app.console("res: " + res + "\n");
	
	// create window
	alert_dlg = new Window('dialog', alertDialogTitle, undefined, {closeButton:false}); 
	alert_dlg.MainPanel = alert_dlg.add(res);
	alert_dlg.MainPanel.TopGroup.MessageBox.text = msg;
	
	if (buttonTwoTitle.length > 0)
	{
		alert_dlg.cancelElement = alert_dlg.MainPanel.ButtonGroup.CancelBtn;
		alert_dlg.MainPanel.ButtonGroup.CancelBtn.onClick = st16_AlertDialog_BtnTwoClicked;
	}

    alert_dlg.defaultElement = alert_dlg.MainPanel.ButtonGroup.OkBtn;
    alert_dlg.MainPanel.ButtonGroup.OkBtn.onClick = st16_AlertDialog_BtnOneClicked;
	
    // display the dialog
    alert_dlg.center();
    alert_dlg.show();
    
    return st16_AlertDialogResult;
}

////////////////////////////////////////////////////////////////
// General Alert Box: single OK button and message
//
// messageString: string to display in alert box
// iconType: number indicating which icon to display (0: note, 1: caution, 2: stop)
//
stockphoto.alertBox.generalAlertBox = function(messageString, iconType)
{
	var errorCode = 0;	// not used since messageString is defined
	var buttonType = 0;	// OK button only
	var result = stockphoto.alertBox.alertDialog(errorCode, iconType, buttonType, messageString);
}

stockphoto.alertBox.readerMissingAlert = function()
{
	stockphoto.DL.generalAlertBox(stockphoto.search.zc.get("$$$/Search/ErrorMessage/ReaderMissing=You do no have Adobe Reader or Acrobat installed on your computer. To view Adobe Stock Photos Help, please download and install the free Adobe Reader for Windows from www.adobe.com."), 1);
}

stockphoto.alertBox.getFooterURLParams = function()
{
	var countryCode = stockphoto.prefs.default_countryCode;
	var languageCode = stockphoto.prefs.default_languageCode;
	var currLocale = stockphoto.core.getValidLocale(true);
	if (currLocale.length == 5)
	{
		languageCode = currLocale.substr(0,2);
		countryCode = currLocale.substr(3,2);
	}
	var urlParams = '?language=' + languageCode.toLowerCase() + '&country=' + countryCode.toLowerCase();
	return urlParams
}

stockphoto.alertBox.footerThumbnail = function(title, url)
{
	var t = new Thumbnail("stockphoto://scFooter");
	t.name = title;
	t.displayMode = "web";
	t.displayPath = unescape(url);
	a = stockphoto.core.html.setUrlFilter( app.document );
	if( a ) 
	{ // do it once more
		stockphoto.core.html.setUrlFilter( app.document );
	}
	app.document.thumbnail = t;	
}	

stockphoto.alertBox.gotoCustomerServiceURL = function()
{
	var onCompleteObj = {};
	onCompleteObj.urlReceived = function(urlString)
	{
		if (urlString != undefined)
		{
			var urlParams = stockphoto.alertBox.getFooterURLParams();
			urlString += urlParams;
		}
		else
		{
			urlString = "http://www.adobe.com";
		}
		var customerServiceStr = zc.get("$$$/AlertBox/customerService=Customer Service");
		stockphoto.alertBox.footerThumbnail(customerServiceStr, urlString);
	}
	
	stockphoto.DL.demandJsxLoading( stockphoto.DL.jsx_MiscDlgs );
	var doc = app.document;
	var request = 
	{
		group: "EComPartners",	
		xmlPath: "",
		keyword: "CustomerServiceURL",
		iteration: 1,
		eventHandler: stockphoto.MiscDlgs.getPartnersXMLItem_EventHandler,
		onComplete: onCompleteObj
	};
	
	stockphoto.MiscDlgs.getPartnersXMLItem(onCompleteObj, request, doc);
}

if( ( stockphoto.timeKeeperOn != undefined )&&( stockphoto.timeKeeperOn ) )
{
	stockphoto.core.util.edTime( stockphoto.DL.jsx_AlertBox );
}

