// JavaScript Document

$(document).ready(function() {
	
	$(function(){
		var spt = $('span.mailme');
		var at = / at /;
		var dot = / dot /g;
		var addr = $(spt).text().replace(at,"@").replace(dot,".");
		$(spt).after('<a href="mailto:'+addr+'" title="Send an email">'+ addr +'</a>')
		$(spt).remove();
	});
	
	$(function(){
		$(".post img.alignleft").wrap('<div class="image_dropshadow post_img_left"></div>');
		$(".post img.alignright").wrap('<div class="image_dropshadow post_img_right"></div>');
		$("#comments img.avatar").wrap('<div class="image_dropshadow"></div>');
		$("#work_list img").wrap('<div class="image_dropshadow"></div>');
		
		var img_width = $(".image_dropshadow img").attr("width") + 8;
		var img_height = $(".image_dropshodow img").attr("height") + 8;

		$('.image_dropshadow').each(function() {
			// 'this' is a DOM element
			this.width = img_width;
			this.height = img_height;
		});
	});
	
	$(".image_dropshadow").dropShadow();
	
	$(".says").remove();

	/*
	$(function(){
		
		//topleft
		$(".post img").wrap('<div class="imgframe_topleft"></div>');
		$("#work_list img").wrap('<div class="imgframe_topleft"></div>');
		//bottomright
		$(".imgframe_topleft").wrap('<div class="imgframe_bottomright"></div>');
		//wrapper
		$(".imgframe_bottomright").wrap('<div class="imgframe_wrapper"></div>');
		
		$(".post img").before('<div class="imgframe_topright"></div>');
		$(".post img").after('<div class="imgframe_bottomleft"></div>');
		$("#work_list img").before('<div class="imgframe_topright"></div>');
		$("#work_list img").after('<div class="imgframe_bottomleft"></div>');

		var img_width = $(".imgframe_wrapper img").attr("width") + 16;
		var img_height = $(".imgframe_wrapper img").attr("height") + 16;

		$('.imgframe_wrapper').each(function() {
			// 'this' is a DOM element
			this.width = img_width;
			this.height = img_height;
		});

	});
	*/

});

