$(document).ready(function(){
	
	var $_memberFAQ = $('.frequently-asked-questions');
	$_memberFAQ.find('.answer').hide();
	$_memberFAQ.find('.question').toggle (
			function () {
				$(this).next().slideDown('slow');
				$(this).addClass('answered');
				$(this).children('.onoff').addClass('on');
				return false;
			},
			function () {
				$(this).next().slideUp('slow');
				$(this).removeClass('answered');
				$(this).children('.onoff').removeClass('on');
				return false;
			}
	);
	
	$(".frequently-asked-questions .section:nth-child(odd)").addClass("odd");	
	
$("input#zipcode1").focus(function() {
	if ($("input#zipcode1").attr("value") == "Zip Code") {		   
		$("input#zipcode1").attr("value","");
	}
	$("input#zipcode1").css("color","#333333");
});
$("input#zipcode1").blur(function() {
	if ($("input#zipcode1").attr("value") == "") {
		$("input#zipcode1").css("color","#999999");
		$("input#zipcode1").attr("value","Zip Code");
	}
});
	
	
// rollover effect for full-image hero text bar
$(".bb-message a, .bb-more a, .bb-more").hover(
	function() {
		$(".bb-text").addClass("over");
	},
	function() {
		$(".bb-text").removeClass("over");
	}
);

	// media kit left nav
	var $_leftnavslide = $('.nooklnav');
	$(".hiddennav").css("height", $(".hiddennav").height()+"px");
	$_leftnavslide.find('.hiddennav').hide();
	$_leftnavslide.find('.show').toggle (
			function () {
				$(this).prev().slideDown('slow');
				$(this).addClass('less');
				$(this).html('Show Less');
				return false;
			},
			function () {
				$(this).prev().slideUp('slow');
				$(this).removeClass('less');
				$(this).html('Show More');
				return false;
			}
	);


});


//left nav expandability
var atHomeLeftNav = {
    expandCategory:function(thePid){
    var listitem = document.getElementById(thePid);
    
    if (listitem) {
            
            // it's a parent
            if (listitem.getElementsByTagName("ul").length > 0) {
                listitem.getElementsByTagName("ul")[0].className="sub-show";
                listitem.className="category-on";
            }
            // it's a non-expandable parent
            else if (listitem.className == "noexpand-off") {
                listitem.className="noexpand-on";
            }
            // it's a child
            else {
                listitem.className="sub-on";
                if (listitem.parentNode) {
                    listitem.parentNode.className="sub-show";
                    if (listitem.parentNode.parentNode && listitem.parentNode.parentNode.tagName=="LI") {
                        
                        listitem.parentNode.parentNode.className="category-on";
                    }
                }
            }
        }
    }

}



