
(function($) {
window.di = window.di || {};
var di = window.di;
di.constants = function() {
  var ctxPath = "";
  return {params: {imgType: "t",
                   imgWidth: "w",
                   imgHeight: "h",
                   imgFill: "fill",
                   imgTrim: "trim",
                   imgGuid: "guid",
                   page: "page",
                   filename: "file",
                   id: "id",
                   collectionId: "cid"},
          url: {/* Global Actions */
                login: ctxPath+"/login.action",
                logout: ctxPath+"/logout.action",
                toggleBandwidth: ctxPath+"/toggleBandwidth.action",
                toggleAjaxAlert: ctxPath+"/toggleUpdateAlerts.action",
                imgRetrieve: ctxPath+"/imageRetrieve.action",
                zipRetrieve: "/zipRetrieve.action",
                imgDownload: ctxPath+"/imageDownload.action",
                acceptTerms: ctxPath+"/acceptTerms.action",
                connectionStatus: ctxPath+"/connectionStatus.action",
                /* Special Page Actions */
                featuredContent: ctxPath+"/featuredContent.action",
                landingThumbnails: ctxPath+"/landing.action",
                emailContent: ctxPath+"/emailContent_input.action",
                shareContent: ctxPath+"/emailContent_input.action",
                /* Find Imagery Actions */
                assetDetails: ctxPath+"/assetDetails.action",
                productDetails: ctxPath+"/products/davisditis.html",
                productSearch: "/runProductSearch.action",
                imagerySearch: "/runDamSearch.action",
                siteSearch: "/runContentSearch.action",
                motionSearch: "/runMotionSearch.action",
                postSearchCriteria: "/postSearch.action",
                getCollections: ctxPath+"/showLightboxes.action",
                collectionContents: ctxPath+"/showLightboxContents.action",
                getPopularSearches: ctxPath+"/getPreDefinedSearches.action",
                getUserSearches: ctxPath+"/getUserSearches.action",
                saveUserSearch: ctxPath+"/saveUserSearch.action",
                deleteUserSearch: ctxPath+"/deleteUserSearch.action",
                getAssetDetails: ctxPath+"/getAssetDetails.action",
                getMotionDetails: ctxPath+"/getMotionDetails.action",
                getAvProductDetails: ctxPath+"/getDavisDetails.action",
                getImiProductDetails: ctxPath+"/getDitisDetails.action",
                /* Shopping Cart Actions */
                fetchOrderInfo: "/fetchOrderInfo.action",
                getAdHocCartItem: "/searchShoppingCartItem.action",
                updateShoppingCartItem: "/updateShoppingCartItem.action",
                removeShoppingCartItem: "/removeShoppingCartItem.action",
                removeAllCartItems: "/removeAllCartItems.action",
                removeAllImageItems: "/removeAllImageItems.action",
                updateCustomerInfo: "/updateCustomerInfo.action",
                submitOrder: "/orderSubmit.action",
                mergeCarts: "/mergeOrderInfos.action"},
          request: {contextPath: ctxPath,
          			pageUpdateAlertsEnabled: false,
          			isLowBandwidth: false,
          			userIsDamsUser: false,
          			isDamsUser: false},
          cmsHandle: {findImagery: "/imagery",
          			  facilities: "/community/facilities"},
          imgTypes: {thumbnail: 0,
          			 preview: 1,
          			 full: 2},
          collectionTypes: {current: 1,
          					archive: 2,
          					all: 3},
          releaseStatus: {values: {released: "Released",
          						   unreleased: "Not Released",
          						   sbu: "Sensitive But Unclassified"},
          				  labels: {released: "Cleared for Public Release",
          						   unreleased: "Not Cleared for Public Release",
          						   sbu: "Sensitive but Unclassified",
          						   unknown: "Unknown Release Status"}},
          pages: {} /* Placeholder for page-specific constants */
  };
}();

di.constants.search = function() {
  return {defaultQuickFormStates: {searchTerms: "", /* Search terms */
  								   checks: parseInt("1101100111111111100", 2).toString(16), /* Checkbox values (hex) - 7cffc */
  							  	   checksWithoutResultTypes: parseInt("1101100111111000000", 2).toString(16), /* 7cfc0 */
  								   radios: parseInt("010", 2).toString(16), /* Radio button values (hex) - 2 */
  								   checksStillVirinOnly: parseInt("1000000111111100000", 2).toString(16), /* 40fe0 */
  								   radiosStillVirinOnly: parseInt("000", 2).toString(16) /* 0 */},
	  	  imageDimensions: {thumbnail: {width: 160, height: 90},
  							previewSmall: {width: 280, height: 280},
  							previewLarge: {width: 538, height: 538}},
  		  avStatus: {current: "CURRENT",
  		  			 nonCurrent: "NONCURRENT",
  		  			 historical: "HISTORICAL"},
  		  summary: {enabled: true,
  		  			option: true}
  };
}();

di.constants.featuredContent = function() {
  return {imageDimensions: {thumbnail: {home: {width: 71, height: 65}, landing: {height: 77}},
  							preview: {width: 550, height: 350}},
  		  preloadPreviews: false,
  		  squareLandingThumbs: true
  };
}();

di.constants.shoppingCart = function() {
  return {enabled: true,
  		  itemTypes: {still: "1",
  					  collection: "2",
  					  av: "3",
  					  imi: "4",
  					  motion: "5",
  					  research: "6"},
  		  allowMotionSubject: false,
  		  mergeTypes: {session: 2,
  		  			   account: 3,
  		  			   both: 1},
  		  imageDimensions: {miniThumbnail: {width: 50, height: 50},
  		  					thumbnail: {width: 160, height: 90}},
  		  downloadMediumName: "Download"
  };
}();

di.constants.facilities = function() {
  return {url: {editFacility: "/updateFacility.action",
  				deleteFacility: "/deleteFacility.action",
  				showFacility: "/showFacility.action",
  				searchFacility: "/searchFacility.action",
  				activateFacility: "/activateFacility.action",
  				login: "/facilityLogin.action",
  				logout: "/facilityLogout.action"},
  		  loginTypes: {guest: 0,
  		  			   facility: 1,
  		  			   monitor: 2},
  		  searchTypes: {zip: 0,
  		  				details: 1,
  		  				dvian: 2,
  		  				monitored: 3,
  		  				approval: 4},
  		  fieldLimits: {remarks: 400,
  		  				equipDesc: 500},
  		  status: {inactive: "1",
  		  		   active: "2"}
  };
}();

di.constants.status = {
	tests: {service: 1,
			artesiaApi: 4,
			vifpDb: 5,
			prodSearch: 60,
			prodAvDetails: 61,
			prodImiDetails: 62,
			dvicSearch: 70,
			dvicDetails: 71}
};
})(window.jQuery);

