dojo.provide("mq.ua");

/* UA Stands for User-Action */
dojo.declare("mq.UA", null, {

	constructor: function() { },
	/* _userAction gets set in a() and get's used in commit() */
	_userAction: null,
	
	_userActionMapping: {
		/** Sorry for all these short variable names, but we want to keep this filesize small, so here's the key:
		 ** 
		 ** omn: Omniture
		 ** 	pv: Page View (Name)
		 ** 	an: Action Name
		 ** cs: comScore 
		 ** ad: Ad Refresh Name
		 */
		 
	   /*** Straight Page Views ***/
		':pv':					{omn : {pv: true}							,cs : true, ad: true},
		':pvNoAd':				{omn : {pv: true}							,cs : true, ad: false},
		':pvForced':			{omn : {pv: true}							,cs : true, ad: true, forced: true},
		':pvNoAdForced':		{omn : {pv: true}							,cs : true, ad: false, forced: true},
		
	   /*** Common ***/
		':MQ08OffersDrop':		{omn : {pv: true, an: "MQ08OffersDrop"}		,cs : true, ad: false},
		':MQ08OffersRight':		{omn : {pv: true, an: "MQ08OffersRight"}	,cs : true, ad: false},
		':MQ08SettingsLink':	{omn : {pv: true, an: "MQ08SettingsLink"}	,cs : true, ad: true, forced: true},
		':MQ08OffersClose':		{omn : {pv: true, an: "MQ08OffersClose"}	,cs : true, ad: true, forced: true},		
		
	   /*** Printer Friendly ***/
		':MQ08PFPrint':			{omn : {an: "MQ08PFPrint"}					,cs : false},
		':MQ08PFTextMap':		{omn : {pv: true, an: "MQ08PFTextMap"}		,cs : true, ad: true, forced: true},
		':MQ08PFTextOnly':		{omn : {pv: true, an: "MQ08PFTextOnly"}		,cs : true, ad: true, forced: true},
		':MQ08PFReturn':		{omn : {pv: true, an: "MQ08PFReturn"}		,cs : true, ad: true, forced: true},
		':MQ08PFMyMap':		    {omn : {pv: true, an: "MQ08PFMyMap"}		,cs : true, ad: true, forced: true},
		':MQ08PFDefaultMap':	{omn : {pv: true, an: "MQ08PFDefaultMap"}	,cs : true, ad: true, forced: true},
		':MQ08PFMyView':	    {omn : {pv: true, an: "MQ08PFMyView"}	    ,cs : true, ad: true, forced: true},
		':MQ08PFShowAll':		{omn : {pv: true, an: "MQ08PFShowAll"}		,cs : true, ad: true, forced: true},		
		':MQ08PFTextBox':		{omn : {an: "MQ08PFTextBox"}	            ,cs : false},
		
	   /*** Saved & Recent ***/
	   	':MQ08SettingsEdit':	{omn : {pv: true, an: "MQ08SettingsEdit"}	,cs : true, ad: true, forced: true},
	   	':MQ08SettingsEditAO':	{omn : {pv: true, an: "MQ08SettingsEdit"}	,cs : false, ad: false, forced: true},
		':MQ08SavedRecent':		{omn : {an: "MQ08SavedRecent"}				,cs : false},
		':MQ08SRHome':			{omn : {an: "MQ08SRHome"}					,cs : false},
	   	':MQ08SRWork':			{omn : {an: "MQ08SRWork"}					,cs : false},
	   	':MQ08ClearAll':		{omn : {an: "MQ08ClearAll"}					,cs : false},
		
	   /*** Routing/Starpower/Helpers ***/
		':MQ08GeoDiff':			{omn : {an: "MQ08GeoDiff"}					,cs : false, forced: true},
	   	':MQ08Amb':				{omn : {an: "MQ08Amb"}						,cs : false, forced: true},
	   	
	   /*** Map Stuff ***/
		':MQ08Hybrid':			{omn : {pv: true, an: "MQ08Hybrid"}			,cs : true, ad: true, forced: true},
		':MQ08Aerial':			{omn : {pv: true, an: "MQ08Aerial"}			,cs : true, ad: true, forced: true},
		':MQ08Street':			{omn : {pv: true, an: "MQ08Street"}			,cs : true, ad: true, forced: true},
		':MQ08CompassC':		{omn : {pv: true, an: "MQ08CompassC"}		,cs : true, ad: true, forced: true},
		':MQ08CompassE':		{omn : {pv: true, an: "MQ08CompassE"}		,cs : true, ad: true, forced: true},
		':MQ08CompassN':		{omn : {pv: true, an: "MQ08CompassN"}		,cs : true, ad: true, forced: true},
		':MQ08CompassS':		{omn : {pv: true, an: "MQ08CompassS"}		,cs : true, ad: true, forced: true},
		':MQ08CompassW':		{omn : {pv: true, an: "MQ08CompassW"}		,cs : true, ad: true, forced: true},
		':MQ08CompassOptions':	{omn : {pv: true, an: "MQ08CompassOptions"}	,cs : true, ad: true, forced: true},
		':MQ08DragE':			{omn : {pv: true, an: "MQ08DragE"}			,cs : true, ad: true, forced: true},
		':MQ08DragN':			{omn : {pv: true, an: "MQ08DragN"}			,cs : true, ad: true, forced: true},
		':MQ08DragNE':			{omn : {pv: true, an: "MQ08DragNE"}			,cs : true, ad: true, forced: true},
		':MQ08DragNW':			{omn : {pv: true, an: "MQ08DragNW"}			,cs : true, ad: true, forced: true},
		':MQ08DragS':			{omn : {pv: true, an: "MQ08DragS"}			,cs : true, ad: true, forced: true},
		':MQ08DragSE':			{omn : {pv: true, an: "MQ08DragSE"}			,cs : true, ad: true, forced: true},
		':MQ08DragSW':			{omn : {pv: true, an: "MQ08DragSW"}			,cs : true, ad: true, forced: true},
		':MQ08DragW':			{omn : {pv: true, an: "MQ08DragW"}			,cs : true, ad: true, forced: true},
		':MQ08Recenter':		{omn : {pv: true, an: "MQ08Recenter"}		,cs : true, ad: true, forced: true},
		':MQ08Zoom1':			{omn : {pv: true, an: "MQ08Zoom1"}			,cs : true, ad: true, forced: true},
		':MQ08Zoom10':			{omn : {pv: true, an: "MQ08Zoom10"}			,cs : true, ad: true, forced: true},
		':MQ08Zoom11':			{omn : {pv: true, an: "MQ08Zoom11"}			,cs : true, ad: true, forced: true},
		':MQ08Zoom12':			{omn : {pv: true, an: "MQ08Zoom12"}			,cs : true, ad: true, forced: true},
		':MQ08Zoom13':			{omn : {pv: true, an: "MQ08Zoom13"}			,cs : true, ad: true, forced: true},
		':MQ08Zoom14':			{omn : {pv: true, an: "MQ08Zoom14"}			,cs : true, ad: true, forced: true},
		':MQ08Zoom15':			{omn : {pv: true, an: "MQ08Zoom15"}			,cs : true, ad: true, forced: true},
		':MQ08Zoom16':			{omn : {pv: true, an: "MQ08Zoom16"}			,cs : true, ad: true, forced: true},
		':MQ08Zoom2':			{omn : {pv: true, an: "MQ08Zoom2"}			,cs : true, ad: true, forced: true},
		':MQ08Zoom20':			{omn : {pv: true, an: "MQ08Zoom20"}			,cs : true, ad: true, forced: true},
		':MQ08Zoom3':			{omn : {pv: true, an: "MQ08Zoom3"}			,cs : true, ad: true, forced: true},
		':MQ08Zoom4':			{omn : {pv: true, an: "MQ08Zoom4"}			,cs : true, ad: true, forced: true},
		':MQ08Zoom5':			{omn : {pv: true, an: "MQ08Zoom5"}			,cs : true, ad: true, forced: true},
		':MQ08Zoom6':			{omn : {pv: true, an: "MQ08Zoom6"}			,cs : true, ad: true, forced: true},
		':MQ08Zoom7':			{omn : {pv: true, an: "MQ08Zoom7"}			,cs : true, ad: true, forced: true},
		':MQ08Zoom8':			{omn : {pv: true, an: "MQ08Zoom8"}			,cs : true, ad: true, forced: true},
		':MQ08Zoom9':			{omn : {pv: true, an: "MQ08Zoom9"}			,cs : true, ad: true, forced: true},
		':MQ08Reset':			{omn : {pv: true, an: "MQ08Reset"}			,cs : true, ad: true, forced: true},
		':MQ08ZoomIN':			{omn : {pv: true, an: "MQ08ZoomIN"}			,cs : true, ad: true, forced: true},
		':MQ08ZoomOUT':			{omn : {pv: true, an: "MQ08ZoomOUT"}		,cs : true, ad: true, forced: true},
		':MQ08ZoomStreetLevel':	{omn : {pv: true, an: "MQ08ZoomStreetLevel"},cs : true, ad: true},

	   /*** Traffic ***/
		':MQ08TrafficOn':			{omn : {pv: true, an: "MQ08TrafficOn"}		,cs : true, ad: true, forced: true},
		':MQ08TrafficOff':			{omn : {pv: true, an: "MQ08TrafficOff"}		,cs : true, ad: true, forced: true},
	    ':MQ08TRFIncidentsOn':		{omn : {an: "MQ08TRFIncidentsOn"}			,cs : false},
	    ':MQ08TRFIncidentsOff':		{omn : {an: "MQ08TRFIncidentsOff"}			,cs : false},	    
	    ':MQ08TRFConstructionOn':	{omn : {an: "MQ08TRFConstructionOn"}		,cs : false},
	    ':MQ08TRFConstructionOff':	{omn : {an: "MQ08TRFConstructionOff"}		,cs : false},	    	    
		':MQ08TrafficRefresh':		{omn : {pv: true, an: "MQ08TrafficRefresh"}	,cs : true, ad: true, forced: true},
	    ':MQ08TRFMinLegend':		{omn : {an: "MQ08TRFMinLegend"}	    		,cs : false},
	    ':MQ08TRFMaxLegend':		{omn : {an: "MQ08TRFMaxLegend"}		    	,cs : false},
	    ':MQ08TRFAlertDetails':		{omn : {an: "MQ08TRFAlertDetails"}		   	,cs : false},    
	    ':MQ08TRFLight':		    {omn : {an: "MQ08TRFLight"}		        	,cs : false},	    
		
	   /*** Map Results ***/
	   ':MQ08Revise':			{omn : {an: "MQ08Revise"}					,cs : false},	
		
	   /*** Directions ***/
	   	':MQ08MapGutter':		{omn : {pv: true, an: "MQ08MapGutter"}		,cs : true, ad: true, forced: true},
	   	':MQ08SplitGutter':		{omn : {pv: true, an: "MQ08SplitGutter"}	,cs : true, ad: true, forced: true},
	   	':MQ08ExpGutter':		{omn : {pv: true, an: "MQ08ExpGutter"}		,cs : true, ad: true, forced: true},
	   	':MQ08MapLink':			{omn : {pv: true, an: "MQ08MapLink"}		,cs : true, ad: true, forced: true},
	   	':MQ08SplitLink':		{omn : {pv: true, an: "MQ08SplitLink"}		,cs : true, ad: true, forced: true},
	   	':MQ08ExpLink':			{omn : {pv: true, an: "MQ08ExpLink"}		,cs : true, ad: true, forced: true},
		
	   /*** Directions ***/
	   	':MQ08Edit':			{omn : {an: "MQ08Edit"}						,cs : false},
	   	':MQ08ReorderUp':		{omn : {pv: true, an: "MQ08ReorderUp"}		,cs : true, ad: true},
	   	':MQ08ReorderDown':		{omn : {pv: true, an: "MQ08ReorderDown"}	,cs : true, ad: true},
	   	':MQ08DragStop':		{omn : {pv: true, an: "MQ08DragStop"}		,cs : true, ad: true},
	   	':MQ08Find':			{omn : {an: "MQ08Find"}						,cs : false},
	   	':MQ08MaxStops':		{omn : {an: "MQ08MaxStops"}					,cs : false},
	   	':MQ08MinRouteMan':		{omn : {an: "MQ08MinRouteMan"}				,cs : false},
	   	':MQ08MaxRouteMan':		{omn : {an: "MQ08MaxRouteMan"}				,cs : false},
		':MQ08AvoidMan':		{omn : {pv: true, an: "MQ08AvoidMan"}		,cs : true, ad: true},
		':MQ08ManMap':			{omn : {an: "MQ08ManMap"}					,cs : false},
		':MQ08Hide':			{omn : {an: "MQ08Hide"}						,cs : false},
		':MQ08RouteOptions':	{omn : {an: "MQ08RouteOptions"}				,cs : false},
		':MQ08AvoidHigh':		{omn : {pv: true, an: "MQ08AvoidHigh"}		,cs : true, ad: true},
		':MQ08AvoidSeason':		{omn : {pv: true, an: "MQ08AvoidSeason"}	,cs : true, ad: true},
		':MQ08AvoidToll':		{omn : {pv: true, an: "MQ08AvoidToll"}		,cs : true, ad: true},
		':MQ08ShortTime':		{omn : {pv: true, an: "MQ08ShortTime"}		,cs : true, ad: true},
		':MQ08ShortDistance':	{omn : {pv: true, an: "MQ08ShortDistance"}	,cs : true, ad: true},
		':MQ08ReverseRoute':	{omn : {pv: true, an: "MQ08ReverseRoute"}	,cs : true, ad: true},
		':MQ08RestoreAvoid':	{omn : {pv: true, an: "MQ08RestoreAvoid"}	,cs : true, ad: true},
	   	':MQ08SearchNearby':	{omn : {an: "MQ08SearchNearby"}				,cs : false},
	   	':MQ08SearchNearbyClose':{omn : {an: "MQ08SearchNearbyClose"}		,cs : false},
	   	':MQ08PopSearch1':		{omn : {pv: true, an: "MQ08PopSearch1"}		,cs : true, ad: true},
	   	':MQ08PopSearch2':		{omn : {pv: true, an: "MQ08PopSearch2"}		,cs : true, ad: true},
	   	':MQ08PopSearch3':		{omn : {pv: true, an: "MQ08PopSearch3"}		,cs : true, ad: true},
	   	':MQ08PopSearch4':		{omn : {pv: true, an: "MQ08PopSearch4"}		,cs : true, ad: true},
	   	':MQ08PopSearch5':		{omn : {pv: true, an: "MQ08PopSearch5"}		,cs : true, ad: true},
	   	':MQ08PopSearch6':		{omn : {pv: true, an: "MQ08PopSearch6"}		,cs : true, ad: true},
	   	':MQ08BUBPopSearch1':	{omn : {pv: true, an: "MQ08BUBPopSearch1"}	,cs : true, ad: true},
	   	':MQ08BUBPopSearch2':	{omn : {pv: true, an: "MQ08BUBPopSearch2"}	,cs : true, ad: true},
	   	':MQ08BUBPopSearch3':	{omn : {pv: true, an: "MQ08BUBPopSearch3"}	,cs : true, ad: true},
	   	':MQ08BUBPopSearch4':	{omn : {pv: true, an: "MQ08BUBPopSearch4"}	,cs : true, ad: true},
	   	':MQ08BUBPopSearch5':	{omn : {pv: true, an: "MQ08BUBPopSearch5"}	,cs : true, ad: true},
	   	':MQ08BUBPopSearch6':	{omn : {pv: true, an: "MQ08BUBPopSearch6"}	,cs : true, ad: true},
		':MQ08SearchNearbyGo':	{omn : {pv: true, an: "MQ08SearchNearbyGo"}	,cs : true, ad: true},
		':MQ08Website':			{omn : {an: "MQ08Website"}					,cs : false},
		':MQ08RouteOn':			{omn : {pv: true, an: "MQ08RouteOn"}		,cs : true, ad: true},
		':MQ08RouteOff':		{omn : {pv: true, an: "MQ08RouteOff"}		,cs : true, ad: true},
		':MQ08Delete':			{omn : {an: "MQ08Delete"}			        ,cs : false},
		':MQ08RemoveAll':		{omn : {an: "MQ08RemoveAll"}				,cs : false},
		':MQ08AddNextLink':		{omn : {an: "MQ08AddNextLink"}		        ,cs : false},
		':MQ08AddNextGo':		{omn : {pv: true, an: "MQ08AddNextGo"}		,cs : true, ad: true},
		':MQ08DirToFromLink':	{omn : {an: "MQ08DirToFromLink"}		    ,cs : false},
		':MQ08DirFromGo':		{omn : {pv: true, an: "MQ08DirFromGo"}		,cs : true, ad: true},
		':MQ08DirToGo':			{omn : {pv: true, an: "MQ08DirToGo"}		,cs : true, ad: true},
		
	   /*** Advanced Routing ***/
		':MQ08RouteOptions':	{omn : {an: "MQ08RouteOptions"} 			,cs : false},
		':MQ08RouteOptionsGo':	{omn : {pv: true, an: "MQ08RouteOptionsGo"}	,cs : true, ad: true},

	   /*** Maneuver Maps ***/
		':MQ08ManMap':			{omn : {an: "MQ08ManMap"} 					,cs : false},
		':MQ08ManMapDrag':		{omn : {an: "MQ08ManMapDrag"}				,cs : false},
		':MQ08ManMapZoomIn':	{omn : {an: "MQ08ManMapZoomIn"}				,cs : false},
		':MQ08ManMapZoomOut':	{omn : {an: "MQ08ManMapZoomOut"}			,cs : false},
		':MQ08ManMapHide':		{omn : {an: "MQ08ManMapHide"}				,cs : false},
							   
	   /*** Place Search ***/
		':MQ08PlacesForm':		{omn : {pv: true, an: "MQ08PlacesForm"}     ,cs : true},
		':MQ08Distance':		{omn : {pv: true, an: "MQ08Distance"}       ,cs : true, ad: true},
		':MQ08Alpha':		    {omn : {pv: true, an: "MQ08Alpha"}          ,cs : true, ad: true},
		':MQ08Relevance':		{omn : {pv: true, an: "MQ08Relevance"}      ,cs : true, ad: true},
		':MQ08RefineSearch':	{omn : {an: "MQ08RefineSearch"}	    		,cs : false},
		':MQ08RefineRadius':	{omn : {pv: true, an: "MQ08RefineRadius"}   ,cs : true},
		':MQ08RefineCity':		{omn : {pv: true, an: "MQ08RefineCity"}     ,cs : true},
		':MQ08RefineCategory':	{omn : {pv: true, an: "MQ08RefineCategory"} ,cs : true},
		':MQ08Next':		    {omn : {pv: true, an: "MQ08Next"}           ,cs : true, ad: true},
		':MQ08Previous':		{omn : {pv: true, an: "MQ08Previous"}       ,cs : true, ad: true},
		':MQ08AddSearch':		{omn : {pv: true, an: "MQ08AddSearch"}      ,cs : true, ad: true},
		':MQ08BUBAddSearch':	{omn : {pv: true, an: "MQ08BUBAddSearch"}   ,cs : true, ad: true},
		':MQ08LocDetails':		{omn : {an: "MQ08LocDetails"}	    		,cs : false},
		':MQ08BUBLocDetails':	{omn : {an: "MQ08BUBLocDetails"}	    	,cs : false},	
		':MQ08CancelSearchAO':	{omn : {an: "MQ08CancelSearch", pause: 250}	,cs : false},
		':MQ08CancelSearch':	{omn : {pv: true, an: "MQ08CancelSearch"}	,cs : true, ad: true, forced: true},
		':MQ08EditSearch':		{omn : {an: "MQ08EditSearch"}	    		,cs : false},
		':MQ08EditGo':			{omn : {pv: true, an: "MQ08EditGo"}			,cs : true, ad: true},
		':MQ08LOCDirTo':		{omn : {an: "MQ08LOCDirTo", pause:250}		,cs : false},
	   	':MQ08LOCDirFrom':		{omn : {an: "MQ08LOCDirFrom", pause:250}	,cs : false},
	   	':MQ08LOCSRCHDirTo':	{omn : {an: "MQ08LOCSRCHDirTo", pause:250}	,cs : false},
	   	':MQ08LOCSRCHDirFrom':	{omn : {an: "MQ08LOCSRCHDirFrom", pause:250},cs : false},
		':MQ08BUBSRCHDirTo':	{omn : {an: "MQ08BUBSRCHDirTo", pause:250}	,cs : false},
	   	':MQ08BUBSRCHDirFrom':	{omn : {an: "MQ08BUBSRCHDirFrom", pause:250},cs : false},
	   	':MQ08BUBSRCHMap':		{omn : {pv: true, an: "MQ08BUBSRCHMap"}		,cs : true, ad: true},

	   /*** Business Locator ***/
		':MQ08ResultsNear':		{omn : {pv: true, an: "MQ08ResultsNear"}	,cs : true, ad: true},		
		
	   /*** Send Menu ***/ 
	    ':MQ08S2OSend':		    {omn : {an: "MQ08S2OSend"}	    			,cs : false, ad: false},
	    ':MQ08Send':		    {omn : {an: "MQ08Send"}	    	    		,cs : false, ad: false},	    
	    ':MQ08LTTP':		    {omn : {an: "MQ08LTTP"}	    				,cs : false, ad: false},
	    ':MQ08S2C':		    	{omn : {an: "MQ08S2C"}	    				,cs : false, ad: false},
	    ':MQ08S2O':		    	{omn : {an: "MQ08S2O"}	    				,cs : false, ad: false},
	    ':MQ08LOCS2C':		    {omn : {an: "MQ08LOCS2C"}	    			,cs : false, ad: false},
	    ':MQ08LOCS2O':		    {omn : {an: "MQ08LOCS2O"}	    			,cs : false, ad: true},
	    ':MQ08LOCEmail':		{omn : {an: "MQ08LOCEmail"}	    			,cs : false, ad: true},
	    ':MQ08Email':		    {omn : {an: "MQ08Email"}	    			,cs : false, ad: false},
	    ':MQ08EmailSend':		{omn : {an: "MQ08EmailSend"}				,cs : false, ad: false},
	    ':MQ08EmailClose':		{omn : {an: "MQ08EmailClose"}				,cs : false, ad: true},
	    ':MQ08S2CSend':		    {omn : {an: "MQ08S2CSend"}	    			,cs : false, ad: false},
	    ':MQ08S2CMobile':		{omn : {an: "MQ08S2CMobile"}	    		,cs : false, ad: false},
	    ':MQ08S2CWAP':	 		{omn : {an: "MQ08S2CWAP"}	    			,cs : false, ad: false},
	    ':MQ08S2CNav':		    {omn : {an: "MQ08S2CNav"}	    			,cs : false, ad: false},
	    ':MQ08S2CInvalidError': {omn : {an: "MQ08S2CInvalidError"}	    	,cs : false, ad: false},
	    ':MQ08S2CFailedError':  {omn : {an: "MQ08S2CFailedError"}	    	,cs : false, ad: false},
	    ':MQ08S2CExceedError':  {omn : {an: "MQ08S2CExceedError"}	    	,cs : false, ad: false},
	    ':MQ08S2CClose':	 	{omn : {an: "MQ08S2CClose"}	    			,cs : false, ad: true},
	    
	   /*** RG Form ***/
		':MQ08DirTop':			{omn : {an: "MQ08DirTop"}					,cs : false},
	   	':MQ08MapTop':			{omn : {an: "MQ08MapTop"}					,cs : false},
	   	':MQ08PlaceTop':		{omn : {an: "MQ08PlaceTop"}					,cs : false},
	   	':MQ08WebTop':			{omn : {an: "MQ08WebTop"}					,cs : false},
	   	':MQ08WebTopGo':		{omn : {an: "MQ08WebTopGo", pause: 250}		,cs : false},
	   	':MQ08GasLink':	    	{omn : {an: "MQ08GasLink"}					,cs : false},
	   	':MQ08BlogLink':	   	{omn : {an: "MQ08BlogLink"}					,cs : false},	   	   	
	   	':MQ08HelpLink':	   	{omn : {an: "MQ08HelpLink"}					,cs : false},	   	   	
	   	':MQ08BSLink':	     	{omn : {an: "MQ08BSLink"}					,cs : false},	   	   	
	   	':MQ08FindHelp':	    {omn : {an: "MQ08FindHelp"}		    		,cs : false},	   	   	
	   	':MQ08LocationHelp':	{omn : {an: "MQ08LocationHelp"}				,cs : false},	   	   		   		   	
	   	':MQ08TopTabGo':	    {omn : {pv: true, an: "MQ08TopTabGo"} 		,cs : true, ad: true},
	   		   	
	   /*** Settings ***/
	   	':MQ08Danish':			{omn : {an: "MQ08Danish"}					,cs : false},
	   	':MQ08English':			{omn : {an: "MQ08English"}					,cs : false},
	   	':MQ08Dutch':			{omn : {an: "MQ08Dutch"}					,cs : false},
	   	':MQ08French':			{omn : {an: "MQ08French"}					,cs : false},
	   	':MQ08German':			{omn : {an: "MQ08German"}					,cs : false},
	   	':MQ08Italian':			{omn : {an: "MQ08Italian"}					,cs : false},
	   	':MQ08Norwegian':		{omn : {an: "MQ08Norwegian"}				,cs : false},
	   	':MQ08Spanish':			{omn : {an: "MQ08Spanish"}					,cs : false},
	   	':MQ08Swedish':			{omn : {an: "MQ08Swedish"}					,cs : false},
	   	':MQ08Miles':			{omn : {an: "MQ08Miles"}					,cs : false},
	   	':MQ08Kilometers':		{omn : {an: "MQ08Kilometers"}				,cs : false},
	   	':MQ08StreetDefault':	{omn : {an: "MQ08StreetDefault"}			,cs : false},
	   	':MQ08AerialDefault':	{omn : {an: "MQ08AerialDefault"}			,cs : false},
	   	':MQ08Mobile':			{omn : {an: "MQ08Mobile"}					,cs : false},
	   	':MQ08HomeDefault':		{omn : {an: "MQ08HomeDefault"}				,cs : false},
	   	':MQ08WorkDefault':		{omn : {an: "MQ08WorkDefault"}				,cs : false},
	   	':MQ08AddHome':			{omn : {an: "MQ08AddHome"}					,cs : false},
	   	':MQ08AddWork':			{omn : {an: "MQ08AddWork"}					,cs : false},
	   	':MQ08EditHome':		{omn : {an: "MQ08EditHome"}					,cs : false},
	   	':MQ08EditWork':		{omn : {an: "MQ08EditWork"}					,cs : false},
	   	':MQ08ClearHome':		{omn : {an: "MQ08ClearHome"}				,cs : false},
	   	':MQ08ClearWork':		{omn : {an: "MQ08ClearWork"}				,cs : false},
	   	':MQ08RecentDelete':	{omn : {an: "MQ08RecentDelete"}				,cs : false},
	   	':MQ08AddRecent':		{omn : {pv: true, an: "MQ08AddRecent"}		,cs : true, ad: true},
	   	':MQ08LOCMap':			{omn : {pv: true, an: "MQ08LOCMap"}			,cs : true, ad: true},
	   	':MQ08SelectAll':		{omn : {an: "MQ08SelectAll"}				,cs : false},

	   /*** Promo Links - Common ***/
		':MQ08Classic2':		{omn : {an: "MQ08Classic2"}					,cs : false},
		':MQ08Classic3':		{omn : {an: "MQ08Classic3"}					,cs : false},
		':MQ08Classic4':		{omn : {an: "MQ08Classic4"}					,cs : false},
		':MQ08Classic5':		{omn : {an: "MQ08Classic5"}					,cs : false},
	   	
	   /*** Promo Links - Itinerary Tab ***/
		':MQ08ItinBlog':		{omn : {an: "MQ08ItinBlog "}		        ,cs : false},
		':MQ08ItinLoc1':		{omn : {pv: true, an: "MQ08ItinLoc1"}		,cs : true, ad: true},
		':MQ08ItinLoc2':		{omn : {pv: true, an: "MQ08ItinLoc2"}		,cs : true, ad: true},
		':MQ08ItinLoc3':		{omn : {pv: true, an: "MQ08ItinLoc3"}		,cs : true, ad: true},
		':MQ08ItinLoc4':		{omn : {pv: true, an: "MQ08ItinLoc4"}		,cs : true, ad: true},
		':MQ08ItinLoc5':		{omn : {pv: true, an: "MQ08ItinLoc5"}		,cs : true, ad: true},
		':MQ08ItinLoc6':		{omn : {pv: true, an: "MQ08ItinLoc6"}		,cs : true, ad: true},
		':MQ08ItinLoc7':		{omn : {pv: true, an: "MQ08ItinLoc7"}		,cs : true, ad: true},
		':MQ08ItinLoc8':		{omn : {pv: true, an: "MQ08ItinLoc8"}		,cs : true, ad: true},		
		':MQ08ItinLoc9':		{omn : {pv: true, an: "MQ08ItinLoc9"}		,cs : true, ad: true},
		':MQ08ItinLoc10':		{omn : {pv: true, an: "MQ08ItinLoc10"}		,cs : true, ad: true},		
		':MQ08ItinSearch1':		{omn : {pv: true, an: "MQ08ItinSearch1"}	,cs : true, ad: true},
		':MQ08ItinSearch2':		{omn : {pv: true, an: "MQ08ItinSearch2"}	,cs : true, ad: true},
		':MQ08ItinSearch3':		{omn : {pv: true, an: "MQ08ItinSearch3"}	,cs : true, ad: true},
		':MQ08ItinSearch4':		{omn : {pv: true, an: "MQ08ItinSearch4"}	,cs : true, ad: true},
		':MQ08ItinSearch5':		{omn : {pv: true, an: "MQ08ItinSearch5"}	,cs : true, ad: true},
		':MQ08ItinSearch6':		{omn : {pv: true, an: "MQ08ItinSearch6"}	,cs : true, ad: true},
		':MQ08ItinSearch7':		{omn : {pv: true, an: "MQ08ItinSearch7"}	,cs : true, ad: true},
		':MQ08ItinSearch8':		{omn : {pv: true, an: "MQ08ItinSearch8"}	,cs : true, ad: true},
		':MQ08ItinSearch9':		{omn : {pv: true, an: "MQ08ItinSearch9"}	,cs : true, ad: true},
		':MQ08ItinSearch10':	{omn : {pv: true, an: "MQ08ItinSearch10"}	,cs : true, ad: true},
		
	   /*** Promo Links - Search Tab ***/		
		':MQ08PlacesAirport1':	{omn : {pv: true, an: "MQ08PlacesAirport1"}	,cs : true, ad: true},
		':MQ08PlacesAirport2':	{omn : {pv: true, an: "MQ08PlacesAirport2"}	,cs : true, ad: true},
		':MQ08PlacesAirport3':	{omn : {pv: true, an: "MQ08PlacesAirport3"}	,cs : true, ad: true},
		':MQ08PlacesAirport4':	{omn : {pv: true, an: "MQ08PlacesAirport4"}	,cs : true, ad: true},
		':MQ08PlacesAirport5':	{omn : {pv: true, an: "MQ08PlacesAirport5"}	,cs : true, ad: true},
		':MQ08PlacesSearch1':	{omn : {pv: true, an: "MQ08PlacesSearch1"}	,cs : true, ad: true},
		':MQ08PlacesSearch2':	{omn : {pv: true, an: "MQ08PlacesSearch2"}	,cs : true, ad: true},
		':MQ08PlacesSearch3':	{omn : {pv: true, an: "MQ08PlacesSearch3"}	,cs : true, ad: true},
		':MQ08PlacesSearch4':	{omn : {pv: true, an: "MQ08PlacesSearch4"}	,cs : true, ad: true},
		':MQ08PlacesSearch5':	{omn : {pv: true, an: "MQ08PlacesSearch5"}	,cs : true, ad: true},
		':MQ08PlacesSearch6':	{omn : {pv: true, an: "MQ08PlacesSearch6"}	,cs : true, ad: true},
		':MQ08PlacesSearch7':	{omn : {pv: true, an: "MQ08PlacesSearch7"}	,cs : true, ad: true},
		':MQ08PlacesSearch8':	{omn : {pv: true, an: "MQ08PlacesSearch8"}	,cs : true, ad: true},
		':MQ08PlacesSearch9':	{omn : {pv: true, an: "MQ08PlacesSearch9"}	,cs : true, ad: true},
		':MQ08PlacesSearch10':	{omn : {pv: true, an: "MQ08PlacesSearch10"}	,cs : true, ad: true},
	   	
	   /*** Promo Links - Temporary ***/
		':MQ08Temporary1':		{omn : {pv: true, an: "MQ08Temporary1"}	    ,cs : true, ad: true},
		':MQ08Temporary2':		{omn : {pv: true, an: "MQ08Temporary2"}		,cs : true, ad: true},
		':MQ08Temporary3':		{omn : {pv: true, an: "MQ08Temporary3"}		,cs : true, ad: true},
		':MQ08Temporary4':		{omn : {pv: true, an: "MQ08Temporary4"}		,cs : true, ad: true},
		':MQ08Temporary5':		{omn : {pv: true, an: "MQ08Temporary5"}		,cs : true, ad: true},
		':MQ08Temporary6':		{omn : {pv: true, an: "MQ08Temporary6"}		,cs : true, ad: true},
		':MQ08Temporary7':		{omn : {pv: true, an: "MQ08Temporary7"}		,cs : true, ad: true},
		':MQ08Temporary8':		{omn : {pv: true, an: "MQ08Temporary8"}		,cs : true, ad: true},
		':MQ08Temporary9':		{omn : {pv: true, an: "MQ08Temporary9"}		,cs : true, ad: true},
		':MQ08Temporary10':		{omn : {pv: true, an: "MQ08Temporary10"}	,cs : true, ad: true},
		':MQ08TemporaryA1':	    {omn : {an: "MQ08TemporaryA1"}           	,cs : false},
		':MQ08TemporaryA2':	    {omn : {an: "MQ08TemporaryA2"}           	,cs : false},
		':MQ08TemporaryA3':	    {omn : {an: "MQ08TemporaryA3"}           	,cs : false},
		':MQ08TemporaryA4':	    {omn : {an: "MQ08TemporaryA4"}           	,cs : false},
		
	   /*** Last Line Has No Comma ***/
	   	':dummy':				{omn : {pv: false, an: "dummy"}				,cs : false}
	},

	_getAction: function(actionName) {
		return this._userActionMapping[actionName] || this._userActionMapping[':'];
	},
	
	/** _getUserActionMappingType takes a userActionMapping and returns what type it is
	 ** Possible types: forced, action, pageview, or pageviewAction
	 **/
	_getUserActionMappingType: function(userActionMapping){
		var uam = this._getAction(userActionMapping);
		if(uam){
			if (uam['forced']) {
				return "forced";
			}else if (uam['omn']) {
				if(uam['omn'].pv){
					if(uam['omn'].an){
						//This has both a pageview and an action
						return "pageviewAction";
					}else{
						//This has just a pageview
						return "pageview";
					}
				}else if(uam['omn'].an){
					//This has just an action
					return "action";
				}
			}
		}else{
			debug("Error: There was no Type mapping for User Action: '"+userActionMapping+"'");
		}
	},
	
	/** a (setAction)
	 ** 'a' is for 'action' as in "set user action-mapping" 
	 */
	a: function(/*userActionMapping*/ uam){
		debug('User action-'+uam);
		this._userAction = uam;
		this.commit();
	},
	
	commit: function(){
		if(this._userAction){
			//If there is a mapping, commit it
			this._fire(this._userAction);
			//Now clear it
			this._userAction = null;
		}
	},
	
	/** _fire (userActionName)
	 ** '_fire' is for "Fire User Action" 
	 */
	_fire: function(name) {
		var userAction = this._getAction(name);
		if(userAction){
			// Handle Omniture
			if (userAction['omn']) {
				this._invokeOmniture(userAction['omn']);
			}
			
			// Handle comScore
			if (userAction['cs']) {
				if(userAction['omn'].pv){
					if(userAction['omn'].an){
						//This has both a pageview and an action
						this._comScore(userAction['cs'], userAction['omn']);
					}else{
						//This has just a pageview
						this._comScore(false, userAction['omn']);
					}
				}
			
			}
			
		}else{
			debug("Error: There was no mapping for User Action: '"+name+"'");
		}
		
	},
	
	_invokeOmniture: function(omniture) {
		//Clear important values
		
		var pv = omniture.pv;
		
		if(typeof(pv) == 'boolean'){
			pv = pageViewName();
		}
		
		
		var s = s_gi(s_account);
		if (!s) return;
		
		//Page View
		s.t();
		if (omniture.pv) {
			debug("[omniture] pv: " + pv );
		} else {
			debug("[omniture] an: " + omniture.an );
		}
	},
	
	_comScore: function(fire, omn){
		if(fire){
			var pv = "?pv="+pageViewName();
			var action = "";
			if(omn){
				if(omn.an){
					action = "&an="+omn.an;
				}
			}
			var r = "&r="+Math.round((Math.random() * 10000))+"&h=2"; //random number to prevent caching
			var theUrl = "/mq/mqrequest.html" + pv + action + r;
			var req = ({
				url: theUrl,
				handleAs: "text",
				timeout: 10000, //Time in milliseconds
				handle: function(response, ioArgs){ 
					if(response instanceof Error){
						debug("[comScore] something went horribly, horribly wrong."); 
					}
				}
			});

			try{
				dojo.xhrGet(req);
				debug("[comScore] pv: "+theUrl);
			}catch(e){
				debug("[comScore] something went horribly, horribly wrong. Error: "+e);
			}
		}
		if(!fire){
			debug("[comScore] pv: false"); //pageview was suppressed
		}
	}
	
	
});

