]>
Commit | Line | Data |
---|---|---|
7c33dbd4 AD |
1 | function debug(msg) { |
2 | // no-op | |
3 | } | |
4 | ||
5 | function setCookie(name, value, lifetime, path, domain, secure) { | |
6 | ||
7 | var d = false; | |
8 | ||
9 | if (lifetime) { | |
10 | d = new Date(); | |
11 | d.setTime(d.getTime() + (lifetime * 1000)); | |
12 | } | |
13 | ||
14 | debug("setCookie: " + name + " => " + value + ": " + d); | |
15 | ||
16 | int_setCookie(name, value, d, path, domain, secure); | |
17 | ||
18 | } | |
19 | ||
20 | function int_setCookie(name, value, expires, path, domain, secure) { | |
21 | document.cookie= name + "=" + escape(value) + | |
22 | ((expires) ? "; expires=" + expires.toGMTString() : "") + | |
23 | ((path) ? "; path=" + path : "") + | |
24 | ((domain) ? "; domain=" + domain : "") + | |
25 | ((secure) ? "; secure" : ""); | |
26 | } | |
27 | ||
28 | function exception_error(location, e, silent) { | |
29 | var msg; | |
30 | ||
31 | if (e.fileName) { | |
32 | var base_fname = e.fileName.substring(e.fileName.lastIndexOf("/") + 1); | |
33 | ||
34 | msg = "Exception: " + e.name + ", " + e.message + | |
35 | "\nFunction: " + location + "()" + | |
36 | "\nLocation: " + base_fname + ":" + e.lineNumber; | |
37 | ||
38 | } else if (e.description) { | |
39 | msg = "Exception: " + e.description + "\nFunction: " + location + "()"; | |
40 | } else { | |
41 | msg = "Exception: " + e + "\nFunction: " + location + "()"; | |
42 | } | |
43 | ||
44 | if (!silent) { | |
45 | alert(msg); | |
46 | } | |
47 | } | |
48 |