/*

Copyright (c) 2009 James Wilding.

*/

// Disable mailto links and show an explanatory message when the links are clicked.
function disableEmailLinks() {
	var mailto = /^mailto:/;
	
	$('a[href]').filter(function() { return mailto.test($(this).attr('href')); }).click(function() {
		alert('Email links are disabled in our portfolio.'); 
		return false;
	});
}

// Determine deployment environment.
function env() {
	switch(window.location.host) {
	case '127.0.0.1':
		return 'development'; 
		break;
	case 'localhost':
		return 'development'; 
		break;
	case '0.0.0.0':
		return 'development'; 
		break;		
	case 'staging.sevenoakdesign.co.uk':
		return 'staging'; 
		break;
	default:
		return 'production';
	}
}