$(document).ready(function(){
	//remove cellspacing from all tables (can't do w/css)
	$("table").attr("cellspacing", "0");
	//cufon, which was breaking in nested divs in ie6--there may be a fix, but 
	// we are just leaving cufon out for ie6 by checking for an ie6-only property
	if(typeof document.body.style.maxHeight === "undefined") {
		//	$('.primary-links a').css( 'font-size' , '16pt');
        //no cufon
	} else {
		// Cufon.replace('.primary-links a:not(.first, #nav_take_action, #nav_contribute)', {
		//	hover: true
		// });
		// Cufon.replace('.primary-links a#nav_take_action', { });
		// Cufon.replace('.primary-links a#nav_contribute', { });
		Cufon.replace('#block-menu-menu-act-menu a');
		Cufon.replace('#content-wrapper h1');
		Cufon.replace('#content-wrapper h2');
		Cufon.replace('#content-wrapper h3, #mainContent .views-field-title a');
		//Cufon.replace('taxonomy-list-list li p');
	}
});

// fade up instructions as used on volunteers
$(document).ready(function(){  
	$(".has-instructions a").hover(function() {
	$(this).next("em").stop(true, true).animate({opacity: "show", top: "-0"}, "slow");
	}, function() {
	$(this).next("em").animate({opacity: "hide", top: "-40"}, "fast");
	});				   
});  

// Signup functions
$(document).ready(function(){
	//salsa signup form: focus elements
	$('#f11').focus(function () {
		$(this).addClass('uFocus');
		if( $(this).val()=='email' ) {
			$(this).val('');
		}
	});
	$('#f32').focus(function () {
		$(this).addClass('uFocus');
		if( $(this).val()=='zip' ) {
			$(this).val('');
		}
	});
	//restore login form text
	$('#f11').blur(function () {
		$(this).removeClass('uFocus');
		if( $(this).val()=='') {
			$(this).val('email');
		}
	});
	$('#f32').blur(function () {
		$(this).removeClass('uFocus');
		if( $(this).val()=='') {
			$(this).val('zip');
		}
	});
	// hide salsa signup form
	$('#block-block-3').css({ 'opacity':'0' , 'z-index':'-50' , 'top':'-20px'});
	// create main menu link for salsa signup
	$('ul.links.primary-links').append('<li class="no-bg"><a href="#block-block-3" id="nav_signup">Join Us</a></li>');
	// animation for showing/hiding salsa signup
	$('a#nav_signup')
		.toggle(function() {
			//alert('hover');
	 		$('#block-block-3').stop().animate({ top: 0, opacity: .8 }, 'fast').css("z-index", "150");
			//$('#block-block-3').show("slow");
			$('a#nav_signup').addClass('mainNavHover');
			return false;
		}, function() {
			//alert('un-hover');
			$('#block-block-3').stop().animate({ top: -20, opacity: 0 }, 'fast').css("z-index", "-50");
			//$('#block-block-3').hide("slow");
			$('a#nav_signup').removeClass('mainNavHover');
			return false;
	});
});
