$(document).ready(function() {

	//var docHeight = $(document).height();

	//$('html').css('height',docHeight);

	$('.children').hide();

	$('.page_item').has('.children').addClass('parent_nav');

	$('.parent_nav').hover(function(){ $(this).stop().find('.children').fadeIn() }, function() { $(this).stop().find('.children').fadeOut(); } );
	
	$('#slides').slides({				
		effect: 'fade',
		crossfade: true,
		fadeSpeed: 700,
		generateNextPrev: false,
		generatePagination: false,
		play: 7000
	});
	
	$("a.youtube").YouTubePopup({ autoplay: 1, draggable: true });
	
	// This sets the opacity of the thumbs to fade down to 60% when the page loads
	$("img.rollover").fadeTo("slow", 0.6); // This sets the opacity of the thumbs to fade down to 60% when the page loads
	
	$("img.rollover").hover(function(){
	$(this).fadeTo("slow", 1.0); // This should set the opacity to 100% on hover
	},function(){
	$(this).fadeTo("slow", 0.6); // This should set the opacity back to 60% on mouseout
	});
	
     //icon div fade in at top
	 var hide = false;
     $("a#ncfe-icon").hover(function(){
       //  if (hide) clearTimeout(hide);
         $("#ncfe-detail").fadeIn();
     }, function() {
         hide = setTimeout(function() {
             $("#ncfe-detail").fadeOut("slow");
         }, 2000);
     }); 
	 
	 $("a#email-icon").hover(function(){
        // if (hide) clearTimeout(hide);
         $("#email-detail").fadeIn();
     }, function() {
         hide = setTimeout(function() {
             $("#email-detail").fadeOut("slow");
         }, 2000);
     }); 
	 
	 $("a#phone-icon").hover(function(){
        // if (hide) clearTimeout(hide);
         $("#phone-detail").fadeIn();
     }, function() {
         hide = setTimeout(function() {
             $("#phone-detail").fadeOut("slow");
         }, 2000);
     }); 

});
