/**
 * Configuration settings for the photo picker application used by all environments
 */
if (!esg) var esg = {};
if (!esg.photoPicker) esg.photoPicker = {};
if (!esg.photoPicker.model) esg.photoPicker.model = {};
if (!esg.photoPicker.model.config) esg.photoPicker.model.config = {};
if (!esg.photoPicker.model.config.uris) esg.photoPicker.model.config.uris = {};
if (!esg.photoPicker.model.config.uris.upload) esg.photoPicker.model.config.uris.upload = {};

esg.photoPicker.model.config.uris.printConfig = "/gallery/creativeapps/printConfig/printConfig.jsp";
esg.photoPicker.model.config.uris.editFromCart = "/gallery/creativeapps/printConfig/editFromCart.jsp";
esg.photoPicker.model.config.uris.slideshow = "/gallery/creativeapps/slideShow/Main.jsp";
esg.photoPicker.model.config.uris.landingPage = "/gallery/sharing/memberLandingPage.jsp";

var siteSvc = "/site/rest";
var ecomSvc = "/ecomm";
var imgSvc = "/imaging-site";

//**  Server Configuration **
esg.photoPicker.model.config.uris.upload.html = "/site/rest/v1.0/album/{albumId}/upload?upload_source={uploadSourceId}";
esg.photoPicker.model.config.uris.upload.flash = "/site/rest/v1.0/album/{albumId}/upload?upload_source={uploadSourceId}";
esg.photoPicker.model.config.uris.upload.arrangeServiceURL = "/site/rest/v1.0/album/{albumId}/arrange";
esg.photoPicker.model.config.uris.listAlbums = siteSvc + "/v1.0/albumList"
esg.photoPicker.model.config.uris.listFriendsAlbums = siteSvc + "/v1.0/friendsAlbumList"
esg.photoPicker.model.config.uris.playList = siteSvc + "/v1.0/playlist/default";
esg.photoPicker.model.config.uris.getAlbum = siteSvc + "/v1.0/album/{albumId}";
esg.photoPicker.model.config.uris.getPhoto = siteSvc + "/v1.0/picture/{photoId}/pictureMetaDataBasic";
esg.photoPicker.model.config.uris.createAlbum = siteSvc + "/v1.0/album/{albumId}";
esg.photoPicker.model.config.uris.imgSvc = imgSvc + "/services/doc/{partitionId}:{photoId}/jpeg/BG";
esg.photoPicker.model.config.uris.thumbUri = imgSvc + "/services/doc/{partitionId}:{photoId}/jpeg/SM";
esg.photoPicker.model.config.uris.getPartnerAlbums = siteSvc + "/v1.0/partnerAlbum/sourceid/{sourceid}/album/{albumId}";
esg.photoPicker.model.config.uris.slideshowSplashUri = "http://cmscache.ofoto.com/publish/gallery/www/americas/en/us/fullpages/slideshow/splash.-Par-50566-Image1Ref.MC4w.jpg";

if (esg.editControls && esg.editControls.model) {
	esg.editControls.model.config.uris.getAlbum = esg.photoPicker.model.config.uris.getAlbum;
	esg.editControls.model.config.uris.getFriendsAlbum = siteSvc + "/v1.0/friendsAlbum/{albumId}";	
	esg.editControls.model.config.uris.rearrangePhoto = siteSvc + "/v1.0/album/{albumId}/arrange";
	esg.editControls.model.config.uris.albumMeta = siteSvc + "/v1.0/album/{albumId}/metaData";
	esg.editControls.model.config.uris.callPicture = siteSvc + "/v1.0/album/{albumId}/picture/{photoId}";
	esg.editControls.model.config.uris.rotatePicture = siteSvc + "/v1.0/album/{albumId}/picture/{photoId}/edit/rotate/{degrees}";
	esg.editControls.model.config.uris.callPictureCaption = siteSvc + "/v1.0/picture/{photoId}/caption";
	esg.editControls.model.config.uris.getPhotoEditorSWF = "Wilma.swf";
}

