From cead5c727147faac362e742aa7bcecf07f68cd99 Mon Sep 17 00:00:00 2001
From: thomascube <thomas@roundcube.net>
Date: Thu, 18 May 2006 17:24:42 -0400
Subject: [PATCH] Updated CHANGELOG

---
 program/js/common.js |   56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 54 insertions(+), 2 deletions(-)

diff --git a/program/js/common.js b/program/js/common.js
index 2d2c2e9..f9fb9c1 100644
--- a/program/js/common.js
+++ b/program/js/common.js
@@ -6,11 +6,11 @@
  | Copyright (C) 2005, RoundCube Dev, - Switzerland                      |
  | Licensed under the GNU GPL                                            |
  |                                                                       |
- | Modified: 19.08.2005 (tbr)                                            |
- |                                                                       |
  +-----------------------------------------------------------------------+
  | Author: Thomas Bruederli <roundcube@gmail.com>                        |
  +-----------------------------------------------------------------------+
+ 
+ $Id$
 */
 
 
@@ -81,6 +81,14 @@
                    (this.ie && this.win && this.vendver>=5.5) || this.safari);
   this.opacity = (this.mz || (this.ie && this.vendver>=5.5 && !this.opera) || (this.safari && this.vendver>=100));
   this.cookies = navigator.cookieEnabled;
+  
+  // test for XMLHTTP support
+  this.xmlhttp_test = function()
+    {
+    var activeX_test = new Function("try{var o=new ActiveXObject('Microsoft.XMLHTTP');return true;}catch(err){return false;}");
+    this.xmlhttp = (window.XMLHttpRequest || (window.ActiveXObject && activeX_test())) ? true : false;
+    return this.xmlhttp;
+    }
   }
 
 
@@ -256,6 +264,19 @@
   }
 
 
+// check if input is a valid email address
+function rcube_check_email(input, inline)
+  {
+  if (input && window.RegExp)
+    {
+    var reg_str = '([a-z0-9][-a-z0-9\.\+_&]*)\@(([-a-z0-9][\.]?)*[a-z0-9]\.[a-z]{2,9})';
+    var reg1 = inline ? new RegExp(reg_str, 'i') : new RegExp('^'+reg_str+'$', 'i');
+    var reg2 = /[\._\-]{2}/;
+    return reg1.test(input) && !reg2.test(input) ? true : false;
+    }
+  return false;
+  }
+  
 
 // find a value in a specific array and returns the index
 function find_in_array()
@@ -342,5 +363,36 @@
 
   return {x:iX, y:iY};
   }
+  
+
+// cookie functions by GoogieSpell
+function setCookie(name, value, expires, path, domain, secure)
+  {
+  var curCookie = name + "=" + escape(value) +
+      (expires ? "; expires=" + expires.toGMTString() : "") +
+      (path ? "; path=" + path : "") +
+      (domain ? "; domain=" + domain : "") +
+      (secure ? "; secure" : "");
+  document.cookie = curCookie;
+  }
+
+function getCookie(name)
+  {
+  var dc = document.cookie;
+  var prefix = name + "=";
+  var begin = dc.indexOf("; " + prefix);
+  if (begin == -1)
+    {
+    begin = dc.indexOf(prefix);
+    if (begin != 0) return null;
+    }
+  else
+    begin += 2;  
+  var end = document.cookie.indexOf(";", begin);
+  if (end == -1)
+    end = dc.length;
+  return unescape(dc.substring(begin + prefix.length, end));
+  }
+
 
 var bw = new roundcube_browser();
\ No newline at end of file

--
Gitblit v1.9.1