// let's keep this in a separate files this time.
// var name = "#column";
// var menuYloc = null;
$(document).ready(function() {
	// menuYloc = parseInt($(name).css("top").substring(0,$(name).css("top").indexOf("px")))
	// $(window).scroll(function () { 
	// 	offset = menuYloc+$(document).scrollTop()+"px";
	// 	$(name).animate({top:offset},{duration:500,queue:false});
	// });
	swapValues = [];
    $(".swap_value").each(function(i){
        swapValues[i] = $(this).val();
        $(this).focus(function(){
            if ($(this).val() == swapValues[i]) {$(this).val("");}
        }).blur(function(){
            if ($.trim($(this).val()) == "") {$(this).val(swapValues[i]);}
        });
    });		
	$('a.external, a.ext').click(function() {
    	window.open(this.href);
    	return false;
	 });
	 $('h3.toggle').click(function() {
	 	$(this).toggleClass('h3on')
	 	$(this).next('div').slideToggle();
	 	return false;
	 });
	$.localScroll.hash({
		queue:true,
		duration:750
	});	 $.localScroll({
	 	queue:true,
	 	duration:500,
	 	hash:true
	 });
	// $('#leaders').accordion({
	// 	header: 'h3',
	// 	selectedClass: 'h3on',
	// 	autoheight: false,
	// 	active: false		
	// });
	$('#message').innerfade({
		animationtype: 'fade',
		type: 'random_start',
		speed: 700,
		timeout: 7000
	});
	var spt = $('.mailme');
	var at = / at /;
	var dot = / dot /g;
	var addr = $(spt).text().replace(at,"@").replace(dot,".");
	$(spt).after('<a href="mailto:'+addr+'" title="Send an email">'+ addr +'</a>')
		.hover(function(){window.status="Send a letter!";}, function(){window.status="";});
	$(spt).remove();
});
