$(document).ready(function()
{
	
	spamprooflinks(); 
	setForumLink();
	
});



function setForumLink()
{
	$('#forumlink').click(function(evt)
			{
				evt.preventDefault(); 
				
				
				showModal($('#comingsoon').click(function(){hideModal($(this));}));
				
				
			}); 

}





function showModal(jqtarget)
{
	$('#modaloverlay').fadeIn(200, function()
			{
				jqtarget.show().focus();
			}); 
}

function hideModal(jqtarget)
{
	$(jqtarget).hide(); 
	$('#modaloverlay').fadeOut(200); 
	
}


function spamprooflinks()
{
	
	
	    $('a[href^=mailto:]').each(function() {
	        var link = $(this).attr('href');
	        var matches = link.match(/^mailto:(.*)-at-(.*)-dot-(.*)$$/);
	        //Flip the data around and change the href of the element.
	        var email = matches[1]+'@'+matches[2]+'.'+matches[3];
	        $(this).attr('href', 'mailto:'+email).text(email);
	    
	});
	
}
