/*

	JQuery Curvy Corners Helper by Dennis Hoppe
	
	Original Library from:
	http://blue-anvil.com
	http://code.google.com/p/jquerycurvycorners/
  
  This program is free software: you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation, either version 3 of the License, or
	(at your option) any later version.
	
	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.
	
	You should have received a copy of the GNU General Public License
	along with this program.  If not, see <http://www.gnu.org/licenses/>.

*/
(function($){ $.fn.round_edges = function(topleft, topright, bottomright, bottomleft){
  // check the parameters
  // if the radius is zero we will give the curvy corner function (bool) false
  if (topleft >= 1)
    topleft = { radius: topleft };
  else
    topleft = false;
    
  if (topright >= 1)
    topright = { radius: topright };
  else
    topright = false;
    
  if (bottomright >= 1)
    bottomright = { radius: bottomright };
  else
    bottomright = false;
    
  if (bottomleft >= 1)
    bottomleft = { radius: bottomleft };
  else
    bottomleft = false;
    
  // Call the corner function
  return this.each(function(){
    var $this = $(this);
    $this.corner({ tl: topleft,
                   tr: topright,
                   br: bottomright,
                   bl: bottomleft,
                   antiAlias: true,
                   autoPad: true,
                   validTags: ["div"]
                 });
  });
};})(jQuery);