
//	Define functions in the Des object

	var Des = Des || {};

	Des.css_on = function() {
		//	FOR THIS TO WORK make sure the following CSS is being referenced somewhere:
		//	.css_test { display: none; height: 1px; width: 1px; }

		$('<div class="css_test"></div>').appendTo('body');
		result = $('.css_test').width() > 0;
		$('.css_test').remove();
		return result;
	}

	Des.print_mode = function() {
		//	FOR THIS TO WORK make sure the following CSS is being referenced somewhere:
		//	.print_test { display: none; height: 1px; width: 1px; }

		$('<div class="print_test"></div>').appendTo('body');
		result = $('.print_test').width() > 0;
		$('.print_test').remove();
		return result;
	}



//	Functions are DONE
	$(function() {

		$('body').addClass('js');

		$('.ligs_map').mappr()

	});


//
//	Put your damn plugins here
//

//	Map
	;(function($) {
		$.fn.mappr = function() {

			map = $(this)

			ligs_pos = { start: 0, basingstoke: 490, eastleigh: 980, winchester: 1470, havant: 1960, forest: 2450 };

			map_src = '/img/design/map_js.png';

			map.css('background-image', 'url(' + map_src + ')')

			$('<img />')
				.attr('src', map_src)
				.load(function() {
					$('img', map)
						.attr('src', '/img/design/trans.png')
						.css('background-image', 'url(' + map_src + ')')

					$('area', map).hover(
						function() { map_highlight($(this).attr('class')) },
						function() { map_highlight('start') }
					)

					$('.lig_sub_nav > li > a').hover(
						function() { map_highlight($(this).parent().attr('id')) },
						function() { map_highlight('start') }
					)

					map_highlight('start')
				})
		}

		function map_highlight(lig) {
			$('img', map).css({ backgroundPosition : '-' + ligs_pos[lig]+'px top'})

			$('.lig_sub_nav > li > a').removeClass('hover')
			$('.lig_sub_nav li#' + lig + ' > a').addClass('hover')
		}
	})(jQuery);

//	Log
	;(function($){$.fn.log=function(message){console.log("%s: %o",message,this);return this}})(jQuery);

