$(document).ready(function(){

// Mast Nav
	
	// Parent LI Hover
	

	// Nav Dropdowns
	$("#mast-nav li").hoverIntent(function(){
		$(this).children("a").css({'border-left-color':'#317d15','border-right-color':'#317d15'});
		$(this).find("ul.subnav").slideDown('fast').show();
	},function(){
		$(this).children("a").css({'border-left-color':'#225278','border-right-color':'#113b6e'});
		$(this).find("ul.subnav").slideUp('fast');
	});


	$("#mast-nav :first-child a").css("border-left","none");
	$("#mast-nav :last-child a").css("border-right","none");

	// Last button's drop down
	$("ul.topnav :last-child ul.subnav").css("left","-107px");
	
	
	
// Promotional images & H1
	$("h1 + img").prev().css("margin-bottom", "-2px").css("z-index", "2").css("position", "relative").css("text-shadow", "none");
	
	// This is to allow the same treatment for promo images wrapped in a link.
	// Wrapping the H1 and img in the same <a> causes a text-decoration bug in IE8
	$("h1 + a").prev().css("margin-bottom", "-2px").css("z-index", "2").css("position", "relative").css("text-shadow", "none");
		
// External Links
	$("a[href^='http']").attr('target','_blank');

// Form OnFocus for submit button			
	
	$('.input-text').focus(function() {
		$(this).css('background-position','0 -35px')							  
	});
	$('.input-text').blur(function() {
		$(this).css('background-position','0 0')							  
	});				
	
	$('.input-textarea textarea').focus(function() {
		$(this).parent().css('background-position','0 -100px')							  
	});
	$('.input-textarea textarea').blur(function() {
		$(this).parent().css('background-position','0 0')							  
	});	
	
	$('#submit').focus(function() {
		$(this).css('background-position','0 -50px')							  
	});	
	$('#submit').blur(function() {
		$(this).css('background-position','0 0')							  
	});
	
	$('#submit').hover(function() {
		$(this).css('background-position','0 -50px')							  
	}, function() {
		$(this).css('background-position','0 0')		
	});

	

// Testing toggle stuff for Andrew
	$("div.faqs dl dd").hide();
	$("div.faqs dt a").click(function() {
		$(this).parent().parent().find("dd").slideDown(500);
	});
	$("div.faqs dd a").click(function() {
		$(this).parent().parent().slideUp(500);
	});

});





