$(document).ready(function() {
	var img = ""; 	
	$("img.profilepic").each(
		function()
		{
			img = $(this);
			$(this).parent().replaceWith('<div class="profilepic"><div class="inner"><img src="' + 
										 $(this).attr('src') + '" alt="' + 
										 $(this).attr('alt') + '" height="' +
										 $(this).attr('height') + '" width="' +
										 $(this).attr('width') + '"/></div></div>');
			//$(this).remove($(this).parent( ) );	
			/* need to strip parent and then adddivs for ydsf */
		}
	);	
	
	$("#post img").each(
		function()
		{
			img = $(this);
                       tag =  $(this).parent().get(0).tagName;
                       if(tag == 'A')
                       { 
                               linkstart = '<a href="' + $(this).parent().attr('href') + '" target="_blank" > '; 
                               linkend = '</a>';
                       }
                       else
                       {
                               linkstart='';
                               linkend='';
                        }
                       	$(this).parent().replaceWith('<div class="ydsf"><div class="inner">' + linkstart + '<img src="' + 
										 $(this).attr('src') + '" alt="' + 
										 $(this).attr('alt') + '" height="' +
                                                                            	 $(this).attr('height') + '" width="' +
										 $(this).attr('width') + '"/>' + linkend + '</div></div>');
			
		}
	);	
});

