
	function church_map() {
		var map_src = '/img/design/map_js.png';

		$('<img />')
			.attr('src', map_src)
			.load(function() {
				$('.filter_map img')
					.attr('src', '/img/design/trans.png')
					.css({ backgroundImage : 'url(' + map_src + ')' })

				$('map#regions area').hover(
					function() { map_highlight($(this).attr('class')) },
					function() { map_highlight(false) }
				)
			})
	}

	function map_highlight(region) {
		switch (region) {

			//	Archdeaconry of Cleveland
			case 'arch-cleveland'		: bg_pos_x = 580;	break;
				case 'middlesbrough'	: bg_pos_x = 1160;	break;
				case 'guisborough'		: bg_pos_x = 1740;	break;
				case 'stokesley'		: bg_pos_x = 2320;	break;
				case 'whitby'			: bg_pos_x = 2900;	break;
				case 'mowbray'			: bg_pos_x = 3480;	break;
				case 'north-ryedale'	: bg_pos_x = 4060;	break;

			//	Archdeaconry of York
			case 'arch-york'			: bg_pos_x = 4640;	break;
				case 'easingwold'		: bg_pos_x = 5220;	break;
				case 'south-ryedale'	: bg_pos_x = 5800;	break;
				case 'york'				: bg_pos_x = 6380;	break;
				case 'new-ainsty'		: bg_pos_x = 6960;	break;
				case 'derwent'			: bg_pos_x = 7540;	break;
				case 'south-wold'		: bg_pos_x = 8120;	break;
				case 'selby'			: bg_pos_x = 8700;	break;

			//	Archdeaconry of The East Riding
			case 'arch-riding'			: bg_pos_x = 9280;	break;
				case 'scarborough'		: bg_pos_x = 9860;	break;
				case 'bridlington'		: bg_pos_x = 10440;	break;
				case 'harthill'			: bg_pos_x = 11020;	break;
				case 'north-holderness'	: bg_pos_x = 11600;	break;
				case 'beverly'			: bg_pos_x = 12180;	break;
				case 'howden'			: bg_pos_x = 12760;	break;
				case 'hull'				: bg_pos_x = 13340;	break;
				case 'south-holderness'	: bg_pos_x = 13920;	break;

			default : bg_pos_x = 0;

		}

		$('.filter_map img').css({ backgroundPosition : '-' + bg_pos_x + 'px 0'});
	}



	$(function() {

		$('body').addClass('js');

		$.localScroll({ hash : true });

		$('span.des_email').desEmail();

		if ($('.churches_list')[0]) $('.churches_list a').attr('target', '_blank');

		if ($('.filter_map')[0]) church_map();

		$('ul.multi_images a').colorbox({ transition: 'elastic', rel: 'colorbox', speed: 250, opacity: 0.5 });

	});


