var newHash = '',
$theContent = $('#innerContent');
 
 $('.subnav').delegate('a', 'click', function() {
	 window.location.hash = $(this).attr('href');
	 $('.subnav a').each(function(){
			$(this).removeClass("selected");
			
	});
	 $(this).addClass("selected");
	 return false;
 });
 
 
 $(document).ready(function() {
	$('.subnav li:first-child a').addClass('selected');
	$('.subnav a').each(function(){
			
			if($(this).attr('href') == window.location.hash) {
					$(this).addClass('selected');
					if ($('.subnav li:first-child a').attr('class') == 'selected') {
						$('.subnav li:first-child a').removeClass('selected');
				}
			};
			
			
			
	});
	
 });
 
 
 $('.subnav').delegate('a', 'load', function() {
	 window.location.hash = $(this).attr('href');
	 $('.subnav a').each(function(){
			$(this).removeClass('selected');
			
	});
	 $(this).addClass('selected');
	 return false;
 });
 
 
 // Not all browsers support hashchange
 // For older browser support: http://benalman.com/projects/jquery-hashchange-plugin/
 $(window).bind('hashchange', function() {
	 newHash = window.location.hash.substr(1);
	 $theContent.load(newHash + ' #innerContent > *');
 });
 
 /*$(window).load('hashchange', function() {
	newHash = window.location.hash.substr(1);
	$theContent.load(newHash + ' #innerContent > *');
	
 });
 */
 
 
 
 
 //  VIDEO THUMB NAV
 
 var vidHash = '',
$theVideo = $('#thePlayer');
 
 $('.videoThumbs').delegate('a', 'click', function() {
	 window.location.hash = $(this).attr('href');
	 $('.videoThumbs a').each(function(){
			$(this).removeClass("selected");
			
	});
	 $(this).addClass("selected");
	 return false;
 });
 
 
 $(document).ready(function() {
	$('.videoThumbs li:first-child a').addClass('selected');
	$('.videoThumbs a').each(function(){
			
			if($(this).attr('href') == window.location.hash) {
					$(this).addClass('selected');
					if ($('.videoThumbs li:first-child a').attr('class') == 'selected') {
						$('.videoThumbs li:first-child a').removeClass('selected');
				}
			};
	});
	
 });
 
 
 $('.videoThumbs').delegate('a', 'load', function() {
	 window.location.hash = $(this).attr('href');
	 $('.videoThumbs a').each(function(){
			$(this).removeClass('selected');
			
	});
	 $(this).addClass('selected');
	 return false;
 });
 
 
 // Not all browsers support hashchange
 // For older browser support: http://benalman.com/projects/jquery-hashchange-plugin/
 $(window).bind('hashchange', function() {
	 vidHash = window.location.hash.substr(1);
	 $theVideo.load(newHash + ' #thePlayer > *');
 });
 
 /*
  $(window).load('hashchange', function() {
	//vidHash = window.location.hash.substr(1);
	//$theVideo.load(newHash + ' #thePlayer > *');
	
 });
 */
 
 
 
 
