$(document).ready(function(){
	$("input.name, input.reason").focus(function() {
		$(this).addClass("current-focus")
	});
	$("input.name, input.reason").blur(function() {
		$(this).removeClass("current-focus")
	});
	
/*   
   	$("#adefinitions").click(function(){
		$.scrollTo( '#doc3', 800);
		return false;
	});
   	$("#aproblem").click(function(){
		$.scrollTo( '#problem', 800);
		return false;
	});
   	$("#agetinvolved").click(function(){
		$.scrollTo( '#getinvolved', 800);
		return false;
	});
   	$("#abook").click(function(){
		$.scrollTo( '#book', 800);
		return false;
	});
   	$("#aspeakup").click(function(){
		$.scrollTo( '#speakup', 800);
		return false;
	});
   	$("#agear").click(function(){
		$.scrollTo( '#gear', 800);
		return false;
	});	
   	$("#acontact").click(function(){
		$.scrollTo( '#contact', 800);
		return false;
	});
   	$("a.up").click(function(){
		$.scrollTo( '#doc3', 800);
		return false;
	});
	
	//Abbr to footnotes
	$("#primary abbr").each(function(i) {
		var title = $(this).attr("title");
		$(this).append("<sup>"+(i+1)+"</sup>");
    	$("#footnotes").append("<p></p>");
		$("#footnotes p:last").text((i+1)+" - "+title);
    });
*/

	//Plugin to add text to an input field that disapears on focus
	jQuery.fn.inputFieldText = function(string) { 		
		this.each(function() {
			$(this).val(string);
			$(this).focus(function(){
				if ($(this).val() == string){
					$(this).val('');
				}
			});
			$(this).blur(function(){
				if ($(this).val() == '' ){
					$(this).val(string);
				}
			});	
		});
	}	

	//Plugin to add text to an textarea field that disapears on focus	
	jQuery.fn.textareaFieldText = function(string) { 		
		this.each(function() {
			$(this).html(string);
			$(this).focus(function(){
				if ($(this).html() == string){
					$(this).html('');
				}
			});
			$(this).blur(function(){
				if ($(this).html() == '' ){
					$(this).html(string);
				}
			});	
		});
	}

	$('fieldset.speak-up-form input[@name=name]').inputFieldText('Your Name');
	$('fieldset.speak-up-form input[@name=comment]').inputFieldText('Your webucation contribution');	
	$('fieldset.speak-up-form input[@name=captcha]').inputFieldText('[ Enter word in image ]');
	$('fieldset.speak-up-form input[@name=profession]').inputFieldText('What is your profession?');
	$('fieldset.speak-up-form input[@name=email]').inputFieldText('What is your email?');
  $('fieldset.speak-up-form input[@name=url]').inputFieldText('What is your website?');
	$('fieldset.speak-up-form input[@name=location]').inputFieldText('Where are you located? (City, State for geocoding)');
	//$('textarea[@name=comment]').textareaFieldText('[ Share your contributions as a webucator ]');
	//$('textarea[@name=comment]').text('[ Share your contributions as a webucator ]');
	

	// Share more information toggle
	$('.more-info').hide();
	$('a.share-more').click(function() {			
		$(this).parent().parent().find('.more-info').slideToggle();
		$(this).toggleClass('uncollapsed');
		return false;
	}); 



});
