﻿/*GESTION DES CADRES ARRONDIS*/
$(window).load(function() {arrondis();});

function arrondis(){
	//$("#main").liquidCanvas("[nico_shadow fill{color: rgba(189,44,22,0.8)}]=>roundedRect");
	$(".arrondis").each(function() {arrondis_elem(this);});
}

function arrondis_elem(elem){
	$(elem).liquidCanvas("[fill{color: rgba(189,44,22,0.9)}]=>roundedRect{radius:5}");
}


 $.registerLiquidCanvasPlugin({
	name: "nico_shadow",
    defaultOpts: { width:10, color:'#000',shift: 2},
    paint: function(area) {
    	var sw = this.opts.width;
	    area.ctx.strokeStyle  = this.opts.color; 
    	area.ctx.lineWidth = 1;
	  	for (var s = 0; s < sw; ++s) {
			area.ctx.globalAlpha = 1.0 / (sw-s);
			area.ctx.stroke();
      		this.action.shrink(area, 0.5);
			this.action.paint(area);
      		area.ctx.globalAlpha = 1;
      		area.ctx.translate(0, -this.opts.shift/(sw-s));
      	}
    }
});
