﻿(function($) {

    $.fn.AppendTag = function(tag) {
        ///	<summary>
        ///		Appends a tag to the selected objects and returns the new objects
        ///	</summary>
        ///	<param name="tag" type="String">
        ///		Tag to insert, eg. "div"
        ///	</param>
        ///	<returns type="jQuery" />
        this.each(function() {
            $(this).append('<' + tag + '></' + tag + '>');

        });
        return this.children(":last-child");
    };

    $.fn.AddTagAfter = function(tag) {
        this.each(function() {
            $(this).after('<' + tag + '></' + tag + '>');
        });
        return this.next();
    };

})(jQuery);
