$(document).ready(function() {
	//removed 20100412 brad (not using Google search any longer)
	/*if (document.getElementById('site-search-inpage')){
		document.getElementById('site-search-inpage').action = "/search/results/";
	} else {
		document.getElementById('site-search').action = "/search/results/";
	}*/
	

	$('.article table.stripe').each(function(){
		$('tbody tr:odd').addClass('alt');
	});
	
	// Autopopulate forms fields
	$('form.autopopulate').each(function(){
		var fieldLabel = $('label.structural',this).text();
		$('input.populate',this).val(fieldLabel).focus(function(){
			if (this.value == fieldLabel){
				$(this).val('');
			};
		}).blur(function(){
			if (this.value == ''){
				$(this).val(searchFieldLabel);
			};
		});
	});
	
	// FAQ List
	var urlHash = window.location.hash,
		$answer = $('.answer').hide();
	
	if (urlHash) {
		$('.answer',urlHash).slideToggle(750);
	}
	
	$('.faq-list h4 a').click(function() {
		$('.answer',this.hash).slideToggle(750);
		return false;
	});

	// Personal Calendar Export slider
	$('#cal-options').hide();
	$('#add-cal a').click(function(){
		$('#cal-options').slideToggle('normal');
		return false;
	});
	$('body').click(function(){
		$('#cal-options').slideUp('normal');
	});
});