<!-- ACCEPTANCE NOTICE --> <script language="JavaScript" type="text/javascript"> <!-- Cookie script - Scott Andrew --> <!-- Notice modification - Copyright 2006, Sandeep Gangadharan --> <!-- var exp = 2; // the number at the left reflects the number of days for the cookie to last // modify it according to your needs function newCookie(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 readCookie(name) { var nameSG = name + "="; var ca = document.cookie.split(';'); for(var i=0; i<ca.length; i++) { var c = ca[i]; while (c.charAt(0)==' ') c = c.substring(1,c.length); if (c.indexOf(nameSG) == 0) return c.substring(nameSG.length,c.length); } return null; } function theMsg() { var num = readCookie('sancookie1') if (num < 1) { if (confirm('Do you agree?')) { newCookie('sancookie1','testcookie1',exp); location.href="accept.html"; } else { alert("You will not be allowed to go any further without accepting our terms!"); } // if you want those who do not accept to go to another page use this code instead of the one above // else { location.href="no-accept.html"; } } if (num) { alert("You have already accepted our terms!"); } } //--> </script> <body> <form name=""> <input type="button" value="Accept Terms?" onclick="theMsg()" /> </form> <!-- Remember to add the following code within the <SCRIPT> tags to all the pages that should be viewed only by those who have accepted your terms: function readCookie(name) { var nameSG = name + "="; var ca = document.cookie.split(';'); for(var i=0; i<ca.length; i++) { var c = ca[i]; while (c.charAt(0)==' ') c = c.substring(1,c.length); if (c.indexOf(nameSG) == 0) return c.substring(nameSG.length,c.length); } return null; } function readIt() { var num = readCookie('sancookie1') if (num < 1) { location.href="index.html"; } } window.onload=readIt; -->