(function($) {
    
    $.fn.bullNose = function(options){
        
        // default configuration properties
        var defaults = {
            pathToImages:            '/images/',
            positionCornerAbsolute:    true,
            topLeftImg:                'corner-top-left.gif',
            topRightImg:            'corner-top-right.gif',
            bottomLeftImg:            'corner-bottom-left.gif',
            bottomRightImg:            'corner-bottom-right.gif',
            imageWidth:                '10',
            imageHeight:            '10',
            imageIdPrefix:            'cornerImage',
            imageClass:                'cornerImage'
        };
        
        var options = $.extend(defaults, options);  
        
        this.each(function() {
            
            // Build the string to insert the images
            var stringImages = '<img src="' + options.pathToImages + options.topLeftImg + '" width="' + options.imageWidth + '" height="' + options.imageHeight + '" alt="" class="' + options.imageClass + '" id="' + options.imageIdPrefix + 'TopLeft" />';
            stringImages += '<img src="' + options.pathToImages + options.topRightImg + '" width="' + options.imageWidth + '" height="' + options.imageHeight + '" alt="" class="' + options.imageClass + '" id="' + options.imageIdPrefix + 'TopRight" />';
            stringImages += '<img src="' + options.pathToImages + options.bottomLeftImg + '" width="' + options.imageWidth + '" height="' + options.imageHeight + '" alt="" class="' + options.imageClass + '" id="' + options.imageIdPrefix + 'BottomLeft" />';
            stringImages += '<img src="' + options.pathToImages + options.bottomRightImg + '" width="' + options.imageWidth + '" height="' + options.imageHeight + '" alt="" class="' + options.imageClass + '" id="' + options.imageIdPrefix + 'BottomRight" />';
            
            // Append the images to the container
            $(this).append(stringImages)
            
            // if positionCornerAbsolute is set to true, position the images using jQuery
            if (options.positionCornerAbsolute) {
                $(this).css('position','relative');
                
                $('.' + options.imageClass).css('position','absolute');
                
                $('#' + options.imageIdPrefix + 'TopLeft').css('left','-1px');
                $('#' + options.imageIdPrefix + 'TopLeft').css('top','-1px');
                
                $('#' + options.imageIdPrefix + 'TopRight').css('right','-1px');
                $('#' + options.imageIdPrefix + 'TopRight').css('top','-1px');
                
                $('#' + options.imageIdPrefix + 'BottomLeft').css('left','-1px');
                $('#' + options.imageIdPrefix + 'BottomLeft').css('bottom','-1px');
                
                $('#' + options.imageIdPrefix + 'BottomRight').css('right','-1px');
                $('#' + options.imageIdPrefix + 'BottomRight').css('bottom','-1px');
            }
            
        });
        
    };

})(jQuery);