var larg = new Array();
var haut = new Array();
var img = new Array();
var imgbase = new Array();
 
  $(document).ready(function(){

	$(".ombre").each(function(i){

		imgbase[i] = $(this);
		img[i] = new Image();
		img[i].onload = function(){

			larg[i] = img[i].width+20;
			haut[i] = img[i].height+5+(img[i].height/10);
			if(larg[i]>21&&larg[i]!=353&&larg[i]!=undefined&&haut[i]>6&&haut[i]!=353&&haut[i]!=undefined){
				if(jQuery.browser['msie']==true && jQuery.browser['version']=='6.0') {
					imgbase[i].replaceWith("<div style=\"position:relative;cursor:pointer;bottom:2px;margin:auto;height:"+haut[i]+"px;width:"+larg[i]+"px\"><div style=\"position:absolute;height:"+haut[i]+"px;width:"+larg[i]+"px; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='/css/ombre.png',sizingMethod='scale'); top:0px; left:0px\"><img src=\""+img[i].src+"\" style=\"position:absolute; top:2px; left:10px\" /></div></div>");
				}
				else{
					imgbase[i].replaceWith("<div style=\"position:relative;cursor:pointer;bottom:2px;margin:auto;height:"+haut[i]+"px;width:"+larg[i]+"px\"><img style=\"position:absolute; top:0px; left:0px\" src=\"/css/ombre.png\" alt=\"\" width="+larg[i]+" height="+haut[i]+" /><img src=\""+img[i].src+"\" style=\"position:absolute; top:2px; left:10px\" /></div>");
				}
			}
		};
		/*IMPORTANT : METTRE LE SRC APRES LE ONLOAD*/
		img[i].src = this.src;
		
		});
  });
