Index: ajax.php
===================================================================
--- ajax.php	(revision 1489)
+++ ajax.php	(working copy)
@@ -479,7 +479,7 @@
     _ces(id);
 }
 
-function _es(id, state) {
+function _es(id, cid, state) {
 	if (document.prevState[id] != null) {
 	   // if we click the edit icon while editing cancel the edit
 	   _ces(id);
@@ -500,7 +500,7 @@
 	onCancel = '<?php echo  rss_plugin_hook("rss.plugins.ajax.admindlg.oncancel",""); ?>'.replace(/_ID_/g,id);
 	extraCode = '<?php echo  rss_plugin_hook("rss.plugins.ajax.admindlg",""); ?>'.replace(/_ID_/g,id);
 	
-  onOk += '_ses('+id+'); return false;';
+  onOk += '_ses('+id+','+cid+'); return false;';
     if (!onCancel) {
         onCancel = '_ces('+id+'); return false;';
     }
@@ -549,7 +549,7 @@
 
 }
 
-function _ses(id) {
+function _ses(id,cid) {
     s = 0;
     if ((sfu = document.getElementById('sf'+id+'u')) && sfu.checked) {
       s += <?php echo  RSS_MODE_UNREAD_STATE ?>;
@@ -570,9 +570,9 @@
         if ((s & <?php echo  RSS_MODE_UNREAD_STATE ?>) != (p & <?php echo  RSS_MODE_UNREAD_STATE ?>)) {
             if (s & <?php echo  RSS_MODE_UNREAD_STATE ?>) {
                 setItemClass(id,'item unread');
-                c=unreadCnt(1);
+                c=unreadCnt(1,cid);
             } else {
-                c = unreadCnt(-1);
+                c = unreadCnt(-1,cid);
 				if ((sel = document.getElementById('<?php echo  SHOW_WHAT ?>')) &&
 				    sel.options[sel.selectedIndex].value == <?php echo  SHOW_UNREAD_ONLY ?>) {
                         setItemHide(id, (c==0));
@@ -593,15 +593,19 @@
     }
 }
 
-function unreadCnt(d) {
-    if (span = document.getElementById('ucnt')) {
-        if (c = span.innerHTML.replace(/[^0-9]+/g,"")) {
-            c = d+eval(c);
-            span.innerHTML = span.innerHTML.replace(/[0-9]+/g,c);
-        }
-        return c;
-    }
-    return null;
+function unreadCnt(d,channel) {
+	e = null;
+	channels = document.getElementsByTagName("strong");
+	for(i=0;i<channels.length;i++){
+		if((channels[i].id == 'cid'+channel) || (channels[i].id == 'ucnt')){
+			if (e = channels[i].innerHTML.replace(/[^0-9]+/g,"")) {
+				e = d+eval(e);
+				channels[i].innerHTML = channels[i].innerHTML.replace(/[0-9]+/g,e);
+				changed = 1;
+			}
+		}
+	}
+	return e;
 }
 
 function _rt(id,rt) {
Index: cls/wrappers/item.php
===================================================================
--- cls/wrappers/item.php	(revision 1489)
+++ cls/wrappers/item.php	(working copy)
@@ -86,6 +86,10 @@
 	return $GLOBALS['rss'] -> currentItem -> id;
 }
 
+function rss_item_cid() {
+	return $GLOBALS['rss'] -> currentItem -> parent -> cid;
+}
+
 function rss_item_flags() {
 	
 	return $GLOBALS['rss'] -> currentItem -> flags;
Index: themes/default/web/item.php
===================================================================
--- themes/default/web/item.php	(revision 1489)
+++ themes/default/web/item.php	(working copy)
@@ -5,7 +5,7 @@
 	</a>
 	<?php } ?>
 	<?php if(!hidePrivate()) { ?>
-	<a id="sa<?php echo rss_item_id(); ?>" href="#" onclick="_es(<?php echo rss_item_id(); ?>,<?php echo rss_item_flags(); ?>); return false;">
+	<a id="sa<?php echo rss_item_id(); ?>" href="#" onclick="_es(<?php echo rss_item_id(); ?>,<?php echo rss_item_cid(); ?>,<?php echo rss_item_flags(); ?>); return false;">
 		<img src="<?php echo getExternalThemeFile('media/edit.gif'); ?>" alt="edit" />
 	</a>
 	<?php } ?>
Index: themes/lilina/web/item.php
===================================================================
--- themes/lilina/web/item.php	(revision 1490)
+++ themes/lilina/web/item.php	(working copy)
@@ -28,7 +28,7 @@
 	</a>
 	<?php } ?>
 	<?php if(!hidePrivate()) { ?>
-	<a id="sa<?php echo rss_item_id(); ?>" href="#" onclick="_es(<?php echo rss_item_id(); ?>,<?php echo rss_item_flags(); ?>); return false;">
+	<a id="sa<?php echo rss_item_id(); ?>" href="#" onclick="_es(<?php echo rss_item_id(); ?>,<?php echo rss_item_cid(); ?>,<?php echo rss_item_flags(); ?>); return false;">
 		<img src="<?php echo rss_theme_path(); ?>/media/edit.gif" alt="edit" />
 	</a>
 	<?php } ?>
@@ -73,7 +73,7 @@
 	</a>
 	<?php } ?>
 	<?php if(!hidePrivate()) { ?>
-	<a id="sa<?php echo rss_item_id(); ?>" href="#" onclick="_es(<?php echo rss_item_id(); ?>,<?php echo rss_item_flags(); ?>); return false;">
+	<a id="sa<?php echo rss_item_id(); ?>" href="#" onclick="_es(<?php echo rss_item_id(); ?>,<?php echo rss_item_cid(); ?>,<?php echo rss_item_flags(); ?>); return false;">
 		<img src="<?php echo rss_theme_path(); ?>/media/edit.gif" alt="edit" />
 	</a>
 	<?php } ?>
