//this is jquery 
 jQuery(document).ready(function(){	
	
	
					// scroll to anchor
					jQuery("a.jscroll").jscrollerto()
					
					
					
	
	// puts the 3d on the ribbon
	jQuery(".ribbon").append("<img src='/images/newbranding/heading_left.gif' class='headingleft'/><img src='/images/newbranding/heading_right.gif' class='headingright'/>");
	jQuery("div.newsdate").append("<img src='/images/newbranding/heading_left.gif' class='headingleft'/>");
	
	
	
	
				// Preload the images used in the nav hover (because of the PNG fix in IE6)
//				jQuery.preloadImages = function()
//				{
//				  for(var i = 0; i<arguments.length; i++)
//				  {
//					jQuery("<img>").attr("src", arguments[i]);
//				  }
//				}
//				jQuery.preloadImages("");	
					
		
		// the 'scroll to top' function
			jQuery('a[href*="#scroll_top"]').click(function(){
				jQuery('html, body').animate({scrollTop:0}, 'slow'); 
				return false;
			});
	
	
	
	//videopage - scroll to top when new video is selected
	
//	jQuery('.videopage #featuredvidpanel td').click(function(){
//				jQuery('html, body').animate({scrollTop:0}, 'slow'); 
		 
//			});
	
	
	
		// the old threads module nav show/hide
//			jQuery('#threads #threadlist').hide();
//			jQuery('#threads>div>a').click(function(){
			//jQuery(this).css("cursor","pointer");
//			jQuery('#threads #cloud').toggle();
//			jQuery('#threads #threadlist').toggle();
//			return false
			
//			});
	

 
 
 
 
			//this is jquery for the text to show/hide tabs on the product detail page
				//hides h4s that are there for script to degrade gracefully
				jQuery("#tabnavcontainer").show();
				jQuery("#tabs h4").hide();
				jQuery("#tabs #tab4").hide();
				jQuery("#tabs #tab3").hide();
				jQuery("#tabs #tab2").hide();
					// When a link is clicked
					jQuery("ul.tabNav li a").click(function () {
					
						// switch all tabs off
						jQuery(".active").removeClass("active");
						// switch this tab on
						jQuery(this).addClass("active");
						
						// slide all content up
						jQuery(".infoBox").hide();
						// slide this content up
						var content_show = jQuery(this).attr("rel");
						jQuery("#"+content_show).show();
					  return false;
					});
	

				


// show and hide comments 
 jQuery('.hide').show();
// 	jQuery('.show').click(function(){
//				jQuery('#commentscontainer').slideToggle(); 
//				jQuery('.hide').show(); 
//				jQuery('.show').hide(); 
//			});
//    	jQuery('.hide').click(function(){
//				jQuery('#commentscontainer').slideToggle(); 
//				jQuery('.hide').hide(); 
//				jQuery('.show').show(); 
				
//			});





// Little Gallery thumb hover over feature


 jQuery(".eventDatesHolderImage").hover(function () {
     jQuery(this).find(".eventDatesHolderStrap").animate({top: 53}, 300);	
     },  function () {
    			  jQuery(this).find(".eventDatesHolderStrap").animate({top: 115}, 300);	
     			 }); 			   
     			   

// show & hide forget pasword form - scrapped because of inferior form validation
//					 jQuery("#pwreset").hide();
//					 jQuery("#showforget").click(function(){
//						 jQuery("#pwreset").slideToggle();
//						 return false;
//						});


 
 // this chacks all boxes in the opt-in selection on registration form
 
  jQuery(function () { // this line makes sure this code runs on page load
	jQuery('#ctl00_ContentPlaceHolder1_Register1_cbxMailAll').click(function () {
		jQuery(this).parents('fieldset:eq(0)').find(':checkbox').attr('checked', this.checked);
	});

});
 

navmenu(); // calling the nav dropdown function
 
 
 
 
 // show cursor commands when gallery is in focus
 jQuery("#gallery").mousedown(function(){ 
      jQuery("#cursorkeys").fadeIn();
      });
      



//video display switch player and grid mode
      jQuery('#gridmode').hide();
      jQuery("#viewswitch #grid").click(function(){ 
      jQuery("#viewswitch a").removeClass("active");
      jQuery(this).addClass("active");
      jQuery("#playermode").hide();
jQuery("#gridmode").show();
      return false;
     });
 
   jQuery("#viewswitch #player").click(function(){ 
      jQuery("#viewswitch a").removeClass("active");
      jQuery(this).addClass("active");
      jQuery("#gridmode").hide();
      jQuery("#playermode").show();       
      return false;
      });
 
 
// jQuery("#viewswitch #ctl00_ContentPlaceHolder1_lnkGridView").click(function(){ 
//   jQuery("#viewswitch a").removeClass("active");
//   jQuery(this).addClass("active");
//  });
  
//   jQuery("#viewswitch #ctl00_ContentPlaceHolder1_lnkPlayerView").click(function(){ 
//   jQuery("#viewswitch a").removeClass("active");
//   jQuery(this).addClass("active");
//  });
  
  
  
  
//#viewswitch #player





//// voting radio button replacement
//jQuery("div#tvvotingcontainer ul").addClass("votingon");

//jQuery("ul.votingon li").append('<a class="vote-select" href="#">Voted</a><a class="vote-notselect" href="#">Not Voted</a><br class="clear"/>');
// jQuery("ul.votingon li input:checked").parent().addClass("selected");



//	/* handle the user selections */
//jQuery("ul.votingon li .vote-notselect").click(
//  function(event) {
//    event.preventDefault();
//    jQuery("ul.votingon li").removeClass("selected");
//    jQuery(this).parent().addClass("selected");
//    jQuery(this).parent().find(":radio").attr("checked","checked");
//  }
//);

//jQuery("ul.votingon li .vote-select").click(
//  function(event) {
//    event.preventDefault();
//   jQuery("ul.votingon li").removeClass("selected");
//   jQuery(this).parent().find(":radio").removeAttr("checked");
//  }
//);

 

//  show and hide TV Schedule show info

showtheschedule(); // calling the nav dropdown function







 
}); // DO NOT DELETE THIS LINE; it is the end  ------------------------------------//:->

