$(function() {	
	var videoPlayer = $('#videos .player');
	var videoNav = $('#videos .nav a');
	var videoPress = $('#features.press-room a');
	var videoPressPlayer = $('#slideshow .video-player');
	
	
	//change video player on click
	videoNav.live('click', function()
	{
		var html = '';
		
	
		var video = $(this).attr('href').replace('#','');
		
		html += '<object width="390" height="235">\n';
		html += '	<param name="movie" value="http://www.youtube.com/v/' + video + '?fs=1&showinfo=0&hd=1&amp;hl=en_US"></param>\n';
		html += '	<param name="allowFullScreen" value="true"></param>\n';
		html += '	<param name="allowscriptaccess" value="always"></param>\n';
		html += '	<embed src="http://www.youtube.com/v/' + video + '?fs=1&showinfo=0&hd=1&amp;hl=en_US" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="390" height="235"></embed>\n';
		html += '</object>\n';
		
		videoNav.removeClass();
		$(this).addClass('active');
		
		videoPlayer.html(html);
		
		return false;
	});
	
	//change video player on click
	videoPress.live('click', function()
	{
		var html = '';
		
	
		var video = $(this).attr('href').replace('#','');
		
		html += '<object width="384" height="236">\n';
		html += '	<param name="movie" value="http://www.youtube.com/v/' + video + '?fs=1&showinfo=0&hd=1&amp;hl=en_US"></param>\n';
		html += '	<param name="allowFullScreen" value="true"></param>\n';
		html += '	<param name="allowscriptaccess" value="always"></param>\n';
		html += '	<embed src="http://www.youtube.com/v/' + video + '?fs=1&showinfo=0&hd=1&amp;hl=en_US" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="390" height="235"></embed>\n';
		html += '</object>\n';
		
		videoPress.removeClass();
		$(this).addClass('active');
		
		videoPressPlayer.html(html);
		
		return false;
	});
});
