	function init() 
	{
	   playVid(corpVids,3);
	};

	function playVid(arr,indx)
	{
		loadMovie('movieFrame',arr[indx].url);
		showDescription('galleryCaption',arr[indx].desc);
	};
	

    function loadMovie(aFrame, url)
    {
     	var dom   = YAHOO.util.Dom;
     	var ifrm = dom.get(aFrame);
     	ifrm.src = url;
     };
  
     function showDescription(anElement, desc)
     {
		try
		{
    		 var dom   = YAHOO.util.Dom;
    	 	var el = document.getElementById(anElement);
    	 	el.innerHTML = desc;
    	}
    	catch(err) {}
     }


	 function generateSelectionOpts(arr)
	 {
	 	try
	 	{
	 		for (var i =0; i<arr.length;i++)
	 		{
        if (arr[i].Name == "Separator")
	 			   document.write("<option disabled='disabled'>--------"+arr[i].desc+"--------</option>");
        else
   			   document.write("<option value='" + i + "'>" + arr[i].Name + "</option>");

	 		}
	 	
	 	}
	 	catch (err) {}
	 
	 }
	       /**
       * Resizing the player in JavaScript.
       */

      // Make the player small.
      function smallPlayer() {
        resizePlayer(480, 295);
      }

      // Set the player back to normal.
      function normalPlayer() {
        resizePlayer(560, 340);
      }

      // Make the player big.
      function largePlayer() {
        resizePlayer(640, 385);
      }

      // Set the loaded player to a specific height and width.
      function resizePlayer(width, height) {
        var playerObj = document.getElementById("ytPlayer");
        playerObj.height = height;
        playerObj.width = width;
      }

      // The "main method" of this sample. Called when someone clicks "Run".
      function loadHighlightVideo(indx) {
        // The video to load
        var videoID = highlightVids[indx].ytid;
        // Lets Flash from another domain call JavaScript
        var params = { allowScriptAccess: "always" };
        // The element id of the Flash embed
        var atts = { id: "ytPlayer" };
        // All of the magic handled by SWFObject (http://code.google.com/p/swfobject/)
        swfobject.embedSWF("http://www.youtube.com/v/" + videoID +
                           "&enablejsapi=1&playerapiid=player1",
                           "videoDiv", "560", "340", "8", null, null, params, atts);
        showDescription('galleryCaption',highlightVids[indx].desc);

      }
      
      function loadFrontPageVideo(indx) {
        // The video to load
        //alert(highlightVids[indx].ytid);
        var videoID = "QcfDEsBmeRs";
       // var videoID = highlightVids[indx].ytid;
        // Lets Flash from another domain call JavaScript
        var params = { allowScriptAccess: "always" };
        // The element id of the Flash embed
        var atts = { id: "ytPlayer2" };
        // All of the magic handled by SWFObject (http://code.google.com/p/swfobject/)
        swfobject.embedSWF("http://www.youtube.com/v/" + videoID +
                           "&enablejsapi=1&playerapiid=player1",
                           "videoDiv", "480", "295", "8", null, null, params, atts);
        //showDescription('galleryCaption',highlightVids[indx].desc);

      }

      
      function changeHighlightMovie(indx) {
        var newURL = "uiViewVid.php?i="+indx;
        location.href=newURL;
      }


      
      
