         ////////////////////////////////////////////////////////////////////////////////
         // Video window function, handles urls, sets up embeds, makes window visible/invisible
         ////////////////////////////////////////////////////////////////////////////////

         function playVid(vidId, noBlackout) {

            ////////////////////////////////////////////////////////////////////////////////
            // Test to see if our video and blackout divisions have been set up.
            // If no division was declared in the HTML then we'll go ahead and automatically
            // create and style the necessary division.
            ////////////////////////////////////////////////////////////////////////////////

            if (_vidPane==null) {
               ////////////////////////////////////////////////////////////////////////////////
               /// Video Pane wasn't set up so see if it's declared in the HTML
               ////////////////////////////////////////////////////////////////////////////////
               _vidPane=document.getElementById('vidPane');
               _blackout=document.getElementById('blackout');
            }

            // Shows (or hides) the vidPane layer.   Accepts 2 parameteres.
            // vidId is null (close window) or an anchor object (contains HREF value)
            // vidId is mandatory example: <a href="someservice.com/somevideo.swf" onClick='return playVid(this);'></a>
            // noBlackout is optional. If you pass true, the background will not be "greyed out".

            if (vidId==null) { 
               // Null is passed by the "close" link, so we'll hide the layer.
               _vidPane.style.display='none';         // Hide the division.
               _vidPane.innerHTML='';                 // purge it's html (kill video)
               _blackout.style.display='none';        // Hide the blackout layer.
            } else {
               // Snag the url from the passed object
               vidId=vidId.href;

               // Next three lines make the blackout layer visible
               // and makes sure it covers the entire page.
               if (!noBlackout) {
                  _blackout.style.width='100%';
                  _blackout.style.height=(document.body.offsetHeight<screen.height) ? screen.height+'px' : document.body.offsetHeight+20+'px'; 
                  _blackout.style.display='block';
               } else {
                  _blackout.style.display='none';        // Hide the blackout layer.
               }
               // Break out the URL passed to this function (so vidInfo[0]=http, [1]=domain, etc
               var vidInfo = vidId.split('/');

               // We're building a temporary string called vidstring. 
               // vidstring will hold the HTML as we build it based on the service
               // being used.  The next few lines contains items which are common
               // to all the services, or at least ignored if not directly used.
               
               //var vidstring ='&nbsp;<A HREF="'+vidId+'">LINK</A>';
               //vidstring+='&nbsp;<A HREF="#" onClick="return(playVid())">CLOSE</A><BR>';
               var vidstring ='<center><embed style="margin-top: 5px;"';  
               vidstring+=' enableJavascript="false" allowScriptAccess="never"';
               vidstring+=' type="application/x-shockwave-flash"';
               vidstring+=' wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" ';

               if (vidInfo[2].indexOf('youtube.com')>=0) {
                  ////////////////////////////////////////////////////////////////////////////////
                  // YouTube (Use browser URL, autoplays)
                  ////////////////////////////////////////////////////////////////////////////////
                  vidInfo=vidId.match(/v=.+$/);
                  vidInfo=String(vidInfo).replace(/v=/g,'');
                  vidstring+=' src="http://www.youtube.com/v/'+vidInfo+'&autoplay=1" ';
                  vidstring+=' height="250" width="300"></embed></center>';
               } else {
                  ////////////////////////////////////////////////////////////////////////////////
                  // Failed.
                  ////////////////////////////////////////////////////////////////////////////////
                  vidstring += '></embed><BR><BR><BR>Unknown video service.</center>';
               } 
               // Insert our HTML and display the video window.
               _vidPane.innerHTML=vidstring;
               // Set the Y position of the video window so it's in the visible clip
               var scrollTop = 0;
               if (document.documentElement && document.documentElement.scrollTop)
	                scrollTop = document.documentElement.scrollTop;
               else if (document.body)
	                scrollTop = document.body.scrollTop
               _vidPane.style.top=scrollTop+50+'px';
               // Video window was hidden so we'll make it visible
               _vidPane.style.display='block'; 
            }
            // return false so the browser won't follow through with A HREF clicks.
            return(false);
         }

        // Initialize global variables.
         var _savedTarget=null;        // The target layer (effectively vidPane)
         var _orgCursor=null;          // The original Cursor (mouse) Style so we can restore it
         var _vidPane = null;          // Video Layer -- won't be defined until a video is called
         var _blackout= null;          // blackout Layer. -- won't be defined until a video is called.
