$(document).ready(function() {
		$(".spip-admin-float").css({right:"auto", left:"20px", top:"4px"});
		$("a.spip-admin-boutons").css({fontWeight:"normal",fontFamily:"arial,helvetica,sans-serif"});
	/* Retaillage des images trop grandes... surtout avec FCKeditor */
		var h;
		var w = 650 ;
		var href = "";
		if ($("#edito").is("*")) w = 520;
		$("object").each(function (i) {
			$(this).append("<param name='wmode' value='transparent' />");
			if ($(this).attr("width") > w) {
				h = Math.floor($(this).attr("height") * w / $(this).attr("width"));
				$(this).attr("height", h) ;
				$(this).attr("width", w) ;
				$(this).css({height: h+"px", width: w+"px"});
				}
			});
		$("img[@class!='spip_logos'][@id!='bandeau_discip']").each(function (i) { 
			if ($(this).attr("width") > w) {
				h = Math.floor($(this).attr("height") * w / $(this).attr("width"));
				$(this).attr("height", h) ;
				$(this).attr("width", w) ;
				$(this).css({height: h+"px", width: w+"px"});
				}
			});
		$("img.pdf").parent().attr("target", "_blank");
		$("a.spip_out").each(function (i) {
			href = $(this).attr("href");
			$(this).after("<span class='invisible_link'>&nbsp; ["+href+"]<\/span>");
			});
	/* Les elements de "spip_documents"... */ 
		$(".spip_documents").each(function(i) {
			var w_min = 0;
			var w_obj = 0;
			var player = "";
			var w_sdt = $(this).find(".spip_doc_titre").width() ;
			var url_img = $(this).find("img").attr("src");
			var w_img = $(this).find("img").width();
			if (url_img != null && (url_img.match(/\/vignettes\//)))
				w_min = 180;
			if ($(this).find("object").width() != null) {
				w_obj = $(this).find("object").attr('width')*1;
				player =  $(this).find("object").attr('data');
				if (!player) player = "";
				}
			if (w_sdt != null && w_sdt > w_min) w_min = w_sdt;
			if (w_img != null && w_img > w_min) w_min = w_img;
			if (w_obj != 0 && w_obj > w_min) w_min = w_obj;
			if (w_min > w) w_min = w;
			if (player.match(/player_flv_maxi.swf/)) w_min = w_obj + 4 ;
			$(this).find(".spip_doc_titre").css("width", w_min + "px");
			$(this).find(".spip_doc_descriptif").css("width", w_min + "px");
			if (url_img != null && (url_img.match(/\/vignettes\//))) {
				$(this).find(".spip_doc_titre").css("marginLeft", "55px");
				$(this).find(".spip_doc_descriptif").css("marginLeft", "55px");
				$(this).find(".spip_doc_titre").css("clear", "none");
				$(this).css("width", w_min + 60 + "px");
				}
			else {
				$(this).css("width", w_min + 10 + "px");
				$(this).find("img").css("margin", "auto");
				}
			});
		$(".spip_documents").append("<br class='nettoyeur' \/>");
	/* Les liens du menu sur deux lignes... */
		var h_item_max = pad = 0 ;
		var haut_it = new Array();
		$("li.item").each(function(i) {
    			haut_it[i] = $(this).height();
    			if (haut_it[i] >= h_item_max) 
        			h_item_max = haut_it[i] ; 
    			}) ;
		$("li.item").each(function(i) {
			if (haut_it[i] < h_item_max) {
				pad = (h_item_max-haut_it[i]+10)/2  ;
				$(this).find("a").css({paddingTop: pad + "px", paddingBottom: pad + "px"});
        			}
			}) ;
		});
