// Do not push this to PROD! Even if it's accidently pushed to prod, it's keyed to Dev & Staging only.
// The prod email address will never be changed. This script auto-detects the server's URL.
$(document).ready(function() {
	/****** BEGIN CONFIG ******/
	var strDevEmail = 'brian.kueck@experian.com';
	var strQAEmail = 'bharat.suryadevara@experian.com';
	var strMgmtEmail = 'jen.wieth@experian.com';
	var strId = '#inputRecipientEmail';
	var strUrl = window.location + ''; // Casts the object to a string, which allows the .indexOf() function to work.
	var isLocalhost = ((strUrl.indexOf('localhost') > -1) || (strUrl.indexOf('127.0.0.1') > -1)) ? true : false;
	var isDev = (strUrl.indexOf('wcmprod1') > -1) ? true : false;
	var isStg = (strUrl.indexOf('stg1') > -1) ? true : false;
	/****** END CONFIG ******/

	if (isStg) {
		strEmail = strDevEmail + ';' + strQAEmail + ';' + strMgmtEmail; // QA and/or MGMT Emails for QA checking in Staging Only.
	} else {
		strEmail = strDevEmail;
	}

	var objEmail = $(strId); // <input id="inputRecipientEmail" type="hidden" name="recipient" value="...">
	if ((objEmail) && (isLocalhost || isDev || isStg)) {
		// Changes Dev & Staging, but leaves Prod alone.
		$(strId).attr('value',strEmail);
	}
});
