/* When the user clicks the play button i call the playVideo() function within the SWF, passing it the URL of the FLV file. */

	function loadNewVideo(url,description) {
			window.document.ytplayer.loadVideo(url,description);
			var obj = document.getElementById("vidDescription");
			vDescription=this[description];
				if (vDescription==undefined){
					obj.innerHTML="";
					}
				else{
					obj.innerHTML=vDescription;
				}
		}
	 function play() {
        
           window.document.ytplayer.playIt();  
        }

        function pause() {
        
            window.document.ytplayer.pauseIt();   
        }

        function stop() {
         
            window.document.ytplayer.stopVideo();   
        }
		
	function whichVid(description){
		vDescription=this[description];
		if (vDescription==undefined){
			document.getElementById('vidDescription').innerHTML=null;
			}
		else{
			document.getElementById('vidDescription').innerHTML=vDescription;
			}
		}

	// Call the pauseResume() function within the SWF.
	

	function vidComplete(){
	 $(document).ready(function(){
			$('div.onState').removeClass('onState');
			});
	 }
	 
$(document).ready(function(){
  $('a.getVid').click(
		function() {  
			$('div.onState').removeClass('onState');
			$(this).parent().addClass('onState');
 			}
		); 
	
	 $('a.stop').click(
	 	function() {  
	 		$('div.onState').removeClass('onState');
			$(this).parent().removeClass('onState');
 			}
		); 
   
});
//for tabbing
	$(function () {
			var tabContainers = $('div.tabs div.videoChooser');
			tabContainers.hide().filter(':first').show();
			
			$('div.tabs ul.tabNavigation a').click(function () {
				tabContainers.hide();
				tabContainers.filter(this.hash).show();
				$('div.tabs ul.tabNavigation a').removeClass('selected');
				$(this).addClass('selected');
				return false;
			}).filter(':first').click();
		});


