Index: subscribe-to-comments.php
===================================================================
--- subscribe-to-comments.php	(revision 9)
+++ subscribe-to-comments.php	(working copy)
@@ -19,9 +19,34 @@
 <?php /* ------------------------------------------------------------------- */ ?>
 <?php /* This is the text that is displayed for users who are NOT subscribed */ ?>
 <?php /* ------------------------------------------------------------------- */ ?>
+	<script type="text/javascript">
+	function stc_createCookie(name,value,days) {
+		if (days) {
+			var date = new Date();
+			date.setTime(date.getTime()+(days*24*60*60*1000));
+			var expires = "; expires="+date.toGMTString();
+		}
+		else var expires = "";
+		document.cookie = name+"="+value+expires+"; path=/";
+	}
 
+	function stc_state_changed(){
+		var e = document.getElementById("subscribe");
+		stc_createCookie('subscribed_to_comments',e.checked,100000);
+	}
+	</script>
 	<p <?php if ($sg_subscribe->clear_both) echo 'style="clear: both;" '; ?>class="subscribe-to-comments">
-        <input type="checkbox" name="subscribe" id="subscribe" value="subscribe" style="width: auto;" <?php if ($sg_subscribe->default_subscribed) echo 'checked="checked" '; ?>/>
+		<?php
+		if (isset($_COOKIE["subscribed_to_comments"]))
+		{
+			$checked = $_COOKIE["subscribed_to_comments"]== 'true' ? 'checked="checked"': '';
+		}
+		else
+		{
+			 if ($sg_subscribe->default_subscribed) $checked = 'checked="checked"';
+		}
+		?>
+        <input type="checkbox" name="subscribe" id="subscribe" value="subscribe" style="width: auto;" <?php echo "$checked" ?> onclick='stc_state_changed()'/>
         <label for="subscribe"><?php echo $sg_subscribe->not_subscribed_text; ?></label>
 	</p>
 

