(function($){
	$.fn.mapToDivs = function(){
		
		return this.find('area').each(function(){
			var $div   = $("<div></div>"), $this = $(this);
			    coords = $this.attr('coords').split(','),
			    url    = $this.attr('href');

			$div.css({
				position: 'absolute',
				background: 'white',
				opacity: 0.0,
				left: parseInt(coords[0]),
				top: parseInt(coords[1]),
				width: parseInt(coords[2]) - parseInt(coords[0]),
				height: parseInt(coords[3]) - parseInt(coords[1]),
				cursor: 'pointer'
			}).html('&nbsp;').data('url', url).prependTo($("#portfolio")).click(function(){
				window.location = $(this).data('url'); // Manually change the page
			}).bind('mouseenter', function(){
				$(this).stop(true, false).animate({opacity:0.3}, 150).animate({opacity: 0.0}, 450);
			});

		}).end();
	};
})(jQuery);