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

function arrondis(){
	//Orange=f2942e Bleu=0091d0
	$("#main").liquidCanvas("[nico_shadow fill{color: rgba(255,255,255,0.7)}]=>roundedRect");
	$("#bas").liquidCanvas("[shadow fill{color: rgba(0,174,255,1)}]=>roundedRect");
	$(".arrondis").each(function() {arrondis_elem(this);});
}

function arrondis_elem(elem){
	//Orange=f2942e Bleu=0091d0
	var strColor=$(elem).css("background-color");
	if(!strColor)
	{
		strColor="#0091d0";
	}
	else if(strColor=="transparent")
	{
		strColor="rgba(0, 0,0, 0)";
	}
	$(elem).liquidCanvas("[shadow gradient{from:rgba(255, 255,255, 0.8); to:" + strColor + ";}] => 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));
      	}
    }
});
