//-----------------------------------------------------------------------------------------------------
// Formally declare the DIConstants namespace object.
//-----------------------------------------------------------------------------------------------------
if (typeof ZeekConstants != "object") {
	DIConstants = new Object(); 
}

//----------------------------------------------------------------------------------------------------------------------------------------
// GLOBAL CONSTANTS SECTION
//	The literal constants here are for general use, but by being within a namespace object - they do not 
//	polute the default namespace.  
//----------------------------------------------------------------------------------------------------------------------------------------
DIConstants.setConstants = function() {
	DIConstants.baseHref = "domestic-innovations.com/";	//Used to find page-relative navigation.  See doPageNav() function for usage.
	DIConstants.pageUnderConstructMsg = "Check back soon for this page to be finished.  Thank you for your patience and for visiting Domestic Innovations!";	
	
	//------- MENUS SECTION -----------------------------------------------------------------------------------------------------
	DIConstants.lNavItemBGColor = "#fff";			//Normal non-hovered state bg color of left nav menu items
	DIConstants.lNavItemBGColorHover = "#fda";	//Hovered state bg color of left nav menu items
	DIConstants.lNavItemFontColor = "#000";		//Normal non-hovered state font color of left nav menu items
	DIConstants.lNavItemFontColorHover = "#000";	//Hovered state font color of left nav menu items
	
	DIConstants.miniNavItemBGColor = "#222";			//Normal non-hovered state bg color of top/mini nav menu items
	DIConstants.miniNavItemBGColorHover = "#666";		//Hovered state bg color of top/mini nav menu items
	DIConstants.minNavItemFontColor = "#ddd";			//Normal non-hovered state font color of top/mini nav menu items
	DIConstants.miniNavItemFontColorHover = "#fff";	//Hovered state font color of top/mini nav menu items
	
	
	//------- LINKS/PATHS SECTION ---------------------------------------------------------------------------------------------
	DIConstants.CastleZeekURL = "http://www.castlezeek.com";
	DIConstants.outlineIconDir = "_j/outline";	//NOTE: Dir Path from perspective of top level.  Individual usage may need to relativize path.
	
	//------- GENERAL CONFIG SECTION ------------------------------------------------------------------------------------------
	DIConstants.busPhone = "512-321-4997";
	DIConstants.yrsInBiz = "10";
	DIConstants.email = "airose722@aol.com";
	
	//------- SERVICE COVERAGE AND IMG SEPARATOR  -----------------------------------------------------------------------------
	DIConstants.coverageAreaSeparator = "coverAreaDot.png";
	DIConstants.coverageAreas = "Bastrop,DelValle,Cedar Creek,Elgin,Smithville, South/East Austin";
};




//----------------------------------------------------------------------------------------------------------------------------------------
// This function allows swapping ID value tags in the DOM with the resolved constant value provided by this JS inclusion.
// The following is how this works:
//	
//		1) 	You have N tags on a page with an ID name indicating the special syntax that invokes CONSTANT substitition:
//				<span id="__{CONST-NAME}__" class="CONST"/>
//		2) 	From example span tag above, it is a self-enclosed span with the double-underscore pre/post around the name of the CONSTANT 
//		   	defined by this JS inclusion --AND-- the class designation marker of "CONST".  Therefore, to refine the example - consider 
//         	there is a business phone number constant called: DIConstants.busPhone
//		   	Therefore, in the DOM you might expect to see a swap designation span element as follows:
//				<span id="__busPhone__" class="CONST"/>
//			In this example, the class setting of "CONST" indicates that there should be a constant substitution, whereas the ID constains
//			the specially-named ID indicating which specific constant setting should be used - and observing the double-underscore pre/post.  
//		3)	This function should be invoked ONCE after body onload, in the typical "initJS" function once the page has loaded.  Then call
//			this function ONCE to sweep through the DOM, collect all the class elements of "CONST" and perform the specific constant value
//			substitutions indicated by the ID values.
//		4)  This current version of the swapCONSTS function currently only operates on span tags.
//----------------------------------------------------------------------------------------------------------------------------------------
DIConstants.swapCONSTS = function() {

	//Gather up all span elements in page having a CLASS set to "CONSTS" ---------------
	var CONSTS_List = $$('span.CONST');

	var curSpanID = null;
	var curElemRef = null;
	var curConstValue = null;
	for (var n=0;n<CONSTS_List.length;n++) {
		curElemRef = CONSTS_List[n];
		curSpanID = curElemRef.id;
		if (curSpanID.indexOf("__")<0) { continue; } 	//If no double-underscores then its not a CONST designated span element
		var totLen = curSpanID.length;
		if (totLen<4) { continue; }			//if total length less than two sets of double-underscores, can not be a CONST span element
		curSpanID = curSpanID.substring(2,(totLen-2));
		curConstValue = DIConstants[curSpanID];
		if (curConstValue===null || ""===curConstValue) { continue; }
		
		curElemRef.innerHTML = curConstValue;
	}
};
