
	//	PLUGINS AND THAT

	//	Partners list details popper-upper
	;(function($) {
		$.fn.partners_map = function() {
			var partners = $(this);

			$('a', partners).hover(
				function() {
					var target_id = $(this).attr('rel')
					var target    = $('#' + target_id)

					var offset_ul = $(this).parent().parent().offset()
					var offset_li = $(this).parent().offset()

					var left = (offset_li.left - offset_ul.left) - target.width() - 3
					var top  = (offset_li.top  - offset_ul.top)  - (target.height() / 2 + 6)

					target.css({ display: 'block', left: left, top: top, visibility: 'visible' })
				},

				function() {
					var target = $(this).attr('rel')
					$('#' + target).css({ display: 'none', visibility: 'hidden' })
				}
			)

			return this;
		}
	})(jQuery);


	//	Pyrmaid highlighter thing for the front page..
	;(function($) {
		$.fn.pyramid_hilite = function() {
			var pyramid = $(this)

			var pyramid_img = $('img', pyramid)
			var pyramid_map = $('map', pyramid)

			pyramid_img
				.attr('src', '/img/design/trans.png')
				.wrap('<div class="pyramid_js"></div>')

			$('area', pyramid_map)
				.hover(
					function() {
						var target = $(this).attr('href').split('#')[1]
						$('#' + target).css({ display: 'block', visibility: 'visible' })

						$('.pyramid_js').css('background-position', '-' + (target.split('_')[1] * 293) + 'px 0')
					},

					function() {
						var target = $(this).attr('href').split('#')[1]
						$('#' + target).css({ display: 'none', visibility: 'hidden' })

						$('.pyramid_js').css('background-position', '0 0')
					}
				)
				.click(function() { return false; })
			return this;
		}
	})(jQuery);


	;(function($) {
		$.fn.log = function(msg) {
			console.log("%s: %o", msg, this)
			return this;
		};
	})(jQuery);


	//	Plugins DONE - Get this bi'niss rollin', yo..

	$(function() {
		$('body').addClass('js')
		$('.home_pyramid').pyramid_hilite()
		$('.partners_list').partners_map()
	})