jQuery.fn.jscrollerto = function(settings) {
					
						return this.each(function(){ var scrollerto = this
							
							jQuery(scrollerto).click(function (event) {//	alert('jscrollerto is activated');
								event.preventDefault()
								var locationHref = window.location.href
								  var elementClick = jQuery(scrollerto).attr("href")
								     var destination = jQuery(elementClick).offset().top;
								
							jQuery("html:not(:animated),body:not(:animated)").animate({ scrollTop: destination}, 1433, function() {window.location.hash = elementClick });return false;
							})
						})
					}
					
					
// funtion for nav dropdowns					
					
			function navmenu(){
		jQuery(".dropdowns").css({display: "none"}); // Opera Fix
		jQuery("#nav li").hover(function(){
				jQuery(this).find('.dropdowns:first').css({'display':'none', 'visibility':'visible'}).slideDown(300);
			//jQuery(this).find('.dropdowns:first').show();
			//	jQuery("#content #mainfeature ").css({'z-index':'-77'});
			//	jQuery("#accountbar, #loginlinks li a ").css({position:"static"});
		
				},function(){
				jQuery(this).find('.dropdowns:first').css({'display':'none', 'visibility':'hidden'});
			//	jQuery("#accountbar, #loginlinks li a ").css({position:"relative"});
		
				});
		}

 
 	
 	
 	
 // calling the schedule dropdown function
function showtheschedule(){ 
	jQuery('.showhide').show();
	jQuery('.showhide').click(function(){
	jQuery('.showhide').html("More Info");
	jQuery(this).html("More Info");
	jQuery(' .fullschedule_cell .blurb').slideUp();
		if (jQuery(this).next('.blurb').css('display') == 'none') {
			jQuery(this).next('.blurb').slideToggle();
			jQuery(this).html("Hide Info");
	}
	return false;
    });
	
 }	
 	
 	
					
