/* this is where you set configurable values for your particular Ginsu installation;
 * include this in your HTML page; it loads the rest of the Ginsu scripts;
 * also loads Prototype (as needed)
 * 
 * NOTE: different customizations are loaded based on markers in the URL for dev/test/etc. servers
*/
 		var BetterRecipesAbsolutePath;
		var ginsuMain = {

		SHOW_DEBUGGING: false,
		RETRY_INTERVAL: 1000,
		MAX_RETRIES: 24,
		USER_ID_VAR_NAME: "plckUserId",
			
		BASEPATH: (BetterRecipesAbsolutePath != null) ? BetterRecipesAbsolutePath + "/web/betterrecipes/js/ginsu/" : "/web/betterrecipes/js/ginsu/",
		CONFIG_PATH: "../../css/",
			
			/*misc.*/
			ANON_USER_ID: "anonymous",
			ANON_USER_DISPLAY_NAME: "Guest",
			ANON_USER_ID: "anonymous",
			PHOTO_SIZE_SUFFIX: ".Medium",
			
/*URLs specific to this installation*/
			COMMUNITY_SERVER_PREFIX: "recipes.",
			COMMUNITY_SERVER_SUFFIX: "/betterrecipes/persona.jsp?",
			LOGIN_URL:    "https://secure.recipes." + document.domain + "/common/profile/login1.jsp?regSource=8273",
			REGISTER_URL: "https://secure.recipes." + document.domain + "/common/profile/regStep1.jsp?regSource=8273",
			REDIRECT_VAR_NAME: "returnURL",
			
/*URL parts required by SiteLife & DAAPI */
			SL_HOST_PREFIX: "sitelife", 
			SL_VERSION: "1.0",
			DAAPI_HOST_PREFIX: "sitelife", 
			DAAPI_VERSION: "1.0",
			DAAPI_URL_SCRIPT_SUFFIX: "DirectProxy",
			DAAPI_URL_SERVER_SUFFIX: "Process",
			LOGIN_COOKIE_1: "hd",
			LOGIN_COOKIE_2: "at",
			
/*querystring parts for related to persona tabs*/
			PERSONA_TAB_VAR_NAME: "plckPersonaPage",
			PERSONA_TAB_BLOG: "PersonaBlog",
			PERSONA_TAB_OPTIONS: "PersonaProfile",
			PERSONA_TAB_MESSAGES: "PersonaMessages",
			
			/*not yet implemented*/
			WAIT_IMG_NAME: "wheelOfJoy.gif",
			WAIT_IMG_WIDTH:  32,
			WAIT_IMG_HEIGHT: 32,
			
/*these are used by Ginsu scripts and should not be changed*/
			SL_USER_ID_PAT: "SL_USER_ID",
			
/*methods to compose full URLs (should not be changed)*/
			getDaapiRoot: function() {
				return "http://" + this.DAAPI_HOST_PREFIX + "."
					 + document.domain + "/ver" + this.DAAPI_VERSION + "/Direct/";
			},
			getPersonaURLTemplate: function() {
				return "http://" + this.COMMUNITY_SERVER_PREFIX + document.domain
					+ this.COMMUNITY_SERVER_SUFFIX + "&"
					+ this.USER_ID_VAR_NAME + "=" + this.SL_USER_ID_PAT
					+ "&userId=" + this.SL_USER_ID_PAT;
			},
			getImageRoot: function() {
				return "http://" + this.SL_HOST_PREFIX + "."
					+ document.domain + "/ver" + this.SL_VERSION + "/Content/images/store/";
			},
			
/* ginsuMain version tracked separately from that of ginsu scripts, 
 * to support any future backwards-compatibility.
 */
			VERSION: "0.93"
		}
		

/* Environment Overrides */

		if (location.host.indexOf("local.") > -1 || location.host.indexOf("dev.") > -1) {
/*overrides for the local and development/integration servers (typically the same)*/
	
		ginsuMain.LOGIN_URL = ginsuMain.LOGIN_URL.replace("://", "://dev.");
		ginsuMain.REGISTER_URL = ginsuMain.REGISTER_URL.replace("://", "://dev.");
		ginsuMain.DAAPI_HOST_PREFIX = "sitelifestage";
		ginsuMain.COMMUNITY_SERVER_PREFIX = "dev.recipes.";
		ginsuMain.SHOW_DEBUGGING = true;

		
		} else if (location.host.indexOf("test.") > -1) {
/*overrides for the local test server*/
		ginsuMain.LOGIN_URL    = ginsuMain.LOGIN_URL.replace("://", "://test.");
		ginsuMain.REGISTER_URL = ginsuMain.REGISTER_URL.replace("://", "://test.");
		ginsuMain.DAAPI_HOST_PREFIX = "sitelifestage";
		ginsuMain.COMMUNITY_SERVER_PREFIX = "test.recipes.";
		ginsuMain.SHOW_DEBUGGING = true;
		
				
		} else if (location.host.indexOf("stage.") > -1) {
/*overrides for the local stage server*/
		ginsuMain.LOGIN_URL    = ginsuMain.LOGIN_URL.replace("://", "://stage.");
		ginsuMain.REGISTER_URL = ginsuMain.REGISTER_URL.replace("://", "://stage.");
		ginsuMain.DAAPI_HOST_PREFIX = "sitelifestage";
		ginsuMain.COMMUNITY_SERVER_PREFIX = "stage.my.";
			
		}




/*load the Ginsu system*/
document.write('<scr'+'ipt src="' + ginsuMain.BASEPATH + 'ginsu.js" type="text/javascript" charset="utf-8"></script>');