if (esg.share && esg.share.model) {
    esg.share.model.config.uris.guestbook = siteSvc + "/v1.0/guestbook";
    esg.share.model.config.uris.comments = siteSvc + "/v1.0/user/comments/ungrouped";	
    esg.share.model.config.uris.comment = siteSvc + "/v1.0/picture/{photoId}/comment/{id}";			
    esg.share.model.config.uris.redeem = siteSvc + "/v1.0/share/redeem/{shareToken}";
    esg.share.model.config.uris.redeemProject = siteSvc + "/v1.0/project/share/redeem/{shareToken}";      
	esg.share.model.config.uris.anonymousRedeem = siteSvc + "/v1.0/share/metadata/{shareToken}"; 
	esg.share.model.config.uris.anonymousAlbumView = siteSvc + "/v1.0/album/anon?asaf={shareToken}";
    esg.share.model.config.uris.serviceContact = siteSvc + "/v1.0/friend/{id}";
    esg.share.model.config.uris.contactList = siteSvc + "/v1.0/friends";
    esg.share.model.config.uris.serviceContactGroup = siteSvc + "/v1.0/friendGroup/{id}";
    esg.share.model.config.uris.updateContactGroup = siteSvc + "/v1.0/friendGroup/{id}/members";
    esg.share.model.config.uris.contactGroupList = siteSvc + "/v1.0/friendGroups";
    esg.share.model.config.uris.addShare = siteSvc + "/v1.0/share/create";
    esg.share.model.config.uris.addProjectShare = siteSvc + "/v1.0/project/{projectid}/share/create";
	esg.share.model.config.uris.getSignInStatus = siteSvc + "/v1.0/pictures/shareSignInStatus";
	esg.share.model.config.uris.legacyShareTranslate = siteSvc + "/v1.0/share/legacy/translate/c/{cVal}/x/{xVal}/y/{yVal}";
    esg.share.model.config.uris.slideShowFacebookRedirect = "/gallery/sharing/shareRedirect.jsp";
	esg.share.model.config.uris.projectFacebookDisplay = "/gallery/sharing/cardFacebookDisplay.jsp";	
	esg.share.model.config.uris.projectFacebookRedirect = "/gallery/sharing/cardsRedirect.jsp";
    esg.share.model.config.uris.shareProjectPhotobooksRedirect = "/gallery/creativeapps/portBooks/portBooks.jsp?projectId={projectId}&preview=true";    		
    esg.share.model.config.uris.shareProjectCalendarsRedirect = "/gallery/creativeapps/calendars/calendars.jsp?projectId={projectId}&preview=true";
    esg.share.model.config.uris.shareProjectSPMRedirect = "/gallery/creativeapps/SPM/SPM.jsp?catId={catId}&productId={productId}&skuId={skuId}&projectId={projectId}&preview=true";
}

if (esg.comments && esg.comments.model) {
	esg.comments.model.config.uris.person = siteSvc + "/v1.0/user/{id}";
	esg.comments.model.config.uris.comments = siteSvc + "/v1.0/picture/{photoId}/comments";
	esg.comments.model.config.uris.createComment = siteSvc + "/v1.0/picture/{photoId}/comment";
	esg.comments.model.config.uris.updateComment = siteSvc + "/v1.0/picture/{photoId}/comment/{commentId}";	
	esg.comments.model.config.uris.deleteComment = siteSvc + "/v1.0/picture/{photoId}/comment/{commentId}";		
}

if (esg.photoPullerMonitor && esg.photoPullerMonitor.model) {
    esg.photoPullerMonitor.model.config.uris.postPartnerDownload = siteSvc + "/v1.0/partnerDownload/sourceid/{sourceId}/start";
    esg.photoPullerMonitor.model.config.uris.finalizePartnerImageUpload = "/gallery/finalizePartnerImageUpload.jsp";
}

if (esg.photoBook && esg.photoBook.model) {
	esg.photoBook.model.config.uris.bookCategories = ecomSvc + "/xml/bookCategories.jsp?categoryId={categoryId}";
	esg.photoBook.model.config.uris.bookCategoryProducts = ecomSvc + "/xml/bookCategoryProducts.jsp?categoryId={categoryId}";
    esg.photoBook.model.config.uris.pageDesignList =  "/gallery/templates/books/pageDesignList.jsp?bookSkuId={skuId}"
}

if (esg.bulkEdit && esg.bulkEdit.model) {
	esg.bulkEdit.model.config.uris.rearrangePhoto = siteSvc + "/v1.0/album/{albumId}/arrange";
	esg.bulkEdit.model.config.uris.updateCaptions = siteSvc + "/v1.0/album/{albumId}/pictures/captions"; 
	esg.bulkEdit.model.config.uris.deletePhotos = siteSvc + "/v1.0/album/{albumId}";
}
