diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php
index 38e8ab24bb1243825dda98930721d213a1289952..ba697538de76c21962b52f68a0936b191f2115f7 100644
--- a/htdocs/comm/action/index.php
+++ b/htdocs/comm/action/index.php
@@ -1038,7 +1038,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
                     		$numicals[dol_string_nospecial($event->icalname)]++;
                     	}
                     	$color=$event->icalcolor;
-                    	$cssclass=(! empty($event->icalname)?'family_'.dol_string_nospecial($event->icalname):'family_other');
+                    	$cssclass=(! empty($event->icalname)?'family_ext'.md5($event->icalname):'family_other');
                     }
                     else if ($event->type_code == 'BIRTHDAY')  { $numbirthday++; $colorindex=2; $cssclass='family_birthday'; }
                     else { $numother++; $cssclass='family_other'; }
diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php
index 5bd0bc5ee95efa485ee06efcc89089c2d8e03c09..e4885245675d60be126c5c3ae6d37fc5e7e20460 100644
--- a/htdocs/core/lib/agenda.lib.php
+++ b/htdocs/core/lib/agenda.lib.php
@@ -130,7 +130,6 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh
 		print '<td align="center" valign="middle" class="nowrap">';
 		print '<script type="text/javascript">' . "\n";
 		print 'jQuery(document).ready(function () {' . "\n";
-		print 'jQuery("#check_mytasks").click(function() { jQuery(".family_mytasks").toggle(); jQuery(".family_other").toggle(); });' . "\n";
 		print 'jQuery("#check_birthday").click(function() { jQuery(".family_birthday").toggle(); });' . "\n";
 		print 'jQuery(".family_birthday").toggle();' . "\n";
 		print '});' . "\n";
@@ -141,28 +140,23 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh
 			if (count($showextcals) > 0)
 			{
 				print '<tr><td>';
-				//jQuery Learning "How do I select an element by an ID that has characters used in CSS notation?"
-				//http://learn.jquery.com/using-jquery-core/faq/how-do-i-select-an-element-by-an-id-that-has-characters-used-in-css-notation/
 				print '<script type="text/javascript">
-					function jq( myid ) {
-						return myid.replace( /(:|\.|\[|\]|,|@)/g, "\\\\$1" );
-					}
 					jQuery(document).ready(function () {
 
 						jQuery("form.listactionsfilter input[name^=\"check_\"]").click(function() {
 							var name = $(this).attr("name");
 
-							jQuery(".family_" + jq(name.replace("check_", ""))).toggle();
+							jQuery(".family_" + name.replace("check_", "")).toggle();
 						});
 				    });
 				</script>';
 				print '<input type="checkbox" id="check_mytasks" name="check_mytasks" checked="true" disabled="disabled"> ' . $langs->trans("LocalAgenda") . '</td></tr>';
 				foreach ($showextcals as $val)
 				{
-					$htmlname = dol_string_nospecial($val['name']);
+					$htmlname = md5($val['name']);
 
 					print '<tr><td>';
-					print '<input type="checkbox" id="check_' . $htmlname . '" name="check_' . $htmlname . '" checked="true"> ' . $val ['name'];
+					print '<input type="checkbox" id="check_' . $htmlname . '" name="check_ext' . $htmlname . '" checked="true"> ' . $val ['name'];
 					print '</td></tr>';
 				}
 			}