	$(function(){
		$('.wp-caption-dd').addClass('tooltip');
	});
	this.tooltip = function(){
		$('.tooltip, .wp-caption, .flipperhanded').hover(function(e){
			if($(this).hasClass("flipperhanded")){
				xOffset = -20;
				yOffset = -200;
			}
			else{
				xOffset = 150;
				yOffset = 30;
			}
			the_title= $(this).attr('title');
			the_alt= $(this).children('img').attr('title');
			if(the_title !== undefined){
				tooltip_description = '<p>'+the_title+'</p>';
			}
			else{
				tooltip_description = '';
			}
			//$("body").prepend('<div id="tooltip">Loading...</div>');
			$("body").prepend('<div id="tooltip"><div id="gallery_loader"></div><img style="display:none" src="'+$(this).attr('href')+'">'+tooltip_description+'</div>');
			$('#tooltip img').load(function(){
				$('#gallery_loader').remove();
				$('#tooltip img').fadeIn();
				$('#tooltip').css({width:$('#tooltip img').width()+'px'});
			});
			$(this).attr('title','');
			$(this).children('img').attr('title','');
			$("#tooltip")
				.css("top",(e.pageY - xOffset) + "px")
				.css("left",(e.pageX + yOffset) + "px")
				.fadeIn("fast");
	    },
		function(){
			$("#tooltip").remove();
			$(this).attr('title',the_title);
			$(this).children('img').attr('title',the_alt);
	    }).click(function(){
			return false;
		}).mousemove(function(e){
			$("#tooltip")
				.css("top",(e.pageY - xOffset) + "px")
				.css("left",(e.pageX + yOffset) + "px");
		});
	};
	$(function(){
		//$('')
		tooltip();
		$('.tooltip img').each(function(){
			if($(this).attr('width') >= $(this).attr('height')){
				$(this).css('width','100px').css('height','auto');
			}
			else{
				$(this).css('height','100px').css('width','auto');
			}
		});
		$('#nav a[title*=Your Account]').parent().remove().children('a').clone()
		.prependTo('#sidebar').addClass('new-your-account').text('My Account »');
	});