package com.panache.comm
{
	
	import flash.events.EventDispatcher;
	
	public class PanacheToolkitAssetCommunicationServicesNotification extends EventDispatcher
	{
		/**
		* The PanacheNotification.AD_UNIT_OPEN_INIT_STATE constant defines the value of the name of the initial state notification
		*/
		public static const AD_UNIT_OPEN_INIT_STATE:String = "adUnitInitState";
		
		/**
		* The PanacheNotification.AD_UNIT_OPEN_MAX_STATE constant defines the value of the name of the max state notification
		*/
		public static const AD_UNIT_OPEN_MAX_STATE:String = "adUnitOpenMaxState";
		
		/**
		* The PanacheNotification.AD_UNIT_MAX_CLICK constant defines the value of the name of the notification that the max state was clicked
		*/
		public static const AD_UNIT_CLICK_MAX:String = "adUnitClickMax";
		
		/**
		* The PanacheNotification.AD_UNIT_MAX_CLOSE constant defines the value of the name of the notification that the max state was cliose
		*/
		public static const AD_UNIT_CLOSE_MAX:String = "adUnitCloseMax";
		
		/**
		* The PanacheNotification.AD_UNIT_OPEN_RESIDUAL_STATE constant defines the value of the name of the residual state notification
		*/
		public static const AD_UNIT_OPEN_RESIDUAL_STATE:String = "adUnitOpenResidualState";
		
		/**
		* The PanacheNotification.AD_UNIT_CLICK_RESIDUAL constant defines the value of the name of the notification that the residual state was clicked
		*/
		public static const AD_UNIT_CLICK_RESIDUAL:String = "adUnitClickResidual";
		
		/**
		* The PanacheNotification.AD_UNIT_CLOSE_RESIDUAL constant defines the value of the name of the close state notification
		*/
		public static const AD_UNIT_CLOSE_RESIDUAL:String = "adUnitCloseResidual";
		
		/**
		* The PanacheNotification.AD_UNIT_TERMINATE_RESIDUAL_TIMER constant defines the value of the name of the terminate residual timer notification
		*/
		public static const AD_UNIT_TERMINATE_RESIDUAL_TIMER:String = "terminateResidualTimer";
		
		////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
		//NLBSA CONSTANTS	
														
		//Creative Notifications To Ad Unit
		/**
		 * The PanacheNotification.PAN_VIDEO_GET_DURATION constant defines the value of the name of the notification that video duration was requested.
		*/
		public static const PAN_VIDEO_GET_DURATION:String = "panVideoGetDuration";
		
		/**
		 * The PanacheNotification.PAN_VIDEO_GET_TIME constant defines the value of the name of the notification that video play head time was requested.
		*/
		public static const PAN_VIDEO_GET_TIME:String = "panVideoGetTime";
		
		/**
		 * The PanacheNotification.PAN_VIDEO_UPDATE_PLAYHEAD constant defines the value of the name of the notification that video play head update time was sent. 
		*/
		public static const PAN_VIDEO_UPDATE_PLAYHEAD:String = "panVideoUpdatePlayhead";
		
		/**
		 * The PanacheNotification.PAN_VIDEO_PLAY constant defines the value of the name of the notification that video play was sent. 
		*/
		public static const PAN_VIDEO_PLAY:String = "panVideoPlay";
		
		/**
		 * The PanacheNotification.PAN_VIDEO_PAUSE constant defines the value of the name of the notification that video pause was sent. 
		*/
		public static const PAN_VIDEO_PAUSE:String = "panVideoPause";
		
		/**
		 * The PanacheNotification.PAN_VIDEO_UPDATE_VOLUME constant defines the value of the name of the notification that video volume was sent. 
		*/
		public static const PAN_VIDEO_UPDATE_VOLUME:String = "panVideoUpdateVolume";

		/**
		 * The PanacheNotification.PAN_VIDEO_CREATIVE_READY constant defines the value of the name of the notification that the creative asset 
		 * is ready. While creative is being initialized, the video playback is paused. Once the ad unit receives this notification, 
		 * it calls play on the player to start playback.  
		*/
		public static const NLBSA_CREATIVE_READY:String = "nlbsaCreativeReady";
		
		/**
		 * The PanacheNotification.NLBSA_CREATIVE_CLOSE constant defines the name of the notification that informs
		 * the NLBSA creative that it should run clean up code to prepare the creative to be
		 * remove from the page.
		 */
		
		public static const NLBSA_CREATIVE_CLOSE:String = "nlbsaCreativeClose";
		
		/**
		 *The PanacheNotification NLBSA_CREATIVE_CLOSE_READY constant defines the name of the notification call back
		 * that informs that NLBSA ad unit that it can remove the NLBSA creative from the page.
		 */
		 
		public static const NLBSA_CREATIVE_CLOSE_READY:String = "creativeCloseReady";
		
		/**
		 * The PanacheNotification.PAN_VIDEO_OPEN_PANEL constant defines the value of the name of 
		 * the notification that a video panel open request was sent. 
		 * (PanacheNotification.NLBSA_SHARE, PanacheNotification.NLBSA_INFO, PanacheNotification.NLBSA_SETTINGS, PanacheNotification.NLBSA_RESIZE)
		*/
		public static const NLBSA_OPEN_PANEL:String = "nlbsaOpenPanel";
		
		/**
		 * The PanacheNotification.PAN_VIDEO_CLOSE_ALL_PANELS constant defines the value of the name of the notification that all 
		 * video panels need to be closed.
		*/
		public static const NLBSA_CLOSE_ALL_PANELS:String = "nlbsaCloseAllPanels";
					
		/**
         * constant defines the name of the value of the name of the notification that requests pop-up container open.
        */
        public static const NLBSA_OPEN_POPUP:String = "nlbsaOpenPopup";
        
        /**
         * constant defines the name of the value of the name of the notification that requests pop-up container close.
        */
        public static const NLBSA_CLOSE_POPUP:String = "nlbsaClosePopup";

        /**
         * constant defines the name of the value of the name of the notification that requests pop-down container open.
        */
        public static const NLBSA_OPEN_POPDOWN:String = "nlbsaOpenPopdown";
        
        /**
         * constant defines the name of the value of the name of the notification that requests pop-down container close.
        */
        public static const NLBSA_CLOSE_POPDOWN:String = "nlbsaClosePopdown";
        
        /**
         *        constant defines the name of the value of the name of the notification that requests pop-up and pop-down containers open.
        */
        public static const NLBSA_OPEN_ALL_POPS:String = "nlbsaOpenAllPops";

        /**
         * constant defines the name of the value of the name of the notification that requests pop-up and pop-down containers close.
        */
        public static const NLBSA_CLOSE_ALL_POPS:String = "nlbsaCloseAllPops";


		
		
		//Ad Unit Notifications To Creative
		
		public static const PAN_RETURN_VOLUME:String = "panReturnVolume";
		
		/**
		 * The PanacheNotification.PAN_GET_METADATA constant defines the value of the name of the notification that retrieves services object metadata.
		*/
		public static const PAN_GET_METADATA:String = "panGetMetaData";
		/**
		**
		 * The PanacheNotification.PAN_RETURN_METADATA constant defines the value of the name of the notification that returns metadata object to creative.
		*/
		public static const PAN_RETURN_METADATA:String = "panReturnMetaData";
		/**  
		 * The PanacheNotification.PAN_GET_GLOBAL_VARIABLE constant defines the value of the name of the notification that returns metadata object to creative.
		*/
		public static const PAN_GET_GLOBAL_VARIABLE:String = "panGetGlobalVariable";
		/**
		 * The PanacheNotification.PAN_RETURN_GLOBAL_VARIABLE constant defines the value of the name of the notification that returns the global variable object requested.
		 */
		public static const PAN_RETURN_GLOBAL_VARIABLE:String = "panReturnGlobalVariable";
		/**
		 * The PanacheNotification.PAN_SET_GLOBAL_VARIABLE constant defines the value of the name of the notification that sets a global variable on the Panache plug-in.
		*/
		public static const PAN_SET_GLOBAL_VARIABLE:String = "panSetGlobalVariable";
		/**
		 * The PanacheNotification.PAN_CONTAINER_RESIZE constant defines the value of the name of the notification that resizes the overlay container with a new width and new hight.
		*/
		public static const PAN_CONTAINER_RESIZE:String = "panContainerResize";
		/**
		 * The PanacheNotification.PAN_CONTAINER_REPOSITION constant defines the value of the name of the notification that resizes the overlay container with a new x and y offset.
		*/
		public static const PAN_CONTAINER_REPOSITION:String = "panContainerReposition";
		/**
		 * The PanacheNotification.PAN_VIDEO_SET_DURATION constant defines the value of the name of the notification that video duration was sent.
		*/
		public static const PAN_VIDEO_SET_DURATION:String = "panVideoSetDuration";

		/**
		 * The PanacheNotification.PAN_VIDEO_SET_TIME constant defines the value of the name of the notification that video play head time was sent.
		*/
		public static const PAN_VIDEO_SET_TIME:String = "panVideoSetTime";
		
		/**
		 * The PanacheNotification.PAN_VIDEO_SET_DURATION constant defines the value of the name of the notification that video duration was sent.
		*/
		public static const PAN_VIDEO_RETURN_DURATION:String = "panVideoReturnDuration";

		/**
		 * The PanacheNotification.PAN_VIDEO_SET_TIME constant defines the value of the name of the notification that video play head time was sent.
		*/
		public static const PAN_VIDEO_RETURN_TIME:String = "panVideoReturnTime";
		
		
		/**
         * constant defines the name of the value of the name of the notification that the video play head has been updated after seek. 
        */
        public static const PAN_VIDEO_UPDATE_PLAYHEAD_COMPLETE:String = "panVideoUpdatePlayheadComplete";

        /**
         * constant defines the name of the value of the name of the notification that pop-up container has been opened.
        */
        public static const NLBSA_POPUP_OPEN_COMPLETE:String = "nlbsaPopupOpenComplete";

        /**
         * constant defines the name of the value of the name of the notification that pop-down container has been closed.
        */
        public static const NLBSA_POPUP_CLOSE_COMPLETE:String = "nlbsaPopupCloseComplete";
     
        /**
         * constant defines the name of the value of the name of the notification that pop-down container has been opened.
        */
        public static const NLBSA_POPDOWN_OPEN_COMPLETE:String = "nlbsaPopdownOpenComplete";

        /**
         * constant defines the name of the value of the name of the notification that pop-down container has been closed.
        */
        public static const NLBSA_POPDOWN_CLOSE_COMPLETE:String = "nlbsaPopdownCloseComplete";
       
        /**
         * constant defines the name of the value of the name of the notification that both pop-up and pop-down containers are open.
        */
        public static const NLBSA_ALL_POPS_OPEN_COMPLETE:String = "nlbsaAllPopsOpenComplete";
       
        /**
         * constant defines the name of the value of the name of the notification that both pop-up and pop-down containers are closed.
        */
        public static const NLBSA_ALL_POPS_CLOSE_COMPLETE:String = "nlbsaAllPopsCloseComplete";
       
        /**
         *  constant defines the name of the value of the share panel.
        */
        public static const NLBSA_SHARE:String = "SHARE";
      
        /**
         * constant defines the name of the value of the information panel.
        */
        public static const NLBSA_INFO:String = "INFO";
       
        /**
         * constant defines the name of the value of the name of the settings panel.
        */
        public static const NLBSA_SETTINGS:String = "SETTINGS";
       
        /**
         * constant defines the name of the value of the name of the resize panel.
        */
        public static const NLBSA_RESIZE:String = "RESIZE";

		/**
		 * constant defines the name of the value of the name of the full screen panel
		 */
		 public static const NLBSA_FULL_SCREEN:String = "FULL SCREEN";

		/**
         * constant defines the name of the notification for reporting impression.
        */
        public static const PAN_REPORT_IMPRESSION:String = "panReportImpression";
		
		/**
         *  constant defines the name of the value of the HOA close overlay.
        */
        public static const HOA_CLOSE_OVERLAY:String = "hoaCloseOverlay";
        
       	/**
         *  constant defines the name of the value of the HOA close requested notification.
        */
        public static const HOA_CLOSE_REQUESTED:String = "hoaCloseRequested";
		
		/**
         * constant defines the max number of the generic notifications for reporting.
        */
        public static const NUM_PAN_GENERIC_ASSET_EVENTS:uint = 31;
		
		/**
         * constant defines the prefix for the generic notifications for reporting.
        */
        public static const PAN_GENERIC_ASSET_EVENT_PREFIX:String = "panache_generic_event_";
        
        /**
        *  constant defines field name for the event name in the generic event notification object
        */
        public static const PAN_GENERIC_ASSET_EVENT_FIELD_EVENT_NAME:String = "eventName";

        /**
        *  constant defines field name for the "hit tag" value in the generic event notification object
        */
        public static const PAN_GENERIC_ASSET_EVENT_FIELD_HIT_TAG:String = "hitTag";
        
        /**
        *  constant defines field name for the "return tag" value in the generic event notification object
        */
        public static const PAN_GENERIC_ASSET_EVENT_FIELD_RETURN_TAG:String = "returnTag";

        /**
        *  constant defines field name for the tracking tag in the generic event notification object
        */
        public static const PAN_GENERIC_ASSET_EVENT_FIELD_TRACKING_TAG:String = "trackingTag";

		/**
         * constant defines the name of the generic notification 01 for reporting.
        */
		public static const PAN_GENERIC_ASSET_EVENT_01:String = PAN_GENERIC_ASSET_EVENT_PREFIX + "01";
		
		/**
         * constant defines the name of the generic notification 02 for reporting.
        */
        public static const PAN_GENERIC_ASSET_EVENT_02:String = PAN_GENERIC_ASSET_EVENT_PREFIX + "02";
		
		/**
         * constant defines the name of the generic notification 03 for reporting.
        */
        public static const PAN_GENERIC_ASSET_EVENT_03:String = PAN_GENERIC_ASSET_EVENT_PREFIX + "03";
		
		/**
         * constant defines the name of the generic notification 04 for reporting.
        */
        public static const PAN_GENERIC_ASSET_EVENT_04:String = PAN_GENERIC_ASSET_EVENT_PREFIX + "04";
		
		/**
         * constant defines the name of the generic notification 05 for reporting.
        */
        public static const PAN_GENERIC_ASSET_EVENT_05:String = PAN_GENERIC_ASSET_EVENT_PREFIX + "05";
		
		/**
         * constant defines the name of the generic notification 06 for reporting.
        */
        public static const PAN_GENERIC_ASSET_EVENT_06:String = PAN_GENERIC_ASSET_EVENT_PREFIX + "06";
		
		/**
         * constant defines the name of the generic notification 07 for reporting.
        */
        public static const PAN_GENERIC_ASSET_EVENT_07:String = PAN_GENERIC_ASSET_EVENT_PREFIX + "07";
		
		/**
         * constant defines the name of the generic notification 08 for reporting.
        */
        public static const PAN_GENERIC_ASSET_EVENT_08:String = PAN_GENERIC_ASSET_EVENT_PREFIX + "08";
		
		/**
         * constant defines the name of the generic notification 09 for reporting.
        */
        public static const PAN_GENERIC_ASSET_EVENT_09:String = PAN_GENERIC_ASSET_EVENT_PREFIX + "09";
		
		/**
         * constant defines the name of the generic notification 10 for reporting.
        */
        public static const PAN_GENERIC_ASSET_EVENT_10:String = PAN_GENERIC_ASSET_EVENT_PREFIX + "10";
        /**
         * constant defines the name of the generic notification 11 for reporting.
        */
        public static const PAN_GENERIC_ASSET_EVENT_11:String = PAN_GENERIC_ASSET_EVENT_PREFIX + "11";
        
       	/**
         * constant defines the name of the generic notification 12 for reporting.
        */
        public static const PAN_GENERIC_ASSET_EVENT_12:String = PAN_GENERIC_ASSET_EVENT_PREFIX + "12";
        
       	/**
         * constant defines the name of the generic notification 13 for reporting.
        */
        public static const PAN_GENERIC_ASSET_EVENT_13:String = PAN_GENERIC_ASSET_EVENT_PREFIX + "13";
        
       	/**
         * constant defines the name of the generic notification 14 for reporting.
        */
        public static const PAN_GENERIC_ASSET_EVENT_14:String = PAN_GENERIC_ASSET_EVENT_PREFIX + "14";
        
       	/**
         * constant defines the name of the generic notification 15 for reporting.
        */
        public static const PAN_GENERIC_ASSET_EVENT_15:String = PAN_GENERIC_ASSET_EVENT_PREFIX + "15";
        
       	/**
         * constant defines the name of the generic notification 16 for reporting.
        */
        public static const PAN_GENERIC_ASSET_EVENT_16:String = PAN_GENERIC_ASSET_EVENT_PREFIX + "16";
        
       	/**
         * constant defines the name of the generic notification 17 for reporting.
        */
        public static const PAN_GENERIC_ASSET_EVENT_17:String = PAN_GENERIC_ASSET_EVENT_PREFIX + "17";
        
       	/**
         * constant defines the name of the generic notification 18 for reporting.
        */
        public static const PAN_GENERIC_ASSET_EVENT_18:String = PAN_GENERIC_ASSET_EVENT_PREFIX + "18";
        
       	/**
         * constant defines the name of the generic notification 19 for reporting.
        */
        public static const PAN_GENERIC_ASSET_EVENT_19:String = PAN_GENERIC_ASSET_EVENT_PREFIX + "19";
        
       	/**
         * constant defines the name of the generic notification 20 for reporting.
        */
        public static const PAN_GENERIC_ASSET_EVENT_20:String = PAN_GENERIC_ASSET_EVENT_PREFIX + "20";
        
       	/**
         * constant defines the name of the generic notification 21 for reporting.
        */
        public static const PAN_GENERIC_ASSET_EVENT_21:String = PAN_GENERIC_ASSET_EVENT_PREFIX + "21";
        
       	/**
         * constant defines the name of the generic notification 22 for reporting.
        */
        public static const PAN_GENERIC_ASSET_EVENT_22:String = PAN_GENERIC_ASSET_EVENT_PREFIX + "22";
        
       	/**
         * constant defines the name of the generic notification 23 for reporting.
        */
        public static const PAN_GENERIC_ASSET_EVENT_23:String = PAN_GENERIC_ASSET_EVENT_PREFIX + "23";
        
       	/**
         * constant defines the name of the generic notification 24 for reporting.
        */
        public static const PAN_GENERIC_ASSET_EVENT_24:String = PAN_GENERIC_ASSET_EVENT_PREFIX + "24";
        
       	/**
         * constant defines the name of the generic notification 25 for reporting.
        */
        public static const PAN_GENERIC_ASSET_EVENT_25:String = PAN_GENERIC_ASSET_EVENT_PREFIX + "25";
       	/**
         * constant defines the name of the generic notification 26 for reporting.
        */
        public static const PAN_GENERIC_ASSET_EVENT_26:String = PAN_GENERIC_ASSET_EVENT_PREFIX + "26";
        
        /**
         * constant defines the name of the generic notification 27 for reporting.
        */
        public static const PAN_GENERIC_ASSET_EVENT_27:String = PAN_GENERIC_ASSET_EVENT_PREFIX + "27";
       	/**
         * constant defines the name of the generic notification 28 for reporting.
        */
        public static const PAN_GENERIC_ASSET_EVENT_28:String = PAN_GENERIC_ASSET_EVENT_PREFIX + "28";
       	/**
         * constant defines the name of the generic notification 29 for reporting.
        */
        public static const PAN_GENERIC_ASSET_EVENT_29:String = PAN_GENERIC_ASSET_EVENT_PREFIX + "29";
        
       	/**
         * constant defines the name of the generic notification 30 for reporting.
        */
        public static const PAN_GENERIC_ASSET_EVENT_30:String = PAN_GENERIC_ASSET_EVENT_PREFIX + "30";
        
       	/**
         * constant defines the name of the generic notification 31 for reporting.
        */
        public static const PAN_GENERIC_ASSET_EVENT_31:String = PAN_GENERIC_ASSET_EVENT_PREFIX + "31";
        
       	/**
         * constant defines the name of a general request received from the creative
        */
        public static const PAN_CREATIVE_REQUEST:String = "creative_request";
        
       	/**
         * constant defines the name of the general response returned to the creative
        */
        public static const PAN_CREATIVE_RESPONSE:String = "creative_response";
        
       	/**
         * constant defines the name of the field containing the specific request being made or answered
        */
        public static const PAN_REQUEST_NAME:String = "requestName";
        
       	/**
         * constant defines the name of the request for tracking from the creative
        */
        public static const PAN_REQUEST_TRACKING:String = "request_tracking";
        
       	/**
         * constant defines the name of the request for ad xml from the creative
        */
        public static const PAN_REQUEST_AD_XML:String = "request_ad_xml";

		/**
		* The PanacheNotification.FULLSCREEN_ASSET_CONNECTED constant defines the value of the name of the notfication that we have connected to a fullscreen asset
		* NOTE: This was copied from the MTV Pan COMM Services source 
		*/
		public static const FULLSCREEN_ASSET_CONNECTED:String = "panFullscreenAssetConnected";
        
		
		//we can have a static and non-static instance of a function with the same name
		//I want them both in here in case we need to make a static call, but can also enforce its existance as part of an interface		
		// creates a generic event name for a number
		public static function createGenericEventName(num:int) : String 
		{
			var name:String = PAN_GENERIC_ASSET_EVENT_PREFIX;
			if (num < 10)
				name += "0";
			name += num;
			
			return name;
		}	
				
		public function createGenericEventName(num:int) : String 
		{	
			//call the static instance of this function... allows us to have a static and member instance of this function
			return PanacheToolkitAssetCommunicationServicesNotification.createGenericEventName(num);
		}	
		
		private var mNotificationName:String;		// name of the notification
		private var mData:Object;					// data that's passed to the connected swf
		private var mTargetAdId:String;				//ad id this notification is targeting
		
		/**
		* Constructor.
		* This is the object that gets passed between swfs when sending notifications
		* @param notificationName The name of the notification to be sent
	 	* @param data An object containing data to be sent with the notification
		*/
		public function PanacheToolkitAssetCommunicationServicesNotification(notificationName:String, data:Object, targetAdId:String = "*")
		{
			mNotificationName = notificationName;
			mData = data;
			mTargetAdId = targetAdId;
		}
		
		public function get notificationName():String
		{
			return mNotificationName;
		}
		public function set notificationName(value:String):void
		{
			mNotificationName = value;
		}
		
		
		public function get targetAdID():String
		{
			return mTargetAdId;
		}
		public function set targetAdID(value:String):void
		{
			mTargetAdId = value;
		}
		
		public function get data():Object
		{
			return mData;
		}
		public function set data(value:Object):void
		{
			mData = value;
		}
		
		
	}
}