
Cufon.replace(".simple-logo-block .largeWhite, .cta .ctaTitle, #mainShell h1, #mainShell h2, #mainShell h3", { fontFamily: "WhitneyCondensed" });
Cufon.replace(".powerSlide .largeText", { fontFamily: "WhitneyCondensed", textShadow: "2px 2px #000" });
Cufon.replace(".simple-logo-block .largeYellow", { fontFamily: "WhitneyCondensedSemiBold" });
Cufon.replace("header nav>ul>li>a", { fontFamily: "WhitneyCondensedSemiBold", textShadow: "1px 1px #fff" });

$(document).ready(function() {

	$("#njl").hover(
		function(){
			$(this).css("margin-left", "5px");
		},
		function(){
			$(this).css("margin-left", "0px");
		}
	);

	$('div#bMain > div.bTop > div#bBack').click(function(){
          parent.history.back();
          return false
	});

	$('div#logInfo').children('kbd').click(function(){
		$(this).parent().addClass('invisible'); 
		$.post("/demo1/tools/njl_info_tip.php", {"id": "log_tip", "val": 1})
	});

        $('div#njlInfo').children('kbd').click(function(){ 
		$(this).parent().addClass('invisible'); 
		$.post("/demo1/tools/njl_info_tip.php", {"id": "njl_tip", "val": 1})
	});

	if ( $('div#logInfo').hasClass('hide') == false ) {
	  setTimeout(function(){
             $('div#logInfo').show(500)
          }, 5000);
        }

        if ( $('div#njlInfo').hasClass('hide') == false ) {
          setTimeout(function(){
             $('div#njlInfo').show(500)
          }, 6000);
        }

	//Add a Last Item class to a few things
	$("nav ul li:last-child").addClass("lastItem");
			
	//cool little animation on sub li hover
	$("header nav>ul>li>ul>li>a").hover(
		function(){
			$(this).animate({ left: "5px" }, 200 );
		},
		function(){
			$(this).animate({ left: "0px" }, 200 );
		}
	);
	
	//give order to ctas
	var ctaOrder = 1
	$("#ctaShell .cta").each(function(){
		$(this).addClass("cta" + ctaOrder);
		ctaOrder++
	});
	
	//add spacers to footer nav
	$("footer nav ul li:not(:first-child)").before("<li>&nbsp;| </li>");

        // Search form (Submit Results)
        $("form.ccm-search-block-form").children("input.ccm-search-block-submit").click(function(){
	  if ( $.trim( $(this).siblings('input#suggest').val() ) == '' ) {
	    $(this).siblings('input#suggest').val('').removeClass('defBg').addClass('redBg').focus();
	    window.alert('Required field');
	    return false;
          } else {
            $(this).siblings('input#suggest').removeClass('redBg').addClass('defBg');
	  }
	});

	// Search form (Clear Results)
	$("form.ccm-search-block-form").children("input.ccm-search-block-clear").click(function(){ 
	  $(this).siblings('div.#searchResults').slideUp('400', function(){
	    $(this).siblings('div.searchCriteria').slideUp();
	    $(this).siblings('h4').slideUp();
	    $(this).siblings('input#suggest').val('').focus()
	  });
	});

});

