1<html>
2<head>
3<title>Cookie Manager</title>
4<style>
5body *{
6	font-family:Verdana, Arial, Helvetica, sans-serif;
7	font-size: 9pt;
8}
9</style>
10</head>
11<body onload="loadCookies()">
12<h1 id="domain"></h1>
13<script>
14function byId(id){
15	return document.getElementById(id);
16}
17function isIE() {
18    var browser = navigator.appName;
19    return browser == "Microsoft Internet Explorer";
20}
21function chooseAll(me){
22	var els = document.getElementsByTagName("INPUT");
23	for (var i=0; i<els.length; i++) {
24		var el = els[i];
25		if (el.type == "checkbox") {
26			if (el.id != "_sahi_chooseAll"){
27				el.checked = me.checked;
28			}
29		}
30	}
31}
32function loadCookies(){
33	byId("raw").innerHTML = "$cookies";
34	var cookies = "$cookies".split(";");
35	var s = "<table><tr><th><input type='checkbox' id='_sahi_chooseAll' onclick='chooseAll(this)'></th>"
36		+ "<th>Name</th><th>Value</th></tr>";
37	for (var i=0; i<cookies.length; i++){
38		s += showCookie(cookies[i], i);
39	}
40	s += "</table>"
41	byId("cookies").innerHTML = s;
42}
43function trim(s) {
44    return s.replace(/^\s+|\s+$/g, "");
45}
46function showCookie(cookie, i){
47	var ix = cookie.indexOf("=");
48	if (ix != -1) {
49		var cookieName = trim(cookie.substring(0, ix));
50		var cookieValue = trim(cookie.substring(ix+1));
51		if (cookieName != "sahisid")
52			return "<tr><td><input type='checkbox' id='" + i + "' value='" + cookieName + "'></td><td>" + cookieName + "</td><td>" + cookieValue + "</td></tr>";
53	}
54	return "";
55}
56function deleteCookies(){
57	var els = document.getElementsByTagName("INPUT");
58	for (var i=0; i<els.length; i++) {
59		var el = els[i];
60		if (el.type == "checkbox") {
61			if (el.checked) deleteCookie(el.value);
62		}
63	}
64	location.reload();
65}
66function deleteCookie(name){
67	_sahi.sendToServer("/_s_/dyn/Cookies_delete?name=" + name);
68}
69</script>
70<br/>
71<div id="cookies"></div>
72<input type="button" value="Delete" onclick="deleteCookies();" style="margin:25px;">
73<div id="raw" style="padding:10px;"></div>
74</body>
75</html>