
function svgradient(start,end,round){if(round!=undefined){round.replace('px','');var r='rx="'+round+'" ry="'+round+'"';}
else{var r='';}
var svg='<?xml version="1.0" ?><svg xmlns="http://www.w3.org/2000/svg"><defs><linearGradient id="gr" x1="0%" y1="0%" x2="0%" y2="100%"><stop offset="0%" style="stop-color:'+start+'"/><stop offset="100%" style="stop-color:'+end+'"/></linearGradient></defs><rect x="0" y="0" '+r+' width="100%" height="100%" style="fill:url(#gr)"/></svg>';if($.base64Encode){return'data:image/svg+xml;base64,'+$.base64Encode(svg);}
else{return'data:image/svg+xml,'+escape(svg);}}
function webgr(obj,start,end,height,padding){he=parseInt(height.replace('px',''))+parseInt(padding.replace('px',''))*2;return obj.css({'background':'url("http://webgradients.appspot.com/make?width=1&height='+he+'&start='+start.replace('#','')+'&end='+end.replace('#','')+'") repeat-x'});}
(function($){$.fn.extend({jacg:function(options){var defaults={radius:'15px',start:'#dddddd',end:'#cccccc',}
var o=$.extend(defaults,options);return this.each(function()
{obj=$(this).css({'border-radius':o.radius});if($.browser.webkit==true)
{obj.css({'-webkit-border-radius':o.radius,'background':'-webkit-gradient(linear, left top, left bottom, from('+o.start+'), to('+o.end+'))'});}
else if($.browser.mozilla==true)
{obj.css({'-moz-border-radius':o.radius,'background':'-moz-linear-gradient(top, '+o.start+', '+o.end+')'});if(parseInt($.browser.version.replace('.','').replace('.',''))<192)
{webgr(obj,o.start,o.end,obj.css('height'),obj.css('padding-bottom'));}}
else if($.browser.opera==true)
{if($.browser.version>=10.50)
{obj.css({'background':'url("'+svgradient(o.start,o.end)+'")'});}
else
{obj.css({'background':'url("'+svgradient(o.start,o.end,o.radius)+'")'});}}
else if($.browser.msie==true)
{if($.browser.version>=9.0)
{obj.css({'background':'url("'+svgradient(o.start,o.end)+'")'});}
else
{$(this).gradient({topcolor:o.start,bottomcolor:o.end,horizontal:false});if(parseInt(o.radius.replace('px',''))>0)
{$(this).corner(o.radius);}}}});}});})(jQuery);
