﻿/**
* hoverIntent r5 // 2007.03.27 // jQuery 1.1.2+
* <http://cherne.net/brian/resources/jquery.hoverIntent.html>
* 
* @param  f  onMouseOver function || An object with configuration options
* @param  g  onMouseOut function  || Nothing (use configuration options object)
* @author    Brian Cherne <brian@cherne.net>
*/
(function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY;};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY))<cfg.sensitivity){$(ob).unbind("mousemove",track);ob.hoverIntent_s=1;return cfg.over.apply(ob,[ev]);}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}};var delay=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s=0;return cfg.out.apply(ob,[ev]);};var handleHover=function(e){var p=(e.type=="mouseover"?e.fromElement:e.toElement)||e.relatedTarget;while(p&&p!=this){try{p=p.parentNode;}catch(e){p=this;}}if(p==this){return false;}var ev=jQuery.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);}if(e.type=="mouseover"){pX=ev.pageX;pY=ev.pageY;$(ob).bind("mousemove",track);if(ob.hoverIntent_s!=1){ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}}else{$(ob).unbind("mousemove",track);if(ob.hoverIntent_s==1){ob.hoverIntent_t=setTimeout(function(){delay(ev,ob);},cfg.timeout);}}};return this.mouseover(handleHover).mouseout(handleHover);};})(jQuery);



//this is jquery 
 $(document).ready(function(){	
	
	
					// scroll to anchor
					$("a.jscroll").jscrollerto()
					
					
					
	
	// puts the 3d on the ribbon
	$(".ribbon").append("<img src='../../content/layout/miscellaneous/heading_left.gif' class='headingleft'/><img src='../../content/layout/miscellaneous/heading_right.gif' class='headingright'/>");
	$("div.date").append("<img src='../../content/layout/miscellaneous/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]);
//				  }
//				}
//				$.preloadImages("");	
					
		
		// the 'scroll to top' function
			$('a[href*="#scroll_top"]').click(function(){
				$('html, body').animate({scrollTop:0}, 'slow'); 
				return false;
			});
	
	
	
	//videopage - scroll to top when new video is selected
	
//	$('.videopage #featuredvidpanel td').click(function(){
//				$('html, body').animate({scrollTop:0}, 'slow'); 
		 
//			});
	
	
	
		// the old threads module nav show/hide
//			$('#threads #threadlist').hide();
//			$('#threads>div>a').click(function(){
			//$(this).css("cursor","pointer");
//			$('#threads #cloud').toggle();
//			$('#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
				$("#tabnavcontainer").show();
				$("#tabs h4").hide();
				$("#tabs #tab4").hide();
				$("#tabs #tab3").hide();
				$("#tabs #tab2").hide();
					// When a link is clicked
					$("ul.tabNav li a").click(function () {
					
						// switch all tabs off
						$(".active").removeClass("active");
						// switch this tab on
						$(this).addClass("active");
						
						// slide all content up
						$(".infoBox").hide();
						// slide this content up
						var content_show = $(this).attr("rel");
						$("#"+content_show).show();
					  return false;
					});
	

				


// show and hide comments 
 $('.hide').show();
// 	$('.show').click(function(){
//				$('#commentscontainer').slideToggle(); 
//				$('.hide').show(); 
//				$('.show').hide(); 
//			});
//    	$('.hide').click(function(){
//				$('#commentscontainer').slideToggle(); 
//				$('.hide').hide(); 
//				$('.show').show(); 
				
//			});





// Little Gallery thumb hover over feature


 $(".eventDatesHolderImage").hover(function () {
     $(this).find(".eventDatesHolderStrap").animate({top: 53}, 300);	
     },  function () {
    			  $(this).find(".eventDatesHolderStrap").animate({top: 115}, 300);	
     			 }); 			   
     			   

// show & hide forget pasword form - scrapped because of inferior form validation
//					 $("#pwreset").hide();
//					 $("#showforget").click(function(){
//						 $("#pwreset").slideToggle();
//						 return false;
//						});


 
 // this chacks all boxes in the opt-in selection on registration form
 
  $(function () { // this line makes sure this code runs on page load
	$('#ctl00_ContentPlaceHolder1_Register1_cbxMailAll').click(function () {
		$(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
 $("#gallery").mousedown(function(){ 
      $("#cursorkeys").fadeIn();
      });
      



//video display switch player and grid mode
      $('#gridmode').hide();
      $("#viewswitch #grid").click(function(){ 
      $("#viewswitch a").removeClass("active");
      $(this).addClass("active");
      $("#playermode").hide();
$("#gridmode").show();
      return false;
     });
 
   $("#viewswitch #player").click(function(){ 
      $("#viewswitch a").removeClass("active");
      $(this).addClass("active");
      $("#gridmode").hide();
      $("#playermode").show();       
      return false;
      });
 
 
// $("#viewswitch #ctl00_ContentPlaceHolder1_lnkGridView").click(function(){ 
//   $("#viewswitch a").removeClass("active");
//   $(this).addClass("active");
//  });
  
//   $("#viewswitch #ctl00_ContentPlaceHolder1_lnkPlayerView").click(function(){ 
//   $("#viewswitch a").removeClass("active");
//   $(this).addClass("active");
//  });
  
  
  
  
//#viewswitch #player







 
}); // DO NOT DELETE THIS LINE; it is the end  ------------------------------------//:->

jQuery.fn.jscrollerto = function(settings) {
					
						return this.each(function(){ var scrollerto = this
							
							$(scrollerto).click(function (event) {//	alert('jscrollerto is activated');
								event.preventDefault()
								var locationHref = window.location.href
								  var elementClick = $(scrollerto).attr("href")
								     var destination = $(elementClick).offset().top;
								
							$("html:not(:animated),body:not(:animated)").animate({ scrollTop: destination}, 1433, function() {window.location.hash = elementClick });return false;
							})
						})
					}
					
					
// funtion for nav dropdowns					
					
			function navmenu(){
		$(".dropdowns").css({display: "none"}); // Opera Fix
		$("#nav li").hover(function(){
				$(this).find('.dropdowns:first').css({'display':'none', 'visibility':'visible'}).slideDown(300);
			//$(this).find('.dropdowns:first').show();
			//	$("#content #mainfeature ").css({'z-index':'-77'});
			//	$("#accountbar, #loginlinks li a ").css({position:"static"});
		
				},function(){
				$(this).find('.dropdowns:first').css({'display':'none', 'visibility':'hidden'});
			//	$("#accountbar, #loginlinks li a ").css({position:"relative"});
		
				});
		}

