
function videoControls(s_objname_fp) ///!!!!!!!note, everything should be under videoControls. I separated the functions for troubleshooting. 
{

    /* BEGIN PRIVATE VARIABLES */
    var i_playing = 1; //playing and stopped are currently used as global variables. This needs to be cleaned up later.
    var i_stopped = 0;
    var b_mute=0;
    var s_objname; //object's instance name for callbacks
    var a_playpause = new Array();
    var a_speaker = new Array();

    //"CONSTANTS"
    //DEF_ (defaults)
    //ERR_ (error messages)
    //HTML_ (template html strings)
    //KEY_ (index keys)
    //RGX_ (regex matching strings)
    KEY_SWFNAME="videoPlayer";
    
    /* END PRIVATE VARIABLES */
    /* BEGIN PUBLIC METHOD POINTERS */

//note; when stop is pressed, movie is paused and footage is reset to starting
// when mute is set volume is set to 0 but actual volume is saved and restored when 
// mute is turned off or volume keys are pressed

    this.doMultiButtonChange = doMultiButtonChange; //Replaces one image with another. like doRollover but for an array of 2x2 images. 
    this.doPlayButtonClick = doPlayButtonClick; //run when the play/pause button is clicked
    this.doRollover = doRollover; // takes an image's Id and filename and replaces the image with the specified file 	    
   

    this.getMute = getMute;	// b_mute getter. 1 for muted. 0 for volume. 
    this.getPlaying = getPlaying; // getter for i_playing    
    this.getPlayPauseArray = getPlayPauseArray; // returns a_playpause. See setPlayPauseArray. 
    this.getSpeakerArray = getSpeakerArray; //returns the private array a_speaker    
    this.getStopped = getStopped; // getter for stopped. 1 = true, 0 = false
    
    this.setMultiButtonArray = setMultiButtonArray;  //returns a 2x2 array to the array setter fxns. Technically not needed, but helps standardize things. 4 images = ( 'images/play.png', 'images/play_ro.png', 'images/pause.png', 'images/pause_ro.png' );
    this.setMute = setMute; // b_mute setter. 1 for muted. 0 for volume.   										
    this.setPlaying = setPlaying; // setter for i_playing. Records whether the movie is playing or not. (1= playing, 0=not playing)
    this.setPlayPauseArray = setPlayPauseArray; // sets a_playpause to hold the active, activerollover, inactive and inactive rollover files    
    this.setSpeakerArray = setSpeakerArray; //sets a_speaker to hold active, activerollover, inactive and inactive rollover. Is redundant (includes two files twice) 
    										//since active rollover is the inactive normal and vice versa    
    this.setStopped = setStopped; // setter for Stopped. Records when the movie has been stopped (not paused)  1 = true, 0 = false    

    /* END PUBLIC METHOD POINTERS */

    /* BEGIN "CONSTRUCTOR" ACTIONS */
    setCallback(s_objname_fp);
    
    /* END "CONSTRUCTOR" ACTIONS */

    /* BEGIN PUBLIC METHODS */
   
    
    function doMultiButtonChange( s_eleid_fp, s_activity_fp, s_stateid_fp, a_multib_fp)
    {
        	document.getElementById(s_eleid_fp).src = a_multib_fp[s_activity_fp][s_stateid_fp];
	                                                                                // assign the target element the state
    }																				// specified by the array.
																					// activity = active or inactive
																					// s_stateid_fp = rest or roll
																					// multiBArray is a 2 dimensional array
																					// with named keys created here by
																					// multiButtonArray
    
  	function doPlayButtonClick(s_id_fp, a_plpse_fp ) //play or pause the movie based. ID of player must be videoPlayer
	{//a_playpause
	
				if (i_playing==1)
				{
					i_playing=0;
					doMultiButtonChange( s_id_fp, 0, 0, a_plpse_fp); // id, [play/pause][roll/noroll] , array
					document.getElementById(KEY_SWFNAME).playpauseMovie();
					return;
				}
				if ( i_playing==0 &&i_stopped==1 ) // if play is hit after 'stopped' was pushed
				{
				alert("play hit after stop pushed");
					i_playing=1;
					stopped=0;
					doMultiButtonChange( s_id_fp, 1, 0, a_plpse_fp);
					document.getElementById(KEY_SWFNAME).playpauseMovie();
					return;
				}
				if ( i_playing==0 &&i_stopped==0 ) //play is hit after pause was pushed
				{
					i_playing=1;
					stopped=false;
					doMultiButtonChange( s_id_fp, 1, 0, a_plpse_fp);
					document.getElementById(KEY_SWFNAME).playpauseMovie();
					return;
				}
	}
    function doRollover(s_id_fp, s_filename_fp)
    {
        document.getElementById(s_id_fp).src = s_filename_fp;
    }

 

 
  

    
     function getMute()
    {
        return b_mute;
    }

    function getPlaying()
    {
        return i_playing;
    }
    
	function getPlayPauseArray()
    {
          return a_playpause;
    }
    
    function getSpeakerArray(a_stopArray_fp)
    {
        return a_speaker;
    }		
    
    function getStopped()
    {
           return i_stopped;
    }
    
    


    function setMultiButtonArray( s_norminactive_fp, s_rollinactive_fp, s_normactive_fp, s_rollactive_fp)  // one multiButtonArray instance needs to be
    {																					//created for each quaternary state you // intend to use
    	var a_button = new Array(2);
    	a_button[0]= new Array(2);
    	a_button[1] = new Array(2);
    	a_button[0][0]= s_norminactive_fp;
    	a_button[0][1] = s_rollinactive_fp;
    	a_button[1][0] = s_normactive_fp;
    	a_button[1][1] = s_rollactive_fp;
    	return a_button;
    }
    
        function setMute(b_setto_fp)
    {
        if(b_setto_fp)
        {
            b_mute=1;
        }else
        {
            b_mute=0;
        }

    }

    
    function setPlaying(b_setto_fp)
    {
        if(b_setto_fp)
        {
           i_playing=1;
        }else
        {
           i_playing=0;
        }
    }

    function setPlayPauseArray(a_pp_fp)
    {
          a_playpause=a_pp_fp;
    }

    function setSpeakerArray(a_stop_fp)
    {
        a_speaker=a_stop_fp;
    }

    function setStopped(b_setto_fp)
    {
        if(b_setto_fp)
        {
           i_stopped=1;
        }else
        {
           i_stopped=0;
        }
    }
    
    /* END PUBLIC METHODS */


    /* BEGIN PRIVATE METHODS */

        // stop and play buttons set 'setPlaying' to 0 for paused or 1 for playing

    function setCallback(s_objname_fp)
    {
        s_objname = s_objname_fp;
    }
    /* END PRIVATE METHODS */
}