+ var url = document.URL;
+ var fqdn = url.replace(/^https?:\/\/([^\/]*)\/.*$/,'$1');
+ var light = (url.indexOf('display=light') > url.indexOf('?'));
+ var resource_page = (url.indexOf('rss') > -1 || url.indexOf('ical') > -1);
+
+ $("a,link").each(
+ function(i) {
+ node = $(this);
+ href = this.href;
+ if(!href || node.hasClass('xdx')
+ || href.indexOf('mailto:') > -1 || href.indexOf('javascript:') > -1) {
+ return;
+ }
+ if ((href.indexOf(fqdn) < 0 && this.className.indexOf('popup') < 0) || node.hasClass('popup')) {
+ node.click(function () { window.open(this.href); return false; });
+ }
+ if (href.indexOf(fqdn) > -1 && light) {
+ href = href.replace(/([^\#\?]*)\??([^\#]*)(\#.*)?/, "$1?display=light&$2$3");
+ this.href = href;
+ }
+ rss = href.indexOf('rss') > -1;
+ ical = href.indexOf('ical') > -1;
+ if (rss || ical) {
+ if (href.indexOf('http') < 0) {
+ href = 'http://' + fqdn + '/' + href;
+ }
+ }
+ if (this.nodeName.toLowerCase() == 'a' && !resource_page) {
+ if (rss && href.indexOf('prefs/rss') < 0 && (href.indexOf('xml') > -1 || href.indexOf('hash'))) {
+ goodiesPopup(this, __goodies_rss);
+ } else if (ical) {
+ goodiesPopup(this, __goodies_ical);
+ }
+ }
+ if(matches = (/^popup_([0-9]*)x([0-9]*)$/).exec(this.className)) {
+ var w = matches[1], h = matches[2];
+ node.click(function() { return popWin(this, w, h); });
+ }
+ }
+ );
+ $('.popup2').click(function() { return popWin(this, 840, 600); });
+ $('.popup3').click(function() { return popWin(this, 640, 800); });
+}
+
+
+// }}}
+
+/***************************************************************************
+ * Password check
+ */
+
+// {{{ function checkPassword
+
+function getType(c) {
+ if (c >= 'a' && c <= 'z') {
+ return 1;
+ } else if (c >= 'A' && c <= 'Z') {
+ return 2;
+ } else if (c >= '0' && c <= '9') {
+ return 3;
+ } else {
+ return 4;
+ }