			var strURL							= window.location + "";
			var coremetricsOnFlag = true;

			/***********************************************************/
			/* Disable Coremetrics when not in production environments */
			/***********************************************************/
			if (strURL.indexOf('.govliquidation.com') < 1) coremetricsOnFlag = false;

			var productionServerFlag = true;

			if ( coremetricsOnFlag ) {
				if ( productionServerFlag ) {
					cmSetProduction();
				}

				var strReferrer					= document.referrer + "";
				var pageID							= "";
				var categoryId					= "";
				var searchTerm					= null; //only for search pages, remains null otherwise
				var searchResults				= null; //only for search pages, remains null otherwise

				/********************************************************************/
				/* Extract the column name, column order (asc/desc) and page number */
				/* and return these values as the pageID for event and FSC pages    */
				/********************************************************************/
				function getSpecialPageID(strURLarrayItem) {
					var tmp1 = strURL.indexOf(strURLarrayItem,10);
					var tmp2 = strURL.substr(tmp1+6,5);
					var tmp3 = strURL.substr(tmp1);
					var tmp4 = "";
					var tmp5 = (tmp3.indexOf(".html")>0)?tmp3.substring(16,tmp3.indexOf(".html")):"1";

					if ( tmp3.indexOf("lnd") > 0 ) tmp4 = "lot_number_desc";
					else if ( tmp3.indexOf("loa") > 0 ) tmp4 = "location_asc";
					else if ( tmp3.indexOf("lod") > 0 ) tmp4 = "location_desc";
					else if ( tmp3.indexOf("cta") > 0 ) tmp4 = "close_time_asc";
					else if ( tmp3.indexOf("ctd") > 0 ) tmp4 = "close_time_desc";
					else tmp4 = "lot_number_asc";

					return tmp2+":"+tmp4+":pg"+tmp5; //e####:column_name_ordered:pg#
				}

				/*************************************************************************************************/
				/* Get the categoryId if coming from the watchlist, else extract and return a categoryId if the  */
				/* referrer URL was an event page or an FSC page or another Lot Details page or if available in  */
				/* the window.bidcategoryId object variable (from bid pages). By default return the eventId from */
				/* the window object. The purpose, to differentiate the referrer to the Lot Details page         */
				/* (i.e. Event, FSC, Watchlist, email, newsletter, etc.)                                         */
				/*************************************************************************************************/
				function getCategoryId() {
					var refCategoryId = "";
					if ( strURL.indexOf('categoryId') > 0 ) {
						refCategoryId = strURL.substr(strURL.indexOf('categoryId')+11,5);
					} else if ( strReferrer.indexOf('list/closing') > 0 ) {
						refCategoryId = '1001-03';
					} else if ( strReferrer.indexOf('list/c') > 0 ) {
						refCategoryId = strReferrer.substr(strReferrer.indexOf('list/c')+5,5);
					} else if ( strReferrer.indexOf('list/e') > 0 ) {
						refCategoryId = strReferrer.substr(strReferrer.indexOf('list/e')+5,5);
					} else if ( strReferrer.indexOf('auction/search') > 0 || strReferrer.indexOf('auction/endecaSearch') > 0 ) {
						refCategoryId = '1004';
					} else {
						refCategoryId = ( window.eventId && window.eventId != '' ) ? "e" + window.eventId :
														( window.bidCategoryId && window.bidCategoryId != "" ) ? "c" + window.bidCategoryId : "";
					}
					return refCategoryId;
				}

				if ( window.isErrorPage ) { //If it's an error page throw the error tag
					cmCreateErrorTag(window.errorType + " Error", 1006);
				} else {

					var tmpIndex = 0; //used in feedback pages
					/**********************************************/
					/* Array of the different kinds of URLs/pages */
					/**********************************************/
					var strURLarray = new Array(
						['1000-02','/account/main?tab=Invoice'],
						['1000-03','/account/main?tab=BidHistory'],
						['1000-03','/auction/bidhistory'],
						['1000-04','/account/main?tab=Profile'],
						['1000-01','/account/main'],
						['1001','/list/hotlots/index.html'],
						['1001','/list/e',3],
						['1001','/events?cmd=showAll'],
						['1001-01','/pastbidresults'],
						['1001-02','/salescalendar/'],
						['1001-03','/list/closing/'],
						['1001-04','/login?watchList=add'],
						['1002','/list/c',3],
						['1002-01','/marketplace/'],
						['1003','/about/'],
						['1003','/bidders_corner.html'],
						['1003','/contact/'],
						['1003','/fp.html'],
						['1003','/locations/'],
						['1003','/terms.html'],
						['1003','/new_visitors.html'],
						['1003','/privacy.html'],
						['1003','/rss-feeds.html'],
						['1003-01','/help/'],
						['1003-02','/press/'],
						['1003-03','/feedback',2],
						['1003-04','/partner/'],
						['1003-04','/conditions/'],
						['1003-05','/glossary.html'],
						['1004','/auction/search',1],
						['1004','/auction/endecaSearch',1],
						['1005-01','/joinlist'],
						['1005-02','/login'],
						['1005-03','/register',5],
						[getCategoryId(),'/auction/view?',4],
						[getCategoryId(),'/auction/bid'],
						['1007','/auction/'],
						['1008','/scrap.html',0],
						['1008','/vehicles.html',0],
						['1008','/61-inch-hdtv.html',0],
						['1003','/contests/'],
						['1008','/William-Angrick',0],
						['1008','/',0]
					)

					/**************************************************************/
					/* Check what page is currently displayed by checking its URL */
					/* then set the pageID and categoryId												 */
					/**************************************************************/
					for ( var i = 0; i < strURLarray.length; i++ ) {
						if ( strURL.indexOf(strURLarray[i][1]) > 0 ) {
							// if a page type (3) is of Events or FSC get the event id or category id, else get the category assigned in the CDF
							categoryId = (strURLarray[i][2] == 3)?strURL.substr(strURL.indexOf(strURLarray[i][1],10)+6,5):strURLarray[i][0];
							pageID     = (strURLarray[i][2] == 3)?getSpecialPageID(strURLarray[i][1]):strURL.substr(strURL.indexOf(strURLarray[i][1],10));
							tmpIndex   = i;
							break;
						}
					}

					if ( pageID.lastIndexOf("/") == (pageID.length-1) ) pageID += "index.html"; //detect if an index.html page present

					/**********************************************************************************************/
					/* if it's a page of type 'Main' or the next page after a login attempt do a registration tag */
					/* do the same if it's the registration complete page                                         */
					/**********************************************************************************************/
					if ( ( strURL.indexOf('/login') > 0 && strReferrer.indexOf('/login') > 0 && ( window.aMainPageType || window.aLogin ) ) ||
							 ( strURLarray[tmpIndex][2] == 5 && window.REGISTER_USERNAME ) //it's a registration complete page?
						 ) {
						//cmCreateRegistrationTag(CustomerID,CustomerEmail,CustomerCity,CustomerState,CustomerZip,NewsletterName,SubscribedFlag)
						cmCreateRegistrationTag(((window.LOGIN_USERNAME)?window.LOGIN_USERNAME:window.REGISTER_USERNAME),
																		((window.email)?window.email:null),
																		((window.city)?window.city:null),
																		((window.state)?window.state:null),
																		((window.zip)?window.zip:null),
																		((window.country)?window.country:null)); //pass the available LOGIN or REGISTER username
						categoryId = window.tmpCategoryId;
						pageID     = window.tmpPageID;
					}


					function extractSearchTerms(str) {
						var temp = "";
						if ( str.indexOf("Ntt") > 0 ) { //Endeca search results page
							temp = str.substring(str.indexOf("Ntt")+4,str.indexOf("&",str.indexOf("Ntt")));
						} else if ( str.indexOf("extlist") > 0 ) { //Extended list search results page
							temp = "extlist->" + str.substring(str.indexOf("parent_category")+16,str.indexOf("&",str.indexOf("parent_category")));
						}
						return temp;
					}

					/********************************************************************/
					/* Set the searchResults and searchTerm parameters for Search pages */
					/********************************************************************/
					if ( strURLarray[tmpIndex][2] == 1 && !window.advanced_search ) { //it's a results page
						var temp = pageID;
						searchResults = window.tmpSearchResults + 0;
						searchTerm = extractSearchTerms(temp); //temp.substr(temp.indexOf("?"));
						pageID = "Search Results: " + ( ( searchResults > 0 ) ? "Successful (pg. " + window.searchPage + ")." : "Unsuccessful." );
					}

					/************************************************************/
					/* if it's a feedback confirmation page do registration tag */
					/************************************************************/
					if ( strURLarray[tmpIndex][2] == 2 && window.feedbackConfirm ) {
						//cmCreateRegistrationTag(CustomerID,CustomerEmail,CustomerCity,CustomerState,CustomerZip,NewsletterName,SubscribedFlag)
						cmCreateRegistrationTag("feedback", (window.emailFrom)?window.emailFrom:"unknown", null, null, null, null, null);
					}

					pageID = (pageID.length < 80) ? pageID : pageID.substr(0,80)+"..."; //trim strings longer than 80 characters

					/************************************************************/
					/* If it's a homepage then use the Technical Properties Tag */
					/* If it's a product details page a Product View Tag else a */
					/* Pageview tag should be shown for all other pages         */
					/************************************************************/
					if ( strURLarray[tmpIndex][2] == 0 ) { //is it a landing page?
						cmCreateTechPropsTag(pageID,categoryId);
					} else if ( strURLarray[tmpIndex][2] == 4 ) {	//Is it a Product Details page?
						//cmCreateProductviewTag(ProductID,ProductName,CategoryId)
						cmCreateProductviewTag ( window.eventId + "_" + window.lotNumber, window.auctionTitle.substr(0,80)+"...", categoryId );
					} else {
						cmCreatePageviewTag(pageID,categoryId,searchTerm,searchResults);
					}

				//Debuggin...
/*
					document.writeln("pageID = " + pageID + "<br>"
													 + "categoryId = " + categoryId + "<br>"
													 + "searchTerm = " + searchTerm + "<br>"
													 + "searchResults = " + searchResults + "<br>"
													 + "LOGIN_USERNAME = " + window.LOGIN_USERNAME + "<br>"
													 + "strURL = " + strURL + "<br>"
													 + "strReferrer = " + strReferrer + "<br>"
					+ "strURLarray[tmpIndex][2] = " + strURLarray[tmpIndex][2] + "<br>"
					);
*/
				} //end of checking if it's an error page
			} //end of checking coremetricsOnFlag
