// JavaScript Document

/*
    Based on this article:      
    http://www.html-advisor.com/javascript/hide-email-with-javascript-jquery/

    Example markup:
    ---------------
    
    <span class="mailme" title="Send me a letter!">me at mydomain dot com</span>

    Example code:
	-------------
	
	// Replaces all the matching elements with a <a href="mailto:..> tag.
		
	$('span.mailme').mailme();
    
*/
    
jQuery.fn.mailme = function() {
    var at = / at /;
    var dot = / dot /g;
    this.each( function() {
        var addr = jQuery(this).text().replace(at,"@").replace(dot,".");
        var title = jQuery(this).attr('title')
        $(this)
            .after('<a href="mailto:'+addr+'" title="'+title+'">'+ addr +'</a>')
            .remove();
    });
};


$(document).ready(function() {
	$('span.mailme').mailme();/* Set up the mailer */
});

/*$(document).ready(function() {
	$(".answer").hide();
	$(".question").click(function() {
		$(this).toggleClass("active").next(".answer").slideToggle("fast");
		return false;
	});
});*/

$(document).ready(function() {
	$(".answer").hide();
	//On Click
	$(".question").click(function(){
		if( $(this).next().is(':hidden') ) { //If immediate next container is closed...
			$(".question").removeClass('active').next().slideUp("fast"); //Remove all "active" state and slide up the immediate next container
			$(this).toggleClass('active').next().slideDown("fast"); //Add "active" state to clicked trigger and slide down the immediate next container
		}
		return false; //Prevent the browser jump to the link anchor
	});
});


