﻿/*
 * jQuery round plugin
 * 
 * add extra markup for rounded corners
 *
 *  example css:
 *
 * .clsName {	background: url(../images/clsName_tl.png) no-repeat top left; }
 * .clsName .top { background: url(../images/clsName_tr.png) no-repeat top right; }
 * .clsName .bottom { background: url(../images/clsName_bl.png) no-repeat bottom left; }
 * .clsName .bottom div {	background: url(../images/clsName_br.png) no-repeat bottom right; }
 * .clsName .content { background: url(../images/clsName_r.png) top right repeat-y; padding: 0 15px; width: auto; }
 * .clsName .top, .clsName .top div,
 * .clsName .bottom, .clsName .bottom div { width: 100%; height: 15px; font-size: 1px; }
 *
 * rounded corner images can be generated from
 * http://www.roundedcornr.com/
 *
  * @author Erwin (erwin@olr.com)
 */

(function($) {
    $.fn.round = function(clsName) {
        return $(this).each(function(){
            $(this).addClass('content')
                   .wrap('<div class="'+clsName+'"></div>')
                   .before('<div class="top"><div></div></div>')
                   .after('<div class="bottom"><div></div></div>');
        });
    };
})(jQuery);
