Index: branches/2.1/themes/default/js/rating.js
===================================================================
--- branches/2.1/themes/default/js/rating.js	(revision 6575)
+++ branches/2.1/themes/default/js/rating.js	(revision 6576)
@@ -36,14 +36,7 @@
 			rateButton.parentNode.removeChild(rateButton.previousSibling);
 
-		if(window.addEventListener){ // Mozilla, Netscape, Firefox
-			rateButton.addEventListener("click", updateRating, false );
-			rateButton.addEventListener("mouseout", resetRatingStarDisplay, false );
-			rateButton.addEventListener("mouseover", updateRatingStarDisplayEvt, false );
-		}
-		else if(window.attachEvent) { // IE
-			rateButton.attachEvent("onclick", updateRating);
-			rateButton.attachEvent("onmouseout", resetRatingStarDisplay);
-			rateButton.attachEvent("onmouseover", updateRatingStarDisplayEvt);
-		}
+		pwgAddEventListener(rateButton, "click", updateRating);
+		pwgAddEventListener(rateButton, "mouseout", resetRatingStarDisplay);
+		pwgAddEventListener(rateButton, "mouseover", updateRatingStarDisplayEvt);
 	}
 	resetRatingStarDisplay();
@@ -89,6 +82,6 @@
 				{
 					var t = gRatingOptions.ratingSummaryText;
-					var args =[result.average, result.count, result.stdev], idx = 0, rexp = new RegExp( /%\.?\d*[sdf]/ );
-					_xxx = t.match( rexp );
+					var args =[result.average, result.count], idx = 0, rexp = new RegExp( /%\.?\d*[sdf]/ );
+					//_xxx = t.match( rexp );
 					while (idx<args.length) t=t.replace(rexp, args[idx++]);
 					gRatingOptions.ratingSummaryElement.innerHTML = t;
Index: branches/2.1/themes/default/js/scripts.js
===================================================================
--- branches/2.1/themes/default/js/scripts.js	(revision 6575)
+++ branches/2.1/themes/default/js/scripts.js	(revision 6576)
@@ -1,13 +1,9 @@
 function SelectAll( formulaire )
 {
-var len = formulaire.elements.length;
-var i=0;
-for( i = 0; i < len; i++)
+var elts = formulaire.elements;
+for(var i=0; i <elts.length; i++)
 {
-	if ( formulaire.elements[i].type=='checkbox'
-		&& formulaire.elements[i].name != 'copie')
-	{
-		formulaire.elements[i].checked = true;
-	}
+	if (elts[i].type=='checkbox')
+		elts[i].checked = true;
 }
 }
@@ -15,13 +11,9 @@
 function DeselectAll( formulaire )
 {
-var len = formulaire.elements.length;
-var i=0;
-for( i = 0; i < len; i++)
+var elts = formulaire.elements;
+for(var i=0; i <elts.length; i++)
 {
-	if ( formulaire.elements[i].type=='checkbox'
-		&& formulaire.elements[i].name != 'copie')
-	{
-	formulaire.elements[i].checked = false;
-	}
+	if (elts[i].type=='checkbox')
+		elts[i].checked = false;
 }
 }
@@ -29,13 +21,9 @@
 function Inverser( formulaire )
 {
-var len = formulaire.elements.length;
-var i=0;
-for( i=0; i<len; i++)
+var elts = formulaire.elements;
+for(var i=0; i <elts.length; i++)
 {
-	if ( formulaire.elements[i].type=='checkbox'
-		&& formulaire.elements[i].name != 'copie')
-	{
-	formulaire.elements[i].checked = !formulaire.elements[i].checked;
-	}
+	if (elts[i].type=='checkbox')
+		elts[i].checked = !elts[i].checked;
 }
 }
@@ -47,19 +35,12 @@
 	if (img.complete)
 	{
-		var width=img.width +40;
-		var height=img.height +40;
+		var width=img.width+40, height=img.height+40;
 	}
 	else
 	{
-		var width=640;
-		var height=480;
-		img.onload = resizeWindowToFit;
+		var width=640, height=480;
+		img.onload = function () { newWin.resizeTo( img.width+50, img.height+100); };
 	}
 	newWin = window.open(theURL,winName,features+',left=2,top=1,width=' + width + ',height=' + height);
-}
-
-function resizeWindowToFit()
-{
-	newWin.resizeTo( img.width+50, img.height+100);
 }
 
@@ -71,13 +52,10 @@
 }
 
-
-
 Function.prototype.pwgBind = function() {
-	var __method = this, object = arguments[0], args = new Array();
-	for (var i=1; i<arguments.length; i++)
-		args[i-1] = arguments[i];
-	return function() { return __method.apply(object, args); }
+		var __method = this, object = arguments[0], args = Array.prototype.slice.call(arguments,1);
+		return function() {
+				return __method.apply(object, args.concat(arguments) );
+		}
 }
-
 function PwgWS(urlRoot)
 {
@@ -145,6 +123,6 @@
 	onStateChange: function() {
 		var readyState = this.transport.readyState;
-		if (readyState == 4)
-			this.respondToReadyState(this.transport.readyState);
+		if (readyState==4)
+			this.respondToReadyState(readyState);
 	},
 
@@ -187,2 +165,10 @@
 	options: {}
 }
+
+function pwgAddEventListener(elem, evt, fn)
+{
+	if (window.attachEvent)
+		elem.attachEvent('on'+evt, fn);
+	else
+		elem.addEventListener(evt, fn, false);
+}
