/**********************************************************************************************************************
* FILE:		PDconfigs.js
* AUTHOR:	Geoff Boeing, Witek Ciemiega, Mike Rais, Shimon Schwartz, Javier Albinarrate
* VERSION:	1.27
* PURPOSE:	Returns an object that contains all configuration settings
* HISTORY:	05/20/2008 - GB - created file
*			05/22/2008 - GB - updated objects and containing config values
*			06/02/2008 - GB - added configs for Survey div, select inputs, and text input boxes
*			07/24/2008 - GB - updated general configs for API settings
*			08/29/2008 - GB - removed style configs and placed them in external CSS file
*			09/29/2008 - GB - rebuild configs file and create config groups - general, connections, errors, style
*			03/30/2009 - JA - added options for RandomPages & DebugConsole
*			04/21/2009 - JA - added OffersPreselected
***********************************************************************************************************************/

	/***************************************************************************************************************
	* Function:	getConfigs
	* Purpose:	Returns an object that contains all configuration settings for the application
	* Argument:	None
	****************************************************************************************************************/	
	function PD_getConfigs(){
		// do not delete any of these configs, just change their settings instead!
		var objConfigs = {};
		objConfigs.general    = {};
		objConfigs.connection = {};
		objConfigs.errors     = {};
		objConfigs.style      = {};
		
		//objConfigs.general contains general application configuration settings
		objConfigs.general.NumberOfOffersToDisplay    = 5;    // Number of offers on each page
		objConfigs.general.NumberOfPagesToDisplay     = 99;    // Total number of pages
		objConfigs.general.RandomPages                = 0;     // The first N pages must have offers selected randomly
		objConfigs.general.NumberOfRandomToChooseFrom = 0;    // The randomly selected offers will be selected from the first N offers in the list
		objConfigs.general.OffersPreselected          = false; // Offer(s) must be preselected

		objConfigs.general.DisplayOfferImages      = true; // display coreg images if true
		objConfigs.general.SuccessCallbackFunction = null; // specify a callback function on successful termination
		objConfigs.general.TestMode                = false; // establishes a session in test mode if true
		
		//objConfigs.connection contains API connection and publisher authentication settings
		objConfigs.connection.WebServiceURL = "http://www.pdapi.com/cs/JSON/v1/"; //the url of the JSON API
		objConfigs.connection.Login   = "sysWD1";     // Publisher's login
		objConfigs.connection.Pin     = "PkfeHJty6Njh";   // Publisher's pin
		objConfigs.connection.PubCode = "WD1";        // Publisher's pub code
		objConfigs.connection.RandomizePubKey = true; // If true, appends a random number to create a unique and random pub key each time
		objConfigs.connection.RandomizeEmail  = false; // If true, appends a random number to create a unique (and fake) email each time
		
		//objConfigs.errors contains error and debug settings
		objConfigs.errors.DebugMode      = 0;     // Testing purposes: 0 = off; 1,2,3 = low,med,high
		objConfigs.errors.DebugArea      = false; // String id or element object of the textarea to route debug information
		objConfigs.errors.DebugFunction  = false; // A Custom debug function to handle the information (DebugArea must be disabled)
		objConfigs.errors.DebugOpen      = false; // Upon JSI init, it gets automatically opened
		objConfigs.errors.DebugHaltCustomErrors   = true;  // Upon an error in a JS custom function (DAQ), consider it as failure
		objConfigs.errors.MaxRequestTime          = 10000; // Max time in milliseconds that jsonp requests can wait for an API response before jsi termination
		objConfigs.errors.TerminateSuccessMessage = "Thanks for participating in these offers!"; //js alert message on successful termination - leave blank to display nothing
		objConfigs.errors.HeadlineMessageRCV      = "Please complete the information below to receive this offer"; //message at top of RCV area
		objConfigs.errors.ValidationErrorMessage  = "Please correct the required fields in red and try again"; //error message at top of RCV area
		
		//objConfigs.style contains stylesheet URL and some display configurations that can't be handled by CSS
		objConfigs.style.StylesheetURL = "http://www.pdapi.com/cs/JSI/v1/default/styles/PDstyle-standard.css"; // URL of stylesheet
		objConfigs.style.SurveyTextAreaCols = 20;       // Number of columns in textarea elements
		objConfigs.style.SurveyTextAreaRows = 5;        // Number of rows in textarea elements
		objConfigs.style.SurveySelectMultipleSize = 5;  // Number of rows in select multiple elements
		objConfigs.style.SlowAnimationTime  = 1000;     // Time in milliseconds for the slow display animation to occur
		objConfigs.style.FastAnimationTime  = 500;      // Time in milliseconds for the fast display animation to occur
		objConfigs.style.TwoColumnSurvey    = false;    // Display survey as 2 columns if true - requires an appropriate stylesheet
		objConfigs.style.TwoColumnRCV       = false;    // Display RCV as 2 columns if true - requires an appropriate stylesheet
		
		//return the configs object to the caller
		return objConfigs;
	}
