← Back to team overview

openerp-dev-web team mailing list archive

lp:~openerp-dev/openobject-client-web/trunk-proto61-dhtmlx-scheduler-vda into lp:~openerp-dev/openobject-client-web/trunk-proto61

 

vda(Open ERP) has proposed merging lp:~openerp-dev/openobject-client-web/trunk-proto61-dhtmlx-scheduler-vda into lp:~openerp-dev/openobject-client-web/trunk-proto61.

Requested reviews:
  OpenERP R&D Team (openerp-dev)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-client-web/trunk-proto61-dhtmlx-scheduler-vda/+merge/56685
-- 
The attached diff has been truncated due to its size.
https://code.launchpad.net/~openerp-dev/openobject-client-web/trunk-proto61-dhtmlx-scheduler-vda/+merge/56685
Your team OpenERP R&D Team is requested to review the proposed merge of lp:~openerp-dev/openobject-client-web/trunk-proto61-dhtmlx-scheduler-vda into lp:~openerp-dev/openobject-client-web/trunk-proto61.
=== modified file 'addons/base/static/src/base.html'
--- addons/base/static/src/base.html	2011-04-06 12:02:06 +0000
+++ addons/base/static/src/base.html	2011-04-07 05:03:24 +0000
@@ -23,6 +23,9 @@
     <script type="text/javascript" src="/base/static/src/js/list.js"></script>
     <script type="text/javascript" src="/base/static/src/js/search.js"></script>
     <script type="text/javascript" src="/base/static/src/js/views.js"></script>
+	
+	<script type="text/javascript" src="/base_calendar/static/src/js/calendar.js"></script>
+	<script type="text/javascript" src="/base_calendar/static/lib/dhtmlxScheduler/codebase/dhtmlxscheduler.js"></script>
 
     <link rel="stylesheet" type="text/css" media="screen" href="/base/static/lib/jquery.ui/css/smoothness/jquery-ui-1.8.9.custom.css" />
     <link rel="stylesheet" type="text/css" media="screen" href="/base/static/lib/jquery.ui.notify/css/ui.notify.css" />
@@ -30,6 +33,8 @@
     <link rel="stylesheet" type="text/css" href="/base/static/lib/jquery.superfish/css/superfish.css" media="screen">
     <link rel="stylesheet" href="/base/static/src/css/base.css" type="text/css"/>
 
+	<link rel="stylesheet" type="text/css" href="/base_calendar/static/lib/dhtmlxScheduler/codebase/dhtmlxscheduler.css" media="screen">
+	
     <script type="text/javascript">
         $(function() {
             var oe = openerp.init();

=== modified file 'addons/base/static/src/js/base.js'
--- addons/base/static/src/js/base.js	2011-03-31 08:58:06 +0000
+++ addons/base/static/src/js/base.js	2011-04-07 05:03:24 +0000
@@ -122,6 +122,7 @@
     openerp.base.search(instance);
     openerp.base.list(instance);
     openerp.base.form(instance);
+	openerp.base.calendar(instance);
 };
 
 // vim:et fdc=0 fdl=0 foldnestmax=3 fdm=syntax:

=== modified file 'addons/base/static/src/xml/base.xml'
--- addons/base/static/src/xml/base.xml	2011-04-06 14:51:13 +0000
+++ addons/base/static/src/xml/base.xml	2011-04-07 05:03:24 +0000
@@ -167,6 +167,39 @@
     </div>
     <table id="todo_use_unique_id" class="jqGrid"></table>
 </t>
+
+<t t-name="CalendarView">
+	<h3 class="title"><t t-esc="view.fields_view.arch.attrs.string"/></h3>
+	<table class="calendar-view" width="100%" height="100%" cellspacing="0" cellpadding="0">
+		<tr>
+			<td>
+				<div style="height: 1000px;width: 100%;">
+					<div id="calendar-sidebar">
+					</div>
+				</div>
+			</td>
+			<td style="width:85%;" align="left">
+				<div id="openerp_scheduler" class="dhx_cal_container" style="height: 1000px;width: 100%;">
+					<div class="dhx_cal_navline">
+						<div class="dhx_cal_prev_button"></div>
+						<div class="dhx_cal_next_button"></div>
+						<div class="dhx_cal_today_button"></div>
+						<div class="dhx_cal_date"></div>
+						<div class="dhx_minical_icon" id="dhx_minical_icon"></div>
+						<div class="dhx_cal_tab" name="day_tab" style="right:204px;"></div>
+						<div class="dhx_cal_tab" name="week_tab" style="right:140px;"></div>
+						<div class="dhx_cal_tab" name="month_tab" style="right:76px;"></div>
+					</div>
+					<div class="dhx_cal_header">
+					</div>
+					<div class="dhx_cal_data">
+					</div>		
+				</div>
+			</td>
+		</tr>
+	</table>
+</t>
+
 <t t-name="FormView">
     <h2 class="oe_view_title"><t t-esc="view.fields_view.arch.attrs.string"/></h2>
     <div class="oe_form_header">

=== modified file 'addons/base_calendar/__init__.py'
--- addons/base_calendar/__init__.py	2011-03-02 18:56:06 +0000
+++ addons/base_calendar/__init__.py	2011-04-07 05:03:24 +0000
@@ -1,1 +1,2 @@
 #!/usr/bin/python
+import controllers

=== added directory 'addons/base_calendar/controllers'
=== added file 'addons/base_calendar/controllers/__init__.py'
--- addons/base_calendar/controllers/__init__.py	1970-01-01 00:00:00 +0000
+++ addons/base_calendar/controllers/__init__.py	2011-04-07 05:03:24 +0000
@@ -0,0 +1,1 @@
+import main
\ No newline at end of file

=== added file 'addons/base_calendar/controllers/main.py'
--- addons/base_calendar/controllers/main.py	1970-01-01 00:00:00 +0000
+++ addons/base_calendar/controllers/main.py	2011-04-07 05:03:24 +0000
@@ -0,0 +1,360 @@
+from base.controllers.main import Xml2Json
+import openerpweb, time, math, re, datetime as DT, pytz
+
+COLOR_PALETTE = ['#f57900', '#cc0000', '#d400a8', '#75507b', '#3465a4', '#73d216', '#c17d11', '#edd400',
+                 '#fcaf3e', '#ef2929', '#ff00c9', '#ad7fa8', '#729fcf', '#8ae234', '#e9b96e', '#fce94f',
+                 '#ff8e00', '#ff0000', '#b0008c', '#9000ff', '#0078ff', '#00ff00', '#e6ff00', '#ffff00',
+                 '#905000', '#9b0000', '#840067', '#510090', '#0000c9', '#009b00', '#9abe00', '#ffc900', ]
+
+_colorline = ['#%02x%02x%02x' % (25 + ((r + 10) % 11) * 23, 5 + ((g + 1) % 11) * 20, 25 + ((b + 4) % 11) * 23) for r in range(11) for g in range(11) for b in range(11) ]
+
+DT_SERVER_FORMATS = {
+  'datetime' : '%Y-%m-%d %H:%M:%S',
+  'date' : '%Y-%m-%d',
+  'time' : '%H:%M:%S'
+}
+
+DT_FORMAT_INFO = {'datetime' : ('%Y-%m-%d %H:%M:%S', DT.datetime, 0, 6),
+                  'date': ('%Y-%m-%d', DT.date, 0, 3),
+                  'time': ('%H:%M:%S', DT.time, 3, 6)}
+
+def choice_colors(n):
+        if n > len(COLOR_PALETTE):
+            return _colorline[0:-1:len(_colorline) / (n + 1)]
+        elif n:
+            return COLOR_PALETTE[:n]
+        return []
+
+class CalendarView(openerpweb.Controller):
+    _cp_path = "/base_calendar/calendarview"
+    
+    mode = 'month'
+    date_start = None
+    date_delay = None
+    date_stop = None
+    color_field = None
+    day_length = 8
+    use_search = False
+    selected_day = None
+    date_format = '%Y-%m-%d'
+    info_fields = []
+    fields = {}
+    events = []
+
+    colors = {}
+    color_values = []
+
+    remote_timezone = 'utc'
+    client_timezone = False
+    
+    calendar_fields = {}
+    concurrency_info = None
+
+    ids = []
+    model = ''
+    domain = []
+    context = {}
+    
+    @openerpweb.jsonrequest
+    def load(self, req, model, view_id):
+        m = req.session.model(model)
+        r = m.fields_view_get(view_id, 'calendar')
+        r["arch"] = Xml2Json.convert_to_structure(r["arch"])
+        v = m.fields_view_get(view_id, 'tree')
+        return {'fields_view':r}
+    
+    def convert(self, event):
+        fields = [self.date_start]
+        if self.date_stop:
+            fields.append(self.date_stop)
+            
+        for fld in fields:
+            fld_type = self.fields[fld]['type']
+            fmt = DT_SERVER_FORMATS[fld_type]
+            if event[fld] and fmt:
+                event[fld] = time.strptime(event[fld], fmt)
+            
+            # default start/stop time is 9:00 AM / 5:00 PM
+            if fld_type == 'date' and event[fld]:
+                ds = list(event[fld])
+                if fld == self.date_start:
+                    ds[3] = 9
+                elif fld == self.date_stop:
+                    ds[3] = 17
+                event[fld] = tuple(ds)
+             
+    
+    @openerpweb.jsonrequest
+    def schedule_events(self, req, **kw):
+        self.model = kw['model']
+        self.mode = kw.get('mode') or self.mode or 'month'
+        self.fields = kw['fields']
+        self.color_field = kw.get('color_field') or self.color_field or None
+        self.colors = kw.get('colors') or {}
+        self.calendar_fields = kw['calendar_fields']
+        self.info_fields = kw['info_fields']
+        self.date_start = self.calendar_fields['date_start']['name']
+        self.domain = kw.get('domain') or []
+        
+        self.remote_timezone = req.session.remote_timezone
+        self.client_timezone = req.session.client_timezone
+        
+        if self.calendar_fields.get('date_stop'):
+            self.date_stop = self.calendar_fields['date_stop']['name']
+        
+        if self.calendar_fields.get('date_delay'):
+            self.date_delay = self.calendar_fields['date_delay']['name']
+            
+        model = req.session.model(self.model)
+        event_ids = model.search(self.domain)
+        
+        self.events = model.read(event_ids, self.fields.keys())
+        result = []
+        self.date_format = req.session._lang and req.session._lang['date_format']
+        
+        if self.color_field:
+            for evt in self.events:
+                key = evt[self.color_field]
+                name = key
+                value = key
+                if isinstance(key, list): # M2O, XMLRPC returns List instead of Tuple
+                    name = key[0]
+                    value = key[-1]
+                    evt[self.color_field] = key = key[-1]
+                if isinstance(key, tuple): # M2O
+                    value, name = key
+                self.colors[key] = (name, value, None)
+            
+            colors = choice_colors(len(self.colors))
+            for i, (key, value) in enumerate(self.colors.items()):
+                self.colors[key] = [value[0], value[1], colors[i]]
+        
+        for evt in self.events:
+            self.convert(evt)
+            a = self.get_event_widget(evt)
+            result.append(a)
+            
+        return {'result':result,'sidebar':self.colors}
+    
+    def parsedatetime(self, string):
+        
+        kind = 'datetime'
+
+        if '-' in string and ':' in string:
+            kind = 'datetime'
+        elif '-' in string:
+            kind = 'date'
+        elif ':' in string:
+            kind = 'time'
+        
+        fmt, obj, i, j = DT_FORMAT_INFO[kind]
+        return obj(*time.strptime(string, fmt)[i:j])
+    
+    def parse_datetime(self, value, kind="datetime", as_timetuple=False):
+        server_format = DT_SERVER_FORMATS[kind]
+        local_format = self.date_format
+        if not value:
+            return False
+
+        if isinstance(value, (time.struct_time, tuple)):
+            value = time.strftime(local_format, value)
+
+        try:
+            value = time.strptime(value, local_format)
+        except ValueError:
+            try:
+                # might be in server format already (e.g. filter domain)
+                value = time.strptime(value, server_format)
+            except ValueError:
+                try:
+                    dt = list(time.localtime())
+                    dt[2] = int(value)
+                    value = tuple(dt)
+                except:
+                    return False
+    
+        if kind == "datetime":
+            try:
+                value = self.tz_convert(value, 'parse')
+            except Exception,e:
+                print "*******************Error in timezone parsing *********",e
+    
+        if as_timetuple:
+            return value
+        
+        return time.strftime(server_format, value)
+
+    
+    @openerpweb.jsonrequest
+    def edit_events(self, req,**kw):
+        data = {}
+        ds = self.parsedatetime(kw['start_date'])
+        de = self.parsedatetime(kw['end_date'])
+        data[kw['calendar_fields']['date_start']['name']] = self.parse_datetime(ds.timetuple())
+        
+        if 'date_stop' in kw['calendar_fields']:
+            data[kw['calendar_fields']['date_stop']['name']] = self.parse_datetime(de.timetuple())
+        elif 'date_delay' in kw['calendar_fields']:
+            day_length = kw['calendar_fields']['day_length']
+            
+            tds = time.mktime(ds.timetuple())
+            tde = time.mktime(de.timetuple())
+            
+            n = (tde - tds) / (60 * 60)
+
+            if n > day_length:
+                d = math.floor(n / 24)
+                h = n % 24
+
+                n = d * day_length + h
+
+            data[kw['calendar_fields']['date_delay']['name']] = n
+        error = None
+        try:
+            req.session.model(kw['model']).write([int(kw['id'])], data)
+        except Exception, e:
+            error = e
+        return error
+    
+    def tz_convert(self, struct_time, action):
+        # if no client timezone is configured, consider the client is in the same
+        # timezone as the server
+        lzone = pytz.timezone(self.client_timezone or self.remote_timezone)
+        szone = pytz.timezone(self.remote_timezone)
+        dt = DT.datetime.fromtimestamp(time.mktime(struct_time))
+    
+        if action == 'parse':
+            fromzone = lzone
+            tozone = szone
+        elif action == 'format':
+            fromzone = szone
+            tozone = lzone
+        else:
+            raise Exception("_tz_convert action should be 'parse' or 'format'. Not '%s'" % (action, ))
+    
+        localized_original_datetime = fromzone.localize(dt, is_dst=True)
+        destination_datetime = localized_original_datetime.astimezone(tozone)
+        return destination_datetime.timetuple()
+    
+    def format_datetime(self, value, kind="datetime", as_timetuple=False):
+        """Convert date value to the local datetime considering timezone info.
+    
+        @param value: the date value
+        @param kind: type of the date value (date, time or datetime)
+        @param as_timetuple: return timetuple
+    
+        @type value: basestring or time.time_tuple)
+    
+        @return: string or timetuple
+        """
+    
+        server_format = DT_SERVER_FORMATS[kind]
+        local_format = self.date_format
+    
+        if not value:
+            return ''
+    
+        if isinstance(value, (time.struct_time, tuple)):
+            value = time.strftime(server_format, value)
+    
+        if isinstance(value, DT.datetime):
+            value = value
+            try:
+                value = DT.datetime.strptime(value[:10], server_format)
+                return value.strftime(local_format)
+            except:
+                return ''
+    
+        value = value.strip()
+    
+        # remove trailing miliseconds
+        value = re.sub("(.*?)(\s+\d{2}:\d{2}:\d{2})(\.\d+)?$", "\g<1>\g<2>", value)
+    
+        # add time part in value if missing
+        if kind == 'datetime' and not re.search('\s+\d{2}:\d{2}:\d{2}?$', value):
+            value += ' 00:00:00'
+    
+        # remove time part from value
+        elif kind == 'date':
+            value = re.sub('\s+\d{2}:\d{2}:\d{2}(\.\d+)?$', '', value)
+    
+        value = time.strptime(value, server_format)
+    
+        if kind == "datetime":
+            try:
+                value = self.tz_convert(value, 'format')
+            except Exception, e:
+                print "\n\n\n************ Error in timezone formatting", e
+    
+        if as_timetuple:
+            return value
+    
+        return time.strftime(local_format, value)
+    
+    def get_event_widget(self, event):
+        title = ''       # the title
+        description = [] # the description
+        
+        if self.info_fields:
+
+            f = self.info_fields[0]
+            s = event[f]
+            
+            if isinstance(s, (tuple, list)): s = s[-1]
+            
+            title = s
+            for f in self.info_fields[1:]:
+                s = event[f]
+                if isinstance(s, (tuple, list)):
+                    s = s[-1]
+                if s:
+                    description.append(str(s))
+        
+        starts = event.get(self.date_start)
+        ends = event.get(self.date_delay) or 1.0
+        span = 0
+        
+        if starts and ends:
+
+            n = 0
+            h = ends
+
+            if ends == self.day_length:
+                span = 1
+
+            elif ends > self.day_length:
+                n = ends / self.day_length
+                h = ends % self.day_length
+
+                n = int(math.floor(n))
+                
+                if h > 0:
+                    span = n + 1
+                else:
+                    span = n
+            ends = time.localtime(time.mktime(starts) + (h * 60 * 60) + (n * 24 * 60 * 60))
+            
+        if starts and self.date_stop:
+
+            ends = event.get(self.date_stop)
+            if not ends:
+                ends = time.localtime(time.mktime(starts) + 60 * 60)
+
+            tds = time.mktime(starts)
+            tde = time.mktime(ends)
+
+            if tds >= tde:
+                tde = tds + 60 * 60
+                ends = time.localtime(tde)
+
+            n = (tde - tds) / (60 * 60)
+
+            if n >= self.day_length:
+                span = math.ceil(n / 24)
+        
+        starts = self.format_datetime(starts, "datetime", True)
+        ends = self.format_datetime(ends, "datetime", True)
+        title = title.strip()
+        description = ', '.join(description).strip()
+        return {'id': event['id'], 'start_date': str(DT.datetime(*starts[:6])), 'end_date': str(DT.datetime(*ends[:6])), 'text': title, 'title': description, 'color': self.colors[event[self.color_field]][-1]}
+        
\ No newline at end of file

=== added directory 'addons/base_calendar/static/lib'
=== added directory 'addons/base_calendar/static/lib/dhtmlxScheduler'
=== added file 'addons/base_calendar/static/lib/dhtmlxScheduler/License_GPL.html'
--- addons/base_calendar/static/lib/dhtmlxScheduler/License_GPL.html	1970-01-01 00:00:00 +0000
+++ addons/base_calendar/static/lib/dhtmlxScheduler/License_GPL.html	2011-04-07 05:03:24 +0000
@@ -0,0 +1,73 @@
+<h1>GNU GENERAL PUBLIC LICENSE</h1>
+Version 2, June 1991 </p>
+</p>
+<p>Copyright (C) 1989, 1991 Free Software Foundation, Inc.  </p>
+<p>59 Temple Place - Suite 330, Boston, MA  02111-1307, USA</p>
+</p>
+<p>Everyone is permitted to copy and distribute verbatim copies</p>
+<p>of this license document, but changing it is not allowed.</p>
+</p>
+</p>
+<p>TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION</p>
+<p>0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". </p>
+</p>
+<p>Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. </p>
+</p>
+<p>1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. </p>
+</p>
+<p>You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. </p>
+</p>
+<p>2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: </p>
+</p>
+</p>
+<p>a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. </p>
+</p>
+<p>b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. </p>
+</p>
+<p>c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) </p>
+<p>These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. </p>
+</p>
+<p>Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. </p>
+</p>
+<p>In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. </p>
+</p>
+<p>3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: </p>
+</p>
+<p>a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, </p>
+</p>
+<p>b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, </p>
+</p>
+<p>c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) </p>
+<p>The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. </p>
+</p>
+<p>If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. </p>
+</p>
+<p>4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. </p>
+</p>
+<p>5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. </p>
+</p>
+<p>6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. </p>
+</p>
+<p>7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. </p>
+</p>
+<p>If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. </p>
+</p>
+<p>It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. </p>
+</p>
+<p>This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. </p>
+</p>
+<p>8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. </p>
+</p>
+<p>9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. </p>
+</p>
+<p>Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. </p>
+</p>
+<p>10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. </p>
+</p>
+<p>NO WARRANTY</p>
+</p>
+<p>11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. </p>
+</p>
+<p>12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. </p>
+</p>
+<p>
\ No newline at end of file

=== added directory 'addons/base_calendar/static/lib/dhtmlxScheduler/codebase'
=== added directory 'addons/base_calendar/static/lib/dhtmlxScheduler/codebase/connector'
=== added file 'addons/base_calendar/static/lib/dhtmlxScheduler/codebase/connector/base_connector.php'
--- addons/base_calendar/static/lib/dhtmlxScheduler/codebase/connector/base_connector.php	1970-01-01 00:00:00 +0000
+++ addons/base_calendar/static/lib/dhtmlxScheduler/codebase/connector/base_connector.php	2011-04-07 05:03:24 +0000
@@ -0,0 +1,706 @@
+<?php
+
+require_once("tools.php");
+require_once("db_common.php");
+require_once("dataprocessor.php");
+require_once("update.php");
+
+//enable buffering to catch and ignore any custom output before XML generation
+//because of this command, it strongly recommended to include connector's file before any other libs
+//in such case it will handle any extra output from not well formed code of other libs
+ini_set("output_buffering","On");
+ob_start();
+
+class OutputWriter{
+	private $start;
+	private $end;
+	private $type;
+	
+	public function __construct($start, $end = ""){
+		$this->start = $start;
+		$this->end = $end;
+		$this->type = "xml";
+	}
+	public function add($add){
+		$this->start.=$add;
+	}
+	public function reset(){
+		$this->start="";
+		$this->end="";
+	}
+	public function set_type($add){
+		$this->type=$add;
+	}
+	public function output($name="", $inline=true){
+		ob_clean();
+		if ($this->type == "xml")
+			header("Content-type: text/xml");
+			
+		echo $this->__toString();
+	}
+	public function __toString(){
+		return $this->start.$this->end;
+	}
+}
+
+/*! EventInterface
+	Base class , for iterable collections, which are used in event
+**/
+class EventInterface{ 
+	protected $request; ////!< DataRequestConfig instance
+	public $rules=array(); //!< array of sorting rules
+	
+	/*! constructor
+		creates a new interface based on existing request
+		@param request 
+			DataRequestConfig object
+	*/
+	public function __construct($request){
+		$this->request = $request;
+	}
+
+	/*! remove all elements from collection
+		*/	
+	public function clear(){
+		array_splice($rules,0);
+	}
+	/*! get index by name
+		
+		@param name 
+			name of field
+		@return 
+			index of named field
+	*/
+	public function index($name){
+		$len = sizeof($this->rules);
+		for ($i=0; $i < $len; $i++) { 
+			if ($this->rules[$i]["name"]==$name)
+				return $i;
+		}
+		return false;
+	}
+}
+/*! Wrapper for collection of sorting rules
+**/
+class SortInterface extends EventInterface{
+	/*! constructor
+		creates a new interface based on existing request
+		@param request 
+			DataRequestConfig object
+	*/
+	public function __construct($request){
+		parent::__construct($request);
+		$this->rules = &$request->get_sort_by_ref();
+	}
+	/*! add new sorting rule
+		
+		@param name 
+			name of field
+		@param dir
+			direction of sorting
+	*/
+	public function add($name,$dir){
+		$this->request->set_sort($name,$dir);
+	}
+	public function store(){
+		$this->request->set_sort_by($this->rules);
+	}
+}
+/*! Wrapper for collection of filtering rules
+**/
+class FilterInterface extends EventInterface{
+	/*! constructor
+		creates a new interface based on existing request
+		@param request 
+			DataRequestConfig object
+	*/	
+	public function __construct($request){
+		$this->request = $request;
+		$this->rules = &$request->get_filters_ref();
+	}
+	/*! add new filatering rule
+		
+		@param name 
+			name of field
+		@param value
+			value to filter by
+		@param rule
+			filtering rule
+	*/
+	public function add($name,$value,$rule){
+		$this->request->set_filter($name,$value,$rule);
+	}
+	public function store(){
+		$this->request->set_filters($this->rules);
+	}
+}
+
+/*! base class for component item representation	
+**/
+class DataItem{
+	protected $data; //!< hash of data
+	protected $config;//!< DataConfig instance
+	protected $index;//!< index of element
+	protected $skip;//!< flag , which set if element need to be skiped during rendering
+	/*! constructor
+		
+		@param data
+			hash of data
+		@param config
+			DataConfig object
+		@param index
+			index of element
+	*/
+	function __construct($data,$config,$index){
+		$this->config=$config;
+		$this->data=$data;
+		$this->index=$index;
+		$this->skip=false;
+	}
+	/*! get named value
+		
+		@param name 
+			name or alias of field
+		@return 
+			value from field with provided name or alias
+	*/
+	public function get_value($name){
+		return $this->data[$name];
+	}
+	/*! set named value
+		
+		@param name 
+			name or alias of field
+		@param value
+			value for field with provided name or alias
+	*/
+	public function set_value($name,$value){
+		return $this->data[$name]=$value;
+	}
+	/*! get id of element
+		@return 
+			id of element
+	*/
+	public function get_id(){
+		$id = $this->config->id["name"];
+		if (array_key_exists($id,$this->data))
+			return $this->data[$id];
+		return false;
+	}
+	/*! change id of element
+		
+		@param value 
+			new id value
+	*/
+	public function set_id($value){
+		$this->data[$this->config->id["name"]]=$value;
+	}
+	/*! get index of element
+		
+		@return 
+			index of element
+	*/
+	public function get_index(){
+		return $this->index;
+	}
+	/*! mark element for skiping ( such element will not be rendered )
+	*/
+	public function skip(){
+		$this->skip=true;
+	}
+	
+	/*! return self as XML string
+	*/
+	public function to_xml(){
+		return $this->to_xml_start().$this->to_xml_end();
+	}
+	
+	/*! replace xml unsafe characters
+		
+		@param string 
+			string to be escaped
+		@return 
+			escaped string
+	*/
+	protected function xmlentities($string) { 
+   		return str_replace( array( '&', '"', "'", '<', '>', '’' ), array( '&amp;' , '&quot;', '&apos;' , '&lt;' , '&gt;', '&apos;' ), $string);
+	}
+	
+	/*! return starting tag for self as XML string 
+	*/
+	public function to_xml_start(){
+		$str="<item";
+		for ($i=0; $i < sizeof($this->config->data); $i++){ 
+			$name=$this->config->data[$i]["name"];
+			$str.=" ".$name."='".$this->xmlentities($this->data[$name])."'";
+		}
+		return $str.">";
+	}
+	/*! return ending tag for XML string
+	*/
+	public function to_xml_end(){
+		return "</item>";
+	}
+}
+
+
+
+
+
+/*! Base connector class
+	This class used as a base for all component specific connectors. 
+	Can be used on its own to provide raw data.	
+**/
+class Connector {
+	protected $config;//DataConfig instance
+	protected $request;//DataRequestConfig instance
+	protected $names;//!< hash of names for used classes
+	private $encoding="utf-8";//!< assigned encoding (UTF-8 by default) 
+	private $editing=false;//!< flag of edit mode ( response for dataprocessor )
+	private $updating=false;//!< flag of update mode ( response for data-update )
+	private $db; //!< db connection resource
+	protected $dload;//!< flag of dyn. loading mode
+	public $access;  //!< AccessMaster instance
+	
+	public $sql;	//DataWrapper instance
+	public $event;	//EventMaster instance
+	public $limit=false;
+	
+	private $id_seed=0; //!< default value, used to generate auto-IDs
+	protected $live_update = false; // actions table name for autoupdating
+	
+	/*! constructor
+		
+		Here initilization of all Masters occurs, execution timer initialized
+		@param db 
+			db connection resource
+		@param type
+			string , which hold type of database ( MySQL or Postgre ), optional, instead of short DB name, full name of DataWrapper-based class can be provided
+		@param item_type
+			name of class, which will be used for item rendering, optional, DataItem will be used by default
+		@param data_type
+			name of class which will be used for dataprocessor calls handling, optional, DataProcessor class will be used by default. 
+	*/	
+	public function __construct($db,$type=false, $item_type=false, $data_type=false){
+		$this->exec_time=microtime(true);
+
+		if (!$type) $type="MySQL";
+		if (class_exists($type."DBDataWrapper",false)) $type.="DBDataWrapper";
+		if (!$item_type) $item_type="DataItem";
+		if (!$data_type) $data_type="DataProcessor";
+		
+		$this->names=array(
+			"db_class"=>$type,
+			"item_class"=>$item_type,
+			"data_class"=>$data_type,
+		);
+		
+		$this->config = new DataConfig();
+		$this->request = new DataRequestConfig();
+		$this->event = new EventMaster();
+		$this->access = new AccessMaster();
+
+		if (!class_exists($this->names["db_class"],false))
+			throw new Exception("DB class not found: ".$this->names["db_class"]);
+		$this->sql = new $this->names["db_class"]($db,$this->config);
+		
+		$this->db=$db;//saved for options connectors, if any
+		
+		EventMaster::trigger_static("connectorCreate",$this);
+	}
+
+	/*! return db connection resource
+		nested class may neeed to access live connection object
+		@return 
+			DB connection resource
+	*/
+	protected function get_connection(){
+		return $this->db;
+	}
+
+	public function get_config(){
+		return new DataConfig($this->config);
+	}
+	
+	public function get_request(){
+		return new DataRequestConfig($this->config);
+	}
+
+
+	/*! config connector based on table
+		
+		@param table 
+			name of table in DB
+		@param id 
+			name of id field
+		@param fields
+			list of fields names
+		@param extra
+			list of extra fields, optional, such fields will not be included in data rendering, but will be accessible in all inner events
+		@param relation_id
+			name of field used to define relations for hierarchical data organization, optional
+	*/
+	public function render_table($table,$id="",$fields=false,$extra=false,$relation_id=false){
+		$this->configure($table,$id,$fields,$extra,$relation_id);
+		return $this->render();
+	}
+	public function configure($table,$id="",$fields=false,$extra=false,$relation_id=false){
+        if ($fields === false){
+            //auto-config
+            $info = $this->sql->fields_list($table);
+            $fields = implode(",",$info["fields"]);
+            if ($info["key"])
+                $id = $info["key"];
+        }
+		$this->config->init($id,$fields,$extra,$relation_id);
+		$this->request->set_source($table);
+	}
+	
+	protected function uuid(){
+		return time()."x".$this->id_seed++;
+	}
+	
+	/*! config connector based on sql
+		
+		@param sql 
+			sql query used as base of configuration
+		@param id 
+			name of id field
+		@param fields
+			list of fields names
+		@param extra
+			list of extra fields, optional, such fields will not be included in data rendering, but will be accessible in all inner events
+		@param relation_id
+			name of field used to define relations for hierarchical data organization, optional
+	*/
+	public function render_sql($sql,$id,$fields,$extra=false,$relation_id=false){
+		$this->config->init($id,$fields,$extra,$relation_id);
+		$this->request->parse_sql($sql);
+		return $this->render();
+	}
+	
+	/*! render already configured connector
+		
+		@param config
+			configuration of data
+		@param request
+			configuraton of request
+	*/
+	public function render_connector($config,$request){
+		$this->config->copy($config);
+		$this->request->copy($request);
+		return $this->render();
+	}	
+	
+	/*! render self
+		process commands, output requested data as XML
+	*/	
+	public function render(){
+		EventMaster::trigger_static("connectorInit",$this);
+		
+		$this->parse_request();
+		if ($this->live_update !== false && $this->updating!==false) {
+			$this->live_update->get_updates();
+		} else {
+			if ($this->editing){
+				$dp = new $this->names["data_class"]($this,$this->config,$this->request);
+				$dp->process($this->config,$this->request);
+			}
+			else {
+				$wrap = new SortInterface($this->request);
+				$this->event->trigger("beforeSort",$wrap);
+				$wrap->store();
+				
+				$wrap = new FilterInterface($this->request);
+				$this->event->trigger("beforeFilter",$wrap);
+				$wrap->store();
+		
+				$this->output_as_xml( $this->sql->select($this->request) );
+			}
+		}
+		$this->end_run();
+	}
+	
+	/*! prevent SQL injection through column names
+		replace dangerous chars in field names
+		@param str 
+			incoming field name
+		@return 
+			safe field name
+	*/
+	protected function safe_field_name($str){
+		return strtok($str, " \n\t;',");
+	}
+	
+	/*! limit max count of records
+		connector will ignore any records after outputing max count
+		@param limit 
+			max count of records
+		@return 
+			none
+	*/
+	public function set_limit($limit){
+		$this->limit = $limit;
+	}
+	
+	protected function parse_request_mode(){
+		//detect edit mode
+        if (isset($_GET["editing"])){
+			$this->editing=true;
+        } else if (isset($_POST["ids"])){
+			$this->editing=true;
+			LogMaster::log('While there is no edit mode mark, POST parameters similar to edit mode detected. \n Switching to edit mode ( to disable behavior remove POST[ids]');
+		} else if (isset($_GET['dhx_version'])){
+			$this->updating = true;
+        }
+	}
+	
+	/*! parse incoming request, detects commands and modes
+	*/
+	protected function parse_request(){
+		//set default dyn. loading params, can be reset in child classes
+		if ($this->dload)
+			$this->request->set_limit(0,$this->dload);
+		else if ($this->limit)
+			$this->request->set_limit(0,$this->limit);
+		
+		$this->parse_request_mode();
+
+        if ($this->live_update && ($this->updating || $this->editing)){
+            $this->request->set_version($_GET["dhx_version"]);
+            $this->request->set_user($_GET["dhx_user"]);
+        }
+		
+		if (isset($_GET["dhx_sort"]))
+			foreach($_GET["dhx_sort"] as $k => $v){
+				$k = $this->safe_field_name($k);
+				$this->request->set_sort($this->resolve_parameter($k),$v);
+			}
+				
+		if (isset($_GET["dhx_filter"]))
+			foreach($_GET["dhx_filter"] as $k => $v){
+				$k = $this->safe_field_name($k);
+				$this->request->set_filter($this->resolve_parameter($k),$v);
+			}
+			
+		
+	}
+
+	/*! convert incoming request name to the actual DB name
+		@param name 
+			incoming parameter name
+		@return 
+			name of related DB field
+	*/
+	protected function resolve_parameter($name){
+		return $name;
+	}
+
+
+	/*! replace xml unsafe characters
+
+		@param string
+			string to be escaped
+		@return
+			escaped string
+	*/
+	private function xmlentities($string) {
+   		return str_replace( array( '&', '"', "'", '<', '>', '’' ), array( '&amp;' , '&quot;', '&apos;' , '&lt;' , '&gt;', '&apos;' ), $string);
+	}
+    
+	/*! render from DB resultset
+		@param res
+			DB resultset 
+		process commands, output requested data as XML
+	*/
+	protected function render_set($res){
+		$output="";
+		$index=0;
+		$this->event->trigger("beforeRenderSet",$this,$res,$this->config);
+		while ($data=$this->sql->get_next($res)){
+			$data = new $this->names["item_class"]($data,$this->config,$index);
+			if ($data->get_id()===false)
+				$data->set_id($this->uuid());
+			$this->event->trigger("beforeRender",$data);
+			$output.=$data->to_xml();
+			$index++;
+		}
+		return $output;
+	}
+	
+	/*! output fetched data as XML
+		@param res
+			DB resultset 
+	*/
+	protected function output_as_xml($res){
+		$start="<?xml version='1.0' encoding='".$this->encoding."' ?>".$this->xml_start();
+		$end=$this->render_set($res).$this->xml_end();
+		
+		$out = new OutputWriter($start, $end);
+		$this->event->trigger("beforeOutput", $this, $out);
+		
+		$out->output();
+	}
+
+
+	/*! end processing
+		stop execution timer, kill the process
+	*/
+	protected function end_run(){
+		$time=microtime(true)-$this->exec_time;
+		LogMaster::log("Done in {$time}s");
+		flush();
+		die();
+	}
+	
+	/*! set xml encoding
+		
+		methods sets only attribute in XML, no real encoding conversion occurs	
+		@param encoding 
+			value which will be used as XML encoding
+	*/
+	public function set_encoding($encoding){
+		$this->encoding=$encoding;
+	}
+
+	/*! enable or disable dynamic loading mode
+		
+		@param count 
+			count of rows loaded from server, actual only for grid-connector, can be skiped in other cases. 
+			If value is a false or 0 - dyn. loading will be disabled
+	*/
+	public function dynamic_loading($count){
+		$this->dload=$count;
+	}	
+		
+	/*! enable logging
+		
+		@param path 
+			path to the log file. If set as false or empty strig - logging will be disabled
+		@param client_log
+			enable output of log data to the client side
+	*/
+	public function enable_log($path=true,$client_log=false){
+		LogMaster::enable_log($path,$client_log);
+	}
+	
+	/*! provides infor about current processing mode
+		@return 
+			true if processing dataprocessor command, false otherwise
+	*/
+	public function is_select_mode(){
+		$this->parse_request_mode();
+		return !$this->editing;
+	}
+	
+	public function is_first_call(){
+		$this->parse_request_mode();
+		return !($this->editing || $this->updating || $this->request->get_start() || sizeof($this->request->get_filters()) || sizeof($this->request->get_sort_by()));
+		
+	}
+	
+	/*! renders self as  xml, starting part
+	*/
+	protected function xml_start(){
+		return "<data>";
+	}
+	/*! renders self as  xml, ending part
+	*/
+	protected function xml_end(){
+		return "</data>";
+	}
+
+
+	public function insert($data) {
+		$action = new DataAction('inserted', false, $data);
+		$request = new DataRequestConfig();
+		$request->set_source($this->request->get_source());
+		
+		$this->config->limit_fields($data);
+		$this->sql->insert($action,$request);
+		$this->config->restore_fields($data);
+		
+		return $action->get_new_id();
+	}
+	
+	public function delete($id) {
+		$action = new DataAction('deleted', $id, array());
+		$request = new DataRequestConfig();
+		$request->set_source($this->request->get_source());
+		
+		$this->sql->delete($action,$request);
+		return $action->get_status();
+}
+
+	public function update($data) {
+		$action = new DataAction('updated', $data[$this->config->id["name"]], $data);
+		$request = new DataRequestConfig();
+		$request->set_source($this->request->get_source());
+
+		$this->config->limit_fields($data);
+		$this->sql->update($action,$request);
+		$this->config->restore_fields($data);
+		
+		return $action->get_status();
+	}
+
+	/*! sets actions_table for Optimistic concurrency control mode and start it
+		@param table_name
+			name of database table which will used for saving actions
+		@param url
+			url used for update notifications
+	*/	
+	public function enable_live_update($table, $url=false){
+		$this->live_update = new DataUpdate($this->sql, $this->config, $this->request, $table,$url);
+        $this->live_update->set_event($this->event,$this->names["item_class"]);
+		$this->event->attach("beforeOutput", 		Array($this->live_update, "version_output"));
+		$this->event->attach("beforeFiltering", 	Array($this->live_update, "get_updates"));
+		$this->event->attach("beforeProcessing", 	Array($this->live_update, "check_collision"));
+		$this->event->attach("afterProcessing", 	Array($this->live_update, "log_operations"));
+	}
+}
+
+
+/*! wrapper around options collection, used for comboboxes and filters
+**/
+class OptionsConnector extends Connector{
+	protected $init_flag=false;//!< used to prevent rendering while initialization
+	public function __construct($res,$type=false,$item_type=false,$data_type=false){
+		if (!$item_type) $item_type="DataItem";
+		if (!$data_type) $data_type=""; //has not sense, options not editable
+		parent::__construct($res,$type,$item_type,$data_type);
+	}
+	/*! render self
+		process commands, return data as XML, not output data to stdout, ignore parameters in incoming request
+		@return
+			data as XML string
+	*/	
+	public function render(){
+		if (!$this->init_flag){
+			$this->init_flag=true;
+			return "";
+		}
+		$res = $this->sql->select($this->request);
+		return $this->render_set($res);
+	}
+}
+
+
+
+class DistinctOptionsConnector extends OptionsConnector{
+	/*! render self
+		process commands, return data as XML, not output data to stdout, ignore parameters in incoming request
+		@return
+			data as XML string
+	*/	
+	public function render(){
+		if (!$this->init_flag){
+			$this->init_flag=true;
+			return "";
+		}
+		$res = $this->sql->get_variants($this->config->text[0]["db_name"],$this->request);
+		return $this->render_set($res);
+	}
+}
+
+?>

=== added file 'addons/base_calendar/static/lib/dhtmlxScheduler/codebase/connector/combo_connector.php'
--- addons/base_calendar/static/lib/dhtmlxScheduler/codebase/connector/combo_connector.php	1970-01-01 00:00:00 +0000
+++ addons/base_calendar/static/lib/dhtmlxScheduler/codebase/connector/combo_connector.php	2011-04-07 05:03:24 +0000
@@ -0,0 +1,89 @@
+<?php
+require_once("base_connector.php");
+/*! DataItem class for Combo component
+**/
+class ComboDataItem extends DataItem{
+	private $selected;//!< flag of selected option
+
+	function __construct($data,$config,$index){
+		parent::__construct($data,$config,$index);
+		
+		$this->selected=false;
+	}
+	/*! mark option as selected
+	*/
+	function select(){
+		$this->selected=true;
+	}
+	/*! return self as XML string, starting part
+	*/
+	function to_xml_start(){
+		if ($this->skip) return "";
+		
+		return "<option ".($this->selected?"selected='true'":"")."value='".$this->get_id()."'><![CDATA[".$this->data[$this->config->text[0]["name"]]."]]>";
+	}
+	/*! return self as XML string, ending part
+	*/
+	function to_xml_end(){
+		if ($this->skip) return "";
+		return "</option>";
+	}
+}
+
+/*! Connector for the dhtmlxCombo
+**/
+class ComboConnector extends Connector{
+	private $filter; //!< filtering mask from incoming request
+	private $position; //!< position from incoming request
+
+	/*! constructor
+		
+		Here initilization of all Masters occurs, execution timer initialized
+		@param res 
+			db connection resource
+		@param type
+			string , which hold type of database ( MySQL or Postgre ), optional, instead of short DB name, full name of DataWrapper-based class can be provided
+		@param item_type
+			name of class, which will be used for item rendering, optional, DataItem will be used by default
+		@param data_type
+			name of class which will be used for dataprocessor calls handling, optional, DataProcessor class will be used by default. 
+	*/	
+	public function __construct($res,$type=false,$item_type=false,$data_type=false){
+		if (!$item_type) $item_type="ComboDataItem";
+		parent::__construct($res,$type,$item_type,$data_type);
+	}	
+	
+	//parse GET scoope, all operations with incoming request must be done here
+	function parse_request(){
+		parent::parse_request();
+		
+		if (isset($_GET["pos"])){
+			if (!$this->dload)	//not critical, so just write a log message
+				LogMaster::log("Dyn loading request received, but server side was not configured to process dyn. loading. ");
+			else
+				$this->request->set_limit($_GET["pos"],$this->dload);
+		}
+			
+		if (isset($_GET["mask"]))
+			$this->request->set_filter($this->config->text[0]["name"],$_GET["mask"]."%","LIKE");
+			
+		LogMaster::log($this->request);
+	}
+	
+	
+	/*! renders self as  xml, starting part
+	*/
+	public function xml_start(){
+		if ($this->request->get_start())
+			return "<complete add='true'>";
+		else
+			return "<complete>";
+	}
+	
+	/*! renders self as  xml, ending part
+	*/
+	public function xml_end(){
+		return "</complete>";
+	}		
+}
+?>
\ No newline at end of file

=== added file 'addons/base_calendar/static/lib/dhtmlxScheduler/codebase/connector/connector.js'
--- addons/base_calendar/static/lib/dhtmlxScheduler/codebase/connector/connector.js	1970-01-01 00:00:00 +0000
+++ addons/base_calendar/static/lib/dhtmlxScheduler/codebase/connector/connector.js	2011-04-07 05:03:24 +0000
@@ -0,0 +1,143 @@
+/*
+This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
+to use it in not GPL project. Please contact sales@xxxxxxxxxx for details
+
+(c) DHTMLX Ltd.
+*/
+/*
+	dhx_sort[index]=direction
+	dhx_filter[index]=mask
+*/
+if (window.dhtmlXGridObject){
+	dhtmlXGridObject.prototype._init_point_connector=dhtmlXGridObject.prototype._init_point;
+	dhtmlXGridObject.prototype._init_point=function(){
+		var clear_url=function(url){
+			url=url.replace(/(\?|\&)connector[^\f]*/g,"");
+			return url+(url.indexOf("?")!=-1?"&":"?")+"connector=true";
+		}
+		var combine_urls=function(url){
+			return clear_url(url)+(this._connector_sorting||"")+(this._connector_filter||"");
+		}
+		var sorting_url=function(url,ind,dir){
+			this._connector_sorting="&dhx_sort["+ind+"]="+dir;
+			return combine_urls.call(this,url);
+		}
+		var filtering_url=function(url,inds,vals){
+			for (var i=0; i<inds.length; i++)
+				inds[i]="dhx_filter["+inds[i]+"]="+encodeURIComponent(vals[i]);
+			this._connector_filter="&"+inds.join("&");
+			return combine_urls.call(this,url);
+		}
+		this.attachEvent("onCollectValues",function(ind){
+			if (this._con_f_used[ind]){
+				if (typeof(this._con_f_used[ind]) == "object")
+					return this._con_f_used[ind];
+				else
+					return false;
+			}
+			return true;
+		});	
+		this.attachEvent("onDynXLS",function(){
+				this.xmlFileUrl=combine_urls.call(this,this.xmlFileUrl);
+				return true;
+		});				
+		this.attachEvent("onBeforeSorting",function(ind,type,dir){
+			if (type=="connector"){
+				var self=this;
+				this.clearAndLoad(sorting_url.call(this,this.xmlFileUrl,ind,dir),function(){
+					self.setSortImgState(true,ind,dir);
+				});
+				return false;
+			}
+			return true;
+		});
+		this.attachEvent("onFilterStart",function(a,b){
+			if (this._con_f_used.length){
+				this.clearAndLoad(filtering_url.call(this,this.xmlFileUrl,a,b));
+				return false;
+			}
+			return true;
+		});
+		this.attachEvent("onXLE",function(a,b,c,xml){
+			if (!xml) return;
+		});
+		
+		if (this._init_point_connector) this._init_point_connector();
+	}
+	dhtmlXGridObject.prototype._con_f_used=[];
+	dhtmlXGridObject.prototype._in_header_connector_text_filter=function(t,i){
+		if (!this._con_f_used[i])
+			this._con_f_used[i]=1;
+		return this._in_header_text_filter(t,i);
+	}
+	dhtmlXGridObject.prototype._in_header_connector_select_filter=function(t,i){
+		if (!this._con_f_used[i])
+			this._con_f_used[i]=2;
+		return this._in_header_select_filter(t,i);
+	}
+	dhtmlXGridObject.prototype.load_connector=dhtmlXGridObject.prototype.load;
+	dhtmlXGridObject.prototype.load=function(url, call, type){
+		if (!this._colls_loaded && this.cellType){
+			var ar=[];
+			for (var i=0; i < this.cellType.length; i++)
+				if (this.cellType[i].indexOf("co")==0 || this._con_f_used[i]==2) ar.push(i);
+			if (ar.length)
+				arguments[0]+=(arguments[0].indexOf("?")!=-1?"&":"?")+"connector=true&dhx_colls="+ar.join(",");
+		}
+		return this.load_connector.apply(this,arguments);
+	}
+	dhtmlXGridObject.prototype._parseHead_connector=dhtmlXGridObject.prototype._parseHead;
+	dhtmlXGridObject.prototype._parseHead=function(url, call, type){
+		this._parseHead_connector.apply(this,arguments);
+		if (!this._colls_loaded){
+			var cols = this.xmlLoader.doXPath("./coll_options", arguments[0]);
+			for (var i=0; i < cols.length; i++){
+				var f = cols[i].getAttribute("for");
+				var v = [];
+				var combo=null;
+				if (this.cellType[f] == "combo")
+					combo = this.getColumnCombo(f);
+				if (this.cellType[f].indexOf("co")==0)
+					combo=this.getCombo(f);
+					
+				var os = this.xmlLoader.doXPath("./item",cols[i]);
+				for (var j=0; j<os.length; j++){
+					var val=os[j].getAttribute("value");
+					
+					if (combo){
+						var lab=os[j].getAttribute("label")||val;
+						
+						if (combo.addOption)
+							combo.addOption([[val, lab]]);
+						else
+							combo.put(val,lab);
+							
+						v[v.length]=lab;
+					} else
+						v[v.length]=val;
+				}
+				if (this._con_f_used[f*1])
+					this._con_f_used[f*1]=v;
+			};
+			this._colls_loaded=true;
+		}
+	}	
+	
+	
+	
+
+}
+
+if (window.dataProcessor){
+	dataProcessor.prototype.init_original=dataProcessor.prototype.init;
+	dataProcessor.prototype.init=function(obj){
+		this.init_original(obj);
+		obj._dataprocessor=this;
+		
+		this.setTransactionMode("POST",true);
+		this.serverProcessor+=(this.serverProcessor.indexOf("?")!=-1?"&":"?")+"editing=true";
+	}
+}
+dhtmlxError.catchError("LoadXML",function(a,b,c){
+	alert(c[0].responseText);
+});

=== added file 'addons/base_calendar/static/lib/dhtmlxScheduler/codebase/connector/crosslink_connector.php'
--- addons/base_calendar/static/lib/dhtmlxScheduler/codebase/connector/crosslink_connector.php	1970-01-01 00:00:00 +0000
+++ addons/base_calendar/static/lib/dhtmlxScheduler/codebase/connector/crosslink_connector.php	2011-04-07 05:03:24 +0000
@@ -0,0 +1,120 @@
+<?php
+
+class DelayedConnector extends Connector{
+	protected $init_flag=false;//!< used to prevent rendering while initialization
+	private $data_mode=false;//!< flag to separate xml and data request modes
+	private $data_result=false;//<! store results of query
+	
+	public function dataMode($name){
+		$this->data_mode = $name;
+		$this->data_result=array();
+	}
+	public function getDataResult(){
+		return $this->data_result;
+	}
+	
+	public function render(){
+		if (!$this->init_flag){
+			$this->init_flag=true;
+			return "";
+		}
+		return parent::render();
+	}
+	
+	protected function output_as_xml($res){
+		if ($this->data_mode){
+			while ($data=$this->sql->get_next($res)){
+				$this->data_result[]=$data[$this->data_mode];
+			}
+		}
+		else 
+			return parent::output_as_xml($res);
+	}
+	protected function end_run(){
+		if (!$this->data_mode)
+			parent::end_run();
+	}
+}
+	
+class CrossOptionsConnector extends Connector{
+	public $options, $link;
+	private $master_name, $link_name, $master_value;
+	
+	public function __construct($res,$type=false,$item_type=false,$data_type=false){
+		$this->options = new OptionsConnector($res,$type,$item_type,$data_type);
+		$this->link = new DelayedConnector($res,$type,$item_type,$data_type);
+		
+		EventMaster::attach_static("connectorInit",array($this, "handle"));
+	}
+	public function handle($conn){
+		if ($conn instanceof DelayedConnector) return;
+		if ($conn instanceof OptionsConnector) return;
+		
+		$this->master_name = $this->link->get_config()->id["db_name"];
+		$this->link_name = $this->options->get_config()->id["db_name"];
+	
+		$this->link->event->attach("beforeFilter",array($this, "get_only_related"));
+		
+		if (isset($_GET["dhx_crosslink_".$this->link_name])){
+			$this->get_links($_GET["dhx_crosslink_".$this->link_name]);
+			die();
+		}
+		
+		if (!$this->dload){
+			$conn->event->attach("beforeRender", array($this, "getOptions"));
+			$conn->event->attach("beforeRenderSet", array($this, "prepareConfig"));
+		}
+		
+		
+		$conn->event->attach("afterProcessing", array($this, "afterProcessing"));
+	}
+	public function prepareConfig($conn, $res, $config){
+		$config->add_field($this->link_name);
+	}
+	public function getOptions($data){
+		$this->link->dataMode($this->link_name);
+
+		$this->get_links($data->get_value($this->master_name));
+		
+		$data->set_value($this->link_name, implode(",",$this->link->getDataResult()));
+	}
+	public function get_links($id){
+		$this->master_value = $id;
+		$this->link->render();
+	}
+	public function get_only_related($filters){
+		$index = $filters->index($this->master_name);
+		if ($index!==false){
+			$filters->rules[$index]["value"]=$this->master_value;
+		} else
+			$filters->add($this->master_name, $this->master_value, "=");
+	}
+	public function afterProcessing($action){
+		$status = $action->get_status();
+		
+		$master_key = $action->get_value($this->master_name);	
+		$link_key = $action->get_value($this->link_name);
+		$link_key = explode(',', $link_key);
+		
+		if ($status == "inserted")
+			$master_key = $action->get_new_id();
+			
+		switch ($status){
+			case "deleted":
+				$this->link->delete($master_key);
+				break;
+			case "updated":
+				$this->link->delete($master_key);
+			case "inserted":
+				for ($i=0; $i < sizeof($link_key); $i++)
+					if ($link_key[$i]!="")
+						$this->link->insert(array(
+							$this->link_name => $link_key[$i],
+							$this->master_name => $master_key
+						));
+				break;
+		}
+	}
+}
+
+?>
\ No newline at end of file

=== added file 'addons/base_calendar/static/lib/dhtmlxScheduler/codebase/connector/dataprocessor.php'
--- addons/base_calendar/static/lib/dhtmlxScheduler/codebase/connector/dataprocessor.php	1970-01-01 00:00:00 +0000
+++ addons/base_calendar/static/lib/dhtmlxScheduler/codebase/connector/dataprocessor.php	2011-04-07 05:03:24 +0000
@@ -0,0 +1,465 @@
+<?php
+/*! Base DataProcessor handling
+**/
+class DataProcessor{
+	protected $connector;//!< Connector instance
+	protected $config;//!< DataConfig instance
+	protected $request;//!< DataRequestConfig instance
+	
+	/*! constructor
+		
+		@param connector 
+			Connector object
+		@param config
+			DataConfig object
+		@param request
+			DataRequestConfig object
+	*/
+	function __construct($connector,$config,$request){
+		$this->connector= $connector;
+		$this->config=$config;
+		$this->request=$request;
+	}
+	
+	/*! convert incoming data name to valid db name
+		redirect to Connector->name_data by default
+		@param data 
+			data name from incoming request
+		@return 
+			related db_name
+	*/
+	function name_data($data){
+		return $data;
+	}
+	/*! retrieve data from incoming request and normalize it
+		
+		@param ids 
+			array of extected IDs
+		@return 
+			hash of data
+	*/
+	function get_post_values($ids){
+		$data=array(); 
+		for ($i=0; $i < sizeof($ids); $i++)
+			$data[$ids[$i]]=array();
+		
+		foreach ($_POST as $key => $value) {
+			$details=explode("_",$key,2);
+			if (sizeof($details)==1) continue;
+			
+			$name=$this->name_data($details[1]);
+			$data[$details[0]][$name]=$value;
+		}
+			
+		return $data;
+	}
+	/*! process incoming request ( save|update|delete )
+	*/
+	function process(){
+		LogMaster::log("DataProcessor object initialized",$_POST);
+		
+		$results=array();
+
+		if (!isset($_POST["ids"]))
+			throw new Exception("Incorrect incoming data, ID of incoming records not recognized");
+			
+		$ids=explode(",",$_POST["ids"]);
+		$rows_data=$this->get_post_values($ids);
+		$failed=false;
+		
+		try{
+			if ($this->connector->sql->is_global_transaction())
+				$this->connector->sql->begin_transaction();
+			
+			for ($i=0; $i < sizeof($ids); $i++) { 
+				$rid = $ids[$i];
+				LogMaster::log("Row data [{$rid}]",$rows_data[$rid]);
+				
+				if (!isset($_POST[$rid."_!nativeeditor_status"]))
+					throw new Exception("Status of record [{$rid}] not found in incoming request");
+				$status = $_POST[$rid."_!nativeeditor_status"];
+				
+				$action=new DataAction($status,$rid,$rows_data[$rid]);
+				$results[]=$action;
+				$this->inner_process($action);
+			}
+			
+		} catch(Exception $e){
+			$failed=true;
+		}
+		
+		if ($this->connector->sql->is_global_transaction()){
+			if (!$failed)
+				for ($i=0; $i < sizeof($results); $i++)
+					if ($results[$i]->get_status()=="error" || $results[$i]->get_status()=="invalid"){
+						$failed=true; 
+						break;
+					}
+			if ($failed){
+				for ($i=0; $i < sizeof($results); $i++)
+					$results[$i]->error();
+				$this->connector->sql->rollback_transaction();
+			}
+			else
+				$this->connector->sql->commit_transaction();
+		}
+		
+		$this->output_as_xml($results);
+	}	
+	
+	/*! converts status string to the inner mode name
+		
+		@param status 
+			external status string
+		@return 
+			inner mode name
+	*/
+	protected function status_to_mode($status){
+		switch($status){
+			case "updated":
+				return "update";
+				break;
+			case "inserted":
+				return "insert";
+				break;
+			case "deleted":
+				return "delete";
+				break;
+			default:
+				return $status;
+				break;
+		}
+	}
+	/*! process data updated request received
+		
+		@param action 
+			DataAction object
+		@return 
+			DataAction object with details of processing
+	*/
+	protected function inner_process($action){
+		
+		if ($this->connector->sql->is_record_transaction())
+				$this->connector->sql->begin_transaction();		
+		
+		try{
+				
+			$mode = $this->status_to_mode($action->get_status());
+			if (!$this->connector->access->check($mode)){
+				LogMaster::log("Access control: {$operation} operation blocked");
+				$action->error();
+			} else {
+				$check = $this->connector->event->trigger("beforeProcessing",$action);
+				if (!$action->is_ready())
+					$this->check_exts($action,$mode);
+				$check = $this->connector->event->trigger("afterProcessing",$action);
+			}
+		
+		} catch (Exception $e){
+			$action->set_status("error");
+		}
+		
+		if ($this->connector->sql->is_record_transaction()){
+			if ($action->get_status()=="error" || $action->get_status()=="invalid")
+				$this->connector->sql->rollback_transaction();		
+			else
+				$this->connector->sql->commit_transaction();		
+		}
+				
+		return $action;
+	}
+	/*! check if some event intercepts processing, send data to DataWrapper in other case
+
+		@param action 
+			DataAction object
+		@param mode
+			name of inner mode ( will be used to generate event names )
+	*/
+	function check_exts($action,$mode){
+		$old_config = new DataConfig($this->config);
+		
+		$this->connector->event->trigger("before".$mode,$action);
+		if ($action->is_ready())
+			LogMaster::log("Event code for ".$mode." processed");
+		else {
+			//check if custom sql defined
+			$sql = $this->connector->sql->get_sql($mode,$action);
+			if ($sql)
+				$this->connector->sql->query($sql);
+			else{
+				$action->sync_config($this->config);
+				$method=array($this->connector->sql,$mode);
+				if (!is_callable($method))
+					throw new Exception("Unknown dataprocessing action: ".$mode);
+				call_user_func($method,$action,$this->request);
+			}
+		}
+		$this->connector->event->trigger("after".$mode,$action);
+		
+		$this->config = $old_config;
+	}
+	
+	/*! output xml response for dataprocessor
+
+		@param  results
+			array of DataAction objects
+	*/
+	function output_as_xml($results){
+		LogMaster::log("Edit operation finished",$results);
+		ob_clean();
+		header("Content-type:text/xml");
+		echo "<?xml version='1.0' ?>";
+		echo "<data>";
+		for ($i=0; $i < sizeof($results); $i++)
+			echo $results[$i]->to_xml();
+		echo "</data>";
+	}		
+	
+}
+
+/*! contain all info related to action and controls customizaton
+**/
+class DataAction{
+	private $status; //!< cuurent status of record
+	private $id;//!< id of record
+	private $data;//!< data hash of record
+	private $userdata;//!< hash of extra data , attached to record
+	private $nid;//!< new id value , after operation executed
+	private $output;//!< custom output to client side code
+	private $attrs;//!< hash of custtom attributes
+	private $ready;//!< flag of operation's execution
+	private $addf;//!< array of added fields
+	private $delf;//!< array of deleted fields
+	
+	
+	/*! constructor
+		
+		@param status 
+			current operation status
+		@param id
+			record id
+		@param data
+			hash of data
+	*/
+	function __construct($status,$id,$data){
+		$this->status=$status;
+		$this->id=$id;
+		$this->data=$data;	
+		$this->nid=$id;
+		
+		$this->output="";
+		$this->attrs=array();
+		$this->ready=false;
+		
+		$this->addf=array();
+		$this->delf=array();
+	}
+
+	
+	/*! add custom field and value to DB operation
+		
+		@param name 
+			name of field which will be added to DB operation
+		@param value
+			value which will be used for related field in DB operation
+	*/
+	function add_field($name,$value){
+		LogMaster::log("adding field: ".$name.", with value: ".$value);
+		$this->data[$name]=$value;
+		$this->addf[]=$name;
+	}
+	/*! remove field from DB operation
+		
+		@param name 
+			name of field which will be removed from DB operation
+	*/
+	function remove_field($name){
+		LogMaster::log("removing field: ".$name);
+		$this->delf[]=$name;
+	}
+	
+	/*! sync field configuration with external object
+		
+		@param slave 
+			SQLMaster object
+		@todo 
+			check , if all fields removed then cancel action
+	*/
+	function sync_config($slave){
+		foreach ($this->addf as $k => $v)
+			$slave->add_field($v);
+		foreach ($this->delf as $k => $v)
+			$slave->remove_field($v);
+	}
+	/*! get value of some record's propery
+		
+		@param name 
+			name of record's property ( name of db field or alias )
+		@return 
+			value of related property
+	*/
+	function get_value($name){
+		if (!array_key_exists($name,$this->data)){
+			LogMaster::log("Incorrect field name used: ".$name);
+			LogMaster::log("data",$this->data);
+			return "";
+		}
+		return $this->data[$name];
+	}
+	/*! set value of some record's propery
+		
+		@param name 
+			name of record's property ( name of db field or alias )
+		@param value
+			value of related property
+	*/
+	function set_value($name,$value){
+		LogMaster::log("change value of: ".$name." as: ".$value);
+		$this->data[$name]=$value;
+	}
+	/*! get hash of data properties
+		
+		@return 
+			hash of data properties
+	*/
+	function get_data(){
+		return $this->data;
+	}
+	/*! get some extra info attached to record
+		deprecated, exists just for backward compatibility, you can use set_value instead of it
+		@param name 
+			name of userdata property
+		@return 
+			value of related userdata property
+	*/
+	function get_userdata_value($name){
+		return $this->get_value($name);
+	}
+	/*! set some extra info attached to record
+		deprecated, exists just for backward compatibility, you can use get_value instead of it
+		@param name 
+			name of userdata property
+		@param value
+			value of userdata property
+	*/
+	function set_userdata_value($name,$value){
+		return $this->set_value($name,$value);
+	}
+	/*! get current status of record
+		
+		@return 
+			string with status value
+	*/
+	function get_status(){
+		return $this->status;
+	}
+	/*! assign new status to the record
+		
+		@param status 
+			new status value
+	*/
+	function set_status($status){
+		$this->status=$status;
+	}
+	/*! get id of current record
+		
+		@return 
+			id of record
+	*/
+	function get_id(){
+		return $this->id;
+	}
+	/*! sets custom response text
+		
+		can be accessed through defineAction on client side. Text wrapped in CDATA, so no extra escaping necessary
+		@param text 
+			custom response text
+	*/
+	function set_response_text($text){
+		$this->set_response_xml("<![CDATA[".$text."]]>");
+	}
+	/*! sets custom response xml
+		
+		can be accessed through defineAction on client side
+		@param text
+			string with XML data
+	*/
+	function set_response_xml($text){
+		$this->output=$text;
+	}
+	/*! sets custom response attributes
+		
+		can be accessed through defineAction on client side
+		@param name
+			name of custom attribute
+		@param value
+			value of custom attribute
+	*/
+	function set_response_attribute($name,$value){
+		$this->attrs[$name]=$value;
+	}
+	/*! check if action finished 
+		
+		@return 
+			true if action finished, false otherwise
+	*/
+	function is_ready(){
+		return $this->ready;
+	}	
+	/*! return new id value
+	
+		equal to original ID normally, after insert operation - value assigned for new DB record	
+		@return 
+			new id value
+	*/
+	function get_new_id(){
+		return $this->nid;
+	}
+	
+	/*! set result of operation as error
+	*/
+	function error(){
+		$this->status="error";
+		$this->ready=true;
+	}
+	/*! set result of operation as invalid
+	*/
+	function invalid(){
+		$this->status="invalid";
+		$this->ready=true;
+	}
+	/*! confirm successful opeation execution
+		@param  id
+			new id value, optional
+	*/
+	function success($id=false){
+		if ($id!==false)
+			$this->nid = $id;
+		$this->ready=true;
+	}
+	/*! convert DataAction to xml format compatible with client side dataProcessor
+		@return 
+			DataAction operation report as XML string
+	*/
+	function to_xml(){
+		$str="<action type='{$this->status}' sid='{$this->id}' tid='{$this->nid}' ";
+		foreach ($this->attrs as $k => $v) {
+			$str.=$k."='".$v."' ";
+		}
+		$str.=">{$this->output}</action>";	
+		return $str;
+	}
+	/*! convert self to string ( for logs )
+		
+		@return 
+			DataAction operation report as plain string 
+	*/
+	function __toString(){
+		return "action:{$this->status}; sid:{$this->id}; tid:{$this->nid};";
+	}
+	
+
+}
+
+
+?>
\ No newline at end of file

=== added file 'addons/base_calendar/static/lib/dhtmlxScheduler/codebase/connector/db_common.php'
--- addons/base_calendar/static/lib/dhtmlxScheduler/codebase/connector/db_common.php	1970-01-01 00:00:00 +0000
+++ addons/base_calendar/static/lib/dhtmlxScheduler/codebase/connector/db_common.php	2011-04-07 05:03:24 +0000
@@ -0,0 +1,959 @@
+<?php
+require_once("tools.php");
+
+/*! manager of data request
+**/
+class DataRequestConfig{
+	private $filters;	//!< array of filtering rules
+	private $relation=false;	//!< ID or other element used for linking hierarchy
+	private $sort_by;	//!< sorting field 
+	private $start;	//!< start of requested data
+	private $count;	//!< length of requested data
+
+    private $user;
+    private $version;
+	
+	//for render_sql
+	private $source;	//!< souce table or another source destination
+	private $fieldset;	//!< set of data, which need to be retrieved from source
+	
+	/*! constructor
+
+		@param proto 
+			DataRequestConfig object, optional, if provided then new request object will copy all properties from provided one
+	*/
+	public function __construct($proto=false){
+		if ($proto)
+			$this->copy($proto);
+		else{
+			$start=0;
+			$this->filters=array();
+			$this->sort_by=array();
+		}
+	}
+	
+	/*! copy parameters of source object into self
+		
+		@param proto 
+			source object
+	*/
+	public function copy($proto){
+		$this->filters	=$proto->get_filters();
+		$this->sort_by	=$proto->get_sort_by();
+		$this->count	=$proto->get_count();
+		$this->start	=$proto->get_start();
+		$this->source	=$proto->get_source();
+		$this->fieldset	=$proto->get_fieldset();
+		$this->relation		=$proto->get_relation();
+        $this->user = $proto->user;
+        $this->version = $proto->version;
+	}
+	
+	/*! convert self to string ( for logs )
+		@return 
+			self as plain string,
+	*/
+	public function __toString(){
+		$str="Source:{$this->source}\nFieldset:{$this->fieldset}\nWhere:";
+		for ($i=0; $i < sizeof($this->filters); $i++)
+			$str.=$this->filters[$i]["name"]." ".$this->filters[$i]["operation"]." ".$this->filters[$i]["value"].";";
+		$str.="\nStart:{$this->start}\nCount:{$this->count}\n";
+		for ($i=0; $i < sizeof($this->sort_by); $i++)
+			$str.=$this->sort_by[$i]["name"]."=".$this->sort_by[$i]["direction"].";";
+		$str.="\nRelation:{$this->relation}";
+		return $str;
+	}
+
+	/*! returns set of filtering rules
+		@return 
+			set of filtering rules
+	*/
+	public function get_filters(){
+		return $this->filters;
+	}
+	public function &get_filters_ref(){
+		return $this->filters;
+	}
+	public function set_filters($data){
+		$this->filters=$data;
+	}
+
+
+    public function get_user(){
+        return $this->user;
+    }
+    public function set_user($user){
+        $this->user = $user;
+    }
+    public function get_version(){
+        return $this->version;
+    }
+    public function set_version($version){
+        $this->version = $version;
+    }
+
+	/*! returns list of used fields
+		@return 
+			list of used fields
+	*/
+	public function get_fieldset(){
+		return $this->fieldset;
+	}
+	/*! returns name of source table 
+		@return 
+			name of source table 
+	*/
+	public function get_source(){
+		return $this->source;
+	}
+	/*! returns set of sorting rules
+		@return 
+			set of sorting rules
+	*/
+	public function get_sort_by(){
+		return $this->sort_by;
+	}
+	public function &get_sort_by_ref(){
+		return $this->sort_by;
+	}
+	public function set_sort_by($data){
+		$this->sort_by=$data;
+	}
+	
+	/*! returns start index 
+		@return 
+			start index
+	*/
+	public function get_start(){
+		return $this->start;
+	}
+	/*! returns count of requested records
+		@return 
+			count of requested records
+	*/
+	public function get_count(){
+		return $this->count;
+	}
+	/*! returns name of relation id
+		@return 
+			relation id name
+	*/
+	public function get_relation(){
+		return $this->relation;
+	}
+	
+	/*! sets sorting rule
+		
+		@param field 
+			name of column
+		@param order
+			direction of sorting
+	*/
+	public function set_sort($field,$order=false){
+		if (!$field && !$order)
+			$this->sort_by=array();
+		else{
+			$order=strtolower($order)=="asc"?"ASC":"DESC";
+			$this->sort_by[]=array("name"=>$field,"direction" => $order);
+		}
+	}
+	/*! sets filtering rule
+		
+		@param field 
+			name of column
+		@param value
+			value for filtering
+		@param operation
+			operation for filtering, optional , LIKE by default
+	*/
+	public function set_filter($field,$value,$operation=false){
+		array_push($this->filters,array("name"=>$field,"value"=>$value,"operation"=>$operation));
+	}
+	
+	/*! sets list of used fields
+		
+		@param value
+			list of used fields
+	*/
+	public function set_fieldset($value){
+		$this->fieldset=$value;
+	}
+	/*! sets name of source table
+		
+		@param value 
+			name of source table
+	*/
+	public function set_source($value){
+		$this->source=trim($value);
+		if (!$this->source) throw new Exception("Source of data can't be empty");
+	}
+	/*! sets data limits
+		
+		@param start
+			start index
+		@param count
+			requested count of data
+	*/
+	public function set_limit($start,$count){
+		$this->start=$start;
+		$this->count=$count;
+	}
+	/*! sets name of relation id
+		
+		@param value 
+			name of relation id field
+	*/
+	public function set_relation($value){
+		$this->relation=$value;
+	}
+	/*! parse incoming sql, to fill other properties
+		
+		@param sql
+			incoming sql string
+	*/
+	public function parse_sql($sql){
+		$sql= preg_replace("/[ \n\t]+limit[\n ,0-9]/i","",$sql);
+		
+		$data = preg_split("/[ \n\t]+\\_from\\_/i",$sql,2);
+		if (count($data)!=2)
+			$data = preg_split("/[ \n\t]+from/i",$sql,2);
+		$this->fieldset = preg_replace("/^[\s]*select/i","",$data[0],1);
+		
+	  	$table_data = preg_split("/[ \n\t]+where/i",$data[1],2);
+	  	if (sizeof($table_data)>1){ //where construction exists
+	  		$this->set_source($table_data[0]);
+  			$where_data = preg_split("/[ \n\t]+order[ ]+by/i",$table_data[1],2);
+  			$this->filters[]=$where_data[0];
+  			if (sizeof($where_data)==1) return; //end of line detected
+  			$data=$where_data[1];
+  		} else {
+  			$table_data = preg_split("/[ \n\t]+order[ ]+by/i",$table_data[0],2);	
+  			$this->set_source($table_data[0]);
+  			if (sizeof($table_data)==1) return; //end of line detected
+  			$data=$table_data[1];
+  		}
+	  	
+      	if (trim($data)){ //order by construction exists
+			$s_data = preg_split("/\\,/",trim($data));
+			for ($i=0; $i < count($s_data); $i++) { 
+				$data=preg_split("/[ ]+/",trim($s_data[$i]),2);
+				$this->set_sort($data[0],$data[1]);
+			}
+			
+		}
+	}
+}
+	
+/*! manager of data configuration
+**/
+class DataConfig{
+	public $id;////!< name of ID field
+	public $relation_id;//!< name or relation ID field
+	public $text;//!< array of text fields
+	public $data;//!< array of all known fields , fields which exists only in this collection will not be included in dataprocessor's operations
+	
+	
+	/*! converts self to the string, for logging purposes
+	**/
+	public function __toString(){
+		$str="ID:{$this->id['db_name']}(ID:{$this->id['name']})\n";
+		$str.="Relation ID:{$this->relation_id['db_name']}({$this->relation_id['name']})\n";
+		$str.="Data:";
+		for ($i=0; $i<sizeof($this->text); $i++)
+			$str.="{$this->text[$i]['db_name']}({$this->text[$i]['name']}),";
+			
+		$str.="\nExtra:";
+		for ($i=0; $i<sizeof($this->data); $i++)
+			$str.="{$this->data[$i]['db_name']}({$this->data[$i]['name']}),";
+			
+		return $str;
+	}
+	
+	/*! removes un-used fields from configuration
+		@param name 
+			name of field , which need to be preserved
+	*/
+	public function minimize($name){
+		for ($i=0; $i < sizeof($this->text); $i++){
+			if ($this->text[$i]["name"]==$name){
+				$this->text[$i]["name"]="value";
+				$this->data=array($this->text[$i]);
+				$this->text=array($this->text[$i]);
+				return;
+			}
+		}
+		throw new Exception("Incorrect dataset minimization, master field not found.");
+	}
+	
+	public function limit_fields($data){
+		if (isset($this->full_field_list))
+			$this->restore_fields();
+		$this->full_field_list = $this->text;
+		$this->text = array();
+			
+		for ($i=0; $i < sizeof($this->full_field_list); $i++) { 
+			if (array_key_exists($this->full_field_list[$i]["name"],$data))
+				$this->text[] = $this->full_field_list[$i];
+		}
+	}
+	
+	public function restore_fields(){
+		if (isset($this->full_field_list))
+			$this->text = $this->full_field_list;
+	}
+	
+	/*! initialize inner state by parsing configuration parameters
+
+		@param id 
+			name of id field
+		@param fields
+			name of data field(s)
+		@param extra
+			name of extra field(s)
+		@param relation
+			name of relation field
+			
+	*/
+	public function init($id,$fields,$extra,$relation){
+		$this->id	= $this->parse($id,false);
+		$this->text = $this->parse($fields,true);
+		$this->data	= array_merge($this->text,$this->parse($extra,true));
+		$this->relation_id = $this->parse($relation,false);
+	}
+	
+	/*! parse configuration string
+		
+		@param key 
+			key string from configuration
+		@param mode
+			multi names flag
+		@return 
+			parsed field name object
+	*/
+	private function parse($key,$mode){
+		if ($mode){
+			if (!$key) return array();
+			$key=explode(",",$key);
+			for ($i=0; $i < sizeof($key); $i++)
+				$key[$i]=$this->parse($key[$i],false);
+			return $key;
+		}
+		$key=explode("(",$key);
+		$data=array("db_name"=>trim($key[0]), "name"=>trim($key[0]));
+		if (sizeof($key)>1)
+			$data["name"]=substr(trim($key[1]),0,-1);
+		return $data;		
+	}
+	
+	/*! constructor
+		init public collectons
+		@param proto
+			DataConfig object used as prototype for new one, optional
+	*/
+	public function __construct($proto=false){
+		if ($proto!==false)
+			$this->copy($proto);
+		else {
+			$this->text=array();
+			$this->data=array();
+			$this->id=array("name"=>"dhx_auto_id", "db_name"=>"dhx_auto_id");
+			$this->relation_id=array("name"=>"", "db_name"=>"");
+		}
+	}
+	
+	/*! copy properties from source object
+		
+		@param proto 
+			source object
+	*/
+	public function copy($proto){
+		$this->id = $proto->id;
+		$this->relation_id = $proto->relation_id;
+		$this->text = $proto->text;
+		$this->data = $proto->data;			
+	}
+
+	/*! returns list of data fields (db_names)
+		@return 
+			list of data fields ( ready to be used in SQL query )
+	*/
+	public function db_names_list($db){
+		$out=array();
+		if ($this->id["db_name"])
+			array_push($out,$db->escape_name($this->id["db_name"]));
+		if ($this->relation_id["db_name"])
+			array_push($out,$db->escape_name($this->relation_id["db_name"]));
+		
+		for ($i=0; $i < sizeof($this->data); $i++){
+			if ($this->data[$i]["db_name"]!=$this->data[$i]["name"])
+				$out[]=$db->escape_name($this->data[$i]["db_name"])." as ".$this->data[$i]["name"];
+			else
+				$out[]=$db->escape_name($this->data[$i]["db_name"]);
+		}
+		
+		return $out;
+	}
+	
+	/*! add field to dataset config ($text collection)
+	
+		added field will be used in all auto-generated queries
+		@param name 
+			name of field
+		@param aliase
+			aliase of field, optional
+	*/	
+	public function add_field($name,$aliase=false){
+		if ($aliase===false) $aliase=$name;
+		
+		//adding to list of data-active fields
+		if ($this->id["db_name"]==$name || $this->relation_id["db_name"] == $name){
+			LogMaster::log("Field name already used as ID, be sure that it is really necessary.");
+		}
+		if ($this->is_field($name,$this->text)!=-1)
+			throw new Exception('Data field already registered: '.$name);
+		array_push($this->text,array("db_name"=>$name,"name"=>$aliase));
+		
+		//adding to list of all fields as well
+		if ($this->is_field($name,$this->data)==-1)
+			array_push($this->data,array("db_name"=>$name,"name"=>$aliase));
+		
+	}
+	
+	/*! remove field from dataset config ($text collection)
+
+		removed field will be excluded from all auto-generated queries
+		@param name 
+			name of field, or aliase of field
+	*/
+	public function remove_field($name){
+		$ind = $this->is_field($name);
+		if ($ind==-1) throw new Exception('There was no such data field registered as: '.$name);
+		array_splice($this->text,$ind,1);
+		//we not deleting field from $data collection, so it will not be included in data operation, but its data still available
+	}
+	
+	/*! check if field is a part of dataset
+
+		@param name 
+			name of field
+		@param collection
+			collection, against which check will be done, $text collection by default
+		@return 
+			returns true if field already a part of dataset, otherwise returns true
+	*/
+	private function is_field($name,$collection = false){
+		if (!$collection)
+			$collection=$this->text;
+			
+		for ($i=0; $i<sizeof($collection); $i++)
+			if ($collection[$i]["name"] == $name || $collection[$i]["db_name"] == $name)	return $i;
+		return -1;
+	}
+	
+	
+}
+
+/*! Base abstraction class, used for data operations
+	Class abstract access to data, it is a base class to all DB wrappers
+**/
+abstract class DataWrapper{
+	protected $connection;
+	protected $config;//!< DataConfig instance
+	/*! constructor
+		@param connection
+			DB connection
+		@param config 
+			DataConfig instance
+	*/
+	public function __construct($connection,$config){
+		$this->config=$config;
+		$this->connection=$connection;
+	}
+	
+	/*! insert record in storage
+		
+		@param data 
+			DataAction object
+		@param source
+			DataRequestConfig object
+	*/
+	abstract function insert($data,$source);
+	
+	/*! delete record from storage
+		
+		@param data 
+			DataAction object
+		@param source
+			DataRequestConfig object
+	*/
+	abstract function delete($data,$source);
+	
+	/*! update record in storage
+		
+		@param data 
+			DataAction object
+		@param source
+			DataRequestConfig object
+	*/
+	abstract function update($data,$source);
+	
+	/*! select record from storage
+		
+		@param source
+			DataRequestConfig object
+	*/
+	abstract function select($source);
+	
+	/*! get size of storage
+		
+		@param source
+			DataRequestConfig object
+	*/
+	abstract function get_size($source);
+	
+	/*! get all variations of field in storage
+		
+		@param name
+			name of field
+		@param source
+			DataRequestConfig object
+	*/
+	abstract function get_variants($name,$source);
+	
+	/*! checks if there is a custom sql string for specified db operation
+		
+		@param  name
+			name of DB operation
+		@param  data
+			hash of data
+		@return 
+			sql string
+	*/
+	public function get_sql($name,$data){
+		return ""; //custom sql not supported by default
+	}
+	
+	/*! begins DB transaction
+	*/
+	public function begin_transaction(){
+		throw new Exception("Data wrapper not supports transactions.");
+	}
+	/*! commits DB transaction
+	*/
+	public function commit_transaction(){
+		throw new Exception("Data wrapper not supports transactions.");
+	}
+	/*! rollbacks DB transaction
+	*/
+	public function rollback_transaction(){
+		throw new Exception("Data wrapper not supports transactions.");
+	}	
+}
+
+/*! Common database abstraction class
+	Class provides base set of methods to access and change data in DB, class used as a base for DB-specific wrappers
+**/
+abstract class DBDataWrapper extends DataWrapper{
+	private $transaction = false; //!< type of transaction
+	private $sequence=false;//!< sequence name
+	private $sqls = array();//!< predefined sql actions
+	
+	
+	/*! assign named sql query
+		@param name 
+			name of sql query
+		@param data
+			sql query text
+	*/
+	public function attach($name,$data){
+		$name=strtolower($name);
+		$this->sqls[$name]=$data;
+	}
+	/*! replace vars in sql string with actual values
+		
+		@param matches 
+			array of field name matches
+		@return 
+			value for the var name
+	*/
+	public function get_sql_callback($matches){
+		return $this->escape($this->temp->get_value($matches[1]));
+	}
+	public function get_sql($name,$data){
+		$name=strtolower($name);
+		if (!array_key_exists($name,$this->sqls)) return "";
+		
+		
+		$str = $this->sqls[$name];
+		$this->temp = $data; //dirty
+		$str = preg_replace_callback('|\{([^}]+)\}|',array($this,"get_sql_callback"),$str);
+		unset ($this->temp); //dirty
+		return $str;
+	}
+
+	public function insert($data,$source){
+		$sql=$this->insert_query($data,$source);
+		$this->query($sql);
+		$data->success($this->get_new_id());
+	}
+	public function delete($data,$source){
+		$sql=$this->delete_query($data,$source);
+		$this->query($sql);
+		$data->success();
+	}
+	public function update($data,$source){
+		$sql=$this->update_query($data,$source);
+		$this->query($sql);
+		$data->success();
+	}
+	public function select($source){
+		$select=$source->get_fieldset();
+		if (!$select){
+			$select=$this->config->db_names_list($this);
+			$select = implode(",",$select);
+		}
+		
+		$where=$this->build_where($source->get_filters(),$source->get_relation());
+		$sort=$this->build_order($source->get_sort_by());
+			
+		return $this->query($this->select_query($select,$source->get_source(),$where,$sort,$source->get_start(),$source->get_count()));
+	}	
+	public function get_size($source){
+		$count = new DataRequestConfig($source);
+		
+		$count->set_fieldset("COUNT(*) as DHX_COUNT ");
+		$count->set_sort(null);
+		$count->set_limit(0,0);
+		
+		$res=$this->select($count);
+		$data=$this->get_next($res);
+		if (array_key_exists("DHX_COUNT",$data)) return $data["DHX_COUNT"];
+		else return $data["dhx_count"]; //postgresql
+	}
+	public function get_variants($name,$source){
+		$count = new DataRequestConfig($source);
+		$count->set_fieldset("DISTINCT ".$this->escape_name($name)." as value");
+		$count->set_sort(null);
+		$count->set_limit(0,0);
+		
+		return $this->select($count);
+	}
+	
+	public function sequence($sec){
+		$this->sequence=$sec;
+	}
+		
+	
+	/*! create an sql string for filtering rules
+		
+		@param rules 
+			set of filtering rules
+		@param relation
+			name of relation id field
+		@return 
+			sql string with filtering rules
+	*/
+	protected function build_where($rules,$relation=false){
+		$sql=array();
+		for ($i=0; $i < sizeof($rules); $i++)
+			if (is_string($rules[$i]))
+				array_push($sql,$rules[$i]);
+			else
+				if ($rules[$i]["value"]!=""){
+					if (!$rules[$i]["operation"])
+						array_push($sql,$this->escape_name($rules[$i]["name"])." LIKE '%".$this->escape($rules[$i]["value"])."%'");
+					else
+						array_push($sql,$this->escape_name($rules[$i]["name"])." ".$rules[$i]["operation"]." '".$this->escape($rules[$i]["value"])."'");
+				}
+		if ($relation!==false)
+			array_push($sql,$this->escape_name($this->config->relation_id["db_name"])." = '".$this->escape($relation)."'");
+		return implode(" AND ",$sql);
+	}	
+	/*! convert sorting rules to sql string
+		
+		@param by 
+			set of sorting rules
+		@return 
+			sql string for set of sorting rules
+	*/
+	protected function build_order($by){
+		if (!sizeof($by)) return "";
+		$out = array();
+		for ($i=0; $i < sizeof($by); $i++)
+			if ($by[$i]["name"])
+				$out[]=$this->escape_name($by[$i]["name"])." ".$by[$i]["direction"];
+		return implode(",",$out);
+	}	
+	
+	/*! generates sql code for select operation
+		
+		@param select 
+			list of fields in select
+		@param from 
+			table name
+		@param where
+			list of filtering rules
+		@param sort
+			list of sorting rules
+		@param start
+			start index of fetching
+		@param count 
+			count of records to fetch
+		@return 
+			sql string for select operation
+	*/
+	protected function select_query($select,$from,$where,$sort,$start,$count){
+		$sql="SELECT ".$select." FROM ".$from;
+		if ($where) $sql.=" WHERE ".$where;
+		if ($sort) $sql.=" ORDER BY ".$sort;
+		if ($start || $count) $sql.=" LIMIT ".$start.",".$count;
+		return $sql;
+	}
+	/*! generates update sql
+		
+		@param data
+			DataAction object
+		@param request
+			DataRequestConfig object
+		@return 
+			sql string, which updates record with provided data
+	*/
+	protected function update_query($data,$request){
+		$sql="UPDATE ".$request->get_source()." SET ";
+		$temp=array();
+		for ($i=0; $i < sizeof($this->config->text); $i++) { 
+			$step=$this->config->text[$i];
+			
+			if ($data->get_value($step["name"])===Null)
+				$step_value ="Null";
+			else
+				$step_value = "'".$this->escape($data->get_value($step["name"]))."'";
+			$temp[$i]= $this->escape_name($step["db_name"])."=". $step_value;
+		}
+		if ($relation = $this->config->relation_id["db_name"]){
+			$temp[]= $this->escape_name($relation)."='".$this->escape($data->get_value($relation))."'";
+		}
+		$sql.=implode(",",$temp)." WHERE ".$this->escape_name($this->config->id["db_name"])."='".$this->escape($data->get_id())."'";
+		
+		//if we have limited set - set constraints
+		$where=$this->build_where($request->get_filters(),$request->get_relation());
+		if ($where) $sql.=" AND (".$where.")";
+		
+		return $sql;
+	}
+	
+	/*! generates delete sql
+		
+		@param data
+			DataAction object
+		@param request
+			DataRequestConfig object
+		@return 
+			sql string, which delete record 
+	*/
+	protected function delete_query($data,$request){
+		$sql="DELETE FROM ".$request->get_source();
+		$sql.=" WHERE ".$this->escape_name($this->config->id["db_name"])."='".$this->escape($data->get_id())."'";
+		
+		//if we have limited set - set constraints
+		$where=$this->build_where($request->get_filters(),$request->get_relation());
+		if ($where) $sql.=" AND (".$where.")";
+		
+		return $sql;
+	}
+	
+	/*! generates insert sql
+		
+		@param data
+			DataAction object
+		@param request
+			DataRequestConfig object
+		@return 
+			sql string, which inserts new record with provided data
+	*/
+	protected function insert_query($data,$request){
+		$temp_n=array(); 
+		$temp_v=array(); 
+		foreach($this->config->text as $k => $v){
+			$temp_n[$k]=$this->escape_name($v["db_name"]);
+			if ($data->get_value($v["name"])===Null)
+				$temp_v[$k]="Null";
+			else
+			$temp_v[$k]="'".$this->escape($data->get_value($v["name"]))."'";
+		}
+		if ($relation = $this->config->relation_id["db_name"]){
+			$temp_n[]=$this->escape_name($relation);
+			$temp_v[]="'".$this->escape($data->get_value($relation))."'";
+		}
+		if ($this->sequence){
+			$temp_n[]=$this->escape_name($this->config->id["db_name"]);
+			$temp_v[]=$this->sequence;
+		}
+		
+		$sql="INSERT INTO ".$request->get_source()."(".implode(",",$temp_n).") VALUES (".implode(",",$temp_v).")";
+		
+		return $sql;
+	}	
+	
+	/*! sets the transaction mode, used by dataprocessor
+		
+		@param mode 
+			mode name
+	*/
+	public function set_transaction_mode($mode){
+		if ($mode!="none" && $mode!="global" && $mode!="record") 
+			throw new Exception("Unknown transaction mode");
+		$this->transaction=$mode;
+	}
+	/*! returns true if global transaction mode was specified
+		@return 
+			true if global transaction mode was specified
+	*/
+	public function is_global_transaction(){
+		return $this->transaction == "global";
+	}
+	/*! returns true if record transaction mode was specified
+		@return 
+			true if record transaction mode was specified
+	*/	
+	public function is_record_transaction(){
+		return $this->transaction == "record";
+	}
+	
+		
+	public function begin_transaction(){
+		$this->query("BEGIN");
+	}
+	public function commit_transaction(){
+		$this->query("COMMIT");
+	}
+	public function rollback_transaction(){
+		$this->query("ROLLBACK");
+	}	
+	
+	/*! exec sql string
+		
+		@param sql 
+			sql string
+		@return 
+			sql result set
+	*/
+	abstract protected function query($sql);
+	/*! returns next record from result set
+		
+		@param res 
+			sql result set
+		@return 
+			hash of data
+	*/
+	abstract public function get_next($res);
+	/*! returns new id value, for newly inserted row
+		@return 
+			new id value, for newly inserted row
+	*/
+	abstract protected function get_new_id();
+	/*! escape data to prevent sql injections
+		@param data 
+			unescaped data
+		@return 
+			escaped data
+	*/
+	abstract public function escape($data);			
+	
+	/*! escape field name to prevent sql reserved words conflict
+		@param data 
+			unescaped data
+		@return 
+			escaped data
+	*/
+	public function escape_name($data){
+		return $data;
+	}
+	
+	/*! get list of tables in the database
+		
+		@return 
+			array of table names
+	*/
+	public function tables_list() {
+		throw new Exception("Not implemented");
+	}
+
+	/*! returns list of fields for the table in question
+		
+		@param table 
+			name of table in question
+		@return 
+			array of field names
+	*/
+	public function fields_list($table) {
+		throw new Exception("Not implemented");
+	}
+	
+}
+/*! Implementation of DataWrapper for MySQL
+**/
+class MySQLDBDataWrapper extends DBDataWrapper{
+	protected $last_result;
+	public function query($sql){
+		LogMaster::log($sql);
+		$res=mysql_query($sql,$this->connection);
+		if ($res===false) throw new Exception("MySQL operation failed\n".mysql_error($this->connection));
+		$this->last_result = $res;
+		return $res;
+	}
+	
+	public function get_next($res){
+		if (!$res)
+			$res = $this->last_result;
+			
+		return mysql_fetch_assoc($res);
+	}
+	
+	protected function get_new_id(){
+		return mysql_insert_id($this->connection);
+	}
+	
+	public function escape($data){
+		return mysql_real_escape_string($data);
+	}
+
+	public function tables_list() {
+		$result = mysql_query("SHOW TABLES");
+		if ($result===false) throw new Exception("MySQL operation failed\n".mysql_error($this->connection));
+
+		$tables = array();
+		while ($table = mysql_fetch_array($result)) {
+			$tables[] = $table[0];
+		}
+		return $tables;
+	}
+
+	public function fields_list($table) {
+		$result = mysql_query("SHOW COLUMNS FROM `".$table."`");
+		if ($result===false) throw new Exception("MySQL operation failed\n".mysql_error($this->connection));
+
+		$fields = array();
+        $id = "";
+		while ($field = mysql_fetch_assoc($result)) {
+			if ($field['Key'] == "PRI")
+				$id = $field["Field"];
+            else
+			    $fields[] = $field["Field"];
+		}
+		return array("fields" => $fields, "key" => $id );
+	}
+	
+	/*! escape field name to prevent sql reserved words conflict
+		@param data 
+			unescaped data
+		@return 
+			escaped data
+	*/
+	public function escape_name($data){
+		if ((strpos($data,"`")!==false || intval($data)==$data) || (strpos($data,".")!==false))
+			return $data;
+		return '`'.$data.'`';
+	}	
+}
+?>
\ No newline at end of file

=== added file 'addons/base_calendar/static/lib/dhtmlxScheduler/codebase/connector/db_mssql.php'
--- addons/base_calendar/static/lib/dhtmlxScheduler/codebase/connector/db_mssql.php	1970-01-01 00:00:00 +0000
+++ addons/base_calendar/static/lib/dhtmlxScheduler/codebase/connector/db_mssql.php	2011-04-07 05:03:24 +0000
@@ -0,0 +1,66 @@
+<?php
+require_once("db_common.php");
+/*! MSSQL implementation of DataWrapper
+**/
+class MsSQLDBDataWrapper extends DBDataWrapper{
+	private $last_id=""; //!< ID of previously inserted record
+	private $insert_operation=false; //!< flag of insert operation
+	private $start_from=false; //!< index of start position
+	
+	public function query($sql){
+		LogMaster::log($sql);
+		$res = mssql_query($sql,$this->connection);
+		if ($this->insert_operation){
+			$last = mssql_fetch_assoc($res);
+			$this->last_id = $last["dhx_id"];
+			mssql_free_result($res);
+		}
+		if ($this->start_from)
+			mssql_data_seek($res,$this->start_from);
+		return $res;
+	}
+	
+	public function get_next($res){
+		return mssql_fetch_assoc($res);
+	}
+	
+	protected function get_new_id(){
+		/*
+		MSSQL doesn't support identity or auto-increment fields
+		Insert SQL returns new ID value, which stored in last_id field
+		*/
+		return $this->last_id;
+	}
+	
+	protected function insert_query($data,$request){
+		$sql = parent::insert_query($data,$request);
+		$this->insert_operation=true;
+		return $sql.";SELECT @@IDENTITY AS dhx_id";
+	}		
+	
+	protected function select_query($select,$from,$where,$sort,$start,$count){
+		$sql="SELECT " ;
+		if ($count)
+			$sql.=" TOP ".($count+$start);
+		$sql.=" ".$select." FROM ".$from;
+		if ($where) $sql.=" WHERE ".$where;
+		if ($sort) $sql.=" ORDER BY ".$sort;
+		if ($start && $count) 
+			$this->start_from=$start;
+		else 
+			$this->start_from=false;
+		return $sql;
+	}
+
+	public function escape($data){
+		/*
+		there is no special escaping method for mssql - use common logic
+		*/
+		return str_replace("'","''",$data);
+	}
+	
+	public function begin_transaction(){
+		$this->query("BEGIN TRAN");
+	}
+}
+?>
\ No newline at end of file

=== added file 'addons/base_calendar/static/lib/dhtmlxScheduler/codebase/connector/db_mysqli.php'
--- addons/base_calendar/static/lib/dhtmlxScheduler/codebase/connector/db_mysqli.php	1970-01-01 00:00:00 +0000
+++ addons/base_calendar/static/lib/dhtmlxScheduler/codebase/connector/db_mysqli.php	2011-04-07 05:03:24 +0000
@@ -0,0 +1,53 @@
+<?php
+
+require_once("db_common.php");
+
+class MySQLiDBDataWrapper extends MySQLDBDataWrapper{
+
+	public function query($sql){
+		LogMaster::log($sql);
+		$res = $this->connection->query($sql);
+		if ($res===false) throw new Exception("MySQL operation failed\n".$this->connection->error);
+		return $res;
+	}
+
+	public function get_next($res){
+		return $res->fetch_assoc();
+	}
+
+	protected function get_new_id(){
+		return $this->connection->insert_id;
+	}
+
+	public function escape($data){
+		return $this->connection->real_escape_string($data);
+	}
+
+	public function tables_list() {
+		$result = $this->connection->query("SHOW TABLES");
+		if ($result===false) throw new Exception("MySQL operation failed\n".$this->connection->error);
+
+		$tables = array();
+		while ($table = $result->fetch_array()) {
+			$tables[] = $table[0];
+		}
+		return $tables;
+	}
+
+	public function fields_list($table) {
+		$result = $this->connection->query("SHOW COLUMNS FROM `".$table."`");
+		if ($result===false) throw new Exception("MySQL operation failed\n".$this->connection->error);
+		$fields = array();
+		while ($field = $result->fetch_array()) {
+			if ($field['Key'] == "PRI") {
+				$fields[$field[0]] = 1;
+			} else {
+				$fields[$field[0]] = 0;
+			}
+		}
+		return $fields;
+	}
+
+}
+
+?>
\ No newline at end of file

=== added file 'addons/base_calendar/static/lib/dhtmlxScheduler/codebase/connector/db_oracle.php'
--- addons/base_calendar/static/lib/dhtmlxScheduler/codebase/connector/db_oracle.php	1970-01-01 00:00:00 +0000
+++ addons/base_calendar/static/lib/dhtmlxScheduler/codebase/connector/db_oracle.php	2011-04-07 05:03:24 +0000
@@ -0,0 +1,79 @@
+<?php
+require_once("db_common.php");
+/*! Implementation of DataWrapper for Oracle
+**/
+class OracleDBDataWrapper extends DBDataWrapper{
+	private $last_id=""; //id of previously inserted record
+	private $insert_operation=false; //flag of insert operation
+	
+	public function query($sql){
+		LogMaster::log($sql);
+		$stm = oci_parse($this->connection,$sql);
+		if ($stm===false) throw new Exception("Oracle - sql parsing failed\n".oci_error($this->connection));
+		
+		$out = array(0=>null);
+		if($this->insert_operation){
+			oci_bind_by_name($stm,":outID",$out[0],999);
+			$this->insert_operation=false;
+		}
+		
+		
+		$mode = ($this->is_record_transaction() || $this->is_global_transaction())?OCI_DEFAULT:OCI_COMMIT_ON_SUCCESS;
+		$res=oci_execute($stm,$mode);
+		if ($res===false) throw new Exception("Oracle - sql execution failed\n".oci_error($this->connection));
+		
+		$this->last_id=$out[0];
+		
+		return $stm;
+	}
+	
+	public function get_next($res){
+		$data = oci_fetch_assoc($res);
+		if (array_key_exists("VALUE",$data))
+			$data["value"]=$data["VALUE"];
+		return $data;
+	}
+	
+	protected function get_new_id(){
+		/*
+		Oracle doesn't support identity or auto-increment fields
+		Insert SQL returns new ID value, which stored in last_id field
+		*/
+		return $this->last_id;
+	}
+	
+	protected function insert_query($data,$request){
+		$sql = parent::insert_query($data,$request);
+		$this->insert_operation=true;
+		return $sql." returning ".$this->config->id["db_name"]." into :outID";
+	}		
+	
+	protected function select_query($select,$from,$where,$sort,$start,$count){
+		$sql="SELECT ".$select." FROM ".$from;
+		if ($where) $sql.=" WHERE ".$where;
+		if ($sort) $sql.=" ORDER BY ".$sort;
+		if ($start || $count) 
+			$sql="SELECT * FROM ( select /*+ FIRST_ROWS(".$count.")*/dhx_table.*, ROWNUM rnum FROM (".$sql.") dhx_table where ROWNUM <= ".($count+$start)." ) where rnum >".$start;
+		return $sql;
+	}
+
+	public function escape($data){
+		/*
+		as far as I can see the only way to escape data is by using oci_bind_by_name
+		while it is neat solution in common case, it conflicts with existing SQL building logic
+		fallback to simple escaping
+		*/
+		return str_replace("'","''",$data);
+	}
+	
+	public function begin_transaction(){
+		//auto-start of transaction
+	}
+	public function commit_transaction(){
+		oci_commit($this->connection);
+	}
+	public function rollback_transaction(){
+		oci_rollback($this->connection);
+	}	
+}
+?>
\ No newline at end of file

=== added file 'addons/base_calendar/static/lib/dhtmlxScheduler/codebase/connector/db_pdo.php'
--- addons/base_calendar/static/lib/dhtmlxScheduler/codebase/connector/db_pdo.php	1970-01-01 00:00:00 +0000
+++ addons/base_calendar/static/lib/dhtmlxScheduler/codebase/connector/db_pdo.php	2011-04-07 05:03:24 +0000
@@ -0,0 +1,65 @@
+<?php
+require_once("db_common.php");
+/*! Implementation of DataWrapper for PDO
+
+if you plan to use it for Oracle - use Oracle connection type instead
+**/
+class PDODBDataWrapper extends DBDataWrapper{
+	private $last_result;//!< store result or last operation
+	
+	public function query($sql){
+		LogMaster::log($sql);
+		
+		$res=$this->connection->query($sql);
+		if ($res===false) throw new Exception("PDO - sql execution failed\n".$this->connection->errorInfo());
+		
+		return new PDOResultSet($res);
+	}
+
+	protected function select_query($select,$from,$where,$sort,$start,$count){
+		$sql="SELECT ".$select." FROM ".$from;
+		if ($where) $sql.=" WHERE ".$where;
+		if ($sort) $sql.=" ORDER BY ".$sort;
+		if ($start || $count) {
+			if ($this->connection->getAttribute(PDO::ATTR_DRIVER_NAME)=="pgsql")
+				$sql.=" OFFSET ".$start." LIMIT ".$count;
+			else
+				$sql.=" LIMIT ".$start.",".$count;
+		}
+		return $sql;
+	}
+	
+		
+	public function get_next($res){
+		$data = $res->next();
+		return $data;
+	}
+	
+	protected function get_new_id(){
+		return $this->connection->lastInsertId();
+	}
+	
+	public function escape($str){
+		$res=$this->connection->quote($str);
+		if ($res===false) //not supported by pdo driver
+			return str_replace("'","''",$str); 
+		return substr($res,1,-1);
+	}
+	
+}
+
+class PDOResultSet{
+	private $res;
+	public function __construct($res){
+		$this->res = $res;
+	}
+	public function next(){
+		$data = $this->res->fetch(PDO::FETCH_ASSOC);
+		if (!$data){
+			$this->res->closeCursor();
+			return null;
+		}
+		return $data;
+	}	
+}
+?>
\ No newline at end of file

=== added file 'addons/base_calendar/static/lib/dhtmlxScheduler/codebase/connector/db_postgre.php'
--- addons/base_calendar/static/lib/dhtmlxScheduler/codebase/connector/db_postgre.php	1970-01-01 00:00:00 +0000
+++ addons/base_calendar/static/lib/dhtmlxScheduler/codebase/connector/db_postgre.php	2011-04-07 05:03:24 +0000
@@ -0,0 +1,66 @@
+<?php
+require_once("db_common.php");
+/*! Implementation of DataWrapper for PostgreSQL
+**/
+class PostgreDBDataWrapper extends DBDataWrapper{
+	public function query($sql){
+		LogMaster::log($sql);
+		
+		$res=pg_query($this->connection,$sql);
+		if ($res===false) throw new Exception("Postgre - sql execution failed\n".pg_last_error($this->connection));
+		
+		return $res;
+	}
+	
+	protected function select_query($select,$from,$where,$sort,$start,$count){
+		$sql="SELECT ".$select." FROM ".$from;
+		if ($where) $sql.=" WHERE ".$where;
+		if ($sort) $sql.=" ORDER BY ".$sort;
+		if ($start || $count) 
+			$sql.=" OFFSET ".$start." LIMIT ".$count;
+		return $sql;
+	}
+		
+	public function get_next($res){
+		return pg_fetch_assoc($res);
+	}
+	
+	protected function get_new_id(){
+		$res  = pg_query( $this->connection, "SELECT LASTVAL() AS seq");
+		$data = pg_fetch_assoc($res);
+				pg_free_result($res);
+		return $data['seq'];
+	}
+	
+	public function escape($data){
+		//need to use oci_bind_by_name
+		return pg_escape_string($this->connection,$data);
+	}
+
+	public function tables_list() {
+		$sql = "SELECT table_name FROM information_schema.tables WHERE table_schema = 'public'";
+		$res = pg_query($this->connection, $sql);
+		$tables = array();
+		while ($table = pg_fetch_assoc($res)) {
+			$tables[] = $table['table_name'];
+		}
+		return $tables;
+	}
+
+	public function fields_list($table) {
+		$sql = "SELECT * FROM information_schema.constraint_column_usage";
+		$result = pg_query($this->connection, $sql);
+		$field = pg_fetch_assoc($result);
+		$id = $field['column_name'];
+
+		$sql = "SELECT * FROM information_schema.columns WHERE table_name ='".$table."';";
+		$result = pg_query($this->connection, $sql);
+		$fields = array();
+        $id = "";
+		while ($field = pg_fetch_assoc($result)) {
+		    $fields[] = $field["column_name"];
+		}
+		return array('fields' => $fields, 'key' => $id );
+	}
+}
+?>
\ No newline at end of file

=== added file 'addons/base_calendar/static/lib/dhtmlxScheduler/codebase/connector/grid_connector.php'
--- addons/base_calendar/static/lib/dhtmlxScheduler/codebase/connector/grid_connector.php	1970-01-01 00:00:00 +0000
+++ addons/base_calendar/static/lib/dhtmlxScheduler/codebase/connector/grid_connector.php	2011-04-07 05:03:24 +0000
@@ -0,0 +1,268 @@
+<?php
+require_once("base_connector.php");
+require_once("grid_config.php");
+
+//require_once("grid_dataprocessor.php");
+
+/*! DataItem class for Grid component
+**/
+
+class GridDataItem extends DataItem{
+	protected $row_attrs;//!< hash of row attributes
+	protected $cell_attrs;//!< hash of cell attributes
+	protected $userdata;
+	
+	function __construct($data,$name,$index=0){
+		parent::__construct($data,$name,$index);
+		
+		$this->row_attrs=array();
+		$this->cell_attrs=array();
+		$this->userdata=array();
+	}
+	/*! set color of row
+		
+		@param color 
+			color of row
+	*/
+	function set_row_color($color){
+		$this->row_attrs["bgColor"]=$color;
+	}
+	/*! set style of row
+		
+		@param color 
+			color of row
+	*/
+	function set_row_style($color){
+		$this->row_attrs["style"]=$color;
+	}
+	/*! assign custom style to the cell
+		
+		@param name
+			name of column
+		@param value
+			css style string
+	*/
+	function set_cell_style($name,$value){
+		$this->set_cell_attribute($name,"style",$value);
+	}
+	/*! assign custom class to specific cell
+		
+		@param name
+			name of column
+		@param value
+			css class name
+	*/
+	function set_cell_class($name,$value){
+		$this->set_cell_attribute($name,"class",$value);
+	}
+	/*! set custom cell attribute
+		
+		@param name
+			name of column
+		@param attr
+			name of attribute
+		@param value
+			value of attribute
+	*/
+	function set_cell_attribute($name,$attr,$value){
+		if (!$this->cell_attrs[$name]) $this->cell_attrs[$name]=array();
+		$this->cell_attrs[$name][$attr]=$value;
+	}
+	
+	/*! set userdata section for the item
+		
+		@param name
+			name of userdata
+		@param value
+			value of userdata
+	*/
+	function set_userdata($name, $value){
+		$this->userdata[$name]=$value;
+	}
+		
+	/*! set custom row attribute
+		
+		@param attr
+			name of attribute
+		@param value
+			value of attribute
+	*/
+	function set_row_attribute($attr,$value){
+		$this->row_attrs[$attr]=$value;
+	}	
+	
+	/*! return self as XML string, starting part
+	*/
+	public function to_xml_start(){
+		if ($this->skip) return "";
+		
+		$str="<row id='".$this->get_id()."'";
+		foreach ($this->row_attrs as $k=>$v)
+			$str.=" ".$k."='".$v."'";
+		$str.=">";
+		for ($i=0; $i < sizeof($this->config->text); $i++){ 
+			$str.="<cell";
+			$name=$this->config->text[$i]["name"];
+			if (isset($this->cell_attrs[$name])){
+				$cattrs=$this->cell_attrs[$name];
+				foreach ($cattrs as $k => $v)
+					$str.=" ".$k."='".$this->xmlentities($v)."'";
+			}
+			$str.="><![CDATA[".$this->data[$name]."]]></cell>";
+		}
+		foreach ($this->userdata as $key => $value)
+			$str.="<userdata name='".$key."'><![CDATA[".$value."]]></userdata>";
+			
+		return $str;
+	}
+	/*! return self as XML string, ending part
+	*/
+	public function to_xml_end(){
+		if ($this->skip) return "";
+		
+		return "</row>";
+	}
+}
+/*! Connector for the dhtmlxgrid
+**/
+class GridConnector extends Connector{
+	protected $extra_output="";//!< extra info which need to be sent to client side
+	private $options=array();//!< hash of OptionsConnector 
+	
+	/*! constructor
+		
+		Here initilization of all Masters occurs, execution timer initialized
+		@param res 
+			db connection resource
+		@param type
+			string , which hold type of database ( MySQL or Postgre ), optional, instead of short DB name, full name of DataWrapper-based class can be provided
+		@param item_type
+			name of class, which will be used for item rendering, optional, DataItem will be used by default
+		@param data_type
+			name of class which will be used for dataprocessor calls handling, optional, DataProcessor class will be used by default. 
+	*/		
+	public function __construct($res,$type=false,$item_type=false,$data_type=false){
+		if (!$item_type) $item_type="GridDataItem";
+		if (!$data_type) $data_type="GridDataProcessor";
+		parent::__construct($res,$type,$item_type,$data_type);
+	}
+
+
+	protected function parse_request(){
+		parent::parse_request();
+		
+		if (isset($_GET["dhx_colls"]))
+			$this->fill_collections($_GET["dhx_colls"]);	
+		
+		if (isset($_GET["posStart"]) && isset($_GET["count"]))
+			$this->request->set_limit($_GET["posStart"],$_GET["count"]);
+	}
+	protected function resolve_parameter($name){
+		if (intval($name).""==$name)
+			return $this->config->text[intval($name)]["db_name"];
+		return $name;
+	}
+	
+	/*! replace xml unsafe characters
+		
+		@param string 
+			string to be escaped
+		@return 
+			escaped string
+	*/	
+	private function xmlentities($string) { 
+   		return str_replace( array( '&', '"', "'", '<', '>', '’' ), array( '&amp;' , '&quot;', '&apos;' , '&lt;' , '&gt;', '&apos;' ), $string);
+	}
+		
+	/*! assign options collection to the column
+		
+		@param name 
+			name of the column
+		@param options
+			array or connector object
+	*/
+	public function set_options($name,$options){
+		if (is_array($options)){
+			$str="";
+			foreach($options as $k => $v)
+				$str.="<item value='".$this->xmlentities($k)."' label='".$this->xmlentities($v)."' />";
+			$options=$str;
+		}
+		$this->options[$name]=$options;
+	}
+	/*! generates xml description for options collections
+		
+		@param list 
+			comma separated list of column names, for which options need to be generated
+	*/
+	protected function fill_collections($list){
+		$names=explode(",",$list);
+		for ($i=0; $i < sizeof($names); $i++) { 
+			$name = $this->resolve_parameter($names[$i]);
+			if (!array_key_exists($name,$this->options)){
+				$this->options[$name] = new DistinctOptionsConnector($this->get_connection(),$this->names["db_class"]);
+				$c = new DataConfig($this->config);
+				$r = new DataRequestConfig($this->request);
+				$c->minimize($name);
+				
+				$this->options[$name]->render_connector($c,$r);
+			} 
+			
+			$this->extra_output.="<coll_options for='{$names[$i]}'>";
+			if (!is_string($this->options[$name]))
+				$this->extra_output.=$this->options[$name]->render();
+			else
+				$this->extra_output.=$this->options[$name];
+			$this->extra_output.="</coll_options>";
+		}
+	}
+	
+	/*! renders self as  xml, starting part
+	*/
+	protected function xml_start(){
+		if ($this->dload){
+			if ($pos=$this->request->get_start())
+				return "<rows pos='".$pos."'>";
+			else
+				return "<rows total_count='".$this->sql->get_size($this->request)."'>";
+		}
+		else
+			return "<rows>";
+	}
+	
+	
+	/*! renders self as  xml, ending part
+	*/
+	protected function xml_end(){
+		return $this->extra_output."</rows>";
+	}
+
+	public function set_config($config = false){
+		if (gettype($config) == 'boolean')
+			$config = new GridConfiguration($config);
+			
+		$this->event->attach("beforeOutput", Array($config, "attachHeaderToXML"));
+	}
+}
+
+/*! DataProcessor class for Grid component
+**/
+class GridDataProcessor extends DataProcessor{
+	
+	/*! convert incoming data name to valid db name
+		converts c0..cN to valid field names
+		@param data 
+			data name from incoming request
+		@return 
+			related db_name
+	*/
+	function name_data($data){
+		if ($data == "gr_id") return $this->config->id["name"];
+		$parts=explode("c",$data);
+		if ($parts[0]=="" && intval($parts[1])==$parts[1])
+			return $this->config->text[intval($parts[1])]["name"];
+		return $data;
+	}
+}
+
+?>
\ No newline at end of file

=== added file 'addons/base_calendar/static/lib/dhtmlxScheduler/codebase/connector/scheduler_connector.php'
--- addons/base_calendar/static/lib/dhtmlxScheduler/codebase/connector/scheduler_connector.php	1970-01-01 00:00:00 +0000
+++ addons/base_calendar/static/lib/dhtmlxScheduler/codebase/connector/scheduler_connector.php	2011-04-07 05:03:24 +0000
@@ -0,0 +1,121 @@
+<?php
+require_once("base_connector.php");
+
+/*! DataItem class for Scheduler component
+**/
+class SchedulerDataItem extends DataItem{
+	/*! return self as XML string
+	*/
+	function to_xml(){
+		if ($this->skip) return "";
+		
+		$str="<event id='".$this->get_id()."' >";
+		$str.="<start_date><![CDATA[".$this->data[$this->config->text[0]["name"]]."]]></start_date>";
+		$str.="<end_date><![CDATA[".$this->data[$this->config->text[1]["name"]]."]]></end_date>";
+		$str.="<text><![CDATA[".$this->data[$this->config->text[2]["name"]]."]]></text>";
+		for ($i=3; $i<sizeof($this->config->text); $i++){
+			$extra = $this->config->text[$i]["name"];
+			$str.="<".$extra."><![CDATA[".$this->data[$extra]."]]></".$extra.">";
+		}
+		return $str."</event>";
+	}
+}
+
+
+/*! Connector class for dhtmlxScheduler
+**/
+class SchedulerConnector extends Connector{
+	
+	protected $extra_output="";//!< extra info which need to be sent to client side
+	private $options=array();//!< hash of OptionsConnector 
+	
+			
+	/*! assign options collection to the column
+		
+		@param name 
+			name of the column
+		@param options
+			array or connector object
+	*/
+	public function set_options($name,$options){
+		if (is_array($options)){
+			$str="";
+			foreach($options as $k => $v)
+				$str.="<item value='".$this->xmlentities($k)."' label='".$this->xmlentities($v)."' />";
+			$options=$str;
+		}
+		$this->options[$name]=$options;
+	}
+	/*! generates xml description for options collections
+		
+		@param list 
+			comma separated list of column names, for which options need to be generated
+	*/
+	protected function fill_collections(){
+		foreach ($this->options as $k=>$v) { 
+			$name = $k;
+			$this->extra_output.="<coll_options for='{$name}'>";
+			if (!is_string($this->options[$name]))
+				$this->extra_output.=$this->options[$name]->render();
+			else
+				$this->extra_output.=$this->options[$name];
+			$this->extra_output.="</coll_options>";
+		}
+	}
+	
+	/*! renders self as  xml, ending part
+	*/
+	protected function xml_end(){
+		$this->fill_collections();
+		return $this->extra_output."</data>";
+	}
+	
+	
+	/*! constructor
+		
+		Here initilization of all Masters occurs, execution timer initialized
+		@param res 
+			db connection resource
+		@param type
+			string , which hold type of database ( MySQL or Postgre ), optional, instead of short DB name, full name of DataWrapper-based class can be provided
+		@param item_type
+			name of class, which will be used for item rendering, optional, DataItem will be used by default
+		@param data_type
+			name of class which will be used for dataprocessor calls handling, optional, DataProcessor class will be used by default. 
+	*/	
+	public function __construct($res,$type=false,$item_type=false,$data_type=false){
+		if (!$item_type) $item_type="SchedulerDataItem";
+		if (!$data_type) $data_type="SchedulerDataProcessor";
+		parent::__construct($res,$type,$item_type,$data_type);
+	}
+
+	//parse GET scoope, all operations with incoming request must be done here
+	function parse_request(){
+		parent::parse_request();
+		if (count($this->config->text)){
+			if (isset($_GET["to"]))
+				$this->request->set_filter($this->config->text[0]["name"],$_GET["to"],"<");
+			if (isset($_GET["from"]))
+				$this->request->set_filter($this->config->text[1]["name"],$_GET["from"],">");
+		}
+	}
+}
+
+/*! DataProcessor class for Scheduler component
+**/
+class SchedulerDataProcessor extends DataProcessor{
+	function name_data($data){
+		if ($data=="start_date")
+			return $this->config->text[0]["db_name"];
+		if ($data=="id")
+			return $this->config->id["db_name"];
+		if ($data=="end_date")
+			return $this->config->text[1]["db_name"];
+		if ($data=="text")
+			return $this->config->text[2]["db_name"];
+			
+		return $data;
+	}
+}
+
+?>
\ No newline at end of file

=== added file 'addons/base_calendar/static/lib/dhtmlxScheduler/codebase/connector/tools.php'
--- addons/base_calendar/static/lib/dhtmlxScheduler/codebase/connector/tools.php	1970-01-01 00:00:00 +0000
+++ addons/base_calendar/static/lib/dhtmlxScheduler/codebase/connector/tools.php	2011-04-07 05:03:24 +0000
@@ -0,0 +1,254 @@
+<?php
+/*!
+	@file
+	Inner classes, which do common tasks. No one of them is purposed for direct usage. 
+*/
+
+/*! Class which allows to assign|fire events.
+*/
+class EventMaster{
+	private $events;//!< hash of event handlers
+	private static $eventsStatic=array();
+	
+	/*! constructor
+	*/
+	function __construct(){
+		$this->events=array();
+	}
+	/*! Method check if event with such name already exists.
+		@param name
+			name of event, case non-sensitive
+		@return
+			true if event with such name registered, false otherwise
+	*/	
+	public function exist($name){
+		$name=strtolower($name);
+		return (isset($this->events[$name]) && sizeof($this->events[$name]));
+	}
+	/*! Attach custom code to event.
+	
+		Only on event handler can be attached in the same time. If new event handler attached - old will be detached.
+		
+		@param name
+			name of event, case non-sensitive
+		@param method
+			function which will be attached. You can use array(class, method) if you want to attach the method of the class.
+	*/
+	public function attach($name,$method){
+		$name=strtolower($name);
+		if (!array_key_exists($name,$this->events))
+			$this->events[$name]=array();
+		$this->events[$name][]=$method;
+	}
+	
+	public static function attach_static($name, $method){
+		$name=strtolower($name);
+		if (!array_key_exists($name,EventMaster::$eventsStatic))
+			EventMaster::$eventsStatic[$name]=array();
+		EventMaster::$eventsStatic[$name][]=$method;
+	}
+	
+	public static function trigger_static($name, $method){
+		$arg_list = func_get_args();
+		$name=strtolower(array_shift($arg_list));
+		
+		if (isset(EventMaster::$eventsStatic[$name]))
+			foreach(EventMaster::$eventsStatic[$name] as $method){
+				if (is_array($method) && !method_exists($method[0],$method[1]))
+					throw new Exception("Incorrect method assigned to event: ".$method[0].":".$method[1]);
+				if (!is_array($method) && !function_exists($method))
+					throw new Exception("Incorrect function assigned to event: ".$method);
+				call_user_func_array($method, $arg_list);
+			}
+		return true;		
+	}
+	
+	/*! Detach code from event
+		@param	name
+			name of event, case non-sensitive
+	*/	
+	public function detach($name){
+		$name=strtolower($name);
+		unset($this->events[$name]);
+	}
+	/*! Trigger event.
+		@param	name
+			name of event, case non-sensitive
+		@param data
+			value which will be provided as argument for event function,
+			you can provide multiple data arguments, method accepts variable number of parameters
+		@return 
+			true if event handler was not assigned , result of event hangler otherwise
+	*/
+	public function trigger($name,$data){
+		$arg_list = func_get_args();
+		$name=strtolower(array_shift($arg_list));
+		
+		if (isset($this->events[$name]))
+			foreach($this->events[$name] as $method){
+				if (is_array($method) && !method_exists($method[0],$method[1]))
+					throw new Exception("Incorrect method assigned to event: ".$method[0].":".$method[1]);
+				if (!is_array($method) && !function_exists($method))
+					throw new Exception("Incorrect function assigned to event: ".$method);
+				call_user_func_array($method, $arg_list);
+			}
+		return true;
+	}
+}
+
+/*! Class which handles access rules.	
+**/
+class AccessMaster{
+	private $rules,$local;
+	/*! constructor
+	
+		Set next access right to "allowed" by default : read, insert, update, delete
+		Basically - all common data operations allowed by default
+	*/
+	function __construct(){
+		$this->rules=array("read" => true, "insert" => true, "update" => true, "delete" => true);
+		$this->local=true;
+	}
+	/*! change access rule to "allow"
+		@param name 
+			name of access right
+	*/
+	public function allow($name){
+		$this->rules[$name]=true;
+	}
+	/*! change access rule to "deny"
+		
+		@param name 
+			name of access right
+	*/
+	public function deny($name){
+		$this->rules[$name]=false;
+	}
+	
+	/*! change all access rules to "deny"
+	*/
+	public function deny_all(){
+		$this->rules=array();
+	}	
+	
+	/*! check access rule
+		
+		@param name 
+			name of access right
+		@return 
+			true if access rule allowed, false otherwise
+	*/
+	public function check($name){
+		if ($this->local){
+			/*!
+			todo
+				add referrer check, to prevent access from remote points
+			*/
+		}
+		if (!isset($this->rules[$name]) || !$this->rules[$name]){
+			return false;
+		}
+		return true;
+	}
+}
+
+/*! Controls error and debug logging.
+	Class designed to be used as static object. 
+**/
+class LogMaster{
+	private static $_log=false;//!< logging mode flag
+	private static $_output=false;//!< output error infor to client flag
+	private static $session="";//!< all messages generated for current request
+	
+	/*! convert array to string representation ( it is a bit more readable than var_dump )
+	
+		@param data 
+			data object
+		@param pref
+			prefix string, used for formating, optional
+		@return 
+			string with array description
+	*/
+	private static function log_details($data,$pref=""){
+		if (is_array($data)){
+			$str=array("");
+			foreach($data as $k=>$v)
+				array_push($str,$pref.$k." => ".LogMaster::log_details($v,$pref."\t"));
+			return implode("\n",$str);
+   		}
+   		return $data;
+	}
+	/*! put record in log
+		
+		@param str 
+			string with log info, optional
+		@param data
+			data object, which will be added to log, optional
+	*/
+	public static function log($str="",$data=""){
+		if (LogMaster::$_log){
+			$message = $str.LogMaster::log_details($data)."\n\n";
+			LogMaster::$session.=$message;
+			error_log($message,3,LogMaster::$_log);			
+		}
+	}
+	
+	/*! get logs for current request
+		@return 
+			string, which contains all log messages generated for current request
+	*/
+	public static function get_session_log(){
+		return LogMaster::$session;
+	}
+	
+	/*! error handler, put normal php errors in log file
+		
+		@param errn
+			error number
+		@param errstr
+			error description
+		@param file
+			error file
+		@param line
+			error line
+		@param context
+			error cntext
+	*/
+	public static function error_log($errn,$errstr,$file,$line,$context){
+		LogMaster::log($errstr." at ".$file." line ".$line);
+	}
+	
+	/*! exception handler, used as default reaction on any error - show execution log and stop processing
+		
+		@param exception
+			instance of Exception	
+	*/
+	public static function exception_log($exception){
+		LogMaster::log("!!!Uncaught Exception\nCode: " . $exception->getCode() . "\nMessage: " . $exception->getMessage());
+		if (LogMaster::$_output){
+			echo "<pre><xmp>\n";
+			echo LogMaster::get_session_log();
+			echo "\n</xmp></pre>";
+		}
+		die();
+	}
+	
+	/*! enable logging
+
+		@param name 
+			path to the log file, if boolean false provided as value - logging will be disabled
+		@param output 
+			flag of client side output, if enabled - session log will be sent to client side in case of an error.
+	*/
+	public static function enable_log($name,$output=false){
+		LogMaster::$_log=$name;
+		LogMaster::$_output=$output;
+		if ($name){
+			set_error_handler(array("LogMaster","error_log"),E_ALL);
+			set_exception_handler(array("LogMaster","exception_log"));
+			LogMaster::log("\n\n====================================\nLog started, ".date("d/m/Y h:m:s")."\n====================================");
+		}
+	}
+}
+
+?>
\ No newline at end of file

=== added file 'addons/base_calendar/static/lib/dhtmlxScheduler/codebase/connector/tree_connector.php'
--- addons/base_calendar/static/lib/dhtmlxScheduler/codebase/connector/tree_connector.php	1970-01-01 00:00:00 +0000
+++ addons/base_calendar/static/lib/dhtmlxScheduler/codebase/connector/tree_connector.php	2011-04-07 05:03:24 +0000
@@ -0,0 +1,274 @@
+<?php
+require_once("base_connector.php");
+
+/*! DataItem class for Tree component
+**/
+
+class TreeDataItem extends DataItem{
+	private $im0;//!< image of closed folder
+	private $im1;//!< image of opened folder
+	private $im2;//!< image of leaf item
+	private $check;//!< checked state
+	private $kids=-1;//!< checked state
+	private $attrs;//!< collection of custom attributes
+	
+	function __construct($data,$config,$index){
+		parent::__construct($data,$config,$index);
+		
+		$this->im0=false;
+		$this->im1=false;
+		$this->im2=false;
+		$this->check=false;
+		$this->attrs = array();
+		$this->userdata = array();
+	}
+	/*! get id of parent record
+		
+		@return 
+			id of parent record
+	*/
+	function get_parent_id(){
+		return $this->data[$this->config->relation_id["name"]];
+	}
+	/*! get state of items checkbox
+		
+		@return 
+			state of item's checkbox as int value, false if state was not defined
+	*/
+	function get_check_state(){
+		return $this->check;
+	}
+	/*! set state of item's checkbox
+
+		@param value 
+			int value, 1 - checked, 0 - unchecked, -1 - third state
+	*/
+	function set_check_state($value){
+		$this->check=$value;
+	}
+	
+	/*! return count of child items
+		-1 if there is no info about childs
+		@return 
+			count of child items
+	*/
+	function has_kids(){
+		return $this->kids;
+	}
+	/*! sets count of child items
+		@param value
+			count of child items
+	*/
+	function set_kids($value){
+		$this->kids=$value;
+	}
+	
+	/*! set custom attribute 
+		
+		@param name 
+			name of the attribute
+		@param value
+			new value of the attribute
+	*/
+	function set_attribute($name, $value){
+		switch($name){
+			case "id": 
+				$this->set_id($value);
+				break;
+			case "text": 
+				$this->data[$this->config->text[0]["name"]]=$value;
+				break;
+			case "checked": 
+				$this->set_check_state($value);
+				break;
+			case "im0": 
+				$this->im0=$value;
+				break;
+			case "im1": 
+				$this->im1=$value;
+				break;
+			case "im2": 
+				$this->im2=$value;
+				break;
+			case "child": 
+				$this->set_kids($value);
+				break;
+			default:
+				$this->attrs[$name]=$value;
+		}
+	}
+	
+	/*! set userdata section for the item
+		
+		@param name
+			name of userdata
+		@param value
+			value of userdata
+	*/
+	function set_userdata($name, $value){
+		$this->userdata[$name]=$value;
+	}
+	
+	/*! assign image for tree's item
+		
+		@param img_folder_closed 
+			image for item, which represents folder in closed state
+		@param img_folder_open 
+			image for item, which represents folder in opened state, optional
+		@param img_leaf 
+			image for item, which represents leaf item, optional
+	*/
+	function set_image($img_folder_closed,$img_folder_open=false,$img_leaf=false){
+		$this->im0=$img_folder_closed;
+		$this->im1=$img_folder_open?$img_folder_open:$img_folder_closed;
+		$this->im2=$img_leaf?$img_leaf:$img_folder_closed;
+	}
+	/*! return self as XML string, starting part
+	*/
+	function to_xml_start(){
+		if ($this->skip) return "";
+		
+		$str1="<item id='".$this->get_id()."' text='".$this->xmlentities($this->data[$this->config->text[0]["name"]])."' ";
+		if ($this->has_kids()==true) $str1.="child='".$this->has_kids()."' ";
+		if ($this->im0) $str1.="im0='".$this->im0."' ";
+		if ($this->im1) $str1.="im1='".$this->im0."' ";
+		if ($this->im2) $str1.="im2='".$this->im0."' ";
+		if ($this->check) $str1.="checked='".$this->check."' ";
+		foreach ($this->attrs as $key => $value)
+			$str1.=$key."='".$this->xmlentities($value)."' ";
+		$str1.=">";
+		foreach ($this->userdata as $key => $value)
+			$str1.="<userdata name='".$key."'><![CDATA[".$value."]]></userdata>";
+			
+		return $str1;
+	}
+	/*! return self as XML string, ending part
+	*/
+	function to_xml_end(){
+		if ($this->skip) return "";
+		return "</item>";
+	}
+
+}
+
+require_once("filesystem_item.php");
+
+/*! Connector for the dhtmlxtree
+**/
+class TreeConnector extends Connector{
+	private $id_swap = array();
+	
+	/*! constructor
+		
+		Here initilization of all Masters occurs, execution timer initialized
+		@param res 
+			db connection resource
+		@param type
+			string , which hold type of database ( MySQL or Postgre ), optional, instead of short DB name, full name of DataWrapper-based class can be provided
+		@param item_type
+			name of class, which will be used for item rendering, optional, DataItem will be used by default
+		@param data_type
+			name of class which will be used for dataprocessor calls handling, optional, DataProcessor class will be used by default. 
+	*/	
+	public function __construct($res,$type=false,$item_type=false,$data_type=false){
+		if (!$item_type) $item_type="TreeDataItem";
+		if (!$data_type) $data_type="TreeDataProcessor";
+		parent::__construct($res,$type,$item_type,$data_type);
+		
+		$this->event->attach("afterInsert",array($this,"parent_id_correction_a"));
+		$this->event->attach("beforeProcessing",array($this,"parent_id_correction_b"));
+	}
+	
+	/*! store info about ID changes during insert operation
+		@param dataAction 
+			data action object during insert operation
+	*/
+	public function parent_id_correction_a($dataAction){
+		$this->id_swap[$dataAction->get_id()]=$dataAction->get_new_id();
+	}
+	/*! update ID if it was affected by previous operation
+		@param dataAction 
+			data action object, before any processing operation
+	*/
+	public function parent_id_correction_b($dataAction){
+		$relation = $this->config->relation_id["db_name"];
+		$value = $dataAction->get_value($relation);
+		
+		if (array_key_exists($value,$this->id_swap))
+			$dataAction->set_value($relation,$this->id_swap[$value]);
+	}
+	
+	
+	public function parse_request(){
+		parent::parse_request();
+		
+		if (isset($_GET["id"]))
+			$this->request->set_relation($_GET["id"]);
+		else
+			$this->request->set_relation("0");
+			
+		$this->request->set_limit(0,0); //netralize default reaction on dyn. loading mode
+	}
+	
+
+   
+	protected function render_set($res){
+		$output="";
+		$index=0;
+		while ($data=$this->sql->get_next($res)){
+			$data = new $this->names["item_class"]($data,$this->config,$index);
+			$this->event->trigger("beforeRender",$data);
+		//there is no info about child elements, 
+		//if we are using dyn. loading - assume that it has,
+		//in normal mode juse exec sub-render routine			
+			if ($data->has_kids()===-1 && $this->dload)
+					$data->set_kids(true);
+			$output.=$data->to_xml_start();
+			if ($data->has_kids()===-1 || ( $data->has_kids()==true && !$this->dload)){
+				$sub_request = new DataRequestConfig($this->request);
+				$sub_request->set_relation($data->get_id());
+				$output.=$this->render_set($this->sql->select($sub_request));
+			}
+			$output.=$data->to_xml_end();
+			$index++;
+		}
+		return $output;
+	}
+   /*! renders self as  xml, starting part
+	*/
+	public function xml_start(){
+		return "<tree id='".$this->request->get_relation()."'>";
+	}
+	
+	/*! renders self as  xml, ending part
+	*/
+	public function xml_end(){
+		return "</tree>";
+	}
+}
+
+
+class TreeDataProcessor extends DataProcessor{
+	
+	function __construct($connector,$config,$request){
+		parent::__construct($connector,$config,$request);
+		$request->set_relation(false);
+	}
+		
+	/*! convert incoming data name to valid db name
+		converts c0..cN to valid field names
+		@param data 
+			data name from incoming request
+		@return 
+			related db_name
+	*/
+	function name_data($data){
+		if ($data=="tr_pid")
+			return $this->config->relation_id["db_name"];
+		if ($data=="tr_text")
+			return $this->config->text[0]["db_name"];
+		return $data;
+	}
+}		
+
+?>
\ No newline at end of file

=== added file 'addons/base_calendar/static/lib/dhtmlxScheduler/codebase/connector/treegrid_connector.php'
--- addons/base_calendar/static/lib/dhtmlxScheduler/codebase/connector/treegrid_connector.php	1970-01-01 00:00:00 +0000
+++ addons/base_calendar/static/lib/dhtmlxScheduler/codebase/connector/treegrid_connector.php	2011-04-07 05:03:24 +0000
@@ -0,0 +1,161 @@
+<?php
+require_once("grid_connector.php");
+
+/*! DataItem class for TreeGrid component
+**/
+class TreeGridDataItem extends GridDataItem{
+	private $kids=-1;//!< checked state
+	
+	function __construct($data,$config,$index){
+		parent::__construct($data,$config,$index);
+		$this->im0=false;
+	}
+	/*! return id of parent record
+
+		@return 
+			id of parent record
+	*/
+	function get_parent_id(){
+		return $this->data[$this->config->relation_id["name"]];
+	}
+	/*! assign image to treegrid's item
+		longer description
+		@param img 
+			relative path to the image
+	*/
+	function set_image($img){
+		$this->set_cell_attribute($this->config->text[0]["name"],"image",$img);
+	}	
+
+	/*! return count of child items
+		-1 if there is no info about childs
+		@return 
+			count of child items
+	*/	
+	function has_kids(){
+		return $this->kids;
+	}
+	/*! sets count of child items
+		@param value
+			count of child items
+	*/	
+	function set_kids($value){
+		$this->kids=$value;
+		if ($value) 
+			$this->set_row_attribute("xmlkids",$value);
+	}
+}
+/*! Connector for dhtmlxTreeGrid
+**/
+class TreeGridConnector extends GridConnector{
+	private $id_swap = array();
+	
+	/*! constructor
+		
+		Here initilization of all Masters occurs, execution timer initialized
+		@param res 
+			db connection resource
+		@param type
+			string , which hold type of database ( MySQL or Postgre ), optional, instead of short DB name, full name of DataWrapper-based class can be provided
+		@param item_type
+			name of class, which will be used for item rendering, optional, DataItem will be used by default
+		@param data_type
+			name of class which will be used for dataprocessor calls handling, optional, DataProcessor class will be used by default. 
+	*/	
+	public function __construct($res,$type=false,$item_type=false,$data_type=false){
+		if (!$item_type) $item_type="TreeGridDataItem";
+		if (!$data_type) $data_type="TreeGridDataProcessor";
+		parent::__construct($res,$type,$item_type,$data_type);
+	
+		$this->event->attach("afterInsert",array($this,"parent_id_correction_a"));
+		$this->event->attach("beforeProcessing",array($this,"parent_id_correction_b"));
+	}
+
+	/*! store info about ID changes during insert operation
+		@param dataAction 
+			data action object during insert operation
+	*/	
+	public function parent_id_correction_a($dataAction){
+		$this->id_swap[$dataAction->get_id()]=$dataAction->get_new_id();
+	}
+	/*! update ID if it was affected by previous operation
+		@param dataAction 
+			data action object, before any processing operation
+	*/
+	public function parent_id_correction_b($dataAction){
+		$relation = $this->config->relation_id["db_name"];
+		$value = $dataAction->get_value($relation);
+		
+		if (array_key_exists($value,$this->id_swap))
+			$dataAction->set_value($relation,$this->id_swap[$value]);
+	}
+		
+	/*! process treegrid specific options in incoming request
+	*/
+	public function parse_request(){
+		parent::parse_request();
+		
+		if (isset($_GET["id"]))
+			$this->request->set_relation($_GET["id"]);
+		else
+			$this->request->set_relation("0");
+			
+		$this->request->set_limit(0,0); //netralize default reaction on dyn. loading mode
+	}
+	
+	/*! process treegrid specific options in incoming request
+	*/	
+	protected function render_set($res){
+		$output="";
+		$index=0;
+		while ($data=$this->sql->get_next($res)){
+			$data = new $this->names["item_class"]($data,$this->config,$index);
+			$this->event->trigger("beforeRender",$data);
+		//there is no info about child elements, 
+		//if we are using dyn. loading - assume that it has,
+		//in normal mode juse exec sub-render routine			
+			if ($data->has_kids()===-1 && $this->dload)
+					$data->set_kids(true);
+			$output.=$data->to_xml_start();
+			if ($data->has_kids()===-1 || ( $data->has_kids()==true && !$this->dload)){
+				$sub_request = new DataRequestConfig($this->request);
+				$sub_request->set_relation($data->get_id());
+				$output.=$this->render_set($this->sql->select($sub_request));
+			}
+			$output.=$data->to_xml_end();
+			$index++;
+		}
+		return $output;
+	}	
+	
+	/*! renders self as  xml, starting part
+	*/	
+	protected function xml_start(){
+		return "<rows parent='".$this->request->get_relation()."'>";
+	}	
+}
+
+/*! DataProcessor class for Grid component
+**/
+class TreeGridDataProcessor extends GridDataProcessor{
+	
+	function __construct($connector,$config,$request){
+		parent::__construct($connector,$config,$request);
+		$request->set_relation(false);
+	}
+	
+	/*! convert incoming data name to valid db name
+		converts c0..cN to valid field names
+		@param data 
+			data name from incoming request
+		@return 
+			related db_name
+	*/
+	function name_data($data){
+		
+		if ($data=="gr_pid")
+			return $this->config->relation_id["name"];
+		else return parent::name_data($data);
+	}
+}
+?>
\ No newline at end of file

=== added file 'addons/base_calendar/static/lib/dhtmlxScheduler/codebase/connector/update.php'
--- addons/base_calendar/static/lib/dhtmlxScheduler/codebase/connector/update.php	1970-01-01 00:00:00 +0000
+++ addons/base_calendar/static/lib/dhtmlxScheduler/codebase/connector/update.php	2011-04-07 05:03:24 +0000
@@ -0,0 +1,262 @@
+<?php
+
+/*! DataItemUpdate class for realization Optimistic concurrency control
+	Wrapper for DataItem object
+	It's used during outputing updates instead of DataItem object
+	Create wrapper for every data item with update information.
+*/
+class DataItemUpdate extends DataItem {
+
+
+	/*! constructor
+		@param data
+			hash of data
+		@param config
+			DataConfig object
+		@param index
+			index of element
+	*/
+	public function __construct($data,$config,$index,$type){
+		$this->config=$config;
+		$this->data=$data;
+		$this->index=$index;
+		$this->skip=false;
+		$this->child = new $type($data, $config, $index);
+	}
+
+	/*! returns parent_id (for Tree and TreeGrid components)
+	*/
+	public function get_parent_id(){
+		if (method_exists($this->child, 'get_parent_id')) {
+			return $this->child->get_parent_id();
+		} else {
+			return '';
+		}
+	}
+
+
+	/*! generate XML on the data hash base
+	*/
+	public function to_xml(){
+        $str= "<update ";
+		$str .= 'status="'.$this->data['type'].'" ';
+		$str .= 'id="'.$this->data['dataId'].'" ';
+		$str .= 'parent="'.$this->get_parent_id().'"';
+		$str .= '>';
+		$str .= $this->child->to_xml();
+		$str .= '</update>';
+        return $str;
+	}
+
+	/*! return starting tag for XML string
+	*/
+	public function to_xml_start(){
+		$str="<update ";
+		$str .= 'status="'.$this->data['type'].'" ';
+		$str .= 'id="'.$this->data['dataId'].'" ';
+		$str .= 'parent="'.$this->get_parent_id().'"';
+		$str .= '>';
+		$str .= $this->child->to_xml_start();
+		return $str;
+	}
+
+	/*! return ending tag for XML string
+	*/
+	public function to_xml_end(){
+		$str = $this->child->to_xml_end();
+		$str .= '</update>';
+		return $str;
+	}
+
+	/*! returns false for outputing only current item without child items
+	*/
+	public function has_kids(){
+		return false;
+	}
+
+	/*! sets count of child items
+		@param value
+			count of child items
+	*/
+	public function set_kids($value){
+		if (method_exists($this->child, 'set_kids')) {
+			$this->child->set_kids($value);
+		}
+	}
+
+	/*! sets attribute for item
+	*/
+	public function set_attribute($name, $value){
+		if (method_exists($this->child, 'set_attribute')) {
+			LogMaster::log("setting attribute: \nname = {$name}\nvalue = {$value}");
+			$this->child->set_attribute($name, $value);
+		} else {
+			LogMaster::log("set_attribute method doesn't exists");
+		}
+	}
+}
+
+
+class DataUpdate{
+	
+	protected $table; //!< table , where actions are stored
+	protected $url; //!< url for notification service, optional
+    protected $sql; //!< DB wrapper object
+    protected $config; //!< DBConfig object
+    protected $request; //!< DBRequestConfig object
+    protected $event;
+    protected $item_class;
+    protected $demu;
+	
+	//protected $config;//!< DataConfig instance
+	//protected $request;//!< DataRequestConfig instance
+	
+	/*! constructor
+	  
+	  @param connector 
+	     Connector object
+	  @param config
+	     DataConfig object
+	  @param request
+	     DataRequestConfig object
+	*/
+	function __construct($sql, $config, $request, $table, $url){
+        $this->config= $config;
+        $this->request= $request;
+        $this->sql = $sql;
+        $this->table=$table;
+        $this->url=$url;
+        $this->demu = false;
+	}
+
+    public function set_demultiplexor($path){
+        $this->demu = $path;
+    }
+
+    public function set_event($master, $name){
+        $this->event = $master;
+        $this->item_class = $name;
+    }
+   	
+	private function select_update($actions_table, $join_table, $id_field_name, $version, $user) {
+		$sql = "SELECT * FROM  {$actions_table}";
+		$sql .= " LEFT OUTER JOIN {$join_table} ON ";
+		$sql .= "{$actions_table}.DATAID = {$join_table}.{$id_field_name} ";
+		$sql .= "WHERE {$actions_table}.ID > '{$version}' AND {$actions_table}.USER <> '{$user}'";
+		return $sql;
+	}
+
+	private function get_update_max_version() {
+		$sql = "SELECT MAX(id) as VERSION FROM {$this->table}";
+		$res = $this->sql->query($sql);
+		$data = $this->sql->get_next($res);
+		
+		if ($data == false || $data['VERSION'] == false) 
+			return 1;
+		else
+			return $data['VERSION'];
+	}
+
+	private function log_update_action($actions_table, $dataId, $status, $user) {
+		$sql = "INSERT INTO {$actions_table} (DATAID, TYPE, USER) VALUES ('{$dataId}', '{$status}', '{$user}')";
+		$this->sql->query($sql);
+        if ($this->demu)
+            file_get_contents($this->demu);
+	}
+
+
+
+
+	/*! records operations in actions_table
+		@param action
+			DataAction object
+	*/
+	public function log_operations($action) {
+		$type = 	$this->sql->escape($action->get_status());
+		$dataId = 	$this->sql->escape($action->get_new_id());
+		$user = 	$this->sql->escape($this->request->get_user());
+		if ($type!="error" && $type!="invalid" && $type !="collision") {
+			$this->log_update_action($this->table, $dataId, $type, $user);
+		}
+	}
+
+
+	/*! return action version in XMl format
+	*/
+	public function get_version() {
+		$version = $this->get_update_max_version();
+		return "<userdata name='version'>".$version."</userdata>";
+	}
+
+
+	/*! adds action version in output XML as userdata
+	*/
+	public function version_output() {
+			echo $this->get_version();
+	}
+
+
+	/*! create update actions in XML-format and sends it to output
+	*/
+	public function get_updates() {
+		$sub_request = new DataRequestConfig($this->request);
+		$version =	$this->request->get_version();
+		$user = 	$this->request->get_user();
+
+		$sub_request->parse_sql($this->select_update($this->table, $this->request->get_source(), $this->config->id['db_name'], $version, $user));
+		$sub_request->set_relation(false);
+
+		$output = $this->render_set($this->sql->select($sub_request), $this->item_class);
+        
+		ob_clean();
+		header("Content-type:text/xml");
+        
+		echo $this->updates_start();
+		echo $this->get_version();
+		echo $output;
+		echo $this->updates_end();
+	}
+
+    
+	protected function render_set($res, $name){
+		$output="";
+		$index=0;
+		while ($data=$this->sql->get_next($res)){
+			$data = new DataItemUpdate($data,$this->config,$index, $name);
+			$this->event->trigger("beforeRender",$data);
+			$output.=$data->to_xml();
+			$index++;
+		}
+		return $output;
+	}
+
+	/*! returns update start string
+	*/
+	protected function updates_start() {
+		$start = '<updates>';
+		return $start;
+	}
+
+	/*! returns update end string
+	*/
+	protected function updates_end() {
+		$start = '</updates>';
+		return $start;
+	}
+
+	/*! checks if action version given by client is deprecated
+		@param action
+			DataAction object
+	*/
+	public function check_collision($action) {
+		$version =	$this->sql->escape($this->request->get_version());
+		//$user = 	$this->sql->escape($this->request->get_user());
+		$last_version = $this->get_update_max_version();
+		if (($last_version > $version)&&($action->get_status() == 'update')) {
+			$action->error();
+			$action->set_status('collision');
+		}
+	}
+}
+	
+?>
\ No newline at end of file

=== added file 'addons/base_calendar/static/lib/dhtmlxScheduler/codebase/dhtmlxscheduler.css'
--- addons/base_calendar/static/lib/dhtmlxScheduler/codebase/dhtmlxscheduler.css	1970-01-01 00:00:00 +0000
+++ addons/base_calendar/static/lib/dhtmlxScheduler/codebase/dhtmlxscheduler.css	2011-04-07 05:03:24 +0000
@@ -0,0 +1,525 @@
+.dhx_cal_container {
+	background-color:#C2D5FC;
+	font-family:Tahoma;
+	font-size:8pt;
+	position:relative;
+	overflow:hidden;
+}
+
+.dhx_cal_container div {
+	-moz-user-select:none;
+	-moz-user-select:-moz-none;
+}
+
+.dhx_cal_navline {
+	height:20px;
+	position:absolute;
+	z-index:3;
+	width:750px;
+	color:#2F3A48;
+}
+
+.dhx_cal_navline div {
+	position:absolute;
+	top:2px;
+	white-space:nowrap;
+}
+
+.dhx_cal_navline .dhx_cal_date {
+	font-weight:600;
+	left:210px;
+}
+
+.dhx_cal_button .dhx_left_bg {
+	width:1px;
+	overflow:hidden;
+	height:17px;
+	z-index:20;
+	top:0;
+}
+
+.dhx_cal_prev_button {
+	background-image:url(imgs/buttons.png);
+	background-position:0 0;
+	width:29px;
+	height:17px;
+	left:50px;
+	cursor:pointer;
+}
+
+.dhx_cal_next_button{
+	background-image:url(imgs/buttons.png);
+	background-position:-30px 0;
+	width:29px;
+	height:17px;
+	left:80px;
+	cursor:pointer;
+}
+
+.dhx_cal_today_button{
+	background-image:url(imgs/buttons.png);
+	background-position:-60px 0;
+	width:75px;
+	height:17px;
+	left:112px;
+	cursor:pointer;
+	text-align:center;
+	text-decoration:underline;
+}
+
+.dhx_cal_tab {
+	background-image:url(imgs/white_tab.png);
+	width:61px;
+	height:19px;
+	text-align:center;
+	text-decoration:underline;
+	padding-top:3px;
+	cursor:pointer;
+}
+
+.dhx_cal_tab.active {
+	background-image:url(imgs/blue_tab.png);
+	text-decoration:none;
+	height:20px;
+	padding-top:2px;
+	cursor:default;
+	font-weight:bold;
+}
+
+.dhx_cal_header {
+	position:absolute;
+	left:10px;
+	top:23px;
+	width:750px;
+	border-top:1px dotted #8894A3;
+	border-right:1px dotted #8894A3;
+	z-index:2;
+	overflow:hidden;
+	color:#2F3A48;
+}
+
+.dhx_cal_data {
+	border-top:1px dotted #8894A3;
+	position:absolute;
+	top:44px;
+	width:600px;
+	overflow-y:auto;
+	overflow-x:hidden;
+}
+
+.dhx_scale_bar {
+	position:absolute;
+	text-align:center;
+	background-color:#C2D5FC;
+	padding-top:3px;
+	border-left:1px dotted #586A7E;
+}
+
+.dhx_scale_holder {
+	position:absolute;
+	border-right:1px dotted #586A7E;
+	background-image:url(imgs/databg.png);
+}
+
+.dhx_scale_holder_now {
+	position:absolute;
+	border-right:1px dotted #586A7E;
+	background-image:url(imgs/databg_now.png);
+}
+
+.dhx_scale_hour {
+	height:41px;
+	width:50px;
+	border-bottom:1px dotted #8894A3;
+	background-color:#C2D5FC;
+	text-align:center;
+	line-height:40px;
+	color:#586A7E;
+	overflow:hidden;
+}
+
+.dhx_month_head {
+	background-color:#EBEFF4;
+	color:#2F3A48;
+	border-right:1px dotted #586A7E;
+	height:18px;
+	padding-right:5px;
+	padding-top:3px;
+	text-align:right;
+}
+
+.dhx_month_body {
+	border-right:1px dotted #586A7E;
+	border-bottom:1px dotted #586A7E;
+	background-color:#FFF;
+}
+
+.dhx_now .dhx_month_body {
+	background-color:#E2EDFF;
+}
+
+.dhx_after .dhx_month_body,.dhx_before .dhx_month_body {
+	background-color:#ECECEC;
+}
+
+.dhx_after .dhx_month_head,.dhx_before .dhx_month_head {
+	background-color:#E2E3E6;
+	color:#94A6BB;
+}
+
+.dhx_now .dhx_month_head {
+	background-color:#D1DEF4;
+	font-weight:bold;
+}
+
+.dhx_cal_drag {
+	position:absolute;
+	z-index:9999;
+	background-color:#FFE763;
+	border:1px solid #B7A543;
+	opacity:.5;
+	filter:alpha(opacity=50);
+}
+
+.dhx_loading {
+	position:absolute;
+	width:128px;
+	height:15px;
+	background-image:url(imgs/loading.gif);
+	z-index:9999;
+}
+
+.dhx_multi_day_icon,.dhx_multi_day {
+	position:absolute;
+	background-color:#E1E6FF;
+	background-repeat:no-repeat;
+	border-bottom:1px dotted #8894A3;
+	border-left:1px dotted #8894A3;
+}
+
+.dhx_multi_day_icon {
+	background-image:url(imgs/clock_big.gif);
+}
+
+.dhx_multi_day_icon_small {
+	background-image:url(imgs/clock_small.gif);
+}
+
+.dhx_multi_day_icon,.dhx_multi_day_icon_small {
+	background-position:center center;
+	position:absolute;
+	background-color:#E1E6FF;
+	background-repeat:no-repeat;
+	border-bottom:1px dotted #8894A3;
+	border-left:1px dotted #8894A3;
+}
+
+.dhtmlxLayoutPolyContainer_dhx_skyblue .dhx_cal_container {
+	background-color:#d0e5ff;
+}
+
+.dhx_cal_event div {
+	background-color:#FFE763;
+	border:1px solid #B7A543;
+	color:#887A2E;
+	overflow:hidden;width:100%;
+	font-family:Tahoma;
+	font-size:8pt;
+}
+
+/*event in day or week or month view*/
+
+.dhx_cal_event.purple div,
+.dhx_cal_event_line.purple {
+	background-color:purple !important; 
+	color:white !important;
+}
+
+.dhx_move_denied .dhx_cal_event .dhx_header,.dhx_move_denied .dhx_cal_event .dhx_title {
+	cursor:default;
+}
+
+.dhx_cal_event .dhx_header {
+	height:1px;
+	margin-left:1px;
+	border-width:1px 1px 0 1px;
+	cursor:pointer;
+}
+
+.dhx_cal_event .dhx_title {
+	height:12px;
+	border-width:0 1px 1px 1px;
+	border-bottom-style:dotted;
+	font-size:7pt;
+	font-weight:bold;
+	text-align:center;
+	background-position:right;
+	background-repeat:no-repeat;
+	cursor:pointer;
+}
+
+.dhx_cal_event .dhx_body {
+	border-width:0 1px 1px 1px;
+	padding:5px;
+}
+
+.dhx_resize_denied .dhx_cal_event .dhx_footer {
+	cursor:default;
+}
+
+.dhx_cal_event .dhx_footer {
+	height:1px;
+	margin-left:2px;
+	border-width:0 1px 1px 1px;
+	cursor:s-resize;
+}
+
+.dhx_cal_event_line {
+	background-color:#FFE763;
+	border:1px solid #B7A543;
+	font-family:Tahoma;
+	font-size:8pt;
+	height:13px;
+	padding-left:10px;
+	color:#887A2E;
+	cursor:pointer;
+	overflow:hidden;
+}
+
+.dhx_cal_event_clear {
+	font-family:Tahoma;
+	font-size:8pt;
+	height:13px;
+	padding-left:2px;
+	color:#887A2E;
+	white-space:nowrap;
+	overflow:hidden;
+	cursor:pointer;
+}
+
+.dhx_in_move {
+	background-color:#FFFF80;
+}
+
+div.dhx_cal_editor {
+	background-color:#FFE763;
+	border:1px solid #B7A543;
+	border-top-style:dotted;
+	z-index:999;
+	position:absolute;
+	overflow:hidden;
+}
+
+textarea.dhx_cal_editor {
+	width:100%;
+	height:100%;
+	border:0 solid black;
+	margin:none;
+	padding:none;
+	overflow:auto;
+}
+
+div.dhx_menu_head {
+	background-image:url(imgs/controls.gif);
+	background-position:0 -43px;
+	width:10px;
+	height:10px;
+	margin-left:5px;
+	margin-top:1px;
+	border:none;
+	cursor:default;
+}
+
+div.dhx_menu_icon {
+	background-image:url(imgs/controls.gif);
+	width:20px;
+	height:20px;
+	margin-left:-5px;
+	margin-top:0;
+	border:none;
+	cursor:pointer;
+}
+
+div.icon_details {
+	background-position:0 0;
+}
+
+div.icon_edit {
+	background-position:-22px 0;
+}
+
+div.icon_save {
+	background-position:-84px -1px;
+}
+
+div.icon_cancel {
+	background-position:-62px 0;
+}
+
+div.icon_delete {
+	background-position:-42px 0;
+}
+
+.dhx_cal_light {
+	height:400px;
+	light:300px;
+	background-color:#FFE763;
+	font-family:Tahoma;
+	font-size:8pt;
+	border:1px solid #B7A64B;
+	color:#887A2E;
+	position:absolute;
+	z-index:10001;
+	width:580px;
+	height:300px;
+}
+
+.dhx_mark {
+	position:relative;
+	top:3px;
+	background-image:url('./imgs/controls.gif');
+	background-position:0 -43px;
+	padding-left:10px;
+}
+
+.dhx_ie6 .dhx_mark {
+	background-position:6px -41px;
+}
+
+.dhx_cal_light select {
+	font-family:Tahoma;
+	font-size:8pt;
+	color:#887A2E;
+	padding:2px;
+	margin:0;
+}
+
+.dhx_cal_ltitle {
+	padding:2px 0 2px 5px;
+	overflow:hidden;
+	white-space:nowrap;
+}
+
+.dhx_cal_ltitle span {
+	white-space:nowrap;
+}
+
+.dhx_cal_lsection {
+	background-color:#DBCF8C;
+	color:#FFF4B5;
+	font-size:18pt;
+	font-weight:bold;
+	padding:5px 0 3px 10px;
+}
+
+.dhx_cal_ltext {
+	padding:2px 0 2px 10px;
+	height:130px;
+	height=140px;
+	overflow:hidden;
+}
+
+.dhx_cal_ltext textarea {
+	background-color:transparent;
+	overflow:auto;
+	border:none;
+	color:#887A2E;
+	height:100%;
+	width:100%;
+	outline:none!important;
+}
+
+.dhx_time {
+	font-weight:bold;
+}
+
+.dhx_cal_light .dhx_title {
+	padding-left:10px;
+}
+
+.dhx_cal_larea {
+	border:1px solid #DCC43E;
+	background-color:#FFF4B5;
+	overflow:hidden;
+	margin-left:3px;
+	width:572px;
+	height:1px;
+}
+
+.dhx_btn_set {
+	padding:5px 10px 0 10px;
+	float:left;
+}
+
+.dhx_btn_set div {
+	float:left;
+	height:21px;
+	line-height:21px;
+	vertical-align:middle;
+	cursor:pointer;
+}
+
+.dhx_save_btn {
+	background-image:url('./imgs/controls.gif');
+	background-position:-84px 0;
+	width:21px;
+}
+
+.dhx_cancel_btn {
+	background-image:url('./imgs/controls.gif');
+	background-position:-63px 0;
+	width:20px;
+}
+
+.dhx_delete_btn {
+	background-image:url('./imgs/controls.gif');
+	background-position:-42px 0;
+	width:20px;
+}
+
+.dhx_cal_cover {
+	width:100%;
+	height:100%;
+	position:absolute;
+	z-index:10000;
+	top:0;
+	left:0;
+	background-color:black;
+	opacity:.1;
+	filter:alpha(opacity=10);
+}
+
+.dhx_custom_button {
+	padding:0 3px 0 3px;
+	color:#887A2E;
+	font-family:Tahoma;
+	font-size:8pt;
+	background-color:#FFE763;
+	font-weight:normal;
+	margin-right:5px;
+	margin-top:5px;
+	cursor:pointer;
+}
+
+.dhx_custom_button div {
+	cursor:pointer;
+	float:left;
+	height:21px;
+	line-height:21px;
+	vertical-align:middle;
+}
+
+.dhx_fullday_checkbox {
+	padding-top:5px;
+	float:right;
+}
+
+.dhx_fullday_checkbox input {
+	vertical-align:middle;
+}
+
+.dhx_fullday_checkbox label {
+	font-size:12pt;
+	font-weight:bold;
+	vertical-align:middle;
+}
\ No newline at end of file

=== added file 'addons/base_calendar/static/lib/dhtmlxScheduler/codebase/dhtmlxscheduler.js'
--- addons/base_calendar/static/lib/dhtmlxScheduler/codebase/dhtmlxscheduler.js	1970-01-01 00:00:00 +0000
+++ addons/base_calendar/static/lib/dhtmlxScheduler/codebase/dhtmlxscheduler.js	2011-04-07 05:03:24 +0000
@@ -0,0 +1,3735 @@
+/*
+dhtmlxScheduler v.2.3
+
+This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
+to use it in not GPL project. Please contact sales@xxxxxxxxxx for details
+
+(c) DHTMLX Ltd.
+*/
+dhtmlx = function (B) {
+    for (var A in B) {
+        dhtmlx[A] = B[A]
+    }
+    return dhtmlx
+};
+dhtmlx.extend_api = function (A, D, C) {
+    var B = window[A];
+    if (!B) {
+        return
+    }
+    window[A] = function (G) {
+        if (G && typeof G == "object" && !G.tagName && !(G instanceof Array)) {
+            var F = B.apply(this, (D._init ? D._init(G) : arguments));
+            for (var E in dhtmlx) {
+                if (D[E]) {
+                    this[D[E]](dhtmlx[E])
+                }
+            }
+            for (var E in G) {
+                if (D[E]) {
+                    this[D[E]](G[E])
+                } else {
+                    if (E.indexOf("on") == 0) {
+                        this.attachEvent(E, G[E])
+                    }
+                }
+            }
+        } else {
+            var F = B.apply(this, arguments)
+        }
+        if (D._patch) {
+            D._patch(this)
+        }
+        return F || this
+    };
+    window[A].prototype = B.prototype;
+    if (C) {
+        dhtmlXHeir(window[A].prototype, C)
+    }
+};
+dhtmlxAjax = {
+    get: function (A, C) {
+        var B = new dtmlXMLLoaderObject(true);
+        B.async = (arguments.length < 3);
+        B.waitCall = C;
+        B.loadXML(A);
+        return B
+    },
+    post: function (A, C, D) {
+        var B = new dtmlXMLLoaderObject(true);
+        B.async = (arguments.length < 4);
+        B.waitCall = D;
+        B.loadXML(A, true, C);
+        return B
+    },
+    getSync: function (A) {
+        return this.get(A, null, true)
+    },
+    postSync: function (A, B) {
+        return this.post(A, B, null, true)
+    }
+};
+
+function dtmlXMLLoaderObject(B, D, C, A) {
+    this.xmlDoc = "";
+    if (typeof(C) != "undefined") {
+        this.async = C
+    } else {
+        this.async = true
+    }
+    this.onloadAction = B || null;
+    this.mainObject = D || null;
+    this.waitCall = null;
+    this.rSeed = A || false;
+    return this
+}
+dtmlXMLLoaderObject.prototype.waitLoadFunction = function (B) {
+    var A = true;
+    this.check = function () {
+        if ((B) && (B.onloadAction != null)) {
+            if ((!B.xmlDoc.readyState) || (B.xmlDoc.readyState == 4)) {
+                if (!A) {
+                    return
+                }
+                A = false;
+                if (typeof B.onloadAction == "function") {
+                    B.onloadAction(B.mainObject, null, null, null, B)
+                }
+                if (B.waitCall) {
+                    B.waitCall.call(this, B);
+                    B.waitCall = null
+                }
+            }
+        }
+    };
+    return this.check
+};
+dtmlXMLLoaderObject.prototype.getXMLTopNode = function (C, A) {
+    if (this.xmlDoc.responseXML) {
+        var B = this.xmlDoc.responseXML.getElementsByTagName(C);
+        if (B.length == 0 && C.indexOf(":") != -1) {
+            var B = this.xmlDoc.responseXML.getElementsByTagName((C.split(":"))[1])
+        }
+        var E = B[0]
+    } else {
+        var E = this.xmlDoc.documentElement
+    }
+    if (E) {
+        this._retry = false;
+        return E
+    }
+    if ((_isIE) && (!this._retry)) {
+        var D = this.xmlDoc.responseText;
+        var A = this.xmlDoc;
+        this._retry = true;
+        this.xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
+        this.xmlDoc.async = false;
+        this.xmlDoc.loadXML(D);
+        return this.getXMLTopNode(C, A)
+    }
+    dhtmlxError.throwError("LoadXML", "Incorrect XML", [(A || this.xmlDoc), this.mainObject]);
+    return document.createElement("DIV")
+};
+dtmlXMLLoaderObject.prototype.loadXMLString = function (B) {
+    try {
+        var C = new DOMParser();
+        this.xmlDoc = C.parseFromString(B, "text/xml")
+    } catch (A) {
+        this.xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
+        this.xmlDoc.async = this.async;
+        this.xmlDoc.loadXML(B)
+    }
+    this.onloadAction(this.mainObject, null, null, null, this);
+    if (this.waitCall) {
+        this.waitCall();
+        this.waitCall = null
+    }
+};
+dtmlXMLLoaderObject.prototype.loadXML = function (C, B, A, D) {
+    if (this.rSeed) {
+        C += ((C.indexOf("?") != -1) ? "&" : "?") + "a_dhx_rSeed=" + (new Date()).valueOf()
+    }
+    this.filePath = C;
+    if ((!_isIE) && (window.XMLHttpRequest)) {
+        this.xmlDoc = new XMLHttpRequest()
+    } else {
+        this.xmlDoc = new ActiveXObject("Microsoft.XMLHTTP")
+    }
+    if (this.async) {
+        this.xmlDoc.onreadystatechange = new this.waitLoadFunction(this)
+    }
+    this.xmlDoc.open(B ? "POST" : "GET", C, this.async);
+    if (D) {
+        this.xmlDoc.setRequestHeader("User-Agent", "dhtmlxRPC v0.1 (" + navigator.userAgent + ")");
+        this.xmlDoc.setRequestHeader("Content-type", "text/xml")
+    } else {
+        if (B) {
+            this.xmlDoc.setRequestHeader("Content-type", "application/x-www-form-urlencoded")
+        }
+    }
+    this.xmlDoc.setRequestHeader("X-Requested-With", "XMLHttpRequest");
+    this.xmlDoc.send(null || A);
+    if (!this.async) {
+        (new this.waitLoadFunction(this))()
+    }
+};
+dtmlXMLLoaderObject.prototype.destructor = function () {
+    this.onloadAction = null;
+    this.mainObject = null;
+    this.xmlDoc = null;
+    return null
+};
+dtmlXMLLoaderObject.prototype.xmlNodeToJSON = function (D) {
+    var C = {};
+    for (var B = 0; B < D.attributes.length; B++) {
+        C[D.attributes[B].name] = D.attributes[B].value
+    }
+    C._tagvalue = D.firstChild ? D.firstChild.nodeValue : "";
+    for (var B = 0; B < D.childNodes.length; B++) {
+        var A = D.childNodes[B].tagName;
+        if (A) {
+            if (!C[A]) {
+                C[A] = []
+            }
+            C[A].push(this.xmlNodeToJSON(D.childNodes[B]))
+        }
+    }
+    return C
+};
+
+function callerFunction(A, B) {
+    this.handler = function (C) {
+        if (!C) {
+            C = window.event
+        }
+        A(C, B);
+        return true
+    };
+    return this.handler
+}
+function getAbsoluteLeft(A) {
+    return getOffset(A).left
+}
+function getAbsoluteTop(A) {
+    return getOffset(A).top
+}
+function getOffsetSum(A) {
+    var C = 0,
+        B = 0;
+    while (A) {
+        C = C + parseInt(A.offsetTop);
+        B = B + parseInt(A.offsetLeft);
+        A = A.offsetParent
+    }
+    return {
+        top: C,
+        left: B
+    }
+}
+function getOffsetRect(D) {
+    var G = D.getBoundingClientRect();
+    var H = document.body;
+    var B = document.documentElement;
+    var A = window.pageYOffset || B.scrollTop || H.scrollTop;
+    var E = window.pageXOffset || B.scrollLeft || H.scrollLeft;
+    var F = B.clientTop || H.clientTop || 0;
+    var I = B.clientLeft || H.clientLeft || 0;
+    var J = G.top + A - F;
+    var C = G.left + E - I;
+    return {
+        top: Math.round(J),
+        left: Math.round(C)
+    }
+}
+function getOffset(A) {
+    if (A.getBoundingClientRect && !_isChrome) {
+        return getOffsetRect(A)
+    } else {
+        return getOffsetSum(A)
+    }
+}
+function convertStringToBoolean(A) {
+    if (typeof(A) == "string") {
+        A = A.toLowerCase()
+    }
+    switch (A) {
+    case "1":
+    case "true":
+    case "yes":
+    case "y":
+    case 1:
+    case true:
+        return true;
+        break;
+    default:
+        return false
+    }
+}
+function getUrlSymbol(A) {
+    if (A.indexOf("?") != -1) {
+        return "&"
+    } else {
+        return "?"
+    }
+}
+function dhtmlDragAndDropObject() {
+    if (window.dhtmlDragAndDrop) {
+        return window.dhtmlDragAndDrop
+    }
+    this.lastLanding = 0;
+    this.dragNode = 0;
+    this.dragStartNode = 0;
+    this.dragStartObject = 0;
+    this.tempDOMU = null;
+    this.tempDOMM = null;
+    this.waitDrag = 0;
+    window.dhtmlDragAndDrop = this;
+    return this
+}
+dhtmlDragAndDropObject.prototype.removeDraggableItem = function (A) {
+    A.onmousedown = null;
+    A.dragStarter = null;
+    A.dragLanding = null
+};
+dhtmlDragAndDropObject.prototype.addDraggableItem = function (A, B) {
+    A.onmousedown = this.preCreateDragCopy;
+    A.dragStarter = B;
+    this.addDragLanding(A, B)
+};
+dhtmlDragAndDropObject.prototype.addDragLanding = function (A, B) {
+    A.dragLanding = B
+};
+dhtmlDragAndDropObject.prototype.preCreateDragCopy = function (A) {
+    if ((A || event) && (A || event).button == 2) {
+        return
+    }
+    if (window.dhtmlDragAndDrop.waitDrag) {
+        window.dhtmlDragAndDrop.waitDrag = 0;
+        document.body.onmouseup = window.dhtmlDragAndDrop.tempDOMU;
+        document.body.onmousemove = window.dhtmlDragAndDrop.tempDOMM;
+        return false
+    }
+    window.dhtmlDragAndDrop.waitDrag = 1;
+    window.dhtmlDragAndDrop.tempDOMU = document.body.onmouseup;
+    window.dhtmlDragAndDrop.tempDOMM = document.body.onmousemove;
+    window.dhtmlDragAndDrop.dragStartNode = this;
+    window.dhtmlDragAndDrop.dragStartObject = this.dragStarter;
+    document.body.onmouseup = window.dhtmlDragAndDrop.preCreateDragCopy;
+    document.body.onmousemove = window.dhtmlDragAndDrop.callDrag;
+    window.dhtmlDragAndDrop.downtime = new Date().valueOf();
+    if ((A) && (A.preventDefault)) {
+        A.preventDefault();
+        return false
+    }
+    return false
+};
+dhtmlDragAndDropObject.prototype.callDrag = function (C) {
+    if (!C) {
+        C = window.event
+    }
+    dragger = window.dhtmlDragAndDrop;
+    if ((new Date()).valueOf() - dragger.downtime < 100) {
+        return
+    }
+    if ((C.button == 0) && (_isIE)) {
+        return dragger.stopDrag()
+    }
+    if (!dragger.dragNode && dragger.waitDrag) {
+        dragger.dragNode = dragger.dragStartObject._createDragNode(dragger.dragStartNode, C);
+        if (!dragger.dragNode) {
+            return dragger.stopDrag()
+        }
+        dragger.dragNode.onselectstart = function () {
+            return false
+        };
+        dragger.gldragNode = dragger.dragNode;
+        document.body.appendChild(dragger.dragNode);
+        document.body.onmouseup = dragger.stopDrag;
+        dragger.waitDrag = 0;
+        dragger.dragNode.pWindow = window;
+        dragger.initFrameRoute()
+    }
+    if (dragger.dragNode.parentNode != window.document.body) {
+        var A = dragger.gldragNode;
+        if (dragger.gldragNode.old) {
+            A = dragger.gldragNode.old
+        }
+        A.parentNode.removeChild(A);
+        var B = dragger.dragNode.pWindow;
+        if (_isIE) {
+            var E = document.createElement("Div");
+            E.innerHTML = dragger.dragNode.outerHTML;
+            dragger.dragNode = E.childNodes[0]
+        } else {
+            dragger.dragNode = dragger.dragNode.cloneNode(true)
+        }
+        dragger.dragNode.pWindow = window;
+        dragger.gldragNode.old = dragger.dragNode;
+        document.body.appendChild(dragger.dragNode);
+        B.dhtmlDragAndDrop.dragNode = dragger.dragNode
+    }
+    dragger.dragNode.style.left = C.clientX + 15 + (dragger.fx ? dragger.fx * (-1) : 0) + (document.body.scrollLeft || document.documentElement.scrollLeft) + "px";
+    dragger.dragNode.style.top = C.clientY + 3 + (dragger.fy ? dragger.fy * (-1) : 0) + (document.body.scrollTop || document.documentElement.scrollTop) + "px";
+    if (!C.srcElement) {
+        var D = C.target
+    } else {
+        D = C.srcElement
+    }
+    dragger.checkLanding(D, C)
+};
+dhtmlDragAndDropObject.prototype.calculateFramePosition = function (E) {
+    if (window.name) {
+        var C = parent.frames[window.name].frameElement.offsetParent;
+        var D = 0;
+        var B = 0;
+        while (C) {
+            D += C.offsetLeft;
+            B += C.offsetTop;
+            C = C.offsetParent
+        }
+        if ((parent.dhtmlDragAndDrop)) {
+            var A = parent.dhtmlDragAndDrop.calculateFramePosition(1);
+            D += A.split("_")[0] * 1;
+            B += A.split("_")[1] * 1
+        }
+        if (E) {
+            return D + "_" + B
+        } else {
+            this.fx = D
+        }
+        this.fy = B
+    }
+    return "0_0"
+};
+dhtmlDragAndDropObject.prototype.checkLanding = function (B, A) {
+    if ((B) && (B.dragLanding)) {
+        if (this.lastLanding) {
+            this.lastLanding.dragLanding._dragOut(this.lastLanding)
+        }
+        this.lastLanding = B;
+        this.lastLanding = this.lastLanding.dragLanding._dragIn(this.lastLanding, this.dragStartNode, A.clientX, A.clientY, A);
+        this.lastLanding_scr = (_isIE ? A.srcElement : A.target)
+    } else {
+        if ((B) && (B.tagName != "BODY")) {
+            this.checkLanding(B.parentNode, A)
+        } else {
+            if (this.lastLanding) {
+                this.lastLanding.dragLanding._dragOut(this.lastLanding, A.clientX, A.clientY, A)
+            }
+            this.lastLanding = 0;
+            if (this._onNotFound) {
+                this._onNotFound()
+            }
+        }
+    }
+};
+dhtmlDragAndDropObject.prototype.stopDrag = function (B, C) {
+    dragger = window.dhtmlDragAndDrop;
+    if (!C) {
+        dragger.stopFrameRoute();
+        var A = dragger.lastLanding;
+        dragger.lastLanding = null;
+        if (A) {
+            A.dragLanding._drag(dragger.dragStartNode, dragger.dragStartObject, A, (_isIE ? event.srcElement : B.target))
+        }
+    }
+    dragger.lastLanding = null;
+    if ((dragger.dragNode) && (dragger.dragNode.parentNode == document.body)) {
+        dragger.dragNode.parentNode.removeChild(dragger.dragNode)
+    }
+    dragger.dragNode = 0;
+    dragger.gldragNode = 0;
+    dragger.fx = 0;
+    dragger.fy = 0;
+    dragger.dragStartNode = 0;
+    dragger.dragStartObject = 0;
+    document.body.onmouseup = dragger.tempDOMU;
+    document.body.onmousemove = dragger.tempDOMM;
+    dragger.tempDOMU = null;
+    dragger.tempDOMM = null;
+    dragger.waitDrag = 0
+};
+dhtmlDragAndDropObject.prototype.stopFrameRoute = function (C) {
+    if (C) {
+        window.dhtmlDragAndDrop.stopDrag(1, 1)
+    }
+    for (var A = 0; A < window.frames.length; A++) {
+        try {
+            if ((window.frames[A] != C) && (window.frames[A].dhtmlDragAndDrop)) {
+                window.frames[A].dhtmlDragAndDrop.stopFrameRoute(window)
+            }
+        } catch (B) {}
+    }
+    try {
+        if ((parent.dhtmlDragAndDrop) && (parent != window) && (parent != C)) {
+            parent.dhtmlDragAndDrop.stopFrameRoute(window)
+        }
+    } catch (B) {}
+};
+dhtmlDragAndDropObject.prototype.initFrameRoute = function (C, D) {
+    if (C) {
+        window.dhtmlDragAndDrop.preCreateDragCopy({});
+        window.dhtmlDragAndDrop.dragStartNode = C.dhtmlDragAndDrop.dragStartNode;
+        window.dhtmlDragAndDrop.dragStartObject = C.dhtmlDragAndDrop.dragStartObject;
+        window.dhtmlDragAndDrop.dragNode = C.dhtmlDragAndDrop.dragNode;
+        window.dhtmlDragAndDrop.gldragNode = C.dhtmlDragAndDrop.dragNode;
+        window.document.body.onmouseup = window.dhtmlDragAndDrop.stopDrag;
+        window.waitDrag = 0;
+        if (((!_isIE) && (D)) && ((!_isFF) || (_FFrv < 1.8))) {
+            window.dhtmlDragAndDrop.calculateFramePosition()
+        }
+    }
+    try {
+        if ((parent.dhtmlDragAndDrop) && (parent != window) && (parent != C)) {
+            parent.dhtmlDragAndDrop.initFrameRoute(window)
+        }
+    } catch (B) {}
+    for (var A = 0; A < window.frames.length; A++) {
+        try {
+            if ((window.frames[A] != C) && (window.frames[A].dhtmlDragAndDrop)) {
+                window.frames[A].dhtmlDragAndDrop.initFrameRoute(window, ((!C || D) ? 1 : 0))
+            }
+        } catch (B) {}
+    }
+};
+var _isFF = false;
+var _isIE = false;
+var _isOpera = false;
+var _isKHTML = false;
+var _isMacOS = false;
+var _isChrome = false;
+if (navigator.userAgent.indexOf("Macintosh") != -1) {
+    _isMacOS = true
+}
+if (navigator.userAgent.toLowerCase().indexOf("chrome") > -1) {
+    _isChrome = true
+}
+if ((navigator.userAgent.indexOf("Safari") != -1) || (navigator.userAgent.indexOf("Konqueror") != -1)) {
+    var _KHTMLrv = parseFloat(navigator.userAgent.substr(navigator.userAgent.indexOf("Safari") + 7, 5));
+    if (_KHTMLrv > 525) {
+        _isFF = true;
+        var _FFrv = 1.9
+    } else {
+        _isKHTML = true
+    }
+} else {
+    if (navigator.userAgent.indexOf("Opera") != -1) {
+        _isOpera = true;
+        _OperaRv = parseFloat(navigator.userAgent.substr(navigator.userAgent.indexOf("Opera") + 6, 3))
+    } else {
+        if (navigator.appName.indexOf("Microsoft") != -1) {
+            _isIE = true;
+            if (navigator.appVersion.indexOf("MSIE 8.0") != -1 && document.compatMode != "BackCompat") {
+                _isIE = 8
+            }
+        } else {
+            _isFF = true;
+            var _FFrv = parseFloat(navigator.userAgent.split("rv:")[1])
+        }
+    }
+}
+dtmlXMLLoaderObject.prototype.doXPath = function (C, E, D, I) {
+    if (_isKHTML || (!_isIE && !window.XPathResult)) {
+        return this.doXPathOpera(C, E)
+    }
+    if (_isIE) {
+        if (!E) {
+            if (!this.xmlDoc.nodeName) {
+                E = this.xmlDoc.responseXML
+            } else {
+                E = this.xmlDoc
+            }
+        }
+        if (!E) {
+            dhtmlxError.throwError("LoadXML", "Incorrect XML", [(E || this.xmlDoc), this.mainObject])
+        }
+        if (D != null) {
+            E.setProperty("SelectionNamespaces", "xmlns:xsl='" + D + "'")
+        }
+        if (I == "single") {
+            return E.selectSingleNode(C)
+        } else {
+            return E.selectNodes(C) || new Array(0)
+        }
+    } else {
+        var A = E;
+        if (!E) {
+            if (!this.xmlDoc.nodeName) {
+                E = this.xmlDoc.responseXML
+            } else {
+                E = this.xmlDoc
+            }
+        }
+        if (!E) {
+            dhtmlxError.throwError("LoadXML", "Incorrect XML", [(E || this.xmlDoc), this.mainObject])
+        }
+        if (E.nodeName.indexOf("document") != -1) {
+            A = E
+        } else {
+            A = E;
+            E = E.ownerDocument
+        }
+        var G = XPathResult.ANY_TYPE;
+        if (I == "single") {
+            G = XPathResult.FIRST_ORDERED_NODE_TYPE
+        }
+        var F = new Array();
+        var B = E.evaluate(C, A, function (J) {
+            return D
+        }, G, null);
+        if (G == XPathResult.FIRST_ORDERED_NODE_TYPE) {
+            return B.singleNodeValue
+        }
+        var H = B.iterateNext();
+        while (H) {
+            F[F.length] = H;
+            H = B.iterateNext()
+        }
+        return F
+    }
+};
+
+function _dhtmlxError(B, A, C) {
+    if (!this.catches) {
+        this.catches = new Array()
+    }
+    return this
+}
+_dhtmlxError.prototype.catchError = function (B, A) {
+    this.catches[B] = A
+};
+_dhtmlxError.prototype.throwError = function (B, A, C) {
+    if (this.catches[B]) {
+        return this.catches[B](B, A, C)
+    }
+    if (this.catches.ALL) {
+        return this.catches.ALL(B, A, C)
+    }
+    alert("Error type: " + arguments[0] + "\nDescription: " + arguments[1]);
+    return null
+};
+window.dhtmlxError = new _dhtmlxError();
+dtmlXMLLoaderObject.prototype.doXPathOpera = function (C, A) {
+    var E = C.replace(/[\/]+/gi, "/").split("/");
+    var D = null;
+    var B = 1;
+    if (!E.length) {
+        return []
+    }
+    if (E[0] == ".") {
+        D = [A]
+    } else {
+        if (E[0] == "") {
+            D = (this.xmlDoc.responseXML || this.xmlDoc).getElementsByTagName(E[B].replace(/\[[^\]]*\]/g, ""));
+            B++
+        } else {
+            return []
+        }
+    }
+    for (B; B < E.length; B++) {
+        D = this._getAllNamedChilds(D, E[B])
+    }
+    if (E[B - 1].indexOf("[") != -1) {
+        D = this._filterXPath(D, E[B - 1])
+    }
+    return D
+};
+dtmlXMLLoaderObject.prototype._filterXPath = function (B, A) {
+    var D = new Array();
+    var A = A.replace(/[^\[]*\[\@/g, "").replace(/[\[\]\@]*/g, "");
+    for (var C = 0; C < B.length; C++) {
+        if (B[C].getAttribute(A)) {
+            D[D.length] = B[C]
+        }
+    }
+    return D
+};
+dtmlXMLLoaderObject.prototype._getAllNamedChilds = function (B, A) {
+    var E = new Array();
+    if (_isKHTML) {
+        A = A.toUpperCase()
+    }
+    for (var D = 0; D < B.length; D++) {
+        for (var C = 0; C < B[D].childNodes.length; C++) {
+            if (_isKHTML) {
+                if (B[D].childNodes[C].tagName && B[D].childNodes[C].tagName.toUpperCase() == A) {
+                    E[E.length] = B[D].childNodes[C]
+                }
+            } else {
+                if (B[D].childNodes[C].tagName == A) {
+                    E[E.length] = B[D].childNodes[C]
+                }
+            }
+        }
+    }
+    return E
+};
+
+function dhtmlXHeir(B, A) {
+    for (var C in A) {
+        if (typeof(A[C]) == "function") {
+            B[C] = A[C]
+        }
+    }
+    return B
+}
+function dhtmlxEvent(B, C, A) {
+    if (B.addEventListener) {
+        B.addEventListener(C, A, false)
+    } else {
+        if (B.attachEvent) {
+            B.attachEvent("on" + C, A)
+        }
+    }
+}
+dtmlXMLLoaderObject.prototype.xslDoc = null;
+dtmlXMLLoaderObject.prototype.setXSLParamValue = function (B, C, D) {
+    if (!D) {
+        D = this.xslDoc
+    }
+    if (D.responseXML) {
+        D = D.responseXML
+    }
+    var A = this.doXPath("/xsl:stylesheet/xsl:variable[@name='" + B + "']", D, "http://www.w3.org/1999/XSL/Transform";, "single");
+    if (A != null) {
+        A.firstChild.nodeValue = C
+    }
+};
+dtmlXMLLoaderObject.prototype.doXSLTransToObject = function (D, B) {
+    if (!D) {
+        D = this.xslDoc
+    }
+    if (D.responseXML) {
+        D = D.responseXML
+    }
+    if (!B) {
+        B = this.xmlDoc
+    }
+    if (B.responseXML) {
+        B = B.responseXML
+    }
+    if (!_isIE) {
+        if (!this.XSLProcessor) {
+            this.XSLProcessor = new XSLTProcessor();
+            this.XSLProcessor.importStylesheet(D)
+        }
+        var A = this.XSLProcessor.transformToDocument(B)
+    } else {
+        var A = new ActiveXObject("Msxml2.DOMDocument.3.0");
+        try {
+            B.transformNodeToObject(D, A)
+        } catch (C) {
+            A = B.transformNode(D)
+        }
+    }
+    return A
+};
+dtmlXMLLoaderObject.prototype.doXSLTransToString = function (C, B) {
+    var A = this.doXSLTransToObject(C, B);
+    if (typeof(A) == "string") {
+        return A
+    }
+    return this.doSerialization(A)
+};
+dtmlXMLLoaderObject.prototype.doSerialization = function (B) {
+    if (!B) {
+        B = this.xmlDoc
+    }
+    if (B.responseXML) {
+        B = B.responseXML
+    }
+    if (!_isIE) {
+        var A = new XMLSerializer();
+        return A.serializeToString(B)
+    } else {
+        return B.xml
+    }
+};
+dhtmlxEventable = function (obj) {
+    obj.dhx_SeverCatcherPath = "";
+    obj.attachEvent = function (name, catcher, callObj) {
+        name = "ev_" + name.toLowerCase();
+        if (!this[name]) {
+            this[name] = new this.eventCatcher(callObj || this)
+        }
+        return (name + ":" + this[name].addEvent(catcher))
+    };
+    obj.callEvent = function (name, arg0) {
+        name = "ev_" + name.toLowerCase();
+        if (this[name]) {
+            return this[name].apply(this, arg0)
+        }
+        return true
+    };
+    obj.checkEvent = function (name) {
+        return ( !! this["ev_" + name.toLowerCase()])
+    };
+    obj.eventCatcher = function (obj) {
+        var dhx_catch = [];
+        var z = function () {
+            var res = true;
+            for (var i = 0; i < dhx_catch.length; i++) {
+                if (dhx_catch[i] != null) {
+                    var zr = dhx_catch[i].apply(obj, arguments);
+                    res = res && zr
+                }
+            }
+            return res
+        };
+        z.addEvent = function (ev) {
+            if (typeof(ev) != "function") {
+                ev = eval(ev)
+            }
+            if (ev) {
+                return dhx_catch.push(ev) - 1
+            }
+            return false
+        };
+        z.removeEvent = function (id) {
+            dhx_catch[id] = null
+        };
+        return z
+    };
+    obj.detachEvent = function (id) {
+        if (id != false) {
+            var list = id.split(":");
+            this[list[0]].removeEvent(list[1])
+        }
+    }
+};
+
+function dataProcessor(A) {
+    this.serverProcessor = A;
+    this.action_param = "!nativeeditor_status";
+    this.object = null;
+    this.updatedRows = [];
+    this.autoUpdate = true;
+    this.updateMode = "cell";
+    this._tMode = "GET";
+    this.post_delim = "_";
+    this._waitMode = 0;
+    this._in_progress = {};
+    this._invalid = {};
+    this.mandatoryFields = [];
+    this.messages = [];
+    this.styles = {
+        updated: "font-weight:bold;",
+        inserted: "font-weight:bold;",
+        deleted: "text-decoration : line-through;",
+        invalid: "background-color:FFE0E0;",
+        invalid_cell: "border-bottom:2px solid red;",
+        error: "color:red;",
+        clear: "font-weight:normal;text-decoration:none;"
+    };
+    this.enableUTFencoding(true);
+    dhtmlxEventable(this);
+    return this
+}
+dataProcessor.prototype = {
+    setTransactionMode: function (B, A) {
+        this._tMode = B;
+        this._tSend = A
+    },
+    escape: function (A) {
+        if (this._utf) {
+            return encodeURIComponent(A)
+        } else {
+            return escape(A)
+        }
+    },
+    enableUTFencoding: function (A) {
+        this._utf = convertStringToBoolean(A)
+    },
+    setDataColumns: function (A) {
+        this._columns = (typeof A == "string") ? A.split(",") : A
+    },
+    getSyncState: function () {
+        return !this.updatedRows.length
+    },
+    enableDataNames: function (A) {
+        this._endnm = convertStringToBoolean(A)
+    },
+    enablePartialDataSend: function (A) {
+        this._changed = convertStringToBoolean(A)
+    },
+    setUpdateMode: function (B, A) {
+        this.autoUpdate = (B == "cell");
+        this.updateMode = B;
+        this.dnd = A
+    },
+    ignore: function (B, A) {
+        this._silent_mode = true;
+        B.call(A || window);
+        this._silent_mode = false
+    },
+    setUpdated: function (D, C, E) {
+        if (this._silent_mode) {
+            return
+        }
+        var B = this.findRow(D);
+        E = E || "updated";
+        var A = this.obj.getUserData(D, this.action_param);
+        if (A && E == "updated") {
+            E = A
+        }
+        if (C) {
+            this.set_invalid(D, false);
+            this.updatedRows[B] = D;
+            this.obj.setUserData(D, this.action_param, E);
+            if (this._in_progress[D]) {
+                this._in_progress[D] = "wait"
+            }
+        } else {
+            if (!this.is_invalid(D)) {
+                this.updatedRows.splice(B, 1);
+                this.obj.setUserData(D, this.action_param, "")
+            }
+        }
+        if (!C) {
+            this._clearUpdateFlag(D)
+        }
+        this.markRow(D, C, E);
+        if (C && this.autoUpdate) {
+            this.sendData(D)
+        }
+    },
+    _clearUpdateFlag: function (A) {},
+    markRow: function (F, C, E) {
+        var D = "";
+        var B = this.is_invalid(F);
+        if (B) {
+            D = this.styles[B];
+            C = true
+        }
+        if (this.callEvent("onRowMark", [F, C, E, B])) {
+            D = this.styles[C ? E : "clear"] + D;
+            this.obj[this._methods[0]](F, D);
+            if (B && B.details) {
+                D += this.styles[B + "_cell"];
+                for (var A = 0; A < B.details.length; A++) {
+                    if (B.details[A]) {
+                        this.obj[this._methods[1]](F, A, D)
+                    }
+                }
+            }
+        }
+    },
+    getState: function (A) {
+        return this.obj.getUserData(A, this.action_param)
+    },
+    is_invalid: function (A) {
+        return this._invalid[A]
+    },
+    set_invalid: function (C, B, A) {
+        if (A) {
+            B = {
+                value: B,
+                details: A,
+                toString: function () {
+                    return this.value.toString()
+                }
+            }
+        }
+        this._invalid[C] = B
+    },
+    checkBeforeUpdate: function (A) {
+        return true
+    },
+    sendData: function (A) {
+        if (this._waitMode && (this.obj.mytype == "tree" || this.obj._h2)) {
+            return
+        }
+        if (this.obj.editStop) {
+            this.obj.editStop()
+        }
+        if (typeof A == "undefined" || this._tSend) {
+            return this.sendAllData()
+        }
+        if (this._in_progress[A]) {
+            return false
+        }
+        this.messages = [];
+        if (!this.checkBeforeUpdate(A) && this.callEvent("onValidatationError", [A, this.messages])) {
+            return false
+        }
+        this._beforeSendData(this._getRowData(A), A)
+    },
+    _beforeSendData: function (A, B) {
+        if (!this.callEvent("onBeforeUpdate", [B, this.getState(B), A])) {
+            return false
+        }
+        this._sendData(A, B)
+    },
+    serialize: function (D, E) {
+        if (typeof D == "string") {
+            return D
+        }
+        if (typeof E != "undefined") {
+            return this.serialize_one(D, "")
+        } else {
+            var A = [];
+            var C = [];
+            for (var B in D) {
+                if (D.hasOwnProperty(B)) {
+                    A.push(this.serialize_one(D[B], B + this.post_delim));
+                    C.push(B)
+                }
+            }
+            A.push("ids=" + this.escape(C.join(",")));
+            return A.join("&")
+        }
+    },
+    serialize_one: function (D, B) {
+        if (typeof D == "string") {
+            return D
+        }
+        var A = [];
+        for (var C in D) {
+            if (D.hasOwnProperty(C)) {
+                A.push(this.escape((B || "") + C) + "=" + this.escape(D[C]))
+            }
+        }
+        return A.join("&")
+    },
+    _sendData: function (B, C) {
+        if (!B) {
+            return
+        }
+        if (!this.callEvent("onBeforeDataSending", C ? [C, this.getState(C), B] : [null, null, B])) {
+            return false
+        }
+        if (C) {
+            this._in_progress[C] = (new Date()).valueOf()
+        }
+        var A = new dtmlXMLLoaderObject(this.afterUpdate, this, true);
+        var D = this.serverProcessor + (this._user ? (getUrlSymbol(this.serverProcessor) + ["dhx_user=" + this._user, "dhx_version=" + this.obj.getUserData(0, "version")].join("&")) : "");
+        if (this._tMode != "POST") {
+            A.loadXML(D + ((D.indexOf("?") != -1) ? "&" : "?") + this.serialize(B, C))
+        } else {
+            A.loadXML(D, true, this.serialize(B, C))
+        }
+        this._waitMode++
+    },
+    sendAllData: function () {
+        if (!this.updatedRows.length) {
+            return
+        }
+        this.messages = [];
+        var B = true;
+        for (var A = 0; A < this.updatedRows.length; A++) {
+            B &= this.checkBeforeUpdate(this.updatedRows[A])
+        }
+        if (!B && !this.callEvent("onValidatationError", ["", this.messages])) {
+            return false
+        }
+        if (this._tSend) {
+            this._sendData(this._getAllData())
+        } else {
+            for (var A = 0; A < this.updatedRows.length; A++) {
+                if (!this._in_progress[this.updatedRows[A]]) {
+                    if (this.is_invalid(this.updatedRows[A])) {
+                        continue
+                    }
+                    this._beforeSendData(this._getRowData(this.updatedRows[A]), this.updatedRows[A]);
+                    if (this._waitMode && (this.obj.mytype == "tree" || this.obj._h2)) {
+                        return
+                    }
+                }
+            }
+        }
+    },
+    _getAllData: function (D) {
+        var B = {};
+        var A = false;
+        for (var C = 0; C < this.updatedRows.length; C++) {
+            var E = this.updatedRows[C];
+            if (this._in_progress[E] || this.is_invalid(E)) {
+                continue
+            }
+            if (!this.callEvent("onBeforeUpdate", [E, this.getState(E)])) {
+                continue
+            }
+            B[E] = this._getRowData(E, E + this.post_delim);
+            A = true;
+            this._in_progress[E] = (new Date()).valueOf()
+        }
+        return A ? B : null
+    },
+    setVerificator: function (B, A) {
+        this.mandatoryFields[B] = A || (function (C) {
+            return (C != "")
+        })
+    },
+    clearVerificator: function (A) {
+        this.mandatoryFields[A] = false
+    },
+    findRow: function (B) {
+        var A = 0;
+        for (A = 0; A < this.updatedRows.length; A++) {
+            if (B == this.updatedRows[A]) {
+                break
+            }
+        }
+        return A
+    },
+    defineAction: function (A, B) {
+        if (!this._uActions) {
+            this._uActions = []
+        }
+        this._uActions[A] = B
+    },
+    afterUpdateCallback: function (B, G, F, E) {
+        var A = B;
+        var D = (F != "error" && F != "invalid");
+        if (!D) {
+            this.set_invalid(B, F)
+        }
+        if ((this._uActions) && (this._uActions[F]) && (!this._uActions[F](E))) {
+            return (delete this._in_progress[A])
+        }
+        if (this._in_progress[A] != "wait") {
+            this.setUpdated(B, false)
+        }
+        var C = B;
+        switch (F) {
+        case "inserted":
+        case "insert":
+            if (G != B) {
+                this.obj[this._methods[2]](B, G);
+                B = G
+            }
+            break;
+        case "delete":
+        case "deleted":
+            this.obj.setUserData(B, this.action_param, "true_deleted");
+            this.obj[this._methods[3]](B);
+            delete this._in_progress[A];
+            return this.callEvent("onAfterUpdate", [B, F, G, E]);
+            break
+        }
+        if (this._in_progress[A] != "wait") {
+            if (D) {
+                this.obj.setUserData(B, this.action_param, "")
+            }
+            delete this._in_progress[A]
+        } else {
+            delete this._in_progress[A];
+            this.setUpdated(G, true, this.obj.getUserData(B, this.action_param))
+        }
+        this.callEvent("onAfterUpdate", [B, F, G, E])
+    },
+    afterUpdate: function (G, K, I, H, F) {
+        F.getXMLTopNode("data");
+        if (!F.xmlDoc.responseXML) {
+            return
+        }
+        var J = F.doXPath("//data/action");
+        for (var D = 0; D < J.length; D++) {
+            var E = J[D];
+            var C = E.getAttribute("type");
+            var A = E.getAttribute("sid");
+            var B = E.getAttribute("tid");
+            G.afterUpdateCallback(A, B, C, E)
+        }
+        G.finalizeUpdate()
+    },
+    finalizeUpdate: function () {
+        if (this._waitMode) {
+            this._waitMode--
+        }
+        if ((this.obj.mytype == "tree" || this.obj._h2) && this.updatedRows.length) {
+            this.sendData()
+        }
+        this.callEvent("onAfterUpdateFinish", []);
+        if (!this.updatedRows.length) {
+            this.callEvent("onFullSync", [])
+        }
+    },
+    init: function (A) {
+        this.obj = A;
+        if (this.obj._dp_init) {
+            this.obj._dp_init(this)
+        }
+    },
+    setOnAfterUpdate: function (A) {
+        this.attachEvent("onAfterUpdate", A)
+    },
+    enableDebug: function (A) {},
+    setOnBeforeUpdateHandler: function (A) {
+        this.attachEvent("onBeforeDataSending", A)
+    },
+/* starts autoupdate mode
+		@param interval
+			time interval for sending update requests
+	*/
+    setAutoUpdate: function (C, B) {
+        C = C || 2000;
+        this._user = B || (new Date()).valueOf();
+        this._need_update = false;
+        this._loader = null;
+        this._update_busy = false;
+        this.attachEvent("onAfterUpdate", function (D, F, G, E) {
+            this.afterAutoUpdate(D, F, G, E)
+        });
+        this.attachEvent("onFullSync", function () {
+            this.fullSync()
+        });
+        var A = this;
+        window.setInterval(function () {
+            A.loadUpdate()
+        }, C)
+    },
+/* process updating request answer
+		if status == collision version is depricated
+		set flag for autoupdating immidiatly
+	*/
+    afterAutoUpdate: function (A, C, D, B) {
+        if (C == "collision") {
+            this._need_update = true;
+            return false
+        } else {
+            return true
+        }
+    },
+/* callback function for onFillSync event
+		call update function if it's need
+	*/
+    fullSync: function () {
+        if (this._need_update == true) {
+            this._need_update = false;
+            this.loadUpdate()
+        }
+        return true
+    },
+/* sends query to the server and call callback function
+	*/
+    getUpdates: function (A, B) {
+        if (this._update_busy) {
+            return false
+        } else {
+            this._update_busy = true
+        }
+        this._loader = this._loader || new dtmlXMLLoaderObject(true);
+        this._loader.async = true;
+        this._loader.waitCall = B;
+        this._loader.loadXML(A)
+    },
+/* returns xml node value
+		@param node
+			xml node
+	*/
+    _v: function (A) {
+        if (A.firstChild) {
+            return A.firstChild.nodeValue
+        }
+        return ""
+    },
+/* returns values array of xml nodes array
+		@param arr
+			array of xml nodes
+	*/
+    _a: function (A) {
+        var C = [];
+        for (var B = 0; B < A.length; B++) {
+            C[B] = this._v(A[B])
+        }
+        return C
+    },
+/* loads updates and processes them
+	*/
+    loadUpdate: function () {
+        var B = this;
+        var A = this.obj.getUserData(0, "version");
+        var C = this.serverProcessor + getUrlSymbol(this.serverProcessor) + ["dhx_user=" + this._user, "dhx_version=" + A].join("&");
+        C = C.replace("editing=true&", "");
+        this.getUpdates(C, function () {
+            var F = B._loader.doXPath("//userdata");
+            B.obj.setUserData(0, "version", B._v(F[0]));
+            var D = B._loader.doXPath("//update");
+            if (D.length) {
+                B._silent_mode = true;
+                for (var G = 0; G < D.length; G++) {
+                    var E = D[G].getAttribute("status");
+                    var I = D[G].getAttribute("id");
+                    var H = D[G].getAttribute("parent");
+                    switch (E) {
+                    case "inserted":
+                        B.callEvent("insertCallback", [D[G], I, H]);
+                        break;
+                    case "updated":
+                        B.callEvent("updateCallback", [D[G], I, H]);
+                        break;
+                    case "deleted":
+                        B.callEvent("deleteCallback", [D[G], I, H]);
+                        break
+                    }
+                }
+                B._silent_mode = false
+            }
+            B._update_busy = false;
+            B = null
+        })
+    }
+};
+if (window.dhtmlXGridObject) {
+    dhtmlXGridObject.prototype._init_point_connector = dhtmlXGridObject.prototype._init_point;
+    dhtmlXGridObject.prototype._init_point = function () {
+        var A = function (E) {
+            E = E.replace(/(\?|\&)connector[^\f]*/g, "");
+            return E + (E.indexOf("?") != -1 ? "&" : "?") + "connector=true" + (mygrid.hdr.rows.length > 0 ? "&dhx_no_header=1" : "")
+        };
+        var D = function (E) {
+            return A(E) + (this._connector_sorting || "") + (this._connector_filter || "")
+        };
+        var C = function (F, G, E) {
+            this._connector_sorting = "&dhx_sort[" + G + "]=" + E;
+            return D.call(this, F)
+        };
+        var B = function (F, E, H) {
+            for (var G = 0; G < E.length; G++) {
+                E[G] = "dhx_filter[" + E[G] + "]=" + encodeURIComponent(H[G])
+            }
+            this._connector_filter = "&" + E.join("&");
+            return D.call(this, F)
+        };
+        this.attachEvent("onCollectValues", function (E) {
+            if (this._con_f_used[E]) {
+                if (typeof(this._con_f_used[E]) == "object") {
+                    return this._con_f_used[E]
+                } else {
+                    return false
+                }
+            }
+            return true
+        });
+        this.attachEvent("onDynXLS", function () {
+            this.xmlFileUrl = D.call(this, this.xmlFileUrl);
+            return true
+        });
+        this.attachEvent("onBeforeSorting", function (H, G, F) {
+            if (G == "connector") {
+                var E = this;
+                this.clearAndLoad(C.call(this, this.xmlFileUrl, H, F), function () {
+                    E.setSortImgState(true, H, F)
+                });
+                return false
+            }
+            return true
+        });
+        this.attachEvent("onFilterStart", function (F, E) {
+            if (this._con_f_used.length) {
+                this.clearAndLoad(B.call(this, this.xmlFileUrl, F, E));
+                return false
+            }
+            return true
+        });
+        this.attachEvent("onXLE", function (F, E, H, G) {
+            if (!G) {
+                return
+            }
+        });
+        if (this._init_point_connector) {
+            this._init_point_connector()
+        }
+    };
+    dhtmlXGridObject.prototype._con_f_used = [];
+    dhtmlXGridObject.prototype._in_header_connector_text_filter = function (B, A) {
+        if (!this._con_f_used[A]) {
+            this._con_f_used[A] = 1
+        }
+        return this._in_header_text_filter(B, A)
+    };
+    dhtmlXGridObject.prototype._in_header_connector_select_filter = function (B, A) {
+        if (!this._con_f_used[A]) {
+            this._con_f_used[A] = 2
+        }
+        return this._in_header_select_filter(B, A)
+    };
+    dhtmlXGridObject.prototype.load_connector = dhtmlXGridObject.prototype.load;
+    dhtmlXGridObject.prototype.load = function (B, E, D) {
+        if (!this._colls_loaded && this.cellType) {
+            var A = [];
+            for (var C = 0; C < this.cellType.length; C++) {
+                if (this.cellType[C].indexOf("co") == 0 || this._con_f_used[C] == 2) {
+                    A.push(C)
+                }
+            }
+            if (A.length) {
+                arguments[0] += (arguments[0].indexOf("?") != -1 ? "&" : "?") + "connector=true&dhx_colls=" + A.join(",")
+            }
+        }
+        return this.load_connector.apply(this, arguments)
+    };
+    dhtmlXGridObject.prototype._parseHead_connector = dhtmlXGridObject.prototype._parseHead;
+    dhtmlXGridObject.prototype._parseHead = function (A, L, I) {
+        this._parseHead_connector.apply(this, arguments);
+        if (!this._colls_loaded) {
+            var J = this.xmlLoader.doXPath("./coll_options", arguments[0]);
+            for (var F = 0; F < J.length; F++) {
+                var H = J[F].getAttribute("for");
+                var K = [];
+                var C = null;
+                if (this.cellType[H] == "combo") {
+                    C = this.getColumnCombo(H)
+                }
+                if (this.cellType[H].indexOf("co") == 0) {
+                    C = this.getCombo(H)
+                }
+                var E = this.xmlLoader.doXPath("./item", J[F]);
+                for (var D = 0; D < E.length; D++) {
+                    var B = E[D].getAttribute("value");
+                    if (C) {
+                        var G = E[D].getAttribute("label") || B;
+                        if (C.addOption) {
+                            C.addOption([
+                                [B, G]
+                            ])
+                        } else {
+                            C.put(B, G)
+                        }
+                        K[K.length] = G
+                    } else {
+                        K[K.length] = B
+                    }
+                }
+                if (this._con_f_used[H * 1]) {
+                    this._con_f_used[H * 1] = K
+                }
+            }
+            this._colls_loaded = true
+        }
+    }
+}
+if (window.dataProcessor) {
+    dataProcessor.prototype.init_original = dataProcessor.prototype.init;
+    dataProcessor.prototype.init = function (A) {
+        this.init_original(A);
+        A._dataprocessor = this;
+        this.setTransactionMode("POST", true);
+        this.serverProcessor += (this.serverProcessor.indexOf("?") != -1 ? "&" : "?") + "editing=true"
+    }
+}
+dhtmlxError.catchError("LoadXML", function (B, A, C) {
+    alert(C[0].responseText)
+});
+window.dhtmlXScheduler = window.scheduler = {
+    version: 2.2
+};
+dhtmlxEventable(scheduler);
+scheduler.init = function (C, A, B) {
+    A = A || (new Date());
+    B = B || "week";
+    this._obj = (typeof C == "string") ? document.getElementById(C) : C;
+    this._els = [];
+    this._scroll = true;
+    this._quirks = (_isIE && document.compatMode == "BackCompat");
+    this._quirks7 = (_isIE && navigator.appVersion.indexOf("MSIE 8") == -1);
+    this.get_elements();
+    this.init_templates();
+    this.set_actions();
+    dhtmlxEvent(window, "resize", function () {
+        window.clearTimeout(scheduler._resize_timer);
+        scheduler._resize_timer = window.setTimeout(function () {
+            if (scheduler.callEvent("onSchedulerResize", [])) {
+                scheduler.update_view()
+            }
+        }, 100)
+    });
+    this.set_sizes();
+    this.setCurrentView(A, B)
+};
+scheduler.xy = {
+    nav_height: 22,
+    min_event_height: 40,
+    scale_width: 50,
+    bar_height: 20,
+    scroll_width: 18,
+    scale_height: 20,
+    month_scale_height: 20,
+    menu_width: 25,
+    margin_top: 0,
+    margin_left: 0,
+    editor_width: 140
+};
+scheduler.keys = {
+    edit_save: 13,
+    edit_cancel: 27
+};
+scheduler.set_sizes = function () {
+    var B = this._x = this._obj.clientWidth - this.xy.margin_left;
+    var D = this._y = this._obj.clientHeight - this.xy.margin_top;
+    var E = this._table_view ? 0 : (this.xy.scale_width + this.xy.scroll_width);
+    var A = this._table_view ? -1 : this.xy.scale_width;
+    this.set_xy(this._els.dhx_cal_navline[0], B, this.xy.nav_height, 0, 0);
+    this.set_xy(this._els.dhx_cal_header[0], B - E, this.xy.scale_height, A, this.xy.nav_height + (this._quirks ? -1 : 1));
+    var F = this._els.dhx_cal_navline[0].offsetHeight;
+    if (F > 0) {
+        this.xy.nav_height = F
+    }
+    var C = this.xy.scale_height + this.xy.nav_height + (this._quirks ? -2 : 0);
+    this.set_xy(this._els.dhx_cal_data[0], B, D - (C + 2), 0, C + 2)
+};
+scheduler.set_xy = function (D, B, C, A, E) {
+    D.style.width = Math.max(0, B) + "px";
+    D.style.height = Math.max(0, C) + "px";
+    if (arguments.length > 3) {
+        D.style.left = A + "px";
+        D.style.top = E + "px"
+    }
+};
+scheduler.get_elements = function () {
+    var D = this._obj.getElementsByTagName("DIV");
+    for (var C = 0; C < D.length; C++) {
+        var A = D[C].className;
+        if (!this._els[A]) {
+            this._els[A] = []
+        }
+        this._els[A].push(D[C]);
+        var B = scheduler.locale.labels[D[C].getAttribute("name") || A];
+        if (B) {
+            D[C].innerHTML = B
+        }
+    }
+};
+scheduler.set_actions = function () {
+    for (var A in this._els) {
+        if (this._click[A]) {
+            for (var B = 0; B < this._els[A].length; B++) {
+                this._els[A][B].onclick = scheduler._click[A]
+            }
+        }
+    }
+    this._obj.onselectstart = function (C) {
+        return false
+    };
+    this._obj.onmousemove = function (C) {
+        scheduler._on_mouse_move(C || event)
+    };
+    this._obj.onmousedown = function (C) {
+        scheduler._on_mouse_down(C || event)
+    };
+    this._obj.onmouseup = function (C) {
+        scheduler._on_mouse_up(C || event)
+    };
+    this._obj.ondblclick = function (C) {
+        scheduler._on_dbl_click(C || event)
+    }
+};
+scheduler.select = function (A) {
+    if (this._table_view || !this.getEvent(A)._timed) {
+        return
+    }
+    if (this._select_id == A) {
+        return
+    }
+    this.editStop(false);
+    this.unselect();
+    this._select_id = A;
+    this.updateEvent(A)
+};
+scheduler.unselect = function (B) {
+    if (B && B != this._select_id) {
+        return
+    }
+    var A = this._select_id;
+    this._select_id = null;
+    if (A) {
+        this.updateEvent(A)
+    }
+};
+scheduler.getState = function () {
+    return {
+        mode: this._mode,
+        date: this._date,
+        min_date: this._min_date,
+        max_date: this._max_date,
+        editor_id: this._edit_id,
+        lightbox_id: this._lightbox_id
+    }
+};
+scheduler._click = {
+    dhx_cal_data: function (C) {
+        var B = C ? C.target : event.srcElement;
+        var D = scheduler._locate_event(B);
+        C = C || event;
+        if ((D && !scheduler.callEvent("onClick", [D, C])) || scheduler.config.readonly) {
+            return
+        }
+        if (D) {
+            scheduler.select(D);
+            var A = B.className;
+            if (A.indexOf("_icon") != -1) {
+                scheduler._click.buttons[A.split(" ")[1].replace("icon_", "")](D)
+            }
+        } else {
+            scheduler._close_not_saved()
+        }
+    },
+    dhx_cal_prev_button: function () {
+        scheduler._click.dhx_cal_next_button(0, -1)
+    },
+    dhx_cal_next_button: function (B, A) {
+        scheduler.setCurrentView(scheduler.date.add(scheduler.date[scheduler._mode + "_start"](scheduler._date), (A || 1), scheduler._mode))
+    },
+    dhx_cal_today_button: function () {
+        scheduler.setCurrentView(new Date())
+    },
+    dhx_cal_tab: function () {
+        var A = this.getAttribute("name").split("_")[0];
+        scheduler.setCurrentView(scheduler._date, A)
+    },
+    buttons: {
+        "delete": function (B) {
+            var A = scheduler.locale.labels.confirm_deleting;
+            if (!A || confirm(A)) {
+                scheduler.deleteEvent(B)
+            }
+        },
+        edit: function (A) {
+            scheduler.edit(A)
+        },
+        save: function (A) {
+            scheduler.editStop(true)
+        },
+        details: function (A) {
+            scheduler.showLightbox(A)
+        },
+        cancel: function (A) {
+            scheduler.editStop(false)
+        }
+    }
+};
+scheduler.addEventNow = function (G, B, D) {
+    var C = {};
+    if (typeof G == "object") {
+        C = G;
+        G = null
+    }
+    var E = (this.config.event_duration || this.config.time_step) * 60000;
+    if (!G) {
+        G = Math.round((new Date()).valueOf() / E) * E
+    }
+    var A = new Date(G);
+    if (!B) {
+        var F = this.config.first_hour;
+        if (F > A.getHours()) {
+            A.setHours(F);
+            G = A.valueOf()
+        }
+        B = G + E
+    }
+    C.start_date = C.start_date || A;
+    C.end_date = C.end_date || new Date(B);
+    C.text = C.text || this.locale.labels.new_event;
+    C.id = this._drag_id = this.uid();
+    this._drag_mode = "new-size";
+    this._loading = true;
+    this.addEvent(C);
+    this.callEvent("onEventCreated", [this._drag_id, D]);
+    this._loading = false;
+    this._drag_event = {};
+    this._on_mouse_up(D)
+};
+scheduler._on_dbl_click = function (C, D) {
+    D = D || (C.target || C.srcElement);
+    if (this.config.readonly) {
+        return
+    }
+    var A = D.className.split(" ")[0];
+    switch (A) {
+    case "dhx_scale_holder":
+    case "dhx_scale_holder_now":
+    case "dhx_month_body":
+        if (!scheduler.config.dblclick_create) {
+            break
+        }
+        var G = this._mouse_coords(C);
+        var F = this._min_date.valueOf() + (G.y * this.config.time_step + (this._table_view ? 0 : G.x) * 24 * 60) * 60000;
+        F = this._correct_shift(F);
+        this.addEventNow(F, null, C);
+        break;
+    case "dhx_body":
+    case "dhx_cal_event_line":
+    case "dhx_cal_event_clear":
+        var E = this._locate_event(D);
+        if (!this.callEvent("onDblClick", [E, C])) {
+            return
+        }
+        if (this.config.details_on_dblclick || this._table_view || !this.getEvent(E)._timed) {
+            this.showLightbox(E)
+        } else {
+            this.edit(E)
+        }
+        break;
+    case "":
+        if (D.parentNode) {
+            return scheduler._on_dbl_click(C, D.parentNode)
+        }
+    default:
+        var B = this["dblclick_" + A];
+        if (B) {
+            B.call(this, C)
+        }
+        break
+    }
+};
+scheduler._mouse_coords = function (D) {
+    var F;
+    var A = document.body;
+    var E = document.documentElement;
+    if (D.pageX || D.pageY) {
+        F = {
+            x: D.pageX,
+            y: D.pageY
+        }
+    } else {
+        F = {
+            x: D.clientX + (A.scrollLeft || E.scrollLeft || 0) - A.clientLeft,
+            y: D.clientY + (A.scrollTop || E.scrollTop || 0) - A.clientTop
+        }
+    }
+    F.x -= getAbsoluteLeft(this._obj) + (this._table_view ? 0 : this.xy.scale_width);
+    F.y -= getAbsoluteTop(this._obj) + this.xy.nav_height + (this._dy_shift || 0) + this.xy.scale_height - this._els.dhx_cal_data[0].scrollTop;
+    F.ev = D;
+    var C = this["mouse_" + this._mode];
+    if (C) {
+        return C.call(this, F)
+    }
+    if (!this._table_view) {
+        F.x = Math.max(0, Math.ceil(F.x / this._cols[0]) - 1);
+        F.y = Math.max(0, Math.ceil(F.y * 60 / (this.config.time_step * this.config.hour_size_px)) - 1) + this.config.first_hour * (60 / this.config.time_step)
+    } else {
+        var B = 0;
+        for (B = 1; B < this._colsS.heights.length; B++) {
+            if (this._colsS.heights[B] > F.y) {
+                break
+            }
+        }
+        F.y = (Math.max(0, Math.ceil(F.x / this._cols[0]) - 1) + Math.max(0, B - 1) * 7) * 24 * 60 / this.config.time_step;
+        F.x = 0
+    }
+    return F
+};
+scheduler._close_not_saved = function () {
+    if (new Date().valueOf() - (scheduler._new_event || 0) > 500 && scheduler._edit_id) {
+        var A = scheduler.locale.labels.confirm_closing;
+        if (!A || confirm(A)) {
+            scheduler.editStop(scheduler.config.positive_closing)
+        }
+    }
+};
+scheduler._correct_shift = function (B, A) {
+    return B -= ((new Date(scheduler._min_date)).getTimezoneOffset() - (new Date(B)).getTimezoneOffset()) * 60000 * (A ? -1 : 1)
+};
+scheduler._on_mouse_move = function (F) {
+    if (this._drag_mode) {
+        var G = this._mouse_coords(F);
+        if (!this._drag_pos || this._drag_pos.x != G.x || this._drag_pos.y != G.y) {
+            if (this._edit_id != this._drag_id) {
+                this._close_not_saved()
+            }
+            this._drag_pos = G;
+            if (this._drag_mode == "create") {
+                this._close_not_saved();
+                this._loading = true;
+                var B = this._min_date.valueOf() + (G.y * this.config.time_step + (this._table_view ? 0 : G.x) * 24 * 60) * 60000;
+                B = this._correct_shift(B);
+                if (!this._drag_start) {
+                    this._drag_start = B;
+                    return
+                }
+                var E = B;
+                if (E == this._drag_start) {
+                    return
+                }
+                this._drag_id = this.uid();
+                this.addEvent(new Date(this._drag_start), new Date(E), this.locale.labels.new_event, this._drag_id, G.fields);
+                this.callEvent("onEventCreated", [this._drag_id, F]);
+                this._loading = false;
+                this._drag_mode = "new-size"
+            }
+            var H = this.getEvent(this._drag_id);
+            var B, E;
+            if (this._drag_mode == "move") {
+                B = this._min_date.valueOf() + (G.y * this.config.time_step + G.x * 24 * 60) * 60000;
+                if (!G.custom && this._table_view) {
+                    B += this.date.time_part(H.start_date) * 1000
+                }
+                B = this._correct_shift(B);
+                E = H.end_date.valueOf() - (H.start_date.valueOf() - B)
+            } else {
+                B = H.start_date.valueOf();
+                if (this._table_view) {
+                    E = this._min_date.valueOf() + G.y * this.config.time_step * 60000 + (G.custom ? 0 : 24 * 60 * 60000)
+                } else {
+                    E = this.date.date_part(new Date(H.end_date)).valueOf() + G.y * this.config.time_step * 60000;
+                    this._els.dhx_cal_data[0].style.cursor = "s-resize";
+                    if (this._mode == "week" || this._mode == "day") {
+                        E = this._correct_shift(E)
+                    }
+                }
+                if (this._drag_mode == "new-size") {
+                    if (E <= this._drag_start) {
+                        var D = G.shift || ((this._table_view && !G.custom) ? 24 * 60 * 60000 : 0);
+                        B = E - D;
+                        E = this._drag_start + (D || (this.config.time_step * 60000))
+                    } else {
+                        B = this._drag_start
+                    }
+                } else {
+                    if (E <= B) {
+                        E = B + this.config.time_step * 60000
+                    }
+                }
+            }
+            var I = new Date(E - 1);
+            var C = new Date(B);
+            if (this._table_view || (I.getDate() == C.getDate() && I.getHours() < this.config.last_hour)) {
+                H.start_date = C;
+                H.end_date = new Date(E);
+                if (this.config.update_render) {
+                    this.update_view()
+                } else {
+                    this.updateEvent(this._drag_id)
+                }
+            }
+            if (this._table_view) {
+                this.for_rendered(this._drag_id, function (J) {
+                    J.className += " dhx_in_move"
+                })
+            }
+        }
+    } else {
+        if (scheduler.checkEvent("onMouseMove")) {
+            var A = this._locate_event(F.target || F.srcElement);
+            this.callEvent("onMouseMove", [A, F])
+        }
+    }
+};
+scheduler._on_mouse_context = function (A, B) {
+    return this.callEvent("onContextMenu", [this._locate_event(B), A])
+};
+scheduler._on_mouse_down = function (A, B) {
+    if (this.config.readonly || this._drag_mode) {
+        return
+    }
+    B = B || (A.target || A.srcElement);
+    if (A.button == 2 || A.ctrlKey) {
+        return this._on_mouse_context(A, B)
+    }
+    switch (B.className.split(" ")[0]) {
+    case "dhx_cal_event_line":
+    case "dhx_cal_event_clear":
+        if (this._table_view) {
+            this._drag_mode = "move"
+        }
+        break;
+    case "dhx_header":
+    case "dhx_title":
+        this._drag_mode = "move";
+        break;
+    case "dhx_footer":
+        this._drag_mode = "resize";
+        break;
+    case "dhx_scale_holder":
+    case "dhx_scale_holder_now":
+    case "dhx_month_body":
+    case "dhx_matrix_cell":
+        this._drag_mode = "create";
+        break;
+    case "":
+        if (B.parentNode) {
+            return scheduler._on_mouse_down(A, B.parentNode)
+        }
+    default:
+        this._drag_mode = null;
+        this._drag_id = null
+    }
+    if (this._drag_mode) {
+        var C = this._locate_event(B);
+        if (!this.config["drag_" + this._drag_mode] || !this.callEvent("onBeforeDrag", [C, this._drag_mode, A])) {
+            this._drag_mode = this._drag_id = 0
+        } else {
+            this._drag_id = C;
+            this._drag_event = this._copy_event(this.getEvent(this._drag_id) || {})
+        }
+    }
+    this._drag_start = null
+};
+scheduler._on_mouse_up = function (B) {
+    if (this._drag_mode && this._drag_id) {
+        this._els.dhx_cal_data[0].style.cursor = "default";
+        var A = this.getEvent(this._drag_id);
+        if (this._drag_event._dhx_changed || !this._drag_event.start_date || A.start_date.valueOf() != this._drag_event.start_date.valueOf() || A.end_date.valueOf() != this._drag_event.end_date.valueOf()) {
+            var C = (this._drag_mode == "new-size");
+            if (!this.callEvent("onBeforeEventChanged", [A, B, C])) {
+                if (C) {
+                    this.deleteEvent(A.id, true)
+                } else {
+                    A.start_date = this._drag_event.start_date;
+                    A.end_date = this._drag_event.end_date;
+                    this.updateEvent(A.id)
+                }
+            } else {
+                if (C && this.config.edit_on_create) {
+                    this.unselect();
+                    this._new_event = new Date();
+                    if (this._table_view || this.config.details_on_create) {
+                        this._drag_mode = null;
+                        return this.showLightbox(this._drag_id)
+                    }
+                    this._drag_pos = true;
+                    this._select_id = this._edit_id = this._drag_id
+                } else {
+                    if (!this._new_event) {
+                        this.callEvent(C ? "onEventAdded" : "onEventChanged", [this._drag_id, this.getEvent(this._drag_id)])
+                    }
+                }
+            }
+        }
+        if (this._drag_pos) {
+            this.render_view_data()
+        }
+    }
+    this._drag_mode = null;
+    this._drag_pos = null
+};
+scheduler.update_view = function () {
+    this._reset_scale();
+    if (this._load_mode && this._load()) {
+        return this._render_wait = true
+    }
+    this.render_view_data()
+};
+scheduler.setCurrentView = function (B, E) {
+    if (!this.callEvent("onBeforeViewChange", [this._mode, this._date, E, B])) {
+        return
+    }
+    if (this[this._mode + "_view"] && E && this._mode != E) {
+        this[this._mode + "_view"](false)
+    }
+    this._close_not_saved();
+    this._mode = E || this._mode;
+    this._date = B;
+    this._table_view = (this._mode == "month");
+    var D = this._els.dhx_cal_tab;
+    for (var C = 0; C < D.length; C++) {
+        D[C].className = "dhx_cal_tab" + ((D[C].getAttribute("name") == this._mode + "_tab") ? " active" : "")
+    }
+    var A = this[this._mode + "_view"];
+    A ? A(true) : this.update_view();
+    this.callEvent("onViewChange", [this._mode, this._date])
+};
+scheduler._render_x_header = function (B, D, E, C) {
+    var A = document.createElement("DIV");
+    A.className = "dhx_scale_bar";
+    this.set_xy(A, this._cols[B] - 1, this.xy.scale_height - 2, D, 0);
+    A.innerHTML = this.templates[this._mode + "_scale_date"](E, this._mode);
+    C.appendChild(A)
+};
+scheduler._reset_scale = function () {
+    if (!this.templates[this._mode + "_date"]) {
+        return
+    }
+    var M = this._els.dhx_cal_header[0];
+    var R = this._els.dhx_cal_data[0];
+    var P = this.config;
+    M.innerHTML = "";
+    R.scrollTop = 0;
+    R.innerHTML = "";
+    var K = ((P.readonly || (!P.drag_resize)) ? " dhx_resize_denied" : "") + ((P.readonly || (!P.drag_move)) ? " dhx_move_denied" : "");
+    if (K) {
+        R.className = "dhx_cal_data" + K
+    }
+    this._cols = [];
+    this._colsS = {
+        height: 0
+    };
+    this._dy_shift = 0;
+    this.set_sizes();
+    var I = parseInt(M.style.width);
+    var C = 0;
+    var O, Q, A, N;
+    Q = this.date[this._mode + "_start"](new Date(this._date.valueOf()));
+    O = A = this._table_view ? scheduler.date.week_start(Q) : Q;
+    N = this.date.date_part(new Date());
+    var D = scheduler.date.add(Q, 1, this._mode);
+    var E = 7;
+    if (!this._table_view) {
+        var G = this.date["get_" + this._mode + "_end"];
+        if (G) {
+            D = G(Q)
+        }
+        E = Math.round((D.valueOf() - Q.valueOf()) / (1000 * 60 * 60 * 24))
+    }
+    this._min_date = O;
+    this._els.dhx_cal_date[0].innerHTML = this.templates[this._mode + "_date"](Q, D, this._mode);
+    for (var L = 0; L < E; L++) {
+        this._cols[L] = Math.floor(I / (E - L));
+        this._render_x_header(L, C, O, M);
+        if (!this._table_view) {
+            var F = document.createElement("DIV");
+            var B = "dhx_scale_holder";
+            if (O.valueOf() == N.valueOf()) {
+                B = "dhx_scale_holder_now"
+            }
+            F.className = B + " " + this.templates.week_date_class(O, N);
+            this.set_xy(F, this._cols[L] - 1, P.hour_size_px * (P.last_hour - P.first_hour), C + this.xy.scale_width + 1, 0);
+            R.appendChild(F)
+        }
+        O = this.date.add(O, 1, "day");
+        I -= this._cols[L];
+        C += this._cols[L];
+        this._colsS[L] = (this._cols[L - 1] || 0) + (this._colsS[L - 1] || (this._table_view ? 0 : this.xy.scale_width + 2))
+    }
+    this._max_date = O;
+    this._colsS[E] = this._cols[E - 1] + this._colsS[E - 1];
+    if (this._table_view) {
+        this._reset_month_scale(R, Q, A)
+    } else {
+        this._reset_hours_scale(R, Q, A);
+        if (P.multi_day) {
+            var J = document.createElement("DIV");
+            J.className = "dhx_multi_day";
+            J.style.visibility = "hidden";
+            this.set_xy(J, parseInt(M.style.width), 0, this.xy.scale_width, 0);
+            R.appendChild(J);
+            var H = J.cloneNode(true);
+            H.className = "dhx_multi_day_icon";
+            H.style.visibility = "hidden";
+            this.set_xy(H, this.xy.scale_width - 1, 0, 0, 0);
+            R.appendChild(H);
+            this._els.dhx_multi_day = [J, H]
+        }
+    }
+};
+scheduler._reset_hours_scale = function (B, A, E) {
+    var G = document.createElement("DIV");
+    G.className = "dhx_scale_holder";
+    var C = new Date(1980, 1, 1, this.config.first_hour, 0, 0);
+    for (var D = this.config.first_hour * 1; D < this.config.last_hour; D++) {
+        var F = document.createElement("DIV");
+        F.className = "dhx_scale_hour";
+        F.style.height = this.config.hour_size_px - (this._quirks ? 0 : 1) + "px";
+        F.style.width = this.xy.scale_width + "px";
+        F.innerHTML = scheduler.templates.hour_scale(C);
+        G.appendChild(F);
+        C = this.date.add(C, 1, "hour")
+    }
+    B.appendChild(G);
+    if (this.config.scroll_hour) {
+        B.scrollTop = this.config.hour_size_px * (this.config.scroll_hour - this.config.first_hour)
+    }
+};
+scheduler._reset_month_scale = function (J, K, I) {
+    var H = scheduler.date.add(K, 1, "month");
+    var A = new Date();
+    this.date.date_part(A);
+    this.date.date_part(I);
+    var N = Math.ceil((H.valueOf() - I.valueOf()) / (60 * 60 * 24 * 1000 * 7));
+    var B = [];
+    var L = (Math.floor(J.clientHeight / N) - 22);
+    this._colsS.height = L + 22;
+    var G = this._colsS.heights = [];
+    for (var E = 0; E <= 7; E++) {
+        B[E] = " style='height:" + L + "px; width:" + ((this._cols[E] || 0) - 1) + "px;' "
+    }
+    var D = 0;
+    this._min_date = I;
+    var F = "<table cellpadding='0' cellspacing='0'>";
+    for (var E = 0; E < N; E++) {
+        F += "<tr>";
+        for (var C = 0; C < 7; C++) {
+            F += "<td";
+            var M = "";
+            if (I < K) {
+                M = "dhx_before"
+            } else {
+                if (I >= H) {
+                    M = "dhx_after"
+                } else {
+                    if (I.valueOf() == A.valueOf()) {
+                        M = "dhx_now"
+                    }
+                }
+            }
+            F += " class='" + M + " " + this.templates.month_date_class(I, A) + "' ";
+            F += "><div class='dhx_month_head'>" + this.templates.month_day(I) + "</div><div class='dhx_month_body' " + B[C] + "></div></td>";
+            I = this.date.add(I, 1, "day")
+        }
+        F += "</tr>";
+        G[E] = D;
+        D += this._colsS.height
+    }
+    F += "</table>";
+    this._max_date = I;
+    J.innerHTML = F;
+    return I
+};
+scheduler.getLabel = function (E, D) {
+    var F = this.config.lightbox.sections;
+    for (var C = 0; C < F.length; C++) {
+        if (F[C].map_to == E) {
+            var B = F[C].options;
+            for (var A = 0; A < B.length; A++) {
+                if (B[A].key == D) {
+                    return B[A].label
+                }
+            }
+        }
+    }
+    return ""
+};
+scheduler.date = {
+    date_part: function (A) {
+        A.setHours(0);
+        A.setMinutes(0);
+        A.setSeconds(0);
+        A.setMilliseconds(0);
+        return A
+    },
+    time_part: function (A) {
+        return (A.valueOf() / 1000 - A.getTimezoneOffset() * 60) % 86400
+    },
+    week_start: function (B) {
+        var A = B.getDay();
+        if (scheduler.config.start_on_monday) {
+            if (A == 0) {
+                A = 6
+            } else {
+                A--
+            }
+        }
+        return this.date_part(this.add(B, -1 * A, "day"))
+    },
+    month_start: function (A) {
+        A.setDate(1);
+        return this.date_part(A)
+    },
+    year_start: function (A) {
+        A.setMonth(0);
+        return this.month_start(A)
+    },
+    day_start: function (A) {
+        return this.date_part(A)
+    },
+    add: function (B, C, D) {
+        var A = new Date(B.valueOf());
+        switch (D) {
+        case "day":
+            A.setDate(A.getDate() + C);
+            break;
+        case "week":
+            A.setDate(A.getDate() + 7 * C);
+            break;
+        case "month":
+            A.setMonth(A.getMonth() + C);
+            break;
+        case "year":
+            A.setYear(A.getFullYear() + C);
+            break;
+        case "hour":
+            A.setHours(A.getHours() + C);
+            break;
+        case "minute":
+            A.setMinutes(A.getMinutes() + C);
+            break;
+        default:
+            return scheduler.date["add_" + D](B, C, D)
+        }
+        return A
+    },
+    to_fixed: function (A) {
+        if (A < 10) {
+            return "0" + A
+        }
+        return A
+    },
+    copy: function (A) {
+        return new Date(A.valueOf())
+    },
+    date_to_str: function (B, A) {
+        B = B.replace(/%[a-zA-Z]/g, function (C) {
+            switch (C) {
+            case "%d":
+                return '"+scheduler.date.to_fixed(date.getDate())+"';
+            case "%m":
+                return '"+scheduler.date.to_fixed((date.getMonth()+1))+"';
+            case "%j":
+                return '"+date.getDate()+"';
+            case "%n":
+                return '"+(date.getMonth()+1)+"';
+            case "%y":
+                return '"+scheduler.date.to_fixed(date.getFullYear()%100)+"';
+            case "%Y":
+                return '"+date.getFullYear()+"';
+            case "%D":
+                return '"+scheduler.locale.date.day_short[date.getDay()]+"';
+            case "%l":
+                return '"+scheduler.locale.date.day_full[date.getDay()]+"';
+            case "%M":
+                return '"+scheduler.locale.date.month_short[date.getMonth()]+"';
+            case "%F":
+                return '"+scheduler.locale.date.month_full[date.getMonth()]+"';
+            case "%h":
+                return '"+scheduler.date.to_fixed((date.getHours()+11)%12+1)+"';
+            case "%g":
+                return '"+((date.getHours()+11)%12+1)+"';
+            case "%G":
+                return '"+date.getHours()+"';
+            case "%H":
+                return '"+scheduler.date.to_fixed(date.getHours())+"';
+            case "%i":
+                return '"+scheduler.date.to_fixed(date.getMinutes())+"';
+            case "%a":
+                return '"+(date.getHours()>11?"pm":"am")+"';
+            case "%A":
+                return '"+(date.getHours()>11?"PM":"AM")+"';
+            case "%s":
+                return '"+scheduler.date.to_fixed(date.getSeconds())+"';
+            case "%W":
+                return '"+scheduler.date.to_fixed(scheduler.date.getISOWeek(date))+"';
+            default:
+                return C
+            }
+        });
+        if (A) {
+            B = B.replace(/date\.get/g, "date.getUTC")
+        }
+        return new Function("date", 'return "' + B + '";')
+    },
+    str_to_date: function (E, C) {
+        var F = "var temp=date.split(/[^0-9a-zA-Z]+/g);";
+        var A = E.match(/%[a-zA-Z]/g);
+        for (var B = 0; B < A.length; B++) {
+            switch (A[B]) {
+            case "%j":
+            case "%d":
+                F += "set[2]=temp[" + B + "]||1;";
+                break;
+            case "%n":
+            case "%m":
+                F += "set[1]=(temp[" + B + "]||1)-1;";
+                break;
+            case "%y":
+                F += "set[0]=temp[" + B + "]*1+(temp[" + B + "]>50?1900:2000);";
+                break;
+            case "%g":
+            case "%G":
+            case "%h":
+            case "%H":
+                F += "set[3]=temp[" + B + "]||0;";
+                break;
+            case "%i":
+                F += "set[4]=temp[" + B + "]||0;";
+                break;
+            case "%Y":
+                F += "set[0]=temp[" + B + "]||0;";
+                break;
+            case "%a":
+            case "%A":
+                F += "set[3]=set[3]%12+((temp[" + B + "]||'').toLowerCase()=='am'?0:12);";
+                break;
+            case "%s":
+                F += "set[5]=temp[" + B + "]||0;";
+                break
+            }
+        }
+        var D = "set[0],set[1],set[2],set[3],set[4],set[5]";
+        if (C) {
+            D = " Date.UTC(" + D + ")"
+        }
+        return new Function("date", "var set=[0,0,1,0,0,0]; " + F + " return new Date(" + D + ");")
+    },
+    getISOWeek: function (C) {
+        if (!C) {
+            return false
+        }
+        var B = C.getDay();
+        if (B == 0) {
+            B = 7
+        }
+        var D = new Date(C.valueOf());
+        D.setDate(C.getDate() + (4 - B));
+        var A = D.getFullYear();
+        var F = Math.floor((D.getTime() - new Date(A, 0, 1).getTime()) / 86400000);
+        var E = 1 + Math.floor(F / 7);
+        return E
+    },
+    getUTCISOWeek: function (A) {
+        return this.getISOWeek(A)
+    }
+};
+scheduler.locale = {
+    date: {
+        month_full: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
+        month_short: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
+        day_full: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
+        day_short: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]
+    },
+    labels: {
+        dhx_cal_today_button: "Today",
+        day_tab: "Day",
+        week_tab: "Week",
+        month_tab: "Month",
+        new_event: "New event",
+        icon_save: "Save",
+        icon_cancel: "Cancel",
+        icon_details: "Details",
+        icon_edit: "Edit",
+        icon_delete: "Delete",
+        confirm_closing: "",
+        confirm_deleting: "Event will be deleted permanently, are you sure?",
+        section_description: "Description",
+        section_time: "Time period",
+        full_day: "Full day",
+        confirm_recurring: "Do you want to edit the whole set of repeated events?",
+        section_recurring: "Repeat event",
+        button_recurring: "Disabled",
+        button_recurring_open: "Enabled",
+        agenda_tab: "Agenda",
+        date: "Date",
+        description: "Description",
+        year_tab: "Year"
+    }
+};
+scheduler.config = {
+    default_date: "%j %M %Y",
+    month_date: "%F %Y",
+    load_date: "%Y-%m-%d",
+    week_date: "%l",
+    day_date: "%D, %F %j",
+    hour_date: "%H:%i",
+    month_day: "%d",
+    xml_date: "%m/%d/%Y %H:%i",
+    api_date: "%d-%m-%Y %H:%i",
+    hour_size_px: 42,
+    time_step: 5,
+    start_on_monday: 1,
+    first_hour: 0,
+    last_hour: 24,
+    readonly: false,
+    drag_resize: 1,
+    drag_move: 1,
+    drag_create: 1,
+    dblclick_create: 1,
+    edit_on_create: 1,
+    details_on_create: 0,
+    click_form_details: 0,
+    server_utc: false,
+    positive_closing: false,
+    icons_edit: ["icon_save", "icon_cancel"],
+    icons_select: ["icon_details", "icon_edit", "icon_delete"],
+    lightbox: {
+        sections: [{
+            name: "description",
+            height: 200,
+            map_to: "text",
+            type: "textarea",
+            focus: true
+        }, {
+            name: "time",
+            height: 72,
+            type: "time",
+            map_to: "auto"
+        }]
+    }
+};
+scheduler.templates = {};
+scheduler.init_templates = function () {
+    var B = scheduler.date.date_to_str;
+    var C = scheduler.config;
+    var A = function (E, D) {
+        for (var F in D) {
+            if (!E[F]) {
+                E[F] = D[F]
+            }
+        }
+    };
+    A(scheduler.templates, {
+        day_date: B(C.default_date),
+        month_date: B(C.month_date),
+        week_date: function (E, D) {
+            return scheduler.templates.day_date(E) + " &ndash; " + scheduler.templates.day_date(scheduler.date.add(D, -1, "day"))
+        },
+        day_scale_date: B(C.default_date),
+        month_scale_date: B(C.week_date),
+        week_scale_date: B(C.day_date),
+        hour_scale: B(C.hour_date),
+        time_picker: B(C.hour_date),
+        event_date: B(C.hour_date),
+        month_day: B(C.month_day),
+        xml_date: scheduler.date.str_to_date(C.xml_date, C.server_utc),
+        load_format: B(C.load_date, C.server_utc),
+        xml_format: B(C.xml_date, C.server_utc),
+        api_date: scheduler.date.str_to_date(C.api_date),
+        event_header: function (F, D, E) {
+            return scheduler.templates.event_date(F) + " - " + scheduler.templates.event_date(D)
+        },
+        event_text: function (F, D, E) {
+            return E.text
+        },
+        event_class: function (F, D, E) {
+            return ""
+        },
+        month_date_class: function (D) {
+            return ""
+        },
+        week_date_class: function (D) {
+            return ""
+        },
+        event_bar_date: function (F, D, E) {
+            return scheduler.templates.event_date(F) + " "
+        },
+        event_bar_text: function (F, D, E) {
+            return E.text
+        }
+    });
+    this.callEvent("onTemplatesReady", [])
+};
+scheduler.uid = function () {
+    if (!this._seed) {
+        this._seed = (new Date).valueOf()
+    }
+    return this._seed++
+};
+scheduler._events = {};
+scheduler.clearAll = function () {
+    this._events = {};
+    this._loaded = {};
+    this.clear_view()
+};
+scheduler.addEvent = function (A, G, D, F, B) {
+    var C = A;
+    if (arguments.length != 1) {
+        C = B || {};
+        C.start_date = A;
+        C.end_date = G;
+        C.text = D;
+        C.id = F
+    }
+    C.id = C.id || scheduler.uid();
+    C.text = C.text || "";
+    if (typeof C.start_date == "string") {
+        C.start_date = this.templates.api_date(C.start_date)
+    }
+    if (typeof C.end_date == "string") {
+        C.end_date = this.templates.api_date(C.end_date)
+    }
+    C._timed = this.is_one_day_event(C);
+    var E = !this._events[C.id];
+    this._events[C.id] = C;
+    this.event_updated(C);
+    if (!this._loading) {
+        this.callEvent(E ? "onEventAdded" : "onEventChanged", [C.id, C])
+    }
+};
+scheduler.deleteEvent = function (C, A) {
+    var B = this._events[C];
+    if (!A && !this.callEvent("onBeforeEventDelete", [C, B])) {
+        return
+    }
+    if (B) {
+        delete this._events[C];
+        this.unselect(C);
+        this.event_updated(B)
+    }
+};
+scheduler.getEvent = function (A) {
+    return this._events[A]
+};
+scheduler.setEvent = function (B, A) {
+    this._events[B] = A
+};
+scheduler.for_rendered = function (C, B) {
+    for (var A = this._rendered.length - 1; A >= 0; A--) {
+        if (this._rendered[A].getAttribute("event_id") == C) {
+            B(this._rendered[A], A)
+        }
+    }
+};
+scheduler.changeEventId = function (C, A) {
+    if (C == A) {
+        return
+    }
+    var B = this._events[C];
+    if (B) {
+        B.id = A;
+        this._events[A] = B;
+        delete this._events[C]
+    }
+    this.for_rendered(C, function (D) {
+        D.setAttribute("event_id", A)
+    });
+    if (this._select_id == C) {
+        this._select_id = A
+    }
+    if (this._edit_id == C) {
+        this._edit_id = A
+    }
+    this.callEvent("onEventIdChange", [C, A])
+};
+(function () {
+    var A = ["text", "Text", "start_date", "StartDate", "end_date", "EndDate"];
+    var C = function (E) {
+        return function (F) {
+            return (scheduler.getEvent(F))[E]
+        }
+    };
+    var D = function (E) {
+        return function (H, G) {
+            var F = scheduler.getEvent(H);
+            F[E] = G;
+            F._changed = true;
+            F._timed = this.is_one_day_event(F);
+            scheduler.event_updated(F, true)
+        }
+    };
+    for (var B = 0; B < A.length; B += 2) {
+        scheduler["getEvent" + A[B + 1]] = C(A[B]);
+        scheduler["setEvent" + A[B + 1]] = D(A[B])
+    }
+})();
+scheduler.event_updated = function (A, B) {
+    if (this.is_visible_events(A)) {
+        this.render_view_data()
+    } else {
+        this.clear_event(A.id)
+    }
+};
+scheduler.is_visible_events = function (A) {
+    if (A.start_date < this._max_date && this._min_date < A.end_date) {
+        return true
+    }
+    return false
+};
+scheduler.is_one_day_event = function (A) {
+    var B = A.end_date.getDate() - A.start_date.getDate();
+    if (!B) {
+        return A.start_date.getMonth() == A.end_date.getMonth() && A.start_date.getFullYear() == A.end_date.getFullYear()
+    } else {
+        if (B < 0) {
+            B = Math.ceil((A.end_date.valueOf() - A.start_date.valueOf()) / (24 * 60 * 60 * 1000))
+        }
+        return (B == 1 && !A.end_date.getHours() && !A.end_date.getMinutes() && (A.start_date.getHours() || A.start_date.getMinutes()))
+    }
+};
+scheduler.get_visible_events = function () {
+    var A = [];
+    var B = this["filter_" + this._mode];
+    for (var C in this._events) {
+        if (this.is_visible_events(this._events[C])) {
+            if (this._table_view || this.config.multi_day || this._events[C]._timed) {
+                if (!B || B(C, this._events[C])) {
+                    A.push(this._events[C])
+                }
+            }
+        }
+    }
+    return A
+};
+scheduler.render_view_data = function () {
+    if (this._not_render) {
+        this._render_wait = true;
+        return
+    }
+    this._render_wait = false;
+    this.clear_view();
+    var B = this.get_visible_events();
+    if (this.config.multi_day && !this._table_view) {
+        var D = [];
+        var A = [];
+        for (var C = 0; C < B.length; C++) {
+            if (B[C]._timed) {
+                D.push(B[C])
+            } else {
+                A.push(B[C])
+            }
+        }
+        this._table_view = true;
+        this.render_data(A);
+        this._table_view = false;
+        this.render_data(D)
+    } else {
+        this.render_data(B)
+    }
+};
+scheduler.render_data = function (A, C) {
+    A = this._pre_render_events(A, C);
+    for (var B = 0; B < A.length; B++) {
+        if (this._table_view) {
+            this.render_event_bar(A[B])
+        } else {
+            this.render_event(A[B])
+        }
+    }
+};
+scheduler._pre_render_events = function (M, A) {
+    var G = this.xy.bar_height;
+    var D = this._colsS.heights;
+    var F = this._colsS.heights = [0, 0, 0, 0, 0, 0, 0];
+    if (!this._table_view) {
+        M = this._pre_render_events_line(M, A)
+    } else {
+        M = this._pre_render_events_table(M, A)
+    }
+    if (this._table_view) {
+        if (A) {
+            this._colsS.heights = D
+        } else {
+            var B = this._els.dhx_cal_data[0].firstChild;
+            if (B.rows) {
+                for (var E = 0; E < B.rows.length; E++) {
+                    F[E]++;
+                    if ((F[E]) * G > this._colsS.height - 22) {
+                        var N = B.rows[E].cells;
+                        for (var C = 0; C < N.length; C++) {
+                            N[C].childNodes[1].style.height = F[E] * G + "px"
+                        }
+                        F[E] = (F[E - 1] || 0) + N[0].offsetHeight
+                    }
+                    F[E] = (F[E - 1] || 0) + B.rows[E].cells[0].offsetHeight
+                }
+                F.unshift(0);
+                if (B.parentNode.offsetHeight < B.parentNode.scrollHeight && !B._h_fix) {
+                    for (var E = 0; E < B.rows.length; E++) {
+                        var L = B.rows[E].cells[6].childNodes[0];
+                        var J = L.offsetWidth - scheduler.xy.scroll_width + "px";
+                        L.style.width = J;
+                        L.nextSibling.style.width = J
+                    }
+                    B._h_fix = true
+                }
+            } else {
+                if (!M.length && this._els.dhx_multi_day[0].style.visibility == "visible") {
+                    F[0] = -1
+                }
+                if (M.length || F[0] == -1) {
+                    var H = B.parentNode.childNodes;
+                    var I = (F[0] + 1) * G + "px";
+                    for (var E = 0; E < H.length; E++) {
+                        if (this._colsS[E]) {
+                            H[E].style.top = I
+                        }
+                    }
+                    var K = this._els.dhx_multi_day[0];
+                    K.style.top = "0px";
+                    K.style.height = I;
+                    K.style.visibility = (F[0] == -1 ? "hidden" : "visible");
+                    K = this._els.dhx_multi_day[1];
+                    K.style.height = I;
+                    K.style.visibility = (F[0] == -1 ? "hidden" : "visible");
+                    K.className = F[0] ? "dhx_multi_day_icon" : "dhx_multi_day_icon_small";
+                    this._dy_shift = (F[0] + 1) * G;
+                    F[0] = 0
+                }
+            }
+        }
+    }
+    return M
+};
+scheduler._get_event_sday = function (A) {
+    return Math.floor((A.start_date.valueOf() - this._min_date.valueOf()) / (24 * 60 * 60 * 1000))
+};
+scheduler._pre_render_events_line = function (H, A) {
+    H.sort(function (K, J) {
+        return K.start_date > J.start_date ? 1 : -1
+    });
+    var G = [];
+    var I = [];
+    for (var C = 0; C < H.length; C++) {
+        var F = H[C];
+        var D = F.start_date.getHours();
+        var B = F.end_date.getHours();
+        F._sday = this._get_event_sday(F);
+        if (!G[F._sday]) {
+            G[F._sday] = []
+        }
+        if (!A) {
+            F._inner = false;
+            var E = G[F._sday];
+            while (E.length && E[E.length - 1].end_date <= F.start_date) {
+                E.splice(E.length - 1, 1)
+            }
+            if (E.length) {
+                E[E.length - 1]._inner = true
+            }
+            F._sorder = E.length;
+            E.push(F);
+            if (E.length > (E.max_count || 0)) {
+                E.max_count = E.length
+            }
+        }
+        if (D < this.config.first_hour || B >= this.config.last_hour) {
+            I.push(F);
+            H[C] = F = this._copy_event(F);
+            if (D < this.config.first_hour) {
+                F.start_date.setHours(this.config.first_hour);
+                F.start_date.setMinutes(0)
+            }
+            if (B >= this.config.last_hour) {
+                F.end_date.setMinutes(0);
+                F.end_date.setHours(this.config.last_hour)
+            }
+            if (F.start_date > F.end_date || D == this.config.last_hour) {
+                H.splice(C, 1);
+                C--;
+                continue
+            }
+        }
+    }
+    if (!A) {
+        for (var C = 0; C < H.length; C++) {
+            H[C]._count = G[H[C]._sday].max_count
+        }
+        for (var C = 0; C < I.length; C++) {
+            I[C]._count = G[I[C]._sday].max_count
+        }
+    }
+    return H
+};
+scheduler._time_order = function (A) {
+    A.sort(function (C, B) {
+        if (C.start_date.valueOf() == B.start_date.valueOf()) {
+            if (C._timed && !B._timed) {
+                return 1
+            }
+            if (!C._timed && B._timed) {
+                return -1
+            }
+            return 0
+        }
+        return C.start_date > B.start_date ? 1 : -1
+    })
+};
+scheduler._pre_render_events_table = function (P, C) {
+    this._time_order(P);
+    var F = [];
+    var A = [
+        [],
+        [],
+        [],
+        [],
+        [],
+        [],
+        []
+    ];
+    var N = this._colsS.heights;
+    var I;
+    var M = this._cols.length;
+    for (var G = 0; G < P.length; G++) {
+        var L = P[G];
+        var J = (I || L.start_date);
+        var H = L.end_date;
+        if (J < this._min_date) {
+            J = this._min_date
+        }
+        if (H > this._max_date) {
+            H = this._max_date
+        }
+        var E = this.locate_holder_day(J, false, L);
+        L._sday = E % M;
+        var O = this.locate_holder_day(H, true, L) || M;
+        L._eday = (O % M) || M;
+        L._length = O - E;
+        L._sweek = Math.floor((this._correct_shift(J.valueOf(), 1) - this._min_date.valueOf()) / (60 * 60 * 1000 * 24 * M));
+        var K = A[L._sweek];
+        var D;
+        for (D = 0; D < K.length; D++) {
+            if (K[D]._eday <= L._sday) {
+                break
+            }
+        }
+        L._sorder = D;
+        if (L._sday + L._length <= M) {
+            I = null;
+            F.push(L);
+            K[D] = L;
+            N[L._sweek] = K.length - 1
+        } else {
+            var B = this._copy_event(L);
+            B._length = M - L._sday;
+            B._eday = M;
+            B._sday = L._sday;
+            B._sweek = L._sweek;
+            B._sorder = L._sorder;
+            B.end_date = this.date.add(J, B._length, "day");
+            F.push(B);
+            K[D] = B;
+            I = B.end_date;
+            N[L._sweek] = K.length - 1;
+            G--;
+            continue
+        }
+    }
+    return F
+};
+scheduler._copy_dummy = function () {
+    this.start_date = new Date(this.start_date);
+    this.end_date = new Date(this.end_date)
+};
+scheduler._copy_event = function (A) {
+    this._copy_dummy.prototype = A;
+    return new this._copy_dummy()
+};
+scheduler._rendered = [];
+scheduler.clear_view = function () {
+    for (var A = 0; A < this._rendered.length; A++) {
+        var B = this._rendered[A];
+        if (B.parentNode) {
+            B.parentNode.removeChild(B)
+        }
+    }
+    this._rendered = []
+};
+scheduler.updateEvent = function (B) {
+    var A = this.getEvent(B);
+    this.clear_event(B);
+    if (A && this.is_visible_events(A)) {
+        this.render_data([A], true)
+    }
+};
+scheduler.clear_event = function (A) {
+    this.for_rendered(A, function (C, B) {
+        if (C.parentNode) {
+            C.parentNode.removeChild(C)
+        }
+        scheduler._rendered.splice(B, 1)
+    })
+};
+scheduler.render_event = function (L) {
+    var D = scheduler.xy.menu_width;
+    if (L._sday < 0) {
+        return
+    }
+    var M = scheduler.locate_holder(L._sday);
+    if (!M) {
+        return
+    }
+    var F = L.start_date.getHours() * 60 + L.start_date.getMinutes();
+    var C = (L.end_date.getHours() * 60 + L.end_date.getMinutes()) || (scheduler.config.last_hour * 60);
+    var K = (Math.round((F * 60 * 1000 - this.config.first_hour * 60 * 60 * 1000) * this.config.hour_size_px / (60 * 60 * 1000))) % (this.config.hour_size_px * 24) + 1;
+    var O = Math.max(scheduler.xy.min_event_height, (C - F) * this.config.hour_size_px / 60) + 1;
+    var B = Math.floor((M.clientWidth - D) / L._count);
+    var E = L._sorder * B + 1;
+    if (!L._inner) {
+        B = B * (L._count - L._sorder)
+    }
+    var J = this._render_v_bar(L.id, D + E, K, B, O, L._text_style, scheduler.templates.event_header(L.start_date, L.end_date, L), scheduler.templates.event_text(L.start_date, L.end_date, L));
+    this._rendered.push(J);
+    M.appendChild(J);
+    E = E + parseInt(M.style.left, 10) + D;
+    K += this._dy_shift;
+    if (this._edit_id == L.id) {
+        J.style.zIndex = 1;
+        B = Math.max(B - 4, scheduler.xy.editor_width);
+        var J = document.createElement("DIV");
+        J.setAttribute("event_id", L.id);
+        this.set_xy(J, B, O - 20, E, K + 14);
+        J.className = "dhx_cal_editor";
+        var A = document.createElement("DIV");
+        this.set_xy(A, B - 6, O - 26);
+        A.style.cssText += ";margin:2px 2px 2px 2px;overflow:hidden;";
+        J.appendChild(A);
+        this._els.dhx_cal_data[0].appendChild(J);
+        this._rendered.push(J);
+        A.innerHTML = "<textarea class='dhx_cal_editor'>" + L.text + "</textarea>";
+        if (this._quirks7) {
+            A.firstChild.style.height = O - 12 + "px"
+        }
+        this._editor = A.firstChild;
+        this._editor.onkeypress = function (Q) {
+            if ((Q || event).shiftKey) {
+                return true
+            }
+            var P = (Q || event).keyCode;
+            if (P == scheduler.keys.edit_save) {
+                scheduler.editStop(true)
+            }
+            if (P == scheduler.keys.edit_cancel) {
+                scheduler.editStop(false)
+            }
+        };
+        this._editor.onselectstart = function (P) {
+            return (P || event).cancelBubble = true
+        };
+        A.firstChild.focus();
+        this._els.dhx_cal_data[0].scrollLeft = 0;
+        A.firstChild.select()
+    }
+    if (this._select_id == L.id) {
+        var N = this.config["icons_" + ((this._edit_id == L.id) ? "edit" : "select")];
+        var I = "";
+        for (var H = 0; H < N.length; H++) {
+            I += "<div class='dhx_menu_icon " + N[H] + "' title='" + this.locale.labels[N[H]] + "'></div>"
+        }
+        var G = this._render_v_bar(L.id, E - D + 1, K, D, N.length * 20 + 26, "", "<div class='dhx_menu_head'></div>", I, true);
+        G.style.left = E - D + 1;
+        this._els.dhx_cal_data[0].appendChild(G);
+        this._rendered.push(G)
+    }
+};
+scheduler._render_v_bar = function (D, M, L, N, H, B, F, E, A) {
+    var J = document.createElement("DIV");
+    var K = this.getEvent(D);
+    var I = "dhx_cal_event";
+    var C = scheduler.templates.event_class(K.start_date, K.end_date, K);
+    if (C) {
+        I = I + " " + C
+    }
+	var G = jQuery('<div>',
+					{
+						'event_id': D,
+						'class': I
+					}).css({
+						'position':'absolute',
+						'top': L,
+						'left': M,
+						'width': (N - 4),
+						'height': H
+					}).append(
+						jQuery('<div>', {
+							'class': 'dhx_header',
+							'width': (N - 6)
+						}),
+						jQuery('<div>', {
+							'class': 'dhx_title'
+						}).html(F),
+						jQuery('<div>', {
+							'class': 'dhx_body',
+							'width': (N - (this._quirks ? 4 : 14)),
+							'height': (H - (this._quirks ? 20 : 30))
+							
+						}).html(E),
+						jQuery('<div>', {
+							'class': 'dhx_footer',
+							'width': (N - 8),
+							'margin-top': A ? 1 : '' 
+						})
+					)
+		if(K.color) {
+			jQuery('div', G).css({'background': K.color, 'color': '#FFFFFF'})
+		}
+	jQuery(J).html(G);
+    return J.firstChild
+};
+scheduler.locate_holder = function (A) {
+    if (this._mode == "day") {
+        return this._els.dhx_cal_data[0].firstChild
+    }
+    return this._els.dhx_cal_data[0].childNodes[A]
+};
+scheduler.locate_holder_day = function (B, C) {
+    var A = Math.floor((this._correct_shift(B, 1) - this._min_date) / (60 * 60 * 24 * 1000));
+    if (C && this.date.time_part(B)) {
+        A++
+    }
+    return A
+};
+scheduler.render_event_bar = function (H) {
+    var J = this._els.dhx_cal_data[0];
+    var I = this._colsS[H._sday];
+    var A = this._colsS[H._eday];
+    if (A == I) {
+        A = this._colsS[H._eday + 1]
+    }
+    var D = this.xy.bar_height;
+    var G = this._colsS.heights[H._sweek] + (this._colsS.height ? (this.xy.month_scale_height + 2) : 2) + H._sorder * D;
+    var F = document.createElement("DIV");
+    var E = H._timed ? "dhx_cal_event_clear" : "dhx_cal_event_line";
+    var B = scheduler.templates.event_class(H.start_date, H.end_date, H);
+    if (B) {
+        E = E + " " + B
+    }
+	
+	var c_innerHTML = " ";
+	var C = jQuery('<div>',
+					{
+						'event_id': H.id, 
+						'class': E
+					}).css({
+						'position': 'absolute',
+						'top': G,
+						'left': I,
+						'width': (A - I - 15)
+					})
+    if (H._timed) {
+		c_innerHTML = scheduler.templates.event_bar_date(H.start_date, H.end_date, H)
+    }
+	
+	C.html(c_innerHTML + scheduler.templates.event_bar_text(H.start_date, H.end_date, H))
+	jQuery(F).html(C);
+	
+	if (H.color) {
+		if (H._length) {
+			C.css({'background-color':H.color, 'color': '#FFFFFF'});
+		} else {
+			C.css('color',H.color);;
+		}
+	}
+	
+	if(H.title) {
+		C.attr('title',H.title);
+	}
+	
+    this._rendered.push(F.firstChild);
+    J.appendChild(F.firstChild)
+};
+
+scheduler._locate_event = function (A) {
+    var B = null;
+    while (A && !B && A.getAttribute) {
+        B = A.getAttribute("event_id");
+        A = A.parentNode
+    }
+    return B
+};
+scheduler.edit = function (A) {
+    if (this._edit_id == A) {
+        return
+    }
+    this.editStop(false, A);
+    this._edit_id = A;
+    this.updateEvent(A)
+};
+scheduler.editStop = function (B, C) {
+    if (C && this._edit_id == C) {
+        return
+    }
+    var A = this.getEvent(this._edit_id);
+    if (A) {
+        if (B) {
+            A.text = this._editor.value
+        }
+        this._edit_id = null;
+        this._editor = null;
+        this.updateEvent(A.id);
+        this._edit_stop_event(A, B)
+    }
+};
+scheduler._edit_stop_event = function (A, B) {
+    if (this._new_event) {
+        if (!B) {
+            this.deleteEvent(A.id, true)
+        } else {
+            this.callEvent("onEventAdded", [A.id, A])
+        }
+        this._new_event = null
+    } else {
+        if (B) {
+            this.callEvent("onEventChanged", [A.id, A])
+        }
+    }
+};
+scheduler.getEvents = function (E, D) {
+    var A = [];
+    for (var B in this._events) {
+        var C = this._events[B];
+        if (C && C.start_date < D && C.end_date > E) {
+            A.push(C)
+        }
+    }
+    return A
+};
+scheduler._loaded = {};
+scheduler._load = function (C, F) {
+    C = C || this._load_url;
+    C += (C.indexOf("?") == -1 ? "?" : "&") + "timeshift=" + (new Date()).getTimezoneOffset();
+    if (this.config.prevent_cache) {
+        C += "&uid=" + this.uid()
+    }
+    var E;
+    F = F || this._date;
+    if (this._load_mode) {
+        var B = this.templates.load_format;
+        F = this.date[this._load_mode + "_start"](new Date(F.valueOf()));
+        while (F > this._min_date) {
+            F = this.date.add(F, -1, this._load_mode)
+        }
+        E = F;
+        var D = true;
+        while (E < this._max_date) {
+            E = this.date.add(E, 1, this._load_mode);
+            if (this._loaded[B(F)] && D) {
+                F = this.date.add(F, 1, this._load_mode)
+            } else {
+                D = false
+            }
+        }
+        var A = E;
+        do {
+            E = A;
+            A = this.date.add(E, -1, this._load_mode)
+        } while (A > F && this._loaded[B(A)]);
+        if (E <= F) {
+            return false
+        }
+        dhtmlxAjax.get(C + "&from=" + B(F) + "&to=" + B(E), function (G) {
+            scheduler.on_load(G)
+        });
+        while (F < E) {
+            this._loaded[B(F)] = true;
+            F = this.date.add(F, 1, this._load_mode)
+        }
+    } else {
+        dhtmlxAjax.get(C, function (G) {
+            scheduler.on_load(G)
+        })
+    }
+    this.callEvent("onXLS", []);
+    return true
+};
+scheduler.on_load = function (A) {
+    this._loading = true;
+    if (this._process) {
+        var B = this[this._process].parse(A.xmlDoc.responseText)
+    } else {
+        var B = this._magic_parser(A)
+    }
+    this._not_render = true;
+    for (var C = 0; C < B.length; C++) {
+        if (!this.callEvent("onEventLoading", [B[C]])) {
+            continue
+        }
+        this.addEvent(B[C])
+    }
+    this._not_render = false;
+    if (this._render_wait) {
+        this.render_view_data()
+    }
+    if (this._after_call) {
+        this._after_call()
+    }
+    this._after_call = null;
+    this._loading = false;
+    this.callEvent("onXLE", [])
+};
+scheduler.json = {};
+scheduler.json.parse = function (data) {
+    if (typeof data == "string") {
+        eval("scheduler._temp = " + data + ";");
+        data = scheduler._temp
+    }
+    var evs = [];
+    for (var i = 0; i < data.length; i++) {
+        data[i].start_date = scheduler.templates.xml_date(data[i].start_date);
+        data[i].end_date = scheduler.templates.xml_date(data[i].end_date);
+        evs.push(data[i])
+    }
+    return evs
+};
+scheduler.parse = function (B, A) {
+    this._process = A;
+    this.on_load({
+        xmlDoc: {
+            responseText: B
+        }
+    })
+};
+scheduler.load = function (A, B) {
+    if (typeof B == "string") {
+        this._process = B;
+        B = arguments[2]
+    }
+    this._load_url = A;
+    this._after_call = B;
+    this._load(A, this._date)
+};
+scheduler.setLoadMode = function (A) {
+    if (A == "all") {
+        A = ""
+    }
+    this._load_mode = A
+};
+scheduler.refresh = function (A) {
+    alert("not implemented")
+};
+scheduler.serverList = function (A) {
+    return this.serverList[A] = (this.serverList[A] || [])
+};
+scheduler._userdata = {};
+scheduler._magic_parser = function (I) {
+    if (!I.getXMLTopNode) {
+        var B = I.xmlDoc.responseText;
+        I = new dtmlXMLLoaderObject(function () {});
+        I.loadXMLString(B)
+    }
+    var F = I.getXMLTopNode("data");
+    if (F.tagName != "data") {
+        return []
+    }
+    var A = I.doXPath("//coll_options");
+    for (var E = 0; E < A.length; E++) {
+        var H = A[E].getAttribute("for");
+        var G = this.serverList[H];
+        if (!G) {
+            continue
+        }
+        G.splice(0, G.length);
+        var K = I.doXPath(".//item", A[E]);
+        for (var C = 0; C < K.length; C++) {
+            G.push({
+                key: K[C].getAttribute("value"),
+                label: K[C].getAttribute("label")
+            })
+        }
+    }
+    if (A.length) {
+        scheduler.callEvent("onOptionsLoad", [])
+    }
+    var L = I.doXPath("//userdata");
+    for (var E = 0; E < L.length; E++) {
+        var D = this.xmlNodeToJSON(L[E]);
+        this._userdata[D.name] = D.text
+    }
+    var J = [];
+    var F = I.doXPath("//event");
+    for (var E = 0; E < F.length; E++) {
+        J[E] = this.xmlNodeToJSON(F[E]);
+        J[E].text = J[E].text || J[E]._tagvalue;
+        J[E].start_date = this.templates.xml_date(J[E].start_date);
+        J[E].end_date = this.templates.xml_date(J[E].end_date)
+    }
+    return J
+};
+scheduler.xmlNodeToJSON = function (C) {
+    var B = {};
+    for (var A = 0; A < C.attributes.length; A++) {
+        B[C.attributes[A].name] = C.attributes[A].value
+    }
+    for (var A = 0; A < C.childNodes.length; A++) {
+        var D = C.childNodes[A];
+        if (D.nodeType == 1) {
+            B[D.tagName] = D.firstChild ? D.firstChild.nodeValue : ""
+        }
+    }
+    if (!B.text) {
+        B.text = C.firstChild ? C.firstChild.nodeValue : ""
+    }
+    return B
+};
+scheduler.attachEvent("onXLS", function () {
+    if (this.config.show_loading === true) {
+        var A;
+        A = this.config.show_loading = document.createElement("DIV");
+        A.className = "dhx_loading";
+        A.style.left = Math.round((this._x - 128) / 2) + "px";
+        A.style.top = Math.round((this._y - 15) / 2) + "px";
+        this._obj.appendChild(A)
+    }
+});
+scheduler.attachEvent("onXLE", function () {
+    var A;
+    if (A = this.config.show_loading) {
+        if (typeof A == "object") {
+            this._obj.removeChild(A);
+            this.config.show_loading = true
+        }
+    }
+});
+scheduler.ical = {
+    parse: function (H) {
+        var E = H.match(RegExp(this.c_start + "[^\f]*" + this.c_end, ""));
+        if (!E.length) {
+            return
+        }
+        E[0] = E[0].replace(/[\r\n]+(?=[a-z \t])/g, " ");
+        E[0] = E[0].replace(/\;[^:\r\n]*/g, "");
+        var B = [];
+        var D;
+        var C = RegExp("(?:" + this.e_start + ")([^\f]*?)(?:" + this.e_end + ")", "g");
+        while (D = C.exec(E)) {
+            var F = {};
+            var G;
+            var A = /[^\r\n]+[\r\n]+/g;
+            while (G = A.exec(D[1])) {
+                this.parse_param(G.toString(), F)
+            }
+            if (F.uid && !F.id) {
+                F.id = F.uid
+            }
+            B.push(F)
+        }
+        return B
+    },
+    parse_param: function (E, C) {
+        var D = E.indexOf(":");
+        if (D == -1) {
+            return
+        }
+        var A = E.substr(0, D).toLowerCase();
+        var B = E.substr(D + 1).replace(/\\\,/g, ",").replace(/[\r\n]+$/, "");
+        if (A == "summary") {
+            A = "text"
+        } else {
+            if (A == "dtstart") {
+                A = "start_date";
+                B = this.parse_date(B, 0, 0)
+            } else {
+                if (A == "dtend") {
+                    A = "end_date";
+                    if (C.start_date && C.start_date.getHours() == 0) {
+                        B = this.parse_date(B, 24, 0)
+                    } else {
+                        B = this.parse_date(B, 23, 59)
+                    }
+                }
+            }
+        }
+        C[A] = B
+    },
+    parse_date: function (G, F, D) {
+        var E = G.split("T");
+        if (E[1]) {
+            F = E[1].substr(0, 2);
+            D = E[1].substr(2, 2)
+        }
+        var C = E[0].substr(0, 4);
+        var B = parseInt(E[0].substr(4, 2), 10) - 1;
+        var A = E[0].substr(6, 2);
+        if (scheduler.config.server_utc && !E[1]) {
+            return new Date(Date.UTC(C, B, A, F, D))
+        }
+        return new Date(C, B, A, F, D)
+    },
+    c_start: "BEGIN:VCALENDAR",
+    e_start: "BEGIN:VEVENT",
+    e_end: "END:VEVENT",
+    c_end: "END:VCALENDAR"
+};
+scheduler.form_blocks = {
+    textarea: {
+        render: function (B) {
+            var A = (B.height || "130") + "px";
+            return "<div class='dhx_cal_ltext' style='height:" + A + ";'><textarea></textarea></div>"
+        },
+        set_value: function (B, C, A) {
+            B.firstChild.value = C || ""
+        },
+        get_value: function (B, A) {
+            return B.firstChild.value
+        },
+        focus: function (B) {
+            var A = B.firstChild;
+            A.select();
+            A.focus()
+        }
+    },
+    select: {
+        render: function (D) {
+            var A = (D.height || "23") + "px";
+            var C = "<div class='dhx_cal_ltext' style='height:" + A + ";'><select style='width:552px;'>";
+            for (var B = 0; B < D.options.length; B++) {
+                C += "<option value='" + D.options[B].key + "'>" + D.options[B].label + "</option>"
+            }
+            C += "</select></div>";
+            return C
+        },
+        set_value: function (B, C, A) {
+            if (typeof C == "undefined") {
+                C = (B.firstChild.options[0] || {}).value
+            }
+            B.firstChild.value = C || ""
+        },
+        get_value: function (B, A) {
+            return B.firstChild.value
+        },
+        focus: function (B) {
+            var A = B.firstChild;
+            if (A.select) {
+                A.select()
+            }
+            A.focus()
+        }
+    },
+    time: {
+        render: function () {
+            var A = scheduler.config;
+            var E = this.date.date_part(new Date());
+            var D = 24 * 60,
+                G = 0;
+            if (scheduler.config.limit_time_select) {
+                D = 60 * A.last_hour + 1;
+                G = 60 * A.first_hour;
+                E.setHours(A.first_hour)
+            }
+            var C = "<select>";
+            for (var B = G; B < D; B += this.config.time_step * 1) {
+                var F = this.templates.time_picker(E);
+                C += "<option value='" + B + "'>" + F + "</option>";
+                E = this.date.add(E, this.config.time_step, "minute")
+            }
+            C += "</select> <select>";
+            for (var B = 1; B < 32; B++) {
+                C += "<option value='" + B + "'>" + B + "</option>"
+            }
+            C += "</select> <select>";
+            for (var B = 0; B < 12; B++) {
+                C += "<option value='" + B + "'>" + this.locale.date.month_full[B] + "</option>"
+            }
+            C += "</select> <select>";
+            E = E.getFullYear() - 5;
+            for (var B = 0; B < 10; B++) {
+                C += "<option value='" + (E + B) + "'>" + (E + B) + "</option>"
+            }
+            C += "</select> ";
+            return "<div style='height:30px; padding-top:0px; font-size:inherit;' class='dhx_cal_lsection dhx_section_time'>" + C + "<span style='font-weight:normal; font-size:10pt;'> &nbsp;&ndash;&nbsp; </span>" + C + "</div>"
+        },
+        set_value: function (A, I, G) {
+            var J = A.getElementsByTagName("select");
+            if (scheduler.config.full_day) {
+                if (!A._full_day) {
+                    A.previousSibling.innerHTML += "<div class='dhx_fullday_checkbox'><label><input type='checkbox' name='full_day' value='true'> " + scheduler.locale.labels.full_day + "&nbsp;</label></input></div>";
+                    A._full_day = true
+                }
+                var H = A.previousSibling.getElementsByTagName("input")[0];
+                var F = (scheduler.date.time_part(G.start_date) == 0 && scheduler.date.time_part(G.end_date) == 0 && G.end_date.valueOf() - G.start_date.valueOf() < 2 * 24 * 60 * 60 * 1000);
+                H.checked = F;
+                for (var B in J) {
+                    J[B].disabled = H.checked
+                }
+                H.onclick = function () {
+                    if (H.checked) {
+                        var K = new Date(G.start_date);
+                        var M = new Date(G.end_date);
+                        scheduler.date.date_part(K);
+                        M = scheduler.date.add(K, 1, "day")
+                    }
+                    for (var L in J) {
+                        J[L].disabled = H.checked
+                    }
+                    C(J, 0, K || G.start_date);
+                    C(J, 4, M || G.end_date)
+                }
+            }
+            if (scheduler.config.auto_end_date && scheduler.config.event_duration) {
+                function E() {
+                    G.start_date = new Date(J[3].value, J[2].value, J[1].value, 0, J[0].value);
+                    G.end_date.setTime(G.start_date.getTime() + (scheduler.config.event_duration * 60 * 1000));
+                    C(J, 4, G.end_date)
+                }
+                for (var D = 0; D < 4; D++) {
+                    J[D].onchange = E
+                }
+            }
+            function C(L, K, M) {
+                L[K + 0].value = Math.round((M.getHours() * 60 + M.getMinutes()) / scheduler.config.time_step) * scheduler.config.time_step;
+                L[K + 1].value = M.getDate();
+                L[K + 2].value = M.getMonth();
+                L[K + 3].value = M.getFullYear()
+            }
+            C(J, 0, G.start_date);
+            C(J, 4, G.end_date)
+        },
+        get_value: function (B, A) {
+            s = B.getElementsByTagName("select");
+            A.start_date = new Date(s[3].value, s[2].value, s[1].value, 0, s[0].value);
+            A.end_date = new Date(s[7].value, s[6].value, s[5].value, 0, s[4].value);
+            if (A.end_date <= A.start_date) {
+                A.end_date = scheduler.date.add(A.start_date, scheduler.config.time_step, "minute")
+            }
+        },
+        focus: function (A) {
+            A.getElementsByTagName("select")[0].focus()
+        }
+    }
+};
+scheduler.showCover = function (A) {
+    this.show_cover();
+    if (A) {
+        A.style.display = "block";
+        var B = getOffset(this._obj);
+        A.style.top = Math.round(B.top + (this._obj.offsetHeight - A.offsetHeight) / 2) + "px";
+        A.style.left = Math.round(B.left + (this._obj.offsetWidth - A.offsetWidth) / 2) + "px"
+    }
+};
+scheduler.showLightbox = function (B) {
+    if (!B) {
+        return
+    }
+    if (!this.callEvent("onBeforeLightbox", [B])) {
+        return
+    }
+    var A = this._get_lightbox();
+    this.showCover(A);
+    this._fill_lightbox(B, A);
+    this.callEvent("onLightbox", [B])
+};
+scheduler._fill_lightbox = function (H, E) {
+    var D = this.getEvent(H);
+    var B = E.getElementsByTagName("span");
+    if (scheduler.templates.lightbox_header) {
+        B[1].innerHTML = "";
+        B[2].innerHTML = scheduler.templates.lightbox_header(D.start_date, D.end_date, D)
+    } else {
+        B[1].innerHTML = this.templates.event_header(D.start_date, D.end_date, D);
+        B[2].innerHTML = (this.templates.event_bar_text(D.start_date, D.end_date, D) || "").substr(0, 70)
+    }
+    var F = this.config.lightbox.sections;
+    for (var A = 0; A < F.length; A++) {
+        var C = document.getElementById(F[A].id).nextSibling;
+        var G = this.form_blocks[F[A].type];
+        G.set_value.call(this, C, D[F[A].map_to], D, F[A]);
+        if (F[A].focus) {
+            G.focus.call(this, C)
+        }
+    }
+    scheduler._lightbox_id = H
+};
+scheduler._lightbox_out = function (D) {
+    var E = this.config.lightbox.sections;
+    for (var B = 0; B < E.length; B++) {
+        var C = document.getElementById(E[B].id).nextSibling;
+        var F = this.form_blocks[E[B].type];
+        var A = F.get_value.call(this, C, D, E[B]);
+        if (E[B].map_to != "auto") {
+            D[E[B].map_to] = A
+        }
+    }
+    return D
+};
+scheduler._empty_lightbox = function () {
+    var C = scheduler._lightbox_id;
+    var B = this.getEvent(C);
+    var A = this._get_lightbox();
+    this._lightbox_out(B);
+    B._timed = this.is_one_day_event(B);
+    this.setEvent(B.id, B);
+    this._edit_stop_event(B, true);
+    this.render_view_data()
+};
+scheduler.hide_lightbox = function (A) {
+    this.hideCover(this._get_lightbox());
+    this._lightbox_id = null;
+    this.callEvent("onAfterLightbox", [])
+};
+scheduler.hideCover = function (A) {
+    if (A) {
+        A.style.display = "none"
+    }
+    this.hide_cover()
+};
+scheduler.hide_cover = function () {
+    if (this._cover) {
+        this._cover.parentNode.removeChild(this._cover)
+    }
+    this._cover = null
+};
+scheduler.show_cover = function () {
+    this._cover = document.createElement("DIV");
+    this._cover.className = "dhx_cal_cover";
+    document.body.appendChild(this._cover)
+};
+scheduler.save_lightbox = function () {
+    if (this.checkEvent("onEventSave") && !this.callEvent("onEventSave", [this._lightbox_id, this._lightbox_out({
+        id: this._lightbox_id
+    }), this._new_event])) {
+        return
+    }
+    this._empty_lightbox();
+    this.hide_lightbox()
+};
+scheduler.startLightbox = function (B, A) {
+    this._lightbox_id = B;
+    this.showCover(A)
+};
+scheduler.endLightbox = function (B, A) {
+    this._edit_stop_event(scheduler.getEvent(this._lightbox_id), B);
+    if (B) {
+        scheduler.render_view_data()
+    }
+    this.hideCover(A)
+};
+scheduler.resetLightbox = function () {
+    scheduler._lightbox = null
+};
+scheduler.cancel_lightbox = function () {
+    this.callEvent("onEventCancel", [this._lightbox_id, this._new_event]);
+    this.endLightbox(false);
+    this.hide_lightbox()
+};
+scheduler._init_lightbox_events = function () {
+    this._get_lightbox().onclick = function (C) {
+        var E = C ? C.target : event.srcElement;
+        if (!E.className) {
+            E = E.previousSibling
+        }
+        if (E && E.className) {
+            switch (E.className) {
+            case "dhx_save_btn":
+                scheduler.save_lightbox();
+                break;
+            case "dhx_delete_btn":
+                var F = scheduler.locale.labels.confirm_deleting;
+                if (!F || confirm(F)) {
+                    scheduler.deleteEvent(scheduler._lightbox_id);
+                    scheduler._new_event = null;
+                    scheduler.hide_lightbox()
+                }
+                break;
+            case "dhx_cancel_btn":
+                scheduler.cancel_lightbox();
+                break;
+            default:
+                if (E.className.indexOf("dhx_custom_button_") != -1) {
+                    var A = E.parentNode.getAttribute("index");
+                    var D = scheduler.form_blocks[scheduler.config.lightbox.sections[A].type];
+                    var B = E.parentNode.parentNode;
+                    D.button_click(A, E, B, B.nextSibling)
+                }
+            }
+        }
+    };
+    this._get_lightbox().onkeypress = function (A) {
+        switch ((A || event).keyCode) {
+        case scheduler.keys.edit_save:
+            if ((A || event).shiftKey) {
+                return
+            }
+            scheduler.save_lightbox();
+            break;
+        case scheduler.keys.edit_cancel:
+            scheduler.cancel_lightbox();
+            break
+        }
+    }
+};
+scheduler.setLightboxSize = function () {
+    var B = this._lightbox;
+    if (!B) {
+        return
+    }
+    var A = B.childNodes[1];
+    A.style.height = "0px";
+    A.style.height = A.scrollHeight + "px";
+    B.style.height = A.scrollHeight + 50 + "px";
+    A.style.height = A.scrollHeight + "px"
+};
+scheduler._get_lightbox = function () {
+    if (!this._lightbox) {
+        var G = document.createElement("DIV");
+        G.className = "dhx_cal_light";
+        if (/msie|MSIE 6/.test(navigator.userAgent)) {
+            G.className += " dhx_ie6"
+        }
+        G.style.visibility = "hidden";
+        G.innerHTML = this._lightbox_template;
+        document.body.insertBefore(G, document.body.firstChild);
+        this._lightbox = G;
+        var E = this.config.lightbox.sections;
+        var C = "";
+        for (var B = 0; B < E.length; B++) {
+            var F = this.form_blocks[E[B].type];
+            if (!F) {
+                continue
+            }
+            E[B].id = "area_" + this.uid();
+            var A = "";
+            if (E[B].button) {
+                A = "<div style='float:right;' class='dhx_custom_button' index='" + B + "'><div class='dhx_custom_button_" + E[B].name + "'></div><div>" + this.locale.labels["button_" + E[B].button] + "</div></div>"
+            }
+            C += "<div id='" + E[B].id + "' class='dhx_cal_lsection'>" + A + this.locale.labels["section_" + E[B].name] + "</div>" + F.render.call(this, E[B])
+        }
+        var D = G.getElementsByTagName("div");
+        D[4].innerHTML = scheduler.locale.labels.icon_save;
+        D[7].innerHTML = scheduler.locale.labels.icon_cancel;
+        D[10].innerHTML = scheduler.locale.labels.icon_delete;
+        D[1].innerHTML = C;
+        this.setLightboxSize();
+        this._init_lightbox_events(this);
+        G.style.display = "none";
+        G.style.visibility = "visible"
+    }
+    return this._lightbox
+};
+scheduler._lightbox_template = "<div class='dhx_cal_ltitle'><span class='dhx_mark'>&nbsp;</span><span class='dhx_time'></span><span class='dhx_title'></span></div><div class='dhx_cal_larea'></div><div class='dhx_btn_set'><div class='dhx_save_btn'></div><div>&nbsp;</div></div><div class='dhx_btn_set'><div class='dhx_cancel_btn'></div><div>&nbsp;</div></div><div class='dhx_btn_set' style='float:right;'><div class='dhx_delete_btn'></div><div>&nbsp;</div></div>";
+scheduler._dp_init = function (A) {
+    A._methods = ["setEventTextStyle", "", "changeEventId", "deleteEvent"];
+    this.attachEvent("onEventAdded", function (B) {
+        if (!this._loading && this.validId(B)) {
+            A.setUpdated(B, true, "inserted")
+        }
+    });
+    this.attachEvent("onBeforeEventDelete", function (C) {
+        if (!this.validId(C)) {
+            return
+        }
+        var B = A.getState(C);
+        if (B == "inserted" || this._new_event) {
+            A.setUpdated(C, false);
+            return true
+        }
+        if (B == "deleted") {
+            return false
+        }
+        if (B == "true_deleted") {
+            return true
+        }
+        A.setUpdated(C, true, "deleted");
+        return false
+    });
+    this.attachEvent("onEventChanged", function (B) {
+        if (!this._loading && this.validId(B)) {
+            A.setUpdated(B, true, "updated")
+        }
+    });
+    A._getRowData = function (F, B) {
+        var D = this.obj.getEvent(F);
+        var E = {};
+        for (var C in D) {
+            if (C.indexOf("_") == 0) {
+                continue
+            }
+            if (D[C] && D[C].getUTCFullYear) {
+                E[C] = this.obj.templates.xml_format(D[C])
+            } else {
+                E[C] = D[C]
+            }
+        }
+        return E
+    };
+    A._clearUpdateFlag = function () {};
+    A.attachEvent("insertCallback", scheduler._update_callback);
+    A.attachEvent("updateCallback", scheduler._update_callback);
+    A.attachEvent("deleteCallback", function (B, C) {
+        this.obj.setUserData(C, this.action_param, "true_deleted");
+        this.obj.deleteEvent(C)
+    })
+};
+scheduler.setUserData = function (C, A, B) {
+    if (C) {
+        this.getEvent(C)[A] = B
+    } else {
+        this._userdata[A] = B
+    }
+};
+scheduler.getUserData = function (B, A) {
+    return B ? this.getEvent(B)[A] : this._userdata[A]
+};
+scheduler.setEventTextStyle = function (C, A) {
+    this.for_rendered(C, function (D) {
+        D.style.cssText += ";" + A
+    });
+    var B = this.getEvent(C);
+    B._text_style = A;
+    this.event_updated(B)
+};
+scheduler.validId = function (A) {
+    return true
+};
+scheduler._update_callback = function (B, C) {
+    var A = scheduler.xmlNodeToJSON(B.firstChild);
+    A.text = A.text || A._tagvalue;
+    A.start_date = scheduler.templates.xml_date(A.start_date);
+    A.end_date = scheduler.templates.xml_date(A.end_date);
+    scheduler.addEvent(A)
+};
+
+/*
+dhtmlxScheduler v.2.3
+
+This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
+to use it in not GPL project. Please contact sales@xxxxxxxxxx for details
+
+(c) DHTMLX Ltd.
+*/
\ No newline at end of file

=== added file 'addons/base_calendar/static/lib/dhtmlxScheduler/codebase/dhtmlxscheduler_debug.js'
--- addons/base_calendar/static/lib/dhtmlxScheduler/codebase/dhtmlxscheduler_debug.js	1970-01-01 00:00:00 +0000
+++ addons/base_calendar/static/lib/dhtmlxScheduler/codebase/dhtmlxscheduler_debug.js	2011-04-07 05:03:24 +0000
@@ -0,0 +1,3931 @@
+/*
+dhtmlxScheduler v.2.3
+
+This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
+to use it in not GPL project. Please contact sales@xxxxxxxxxx for details
+
+(c) DHTMLX Ltd.
+*/
+
+dhtmlx=function(obj){
+	for (var a in obj) dhtmlx[a]=obj[a];
+	return dhtmlx; //simple singleton
+};
+dhtmlx.extend_api=function(name,map,ext){
+	var t = window[name];
+	if (!t) return; //component not defined
+	window[name]=function(obj){
+		if (obj && typeof obj == "object" && !obj.tagName && !(obj instanceof Array)){
+			var that = t.apply(this,(map._init?map._init(obj):arguments));
+			//global settings
+			for (var a in dhtmlx)
+				if (map[a]) this[map[a]](dhtmlx[a]);			
+			//local settings
+			for (var a in obj){
+				if (map[a]) this[map[a]](obj[a]);
+				else if (a.indexOf("on")==0){
+					this.attachEvent(a,obj[a]);
+				}
+			}
+		} else
+			var that = t.apply(this,arguments);
+		if (map._patch) map._patch(this);
+		return that||this;
+	};
+	window[name].prototype=t.prototype;
+	if (ext)
+		dhtmlXHeir(window[name].prototype,ext);
+};
+
+dhtmlxAjax={
+	get:function(url,callback){
+		var t=new dtmlXMLLoaderObject(true);
+		t.async=(arguments.length<3);
+		t.waitCall=callback;
+		t.loadXML(url)
+		return t;
+	},
+	post:function(url,post,callback){
+		var t=new dtmlXMLLoaderObject(true);
+		t.async=(arguments.length<4);
+		t.waitCall=callback;
+		t.loadXML(url,true,post)
+		return t;
+	},
+	getSync:function(url){
+		return this.get(url,null,true)
+	},
+	postSync:function(url,post){
+		return this.post(url,post,null,true);		
+	}
+}
+
+/**
+  *     @desc: xmlLoader object
+  *     @type: private
+  *     @param: funcObject - xml parser function
+  *     @param: object - jsControl object
+  *     @param: async - sync/async mode (async by default)
+  *     @param: rSeed - enable/disable random seed ( prevent IE caching)
+  *     @topic: 0
+  */
+function dtmlXMLLoaderObject(funcObject, dhtmlObject, async, rSeed){
+	this.xmlDoc="";
+
+	if (typeof (async) != "undefined")
+		this.async=async;
+	else
+		this.async=true;
+
+	this.onloadAction=funcObject||null;
+	this.mainObject=dhtmlObject||null;
+	this.waitCall=null;
+	this.rSeed=rSeed||false;
+	return this;
+};
+/**
+  *     @desc: xml loading handler
+  *     @type: private
+  *     @param: dtmlObject - xmlLoader object
+  *     @topic: 0
+  */
+dtmlXMLLoaderObject.prototype.waitLoadFunction=function(dhtmlObject){
+	var once = true;
+	this.check=function (){
+		if ((dhtmlObject)&&(dhtmlObject.onloadAction != null)){
+			if ((!dhtmlObject.xmlDoc.readyState)||(dhtmlObject.xmlDoc.readyState == 4)){
+				if (!once)
+					return;
+
+				once=false; //IE 5 fix
+				if (typeof dhtmlObject.onloadAction == "function")
+					dhtmlObject.onloadAction(dhtmlObject.mainObject, null, null, null, dhtmlObject);
+
+				if (dhtmlObject.waitCall){
+					dhtmlObject.waitCall.call(this,dhtmlObject);
+					dhtmlObject.waitCall=null;
+				}
+			}
+		}
+	};
+	return this.check;
+};
+
+/**
+  *     @desc: return XML top node
+  *     @param: tagName - top XML node tag name (not used in IE, required for Safari and Mozilla)
+  *     @type: private
+  *     @returns: top XML node
+  *     @topic: 0  
+  */
+dtmlXMLLoaderObject.prototype.getXMLTopNode=function(tagName, oldObj){
+	if (this.xmlDoc.responseXML){
+		var temp = this.xmlDoc.responseXML.getElementsByTagName(tagName);
+		if(temp.length==0 && tagName.indexOf(":")!=-1)
+			var temp = this.xmlDoc.responseXML.getElementsByTagName((tagName.split(":"))[1]);
+		var z = temp[0];
+	} else
+		var z = this.xmlDoc.documentElement;
+
+	if (z){
+		this._retry=false;
+		return z;
+	}
+
+	if ((_isIE)&&(!this._retry)){
+		//fall back to MS.XMLDOM
+		var xmlString = this.xmlDoc.responseText;
+		var oldObj = this.xmlDoc;
+		this._retry=true;
+		this.xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
+		this.xmlDoc.async=false;
+		this.xmlDoc["loadXM"+"L"](xmlString);
+
+		return this.getXMLTopNode(tagName, oldObj);
+	}
+	dhtmlxError.throwError("LoadXML", "Incorrect XML", [
+		(oldObj||this.xmlDoc),
+		this.mainObject
+	]);
+
+	return document.createElement("DIV");
+};
+
+/**
+  *     @desc: load XML from string
+  *     @type: private
+  *     @param: xmlString - xml string
+  *     @topic: 0  
+  */
+dtmlXMLLoaderObject.prototype.loadXMLString=function(xmlString){
+	{
+		try{
+			var parser = new DOMParser();
+			this.xmlDoc=parser.parseFromString(xmlString, "text/xml");
+		}
+		catch (e){
+			this.xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
+			this.xmlDoc.async=this.async;
+			this.xmlDoc["loadXM"+"L"](xmlString);
+		}
+	}
+
+	this.onloadAction(this.mainObject, null, null, null, this);
+
+	if (this.waitCall){
+		this.waitCall();
+		this.waitCall=null;
+	}
+}
+/**
+  *     @desc: load XML
+  *     @type: private
+  *     @param: filePath - xml file path
+  *     @param: postMode - send POST request
+  *     @param: postVars - list of vars for post request
+  *     @topic: 0
+  */
+dtmlXMLLoaderObject.prototype.loadXML=function(filePath, postMode, postVars, rpc){
+	if (this.rSeed)
+		filePath+=((filePath.indexOf("?") != -1) ? "&" : "?")+"a_dhx_rSeed="+(new Date()).valueOf();
+	this.filePath=filePath;
+	if ((!_isIE)&&(window.XMLHttpRequest))
+		this.xmlDoc=new XMLHttpRequest();
+	else {
+		this.xmlDoc=new ActiveXObject("Microsoft.XMLHTTP");
+	}
+
+	if (this.async)
+		this.xmlDoc.onreadystatechange=new this.waitLoadFunction(this);
+	this.xmlDoc.open(postMode ? "POST" : "GET", filePath, this.async);
+
+	if (rpc){
+		this.xmlDoc.setRequestHeader("User-Agent", "dhtmlxRPC v0.1 ("+navigator.userAgent+")");
+		this.xmlDoc.setRequestHeader("Content-type", "text/xml");
+	}
+
+	else if (postMode)
+		this.xmlDoc.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
+		
+	this.xmlDoc.setRequestHeader("X-Requested-With","XMLHttpRequest");
+	this.xmlDoc.send(null||postVars);
+
+	if (!this.async)
+		(new this.waitLoadFunction(this))();
+};
+/**
+  *     @desc: destructor, cleans used memory
+  *     @type: private
+  *     @topic: 0
+  */
+dtmlXMLLoaderObject.prototype.destructor=function(){
+	this.onloadAction=null;
+	this.mainObject=null;
+	this.xmlDoc=null;
+	return null;
+}
+
+dtmlXMLLoaderObject.prototype.xmlNodeToJSON = function(node){
+        var t={};
+        for (var i=0; i<node.attributes.length; i++)
+            t[node.attributes[i].name]=node.attributes[i].value;
+        t["_tagvalue"]=node.firstChild?node.firstChild.nodeValue:"";
+        for (var i=0; i<node.childNodes.length; i++){
+            var name=node.childNodes[i].tagName;
+            if (name){
+                if (!t[name]) t[name]=[];
+                t[name].push(this.xmlNodeToJSON(node.childNodes[i]));
+            }            
+        }        
+        return t;
+    }
+
+/**  
+  *     @desc: Call wrapper
+  *     @type: private
+  *     @param: funcObject - action handler
+  *     @param: dhtmlObject - user data
+  *     @returns: function handler
+  *     @topic: 0  
+  */
+function callerFunction(funcObject, dhtmlObject){
+	this.handler=function(e){
+		if (!e)
+			e=window.event;
+		funcObject(e, dhtmlObject);
+		return true;
+	};
+	return this.handler;
+};
+
+/**  
+  *     @desc: Calculate absolute position of html object
+  *     @type: private
+  *     @param: htmlObject - html object
+  *     @topic: 0  
+  */
+function getAbsoluteLeft(htmlObject){
+	return getOffset(htmlObject).left;
+}
+/**
+  *     @desc: Calculate absolute position of html object
+  *     @type: private
+  *     @param: htmlObject - html object
+  *     @topic: 0  
+  */
+function getAbsoluteTop(htmlObject){
+	return getOffset(htmlObject).top;
+}
+
+function getOffsetSum(elem) {
+	var top=0, left=0;
+	while(elem) {
+		top = top + parseInt(elem.offsetTop);
+		left = left + parseInt(elem.offsetLeft);
+		elem = elem.offsetParent;
+	}
+	return {top: top, left: left};
+}
+function getOffsetRect(elem) {
+	var box = elem.getBoundingClientRect();
+	var body = document.body;
+	var docElem = document.documentElement;
+	var scrollTop = window.pageYOffset || docElem.scrollTop || body.scrollTop;
+	var scrollLeft = window.pageXOffset || docElem.scrollLeft || body.scrollLeft;
+	var clientTop = docElem.clientTop || body.clientTop || 0;
+	var clientLeft = docElem.clientLeft || body.clientLeft || 0;
+	var top  = box.top +  scrollTop - clientTop;
+	var left = box.left + scrollLeft - clientLeft;
+	return { top: Math.round(top), left: Math.round(left) };
+}
+function getOffset(elem) {
+	if (elem.getBoundingClientRect && !_isChrome) {
+		return getOffsetRect(elem);
+	} else {
+		return getOffsetSum(elem);
+	}
+}
+
+/**  
+*     @desc: Convert string to it boolean representation
+*     @type: private
+*     @param: inputString - string for covertion
+*     @topic: 0
+*/
+function convertStringToBoolean(inputString){
+	if (typeof (inputString) == "string")
+		inputString=inputString.toLowerCase();
+
+	switch (inputString){
+		case "1":
+		case "true":
+		case "yes":
+		case "y":
+		case 1:
+		case true:
+			return true;
+			break;
+
+		default: return false;
+	}
+}
+
+/**  
+*     @desc: find out what symbol to use as url param delimiters in further params
+*     @type: private
+*     @param: str - current url string
+*     @topic: 0  
+*/
+function getUrlSymbol(str){
+	if (str.indexOf("?") != -1)
+		return "&"
+	else
+		return "?"
+}
+
+function dhtmlDragAndDropObject(){
+	if (window.dhtmlDragAndDrop)
+		return window.dhtmlDragAndDrop;
+
+	this.lastLanding=0;
+	this.dragNode=0;
+	this.dragStartNode=0;
+	this.dragStartObject=0;
+	this.tempDOMU=null;
+	this.tempDOMM=null;
+	this.waitDrag=0;
+	window.dhtmlDragAndDrop=this;
+
+	return this;
+};
+
+dhtmlDragAndDropObject.prototype.removeDraggableItem=function(htmlNode){
+	htmlNode.onmousedown=null;
+	htmlNode.dragStarter=null;
+	htmlNode.dragLanding=null;
+}
+dhtmlDragAndDropObject.prototype.addDraggableItem=function(htmlNode, dhtmlObject){
+	htmlNode.onmousedown=this.preCreateDragCopy;
+	htmlNode.dragStarter=dhtmlObject;
+	this.addDragLanding(htmlNode, dhtmlObject);
+}
+dhtmlDragAndDropObject.prototype.addDragLanding=function(htmlNode, dhtmlObject){
+	htmlNode.dragLanding=dhtmlObject;
+}
+dhtmlDragAndDropObject.prototype.preCreateDragCopy=function(e){
+	if ((e||event) && (e||event).button == 2)
+		return;
+
+	if (window.dhtmlDragAndDrop.waitDrag){
+		window.dhtmlDragAndDrop.waitDrag=0;
+		document.body.onmouseup=window.dhtmlDragAndDrop.tempDOMU;
+		document.body.onmousemove=window.dhtmlDragAndDrop.tempDOMM;
+		return false;
+	}
+
+	window.dhtmlDragAndDrop.waitDrag=1;
+	window.dhtmlDragAndDrop.tempDOMU=document.body.onmouseup;
+	window.dhtmlDragAndDrop.tempDOMM=document.body.onmousemove;
+	window.dhtmlDragAndDrop.dragStartNode=this;
+	window.dhtmlDragAndDrop.dragStartObject=this.dragStarter;
+	document.body.onmouseup=window.dhtmlDragAndDrop.preCreateDragCopy;
+	document.body.onmousemove=window.dhtmlDragAndDrop.callDrag;
+	window.dhtmlDragAndDrop.downtime = new Date().valueOf();
+	
+
+	if ((e)&&(e.preventDefault)){
+		e.preventDefault();
+		return false;
+	}
+	return false;
+};
+dhtmlDragAndDropObject.prototype.callDrag=function(e){
+	if (!e)
+		e=window.event;
+	dragger=window.dhtmlDragAndDrop;
+	if ((new Date()).valueOf()-dragger.downtime<100) return;
+
+	if ((e.button == 0)&&(_isIE))
+		return dragger.stopDrag();
+
+	if (!dragger.dragNode&&dragger.waitDrag){
+		dragger.dragNode=dragger.dragStartObject._createDragNode(dragger.dragStartNode, e);
+
+		if (!dragger.dragNode)
+			return dragger.stopDrag();
+
+		dragger.dragNode.onselectstart=function(){return false;}
+		dragger.gldragNode=dragger.dragNode;
+		document.body.appendChild(dragger.dragNode);
+		document.body.onmouseup=dragger.stopDrag;
+		dragger.waitDrag=0;
+		dragger.dragNode.pWindow=window;
+		dragger.initFrameRoute();
+	}
+
+	if (dragger.dragNode.parentNode != window.document.body){
+		var grd = dragger.gldragNode;
+
+		if (dragger.gldragNode.old)
+			grd=dragger.gldragNode.old;
+
+		//if (!document.all) dragger.calculateFramePosition();
+		grd.parentNode.removeChild(grd);
+		var oldBody = dragger.dragNode.pWindow;
+
+		//		var oldp=dragger.dragNode.parentObject;
+		if (_isIE){
+			var div = document.createElement("Div");
+			div.innerHTML=dragger.dragNode.outerHTML;
+			dragger.dragNode=div.childNodes[0];
+		} else
+			dragger.dragNode=dragger.dragNode.cloneNode(true);
+
+		dragger.dragNode.pWindow=window;
+		//		dragger.dragNode.parentObject=oldp;
+
+		dragger.gldragNode.old=dragger.dragNode;
+		document.body.appendChild(dragger.dragNode);
+		oldBody.dhtmlDragAndDrop.dragNode=dragger.dragNode;
+	}
+
+	dragger.dragNode.style.left=e.clientX+15+(dragger.fx
+		? dragger.fx*(-1)
+		: 0)
+		+(document.body.scrollLeft||document.documentElement.scrollLeft)+"px";
+	dragger.dragNode.style.top=e.clientY+3+(dragger.fy
+		? dragger.fy*(-1)
+		: 0)
+		+(document.body.scrollTop||document.documentElement.scrollTop)+"px";
+
+	if (!e.srcElement)
+		var z = e.target;
+	else
+		z=e.srcElement;
+	dragger.checkLanding(z, e);
+}
+
+dhtmlDragAndDropObject.prototype.calculateFramePosition=function(n){
+	//this.fx = 0, this.fy = 0;
+	if (window.name){
+		var el = parent.frames[window.name].frameElement.offsetParent;
+		var fx = 0;
+		var fy = 0;
+
+		while (el){
+			fx+=el.offsetLeft;
+			fy+=el.offsetTop;
+			el=el.offsetParent;
+		}
+
+		if ((parent.dhtmlDragAndDrop)){
+			var ls = parent.dhtmlDragAndDrop.calculateFramePosition(1);
+			fx+=ls.split('_')[0]*1;
+			fy+=ls.split('_')[1]*1;
+		}
+
+		if (n)
+			return fx+"_"+fy;
+		else
+			this.fx=fx;
+		this.fy=fy;
+	}
+	return "0_0";
+}
+dhtmlDragAndDropObject.prototype.checkLanding=function(htmlObject, e){
+	if ((htmlObject)&&(htmlObject.dragLanding)){
+		if (this.lastLanding)
+			this.lastLanding.dragLanding._dragOut(this.lastLanding);
+		this.lastLanding=htmlObject;
+		this.lastLanding=this.lastLanding.dragLanding._dragIn(this.lastLanding, this.dragStartNode, e.clientX,
+			e.clientY, e);
+		this.lastLanding_scr=(_isIE ? e.srcElement : e.target);
+	} else {
+		if ((htmlObject)&&(htmlObject.tagName != "BODY"))
+			this.checkLanding(htmlObject.parentNode, e);
+		else {
+			if (this.lastLanding)
+				this.lastLanding.dragLanding._dragOut(this.lastLanding, e.clientX, e.clientY, e);
+			this.lastLanding=0;
+
+			if (this._onNotFound)
+				this._onNotFound();
+		}
+	}
+}
+dhtmlDragAndDropObject.prototype.stopDrag=function(e, mode){
+	dragger=window.dhtmlDragAndDrop;
+
+	if (!mode){
+		dragger.stopFrameRoute();
+		var temp = dragger.lastLanding;
+		dragger.lastLanding=null;
+
+		if (temp)
+			temp.dragLanding._drag(dragger.dragStartNode, dragger.dragStartObject, temp, (_isIE
+				? event.srcElement
+				: e.target));
+	}
+	dragger.lastLanding=null;
+
+	if ((dragger.dragNode)&&(dragger.dragNode.parentNode == document.body))
+		dragger.dragNode.parentNode.removeChild(dragger.dragNode);
+	dragger.dragNode=0;
+	dragger.gldragNode=0;
+	dragger.fx=0;
+	dragger.fy=0;
+	dragger.dragStartNode=0;
+	dragger.dragStartObject=0;
+	document.body.onmouseup=dragger.tempDOMU;
+	document.body.onmousemove=dragger.tempDOMM;
+	dragger.tempDOMU=null;
+	dragger.tempDOMM=null;
+	dragger.waitDrag=0;
+}
+
+dhtmlDragAndDropObject.prototype.stopFrameRoute=function(win){
+	if (win)
+		window.dhtmlDragAndDrop.stopDrag(1, 1);
+
+	for (var i = 0; i < window.frames.length; i++){
+		try{
+		if ((window.frames[i] != win)&&(window.frames[i].dhtmlDragAndDrop))
+			window.frames[i].dhtmlDragAndDrop.stopFrameRoute(window);
+		} catch(e){}
+	}
+
+	try{
+	if ((parent.dhtmlDragAndDrop)&&(parent != window)&&(parent != win))
+		parent.dhtmlDragAndDrop.stopFrameRoute(window);
+	} catch(e){}
+}
+dhtmlDragAndDropObject.prototype.initFrameRoute=function(win, mode){
+	if (win){
+		window.dhtmlDragAndDrop.preCreateDragCopy({});
+		window.dhtmlDragAndDrop.dragStartNode=win.dhtmlDragAndDrop.dragStartNode;
+		window.dhtmlDragAndDrop.dragStartObject=win.dhtmlDragAndDrop.dragStartObject;
+		window.dhtmlDragAndDrop.dragNode=win.dhtmlDragAndDrop.dragNode;
+		window.dhtmlDragAndDrop.gldragNode=win.dhtmlDragAndDrop.dragNode;
+		window.document.body.onmouseup=window.dhtmlDragAndDrop.stopDrag;
+		window.waitDrag=0;
+
+		if (((!_isIE)&&(mode))&&((!_isFF)||(_FFrv < 1.8)))
+			window.dhtmlDragAndDrop.calculateFramePosition();
+	}
+	try{
+	if ((parent.dhtmlDragAndDrop)&&(parent != window)&&(parent != win))
+		parent.dhtmlDragAndDrop.initFrameRoute(window);
+	}catch(e){}
+
+	for (var i = 0; i < window.frames.length; i++){
+		try{
+		if ((window.frames[i] != win)&&(window.frames[i].dhtmlDragAndDrop))
+			window.frames[i].dhtmlDragAndDrop.initFrameRoute(window, ((!win||mode) ? 1 : 0));
+		} catch(e){}
+	}
+}
+
+var _isFF = false;
+var _isIE = false;
+var _isOpera = false;
+var _isKHTML = false;
+var _isMacOS = false;
+var _isChrome = false;
+
+if (navigator.userAgent.indexOf('Macintosh') != -1)
+	_isMacOS=true;
+
+
+if (navigator.userAgent.toLowerCase().indexOf('chrome')>-1)
+	_isChrome=true;
+
+if ((navigator.userAgent.indexOf('Safari') != -1)||(navigator.userAgent.indexOf('Konqueror') != -1)){
+	var _KHTMLrv = parseFloat(navigator.userAgent.substr(navigator.userAgent.indexOf('Safari')+7, 5));
+
+	if (_KHTMLrv > 525){ //mimic FF behavior for Safari 3.1+
+		_isFF=true;
+		var _FFrv = 1.9;
+	} else
+		_isKHTML=true;
+} else if (navigator.userAgent.indexOf('Opera') != -1){
+	_isOpera=true;
+	_OperaRv=parseFloat(navigator.userAgent.substr(navigator.userAgent.indexOf('Opera')+6, 3));
+}
+
+
+else if (navigator.appName.indexOf("Microsoft") != -1){
+	_isIE=true;
+	if (navigator.appVersion.indexOf("MSIE 8.0")!= -1 && document.compatMode != "BackCompat") _isIE=8;
+} else {
+	_isFF=true;
+	var _FFrv = parseFloat(navigator.userAgent.split("rv:")[1])
+}
+
+
+//multibrowser Xpath processor
+dtmlXMLLoaderObject.prototype.doXPath=function(xpathExp, docObj, namespace, result_type){
+	if (_isKHTML || (!_isIE && !window.XPathResult))
+		return this.doXPathOpera(xpathExp, docObj);
+
+	if (_isIE){ //IE
+		if (!docObj)
+			if (!this.xmlDoc.nodeName)
+				docObj=this.xmlDoc.responseXML
+			else
+				docObj=this.xmlDoc;
+
+		if (!docObj)
+			dhtmlxError.throwError("LoadXML", "Incorrect XML", [
+				(docObj||this.xmlDoc),
+				this.mainObject
+			]);
+
+		if (namespace != null)
+			docObj.setProperty("SelectionNamespaces", "xmlns:xsl='"+namespace+"'"); //
+
+		if (result_type == 'single'){
+			return docObj.selectSingleNode(xpathExp);
+		}
+		else {
+			return docObj.selectNodes(xpathExp)||new Array(0);
+		}
+	} else { //Mozilla
+		var nodeObj = docObj;
+
+		if (!docObj){
+			if (!this.xmlDoc.nodeName){
+				docObj=this.xmlDoc.responseXML
+			}
+			else {
+				docObj=this.xmlDoc;
+			}
+		}
+
+		if (!docObj)
+			dhtmlxError.throwError("LoadXML", "Incorrect XML", [
+				(docObj||this.xmlDoc),
+				this.mainObject
+			]);
+
+		if (docObj.nodeName.indexOf("document") != -1){
+			nodeObj=docObj;
+		}
+		else {
+			nodeObj=docObj;
+			docObj=docObj.ownerDocument;
+		}
+		var retType = XPathResult.ANY_TYPE;
+
+		if (result_type == 'single')
+			retType=XPathResult.FIRST_ORDERED_NODE_TYPE
+		var rowsCol = new Array();
+		var col = docObj.evaluate(xpathExp, nodeObj, function(pref){
+			return namespace
+		}, retType, null);
+
+		if (retType == XPathResult.FIRST_ORDERED_NODE_TYPE){
+			return col.singleNodeValue;
+		}
+		var thisColMemb = col.iterateNext();
+
+		while (thisColMemb){
+			rowsCol[rowsCol.length]=thisColMemb;
+			thisColMemb=col.iterateNext();
+		}
+		return rowsCol;
+	}
+}
+
+function _dhtmlxError(type, name, params){
+	if (!this.catches)
+		this.catches=new Array();
+
+	return this;
+}
+
+_dhtmlxError.prototype.catchError=function(type, func_name){
+	this.catches[type]=func_name;
+}
+_dhtmlxError.prototype.throwError=function(type, name, params){
+	if (this.catches[type])
+		return this.catches[type](type, name, params);
+
+	if (this.catches["ALL"])
+		return this.catches["ALL"](type, name, params);
+
+	alert("Error type: "+arguments[0]+"\nDescription: "+arguments[1]);
+	return null;
+}
+
+window.dhtmlxError=new _dhtmlxError();
+
+
+//opera fake, while 9.0 not released
+//multibrowser Xpath processor
+dtmlXMLLoaderObject.prototype.doXPathOpera=function(xpathExp, docObj){
+	//this is fake for Opera
+	var z = xpathExp.replace(/[\/]+/gi, "/").split('/');
+	var obj = null;
+	var i = 1;
+
+	if (!z.length)
+		return [];
+
+	if (z[0] == ".")
+		obj=[docObj]; else if (z[0] == ""){
+		obj=(this.xmlDoc.responseXML||this.xmlDoc).getElementsByTagName(z[i].replace(/\[[^\]]*\]/g, ""));
+		i++;
+	} else
+		return [];
+
+	for (i; i < z.length; i++)obj=this._getAllNamedChilds(obj, z[i]);
+
+	if (z[i-1].indexOf("[") != -1)
+		obj=this._filterXPath(obj, z[i-1]);
+	return obj;
+}
+
+dtmlXMLLoaderObject.prototype._filterXPath=function(a, b){
+	var c = new Array();
+	var b = b.replace(/[^\[]*\[\@/g, "").replace(/[\[\]\@]*/g, "");
+
+	for (var i = 0; i < a.length; i++)
+		if (a[i].getAttribute(b))
+			c[c.length]=a[i];
+
+	return c;
+}
+dtmlXMLLoaderObject.prototype._getAllNamedChilds=function(a, b){
+	var c = new Array();
+
+	if (_isKHTML)
+		b=b.toUpperCase();
+
+	for (var i = 0; i < a.length; i++)for (var j = 0; j < a[i].childNodes.length; j++){
+		if (_isKHTML){
+			if (a[i].childNodes[j].tagName&&a[i].childNodes[j].tagName.toUpperCase() == b)
+				c[c.length]=a[i].childNodes[j];
+		}
+
+		else if (a[i].childNodes[j].tagName == b)
+			c[c.length]=a[i].childNodes[j];
+	}
+
+	return c;
+}
+
+function dhtmlXHeir(a, b){
+	for (var c in b)
+		if (typeof (b[c]) == "function")
+			a[c]=b[c];
+	return a;
+}
+
+function dhtmlxEvent(el, event, handler){
+	if (el.addEventListener)
+		el.addEventListener(event, handler, false);
+
+	else if (el.attachEvent)
+		el.attachEvent("on"+event, handler);
+}
+
+//============= XSL Extension ===================================
+
+dtmlXMLLoaderObject.prototype.xslDoc=null;
+dtmlXMLLoaderObject.prototype.setXSLParamValue=function(paramName, paramValue, xslDoc){
+	if (!xslDoc)
+		xslDoc=this.xslDoc
+
+	if (xslDoc.responseXML)
+		xslDoc=xslDoc.responseXML;
+	var item =
+		this.doXPath("/xsl:stylesheet/xsl:variable[@name='"+paramName+"']", xslDoc,
+			"http:/\/www.w3.org/1999/XSL/Transform", "single");
+
+	if (item != null)
+		item.firstChild.nodeValue=paramValue
+}
+dtmlXMLLoaderObject.prototype.doXSLTransToObject=function(xslDoc, xmlDoc){
+	if (!xslDoc)
+		xslDoc=this.xslDoc;
+
+	if (xslDoc.responseXML)
+		xslDoc=xslDoc.responseXML
+
+	if (!xmlDoc)
+		xmlDoc=this.xmlDoc;
+
+	if (xmlDoc.responseXML)
+		xmlDoc=xmlDoc.responseXML
+
+	//MOzilla
+	if (!_isIE){
+		if (!this.XSLProcessor){
+			this.XSLProcessor=new XSLTProcessor();
+			this.XSLProcessor.importStylesheet(xslDoc);
+		}
+		var result = this.XSLProcessor.transformToDocument(xmlDoc);
+	} else {
+		var result = new ActiveXObject("Msxml2.DOMDocument.3.0");
+		try{
+			xmlDoc.transformNodeToObject(xslDoc, result);
+		}catch(e){
+			result = xmlDoc.transformNode(xslDoc);
+		}
+	}
+	return result;
+}
+
+dtmlXMLLoaderObject.prototype.doXSLTransToString=function(xslDoc, xmlDoc){
+	var res = this.doXSLTransToObject(xslDoc, xmlDoc);
+	if(typeof(res)=="string")
+		return res;
+	return this.doSerialization(res);
+}
+
+dtmlXMLLoaderObject.prototype.doSerialization=function(xmlDoc){
+	if (!xmlDoc)
+			xmlDoc=this.xmlDoc;
+	if (xmlDoc.responseXML)
+			xmlDoc=xmlDoc.responseXML
+	if (!_isIE){
+		var xmlSerializer = new XMLSerializer();
+		return xmlSerializer.serializeToString(xmlDoc);
+	} else
+		return xmlDoc.xml;
+}
+
+/**
+*   @desc: 
+*   @type: private
+*/
+dhtmlxEventable=function(obj){
+		obj.dhx_SeverCatcherPath="";
+		obj.attachEvent=function(name, catcher, callObj){
+			name='ev_'+name.toLowerCase();
+			if (!this[name])
+				this[name]=new this.eventCatcher(callObj||this);
+				
+			return(name+':'+this[name].addEvent(catcher)); //return ID (event name & event ID)
+		}
+		obj.callEvent=function(name, arg0){ 
+			name='ev_'+name.toLowerCase();
+			if (this[name])
+				return this[name].apply(this, arg0);
+			return true;
+		}
+		obj.checkEvent=function(name){
+			return (!!this['ev_'+name.toLowerCase()])
+		}
+		obj.eventCatcher=function(obj){
+			var dhx_catch = [];
+			var z = function(){
+				var res = true;
+				for (var i = 0; i < dhx_catch.length; i++){
+					if (dhx_catch[i] != null){
+						var zr = dhx_catch[i].apply(obj, arguments);
+						res=res&&zr;
+					}
+				}
+				return res;
+			}
+			z.addEvent=function(ev){
+				if (typeof (ev) != "function")
+					ev=eval(ev);
+				if (ev)
+					return dhx_catch.push(ev)-1;
+				return false;
+			}
+			z.removeEvent=function(id){
+				dhx_catch[id]=null;
+			}
+			return z;
+		}
+		obj.detachEvent=function(id){
+			if (id != false){
+				var list = id.split(':');           //get EventName and ID
+				this[list[0]].removeEvent(list[1]); //remove event
+			}
+		}
+}
+
+/**
+	* 	@desc: constructor, data processor object 
+	*	@param: serverProcessorURL - url used for update
+	*	@type: public
+	*/
+function dataProcessor(serverProcessorURL){
+    this.serverProcessor = serverProcessorURL;
+    this.action_param="!nativeeditor_status";
+    
+	this.object = null;
+	this.updatedRows = []; //ids of updated rows
+	
+	this.autoUpdate = true;
+	this.updateMode = "cell";
+	this._tMode="GET"; 
+	this.post_delim = "_";
+	
+    this._waitMode=0;
+    this._in_progress={};//?
+    this._invalid={};
+    this.mandatoryFields=[];
+    this.messages=[];
+    
+    this.styles={
+    	updated:"font-weight:bold;",
+    	inserted:"font-weight:bold;",
+    	deleted:"text-decoration : line-through;",
+    	invalid:"background-color:FFE0E0;",
+    	invalid_cell:"border-bottom:2px solid red;",
+    	error:"color:red;",
+    	clear:"font-weight:normal;text-decoration:none;"
+    };
+    
+    this.enableUTFencoding(true);
+    dhtmlxEventable(this);
+
+    return this;
+    }
+
+dataProcessor.prototype={
+	/**
+	* 	@desc: select GET or POST transaction model
+	*	@param: mode - GET/POST
+	*	@param: total - true/false - send records row by row or all at once (for grid only)
+	*	@type: public
+	*/
+	setTransactionMode:function(mode,total){
+        this._tMode=mode;
+		this._tSend=total;
+    },
+    escape:function(data){
+    	if (this._utf)
+    		return encodeURIComponent(data);
+    	else
+        	return escape(data);
+	},
+    /**
+	* 	@desc: allows to set escaping mode
+	*	@param: true - utf based escaping, simple - use current page encoding
+	*	@type: public
+	*/	
+	enableUTFencoding:function(mode){
+        this._utf=convertStringToBoolean(mode);
+    },
+    /**
+	* 	@desc: allows to define, which column may trigger update
+	*	@param: val - array or list of true/false values
+	*	@type: public
+	*/
+	setDataColumns:function(val){
+		this._columns=(typeof val == "string")?val.split(","):val;
+    },
+    /**
+	* 	@desc: get state of updating
+	*	@returns:   true - all in sync with server, false - some items not updated yet.
+	*	@type: public
+	*/
+	getSyncState:function(){
+		return !this.updatedRows.length;
+	},
+	/**
+	* 	@desc: enable/disable named field for data syncing, will use column ids for grid
+	*	@param:   mode - true/false
+	*	@type: public
+	*/
+	enableDataNames:function(mode){
+		this._endnm=convertStringToBoolean(mode);
+	},
+	/**
+	* 	@desc: enable/disable mode , when only changed fields and row id send to the server side, instead of all fields in default mode
+	*	@param:   mode - true/false
+	*	@type: public
+	*/
+	enablePartialDataSend:function(mode){
+		this._changed=convertStringToBoolean(mode);
+	},
+	/**
+	* 	@desc: set if rows should be send to server automaticaly
+	*	@param: mode - "row" - based on row selection changed, "cell" - based on cell editing finished, "off" - manual data sending
+	*	@type: public
+	*/
+	setUpdateMode:function(mode,dnd){
+		this.autoUpdate = (mode=="cell");
+		this.updateMode = mode;
+		this.dnd=dnd;
+	},
+	ignore:function(code,master){
+		this._silent_mode=true;
+		code.call(master||window);
+		this._silent_mode=false;
+	},
+	/**
+	* 	@desc: mark row as updated/normal. check mandatory fields,initiate autoupdate (if turned on)
+	*	@param: rowId - id of row to set update-status for
+	*	@param: state - true for "updated", false for "not updated"
+	*	@param: mode - update mode name
+	*	@type: public
+	*/
+	setUpdated:function(rowId,state,mode){
+		if (this._silent_mode) return;
+		var ind=this.findRow(rowId);
+		
+		mode=mode||"updated";
+		var existing = this.obj.getUserData(rowId,this.action_param);
+		if (existing && mode == "updated") mode=existing;
+		if (state){
+			this.set_invalid(rowId,false); //clear previous error flag
+			this.updatedRows[ind]=rowId;
+			this.obj.setUserData(rowId,this.action_param,mode);
+			if (this._in_progress[rowId]) 
+				this._in_progress[rowId]="wait";
+		} else{
+			if (!this.is_invalid(rowId)){
+				this.updatedRows.splice(ind,1);
+				this.obj.setUserData(rowId,this.action_param,"");
+			}
+		}
+
+		//clear changed flag
+		if (!state)
+			this._clearUpdateFlag(rowId);
+     			
+		this.markRow(rowId,state,mode);
+		if (state && this.autoUpdate) this.sendData(rowId);
+	},
+	_clearUpdateFlag:function(id){},
+	markRow:function(id,state,mode){ 
+		var str="";
+		var invalid=this.is_invalid(id);
+		if (invalid){
+        	str=this.styles[invalid];
+        	state=true;
+    	}
+		if (this.callEvent("onRowMark",[id,state,mode,invalid])){
+			//default logic
+			str=this.styles[state?mode:"clear"]+str;
+			
+        	this.obj[this._methods[0]](id,str);
+
+			if (invalid && invalid.details){
+				str+=this.styles[invalid+"_cell"];
+				for (var i=0; i < invalid.details.length; i++)
+					if (invalid.details[i])
+        				this.obj[this._methods[1]](id,i,str);
+			}
+		}
+	},
+	getState:function(id){
+		return this.obj.getUserData(id,this.action_param);
+	},
+	is_invalid:function(id){
+		return this._invalid[id];
+	},
+	set_invalid:function(id,mode,details){ 
+		if (details) mode={value:mode, details:details, toString:function(){ return this.value.toString(); }};
+		this._invalid[id]=mode;
+	},
+	/**
+	* 	@desc: check mandatory fields and varify values of cells, initiate update (if specified)
+	*	@param: rowId - id of row to set update-status for
+	*	@type: public
+	*/
+	checkBeforeUpdate:function(rowId){ 
+		return true;
+	},
+	/**
+	* 	@desc: send row(s) values to server
+	*	@param: rowId - id of row which data to send. If not specified, then all "updated" rows will be send
+	*	@type: public
+	*/
+	sendData:function(rowId){
+		if (this._waitMode && (this.obj.mytype=="tree" || this.obj._h2)) return;
+		if (this.obj.editStop) this.obj.editStop();
+	
+		
+		if(typeof rowId == "undefined" || this._tSend) return this.sendAllData();
+		if (this._in_progress[rowId]) return false;
+		
+		this.messages=[];
+		if (!this.checkBeforeUpdate(rowId) && this.callEvent("onValidatationError",[rowId,this.messages])) return false;
+		this._beforeSendData(this._getRowData(rowId),rowId);
+    },
+    _beforeSendData:function(data,rowId){
+    	if (!this.callEvent("onBeforeUpdate",[rowId,this.getState(rowId),data])) return false;	
+		this._sendData(data,rowId);
+    },
+    serialize:function(data, id){
+    	if (typeof data == "string")
+    		return data;
+    	if (typeof id != "undefined")
+    		return this.serialize_one(data,"");
+    	else{
+    		var stack = [];
+    		var keys = [];
+    		for (var key in data)
+    			if (data.hasOwnProperty(key)){
+    				stack.push(this.serialize_one(data[key],key+this.post_delim));
+    				keys.push(key);
+				}
+    		stack.push("ids="+this.escape(keys.join(",")));
+    		return stack.join("&");
+    	}
+    },
+    serialize_one:function(data, pref){
+    	if (typeof data == "string")
+    		return data;
+    	var stack = [];
+    	for (var key in data)
+    		if (data.hasOwnProperty(key))
+    			stack.push(this.escape((pref||"")+key)+"="+this.escape(data[key]));
+		return stack.join("&");
+    },
+    _sendData:function(a1,rowId){
+    	if (!a1) return; //nothing to send
+		if (!this.callEvent("onBeforeDataSending",rowId?[rowId,this.getState(rowId),a1]:[null, null, a1])) return false;				
+		
+    	if (rowId)
+			this._in_progress[rowId]=(new Date()).valueOf();
+		var a2=new dtmlXMLLoaderObject(this.afterUpdate,this,true);
+		
+		var a3 = this.serverProcessor+(this._user?(getUrlSymbol(this.serverProcessor)+["dhx_user="+this._user,"dhx_version="+this.obj.getUserData(0,"version")].join("&")):"");
+
+		if (this._tMode!="POST")
+        	a2.loadXML(a3+((a3.indexOf("?")!=-1)?"&":"?")+this.serialize(a1,rowId));
+		else
+        	a2.loadXML(a3,true,this.serialize(a1,rowId));
+
+		this._waitMode++;
+    },
+	sendAllData:function(){
+		if (!this.updatedRows.length) return;			
+
+		this.messages=[]; var valid=true;
+		for (var i=0; i<this.updatedRows.length; i++)
+			valid&=this.checkBeforeUpdate(this.updatedRows[i]);
+		if (!valid && !this.callEvent("onValidatationError",["",this.messages])) return false;
+	
+		if (this._tSend) 
+			this._sendData(this._getAllData());
+		else
+			for (var i=0; i<this.updatedRows.length; i++)
+				if (!this._in_progress[this.updatedRows[i]]){
+					if (this.is_invalid(this.updatedRows[i])) continue;
+					this._beforeSendData(this._getRowData(this.updatedRows[i]),this.updatedRows[i]);
+					if (this._waitMode && (this.obj.mytype=="tree" || this.obj._h2)) return; //block send all for tree
+				}
+	},
+    
+	
+	
+	
+	
+	
+	
+	
+	_getAllData:function(rowId){
+		var out={};
+		var has_one = false;
+		for(var i=0;i<this.updatedRows.length;i++){
+			var id=this.updatedRows[i];
+			if (this._in_progress[id] || this.is_invalid(id)) continue;
+			if (!this.callEvent("onBeforeUpdate",[id,this.getState(id)])) continue;	
+			out[id]=this._getRowData(id,id+this.post_delim);
+			has_one = true;
+			this._in_progress[id]=(new Date()).valueOf();
+		}
+		return has_one?out:null;
+	},
+	
+	
+	/**
+	* 	@desc: specify column which value should be varified before sending to server
+	*	@param: ind - column index (0 based)
+	*	@param: verifFunction - function (object) which should verify cell value (if not specified, then value will be compared to empty string). Two arguments will be passed into it: value and column name
+	*	@type: public
+	*/
+	setVerificator:function(ind,verifFunction){
+		this.mandatoryFields[ind] = verifFunction||(function(value){return (value!="");});
+	},
+	/**
+	* 	@desc: remove column from list of those which should be verified
+	*	@param: ind - column Index (0 based)
+	*	@type: public
+	*/
+	clearVerificator:function(ind){
+		this.mandatoryFields[ind] = false;
+	},
+	
+	
+	
+	
+	
+	findRow:function(pattern){
+		var i=0;
+    	for(i=0;i<this.updatedRows.length;i++)
+		    if(pattern==this.updatedRows[i]) break;
+	    return i;
+    },
+
+   
+	
+
+
+    
+
+
+
+
+
+	/**
+	* 	@desc: define custom actions
+	*	@param: name - name of action, same as value of action attribute
+	*	@param: handler - custom function, which receives a XMl response content for action
+	*	@type: private
+	*/
+	defineAction:function(name,handler){
+        if (!this._uActions) this._uActions=[];
+            this._uActions[name]=handler;
+	},
+
+
+
+
+	/**
+*     @desc: used in combination with setOnBeforeUpdateHandler to create custom client-server transport system
+*     @param: sid - id of item before update
+*     @param: tid - id of item after up0ate
+*     @param: action - action name
+*     @type: public
+*     @topic: 0
+*/
+	afterUpdateCallback:function(sid, tid, action, btag) {
+		var marker = sid;
+		var correct=(action!="error" && action!="invalid");
+		if (!correct) this.set_invalid(sid,action);
+		if ((this._uActions)&&(this._uActions[action])&&(!this._uActions[action](btag))) 
+			return (delete this._in_progress[marker]);
+			
+		if (this._in_progress[marker]!="wait")
+	    	this.setUpdated(sid, false);
+	    	
+	    var soid = sid;
+	
+	    switch (action) {
+	    case "inserted":
+	    case "insert":
+	        if (tid != sid) {
+	            this.obj[this._methods[2]](sid, tid);
+	            sid = tid;
+	        }
+	        break;
+	    case "delete":
+	    case "deleted":
+	    	this.obj.setUserData(sid, this.action_param, "true_deleted");
+	        this.obj[this._methods[3]](sid);
+	        delete this._in_progress[marker];
+	        return this.callEvent("onAfterUpdate", [sid, action, tid, btag]);
+	        break;
+	    }
+	    
+	    if (this._in_progress[marker]!="wait"){
+	    	if (correct) this.obj.setUserData(sid, this.action_param,'');
+	    	delete this._in_progress[marker];
+    	} else {
+    		delete this._in_progress[marker];
+    		this.setUpdated(tid,true,this.obj.getUserData(sid,this.action_param));
+		}
+	    
+	    this.callEvent("onAfterUpdate", [sid, action, tid, btag]);
+	},
+
+	/**
+	* 	@desc: response from server
+	*	@param: xml - XMLLoader object with response XML
+	*	@type: private
+	*/
+	afterUpdate:function(that,b,c,d,xml){
+		xml.getXMLTopNode("data"); //fix incorrect content type in IE
+		if (!xml.xmlDoc.responseXML) return;
+		var atag=xml.doXPath("//data/action");
+		for (var i=0; i<atag.length; i++){
+        	var btag=atag[i];
+			var action = btag.getAttribute("type");
+			var sid = btag.getAttribute("sid");
+			var tid = btag.getAttribute("tid");
+			
+			that.afterUpdateCallback(sid,tid,action,btag);
+		}
+		that.finalizeUpdate();
+	},
+	finalizeUpdate:function(){
+		if (this._waitMode) this._waitMode--;
+		
+		if ((this.obj.mytype=="tree" || this.obj._h2) && this.updatedRows.length) 
+			this.sendData();
+		this.callEvent("onAfterUpdateFinish",[]);
+		if (!this.updatedRows.length)
+			this.callEvent("onFullSync",[]);
+	},
+
+
+
+
+	
+	/**
+	* 	@desc: initializes data-processor
+	*	@param: anObj - dhtmlxGrid object to attach this data-processor to
+	*	@type: public
+	*/
+	init:function(anObj){
+		this.obj = anObj;
+		if (this.obj._dp_init) 
+			this.obj._dp_init(this);
+	},
+	
+	
+	setOnAfterUpdate:function(ev){
+		this.attachEvent("onAfterUpdate",ev);
+	},
+	enableDebug:function(mode){
+	},
+	setOnBeforeUpdateHandler:function(func){  
+		this.attachEvent("onBeforeDataSending",func);
+	},
+
+
+
+	/*! starts autoupdate mode
+		@param interval
+			time interval for sending update requests
+	*/
+	setAutoUpdate: function(interval, user) {
+		interval = interval || 2000;
+		
+		this._user = user || (new Date()).valueOf();
+		this._need_update = false;
+		this._loader = null;
+		this._update_busy = false;
+		
+		this.attachEvent("onAfterUpdate",function(sid,action,tid,xml_node){
+			this.afterAutoUpdate(sid, action, tid, xml_node);
+		});
+		this.attachEvent("onFullSync",function(){
+			this.fullSync();
+		});
+		
+		var self = this;
+		window.setInterval(function(){
+			self.loadUpdate();
+		}, interval);
+	},
+
+
+	/*! process updating request answer
+		if status == collision version is depricated
+		set flag for autoupdating immidiatly
+	*/
+	afterAutoUpdate: function(sid, action, tid, xml_node) {
+		if (action == 'collision') {
+			this._need_update = true;
+			return false;
+		} else {
+			return true;
+		}
+	},
+
+
+	/*! callback function for onFillSync event
+		call update function if it's need
+	*/
+	fullSync: function() {
+		if (this._need_update == true) {
+			this._need_update = false;
+			this.loadUpdate();
+		}
+		return true;
+	},
+
+
+	/*! sends query to the server and call callback function
+	*/
+	getUpdates: function(url,callback){
+		if (this._update_busy) 
+			return false;
+		else
+			this._update_busy = true;
+		
+		this._loader = this._loader || new dtmlXMLLoaderObject(true);
+		
+		this._loader.async=true;
+		this._loader.waitCall=callback;
+		this._loader.loadXML(url);
+	},
+
+
+	/*! returns xml node value
+		@param node
+			xml node
+	*/
+	_v: function(node) {
+		if (node.firstChild) return node.firstChild.nodeValue;
+		return "";
+	},
+
+
+	/*! returns values array of xml nodes array
+		@param arr
+			array of xml nodes
+	*/
+	_a: function(arr) {
+		var res = [];
+		for (var i=0; i < arr.length; i++) {
+			res[i]=this._v(arr[i]);
+		};
+		return res;
+	},
+
+
+	/*! loads updates and processes them
+	*/
+	loadUpdate: function(){
+		var self = this;
+		var version = this.obj.getUserData(0,"version");
+		var url = this.serverProcessor+getUrlSymbol(this.serverProcessor)+["dhx_user="+this._user,"dhx_version="+version].join("&");
+		url = url.replace("editing=true&","");
+		this.getUpdates(url, function(){
+			var vers = self._loader.doXPath("//userdata");
+			self.obj.setUserData(0,"version",self._v(vers[0]));
+			
+			var upds = self._loader.doXPath("//update");
+			if (upds.length){
+				self._silent_mode = true;
+				
+				for (var i=0; i<upds.length; i++) {
+					var status = upds[i].getAttribute('status');
+					var id = upds[i].getAttribute('id');
+					var parent = upds[i].getAttribute('parent');
+					switch (status) {
+						case 'inserted':
+							self.callEvent("insertCallback",[upds[i], id, parent]);
+							break;
+						case 'updated':
+							self.callEvent("updateCallback",[upds[i], id, parent]);
+							break;
+						case 'deleted':
+							self.callEvent("deleteCallback",[upds[i], id, parent]);
+							break;
+					}
+				}
+				
+				self._silent_mode = false;
+			}
+			
+			self._update_busy = false;
+			self = null;
+		});
+	}
+
+};
+
+//(c)dhtmlx ltd. www.dhtmlx.com
+dataProcessor.prototype._o_init = dataProcessor.prototype.init;
+dataProcessor.prototype.init=function(obj){
+    this._console=this._console||this._createConsole();
+    this.attachEvent("onValidatationError",function(rowId){
+    	this._log("Validation error for ID="+(rowId||"[multiple]"));
+    	return true;
+	});
+    return this._o_init(obj);
+}
+
+dataProcessor.prototype._createConsole=function(){
+    var c=document.createElement("DIV");
+    c.style.cssText='width:450px; height:420px; overflow:auto; position:absolute; z-index:99999; background-color:white; top:0px; right:0px; border:1px dashed black; font-family:Tahoma; Font-size:10pt;';
+    c.innerHTML="<div style='width:100%; background-color:gray; font-weight:bold; color:white;'><span style='cursor:pointer;float:right;' onclick='this.parentNode.parentNode.style.display=\"none\"'><sup>[close]&nbsp;</sup></span><span style='cursor:pointer;float:right;' onclick='this.parentNode.parentNode.childNodes[2].innerHTML=\"\"'><sup>[clear]&nbsp;</sup></span>&nbsp;DataProcessor</div><div style='width:100%; height:200px; overflow-Y:scroll;'>&nbsp;Current state</div><div style='width:100%; height:200px; overflow-Y:scroll;'>&nbsp;Log:</div>";
+    if (document.body) document.body.insertBefore(c,document.body.firstChild);
+    else dhtmlxEvent(window,"load",function(){
+        document.body.insertBefore(c,document.body.firstChild);
+    })    
+    dhtmlxEvent(window,"dblclick",function(){ 
+        c.style.display='';
+    })    
+    return c;
+}
+
+dataProcessor.prototype._error=function(data){
+	this._log("<span style='color:red'>"+data+"</span>");
+}
+dataProcessor.prototype._log=function(data){
+	var div=document.createElement("DIV");
+	div.innerHTML = data;
+	var parent=this._console.childNodes[2];
+    parent.appendChild(div);
+    parent.scrollTop=parent.scrollHeight;
+    
+    if (window.console && window.console.log)
+    	window.console.log("DataProcessor :: "+data.replace("&nbsp;"," ").replace("<b>","").replace("</b>",""));
+    
+}
+dataProcessor.prototype._updateStat=function(data){
+    var data=["&nbsp;Current state"];
+    for(var i=0;i<this.updatedRows.length;i++)
+	    data.push("&nbsp;ID:"+this.updatedRows[i]+" Status: "+(this.obj.getUserData(this.updatedRows[i],"!nativeeditor_status")||"updated")+", "+(this.is_invalid(this.updatedRows[i])||"valid"))
+	this._console.childNodes[1].innerHTML=data.join("<br/>")+"<hr/>Current mode: "+this.updateMode;
+}
+dataProcessor.prototype.xml_analize=function(xml){
+	if (_isFF){
+		if (!xml.xmlDoc.responseXML)
+			this._error("Not an XML, probably incorrect content type specified ( must be text/xml ), or some text output was started before XML data");
+		else if (xml.xmlDoc.responseXML.firstChild.tagName=="parsererror")
+			this._error(xml.xmlDoc.responseXML.firstChild.textContent);
+		else return true;
+	} else if (_isIE){
+		if (xml.xmlDoc.responseXML.parseError.errorCode)
+			this._error("XML error : "+xml.xmlDoc.responseXML.parseError.reason);
+		else if (!xml.xmlDoc.responseXML.documentElement) 
+			this._error("Not an XML, probably incorrect content type specified ( must be text/xml ), or some text output was started before XML data");
+		else return true;
+	}
+	return false;
+}
+
+dataProcessor.wrap=function(name,before,after){
+	var d=dataProcessor.prototype;
+	if (!d._wrap) d._wrap={};
+	d._wrap[name]=d[name];
+	d[name]=function(){
+		if (before) before.apply(this,arguments);
+		var res=d._wrap[name].apply(this,arguments);
+		if (after) after.apply(this,[arguments,res]);
+		return res;
+	}
+};
+
+dataProcessor.wrap("setUpdated",function(rowId,state,mode){
+	this._log("&nbsp;row <b>"+rowId+"</b> "+(state?"marked":"unmarked")+" ["+(mode||"updated")+","+(this.is_invalid(rowId)||"valid")+"]");
+},function(){
+	this._updateStat();
+});
+
+
+
+dataProcessor.wrap("sendData",function(rowId){
+	if (rowId){
+		this._log("&nbsp;Initiating data sending for <b>"+rowId+"</b>");
+		if (this.obj.mytype=="tree"){
+        	if (!this.obj._idpull[rowId])
+	    		this._log("&nbsp;Error! item with such ID not exists <b>"+rowId+"</b>");
+		} else {
+			if (!this.obj.rowsAr[rowId])
+	        	this._log("&nbsp;Error! row with such ID not exists <b>"+rowId+"</b>");
+        }
+	}
+},function(){
+	
+});
+
+dataProcessor.wrap("sendAllData",function(){
+	this._log("&nbsp;Initiating data sending for <b>all</b> rows ");
+},function(){
+	
+});
+dataProcessor.logSingle=function(data,id){
+	var tdata = {};
+	if (id)
+		tdata[id] = data;
+	else
+		tdata = data;
+		
+	var url = [];
+	for (var key in tdata) {
+		url.push("<fieldset><legend>"+key+"</legend>");
+		var suburl = [];
+		
+		for (var ikey in tdata[key])
+			suburl.push(ikey+" = "+tdata[key][ikey]);
+
+		url.push(suburl.join("<br>"));
+		url.push("</fieldset>");
+	}
+	return url.join("");
+}
+dataProcessor.wrap("_sendData",function(data,rowId){
+	if (rowId)
+		this._log("&nbsp;Sending in one-by-one mode, current ID = "+rowId);
+	else
+		this._log("&nbsp;Sending all data at once");
+	this._log("&nbsp;Server url: "+this.serverProcessor+" <a onclick='this.parentNode.nextSibling.firstChild.style.display=\"block\"' href='#'>parameters</a>");
+	var url = [];
+	this._log("<blockquote style='display:none;'>"+dataProcessor.logSingle(data,rowId)+"<blockquote>");
+},function(){
+	
+});
+
+
+dataProcessor.wrap("afterUpdate",function(that,b,c,d,xml){
+	that._log("&nbsp;Server response received <a onclick='this.nextSibling.style.display=\"block\"' href='#'>details</a><blockquote style='display:none'><code>"+(xml.xmlDoc.responseText||"").replace(/\&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")+"</code></blockquote>");			
+	if (!that.xml_analize(xml)) return;
+	var atag=xml.doXPath("//data/action");
+	if (!atag){
+		that._log("&nbsp;No actions found");
+		var atag=xml.getXMLTopNode("data");
+		if (!atag) that._log("&nbsp;XML not valid");
+		else that._log("&nbsp;Incorrect content type - need to be text/xml"); 
+	}
+},function(){
+	
+});
+
+dataProcessor.wrap("afterUpdateCallback",function(sid,tid,action){
+	if (this.obj.mytype=="tree"){
+		if (!this.obj._idpull[sid]) this._log("Incorrect SID, item with such ID not exists in grid");
+	} else {
+		if (!this.obj.rowsAr[sid]) this._log("Incorrect SID, row with such ID not exists in grid");
+	}
+	this._log("&nbsp;Action: "+action+" SID:"+sid+" TID:"+tid);
+},function(){
+	
+});
+
+
+
+
+
+
+
+/*
+	dhx_sort[index]=direction
+	dhx_filter[index]=mask
+*/
+if (window.dhtmlXGridObject){
+	dhtmlXGridObject.prototype._init_point_connector=dhtmlXGridObject.prototype._init_point;
+	dhtmlXGridObject.prototype._init_point=function(){
+		var clear_url=function(url){
+			url=url.replace(/(\?|\&)connector[^\f]*/g,"");
+			return url+(url.indexOf("?")!=-1?"&":"?")+"connector=true"+(mygrid.hdr.rows.length > 0 ? "&dhx_no_header=1":"");
+		};
+		var combine_urls=function(url){
+			return clear_url(url)+(this._connector_sorting||"")+(this._connector_filter||"");
+		};
+		var sorting_url=function(url,ind,dir){
+			this._connector_sorting="&dhx_sort["+ind+"]="+dir;
+			return combine_urls.call(this,url);
+		};
+		var filtering_url=function(url,inds,vals){
+			for (var i=0; i<inds.length; i++)
+				inds[i]="dhx_filter["+inds[i]+"]="+encodeURIComponent(vals[i]);
+			this._connector_filter="&"+inds.join("&");
+			return combine_urls.call(this,url);
+		};
+		this.attachEvent("onCollectValues",function(ind){
+			if (this._con_f_used[ind]){
+				if (typeof(this._con_f_used[ind]) == "object")
+					return this._con_f_used[ind];
+				else
+					return false;
+			}
+			return true;
+		});	
+		this.attachEvent("onDynXLS",function(){
+				this.xmlFileUrl=combine_urls.call(this,this.xmlFileUrl);
+				return true;
+		});				
+		this.attachEvent("onBeforeSorting",function(ind,type,dir){
+			if (type=="connector"){
+				var self=this;
+				this.clearAndLoad(sorting_url.call(this,this.xmlFileUrl,ind,dir),function(){
+					self.setSortImgState(true,ind,dir);
+				});
+				return false;
+			}
+			return true;
+		});
+		this.attachEvent("onFilterStart",function(a,b){
+			if (this._con_f_used.length){
+				this.clearAndLoad(filtering_url.call(this,this.xmlFileUrl,a,b));
+				return false;
+			}
+			return true;
+		});
+		this.attachEvent("onXLE",function(a,b,c,xml){
+			if (!xml) return;
+		});
+		
+		if (this._init_point_connector) this._init_point_connector();
+	};
+	dhtmlXGridObject.prototype._con_f_used=[];
+	dhtmlXGridObject.prototype._in_header_connector_text_filter=function(t,i){
+		if (!this._con_f_used[i])
+			this._con_f_used[i]=1;
+		return this._in_header_text_filter(t,i);
+	};
+	dhtmlXGridObject.prototype._in_header_connector_select_filter=function(t,i){
+		if (!this._con_f_used[i])
+			this._con_f_used[i]=2;
+		return this._in_header_select_filter(t,i);
+	};
+	dhtmlXGridObject.prototype.load_connector=dhtmlXGridObject.prototype.load;
+	dhtmlXGridObject.prototype.load=function(url, call, type){
+		if (!this._colls_loaded && this.cellType){
+			var ar=[];
+			for (var i=0; i < this.cellType.length; i++)
+				if (this.cellType[i].indexOf("co")==0 || this._con_f_used[i]==2) ar.push(i);
+			if (ar.length)
+				arguments[0]+=(arguments[0].indexOf("?")!=-1?"&":"?")+"connector=true&dhx_colls="+ar.join(",");
+		}
+		return this.load_connector.apply(this,arguments);
+	};
+	dhtmlXGridObject.prototype._parseHead_connector=dhtmlXGridObject.prototype._parseHead;
+	dhtmlXGridObject.prototype._parseHead=function(url, call, type){
+		this._parseHead_connector.apply(this,arguments);
+		if (!this._colls_loaded){
+			var cols = this.xmlLoader.doXPath("./coll_options", arguments[0]);
+			for (var i=0; i < cols.length; i++){
+				var f = cols[i].getAttribute("for");
+				var v = [];
+				var combo=null;
+				if (this.cellType[f] == "combo")
+					combo = this.getColumnCombo(f);
+				if (this.cellType[f].indexOf("co")==0)
+					combo=this.getCombo(f);
+					
+				var os = this.xmlLoader.doXPath("./item",cols[i]);
+				for (var j=0; j<os.length; j++){
+					var val=os[j].getAttribute("value");
+					
+					if (combo){
+						var lab=os[j].getAttribute("label")||val;
+						
+						if (combo.addOption)
+							combo.addOption([[val, lab]]);
+						else
+							combo.put(val,lab);
+							
+						v[v.length]=lab;
+					} else
+						v[v.length]=val;
+				}
+				if (this._con_f_used[f*1])
+					this._con_f_used[f*1]=v;
+			};
+			this._colls_loaded=true;
+		}
+	};	
+	
+	
+	
+
+}
+
+if (window.dataProcessor){
+	dataProcessor.prototype.init_original=dataProcessor.prototype.init;
+	dataProcessor.prototype.init=function(obj){
+		this.init_original(obj);
+		obj._dataprocessor=this;
+		
+		this.setTransactionMode("POST",true);
+		this.serverProcessor+=(this.serverProcessor.indexOf("?")!=-1?"&":"?")+"editing=true";
+	};
+};
+dhtmlxError.catchError("LoadXML",function(a,b,c){
+	alert(c[0].responseText);
+});
+
+window.dhtmlXScheduler=window.scheduler={version:2.2};
+dhtmlxEventable(scheduler);
+scheduler.init=function(id,date,mode){
+	date=date||(new Date());
+	mode=mode||"week";
+	
+	this._obj=(typeof id == "string")?document.getElementById(id):id;
+	this._els=[];
+	this._scroll=true;
+	this._quirks=(_isIE && document.compatMode == "BackCompat");
+	this._quirks7=(_isIE && navigator.appVersion.indexOf("MSIE 8")==-1);
+	
+	this.get_elements();
+	this.init_templates();
+	this.set_actions();
+	dhtmlxEvent(window,"resize",function(){
+		window.clearTimeout(scheduler._resize_timer);
+		scheduler._resize_timer=window.setTimeout(function(){
+			if (scheduler.callEvent("onSchedulerResize",[]))
+				scheduler.update_view();
+		}, 100);
+	})
+	
+	this.set_sizes();
+	this.setCurrentView(date,mode);
+};
+scheduler.xy={
+	nav_height:22,
+	min_event_height:40,
+	scale_width:50,
+	bar_height:20,
+	scroll_width:18,
+	scale_height:20,
+	month_scale_height:20,
+	menu_width:25,
+	margin_top:0,
+	margin_left:0,
+	editor_width:140
+};
+scheduler.keys={
+	edit_save:13,
+	edit_cancel:27
+};
+scheduler.set_sizes=function(){
+	var w = this._x = this._obj.clientWidth-this.xy.margin_left;
+	var h = this._y = this._obj.clientHeight-this.xy.margin_top;
+	
+	//not-table mode always has scroll - need to be fixed in future
+	var scale_x=this._table_view?0:(this.xy.scale_width+this.xy.scroll_width);
+	var scale_s=this._table_view?-1:this.xy.scale_width;
+	
+	this.set_xy(this._els["dhx_cal_navline"][0],w,this.xy.nav_height,0,0);
+	this.set_xy(this._els["dhx_cal_header"][0],w-scale_x,this.xy.scale_height,scale_s,this.xy.nav_height+(this._quirks?-1:1));
+	//to support alter-skin, we need a way to alter height directly from css
+	var actual_height = this._els["dhx_cal_navline"][0].offsetHeight;
+	if (actual_height > 0) this.xy.nav_height = actual_height;
+	
+	var data_y=this.xy.scale_height+this.xy.nav_height+(this._quirks?-2:0);
+	this.set_xy(this._els["dhx_cal_data"][0],w,h-(data_y+2),0,data_y+2);
+}
+scheduler.set_xy=function(node,w,h,x,y){
+	node.style.width=Math.max(0,w)+"px";
+	node.style.height=Math.max(0,h)+"px";
+	if (arguments.length>3){
+		node.style.left=x+"px";
+		node.style.top=y+"px";	
+	}
+}
+scheduler.get_elements=function(){
+	//get all child elements as named hash
+	var els=this._obj.getElementsByTagName("DIV");
+	for (var i=0; i < els.length; i++){
+		var name=els[i].className;
+		if (!this._els[name]) this._els[name]=[];
+		this._els[name].push(els[i]);
+		
+		//check if name need to be changed
+		var t=scheduler.locale.labels[els[i].getAttribute("name")||name];
+		if (t) els[i].innerHTML=t;
+	}
+}
+scheduler.set_actions=function(){
+	for (var a in this._els)
+		if (this._click[a])
+			for (var i=0; i < this._els[a].length; i++)
+				this._els[a][i].onclick=scheduler._click[a];
+	this._obj.onselectstart=function(e){ return false; }
+	this._obj.onmousemove=function(e){
+		scheduler._on_mouse_move(e||event);
+	}
+	this._obj.onmousedown=function(e){
+		scheduler._on_mouse_down(e||event);
+	}
+	this._obj.onmouseup=function(e){
+		scheduler._on_mouse_up(e||event);
+	}
+	this._obj.ondblclick=function(e){
+		scheduler._on_dbl_click(e||event);
+	}
+}
+scheduler.select=function(id){
+	if (this._table_view || !this.getEvent(id)._timed) return; //temporary block
+	if (this._select_id==id) return;
+	this.editStop(false);
+	this.unselect();
+	this._select_id = id;
+	this.updateEvent(id);
+}
+scheduler.unselect=function(id){
+	if (id && id!=this._select_id) return;
+	var t=this._select_id;
+	this._select_id = null;
+	if (t) this.updateEvent(t);
+}
+scheduler.getState=function(){
+	return {
+		mode: this._mode,
+		date: this._date,
+		min_date: this._min_date,
+		max_date: this._max_date,
+		editor_id: this._edit_id,
+		lightbox_id: this._lightbox_id
+	};
+}
+scheduler._click={
+	dhx_cal_data:function(e){
+		var trg = e?e.target:event.srcElement;
+		var id = scheduler._locate_event(trg);
+		
+		e = e || event;
+		if ((id && !scheduler.callEvent("onClick",[id,e])) ||scheduler.config.readonly) return;
+		
+		if (id) {		
+			scheduler.select(id);
+			var mask = trg.className;
+			if (mask.indexOf("_icon")!=-1)
+				scheduler._click.buttons[mask.split(" ")[1].replace("icon_","")](id);
+		} else
+			scheduler._close_not_saved();
+	},
+	dhx_cal_prev_button:function(){
+		scheduler._click.dhx_cal_next_button(0,-1);
+	},
+	dhx_cal_next_button:function(dummy,step){
+		scheduler.setCurrentView(scheduler.date.add( //next line changes scheduler._date , but seems it has not side-effects
+			scheduler.date[scheduler._mode+"_start"](scheduler._date),(step||1),scheduler._mode));
+	},
+	dhx_cal_today_button:function(){
+		scheduler.setCurrentView(new Date());
+	},
+	dhx_cal_tab:function(){
+		var mode = this.getAttribute("name").split("_")[0];
+		scheduler.setCurrentView(scheduler._date,mode);
+	},
+	buttons:{
+		"delete":function(id){ var c=scheduler.locale.labels.confirm_deleting; if (!c||confirm(c)) scheduler.deleteEvent(id); },
+		edit:function(id){ scheduler.edit(id); },
+		save:function(id){ scheduler.editStop(true); },
+		details:function(id){ scheduler.showLightbox(id); },
+		cancel:function(id){ scheduler.editStop(false); }
+	}
+}
+
+scheduler.addEventNow=function(start,end,e){
+	var base = {};
+	if (typeof start == "object"){
+		base = start;
+		start = null;
+	}
+	
+	var d = (this.config.event_duration||this.config.time_step)*60000;
+	if (!start) start = Math.round((new Date()).valueOf()/d)*d;
+	var start_date = new Date(start);
+	if (!end){
+		var start_hour = this.config.first_hour;
+		if (start_hour > start_date.getHours()){
+			start_date.setHours(start_hour);
+			start = start_date.valueOf();
+		}
+		end = start+d;
+	}
+	
+	
+	base.start_date = base.start_date||start_date;
+	base.end_date =  base.end_date||new Date(end);
+	base.text = base.text||this.locale.labels.new_event;
+	base.id = this._drag_id = this.uid();
+	this._drag_mode="new-size";
+	
+	this._loading=true;
+	this.addEvent(base);
+	this.callEvent("onEventCreated",[this._drag_id,e]);
+	this._loading=false;
+	
+	this._drag_event={}; //dummy , to trigger correct event updating logic
+	this._on_mouse_up(e);	
+}
+scheduler._on_dbl_click=function(e,src){
+	src = src||(e.target||e.srcElement);
+	if (this.config.readonly) return;
+	var name = src.className.split(" ")[0];
+	switch(name){
+		case "dhx_scale_holder":
+		case "dhx_scale_holder_now":
+		case "dhx_month_body":
+			if (!scheduler.config.dblclick_create) break;
+			var pos=this._mouse_coords(e);
+			var start=this._min_date.valueOf()+(pos.y*this.config.time_step+(this._table_view?0:pos.x)*24*60)*60000;
+			start = this._correct_shift(start);
+			this.addEventNow(start,null,e);
+			break;
+		case "dhx_body":
+		case "dhx_cal_event_line":
+		case "dhx_cal_event_clear":
+			var id = this._locate_event(src);
+			if (!this.callEvent("onDblClick",[id,e])) return;
+			if (this.config.details_on_dblclick || this._table_view || !this.getEvent(id)._timed)
+				this.showLightbox(id);
+			else
+				this.edit(id);
+			break;
+		case "":
+			if (src.parentNode)
+				return scheduler._on_dbl_click(e,src.parentNode);			
+		default:
+			var t = this["dblclick_"+name];
+			if (t) t.call(this,e);
+			break;
+	}
+}
+
+scheduler._mouse_coords=function(ev){
+	var pos;
+	var b=document.body;
+	var d = document.documentElement;
+	if(ev.pageX || ev.pageY)
+	    pos={x:ev.pageX, y:ev.pageY};
+	else pos={
+	    x:ev.clientX + (b.scrollLeft||d.scrollLeft||0) - b.clientLeft,
+	    y:ev.clientY + (b.scrollTop||d.scrollTop||0) - b.clientTop
+	}
+
+	//apply layout
+	pos.x-=getAbsoluteLeft(this._obj)+(this._table_view?0:this.xy.scale_width);
+	pos.y-=getAbsoluteTop(this._obj)+this.xy.nav_height+(this._dy_shift||0)+this.xy.scale_height-this._els["dhx_cal_data"][0].scrollTop;
+	pos.ev = ev;
+	
+	var handler = this["mouse_"+this._mode];
+	if (handler)
+		return handler.call(this,pos);
+		
+	//transform to date
+	if (!this._table_view){
+		pos.x=Math.max(0,Math.ceil(pos.x/this._cols[0])-1);
+		pos.y=Math.max(0,Math.ceil(pos.y*60/(this.config.time_step*this.config.hour_size_px))-1)+this.config.first_hour*(60/this.config.time_step);
+	} else {
+		var dy=0;
+		for (dy=1; dy < this._colsS.heights.length; dy++)
+			if (this._colsS.heights[dy]>pos.y) break;
+
+		pos.y=(Math.max(0,Math.ceil(pos.x/this._cols[0])-1)+Math.max(0,dy-1)*7)*24*60/this.config.time_step; 
+		pos.x=0;
+	}
+
+	return pos;
+}
+scheduler._close_not_saved=function(){
+	if (new Date().valueOf()-(scheduler._new_event||0) > 500 && scheduler._edit_id){
+		var c=scheduler.locale.labels.confirm_closing;
+		if (!c || confirm(c))
+			scheduler.editStop(scheduler.config.positive_closing);
+	}
+}
+scheduler._correct_shift=function(start, back){
+	return start-=((new Date(scheduler._min_date)).getTimezoneOffset()-(new Date(start)).getTimezoneOffset())*60000*(back?-1:1);	
+}
+scheduler._on_mouse_move=function(e){
+	if (this._drag_mode){
+		var pos=this._mouse_coords(e);
+		if (!this._drag_pos || this._drag_pos.x!=pos.x || this._drag_pos.y!=pos.y){
+			
+			if (this._edit_id!=this._drag_id)
+				this._close_not_saved();
+				
+			this._drag_pos=pos;
+			
+			if (this._drag_mode=="create"){
+				this._close_not_saved();
+				this._loading=true; //will be ignored by dataprocessor
+				
+				var start=this._min_date.valueOf()+(pos.y*this.config.time_step+(this._table_view?0:pos.x)*24*60)*60000;
+				//if (this._mode != "week" && this._mode != "day")
+				start = this._correct_shift(start);
+				
+				if (!this._drag_start){
+					this._drag_start=start; return; 
+				}
+				var end = start;
+				if (end==this._drag_start) return;
+				
+				this._drag_id=this.uid();
+				this.addEvent(new Date(this._drag_start), new Date(end),this.locale.labels.new_event,this._drag_id, pos.fields);
+				
+				this.callEvent("onEventCreated",[this._drag_id,e]);
+				this._loading=false;
+				this._drag_mode="new-size";
+				
+			} 
+
+			var ev=this.getEvent(this._drag_id);
+			var start,end;
+			if (this._drag_mode=="move"){
+				start = this._min_date.valueOf()+(pos.y*this.config.time_step+pos.x*24*60)*60000;
+				if (!pos.custom && this._table_view) start+=this.date.time_part(ev.start_date)*1000;
+				start = this._correct_shift(start);
+				end = ev.end_date.valueOf()-(ev.start_date.valueOf()-start);
+			} else {
+				start = ev.start_date.valueOf();
+				if (this._table_view)
+					end = this._min_date.valueOf()+pos.y*this.config.time_step*60000 + (pos.custom?0:24*60*60000);
+				else{
+					end = this.date.date_part(new Date(ev.end_date)).valueOf()+pos.y*this.config.time_step*60000;
+					this._els["dhx_cal_data"][0].style.cursor="s-resize";
+					if (this._mode == "week" || this._mode == "day")
+						end = this._correct_shift(end);
+				}
+				if (this._drag_mode == "new-size"){ 
+					if (end <= this._drag_start){
+						var shift = pos.shift||((this._table_view && !pos.custom)?24*60*60000:0);
+						start = end-shift;
+						end = this._drag_start+(shift||(this.config.time_step*60000));
+					} else {
+						start = this._drag_start;
+					}
+					
+				} else if (end<=start) 
+					end=start+this.config.time_step*60000;
+			}
+			var new_end = new Date(end-1);			
+			var new_start = new Date(start);
+			//prevent out-of-borders situation for day|week view
+			if (this._table_view || (new_end.getDate()==new_start.getDate() && new_end.getHours()<this.config.last_hour)){
+				ev.start_date=new_start;
+				ev.end_date=new Date(end);
+				if (this.config.update_render)
+					this.update_view();
+				else
+					this.updateEvent(this._drag_id);
+			}
+			if (this._table_view)
+				this.for_rendered(this._drag_id,function(r){
+					r.className+=" dhx_in_move";
+				})
+		}
+	}  else {
+		if (scheduler.checkEvent("onMouseMove")){
+			var id = this._locate_event(e.target||e.srcElement);
+			this.callEvent("onMouseMove",[id,e]);
+		}
+	}
+}
+scheduler._on_mouse_context=function(e,src){
+	return this.callEvent("onContextMenu",[this._locate_event(src),e]);
+}
+scheduler._on_mouse_down=function(e,src){
+	if (this.config.readonly || this._drag_mode) return;
+	src = src||(e.target||e.srcElement);
+	if (e.button==2||e.ctrlKey) return this._on_mouse_context(e,src);
+		switch(src.className.split(" ")[0]){
+		case "dhx_cal_event_line":
+		case "dhx_cal_event_clear":
+			if (this._table_view)
+				this._drag_mode="move"; //item in table mode
+			break;
+		case "dhx_header":
+		case "dhx_title":
+			this._drag_mode="move"; //item in table mode
+			break;
+		case "dhx_footer":
+			this._drag_mode="resize"; //item in table mode
+			break;
+		case "dhx_scale_holder":
+		case "dhx_scale_holder_now":
+		case "dhx_month_body":
+		case "dhx_matrix_cell":
+			this._drag_mode="create";
+			break;
+		case "":
+			if (src.parentNode)
+				return scheduler._on_mouse_down(e,src.parentNode);
+		default:
+			this._drag_mode=null;
+			this._drag_id=null;
+	}
+	if (this._drag_mode){
+		var id = this._locate_event(src);
+		if (!this.config["drag_"+this._drag_mode] || !this.callEvent("onBeforeDrag",[id, this._drag_mode, e]))
+			this._drag_mode=this._drag_id=0;
+		else {
+			this._drag_id= id;
+			this._drag_event=this._copy_event(this.getEvent(this._drag_id)||{});
+		}
+	}
+	this._drag_start=null;
+}
+scheduler._on_mouse_up=function(e){
+	if (this._drag_mode && this._drag_id){
+		this._els["dhx_cal_data"][0].style.cursor="default";
+		//drop
+		var ev=this.getEvent(this._drag_id);
+		if (this._drag_event._dhx_changed || !this._drag_event.start_date || ev.start_date.valueOf()!=this._drag_event.start_date.valueOf() || ev.end_date.valueOf()!=this._drag_event.end_date.valueOf()){
+			var is_new=(this._drag_mode=="new-size");
+			if (!this.callEvent("onBeforeEventChanged",[ev,e,is_new])){
+				if (is_new) 
+					this.deleteEvent(ev.id, true);
+				else {
+					ev.start_date = this._drag_event.start_date;
+					ev.end_date = this._drag_event.end_date;
+					this.updateEvent(ev.id);
+				}
+			} else {
+				if (is_new && this.config.edit_on_create){
+					this.unselect();
+					this._new_event=new Date();//timestamp of creation
+					if (this._table_view || this.config.details_on_create) {
+						this._drag_mode=null;
+						return this.showLightbox(this._drag_id);
+					}
+					this._drag_pos=true; //set flag to trigger full redraw
+					this._select_id=this._edit_id=this._drag_id;
+				} else if (!this._new_event)
+					this.callEvent(is_new?"onEventAdded":"onEventChanged",[this._drag_id,this.getEvent(this._drag_id)]);
+			}
+		}
+		if (this._drag_pos) this.render_view_data(); //redraw even if there is no real changes - necessary for correct positioning item after drag
+	}
+	this._drag_mode=null;
+	this._drag_pos=null;
+}	
+scheduler.update_view=function(){
+	//this.set_sizes();
+	this._reset_scale();
+	if (this._load_mode && this._load()) return this._render_wait = true;
+	this.render_view_data();
+}
+scheduler.setCurrentView=function(date,mode){
+	
+	if (!this.callEvent("onBeforeViewChange",[this._mode,this._date,mode,date])) return;
+	//hide old custom view
+	if (this[this._mode+"_view"] && mode && this._mode!=mode)
+		this[this._mode+"_view"](false);
+		
+	this._close_not_saved();
+	
+	this._mode=mode||this._mode;
+	this._date=date;
+	this._table_view=(this._mode=="month");
+	
+	var tabs=this._els["dhx_cal_tab"];
+	for (var i=0; i < tabs.length; i++) {
+		tabs[i].className="dhx_cal_tab"+((tabs[i].getAttribute("name")==this._mode+"_tab")?" active":"");
+	};
+	
+	//show new view
+	var view=this[this._mode+"_view"];
+	view?view(true):this.update_view();
+	
+	this.callEvent("onViewChange",[this._mode,this._date]);
+}
+scheduler._render_x_header = function(i,left,d,h){
+	//header scale	
+	var head=document.createElement("DIV"); head.className="dhx_scale_bar";
+	this.set_xy(head,this._cols[i]-1,this.xy.scale_height-2,left,0);//-1 for border
+	head.innerHTML=this.templates[this._mode+"_scale_date"](d,this._mode); //TODO - move in separate method
+	h.appendChild(head);
+}
+scheduler._reset_scale=function(){
+	//current mode doesn't support scales
+	//we mustn't call reset_scale for such modes, so it just to be sure
+	if (!this.templates[this._mode+"_date"]) return;
+	
+	var h=this._els["dhx_cal_header"][0];
+	var b=this._els["dhx_cal_data"][0];
+	var c = this.config;
+	
+	h.innerHTML="";
+	b.scrollTop=0; //fix flickering in FF
+	b.innerHTML="";
+	
+	
+	var str=((c.readonly||(!c.drag_resize))?" dhx_resize_denied":"")+((c.readonly||(!c.drag_move))?" dhx_move_denied":"");
+	if (str) b.className = "dhx_cal_data"+str;
+		
+		
+	this._cols=[];	//store for data section
+	this._colsS={height:0};
+	this._dy_shift=0;
+	
+	this.set_sizes();
+	var summ=parseInt(h.style.width); //border delta
+	var left=0;
+	
+	var d,dd,sd,today;
+	dd=this.date[this._mode+"_start"](new Date(this._date.valueOf()));
+	d=sd=this._table_view?scheduler.date.week_start(dd):dd;
+	today=this.date.date_part(new Date());
+	
+	//reset date in header
+	var ed=scheduler.date.add(dd,1,this._mode);
+	var count = 7;
+	
+	if (!this._table_view){
+		var count_n = this.date["get_"+this._mode+"_end"];
+		if (count_n) ed = count_n(dd);
+		count = Math.round((ed.valueOf()-dd.valueOf())/(1000*60*60*24));
+	}
+	
+	this._min_date=d;
+	this._els["dhx_cal_date"][0].innerHTML=this.templates[this._mode+"_date"](dd,ed,this._mode);
+	
+	
+	for (var i=0; i<count; i++){
+		this._cols[i]=Math.floor(summ/(count-i));
+	
+		this._render_x_header(i,left,d,h);
+		if (!this._table_view){
+			var scales=document.createElement("DIV");
+			var cls = "dhx_scale_holder"
+			if (d.valueOf()==today.valueOf()) cls = "dhx_scale_holder_now";
+			scales.className=cls+" "+this.templates.week_date_class(d,today);
+			this.set_xy(scales,this._cols[i]-1,c.hour_size_px*(c.last_hour-c.first_hour),left+this.xy.scale_width+1,0);//-1 for border
+			b.appendChild(scales);
+		}
+		
+		d=this.date.add(d,1,"day")
+		summ-=this._cols[i];
+		left+=this._cols[i];
+		this._colsS[i]=(this._cols[i-1]||0)+(this._colsS[i-1]||(this._table_view?0:this.xy.scale_width+2));
+	}
+	this._max_date=d;
+	this._colsS[count]=this._cols[count-1]+this._colsS[count-1];
+	
+	if (this._table_view)
+		this._reset_month_scale(b,dd,sd);
+	else{
+		this._reset_hours_scale(b,dd,sd);
+		if (c.multi_day){
+			var c1 = document.createElement("DIV");
+			c1.className="dhx_multi_day";
+			c1.style.visibility="hidden";
+			this.set_xy(c1,parseInt(h.style.width),0,this.xy.scale_width,0);
+			b.appendChild(c1);
+			var c2 = c1.cloneNode(true);
+			c2.className="dhx_multi_day_icon";
+			c2.style.visibility="hidden";
+			this.set_xy(c2,this.xy.scale_width-1,0,0,0);
+			b.appendChild(c2);
+			
+			this._els["dhx_multi_day"]=[c1,c2];
+		}
+	}
+}
+scheduler._reset_hours_scale=function(b,dd,sd){
+	var c=document.createElement("DIV");
+	c.className="dhx_scale_holder";
+	
+	var date = new Date(1980,1,1,this.config.first_hour,0,0);
+	for (var i=this.config.first_hour*1; i < this.config.last_hour; i++) {
+		var cc=document.createElement("DIV");
+		cc.className="dhx_scale_hour";
+		cc.style.height=this.config.hour_size_px-(this._quirks?0:1)+"px";
+		cc.style.width=this.xy.scale_width+"px";
+		cc.innerHTML=scheduler.templates.hour_scale(date);
+		
+		c.appendChild(cc);
+		date=this.date.add(date,1,"hour");
+	};
+	b.appendChild(c);
+	if (this.config.scroll_hour)
+		b.scrollTop = this.config.hour_size_px*(this.config.scroll_hour-this.config.first_hour);
+}
+scheduler._reset_month_scale=function(b,dd,sd){
+	var ed=scheduler.date.add(dd,1,"month");
+	
+	//trim time part for comparation reasons
+	var cd=new Date();
+	this.date.date_part(cd);
+	this.date.date_part(sd);
+	
+	var rows=Math.ceil((ed.valueOf()-sd.valueOf())/(60*60*24*1000*7));
+	var tdcss=[];
+	var height=(Math.floor(b.clientHeight/rows)-22);
+	
+	this._colsS.height=height+22;
+	var h = this._colsS.heights = [];
+	for (var i=0; i<=7; i++)
+		tdcss[i]=" style='height:"+height+"px; width:"+((this._cols[i]||0)-1)+"px;' "
+
+	
+	
+	var cellheight = 0;
+	this._min_date=sd;
+	var html="<table cellpadding='0' cellspacing='0'>";
+	for (var i=0; i<rows; i++){
+		html+="<tr>";
+			for (var j=0; j<7; j++){
+				html+="<td";
+				var cls = "";
+				if (sd<dd)
+					cls='dhx_before';
+				else if (sd>=ed)
+					cls='dhx_after';
+				else if (sd.valueOf()==cd.valueOf())
+					cls='dhx_now';
+				html+=" class='"+cls+" "+this.templates.month_date_class(sd,cd)+"' ";
+				html+="><div class='dhx_month_head'>"+this.templates.month_day(sd)+"</div><div class='dhx_month_body' "+tdcss[j]+"></div></td>"
+				sd=this.date.add(sd,1,"day");
+			}
+		html+="</tr>";
+		h[i] = cellheight;
+		cellheight+=this._colsS.height;
+	}
+	html+="</table>";
+	this._max_date=sd;
+	
+	b.innerHTML=html;	
+	return sd;
+}
+scheduler.getLabel = function(property, key) {
+	var sections = this.config.lightbox.sections;
+	for (var i=0; i<sections.length; i++) {
+		if(sections[i].map_to == property) {
+			var options = sections[i].options;
+			for (var j=0; j<options.length; j++) {
+				if(options[j].key == key) {
+					return options[j].label;
+				}
+			}
+		}
+	}
+	return "";
+};
+scheduler.date={
+	date_part:function(date){
+		date.setHours(0);
+		date.setMinutes(0);
+		date.setSeconds(0);
+		date.setMilliseconds(0);	
+		return date;
+	},
+	time_part:function(date){
+		return (date.valueOf()/1000 - date.getTimezoneOffset()*60)%86400;
+	},
+	week_start:function(date){
+			var shift=date.getDay();
+			if (scheduler.config.start_on_monday){
+				if (shift==0) shift=6
+				else shift--;
+			}
+			return this.date_part(this.add(date,-1*shift,"day"));
+	},
+	month_start:function(date){
+		date.setDate(1);
+		return this.date_part(date);
+	},
+	year_start:function(date){
+		date.setMonth(0);
+		return this.month_start(date);
+	},
+	day_start:function(date){
+			return this.date_part(date);
+	},
+	add:function(date,inc,mode){
+		var ndate=new Date(date.valueOf());
+		switch(mode){
+			case "day": ndate.setDate(ndate.getDate()+inc); break;
+			case "week": ndate.setDate(ndate.getDate()+7*inc); break;
+			case "month": ndate.setMonth(ndate.getMonth()+inc); break;
+			case "year": ndate.setYear(ndate.getFullYear()+inc); break;
+			case "hour": ndate.setHours(ndate.getHours()+inc); break;
+			case "minute": ndate.setMinutes(ndate.getMinutes()+inc); break;
+			default:
+				return scheduler.date["add_"+mode](date,inc,mode);
+		}
+		return ndate;
+	},
+	to_fixed:function(num){
+		if (num<10)	return "0"+num;
+		return num;
+	},
+	copy:function(date){
+		return new Date(date.valueOf());
+	},
+	date_to_str:function(format,utc){
+		format=format.replace(/%[a-zA-Z]/g,function(a){
+			switch(a){
+				case "%d": return "\"+scheduler.date.to_fixed(date.getDate())+\"";
+				case "%m": return "\"+scheduler.date.to_fixed((date.getMonth()+1))+\"";
+				case "%j": return "\"+date.getDate()+\"";
+				case "%n": return "\"+(date.getMonth()+1)+\"";
+				case "%y": return "\"+scheduler.date.to_fixed(date.getFullYear()%100)+\""; 
+				case "%Y": return "\"+date.getFullYear()+\"";
+				case "%D": return "\"+scheduler.locale.date.day_short[date.getDay()]+\"";
+				case "%l": return "\"+scheduler.locale.date.day_full[date.getDay()]+\"";
+				case "%M": return "\"+scheduler.locale.date.month_short[date.getMonth()]+\"";
+				case "%F": return "\"+scheduler.locale.date.month_full[date.getMonth()]+\"";
+				case "%h": return "\"+scheduler.date.to_fixed((date.getHours()+11)%12+1)+\"";
+				case "%g": return "\"+((date.getHours()+11)%12+1)+\"";
+				case "%G": return "\"+date.getHours()+\"";
+				case "%H": return "\"+scheduler.date.to_fixed(date.getHours())+\"";
+				case "%i": return "\"+scheduler.date.to_fixed(date.getMinutes())+\"";
+				case "%a": return "\"+(date.getHours()>11?\"pm\":\"am\")+\"";
+				case "%A": return "\"+(date.getHours()>11?\"PM\":\"AM\")+\"";
+				case "%s": return "\"+scheduler.date.to_fixed(date.getSeconds())+\"";
+				case "%W": return "\"+scheduler.date.to_fixed(scheduler.date.getISOWeek(date))+\"";
+				default: return a;
+			}
+		})
+		if (utc) format=format.replace(/date\.get/g,"date.getUTC");
+		return new Function("date","return \""+format+"\";");
+	},
+	str_to_date:function(format,utc){
+		var splt="var temp=date.split(/[^0-9a-zA-Z]+/g);";
+		var mask=format.match(/%[a-zA-Z]/g);
+		for (var i=0; i<mask.length; i++){
+			switch(mask[i]){
+				case "%j":
+				case "%d": splt+="set[2]=temp["+i+"]||1;";
+					break;
+				case "%n":
+				case "%m": splt+="set[1]=(temp["+i+"]||1)-1;";
+					break;
+				case "%y": splt+="set[0]=temp["+i+"]*1+(temp["+i+"]>50?1900:2000);";
+					break;
+				case "%g":
+				case "%G":
+				case "%h": 
+				case "%H":
+							splt+="set[3]=temp["+i+"]||0;";
+					break;
+				case "%i":
+							splt+="set[4]=temp["+i+"]||0;";
+					break;
+				case "%Y":  splt+="set[0]=temp["+i+"]||0;";
+					break;
+				case "%a":					
+				case "%A":  splt+="set[3]=set[3]%12+((temp["+i+"]||'').toLowerCase()=='am'?0:12);";
+					break;					
+				case "%s":  splt+="set[5]=temp["+i+"]||0;";
+					break;
+			}
+		}
+		var code ="set[0],set[1],set[2],set[3],set[4],set[5]";
+		if (utc) code =" Date.UTC("+code+")";
+		return new Function("date","var set=[0,0,1,0,0,0]; "+splt+" return new Date("+code+");");
+	},
+		
+	getISOWeek: function(ndate) {
+		if(!ndate) return false;
+		var nday = ndate.getDay();
+		if (nday == 0) {
+			nday = 7;
+		}
+		var first_thursday = new Date(ndate.valueOf());
+		first_thursday.setDate(ndate.getDate() + (4 - nday));
+		var year_number = first_thursday.getFullYear(); // year of the first Thursday
+		var ordinal_date = Math.floor( (first_thursday.getTime() - new Date(year_number, 0, 1).getTime()) / 86400000); //ordinal date of the first Thursday - 1 (so not really ordinal date)
+		var week_number = 1 + Math.floor( ordinal_date / 7);	
+		return week_number;
+	},
+	
+	getUTCISOWeek: function(ndate){
+   	return this.getISOWeek(ndate);
+   }
+}
+
+scheduler.locale={
+	date:{
+		month_full:["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
+		month_short:["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
+		day_full:["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
+    	day_short:["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]
+    },
+    labels:{
+    	dhx_cal_today_button:"Today",
+    	day_tab:"Day",
+    	week_tab:"Week",
+    	month_tab:"Month",
+    	new_event:"New event",
+		icon_save:"Save",
+		icon_cancel:"Cancel",
+		icon_details:"Details",
+		icon_edit:"Edit",
+		icon_delete:"Delete",
+		confirm_closing:"",//Your changes will be lost, are your sure ?
+		confirm_deleting:"Event will be deleted permanently, are you sure?",
+		section_description:"Description",
+		section_time:"Time period",
+		full_day:"Full day",
+		
+		/*recurring events*/
+		confirm_recurring:"Do you want to edit the whole set of repeated events?",
+		section_recurring:"Repeat event",
+		button_recurring:"Disabled",
+		button_recurring_open:"Enabled",
+		
+		/*agenda view extension*/
+		agenda_tab:"Agenda",
+		date:"Date",
+		description:"Description",
+		
+		/*year view extension*/
+		year_tab:"Year"
+    }
+}
+
+
+/*
+%e	Day of the month without leading zeros (01..31)
+%d	Day of the month, 2 digits with leading zeros (01..31)
+%j	Day of the year, 3 digits with leading zeros (001..366)
+%a	A textual representation of a day, two letters
+%W	A full textual representation of the day of the week
+
+%c	Numeric representation of a month, without leading zeros (0..12)
+%m	Numeric representation of a month, with leading zeros (00..12)
+%b	A short textual representation of a month, three letters (Jan..Dec)
+%M	A full textual representation of a month, such as January or March (January..December)
+
+%y	A two digit representation of a year (93..03)
+%Y	A full numeric representation of a year, 4 digits (1993..03)
+*/
+
+scheduler.config={
+	default_date: "%j %M %Y",
+	month_date: "%F %Y",
+	load_date: "%Y-%m-%d",
+	week_date: "%l",
+	day_date: "%D, %F %j",
+	hour_date: "%H:%i",
+	month_day : "%d",
+	xml_date:"%m/%d/%Y %H:%i",
+	api_date:"%d-%m-%Y %H:%i",
+
+	hour_size_px:42,
+	time_step:5,
+
+	start_on_monday:1,
+	first_hour:0,
+	last_hour:24,
+	readonly:false,
+	drag_resize:1,
+	drag_move:1,
+	drag_create:1,
+	dblclick_create:1,
+	edit_on_create:1,
+	details_on_create:0,
+	click_form_details:0,
+	
+	server_utc:false,
+
+	positive_closing:false,
+
+	icons_edit:["icon_save","icon_cancel"],
+	icons_select:["icon_details","icon_edit","icon_delete"],
+	
+	lightbox:{
+		sections:[	{name:"description", height:200, map_to:"text", type:"textarea" , focus:true},
+					{name:"time", height:72, type:"time", map_to:"auto"}	]
+	}
+};
+scheduler.templates={}
+scheduler.init_templates=function(){
+	var d=scheduler.date.date_to_str;
+	var c=scheduler.config;
+	var f = function(a,b){
+		for (var c in b)
+			if (!a[c]) a[c]=b[c];
+	}
+	f(scheduler.templates,{
+		day_date:d(c.default_date),
+		month_date:d(c.month_date),
+		week_date:function(d1,d2){
+			return scheduler.templates.day_date(d1)+" &ndash; "+scheduler.templates.day_date(scheduler.date.add(d2,-1,"day"));
+		},
+		day_scale_date:d(c.default_date),
+		month_scale_date:d(c.week_date),
+		week_scale_date:d(c.day_date),
+		hour_scale:d(c.hour_date),
+		time_picker:d(c.hour_date),
+		event_date:d(c.hour_date),
+		month_day:d(c.month_day),
+		xml_date:scheduler.date.str_to_date(c.xml_date,c.server_utc),
+		load_format:d(c.load_date,c.server_utc),
+		xml_format:d(c.xml_date,c.server_utc),
+		api_date:scheduler.date.str_to_date(c.api_date),
+		event_header:function(start,end,ev){
+			return scheduler.templates.event_date(start)+" - "+scheduler.templates.event_date(end);
+		},
+		event_text:function(start,end,ev){
+			return ev.text;
+		},
+		event_class:function(start,end,ev){
+			return "";
+		},
+		month_date_class:function(d){
+			return "";
+		},
+		week_date_class:function(d){
+			return "";
+		},
+		event_bar_date:function(start,end,ev){
+			return scheduler.templates.event_date(start)+" ";
+		},
+		event_bar_text:function(start,end,ev){
+			return ev.text;
+		}
+	});
+	this.callEvent("onTemplatesReady",[])
+}
+
+
+
+scheduler.uid=function(){
+	if (!this._seed) this._seed=(new Date).valueOf();
+	return this._seed++;
+};
+scheduler._events={};
+scheduler.clearAll=function(){
+	this._events={};
+	this._loaded={};
+	this.clear_view();
+};
+scheduler.addEvent=function(start_date,end_date,text,id,extra_data){
+	var ev=start_date;
+	if (arguments.length!=1){
+		ev=extra_data||{};
+		ev.start_date=start_date;
+		ev.end_date=end_date;
+		ev.text=text;
+		ev.id=id;
+	};
+	ev.id = ev.id||scheduler.uid();
+	ev.text = ev.text||"";
+	
+	if (typeof ev.start_date == "string")  ev.start_date=this.templates.api_date(ev.start_date);
+	if (typeof ev.end_date == "string")  ev.end_date=this.templates.api_date(ev.end_date);
+	ev._timed=this.is_one_day_event(ev);
+
+	var is_new=!this._events[ev.id];
+	this._events[ev.id]=ev;
+	this.event_updated(ev);
+	if (!this._loading)
+		this.callEvent(is_new?"onEventAdded":"onEventChanged",[ev.id,ev]);
+};
+scheduler.deleteEvent=function(id,silent){ 
+	var ev=this._events[id];
+	if (!silent && !this.callEvent("onBeforeEventDelete",[id,ev])) return;
+	
+	if (ev){
+		delete this._events[id];
+		this.unselect(id);
+		this.event_updated(ev);
+	}
+};
+scheduler.getEvent=function(id){
+	return this._events[id];
+};
+scheduler.setEvent=function(id,hash){
+	this._events[id]=hash;
+};
+scheduler.for_rendered=function(id,method){
+	for (var i=this._rendered.length-1; i>=0; i--)
+		if (this._rendered[i].getAttribute("event_id")==id)
+			method(this._rendered[i],i);
+};
+scheduler.changeEventId=function(id,new_id){
+	if (id == new_id) return;
+	var ev=this._events[id];
+	if (ev){
+		ev.id=new_id;
+		this._events[new_id]=ev;
+		delete this._events[id];
+	}
+	this.for_rendered(id,function(r){
+		r.setAttribute("event_id",new_id);
+	});
+	if (this._select_id==id) this._select_id=new_id;
+	if (this._edit_id==id) this._edit_id=new_id;
+	this.callEvent("onEventIdChange",[id,new_id]);
+};
+
+(function(){
+	var attrs=["text","Text","start_date","StartDate","end_date","EndDate"];
+	var create_getter=function(name){
+		return function(id){ return (scheduler.getEvent(id))[name]; };
+	};
+	var create_setter=function(name){
+		return function(id,value){ 
+			var ev=scheduler.getEvent(id); ev[name]=value; 
+			ev._changed=true; 
+			ev._timed=this.is_one_day_event(ev);
+			scheduler.event_updated(ev,true); 
+		};
+	};
+	for (var i=0; i<attrs.length; i+=2){
+		scheduler["getEvent"+attrs[i+1]]=create_getter(attrs[i]);
+		scheduler["setEvent"+attrs[i+1]]=create_setter(attrs[i]);
+	}
+})();
+
+scheduler.event_updated=function(ev,force){
+	if (this.is_visible_events(ev))
+		this.render_view_data();
+	else this.clear_event(ev.id);
+};
+scheduler.is_visible_events=function(ev){
+	if (ev.start_date<this._max_date && this._min_date<ev.end_date) return true;
+	return false;
+};
+scheduler.is_one_day_event=function(ev){
+	var delta = ev.end_date.getDate()-ev.start_date.getDate();
+	
+	if (!delta)
+		return ev.start_date.getMonth()==ev.end_date.getMonth() && ev.start_date.getFullYear()==ev.end_date.getFullYear();
+	else {
+		if (delta < 0)  delta = Math.ceil((ev.end_date.valueOf()-ev.start_date.valueOf())/(24*60*60*1000));
+		return (delta == 1 && !ev.end_date.getHours() && !ev.end_date.getMinutes() && (ev.start_date.getHours() || ev.start_date.getMinutes() ));
+	}
+		
+};
+scheduler.get_visible_events=function(){
+	//not the best strategy for sure
+	var stack=[];
+	var filter = this["filter_"+this._mode];
+	
+	for( var id in this._events)
+		if (this.is_visible_events(this._events[id]))
+			if (this._table_view || this.config.multi_day || this._events[id]._timed)
+				if (!filter || filter(id,this._events[id]))
+					stack.push(this._events[id]);
+				
+	return stack;
+};
+scheduler.render_view_data=function(){
+	if (this._not_render) {
+		this._render_wait=true;
+		return;
+	}
+	this._render_wait=false;
+	
+	this.clear_view();
+	var evs=this.get_visible_events();
+	
+	if (this.config.multi_day && !this._table_view){
+		var tvs = [];
+		var tvd = [];
+		for (var i=0; i < evs.length; i++){
+			if (evs[i]._timed)
+				tvs.push(evs[i]);
+			else
+				tvd.push(evs[i]);
+		};
+		this._table_view=true;
+		this.render_data(tvd);
+		this._table_view=false;		
+		this.render_data(tvs);
+	} else 
+		this.render_data(evs);	
+};
+scheduler.render_data=function(evs,hold){
+	evs=this._pre_render_events(evs,hold);
+	for (var i=0; i<evs.length; i++)
+		if (this._table_view)
+			this.render_event_bar(evs[i]);
+		else
+			this.render_event(evs[i]);
+};
+scheduler._pre_render_events=function(evs,hold){
+	var hb = this.xy.bar_height;
+	var h_old = this._colsS.heights;	
+	var h=this._colsS.heights=[0,0,0,0,0,0,0];
+	
+	if (!this._table_view) evs=this._pre_render_events_line(evs,hold); //ignore long events for now
+	else evs=this._pre_render_events_table(evs,hold);
+	
+	if (this._table_view){
+		if (hold)
+			this._colsS.heights = h_old;
+		else {
+			var evl = this._els["dhx_cal_data"][0].firstChild;
+			if (evl.rows){
+				for (var i=0; i<evl.rows.length; i++){
+					h[i]++;
+					if ((h[i])*hb > this._colsS.height-22){ // 22 - height of cell's header
+						//we have overflow, update heights
+						var cells = evl.rows[i].cells;
+						for (var j=0; j < cells.length; j++) {
+							cells[j].childNodes[1].style.height = h[i]*hb+"px";
+						}
+						h[i]=(h[i-1]||0)+cells[0].offsetHeight;
+					}
+					h[i]=(h[i-1]||0)+evl.rows[i].cells[0].offsetHeight;
+				}	
+				h.unshift(0);
+				if (evl.parentNode.offsetHeight<evl.parentNode.scrollHeight && !evl._h_fix){
+					//we have v-scroll, decrease last day cell
+					for (var i=0; i<evl.rows.length; i++){
+						var cell = evl.rows[i].cells[6].childNodes[0];
+						var w = cell.offsetWidth-scheduler.xy.scroll_width+"px";
+						cell.style.width = w;
+						cell.nextSibling.style.width = w;
+					}		
+					evl._h_fix=true;
+				}
+			} else{
+				
+				if (!evs.length && this._els["dhx_multi_day"][0].style.visibility == "visible")
+					h[0]=-1;
+				if (evs.length || h[0]==-1){
+					//shift days to have space for multiday events
+					var childs = evl.parentNode.childNodes;
+					var dh = (h[0]+1)*hb+"px";
+					for (var i=0; i<childs.length; i++)
+						if (this._colsS[i])
+							childs[i].style.top=dh;
+					var last = this._els["dhx_multi_day"][0];
+					last.style.top = "0px";
+					last.style.height=dh;
+					last.style.visibility=(h[0]==-1?"hidden":"visible");
+					last=this._els["dhx_multi_day"][1];
+					last.style.height=dh;
+					last.style.visibility=(h[0]==-1?"hidden":"visible");
+					last.className=h[0]?"dhx_multi_day_icon":"dhx_multi_day_icon_small";
+					
+					this._dy_shift=(h[0]+1)*hb;
+					h[0] = 0;
+				}				
+				
+			}
+		}
+	}
+	
+	return evs;
+};
+scheduler._get_event_sday=function(ev){
+	return Math.floor((ev.start_date.valueOf()-this._min_date.valueOf())/(24*60*60*1000));
+};
+scheduler._pre_render_events_line=function(evs,hold){
+	evs.sort(function(a,b){ return a.start_date>b.start_date?1:-1; });
+	var days=[]; //events by weeks
+	var evs_originals = [];
+	for (var i=0; i < evs.length; i++) {
+		var ev=evs[i];
+
+		//check scale overflow
+		var sh = ev.start_date.getHours();
+		var eh = ev.end_date.getHours();
+		
+		ev._sday=this._get_event_sday(ev);
+		if (!days[ev._sday]) days[ev._sday]=[];
+		
+		if (!hold){
+			ev._inner=false;
+			var stack=days[ev._sday];
+			while (stack.length && stack[stack.length-1].end_date<=ev.start_date)
+				stack.splice(stack.length-1,1);
+			if (stack.length) stack[stack.length-1]._inner=true;
+			ev._sorder=stack.length; stack.push(ev);
+			if (stack.length>(stack.max_count||0)) stack.max_count=stack.length;
+		}
+		
+		if (sh < this.config.first_hour || eh >= this.config.last_hour){
+			evs_originals.push(ev);
+			evs[i]=ev=this._copy_event(ev);
+			if (sh < this.config.first_hour){
+				ev.start_date.setHours(this.config.first_hour);
+				ev.start_date.setMinutes(0);
+			}
+			if (eh >= this.config.last_hour){
+				ev.end_date.setMinutes(0);
+				ev.end_date.setHours(this.config.last_hour);
+			}
+			if (ev.start_date>ev.end_date || sh==this.config.last_hour) {
+				evs.splice(i,1); i--; continue;
+			}
+		}
+				
+	}
+	if (!hold){
+		for (var i=0; i < evs.length; i++) 
+			evs[i]._count=days[evs[i]._sday].max_count;
+		for (var i=0; i < evs_originals.length; i++) 
+			evs_originals[i]._count=days[evs_originals[i]._sday].max_count;
+	}
+	
+	return evs;
+};
+scheduler._time_order=function(evs){
+	evs.sort(function(a,b){ 
+		if (a.start_date.valueOf()==b.start_date.valueOf()){
+			if (a._timed && !b._timed) return 1;
+			if (!a._timed && b._timed) return -1;
+			return 0;
+		}
+		return a.start_date>b.start_date?1:-1;
+	});
+};
+scheduler._pre_render_events_table=function(evs,hold){ // max - max height of week slot
+	this._time_order(evs);
+	
+	var out=[];
+	var weeks=[[],[],[],[],[],[],[]]; //events by weeks
+	var max = this._colsS.heights;
+	var start_date;
+	var cols = this._cols.length;
+	
+	for (var i=0; i < evs.length; i++) {
+		var ev=evs[i];
+		var sd = (start_date||ev.start_date);
+		var ed = ev.end_date;
+		//trim events which are crossing through current view
+		if (sd<this._min_date) sd=this._min_date;
+		if (ed>this._max_date) ed=this._max_date;
+		
+		var locate_s = this.locate_holder_day(sd,false,ev);
+		ev._sday=locate_s%cols;
+		var locate_e = this.locate_holder_day(ed,true,ev)||cols;
+		ev._eday=(locate_e%cols)||cols; //cols used to fill full week, when event end on monday
+		ev._length=locate_e-locate_s;
+		
+		//3600000 - compensate 1 hour during winter|summer time shift
+		ev._sweek=Math.floor((this._correct_shift(sd.valueOf(),1)-this._min_date.valueOf())/(60*60*1000*24*cols)); 	
+		
+		//current slot
+		var stack=weeks[ev._sweek];
+		//check order position
+		var stack_line;
+		
+		for (stack_line=0; stack_line<stack.length; stack_line++)
+			if (stack[stack_line]._eday<=ev._sday)
+				break;
+		ev._sorder=stack_line; 
+		
+		
+		if (ev._sday+ev._length<=cols){
+			start_date=null;
+			out.push(ev);
+			stack[stack_line]=ev;
+			//get max height of slot
+			max[ev._sweek]=stack.length-1;
+		} else{ // split long event in chunks
+			var copy=this._copy_event(ev);
+			copy._length=cols-ev._sday;
+			copy._eday=cols; copy._sday=ev._sday;
+			copy._sweek=ev._sweek; copy._sorder=ev._sorder;
+			copy.end_date=this.date.add(sd,copy._length,"day");
+			
+			out.push(copy);
+			stack[stack_line]=copy;
+			start_date=copy.end_date;
+			//get max height of slot
+			max[ev._sweek]=stack.length-1;
+			i--; continue;  //repeat same step
+		}
+	};
+	
+	return out;
+};
+scheduler._copy_dummy=function(){ 
+	this.start_date=new Date(this.start_date);
+	this.end_date=new Date(this.end_date);
+};
+scheduler._copy_event=function(ev){
+	this._copy_dummy.prototype = ev;
+	return new this._copy_dummy();
+	//return {start_date:ev.start_date, end_date:ev.end_date, text:ev.text, id:ev.id}
+};
+scheduler._rendered=[];
+scheduler.clear_view=function(){
+	for (var i=0; i<this._rendered.length; i++){
+		var obj=this._rendered[i];
+		if (obj.parentNode) obj.parentNode.removeChild(obj);		
+	}
+	this._rendered=[];
+};
+scheduler.updateEvent=function(id){
+	var ev=this.getEvent(id);
+	this.clear_event(id);
+	if (ev && this.is_visible_events(ev)) 
+		this.render_data([ev],true);
+};
+scheduler.clear_event=function(id){
+	this.for_rendered(id,function(node,i){
+		if (node.parentNode)
+			node.parentNode.removeChild(node);
+		scheduler._rendered.splice(i,1);
+	});
+};
+scheduler.render_event=function(ev){
+	var menu = scheduler.xy.menu_width;
+	if (ev._sday<0) return; //can occur in case of recurring event during time shift
+	var parent=scheduler.locate_holder(ev._sday);	
+	if (!parent) return; //attempt to render non-visible event
+	var sm = ev.start_date.getHours()*60+ev.start_date.getMinutes();
+	var em = (ev.end_date.getHours()*60+ev.end_date.getMinutes())||(scheduler.config.last_hour*60);
+	
+	var top = (Math.round((sm*60*1000-this.config.first_hour*60*60*1000)*this.config.hour_size_px/(60*60*1000)))%(this.config.hour_size_px*24)+1; //42px/hour
+	var height = Math.max(scheduler.xy.min_event_height,(em-sm)*this.config.hour_size_px/60)+1; //42px/hour
+	//var height = Math.max(25,Math.round((ev.end_date.valueOf()-ev.start_date.valueOf())*(this.config.hour_size_px+(this._quirks?1:0))/(60*60*1000))); //42px/hour
+	var width=Math.floor((parent.clientWidth-menu)/ev._count);
+	var left=ev._sorder*width+1;
+	if (!ev._inner) width=width*(ev._count-ev._sorder);
+	
+	
+	
+	var d=this._render_v_bar(ev.id,menu+left,top,width,height,ev._text_style,scheduler.templates.event_header(ev.start_date,ev.end_date,ev),scheduler.templates.event_text(ev.start_date,ev.end_date,ev));
+		
+	this._rendered.push(d);
+	parent.appendChild(d);
+	
+	left=left+parseInt(parent.style.left,10)+menu;
+	
+	top+=this._dy_shift; //corrupt top, to include possible multi-day shift
+	if (this._edit_id==ev.id){
+		d.style.zIndex = 1; //fix overlapping issue
+		width=Math.max(width-4,scheduler.xy.editor_width);
+		var d=document.createElement("DIV");
+		d.setAttribute("event_id",ev.id);
+		this.set_xy(d,width,height-20,left,top+14);
+		d.className="dhx_cal_editor";
+			
+		var d2=document.createElement("DIV");
+		this.set_xy(d2,width-6,height-26);
+		d2.style.cssText+=";margin:2px 2px 2px 2px;overflow:hidden;";
+		
+		d.appendChild(d2);
+		this._els["dhx_cal_data"][0].appendChild(d);
+		this._rendered.push(d);
+	
+		d2.innerHTML="<textarea class='dhx_cal_editor'>"+ev.text+"</textarea>";
+		if (this._quirks7) d2.firstChild.style.height=height-12+"px"; //IEFIX
+		this._editor=d2.firstChild;
+		this._editor.onkeypress=function(e){ 
+			if ((e||event).shiftKey) return true;
+			var code=(e||event).keyCode; 
+			if (code==scheduler.keys.edit_save) scheduler.editStop(true); 
+			if (code==scheduler.keys.edit_cancel) scheduler.editStop(false); 
+		};
+		this._editor.onselectstart=function(e){ return (e||event).cancelBubble=true; };
+		d2.firstChild.focus();
+		//IE and opera can add x-scroll during focusing
+		this._els["dhx_cal_data"][0].scrollLeft=0;
+		d2.firstChild.select();
+	}
+	
+	if (this._select_id==ev.id){
+		//d.style.zIndex = 1; //fix overlapping issue
+		var icons=this.config["icons_"+((this._edit_id==ev.id)?"edit":"select")];
+		var icons_str="";
+		for (var i=0; i<icons.length; i++)
+			icons_str+="<div class='dhx_menu_icon "+icons[i]+"' title='"+this.locale.labels[icons[i]]+"'></div>";
+		var obj = this._render_v_bar(ev.id,left-menu+1,top,menu,icons.length*20+26,"","<div class='dhx_menu_head'></div>",icons_str,true);
+		obj.style.left=left-menu+1;
+		this._els["dhx_cal_data"][0].appendChild(obj);
+		this._rendered.push(obj);
+	}
+};
+scheduler._render_v_bar=function(id,x,y,w,h,style,contentA,contentB,bottom){
+	var d=document.createElement("DIV");
+	
+	var ev = this.getEvent(id);
+	var cs = "dhx_cal_event";
+	var cse = scheduler.templates.event_class(ev.start_date,ev.end_date,ev);
+	if (cse) cs=cs+" "+cse;
+	
+	var html='<div event_id="'+id+'" class="'+cs+'" style="position:absolute; top:'+y+'px; left:'+x+'px; width:'+(w-4)+'px; height:'+h+'px;'+(style||"")+'">';
+	html+='<div class="dhx_header" style=" width:'+(w-6)+'px;" >&nbsp;</div>';
+	html+='<div class="dhx_title">'+contentA+'</div>';
+	html+='<div class="dhx_body" style=" width:'+(w-(this._quirks?4:14))+'px; height:'+(h-(this._quirks?20:30))+'px;">'+contentB+'</div>';
+	html+='<div class="dhx_footer" style=" width:'+(w-8)+'px;'+(bottom?' margin-top:-1px;':'')+'" ></div></div>';
+	
+	d.innerHTML=html;
+	return d.firstChild;
+};
+scheduler.locate_holder=function(day){
+	if (this._mode=="day") return this._els["dhx_cal_data"][0].firstChild; //dirty
+	return this._els["dhx_cal_data"][0].childNodes[day];
+};
+scheduler.locate_holder_day=function(date,past){
+	var day = Math.floor((this._correct_shift(date,1)-this._min_date)/(60*60*24*1000));
+	//when locating end data of event , we need to use next day if time part was defined
+	if (past && this.date.time_part(date)) day++;
+	return day;
+};
+scheduler.render_event_bar=function(ev){
+	var parent=this._els["dhx_cal_data"][0];
+
+	var x=this._colsS[ev._sday];
+	var x2=this._colsS[ev._eday];
+	if (x2==x) x2=this._colsS[ev._eday+1];
+	var hb = this.xy.bar_height;
+	
+	var y=this._colsS.heights[ev._sweek]+(this._colsS.height?(this.xy.month_scale_height+2):2)+ev._sorder*hb; 
+			
+	var d=document.createElement("DIV");
+	var cs = ev._timed?"dhx_cal_event_clear":"dhx_cal_event_line";
+	var cse = scheduler.templates.event_class(ev.start_date,ev.end_date,ev);
+	if (cse) cs=cs+" "+cse; 
+	
+	var html='<div event_id="'+ev.id+'" class="'+cs+'" style="position:absolute; top:'+y+'px; left:'+x+'px; width:'+(x2-x-15)+'px;'+(ev._text_style||"")+'">';
+		
+	if (ev._timed)
+		html+=scheduler.templates.event_bar_date(ev.start_date,ev.end_date,ev);
+	html+=scheduler.templates.event_bar_text(ev.start_date,ev.end_date,ev)+'</div>';
+	html+='</div>';
+	
+	d.innerHTML=html;
+	
+	this._rendered.push(d.firstChild);
+	parent.appendChild(d.firstChild);
+};
+
+scheduler._locate_event=function(node){
+	var id=null;
+	while (node && !id && node.getAttribute){
+		id=node.getAttribute("event_id"); 
+		node=node.parentNode;
+	}
+	return id;
+};
+
+
+scheduler.edit=function(id){
+	if (this._edit_id==id) return;
+	this.editStop(false,id);
+	this._edit_id=id;
+	this.updateEvent(id);
+};
+scheduler.editStop=function(mode,id){
+	if (id && this._edit_id==id) return;
+	var ev=this.getEvent(this._edit_id);
+	if (ev){
+		if (mode) ev.text=this._editor.value;
+		this._edit_id=null;
+		this._editor=null;	
+		this.updateEvent(ev.id);
+		this._edit_stop_event(ev,mode);
+	}
+};
+scheduler._edit_stop_event=function(ev,mode){
+	if (this._new_event){
+		if (!mode) this.deleteEvent(ev.id,true);		
+		else this.callEvent("onEventAdded",[ev.id,ev]);
+		this._new_event=null;
+	} else
+		if (mode) this.callEvent("onEventChanged",[ev.id,ev]);
+};
+
+scheduler.getEvents = function(from,to){
+	var result = [];
+	for (var a in this._events){
+		var ev = this._events[a];
+		if (ev && ev.start_date<to && ev.end_date>from)
+			result.push(ev);
+	}
+	return result;
+};
+scheduler._loaded={};
+scheduler._load=function(url,from){
+	url=url||this._load_url;
+	url+=(url.indexOf("?")==-1?"?":"&")+"timeshift="+(new Date()).getTimezoneOffset();
+	if (this.config.prevent_cache)	url+="&uid="+this.uid();
+	var to;
+	from=from||this._date;
+	
+	if (this._load_mode){
+		var lf = this.templates.load_format;
+		
+		from = this.date[this._load_mode+"_start"](new Date(from.valueOf()));
+		while (from>this._min_date) from=this.date.add(from,-1,this._load_mode);
+		to = from;
+		
+		var cache_line = true;
+		while (to<this._max_date){
+			to=this.date.add(to,1,this._load_mode);	
+			if (this._loaded[lf(from)] && cache_line) 
+				from=this.date.add(from,1,this._load_mode);	
+			else cache_line = false;
+		}
+		
+		var temp_to=to;
+		do {
+			to = temp_to;
+			temp_to=this.date.add(to,-1,this._load_mode);
+		} while (temp_to>from && this._loaded[lf(temp_to)]);
+			
+		if (to<=from) 
+			return false; //already loaded
+		dhtmlxAjax.get(url+"&from="+lf(from)+"&to="+lf(to),function(l){scheduler.on_load(l);});
+		while(from<to){
+			this._loaded[lf(from)]=true;
+			from=this.date.add(from,1,this._load_mode);	
+		}
+	} else
+		dhtmlxAjax.get(url,function(l){scheduler.on_load(l);});
+	this.callEvent("onXLS",[]);
+	return true;
+}
+scheduler.on_load=function(loader){
+	this._loading=true;
+	if (this._process)
+		var evs=this[this._process].parse(loader.xmlDoc.responseText);
+	else
+		var evs=this._magic_parser(loader);
+	
+	this._not_render=true;
+	for (var i=0; i<evs.length; i++){
+		if (!this.callEvent("onEventLoading",[evs[i]])) continue;
+		this.addEvent(evs[i]);
+	}
+	this._not_render=false;
+	if (this._render_wait) this.render_view_data();
+	
+	if (this._after_call) this._after_call();
+	this._after_call=null;
+	this._loading=false;
+	this.callEvent("onXLE",[]);
+}
+scheduler.json={};
+scheduler.json.parse = function(data){
+	if (typeof data == "string"){
+		eval("scheduler._temp = "+data+";");
+		data = scheduler._temp;
+	}
+	var evs = [];
+	for (var i=0; i < data.length; i++){
+		data[i].start_date = scheduler.templates.xml_date(data[i].start_date);
+		data[i].end_date = scheduler.templates.xml_date(data[i].end_date);
+		evs.push(data[i]);
+	}
+	return evs;
+}
+scheduler.parse=function(data,type){
+	this._process=type;
+	this.on_load({xmlDoc:{responseText:data}});
+}
+scheduler.load=function(url,call){
+	if (typeof call == "string"){
+		this._process=call;
+		call = arguments[2];
+	}
+	
+	this._load_url=url;
+	this._after_call=call;
+	this._load(url,this._date);
+};
+//possible values - day,week,month,year,all
+scheduler.setLoadMode=function(mode){
+	if (mode=="all") mode="";
+	this._load_mode=mode;
+};
+
+//current view by default, or all data if "true" as parameter provided
+scheduler.refresh=function(refresh_all){
+	alert("not implemented");
+	/*
+	this._loaded={};
+	this._load();
+	*/
+}
+scheduler.serverList=function(name){
+	return this.serverList[name] = (this.serverList[name]||[]);
+}
+
+scheduler._userdata={};
+scheduler._magic_parser=function(loader){
+	if (!loader.getXMLTopNode){ //from a string
+		var xml_string = loader.xmlDoc.responseText;
+		loader = new dtmlXMLLoaderObject(function(){});
+		loader.loadXMLString(xml_string);
+	}
+	
+	var xml=loader.getXMLTopNode("data");
+	if (xml.tagName!="data") return [];//not an xml
+	
+	var opts = loader.doXPath("//coll_options");
+	for (var i=0; i < opts.length; i++) {
+		var bind = opts[i].getAttribute("for");
+		var arr = this.serverList[bind];
+		if (!arr) continue;
+		arr.splice(0,arr.length);	//clear old options
+		var itms = loader.doXPath(".//item",opts[i]);
+		for (var j=0; j < itms.length; j++)
+			arr.push({ key:itms[j].getAttribute("value"), label:itms[j].getAttribute("label")});
+	}
+	if (opts.length)
+		scheduler.callEvent("onOptionsLoad",[]);
+	
+	var ud=loader.doXPath("//userdata");	
+	for (var i=0; i < ud.length; i++) {
+		var udx = this.xmlNodeToJSON(ud[i]);
+		this._userdata[udx.name]=udx.text;
+	};
+	
+	var evs=[];
+	var xml=loader.doXPath("//event");
+	
+	
+	for (var i=0; i < xml.length; i++) {
+		evs[i]=this.xmlNodeToJSON(xml[i])
+		
+		evs[i].text=evs[i].text||evs[i]._tagvalue;
+		evs[i].start_date=this.templates.xml_date(evs[i].start_date);
+		evs[i].end_date=this.templates.xml_date(evs[i].end_date);
+	}
+	return evs;
+}
+scheduler.xmlNodeToJSON = function(node){
+        var t={};
+        for (var i=0; i<node.attributes.length; i++)
+            t[node.attributes[i].name]=node.attributes[i].value;
+        
+        for (var i=0; i<node.childNodes.length; i++){
+        	var child=node.childNodes[i];
+            if (child.nodeType==1)
+                t[child.tagName]=child.firstChild?child.firstChild.nodeValue:"";
+        }
+                 
+        if (!t.text) t.text=node.firstChild?node.firstChild.nodeValue:"";
+        
+        return t;
+}
+
+scheduler.attachEvent("onXLS",function(){
+	if (this.config.show_loading===true){
+		var t;
+		t=this.config.show_loading=document.createElement("DIV");
+		t.className='dhx_loading';
+		t.style.left = Math.round((this._x-128)/2)+"px";
+		t.style.top = Math.round((this._y-15)/2)+"px";
+		this._obj.appendChild(t);
+	}
+});
+scheduler.attachEvent("onXLE",function(){
+	var t;
+	if (t=this.config.show_loading)
+		if (typeof t == "object"){
+		this._obj.removeChild(t);
+		this.config.show_loading=true;
+	}
+});
+
+scheduler.ical={
+	parse:function(str){
+		var data = str.match(RegExp(this.c_start+"[^\f]*"+this.c_end,""));
+		if (!data.length) return;
+		
+		//unfolding 
+		data[0]=data[0].replace(/[\r\n]+(?=[a-z \t])/g," ");
+		//drop property
+		data[0]=data[0].replace(/\;[^:\r\n]*/g,"");
+		
+		
+		var incoming=[];
+		var match;
+		var event_r = RegExp("(?:"+this.e_start+")([^\f]*?)(?:"+this.e_end+")","g");
+		while (match=event_r.exec(data)){
+			var e={};
+			var param;
+			var param_r = /[^\r\n]+[\r\n]+/g;
+			while (param=param_r.exec(match[1]))
+				this.parse_param(param.toString(),e);
+			if (e.uid && !e.id) e.id = e.uid; //fallback to UID, when ID is not defined
+			incoming.push(e);	
+		}
+		return incoming;
+	},
+	parse_param:function(str,obj){
+		var d = str.indexOf(":"); 
+			if (d==-1) return;
+		
+		var name = str.substr(0,d).toLowerCase();
+		var value = str.substr(d+1).replace(/\\\,/g,",").replace(/[\r\n]+$/,"");
+		if (name=="summary")
+			name="text";
+		else if (name=="dtstart"){
+			name = "start_date";
+			value = this.parse_date(value,0,0);
+		}
+		else if (name=="dtend"){
+			name = "end_date";
+			if (obj.start_date && obj.start_date.getHours()==0)
+				value = this.parse_date(value,24,00);
+			else
+				value = this.parse_date(value,23,59);
+		}
+		obj[name]=value;
+	},
+	parse_date:function(value,dh,dm){
+		var t = value.split("T");	
+		if (t[1]){
+			dh=t[1].substr(0,2);
+			dm=t[1].substr(2,2);
+		}
+		var dy = t[0].substr(0,4);
+		var dn = parseInt(t[0].substr(4,2),10)-1;
+		var dd = t[0].substr(6,2);
+		if (scheduler.config.server_utc && !t[1]) { // if no hours/minutes were specified == full day event
+			return new Date(Date.UTC(dy,dn,dd,dh,dm)) ;
+		}
+		return new Date(dy,dn,dd,dh,dm);
+	},
+	c_start:"BEGIN:VCALENDAR",
+	e_start:"BEGIN:VEVENT",
+	e_end:"END:VEVENT",
+	c_end:"END:VCALENDAR"	
+};
+scheduler.form_blocks={
+	textarea:{
+		render:function(sns){
+			var height=(sns.height||"130")+"px";
+			return "<div class='dhx_cal_ltext' style='height:"+height+";'><textarea></textarea></div>";
+		},
+		set_value:function(node,value,ev){
+			node.firstChild.value=value||"";
+		},
+		get_value:function(node,ev){
+			return node.firstChild.value;
+		},
+		focus:function(node){
+			var a=node.firstChild; a.select(); a.focus(); 
+		}
+	},
+	select:{
+		render:function(sns){
+			var height=(sns.height||"23")+"px";
+			var html="<div class='dhx_cal_ltext' style='height:"+height+";'><select style='width:552px;'>";
+			for (var i=0; i < sns.options.length; i++)
+				html+="<option value='"+sns.options[i].key+"'>"+sns.options[i].label+"</option>";
+			html+="</select></div>";
+			return html;
+		},
+		set_value:function(node,value,ev){
+			if (typeof value == "undefined")
+				value = (node.firstChild.options[0]||{}).value;
+			node.firstChild.value=value||"";
+		},
+		get_value:function(node,ev){
+			return node.firstChild.value;
+		},
+		focus:function(node){
+			var a=node.firstChild; if (a.select) a.select(); a.focus(); 
+		}
+	},	
+	time:{
+		render:function(){
+			//hours
+			var cfg = scheduler.config;
+			var dt = this.date.date_part(new Date());
+			var last = 24*60, first = 0;
+			if(scheduler.config.limit_time_select){
+				last = 60*cfg.last_hour+1;
+				first = 60*cfg.first_hour;
+				dt.setHours(cfg.first_hour);
+			}
+				
+			var html="<select>";
+			for (var i=first; i<last; i+=this.config.time_step*1){
+				var time=this.templates.time_picker(dt);
+				html+="<option value='"+i+"'>"+time+"</option>";
+				dt=this.date.add(dt,this.config.time_step,"minute");
+			}
+			
+			//days
+			html+="</select> <select>";
+			for (var i=1; i < 32; i++) 
+				html+="<option value='"+i+"'>"+i+"</option>";
+			
+			//month
+			html+="</select> <select>";
+			for (var i=0; i < 12; i++) 
+				html+="<option value='"+i+"'>"+this.locale.date.month_full[i]+"</option>";
+			
+			//year
+			html+="</select> <select>";
+			dt = dt.getFullYear()-5; //maybe take from config?
+			for (var i=0; i < 10; i++) 
+				html+="<option value='"+(dt+i)+"'>"+(dt+i)+"</option>";
+			html+="</select> ";
+			
+			return "<div style='height:30px; padding-top:0px; font-size:inherit;' class='dhx_cal_lsection dhx_section_time'>"+html+"<span style='font-weight:normal; font-size:10pt;'> &nbsp;&ndash;&nbsp; </span>"+html+"</div>";			
+
+		},
+		set_value:function(node,value,ev){
+
+			var s=node.getElementsByTagName("select");
+
+			if(scheduler.config.full_day) {
+				if (!node._full_day){
+					node.previousSibling.innerHTML+="<div class='dhx_fullday_checkbox'><label><input type='checkbox' name='full_day' value='true'> "+scheduler.locale.labels.full_day+"&nbsp;</label></input></div>";
+					node._full_day=true;
+				}
+				var input=node.previousSibling.getElementsByTagName("input")[0];
+				var isFulldayEvent = (scheduler.date.time_part(ev.start_date)==0 && scheduler.date.time_part(ev.end_date)==0 && ev.end_date.valueOf()-ev.start_date.valueOf() < 2*24*60*60*1000);
+				input.checked = isFulldayEvent;
+				
+				for(var k in s)
+					s[k].disabled=input.checked;
+
+				input.onclick = function(){ 
+					if(input.checked) {
+						var start_date = new Date(ev.start_date);
+						var end_date = new Date(ev.end_date);
+						
+						scheduler.date.date_part(start_date);
+						end_date = scheduler.date.add(start_date, 1, "day")
+					} 
+					for(var i in s)
+						s[i].disabled=input.checked;
+					
+					_fill_lightbox_select(s,0,start_date||ev.start_date);
+					_fill_lightbox_select(s,4,end_date||ev.end_date);
+				}
+			}
+			
+			if(scheduler.config.auto_end_date && scheduler.config.event_duration) {
+				function _update_lightbox_select() {
+					ev.start_date=new Date(s[3].value,s[2].value,s[1].value,0,s[0].value);
+					ev.end_date.setTime(ev.start_date.getTime() + (scheduler.config.event_duration * 60 * 1000));
+					_fill_lightbox_select(s,4,ev.end_date);
+				}
+				for(var i=0; i<4; i++) {
+					s[i].onchange = _update_lightbox_select;
+				}
+			}
+			
+			function _fill_lightbox_select(s,i,d){
+				s[i+0].value=Math.round((d.getHours()*60+d.getMinutes())/scheduler.config.time_step)*scheduler.config.time_step;	
+				s[i+1].value=d.getDate();
+				s[i+2].value=d.getMonth();
+				s[i+3].value=d.getFullYear();
+			}
+			
+			_fill_lightbox_select(s,0,ev.start_date);
+			_fill_lightbox_select(s,4,ev.end_date);
+		},
+		get_value:function(node,ev){
+			s=node.getElementsByTagName("select");
+			ev.start_date=new Date(s[3].value,s[2].value,s[1].value,0,s[0].value);
+			ev.end_date=new Date(s[7].value,s[6].value,s[5].value,0,s[4].value);
+			if (ev.end_date<=ev.start_date) 
+				ev.end_date=scheduler.date.add(ev.start_date,scheduler.config.time_step,"minute");
+		},
+		focus:function(node){
+			node.getElementsByTagName("select")[0].focus(); 
+		}
+	}
+}
+scheduler.showCover=function(box){
+	this.show_cover();
+	if (box){
+		box.style.display="block";
+		var pos = getOffset(this._obj);
+		box.style.top=Math.round(pos.top+(this._obj.offsetHeight-box.offsetHeight)/2)+"px";
+		box.style.left=Math.round(pos.left+(this._obj.offsetWidth-box.offsetWidth)/2)+"px";	
+	}
+}
+scheduler.showLightbox=function(id){
+	if (!id) return;
+	if (!this.callEvent("onBeforeLightbox",[id])) return;
+	var box = this._get_lightbox();
+	this.showCover(box);
+	this._fill_lightbox(id,box);
+	this.callEvent("onLightbox",[id]);
+}
+scheduler._fill_lightbox=function(id,box){ 
+	var ev=this.getEvent(id);
+	var s=box.getElementsByTagName("span");
+	if (scheduler.templates.lightbox_header){
+		s[1].innerHTML="";
+		s[2].innerHTML=scheduler.templates.lightbox_header(ev.start_date,ev.end_date,ev);
+	} else {
+		s[1].innerHTML=this.templates.event_header(ev.start_date,ev.end_date,ev);
+		s[2].innerHTML=(this.templates.event_bar_text(ev.start_date,ev.end_date,ev)||"").substr(0,70); //IE6 fix	
+	}
+	
+	
+	var sns = this.config.lightbox.sections;	
+	for (var i=0; i < sns.length; i++) {
+		var node=document.getElementById(sns[i].id).nextSibling;
+		var block=this.form_blocks[sns[i].type];
+		block.set_value.call(this,node,ev[sns[i].map_to],ev, sns[i])
+		if (sns[i].focus)
+			block.focus.call(this,node);
+	};
+	
+	scheduler._lightbox_id=id;
+}
+scheduler._lightbox_out=function(ev){
+	var sns = this.config.lightbox.sections;	
+	for (var i=0; i < sns.length; i++) {
+		var node=document.getElementById(sns[i].id).nextSibling;
+		var block=this.form_blocks[sns[i].type];
+		var res=block.get_value.call(this,node,ev, sns[i]);
+		if (sns[i].map_to!="auto")
+			ev[sns[i].map_to]=res;
+	}
+	return ev;
+}
+scheduler._empty_lightbox=function(){
+	var id=scheduler._lightbox_id;
+	var ev=this.getEvent(id);
+	var box=this._get_lightbox();
+	
+	this._lightbox_out(ev);
+	
+	ev._timed=this.is_one_day_event(ev);
+	this.setEvent(ev.id,ev);
+	this._edit_stop_event(ev,true)
+	this.render_view_data();
+}
+scheduler.hide_lightbox=function(id){
+	this.hideCover(this._get_lightbox());
+	this._lightbox_id=null;
+	this.callEvent("onAfterLightbox",[]);
+}
+scheduler.hideCover=function(box){
+	if (box) box.style.display="none";
+	this.hide_cover();
+}
+scheduler.hide_cover=function(){
+	if (this._cover) 
+		this._cover.parentNode.removeChild(this._cover);
+	this._cover=null;
+}
+scheduler.show_cover=function(){
+	this._cover=document.createElement("DIV");
+	this._cover.className="dhx_cal_cover";
+	document.body.appendChild(this._cover);
+}
+scheduler.save_lightbox=function(){
+	if (this.checkEvent("onEventSave") && 						!this.callEvent("onEventSave",[this._lightbox_id,this._lightbox_out({ id: this._lightbox_id}), this._new_event]))
+		return;
+	this._empty_lightbox()
+	this.hide_lightbox();
+};
+scheduler.startLightbox = function(id, box){
+	this._lightbox_id=id;
+	this.showCover(box);
+}
+scheduler.endLightbox = function(mode, box){
+	this._edit_stop_event(scheduler.getEvent(this._lightbox_id),mode);
+	if (mode)
+		scheduler.render_view_data();
+	this.hideCover(box);
+};
+scheduler.resetLightbox = function(){
+	scheduler._lightbox = null;
+};
+scheduler.cancel_lightbox=function(){
+	this.callEvent("onEventCancel",[this._lightbox_id, this._new_event]);
+	this.endLightbox(false);
+	this.hide_lightbox();
+};
+scheduler._init_lightbox_events=function(){
+	this._get_lightbox().onclick=function(e){
+		var src=e?e.target:event.srcElement;
+		if (!src.className) src=src.previousSibling;
+		if (src && src.className)
+			switch(src.className){
+				case "dhx_save_btn":
+					scheduler.save_lightbox();
+					break;
+				case "dhx_delete_btn":
+					var c=scheduler.locale.labels.confirm_deleting; 
+					if (!c||confirm(c)) {
+						scheduler.deleteEvent(scheduler._lightbox_id);
+						scheduler._new_event = null; //clear flag, if it was unsaved event
+						scheduler.hide_lightbox();
+					}
+					break;
+				case "dhx_cancel_btn":
+					scheduler.cancel_lightbox();
+					break;
+					
+				default:
+					if (src.className.indexOf("dhx_custom_button_")!=-1){
+						var index = src.parentNode.getAttribute("index");
+						var block=scheduler.form_blocks[scheduler.config.lightbox.sections[index].type];
+						var sec = src.parentNode.parentNode;
+						block.button_click(index,src,sec,sec.nextSibling);	
+					}
+			}
+	};
+	this._get_lightbox().onkeypress=function(e){
+		switch((e||event).keyCode){
+			case scheduler.keys.edit_save:
+				if ((e||event).shiftKey) return;
+				scheduler.save_lightbox();
+				break;
+			case scheduler.keys.edit_cancel:
+				scheduler.cancel_lightbox();
+				break;
+		}
+	}
+}
+scheduler.setLightboxSize=function(){
+	var d = this._lightbox;
+	if (!d) return;
+	
+	var con = d.childNodes[1];
+	con.style.height="0px";
+	con.style.height=con.scrollHeight+"px";		
+	d.style.height=con.scrollHeight+50+"px";		
+	con.style.height=con.scrollHeight+"px";		 //it is incredible , how ugly IE can be 	
+}
+
+scheduler._get_lightbox=function(){
+	if (!this._lightbox){
+		var d=document.createElement("DIV");
+		d.className="dhx_cal_light";
+		if (/msie|MSIE 6/.test(navigator.userAgent))
+			d.className+=" dhx_ie6";
+		d.style.visibility="hidden";
+		d.innerHTML=this._lightbox_template;
+		document.body.insertBefore(d,document.body.firstChild);
+		this._lightbox=d;
+		
+		var sns=this.config.lightbox.sections;
+		var html="";
+		for (var i=0; i < sns.length; i++) {
+			var block=this.form_blocks[sns[i].type];
+			if (!block) continue; //ignore incorrect blocks
+			sns[i].id="area_"+this.uid();
+			var button = "";
+			if (sns[i].button) button = "<div style='float:right;' class='dhx_custom_button' index='"+i+"'><div class='dhx_custom_button_"+sns[i].name+"'></div><div>"+this.locale.labels["button_"+sns[i].button]+"</div></div>";
+			html+="<div id='"+sns[i].id+"' class='dhx_cal_lsection'>"+button+this.locale.labels["section_"+sns[i].name]+"</div>"+block.render.call(this,sns[i]);
+		};
+		
+	
+		//localization
+		var ds=d.getElementsByTagName("div");
+		ds[4].innerHTML=scheduler.locale.labels.icon_save;
+		ds[7].innerHTML=scheduler.locale.labels.icon_cancel;
+		ds[10].innerHTML=scheduler.locale.labels.icon_delete;
+		//sections
+		ds[1].innerHTML=html;
+		//sizes
+		this.setLightboxSize();
+	
+		this._init_lightbox_events(this);
+		d.style.display="none";
+		d.style.visibility="visible";
+	}
+	return this._lightbox;
+}
+scheduler._lightbox_template="<div class='dhx_cal_ltitle'><span class='dhx_mark'>&nbsp;</span><span class='dhx_time'></span><span class='dhx_title'></span></div><div class='dhx_cal_larea'></div><div class='dhx_btn_set'><div class='dhx_save_btn'></div><div>&nbsp;</div></div><div class='dhx_btn_set'><div class='dhx_cancel_btn'></div><div>&nbsp;</div></div><div class='dhx_btn_set' style='float:right;'><div class='dhx_delete_btn'></div><div>&nbsp;</div></div>";
+scheduler._dp_init=function(dp){
+	dp._methods=["setEventTextStyle","","changeEventId","deleteEvent"];
+	
+	this.attachEvent("onEventAdded",function(id){
+		if (!this._loading && this.validId(id))
+			dp.setUpdated(id,true,"inserted");
+	});
+	this.attachEvent("onBeforeEventDelete",function(id){
+		if (!this.validId(id)) return;
+        var z=dp.getState(id);
+        
+		if (z=="inserted" || this._new_event) {  dp.setUpdated(id,false);		return true; }
+		if (z=="deleted")  return false;
+    	if (z=="true_deleted")  return true;
+    	
+		dp.setUpdated(id,true,"deleted");
+      	return false;
+	});
+	this.attachEvent("onEventChanged",function(id){
+		if (!this._loading && this.validId(id))
+			dp.setUpdated(id,true,"updated");
+	});
+	
+	dp._getRowData=function(id,pref){
+		var ev=this.obj.getEvent(id);
+		var data = {};
+		
+		for (var a in ev){
+			if (a.indexOf("_")==0) continue;
+			if (ev[a] && ev[a].getUTCFullYear) //not very good, but will work
+				data[a] = this.obj.templates.xml_format(ev[a]);
+			else
+				data[a] = ev[a];
+		}
+		
+		return data;
+	};
+	dp._clearUpdateFlag=function(){};
+	
+	dp.attachEvent("insertCallback", scheduler._update_callback);
+	dp.attachEvent("updateCallback", scheduler._update_callback);
+	dp.attachEvent("deleteCallback", function(upd, id) {
+		this.obj.setUserData(id, this.action_param, "true_deleted");
+		this.obj.deleteEvent(id);
+	});
+		
+};
+
+
+scheduler.setUserData=function(id,name,value){
+	if (id)
+		this.getEvent(id)[name]=value;
+	else
+		this._userdata[name]=value;
+};
+scheduler.getUserData=function(id,name){
+	return id?this.getEvent(id)[name]:this._userdata[name];
+};
+scheduler.setEventTextStyle=function(id,style){
+	this.for_rendered(id,function(r){
+		r.style.cssText+=";"+style;
+	});
+	var ev = this.getEvent(id);
+	ev["_text_style"]=style;
+	this.event_updated(ev);
+};
+scheduler.validId=function(id){
+	return true;
+};
+
+scheduler._update_callback = function(upd,id){
+	var data		=	scheduler.xmlNodeToJSON(upd.firstChild);
+	data.text		=	data.text||data._tagvalue;
+	data.start_date	=	scheduler.templates.xml_date(data.start_date);
+	data.end_date	=	scheduler.templates.xml_date(data.end_date);
+	
+	scheduler.addEvent(data);
+};
\ No newline at end of file

=== added directory 'addons/base_calendar/static/lib/dhtmlxScheduler/codebase/ext'
=== added file 'addons/base_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_active_links.js'
--- addons/base_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_active_links.js	1970-01-01 00:00:00 +0000
+++ addons/base_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_active_links.js	2011-04-07 05:03:24 +0000
@@ -0,0 +1,9 @@
+/*
+dhtmlxScheduler v.2.3
+
+This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
+to use it in not GPL project. Please contact sales@xxxxxxxxxx for details
+
+(c) DHTMLX Ltd.
+*/
+scheduler.attachEvent("onTemplatesReady",function(){var B=scheduler.date.str_to_date(scheduler.config.api_date);var C=scheduler.date.date_to_str(scheduler.config.api_date);var D=scheduler.templates.month_day;scheduler.templates.month_day=function(E){return"<a jump_to='"+C(E)+"' href='#'>"+D(E)+"</a>"};var A=scheduler.templates.week_scale_date;scheduler.templates.week_scale_date=function(E){return"<a jump_to='"+C(E)+"' href='#'>"+A(E)+"</a>"};dhtmlxEvent(this._obj,"click",function(E){var G=E.target||event.srcElement;var F=G.getAttribute("jump_to");if(F){scheduler.setCurrentView(B(F),"day")}})});
\ No newline at end of file

=== added file 'addons/base_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_agenda_view.js'
--- addons/base_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_agenda_view.js	1970-01-01 00:00:00 +0000
+++ addons/base_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_agenda_view.js	2011-04-07 05:03:24 +0000
@@ -0,0 +1,9 @@
+/*
+dhtmlxScheduler v.2.3
+
+This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
+to use it in not GPL project. Please contact sales@xxxxxxxxxx for details
+
+(c) DHTMLX Ltd.
+*/
+scheduler.date.add_agenda=function(A){return(new Date(A.valueOf()))};scheduler.dblclick_dhx_agenda_area=function(){if(!this.config.readonly&&this.config.dblclick_create){this.addEventNow()}};scheduler.templates.agenda_time=function(C,A,B){if(B._timed){return this.day_date(B.start_date,B.end_date,B)+" "+this.event_date(C)}else{return scheduler.templates.day_date(C)+" &ndash; "+scheduler.templates.day_date(A)}};scheduler.templates.agenda_text=function(A){return A.text};scheduler.date.agenda_start=function(A){return A};scheduler.attachEvent("onTemplatesReady",function(){scheduler.attachEvent("onSchedulerResize",function(){if(this._mode=="agenda"){this.agenda_view(true);return false}return true});var A=scheduler.render_data;scheduler.render_data=function(D){if(this._mode=="agenda"){B()}else{return A.apply(this,arguments)}};function C(E){if(E){var D=scheduler.locale.labels;scheduler._els.dhx_cal_header[0].innerHTML="<div class='dhx_agenda_line'><div>"+D.date+"</div><span style='padding-left:25px'>"+D.description+"</span></div>";scheduler._table_view=true;scheduler.set_sizes()}}function B(){var D=scheduler._date;var H=scheduler.get_visible_events();H.sort(function(J,I){return J.start_date>I.start_date?1:-1});var G="<div class='dhx_agenda_area'>";for(var F=0;F<H.length;F++){G+="<div class='dhx_agenda_line' event_id='"+H[F].id+"' style='"+(H[F]._text_style||"")+"'><div>"+scheduler.templates.agenda_time(H[F].start_date,H[F].end_date,H[F])+"</div>";G+="<div class='dhx_event_icon icon_details'>&nbsp</div>";G+="<span>"+scheduler.templates.agenda_text(H[F])+"</span></div>"}G+="<div class='dhx_v_border'></div></div>";scheduler._els.dhx_cal_data[0].scrollTop=0;scheduler._els.dhx_cal_data[0].innerHTML=G;var E=scheduler._els.dhx_cal_data[0].firstChild.childNodes;scheduler._els.dhx_cal_date[0].innerHTML="";scheduler._rendered=[];for(var F=0;F<E.length-1;F++){scheduler._rendered[F]=E[F]}}scheduler.agenda_view=function(D){scheduler._min_date=scheduler.config.agenda_start||(new Date());scheduler._max_date=scheduler.config.agenda_end||(new Date(9999,1,1));scheduler._table_view=true;C(D);if(D){B()}else{}}});
\ No newline at end of file

=== added file 'addons/base_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_collision.js'
--- addons/base_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_collision.js	1970-01-01 00:00:00 +0000
+++ addons/base_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_collision.js	2011-04-07 05:03:24 +0000
@@ -0,0 +1,1 @@
+(function(){var C,D;var B;scheduler.config.collision_limit=1;scheduler.attachEvent("onBeforeDrag",function(I){var H=scheduler._props?scheduler._props[this._mode]:null;var F=scheduler.matrix?scheduler.matrix[this._mode]:null;var G=H||F;if(H){var E=G.map_to}if(F){var E=G.y_property}if((G)&&I){C=this.getEvent(I)[E];D=this.getEvent(I).start_date}return true});scheduler.attachEvent("onBeforeLightbox",function(F){var E=scheduler.getEvent(F);B=[E.start_date,E.end_date];return true});scheduler.attachEvent("onEventChanged",function(F){if(!F){return true}var E=scheduler.getEvent(F);if(!A(E)){if(!B){return false}E.start_date=B[0];E.end_date=B[1];E._timed=this.is_one_day_event(E)}return true});scheduler.attachEvent("onBeforeEventChanged",function(E,F,G){return A(E)});scheduler.attachEvent("onEventSave",function(F,E){if(E.rec_type){scheduler._roll_back_dates(E)}return A(E)});function A(N){var Q=[];if(N.rec_type){var F=scheduler.getRecDates(N);for(var I=0;I<F.length;I++){var M=scheduler.getEvents(F[I].start_date,F[I].end_date);for(var J=0;J<M.length;J++){if((M[J].event_pid||M[J].id)!=N.id){Q.push(M[J])}}}Q.push(N)}else{Q=scheduler.getEvents(N.start_date,N.end_date)}var E=scheduler._props?scheduler._props[scheduler._mode]:null;var O=scheduler.matrix?scheduler.matrix[scheduler._mode]:null;var H=E||O;if(E){var G=H.map_to}if(O){var G=H.y_property}var P=true;if(H){var L=0;for(var K=0;K<Q.length;K++){if(Q[K][G]==N[G]){L++}}if(L>scheduler.config.collision_limit){scheduler._drag_event.start_date=D;N[G]=C;P=false}}else{if(Q.length>scheduler.config.collision_limit){P=false}}if(!P){return !scheduler.callEvent("onEventCollision",[N,Q])}return P}})();
\ No newline at end of file

=== added file 'addons/base_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_cookie.js'
--- addons/base_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_cookie.js	1970-01-01 00:00:00 +0000
+++ addons/base_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_cookie.js	2011-04-07 05:03:24 +0000
@@ -0,0 +1,9 @@
+/*
+dhtmlxScheduler v.2.3
+
+This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
+to use it in not GPL project. Please contact sales@xxxxxxxxxx for details
+
+(c) DHTMLX Ltd.
+*/
+(function(){function B(E,D,F){var G=E+"="+F+(D?("; "+D):"");document.cookie=G}function A(E){var F=E+"=";if(document.cookie.length>0){var G=document.cookie.indexOf(F);if(G!=-1){G+=F.length;var D=document.cookie.indexOf(";",G);if(D==-1){D=document.cookie.length}return document.cookie.substring(G,D)}}return""}var C=true;scheduler.attachEvent("onBeforeViewChange",function(F,E,D,I){if(C){C=false;var G=A("scheduler_settings");if(G){G=G.split("@");G[0]=this.templates.xml_date(G[0]);this.setCurrentView(G[0],G[1]);return false}}var H=this.templates.xml_format(I||E)+"@"+(D||F);B("scheduler_settings","expires=Sun, 31 Jan 9999 22:00:00 GMT",H);return true})})();
\ No newline at end of file

=== added file 'addons/base_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_editors.js'
--- addons/base_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_editors.js	1970-01-01 00:00:00 +0000
+++ addons/base_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_editors.js	2011-04-07 05:03:24 +0000
@@ -0,0 +1,9 @@
+/*
+dhtmlxScheduler v.2.3
+
+This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
+to use it in not GPL project. Please contact sales@xxxxxxxxxx for details
+
+(c) DHTMLX Ltd.
+*/
+scheduler.form_blocks.combo={render:function(B){var A="";A+="<div class='"+B.type+"' style='height:"+(B.height||20)+"px;' ></div>";return A},set_value:function(F,H,E,C){if(F._combo){F._combo.destructor()}window.dhx_globalImgPath=C.image_path||"/";F._combo=new dhtmlXCombo(F,C.name,F.offsetWidth-8);F._combo.enableFilteringMode(!!C.filtering,C.script_path||null,!!C.cache);if(!C.script_path){var G=[];for(var D=0;D<C.options.length;D++){var A=[];A.push(C.options[D].key);A.push(C.options[D].label);G.push(A)}F._combo.addOption(G);if(E[C.map_to]){var B=F._combo.getIndexByValue(E[C.map_to]);F._combo.selectOption(B)}}else{F._combo.setComboValue(E[C.map_to]||null)}},get_value:function(D,C,A){var B=D._combo.getSelectedValue();return B},focus:function(A){}};scheduler.form_blocks.radio={render:function(C){var B="";B+="<div class='"+C.type+"' style='height:"+C.height+"px;' >";for(var A=0;A<C.options.length;A++){var D=scheduler.uid();B+="<input id='"+D+"' type='radio' name='"+C.name+"' value='"+C.options[A].key+"'><label for='"+D+"'> "+C.options[A].label+"</label>";if(C.vertical){B+="<br/>"}}B+="</div>";return B},set_value:function(D,F,C,A){var E=D.getElementsByTagName("input");for(var B=0;B<E.length;B++){E[B].checked=false;if(E[B].value==C[A.map_to]){E[B].checked=true}}},get_value:function(D,C,A){var E=D.getElementsByTagName("input");for(var B=0;B<E.length;B++){if(E[B].checked){return E[B].value}}},focus:function(A){}};scheduler.form_blocks.checkbox={render:function(A){return""},set_value:function(C,D,B,A){var F=scheduler.uid();var E=false;if(typeof A.checked_value!="undefined"&&B[A.map_to]==A.checked_value){E=true}C.previousSibling.className+=" dhx_cal_checkbox";C.previousSibling.innerHTML="<input id='"+F+"' type='checkbox' value='true' name='"+A.name+"'"+((E)?"checked='true'":"")+"'><label for='"+F+"'>"+(scheduler.locale.labels["section_"+A.name]||A.name)+"</label>"},get_value:function(C,B,A){var D=C.previousSibling.getElementsByTagName("input")[0];return(D.checked)?(A.checked_value||true):(A.unchecked_value||false)},focus:function(A){}};
\ No newline at end of file

=== added file 'addons/base_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_expand.js'
--- addons/base_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_expand.js	1970-01-01 00:00:00 +0000
+++ addons/base_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_expand.js	2011-04-07 05:03:24 +0000
@@ -0,0 +1,9 @@
+/*
+dhtmlxScheduler v.2.3
+
+This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
+to use it in not GPL project. Please contact sales@xxxxxxxxxx for details
+
+(c) DHTMLX Ltd.
+*/
+scheduler.expand=function(){var A=scheduler._obj;do{A._position=A.style.position||"";A.style.position="static"}while((A=A.parentNode)&&A.style);A=scheduler._obj;A.style.position="absolute";A._width=A.style.width;A._height=A.style.height;A.style.width=A.style.height="100%";A.style.top=A.style.left="0px";var B=document.body;B.scrollTop=0;B=B.parentNode;if(B){B.scrollTop=0}document.body._overflow=document.body.style.overflow||"";document.body.style.overflow="hidden";scheduler._maximize()};scheduler.collapse=function(){var A=scheduler._obj;do{A.style.position=A._position}while((A=A.parentNode)&&A.style);A=scheduler._obj;A.style.width=A._width;A.style.height=A._height;document.body.style.overflow=document.body._overflow;scheduler._maximize()};scheduler.attachEvent("onTemplatesReady",function(){var A=document.createElement("DIV");A.className="dhx_expand_icon";scheduler.toggleIcon=A;scheduler._obj.appendChild(A);A.onclick=function(){if(!scheduler.expanded){scheduler.expand()}else{scheduler.collapse()}}});scheduler._maximize=function(){this.expanded=!this.expanded;this.toggleIcon.style.backgroundPosition="0px "+(this._expand?"0":"18")+"px";if(scheduler.callEvent("onSchedulerResize",[])){scheduler.update_view()}};
\ No newline at end of file

=== added file 'addons/base_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_ext.css'
--- addons/base_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_ext.css	1970-01-01 00:00:00 +0000
+++ addons/base_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_ext.css	2011-04-07 05:03:24 +0000
@@ -0,0 +1,1 @@
+.dhx_expand_icon{position:absolute;top:0;right:0;background-image:url(../imgs/colapce-expand-icon.gif);width:18px;height:18px;cursor:pointer;background-position:0 18px;z-index:16;}.dhx_agenda_area{width:100%;height:100%;overflow-y:auto;background-image:url(../imgs/databg.png);}.dhx_agenda_line{height:21px;clear:both;overflow:hidden;}.dhx_agenda_line div{float:left;width:188px;border-right:1px dotted #8894A3;text-align:center;line-height:21px;overflow:hidden;}.dhx_agenda_area .dhx_agenda_line div{border-right:0 dotted #8894A3;}.dhx_v_border{position:absolute;left:186px;top:0;border-right:1px dotted #8894A3;width:1px;height:100%;}.dhx_agenda_line .dhx_event_icon{width:20px;border-width:0;background:url(../imgs/icon.png) no-repeat;background-position:5px 4px;cursor:pointer;}.dhx_agenda_line span{padding-left:5px;line-height:21px;}.dhx_year_body{border-left:1px dotted #586A7E;}.dhx_year_week{height:20px;position:relative;}.dhx_scale_bar_last{border-right:1px dotted #586A7E;}.dhx_year_month{height:18px;padding-top:3px;border:1px dotted #586A7E;text-align:center;vertical-align:middle;}.dhx_year_body .dhx_before .dhx_month_head,.dhx_year_body .dhx_after .dhx_month_head,.dhx_year_body .dhx_before .dhx_month_head a,.dhx_year_body .dhx_after .dhx_month_head a{color:#E2E3E6!important;}.dhx_year_body .dhx_month_body{height:0;overflow:hidden;}.dhx_month_head.dhx_year_event{background-color:#FFE763;}.dhx_year_body .dhx_before .dhx_month_head,.dhx_year_body .dhx_after .dhx_month_head{cursor:default;}.dhx_tooltip{border:1px solid #BBB;background-image:url(../imgs/databg.png);position:absolute;z-index:9998;width:300px;height:auto;font-family:Tahoma;font-size:8pt;overflow:hidden;}.dhx_tooltip_line{line-height:20px;height:20px;overflow:hidden;}.dhx_tooltip_line .dhx_event_icon{width:20px;height:20px;padding-right:10px;float:left;border-width:0;position:relative;background:url(../imgs/icon.png) no-repeat;background-position:5px 4px;cursor:pointer;}.dhx_tooltip_date{float:left;width:auto;padding-left:5px;text-align:center;}.dhx_text_disabled{color:#887A2E;font-family:Tahoma;font-size:8pt;}.dhx_mini_calendar{-moz-box-shadow:5px 5px 5px #888;-khtml-box-shadow:5px 5px 5px #888;}.dhx_mini_calendar .dhx_month_head{cursor:pointer;}.dhx_mini_calendar .dhx_calendar_click{background-color:#C2D5FC;}.dhx_cal_navline div.dhx_minical_icon{width:18px;height:18px;left:190px;top:1px;cursor:pointer;background-image:url(../imgs/calendar.gif);}.dhx_matrix_cell,.dhx_matrix_scell{overflow:hidden;text-align:center;vertical-align:middle;border-bottom:1px dotted #8894A3;border-right:1px dotted #8894A3;}.dhx_matrix_cell{background-color:white;}.dhx_matrix_cell div,.dhx_matrix_scell div{overflow:hidden;text-align:center;width:100%;height:auto;}.dhx_cal_lsection .dhx_readonly{font-size:9pt;font-size:8pt;padding:2px;color:#887A2E;}.dhx_matrix_scell.folder,.dhx_data_table.folder .dhx_matrix_cell{background-color:#969394;cursor:pointer;}.dhx_matrix_scell .dhx_scell_level0{padding-left:5px;}.dhx_matrix_scell .dhx_scell_level1{padding-left:20px;}.dhx_matrix_scell .dhx_scell_level2{padding-left:35px;}.dhx_matrix_scell.folder{font-weight:bold;text-align:left;}.dhx_matrix_scell.folder .dhx_scell_expand{float:left;width:10px;padding-right:3px;}.dhx_matrix_scell.folder .dhx_scell_name{float:left;width:auto;}.dhx_matrix_scell.item .dhx_scell_name{padding-left:15px;text-align:left;}.dhx_section_timeline{overflow:hidden;padding:4px 0 2px 10px;}.dhx_section_timeline select{width:552px;}.dhx_map_area{width:100%;height:100%;overflow-y:auto;overflow-x:hidden;background-image:url(../imgs/databg.png);}.dhx_map_line .dhx_event_icon{width:20px;border-width:0;background:url(../imgs/icon.png) no-repeat;background-position:5px 4px;cursor:pointer;}.dhx_map_line{height:21px;clear:both;overflow:hidden;}.dhx_map{position:absolute;}.dhx_map_line div{float:left;border-right:1px dotted #8894A3;text-align:center;line-height:21px;overflow:hidden;}.dhx_map_line .headline_description{float:left;border-right:1px dotted #8894A3;text-align:center;line-height:21px;overflow:hidden;}.dhx_map_line .dhx_map_description{float:left;border-right:0 dotted #8894A3;text-align:center;line-height:21px;overflow:hidden;}.dhx_map_line .line_description{float:left;border-right:1px dotted #8894A3;text-align:left;padding-left:5px;line-height:21px;overflow:hidden;}.dhx_map_line.highlight{background-color:#C4C5CC;}.dhx_map_area .dhx_map_line div{border-right:0 dotted #8894A3;}.dhtmlXTooltip.tooltip{-moz-box-shadow:3px 3px 3px #888;-khtml-box-shadow:3px 3px 3px #888;background-color:white;border-left:1px dotted #887A2E;border-top:1px dotted #887A2E;color:#887A2E;cursor:default;padding:10px;position:absolute;z-index:500;}.dhx_cal_checkbox label{padding-left:5px;}.dhx_cal_light .radio{padding:2px 0 2px 10px;}.dhx_cal_light .radio input,.dhx_cal_light .radio label{line-height:15px;}.dhx_cal_light .radio input{vertical-align:middle;margin:0;padding:0;}.dhx_cal_light .radio label{vertical-align:middle;padding-right:10px;}.dhx_cal_light .combo{padding:4px;}
\ No newline at end of file

=== added file 'addons/base_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_html_templates.js'
--- addons/base_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_html_templates.js	1970-01-01 00:00:00 +0000
+++ addons/base_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_html_templates.js	2011-04-07 05:03:24 +0000
@@ -0,0 +1,9 @@
+/*
+dhtmlxScheduler v.2.3
+
+This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
+to use it in not GPL project. Please contact sales@xxxxxxxxxx for details
+
+(c) DHTMLX Ltd.
+*/
+scheduler.attachEvent("onTemplatesReady",function(){var B=document.body.getElementsByTagName("DIV");for(var A=0;A<B.length;A++){var C=B[A].className||"";C=C.split(":");if(C.length==2&&C[0]=="template"){var D='return "'+(B[A].innerHTML||"").replace(/\"/g,'\\"').replace(/[\n\r]+/g,"")+'";';D=unescape(D).replace(/\{event\.([a-z]+)\}/g,function(F,E){return'"+ev.'+E+'+"'});scheduler.templates[C[1]]=Function("start","end","ev",D);B[A].style.display="none"}}});
\ No newline at end of file

=== added file 'addons/base_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_key_nav.js'
--- addons/base_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_key_nav.js	1970-01-01 00:00:00 +0000
+++ addons/base_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_key_nav.js	2011-04-07 05:03:24 +0000
@@ -0,0 +1,9 @@
+/*
+dhtmlxScheduler v.2.3
+
+This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
+to use it in not GPL project. Please contact sales@xxxxxxxxxx for details
+
+(c) DHTMLX Ltd.
+*/
+(function(){var A=false;scheduler.attachEvent("onBeforeLightbox",function(){A=true;return true});scheduler.attachEvent("onAfterLightbox",function(){A=false;return true});dhtmlxEvent(document,(_isOpera?"keypress":"keydown"),function(D){D=D||event;if(!A){if(D.keyCode==37||D.keyCode==39){D.cancelBubble=true;var B=scheduler.date.add(scheduler._date,(D.keyCode==37?-1:1),scheduler._mode);scheduler.setCurrentView(B);return true}else{if(D.ctrlKey&&D.keyCode==67){scheduler._copy_id=scheduler._select_id}else{if(D.ctrlKey&&D.keyCode==86){var C=scheduler.getEvent(scheduler._copy_id);if(C){var E=scheduler._copy_event(C);E.id=scheduler.uid();scheduler.addEvent(E)}}}}}})})();
\ No newline at end of file

=== added file 'addons/base_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_limit.js'
--- addons/base_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_limit.js	1970-01-01 00:00:00 +0000
+++ addons/base_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_limit.js	2011-04-07 05:03:24 +0000
@@ -0,0 +1,9 @@
+/*
+dhtmlxScheduler v.2.3
+
+This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
+to use it in not GPL project. Please contact sales@xxxxxxxxxx for details
+
+(c) DHTMLX Ltd.
+*/
+scheduler.config.limit_start=new Date(-3999,0,0);scheduler.config.limit_end=new Date(3999,0,0);scheduler.config.limit_view=false;(function(){var B=null;scheduler.attachEvent("onBeforeViewChange",function(E,D,C,F){F=F||D;C=C||E;if(scheduler.config.limit_view){if(F.valueOf()>scheduler.config.limit_end.valueOf()||this.date.add(F,1,C)<=scheduler.config.limit_start.valueOf()){setTimeout(function(){scheduler.setCurrentView(scheduler._date,C)},1);return false}}return true});var A=function(D){var E=scheduler.config;var C=(D.start_date.valueOf()>=E.limit_start.valueOf()&&D.end_date.valueOf()<=E.limit_end.valueOf());if(!C){scheduler._drag_id=null;scheduler._drag_mode=null;scheduler.callEvent("onLimitViolation",[D.id,D])}return C};scheduler.attachEvent("onBeforeDrag",function(C){if(!C){return true}return A(scheduler.getEvent(C))});scheduler.attachEvent("onClick",function(D,C){return A(scheduler.getEvent(D))});scheduler.attachEvent("onBeforeLightbox",function(D){var C=scheduler.getEvent(D);B=[C.start_date,C.end_date];return A(C)});scheduler.attachEvent("onEventAdded",function(D){if(!D){return true}var C=scheduler.getEvent(D);if(!A(C)){if(C.start_date<scheduler.config.limit_start){C.start_date=new Date(scheduler.config.limit_start)}if(C.end_date>scheduler.config.limit_end){C.end_date=new Date(scheduler.config.limit_end);C._timed=this.is_one_day_event(C)}if(C.start_date>C.end_date){C.end_date=this.date.add(C.start_date,(this.config.event_duration||this.config.time_step),"minute")}}return true});scheduler.attachEvent("onEventChanged",function(D){if(!D){return true}var C=scheduler.getEvent(D);if(!A(C)){if(!B){return false}C.start_date=B[0];C.end_date=B[1];C._timed=this.is_one_day_event(C)}return true});scheduler.attachEvent("onBeforeEventChanged",function(D,C,E){return A(D)})})();
\ No newline at end of file

=== added file 'addons/base_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_map_view.js'
--- addons/base_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_map_view.js	1970-01-01 00:00:00 +0000
+++ addons/base_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_map_view.js	2011-04-07 05:03:24 +0000
@@ -0,0 +1,9 @@
+/*
+dhtmlxScheduler v.2.3
+
+This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
+to use it in not GPL project. Please contact sales@xxxxxxxxxx for details
+
+(c) DHTMLX Ltd.
+*/
+scheduler.xy.map_date_width=188;scheduler.xy.map_description_width=400;scheduler.config.map_resolve_event_location=true;scheduler.config.map_resolve_user_location=true;scheduler.config.map_initial_position=new google.maps.LatLng(48.724,8.215);scheduler.config.map_error_position=new google.maps.LatLng(15,15);scheduler.config.map_infowindow_max_width=300;scheduler.config.map_type=google.maps.MapTypeId.ROADMAP;scheduler.config.map_zoom_after_resolve=15;scheduler.locale.labels.marker_geo_success="It seems you are here.";scheduler.locale.labels.marker_geo_fail="Sorry, could not get your current position using geolocation.";scheduler.templates.marker_date=scheduler.date.date_to_str("%Y-%m-%d %H:%i");scheduler.templates.marker_text=function(C,A,B){return"<div><b>"+B.text+"</b><br/><br/>"+(B.event_location||"")+"<br/><br/>"+scheduler.templates.marker_date(C)+" - "+scheduler.templates.marker_date(A)+"</div>"};scheduler.dblclick_dhx_map_area=function(){if(!this.config.readonly&&this.config.dblclick_create){this.addEventNow()}};scheduler.templates.map_time=function(C,A,B){if(B._timed){return this.day_date(B.start_date,B.end_date,B)+" "+this.event_date(C)}else{return scheduler.templates.day_date(C)+" &ndash; "+scheduler.templates.day_date(A)}};scheduler.templates.map_text=function(A){return A.text};scheduler.date.map_start=function(A){return A};scheduler.attachEvent("onTemplatesReady",function(){function D(){_isPositionSet=false;var H=document.createElement("div");H.className="dhx_map";H.id="dhx_gmap";H.style.dispay="none";node=document.getElementById("scheduler_here");node.appendChild(H);scheduler._els.dhx_gmap=[];scheduler._els.dhx_gmap.push(H);C("dhx_gmap");var G={zoom:scheduler.config.map_inital_zoom||10,center:scheduler.config.map_initial_position,mapTypeId:scheduler.config.map_type||google.maps.MapTypeId.ROADMAP};map=new google.maps.Map(document.getElementById("dhx_gmap"),G);map.disableDefaultUI=false;map.disableDoubleClickZoom=true;google.maps.event.addListener(map,"dblclick",function(J){if(!scheduler.config.readonly&&scheduler.config.dblclick_create){point=J.latLng;geocoder.geocode({latLng:point},function(L,K){if(K==google.maps.GeocoderStatus.OK){point=L[0].geometry.location;scheduler.addEventNow({lat:point.lat(),lng:point.lng(),event_location:L[0].formatted_address})}})}});var I={content:""};if(scheduler.config.map_infowindow_max_width){I.maxWidth=scheduler.config.map_infowindow_max_width}scheduler.map={_points:[],_markers:[],_infowindow:new google.maps.InfoWindow(I),_infowindows_content:[],_initialization_count:-1};geocoder=new google.maps.Geocoder();if(scheduler.config.map_resolve_user_location){if(navigator.geolocation){if(!_isPositionSet){navigator.geolocation.getCurrentPosition(function(J){var K=new google.maps.LatLng(J.coords.latitude,J.coords.longitude);map.setCenter(K);map.setZoom(scheduler.config.map_zoom_after_resolve||10);scheduler.map._infowindow.setContent(scheduler.locale.labels.marker_geo_success);scheduler.map._infowindow.position=map.getCenter();scheduler.map._infowindow.open(map);_isPositionSet=true},function(){scheduler.map._infowindow.setContent(scheduler.locale.labels.marker_geo_fail);scheduler.map._infowindow.setPosition(map.getCenter());scheduler.map._infowindow.open(map);_isPositionSet=true})}}}google.maps.event.addListener(map,"resize",function(J){H.style.zIndex="5";map.setZoom(map.getZoom())});google.maps.event.addListener(map,"tilesloaded",function(J){H.style.zIndex="5"})}D();scheduler.attachEvent("onSchedulerResize",function(){if(this._mode=="map"){this.map_view(true)}});var A=scheduler.render_data;scheduler.render_data=function(G,J){if(this._mode=="map"){E();var I=scheduler.get_visible_events();for(var H=0;H<I.length;H++){if(!scheduler.map._markers[I[H].id]){B(I[H],false,false)}}}else{return A.apply(this,arguments)}};function F(H){if(H){var G=scheduler.locale.labels;scheduler._els.dhx_cal_header[0].innerHTML="<div class='dhx_map_line' style='width: "+(scheduler.xy.map_date_width+scheduler.xy.map_description_width+2)+"px;' ><div style='width: "+scheduler.xy.map_date_width+"px;'>"+G.date+"</div><div class='headline_description' style='width: "+scheduler.xy.map_description_width+"px;'>"+G.description+"</div></div>";scheduler._table_view=true;scheduler.set_sizes()}}function E(){var H=scheduler._date;var L=scheduler.get_visible_events();L.sort(function(N,M){return N.start_date>M.start_date?1:-1});var K="<div class='dhx_map_area'>";for(var J=0;J<L.length;J++){var G=(L[J].id==scheduler._selected_event_id)?"dhx_map_line highlight":"dhx_map_line";K+="<div class='"+G+"' event_id='"+L[J].id+"' style='"+(L[J]._text_style||"")+" width: "+(scheduler.xy.map_date_width+scheduler.xy.map_description_width+2)+"px;'><div style='width: "+scheduler.xy.map_date_width+"px;' >"+scheduler.templates.map_time(L[J].start_date,L[J].end_date,L[J])+"</div>";K+="<div class='dhx_event_icon icon_details'>&nbsp</div>";K+="<div class='line_description' style='width:"+(scheduler.xy.map_description_width-25)+"px;'>"+scheduler.templates.map_text(L[J])+"</div></div>"}K+="<div class='dhx_v_border' style='left: "+(scheduler.xy.map_date_width-2)+"px;'></div><div class='dhx_v_border_description'></div></div>";scheduler._els.dhx_cal_data[0].scrollTop=0;scheduler._els.dhx_cal_data[0].innerHTML=K;scheduler._els.dhx_cal_data[0].style.width=(scheduler.xy.map_date_width+scheduler.xy.map_description_width+1)+"px";var I=scheduler._els.dhx_cal_data[0].firstChild.childNodes;scheduler._els.dhx_cal_date[0].innerHTML="";scheduler._rendered=[];for(var J=0;J<I.length-2;J++){scheduler._rendered[J]=I[J]}}function C(G){var H=document.getElementById(G);H.style.height=(scheduler._y-scheduler.xy.nav_height)+"px";H.style.width=(scheduler._x-scheduler.xy.map_date_width-scheduler.xy.map_description_width-1)+"px";H.style.marginLeft=(scheduler.xy.map_date_width+scheduler.xy.map_description_width+1)+"px";H.style.marginTop=(scheduler.xy.nav_height+2)+"px"}scheduler.map_view=function(J){scheduler.map._initialization_count++;var I=scheduler._els.dhx_gmap[0];scheduler._els.dhx_cal_data[0].style.width=(scheduler.xy.map_date_width+scheduler.xy.map_description_width+1)+"px";scheduler._min_date=scheduler.config.map_start||(new Date());scheduler._max_date=scheduler.config.map_end||(new Date(9999,1,1));scheduler._table_view=true;F(J);if(J){E();I.style.display="block";C("dhx_gmap");var H=scheduler.get_visible_events();for(var G=0;G<H.length;G++){if(!scheduler.map._markers[H[G].id]){B(H[G])}}}else{I.style.display="none"}google.maps.event.trigger(map,"resize");if(scheduler.map._initialization_count===0){map.setCenter(scheduler.config.map_initial_position)}};function B(K,H,I){if(K.lat&&K.lng){var G=new google.maps.LatLng(K.lat,K.lng)}else{var G=scheduler.config.map_error_position}var J=scheduler.templates.marker_text(K.start_date,K.end_date,K);if(!scheduler._new_event){scheduler.map._markers[K.id]=new google.maps.Marker({position:G,map:map});scheduler.map._infowindows_content[K.id]=J;google.maps.event.addListener(scheduler.map._markers[K.id],"click",function(){scheduler.map._infowindow.setContent(scheduler.map._infowindows_content[K.id]);scheduler.map._infowindow.open(map,scheduler.map._markers[K.id]);scheduler._selected_event_id=K.id;scheduler.render_data()});scheduler.map._points[K.id]=G;if(H){map.setCenter(scheduler.map._points[K.id])}if(I){scheduler.callEvent("onClick",[K.id])}}}scheduler.attachEvent("onClick",function(I,G){if(this._mode=="map"){scheduler._selected_event_id=I;for(var H=0;H<scheduler._rendered.length;H++){scheduler._rendered[H].className="dhx_map_line";if(scheduler._rendered[H].getAttribute("event_id")==I){scheduler._rendered[H].className+=" highlight"}}if(scheduler.map._points[I]&&scheduler.map._markers[I]){map.panTo(scheduler.map._points[I]);google.maps.event.trigger(scheduler.map._markers[I],"click")}}return true});_displayEventOnMap=function(G){if(G.event_location&&geocoder){geocoder.geocode({address:G.event_location},function(J,I){var H={};if(I!=google.maps.GeocoderStatus.OK){H=scheduler.callEvent("onLocationError",[G.id]);if(!H||H===true){H=scheduler.config.map_error_position}}else{H=J[0].geometry.location}G.lat=H.lat();G.lng=H.lng();scheduler._selected_event_id=G.id;B(G,true,true);dp.setUpdated(G.id,true,"updated")})}else{B(G,true,true)}};_updateEventLocation=function(G){if(G.event_location&&geocoder){geocoder.geocode({address:G.event_location},function(J,I){var H={};if(I!=google.maps.GeocoderStatus.OK){H=scheduler.callEvent("onLocationError",[G.id]);if(!H||H===true){H=scheduler.config.map_error_position}}else{H=J[0].geometry.location}G.lat=H.lat();G.lng=H.lng();dp.setUpdated(G.id,true,"updated")})}};_delay=function(J,H,I,G){setTimeout(function(){var K=J.apply(H,I);J=obj=I=null;return K},G||1000)};scheduler.attachEvent("onEventChanged",function(H,I){if(scheduler.is_visible_events(scheduler.getEvent(H))){scheduler.map._markers[H].setMap(null);var G=scheduler.getEvent(H);_displayEventOnMap(G)}else{scheduler.map._infowindow.close();scheduler.map._markers[H].setMap(null)}return true});scheduler.attachEvent("onEventIdChange",function(H,G){if(scheduler.is_visible_events(scheduler.getEvent(G))){if(scheduler.map._markers[H]){scheduler.map._markers[H].setMap(null)}var I=scheduler.getEvent(G);_displayEventOnMap(I)}return true});scheduler.attachEvent("onBeforeEventDelete",function(G,H){if(scheduler.map._markers[G]){scheduler.map._markers[G].setMap(null)}scheduler.map._infowindow.close();return true});scheduler._event_resolve_delay=500;scheduler.attachEvent("onEventLoading",function(G){if(scheduler.config.map_resolve_event_location&&G.event_location&&!G.lat&&!G.lng){scheduler._event_resolve_delay+=500;_delay(_updateEventLocation,this,[G],scheduler._event_resolve_delay)}return true});scheduler.attachEvent("onEventCancel",function(G,H){if(H){if(scheduler.map._markers[G]){scheduler.map._markers[G].setMap(null)}scheduler.map._infowindow.close()}return true})});
\ No newline at end of file

=== added file 'addons/base_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_minical.js'
--- addons/base_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_minical.js	1970-01-01 00:00:00 +0000
+++ addons/base_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_minical.js	2011-04-07 05:03:24 +0000
@@ -0,0 +1,9 @@
+/*
+dhtmlxScheduler v.2.3
+
+This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
+to use it in not GPL project. Please contact sales@xxxxxxxxxx for details
+
+(c) DHTMLX Ltd.
+*/
+scheduler.templates.calendar_month=scheduler.date.date_to_str("%F %Y");scheduler.templates.calendar_scale_date=scheduler.date.date_to_str("%D");scheduler.templates.calendar_date=scheduler.date.date_to_str("%d");scheduler.renderCalendar=function(G,A){var B=null;var D=G.date||(new Date());if(typeof D=="string"){D=this.templates.api_date(D)}if(!A){var M=G.container;var K=G.position;if(typeof M=="string"){M=document.getElementById(M)}if(typeof K=="string"){K=document.getElementById(K)}if(K&&(typeof K.left=="undefined")){var H=getOffset(K);K={top:H.top+K.offsetHeight,left:H.left}}if(!M){M=scheduler._get_def_cont(K)}B=this._render_calendar(M,D,G);B.onclick=function(P){P=P||event;var Q=P.target||P.srcElement;if(Q.className.indexOf("dhx_month_head")!=-1){var O=Q.parentNode.className;if(O.indexOf("dhx_after")==-1&&O.indexOf("dhx_before")==-1){var N=scheduler.templates.xml_date(this.getAttribute("date"));N.setDate(parseInt(Q.innerHTML,10));scheduler.unmarkCalendar(this);scheduler.markCalendar(this,N,"dhx_calendar_click");this._last_date=N;if(this.conf.handler){this.conf.handler.call(scheduler,N,this)}}}}}else{B=this._render_calendar(A.parentNode,D,G,A);scheduler.unmarkCalendar(B)}var C=scheduler.date.month_start(D);var E=scheduler.date.add(C,1,"month");var L=this.getEvents(C,E);for(var F=0;F<L.length;F++){var J=L[F];var I=J.start_date;if(I.valueOf()<C.valueOf()){I=C}while(I<=J.end_date){this.markCalendar(B,I,"dhx_year_event");I=this.date.add(I,1,"day");if(I.valueOf()>=E.valueOf()){break}}}B.conf=G;return B};scheduler._get_def_cont=function(A){if(!this._def_count){this._def_count=document.createElement("DIV");this._def_count.style.cssText="position:absolute;z-index:10100;width:251px; height:175px;";this._def_count.onclick=function(B){(B||event).cancelBubble=true};document.body.appendChild(this._def_count)}this._def_count.style.left=A.left+"px";this._def_count.style.top=A.top+"px";this._def_count._created=new Date();return this._def_count};scheduler._locateCalendar=function(C,A){var B=C.childNodes[2].childNodes[0];if(typeof A=="string"){A=scheduler.templates.api_date(A)}var D=C.week_start+A.getDate()-1;return B.rows[Math.floor(D/7)].cells[D%7].firstChild};scheduler.markCalendar=function(C,A,B){this._locateCalendar(C,A).className+=" "+B};scheduler.unmarkCalendar=function(D,A,B){A=A||D._last_date;B=B||"dhx_calendar_click";if(!A){return }var C=this._locateCalendar(D,A);C.className=(C.className||"").replace(RegExp(B,"g"))};scheduler._week_template=function(B){var F=(B||250);var E=0;var C=document.createElement("div");var D=this.date.week_start(new Date());for(var A=0;A<7;A++){this._cols[A]=Math.floor(F/(7-A));this._render_x_header(A,E,D,C);D=this.date.add(D,1,"day");F-=this._cols[A];E+=this._cols[A]}C.lastChild.className+=" dhx_scale_bar_last";return C};scheduler.updateCalendar=function(B,A){B.conf.date=A;this.renderCalendar(B.conf,B)};scheduler._mini_cal_arrows=["&nbsp","&nbsp"];scheduler._render_calendar=function(G,A,F,D){var B=scheduler.templates;var K=this._cols;this._cols=[];var S=this._mode;this._mode="calendar";var R=this._colsS;this._colsS={height:0};var Q=new Date(this._min_date);var O=new Date(this._max_date);var N=new Date(scheduler._date);var L=B.month_day;B.month_day=B.calendar_date;A=this.date.month_start(A);var E=this._week_template(G.offsetWidth-1);var M;if(D){M=D}else{var M=document.createElement("DIV");M.className="dhx_cal_container dhx_mini_calendar"}M.setAttribute("date",this.templates.xml_format(A));M.innerHTML="<div class='dhx_year_month'></div><div class='dhx_year_week'>"+E.innerHTML+"</div><div class='dhx_year_body'></div>";M.childNodes[0].innerHTML=this.templates.calendar_month(A);if(F.navigation){var C=document.createElement("DIV");C.className="dhx_cal_prev_button";C.style.cssText="left:1px;top:2px;position:absolute;";C.innerHTML=this._mini_cal_arrows[0];M.firstChild.appendChild(C);C.onclick=function(){scheduler.updateCalendar(M,scheduler.date.add(M._date,-1,"month"))};C=document.createElement("DIV");C.className="dhx_cal_next_button";C.style.cssText="left:auto; right:1px;top:2px;position:absolute;";C.innerHTML=this._mini_cal_arrows[1];M.firstChild.appendChild(C);C.onclick=function(){scheduler.updateCalendar(M,scheduler.date.add(M._date,1,"month"))};M._date=new Date(A)}M.week_start=(A.getDay()-(this.config.start_on_monday?1:0)+7)%7;var P=this.date.week_start(A);this._reset_month_scale(M.childNodes[2],A,P);var I=M.childNodes[2].firstChild.rows;for(var J=I.length;J<6;J++){I[0].parentNode.appendChild(I[0].cloneNode(true));for(var H=0;H<I[J].childNodes.length;H++){I[J].childNodes[H].className="dhx_after"}}if(!D){G.appendChild(M)}this._cols=K;this._mode=S;this._colsS=R;this._min_date=Q;this._max_date=O;scheduler._date=N;B.month_day=L;return M};scheduler.destroyCalendar=function(B,A){if(!B&&this._def_count&&this._def_count.firstChild){if(A||(new Date()).valueOf()-this._def_count._created.valueOf()>500){B=this._def_count.firstChild}}if(!B){return }B.onclick=null;B.innerHTML="";if(B.parentNode){B.parentNode.removeChild(B)}if(this._def_count){this._def_count.style.top="-1000px"}};scheduler.isCalendarVisible=function(){if(this._def_count&&parseInt(this._def_count.style.top,10)>0){return this._def_count}return false};scheduler.attachEvent("onTemplatesReady",function(){dhtmlxEvent(document.body,"click",function(){scheduler.destroyCalendar()})});scheduler.templates.calendar_time=scheduler.date.date_to_str("%d-%m-%Y");scheduler.form_blocks.calendar_time={render:function(){var D="<input class='dhx_readonly' type='text' readonly='true'>";var B=scheduler.config;var E=this.date.date_part(new Date());if(B.first_hour){E.setHours(B.first_hour)}D+=" <select>";for(var C=60*B.first_hour;C<60*B.last_hour;C+=this.config.time_step*1){var F=this.templates.time_picker(E);D+="<option value='"+C+"'>"+F+"</option>";E=this.date.add(E,this.config.time_step,"minute")}D+="</select>";var A=scheduler.config.full_day;return"<div style='height:30px; padding-top:0px; font-size:inherit;' class='dhx_cal_lsection dhx_section_time'>"+D+"<span style='font-weight:normal; font-size:10pt;'> &nbsp;&ndash;&nbsp; </span>"+D+"</div>"},set_value:function(B,K,H){var D=B.getElementsByTagName("input");var F=B.getElementsByTagName("select");var A=function(N,L,M){N.onclick=function(){scheduler.destroyCalendar(null,true);scheduler.renderCalendar({position:N,date:new Date(this._date),navigation:true,handler:function(O){N.value=scheduler.templates.calendar_time(O);N._date=new Date(O);scheduler.destroyCalendar();if(scheduler.config.event_duration&&M==0){J()}}})}};if(scheduler.config.full_day){if(!B._full_day){B.previousSibling.innerHTML+="<div class='dhx_fullday_checkbox'><label><input type='checkbox' name='full_day' value='true'> "+scheduler.locale.labels.full_day+"&nbsp;</label></input></div>";B._full_day=true}var I=B.previousSibling.getElementsByTagName("input")[0];var E=(scheduler.date.time_part(H.start_date)==0&&scheduler.date.time_part(H.end_date)==0&&H.end_date.valueOf()-H.start_date.valueOf()<2*24*60*60*1000);I.checked=E;for(var C in F){F[C].disabled=I.checked}for(var C=0;C<D.length-1;C++){D[C].disabled=I.checked}I.onclick=function(){if(I.checked==true){var M=new Date(H.start_date);var P=new Date(H.end_date);scheduler.date.date_part(M);P=scheduler.date.add(M,1,"day")}var O=M||H.start_date;var L=P||H.end_date;G(D[0],O);G(D[1],L);F[0].value=O.getHours()*60+O.getMinutes();F[1].value=L.getHours()*60+L.getMinutes();for(var N in F){F[N].disabled=I.checked}for(var N=0;N<D.length-1;N++){D[N].disabled=I.checked}}}if(scheduler.config.event_duration){function J(){H.start_date=scheduler.date.add(D[0]._date,F[0].value,"minute");H.end_date.setTime(H.start_date.getTime()+(scheduler.config.event_duration*60*1000));D[1].value=scheduler.templates.calendar_time(H.end_date);D[1]._date=scheduler.date.date_part(new Date(H.end_date));F[1].value=H.end_date.getHours()*60+H.end_date.getMinutes()}for(var C in F){F[C].onchange=J}}function G(N,L,M){A(N,L,M);N.value=scheduler.templates.calendar_time(L);N._date=scheduler.date.date_part(new Date(L))}G(D[0],H.start_date,0);G(D[1],H.end_date,1);A=function(){};F[0].value=H.start_date.getHours()*60+H.start_date.getMinutes();F[1].value=H.end_date.getHours()*60+H.end_date.getMinutes()},get_value:function(D,C){var A=D.getElementsByTagName("input");var B=D.getElementsByTagName("select");C.start_date=scheduler.date.add(A[0]._date,B[0].value,"minute");C.end_date=scheduler.date.add(A[1]._date,B[1].value,"minute");if(C.end_date<=C.start_date){C.end_date=scheduler.date.add(C.start_date,scheduler.config.time_step,"minute")}},focus:function(A){}};scheduler.linkCalendar=function(B,C){var A=function(){var D=scheduler._date;var G=scheduler._mode;var F=new Date(D.valueOf());if(C){F=C(F)}F.setDate(1);scheduler.updateCalendar(B,F);if(!C){if(G=="day"){scheduler.markCalendar(B,D,"dhx_calendar_click")}else{if(G=="week"){F=scheduler.date.week_start(new Date(D.valueOf()));for(i=0;i<7;i++){var E=F.getMonth()+F.getYear()*12-D.getMonth()-D.getYear()*12;if(E&&E>0){continue}scheduler.markCalendar(B,F,"dhx_calendar_click");F=scheduler.date.add(F,1,"day")}}}}return true};scheduler.attachEvent("onViewChange",A);scheduler.attachEvent("onXLE",A);scheduler.attachEvent("onEventAdded",A);scheduler.attachEvent("onEventChanged",A);scheduler.attachEvent("onAfterEventDelete",A);A()};
\ No newline at end of file

=== added file 'addons/base_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_multiselect.js'
--- addons/base_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_multiselect.js	1970-01-01 00:00:00 +0000
+++ addons/base_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_multiselect.js	2011-04-07 05:03:24 +0000
@@ -0,0 +1,9 @@
+/*
+dhtmlxScheduler v.2.3
+
+This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
+to use it in not GPL project. Please contact sales@xxxxxxxxxx for details
+
+(c) DHTMLX Ltd.
+*/
+scheduler.form_blocks.multiselect={render:function(C){var B="<div class='dhx_multi_select_"+C.name+"' style='overflow: auto; height: "+C.height+"px; position: relative;' >";for(var A=0;A<C.options.length;A++){B+="<label><input type='checkbox' value='"+C.options[A].key+"'/>"+C.options[A].label+"</label>";if(convertStringToBoolean(C.vertical)){B+="<br/>"}}B+="</div>";return B},set_value:function(C,J,I,A){var E=C.getElementsByTagName("input");for(var G=0;G<E.length;G++){E[G].checked=false}function H(M){var L=C.getElementsByTagName("input");for(var K=0;K<L.length;K++){L[K].checked=!!M[L[K].value]}}if(!scheduler._new_event){var D=[];if(I[A.map_to]){var F=I[A.map_to].split(",");for(var G=0;G<F.length;G++){D[F[G]]=true}H(D)}else{var B=document.createElement("div");B.className="dhx_loading";B.style.cssText="position: absolute; top: 40%; left: 40%;";C.appendChild(B);dhtmlxAjax.get(A.script_url+"?dhx_crosslink_"+A.map_to+"="+I.id+"&uid="+scheduler.uid(),function(K){var M=K.doXPath("//data/item");var N=[];for(var L=0;L<M.length;L++){N[M[L].getAttribute(A.map_to)]=true}H(N);C.removeChild(B)})}}},get_value:function(F,E,A){var C=[];var D=F.getElementsByTagName("input");for(var B=0;B<D.length;B++){if(D[B].checked){C.push(D[B].value)}}return C.join(",")},focus:function(A){}};
\ No newline at end of file

=== added file 'addons/base_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_multisource.js'
--- addons/base_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_multisource.js	1970-01-01 00:00:00 +0000
+++ addons/base_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_multisource.js	2011-04-07 05:03:24 +0000
@@ -0,0 +1,9 @@
+/*
+dhtmlxScheduler v.2.3
+
+This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
+to use it in not GPL project. Please contact sales@xxxxxxxxxx for details
+
+(c) DHTMLX Ltd.
+*/
+(function(){function B(D){var C=function(){};C.prototype=D;return C}var A=scheduler._load;scheduler._load=function(C,F){C=C||this._load_url;if(typeof C=="object"){var E=B(this._loaded);for(var D=0;D<C.length;D++){this._loaded=new E();A.call(this,C[D],F)}}else{A.apply(this,arguments)}}})();
\ No newline at end of file

=== added file 'addons/base_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_outerdrag.js'
--- addons/base_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_outerdrag.js	1970-01-01 00:00:00 +0000
+++ addons/base_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_outerdrag.js	2011-04-07 05:03:24 +0000
@@ -0,0 +1,9 @@
+/*
+dhtmlxScheduler v.2.3
+
+This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
+to use it in not GPL project. Please contact sales@xxxxxxxxxx for details
+
+(c) DHTMLX Ltd.
+*/
+scheduler.attachEvent("onTemplatesReady",function(){var C=(new dhtmlDragAndDropObject());var B=C.stopDrag;var A;C.stopDrag=function(D){A=D||event;return B.apply(this,arguments)};C.addDragLanding(scheduler._els.dhx_cal_data[0],{_drag:function(F,G,D){var E=scheduler.attachEvent("onEventCreated",function(I,H){if(!scheduler.callEvent("onExternalDragIn",[I,F,H])){this._drag_mode=this._drag_id=null;this.deleteEvent(I)}});if(scheduler.matrix[scheduler._mode]){scheduler.dblclick_dhx_matrix_cell(A)}else{scheduler._on_dbl_click(A)}scheduler.detachEvent(E)},_dragIn:function(E,D){return E},_dragOut:function(D){return this}})});
\ No newline at end of file

=== added file 'addons/base_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_pdf.js'
--- addons/base_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_pdf.js	1970-01-01 00:00:00 +0000
+++ addons/base_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_pdf.js	2011-04-07 05:03:24 +0000
@@ -0,0 +1,9 @@
+/*
+dhtmlxScheduler v.2.3
+
+This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
+to use it in not GPL project. Please contact sales@xxxxxxxxxx for details
+
+(c) DHTMLX Ltd.
+*/
+scheduler.toPDF=function(C,J,P,L){var I=0;var H=0;var F=false;if(J=="fullcolor"){F=true;J="color"}J=J||"color";function M(T){T=parseFloat(T);if(isNaN(T)){return"auto"}return 100*T/I}function Q(T){T=parseFloat(T);if(isNaN(T)){return"auto"}return 100*T/H}function O(U){var T="";for(var V=0;V<U.length;V++){T+="\n<column><![CDATA["+U[V].innerHTML+"]]></column>"}I=U[0].offsetWidth;return T}function G(V,W){var T=parseInt(V.style.left);for(var U=0;U<scheduler._cols.length;U++){T-=scheduler._cols[U];if(T<0){return U}}return W}function N(U,W){var V=parseInt(U.style.top);for(var T=0;T<scheduler._colsS.heights.length;T++){if(scheduler._colsS.heights[T]>V){return T}}return W}function A(W){var U="";var X=W.firstChild.rows;for(var V=0;V<X.length;V++){var Y=[];for(var T=0;T<X[V].cells.length;T++){Y.push(X[V].cells[T].firstChild.innerHTML)}U+="\n<row height='"+W.firstChild.rows[V].cells[0].offsetHeight+"'><![CDATA["+Y.join("|")+"]]></row>";H=W.firstChild.rows[0].cells[0].offsetHeight}return U}function S(X){var U="<data profile='"+X+"'";if(P){U+=" header='"+P+"'"}if(L){U+=" footer='"+L+"'"}U+=">";U+="<scale mode='"+scheduler._mode+"' today='"+scheduler._els.dhx_cal_date[0].innerHTML+"'>";if(scheduler._mode=="agenda"){var T=scheduler._els.dhx_cal_header[0].childNodes[0].childNodes;U+="<column>"+T[0].innerHTML+"</column><column>"+T[1].innerHTML+"</column>"}else{if(scheduler._mode=="year"){var T=scheduler._els.dhx_cal_data[0].childNodes;for(var V=0;V<T.length;V++){U+="<month label='"+T[V].childNodes[0].innerHTML+"'>";U+=O(T[V].childNodes[1].childNodes);U+=A(T[V].childNodes[2]);U+="</month>"}}else{U+="<x>";var T=scheduler._els.dhx_cal_header[0].childNodes;U+=O(T);U+="</x>";var W=scheduler._els.dhx_cal_data[0];if(W.firstChild.tagName=="TABLE"){U+=A(W)}else{W=W.childNodes[W.childNodes.length-1];while(W.className.indexOf("dhx_scale_holder")==-1){W=W.previousSibling}W=W.childNodes;U+="<y>";for(var V=0;V<W.length;V++){U+="\n<row><![CDATA["+W[V].innerHTML+"]]></row>"}U+="</y>";H=W[0].offsetHeight}}}U+="</scale>";return U}function E(U,T){return(window.getComputedStyle?(window.getComputedStyle(U,null)[T]):(U.currentStyle?U.currentStyle[T]:null))||""}function B(){var b="";var j=scheduler._rendered;if(scheduler._mode=="agenda"){for(var Z=0;Z<j.length;Z++){b+="<event><head>"+j[Z].childNodes[0].innerHTML+"</head><body>"+j[Z].childNodes[2].innerHTML+"</body></event>"}}else{if(scheduler._mode=="year"){var j=scheduler.get_visible_events();for(var Z=0;Z<j.length;Z++){var f=j[Z].start_date;if(f.valueOf()<scheduler._min_date.valueOf()){f=scheduler._min_date}while(f<j[Z].end_date){var U=f.getMonth()+12*(f.getFullYear()-scheduler._min_date.getFullYear())-scheduler.week_starts._month;var g=scheduler.week_starts[U]+f.getDate()-1;b+="<event day='"+(g%7)+"' week='"+Math.floor(g/7)+"' month='"+U+"'></event>";scheduler._mark_year_date(f);f=scheduler.date.add(f,1,"day");if(f.valueOf()>=scheduler._max_date.valueOf()){break}}}}else{for(var Z=0;Z<j.length;Z++){var X=M(j[Z].style.left);var V=Q(j[Z].style.top);var e=M(j[Z].style.width);var a=Q(j[Z].style.height);var Y=j[Z].className.split(" ")[0].replace("dhx_cal_","");var c=scheduler.getEvent(j[Z].getAttribute("event_id"));var g=c._sday;var T=c._sweek;if(scheduler._mode!="month"){if(parseInt(j[Z].style.left)<=26){X=2;e+=M(j[Z].style.left)-1}if(j[Z].parentNode==scheduler._els.dhx_cal_data[0]){continue}X+=M(j[Z].parentNode.style.left);X-=M(51)}else{a=parseInt(j[Z].offsetHeight);V=parseInt(j[Z].style.top)-22;g=G(j[Z],g);T=N(j[Z],T)}b+="\n<event week='"+T+"' day='"+g+"' type='"+Y+"' x='"+X+"' y='"+V+"' width='"+e+"' height='"+a+"'>";if(Y=="event"){b+="<header><![CDATA["+j[Z].childNodes[1].innerHTML+"]]></header>";var W=F?E(j[Z].childNodes[2],"color"):"";var h=F?E(j[Z].childNodes[2],"backgroundColor"):"";b+="<body backgroundColor='"+h+"' color='"+W+"'><![CDATA["+j[Z].childNodes[2].innerHTML+"]]></body>"}else{var W=F?E(j[Z],"color"):"";var h=F?E(j[Z],"backgroundColor"):"";b+="<body backgroundColor='"+h+"' color='"+W+"'><![CDATA["+j[Z].innerHTML+"]]></body>"}b+="</event>"}}}return b}function K(){var T="</data>";return T}var D=(new Date()).valueOf();var R=document.createElement("div");R.style.display="none";document.body.appendChild(R);R.innerHTML='<form id="'+D+'" method="post" target="_blank" action="'+C+'" accept-charset="utf-8" enctype="text/html"><input type="hidden" name="mycoolxmlbody"/> </form>';document.getElementById(D).firstChild.value=S(J).replace("\u2013","-")+B()+K();document.getElementById(D).submit();R.parentNode.removeChild(R);grid=null};
\ No newline at end of file

=== added file 'addons/base_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_readonly.js'
--- addons/base_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_readonly.js	1970-01-01 00:00:00 +0000
+++ addons/base_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_readonly.js	2011-04-07 05:03:24 +0000
@@ -0,0 +1,9 @@
+/*
+dhtmlxScheduler v.2.3
+
+This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
+to use it in not GPL project. Please contact sales@xxxxxxxxxx for details
+
+(c) DHTMLX Ltd.
+*/
+scheduler.attachEvent("onTemplatesReady",function(){scheduler.attachEvent("onBeforeLightbox",function(F){if(this.config.readonly_form||this.getEvent(F).readonly){this.config.readonly_active=true}else{this.config.readonly_active=false;return true}for(var E=0;E<this.config.lightbox.sections.length;E++){this.config.lightbox.sections[E].focus=false}return true});function D(E,K,L,J){var G=K.getElementsByTagName(E);var F=L.getElementsByTagName(E);for(var I=F.length-1;I>=0;I--){var L=F[I];if(!J){L.disabled=true}else{var H=document.createElement("SPAN");H.className="dhx_text_disabled";H.innerHTML=J(G[I]);L.parentNode.insertBefore(H,L);L.parentNode.removeChild(L)}}}var B=scheduler._fill_lightbox;scheduler._fill_lightbox=function(){var H=this.config.lightbox.sections;if(this.config.readonly_active){for(var F=0;F<H.length;F++){if(H[F].type=="recurring"){var G=document.getElementById(H[F].id);G.style.display=G.nextSibling.style.display="none";H.splice(F,1);F--}}}var E=B.apply(this,arguments);if(this.config.readonly_active){var I=this._get_lightbox();var J=this._lightbox_r=I.cloneNode(true);D("textarea",I,J,function(K){return K.value});D("input",I,J,false);D("select",I,J,function(K){return K.options[Math.max((K.selectedIndex||0),0)].text});J.removeChild(J.childNodes[2]);J.removeChild(J.childNodes[3]);I.parentNode.insertBefore(J,I);A.call(this,J);this._lightbox=J;this.setLightboxSize();this._lightbox=null;J.onclick=function(K){var L=K?K.target:event.srcElement;if(!L.className){L=L.previousSibling}if(L&&L.className){switch(L.className){case"dhx_cancel_btn":scheduler.callEvent("onEventCancel",[scheduler._lightbox_id]);scheduler._edit_stop_event(scheduler.getEvent(scheduler._lightbox_id),false);scheduler.hide_lightbox();break}}}}return E};var A=scheduler.showCover;scheduler.showCover=function(){if(!this.config.readonly_active){A.apply(this,arguments)}};var C=scheduler.hide_lightbox;scheduler.hide_lightbox=function(){if(this._lightbox_r){this._lightbox_r.parentNode.removeChild(this._lightbox_r);this._lightbox_r=null}return C.apply(this,arguments)}});
\ No newline at end of file

=== added file 'addons/base_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_recurring.css'
--- addons/base_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_recurring.css	1970-01-01 00:00:00 +0000
+++ addons/base_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_recurring.css	2011-04-07 05:03:24 +0000
@@ -0,0 +1,9 @@
+/*
+dhtmlxScheduler v.2.3
+
+This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
+to use it in not GPL project. Please contact sales@xxxxxxxxxx for details
+
+(c) DHTMLX Ltd.
+*/
+div input.radio{margin:-4px 0 0 -4px!ie;}div input.checkbox{margin:0 0 0 -4px!ie;}.dhx_form_repeat,.dhx_form_repeat input{padding:0;margin:0;font-family:Tahoma,Verdana;font-size:11px;line-height:24px;}.dhx_form_repeat{overflow:hidden;height:0;background-color:#FFF4B5;}.dhx_repeat_center,.dhx_repeat_left{height:115px;padding:10px 0 10px 10px;float:left;}.dhx_repeat_left{width:95px;}.dhx_repeat_center{width:335px;margin-top:12px;}.dhx_repeat_divider{float:left;height:115px;border-left:1px dotted #DCC43E;width:1px;}.dhx_repeat_right{float:right;height:115px;width:160px;padding:10px 3px 10px 10px;margin-top:7px;}input.dhx_repeat_text{height:16px;width:27px;margin:0 4px 0 4px;line-height:18px;padding:0 0 0 2px;}.dhx_form_repeat select{height:20px;width:87px;padding:0 0 0 2px;margin:0 4px 0 4px;}input.dhx_repeat_date{height:18px;width:80px;padding:0 0 0 2px;margin:0 4px 0 4px;background-repeat:no-repeat;background-position:64px 0;border:1px #7f9db9 solid;line-height:18px;}input.dhx_repeat_radio{margin-right:4px;}input.dhx_repeat_checkbox{margin:4px 4px 0 0;}.dhx_repeat_days td{padding-right:5px;}.dhx_repeat_days label{font-size:10px;}.dhx_custom_button_recurring{background-image:url(../imgs/but_repeat.gif);background-position:-5px 20px;width:20px;margin-right:10px;}.dhx_custom_button{width:90px;}.dhx_cal_light{width:640px;}.dhx_cal_larea{width:632px;}
\ No newline at end of file

=== added file 'addons/base_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_recurring.js'
--- addons/base_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_recurring.js	1970-01-01 00:00:00 +0000
+++ addons/base_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_recurring.js	2011-04-07 05:03:24 +0000
@@ -0,0 +1,1 @@
+scheduler.form_blocks.recurring={render:function(A){return scheduler.__recurring_template},set_value:function(L,K,P){var I={start:P.start_date,end:P._end_date};var E=scheduler.date.str_to_date(scheduler.config.repeat_date);var G=scheduler.date.date_to_str(scheduler.config.repeat_date);var F=L.getElementsByTagName("FORM")[0];var B=[];function H(S){for(var T=0;T<S.length;T++){var U=S[T];if(U.type=="checkbox"||U.type=="radio"){if(!B[U.name]){B[U.name]=[]}B[U.name].push(U)}else{B[U.name]=U}}}H(F.getElementsByTagName("INPUT"));H(F.getElementsByTagName("SELECT"));var C=function(S){return document.getElementById(S)};function O(T){var S=B[T];for(var U=0;U<S.length;U++){if(S[U].checked){return S[U].value}}}function J(){C("dhx_repeat_day").style.display="none";C("dhx_repeat_week").style.display="none";C("dhx_repeat_month").style.display="none";C("dhx_repeat_year").style.display="none";C("dhx_repeat_"+this.value).style.display="block"}function D(V){var T=[O("repeat")];Q[T[0]](T,V);while(T.length<5){T.push("")}var U="";if(B.end[0].checked){V.end=new Date(9999,1,1);U="no"}else{if(B.end[2].checked){V.end=E(B.date_of_end.value)}else{scheduler.transpose_type(T.join("_"));U=Math.max(1,B.occurences_count.value);var S=((T[0]=="week"&&T[4]&&T[4].toString().indexOf(scheduler.config.start_on_monday?1:0)==-1)?1:0);V.end=scheduler.date.add(new Date(V.start),U+S,T.join("_"))}}return T.join("_")+"#"+U}var Q={month:function(S,T){if(O("month_type")=="d"){S.push(Math.max(1,B.month_count.value));T.start.setDate(B.month_day.value)}else{S.push(Math.max(1,B.month_count2.value));S.push(B.month_day2.value);S.push(Math.max(1,B.month_week2.value));T.start.setDate(1)}T._start=true},week:function(V,W){V.push(Math.max(1,B.week_count.value));V.push("");V.push("");var U=[];var S=B.week_day;for(var T=0;T<S.length;T++){if(S[T].checked){U.push(S[T].value)}}if(!U.length){U.push(W.start.getDay())}W.start=scheduler.date.week_start(W.start);W._start=true;V.push(U.sort().join(","))},day:function(S){if(O("day_type")=="d"){S.push(Math.max(1,B.day_count.value))}else{S.push("week");S.push(1);S.push("");S.push("");S.push("1,2,3,4,5");S.splice(0,1)}},year:function(S,T){if(O("year_type")=="d"){S.push("1");T.start.setMonth(0);T.start.setDate(B.year_day.value);T.start.setMonth(B.year_month.value)}else{S.push("1");S.push(B.year_day2.value);S.push(B.year_week2.value);T.start.setDate(1);T.start.setMonth(B.year_month2.value)}T._start=true}};var M={week:function(V,W){B.week_count.value=V[1];var S=B.week_day;var U=V[4].split(",");var X={};for(var T=0;T<U.length;T++){X[U[T]]=true}for(var T=0;T<S.length;T++){S[T].checked=(!!X[S[T].value])}},month:function(S,T){if(S[2]==""){B.month_type[0].checked=true;B.month_count.value=S[1];B.month_day.value=T.start.getDate()}else{B.month_type[1].checked=true;B.month_count2.value=S[1];B.month_week2.value=S[3];B.month_day2.value=S[2]}},day:function(S,T){B.day_type[0].checked=true;B.day_count.value=S[1]},year:function(S,T){if(S[2]==""){B.year_type[0].checked=true;B.year_day.value=T.start.getDate();B.year_month.value=T.start.getMonth()}else{B.year_type[1].checked=true;B.year_week2.value=S[3];B.year_day2.value=S[2];B.year_month2.value=T.start.getMonth()}}};function R(S,V){var T=S.split("#");S=T[0].split("_");M[S[0]](S,V);var U=B.repeat[({day:0,week:1,month:2,year:3})[S[0]]];switch(T[1]){case"no":B.end[0].checked=true;break;case"":B.end[2].checked=true;B.date_of_end.value=G(V.end);break;default:B.end[1].checked=true;B.occurences_count.value=T[1];break}U.checked=true;U.onclick()}for(var N=0;N<F.elements.length;N++){var A=F.elements[N];switch(A.name){case"repeat":A.onclick=J;break}}scheduler.form_blocks.recurring.set_value=function(T,U,S){T.open=!S.rec_type;if(S.event_pid&&S.event_pid!="0"){T.blocked=true}else{T.blocked=false}I.start=S.start_date;I.end=S._end_date;scheduler.form_blocks.recurring.button_click(0,T.previousSibling.firstChild.firstChild,T,T);if(U){R(U,I)}};scheduler.form_blocks.recurring.get_value=function(T,S){if(T.open){S.rec_type=D(I);if(I._start){S._start_date=S.start_date=I.start;I._start=false}else{S._start_date=null}S._end_date=S.end_date=I.end;S.rec_pattern=S.rec_type.split("#")[0]}else{S.rec_type=S.rec_pattern="";S._end_date=S.end_date}return S.rec_type};scheduler.form_blocks.recurring.set_value(L,K,P)},get_value:function(B,A){},focus:function(A){},button_click:function(B,C,D,A){if(!A.open&&!A.blocked){A.style.height="115px";C.style.backgroundPosition="-5px 0px";C.nextSibling.innerHTML=scheduler.locale.labels.button_recurring_open}else{A.style.height="0px";C.style.backgroundPosition="-5px 20px";C.nextSibling.innerHTML=scheduler.locale.labels.button_recurring}A.open=!A.open;scheduler.setLightboxSize()}};scheduler._rec_markers={};scheduler._rec_markers_pull={};scheduler._add_rec_marker=function(A,B){A._pid_time=B;this._rec_markers[A.id]=A;if(!this._rec_markers_pull[A.event_pid]){this._rec_markers_pull[A.event_pid]={}}this._rec_markers_pull[A.event_pid][B]=A};scheduler._get_rec_marker=function(B,C){var A=this._rec_markers_pull[C];if(A){return A[B]}return null};scheduler._get_rec_markers=function(A){return(this._rec_markers_pull[A]||[])};scheduler._rec_temp=[];scheduler.attachEvent("onEventLoading",function(A){if(A.event_pid!=0){scheduler._add_rec_marker(A,A.event_length*1000)}if(A.rec_type){A.rec_pattern=A.rec_type.split("#")[0]}return true});scheduler.attachEvent("onEventIdChange",function(D,A){if(this._ignore_call){return }this._ignore_call=true;for(var C=0;C<this._rec_temp.length;C++){var B=this._rec_temp[C];if(B.event_pid==D){B.event_pid=A;this.changeEventId(B.id,A+"#"+B.id.split("#")[1])}}delete this._ignore_call});scheduler.attachEvent("onBeforeEventDelete",function(F){var D=this.getEvent(F);if(F.toString().indexOf("#")!=-1){var F=F.split("#");var E=this.uid();var C=this._copy_event(D);C.id=E;C.event_pid=F[0];C.event_length=F[1];C.rec_type=C.rec_pattern="none";this.addEvent(C);this._add_rec_marker(this.getEvent(E),F[1]*1000)}else{if(D.rec_type){this._roll_back_dates(D)}var B=this._get_rec_markers(F);for(var A in B){this.deleteEvent(B[A].id,true)}}return true});scheduler.attachEvent("onEventChanged",function(F){if(this._loading){return true}var D=this.getEvent(F);if(F.toString().indexOf("#")!=-1){var F=F.split("#");var E=this.uid();this._not_render=true;var C=this._copy_event(D);C.id=E;C.event_pid=F[0];C.event_length=F[1];C.rec_type=C.rec_pattern="";this.addEvent(C);this._not_render=false;this._add_rec_marker(this.getEvent(E),F[1]*1000)}else{if(D.rec_type){this._roll_back_dates(D)}var B=this._get_rec_markers(F);for(var A in B){delete this._rec_markers[B[A].id];this.deleteEvent(B[A].id,true)}delete this._rec_markers_pull[F];this._select_id=null}return true});scheduler.attachEvent("onEventAdded",function(B){if(!this._loading){var A=this.getEvent(B);if(A.rec_type&&!A.event_length){this._roll_back_dates(A)}}return true});scheduler.attachEvent("onEventCreated",function(B){var A=this.getEvent(B);if(!A.rec_type){A.rec_type=A.rec_pattern=""}return true});scheduler.attachEvent("onEventCancel",function(B){var A=this.getEvent(B);if(A.rec_type){this._roll_back_dates(A);this.render_view_data(A.id)}});scheduler._roll_back_dates=function(A){A.event_length=(A.end_date.valueOf()-A.start_date.valueOf())/1000;A.end_date=A._end_date;if(A._start_date){A.start_date.setMonth(0);A.start_date.setDate(A._start_date.getDate());A.start_date.setMonth(A._start_date.getMonth());A.start_date.setFullYear(A._start_date.getFullYear())}};scheduler.validId=function(A){return A.toString().indexOf("#")==-1};scheduler.showLightbox_rec=scheduler.showLightbox;scheduler.showLightbox=function(B){var A=this.getEvent(B).event_pid;if(B.toString().indexOf("#")!=-1){A=B.split("#")[0]}if(!A||A==0||(!this.locale.labels.confirm_recurring||!confirm(this.locale.labels.confirm_recurring))){return this.showLightbox_rec(B)}A=this.getEvent(A);A._end_date=A.end_date;A.end_date=new Date(A.start_date.valueOf()+A.event_length*1000);return this.showLightbox_rec(A.id)};scheduler.get_visible_events_rec=scheduler.get_visible_events;scheduler.get_visible_events=function(){for(var C=0;C<this._rec_temp.length;C++){delete this._events[this._rec_temp[C].id]}this._rec_temp=[];var A=this.get_visible_events_rec();var B=[];for(var C=0;C<A.length;C++){if(A[C].rec_type){if(A[C].rec_pattern!="none"){this.repeat_date(A[C],B)}}else{B.push(A[C])}}return B};(function(){var A=scheduler.is_one_day_event;scheduler.is_one_day_event=function(B){if(B.rec_type){return true}return A.call(this,B)}})();scheduler.transponse_size={day:1,week:7,month:1,year:12};scheduler.date.day_week=function(E,C,D){E.setDate(1);D=(D-1)*7;var B=E.getDay();var A=C*1+D-B+1;E.setDate(A<=D?(A+7):A)};scheduler.transpose_day_week=function(G,D,F,C,E){var A=(G.getDay()||(scheduler.config.start_on_monday?7:0))-F;for(var B=0;B<D.length;B++){if(D[B]>A){return G.setDate(G.getDate()+D[B]*1-A-(C?F:E))}}this.transpose_day_week(G,D,F+C,null,F)};scheduler.transpose_type=function(D){var F="transpose_"+D;if(!this.date[F]){var G=D.split("_");var A=60*60*24*1000;var C="add_"+D;var E=this.transponse_size[G[0]]*G[1];if(G[0]=="day"||G[0]=="week"){var H=null;if(G[4]){H=G[4].split(",");if(scheduler.config.start_on_monday){for(var B=0;B<H.length;B++){H[B]=(H[B]*1)||7}H.sort()}}this.date[F]=function(I,K){var J=Math.floor((K.valueOf()-I.valueOf())/(A*E));if(J>0){I.setDate(I.getDate()+J*E)}if(H){scheduler.transpose_day_week(I,H,1,E)}};this.date[C]=function(K,J){var L=new Date(K.valueOf());if(H){for(var I=0;I<J;I++){scheduler.transpose_day_week(L,H,0,E)}}else{L.setDate(L.getDate()+J*E)}return L}}else{if(G[0]=="month"||G[0]=="year"){this.date[F]=function(I,K){var J=Math.ceil(((K.getFullYear()*12+K.getMonth()*1)-(I.getFullYear()*12+I.getMonth()*1))/(E));if(J>=0){I.setMonth(I.getMonth()+J*E)}if(G[3]){scheduler.date.day_week(I,G[2],G[3])}};this.date[C]=function(J,I){var K=new Date(J.valueOf());K.setMonth(K.getMonth()+I*E);if(G[3]){scheduler.date.day_week(K,G[2],G[3])}return K}}}}};scheduler.repeat_date=function(F,G,C,I,J){I=I||this._min_date;J=J||this._max_date;var E=new Date(F.start_date.valueOf());if(!F.rec_pattern&&F.rec_type){F.rec_pattern=F.rec_type.split("#")[0]}this.transpose_type(F.rec_pattern);scheduler.date["transpose_"+F.rec_pattern](E,I);while(E<F.start_date||(E.valueOf()+F.event_length*1000)<=I.valueOf()){E=this.date.add(E,1,F.rec_pattern)}while(E<J&&E<F.end_date){var A=this._get_rec_marker(E.valueOf(),F.id);if(!A){var H=new Date(E.valueOf()+F.event_length*1000);var B=this._copy_event(F);B.start_date=E;B.event_pid=F.id;B.id=F.id+"#"+Math.ceil(E.valueOf()/1000);B.end_date=H;var D=B.start_date.getTimezoneOffset()-B.end_date.getTimezoneOffset();if(D){if(D>0){B.end_date=new Date(E.valueOf()+F.event_length*1000-D*60*1000)}else{B.end_date=new Date(B.end_date.valueOf()+D*60*1000)}}B._timed=this.is_one_day_event(B);if(!B._timed&&!this._table_view&&!this.config.multi_day){return }G.push(B);if(!C){this._events[B.id]=B;this._rec_temp.push(B)}}else{if(C){G.push(A)}}E=this.date.add(E,1,F.rec_pattern)}};scheduler.getRecDates=function(B,H){var G=typeof B=="object"?B:scheduler.getEvent(B);var E=0;var J=[];H=H||1000;var C=new Date(G.start_date.valueOf());var I=new Date(C.valueOf());if(!G.rec_type){return[{start_date:G.start_date,end_date:G.end_date}]}this.transpose_type(G.rec_pattern);scheduler.date["transpose_"+G.rec_pattern](C,I);while(C<G.start_date||(C.valueOf()+G.event_length*1000)<=I.valueOf()){C=this.date.add(C,1,G.rec_pattern)}while(C<G.end_date){var A=this._get_rec_marker(C.valueOf(),G.id);if(!A){var F=new Date(C.valueOf()+G.event_length*1000);var D=new Date(C);J.push({start_date:D,end_date:F});C=this.date.add(C,1,G.rec_pattern);E++}if(E==H){break}}return J};scheduler.getEvents=function(G,F){var A=[];for(var B in this._events){var D=this._events[B];if(D&&D.start_date<F&&D.end_date>G){if(D.rec_pattern){if(D.rec_pattern=="none"){continue}var E=[];this.repeat_date(D,E,true,G,F);for(var C=0;C<E.length;C++){if(!E[C].rec_pattern&&E[C].start_date<F&&E[C].end_date>G){A.push(E[C])}}}else{if(!D.event_pid||D.event_pid==0){A.push(D)}}}}return A};scheduler.config.repeat_date="%m.%d.%Y";scheduler.config.lightbox.sections=[{name:"description",height:130,map_to:"text",type:"textarea",focus:true},{name:"recurring",height:115,type:"recurring",map_to:"rec_type",button:"recurring"},{name:"time",height:72,type:"time",map_to:"auto"}];scheduler._copy_dummy=function(A){this.start_date=new Date(this.start_date);this.end_date=new Date(this.end_date);this.event_length=this.event_pid=this.rec_pattern=this.rec_type=this._timed=null};scheduler.__recurring_template='<div class="dhx_form_repeat"> <form> <div class="dhx_repeat_left"> <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="day" />Daily</label><br /> <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="week"/>Weekly</label><br /> <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="month" checked />Monthly</label><br /> <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="year" />Yearly</label> </div> <div class="dhx_repeat_divider"></div> <div class="dhx_repeat_center"> <div style="display:none;" id="dhx_repeat_day"> <label><input class="dhx_repeat_radio" type="radio" name="day_type" value="d"/>Every</label><input class="dhx_repeat_text" type="text" name="day_count" value="1" />day<br /> <label><input class="dhx_repeat_radio" type="radio" name="day_type" checked value="w"/>Every workday</label> </div> <div style="display:none;" id="dhx_repeat_week"> Repeat every<input class="dhx_repeat_text" type="text" name="week_count" value="1" />week next days:<br /> <table class="dhx_repeat_days"> <tr> <td> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="1" />Monday</label><br /> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="4" />Thursday</label> </td> <td> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="2" />Tuesday</label><br /> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="5" />Friday</label> </td> <td> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="3" />Wednesday</label><br /> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="6" />Saturday</label> </td> <td> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="0" />Sunday</label><br /><br /> </td> </tr> </table> </div> <div id="dhx_repeat_month"> <label><input class="dhx_repeat_radio" type="radio" name="month_type" value="d"/>Repeat</label><input class="dhx_repeat_text" type="text" name="month_day" value="1" />day every<input class="dhx_repeat_text" type="text" name="month_count" value="1" />month<br /> <label><input class="dhx_repeat_radio" type="radio" name="month_type" checked value="w"/>On</label><input class="dhx_repeat_text" type="text" name="month_week2" value="1" /><select name="month_day2"><option value="1" selected >Monday<option value="2">Tuesday<option value="3">Wednesday<option value="4">Thursday<option value="5">Friday<option value="6">Saturday<option value="0">Sunday</select>every<input class="dhx_repeat_text" type="text" name="month_count2" value="1" />month<br /> </div> <div style="display:none;" id="dhx_repeat_year"> <label><input class="dhx_repeat_radio" type="radio" name="year_type" value="d"/>Every</label><input class="dhx_repeat_text" type="text" name="year_day" value="1" />day<select name="year_month"><option value="0" selected >January<option value="1">February<option value="2">March<option value="3">April<option value="4">May<option value="5">June<option value="6">July<option value="7">August<option value="8">September<option value="9">October<option value="10">November<option value="11">December</select>month<br /> <label><input class="dhx_repeat_radio" type="radio" name="year_type" checked value="w"/>On</label><input class="dhx_repeat_text" type="text" name="year_week2" value="1" /><select name="year_day2"><option value="1" selected >Monday<option value="2">Tuesday<option value="3">Wednesday<option value="4">Thursday<option value="5">Friday<option value="6">Saturday<option value="7">Sunday</select>of<select name="year_month2"><option value="0" selected >January<option value="1">February<option value="2">March<option value="3">April<option value="4">May<option value="5">June<option value="6">July<option value="7">August<option value="8">September<option value="9">October<option value="10">November<option value="11">December</select><br /> </div> </div> <div class="dhx_repeat_divider"></div> <div class="dhx_repeat_right"> <label><input class="dhx_repeat_radio" type="radio" name="end" checked/>No end date</label><br /> <label><input class="dhx_repeat_radio" type="radio" name="end" />After</label><input class="dhx_repeat_text" type="text" name="occurences_count" value="1" />occurrences<br /> <label><input class="dhx_repeat_radio" type="radio" name="end" />End by</label><input class="dhx_repeat_date" type="text" name="date_of_end" value="01.01.2010" /><br /> </div> </form> </div> <div style="clear:both"> </div>';
\ No newline at end of file

=== added file 'addons/base_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_serialize.js'
--- addons/base_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_serialize.js	1970-01-01 00:00:00 +0000
+++ addons/base_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_serialize.js	2011-04-07 05:03:24 +0000
@@ -0,0 +1,9 @@
+/*
+dhtmlxScheduler v.2.3
+
+This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
+to use it in not GPL project. Please contact sales@xxxxxxxxxx for details
+
+(c) DHTMLX Ltd.
+*/
+scheduler.data_attributes=function(){var C=[];var E=scheduler.templates.xml_format;for(var A in this._events){var D=this._events[A];for(var B in D){if(B.substr(0,1)!="_"){C.push([B,((B=="start_date"||B=="end_date")?E:null)])}}break}return C};scheduler.toXML=function(F){var C=[];var B=this.data_attributes();for(var A in this._events){var E=this._events[A];if(E.id.toString().indexOf("#")!=-1){continue}C.push("<event>");for(var D=0;D<B.length;D++){C.push("<"+B[D][0]+"><![CDATA["+(B[D][1]?B[D][1](E[B[D][0]]):E[B[D][0]])+"]]></"+B[D][0]+">")}C.push("</event>")}return(F||"")+"<data>"+C.join("\n")+"</data>"};scheduler.toJSON=function(){var E=[];var C=this.data_attributes();for(var B in this._events){var F=this._events[B];if(F.id.toString().indexOf("#")!=-1){continue}var F=this._events[B];var A=[];for(var D=0;D<C.length;D++){A.push(" "+C[D][0]+':"'+((C[D][1]?C[D][1](F[C[D][0]]):F[C[D][0]])||"").toString().replace(/\n/g,"")+'" ')}E.push("{"+A.join(",")+"}")}return"["+E.join(",\n")+"]"};scheduler.toICal=function(G){var F="BEGIN:VCALENDAR\nVERSION:2.0\nPRODID:-//dhtmlXScheduler//NONSGML v2.2//EN\nDESCRIPTION:";var C="END:VCALENDAR";var E=scheduler.date.date_to_str("%Y%m%dT%H%i%s");var B=[];for(var A in this._events){var D=this._events[A];if(D.id.toString().indexOf("#")!=-1){continue}B.push("BEGIN:VEVENT");B.push("DTSTART:"+E(D.start_date));B.push("DTEND:"+E(D.end_date));B.push("SUMMARY:"+D.text);B.push("END:VEVENT")}return F+(G||"")+"\n"+B.join("\n")+"\n"+C};
\ No newline at end of file

=== added file 'addons/base_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_timeline.js'
--- addons/base_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_timeline.js	1970-01-01 00:00:00 +0000
+++ addons/base_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_timeline.js	2011-04-07 05:03:24 +0000
@@ -0,0 +1,1 @@
+(function(){scheduler.matrix={};scheduler._merge=function(M,L){for(var N in L){if(typeof M[N]=="undefined"){M[N]=L[N]}}};scheduler.createTimelineView=function(O){scheduler._merge(O,{section_autoheight:true,name:"matrix",x:"time",y:"time",x_step:1,x_unit:"hour",y_unit:"day",y_step:1,x_start:0,x_size:24,y_start:0,y_size:7,render:"cell",dx:200,dy:50,_logic:function(S,R,Q){var P={};if(scheduler.checkEvent("onBeforeViewRender")){P=scheduler.callEvent("onBeforeViewRender",[S,R,Q])}return P}});if(scheduler.checkEvent("onTimelineCreated")){scheduler.callEvent("onTimelineCreated",[O])}scheduler[O.name+"_view"]=function(){scheduler.renderMatrix.apply(O,arguments)};var L=scheduler.render_data;scheduler.render_data=function(P,R){if(this._mode==O.name){if(R){for(var Q=0;Q<P.length;Q++){this.clear_event(P[Q]);this.render_timeline_event.call(this.matrix[this._mode],P[Q],0,true)}}else{C.call(O,true)}}else{return L.apply(this,arguments)}};scheduler.matrix[O.name]=O;scheduler.templates[O.name+"_cell_value"]=function(P){return P?P.length:""};scheduler.templates[O.name+"_cell_class"]=function(P){return""};scheduler.templates[O.name+"_scalex_class"]=function(P){return""};scheduler.templates[O.name+"_scaley_class"]=function(Q,R,P){return"class"};scheduler.templates[O.name+"_scale_label"]=function(Q,R,P){return R};scheduler.templates[O.name+"_tooltip"]=function(Q,P,R){return R.text};scheduler.templates[O.name+"_date"]=function(Q,P){if(Q.getDay()==P.getDay()&&Q-P<(24*60*60*1000)){return scheduler.templates.day_date(Q)}return scheduler.templates.week_date(Q,P)};scheduler.templates[O.name+"_scale_date"]=scheduler.date.date_to_str(O.x_date||scheduler.config.hour_date);scheduler.date["add_"+O.name]=function(Q,P,R){return scheduler.date.add(Q,(O.x_length||O.x_size)*P*O.x_step,O.x_unit)};scheduler.date[O.name+"_start"]=scheduler.date[O.x_unit+"_start"]||scheduler.date.day_start;scheduler.attachEvent("onSchedulerResize",function(){if(this._mode==O.name){C.call(O,true);return false}return true});scheduler.attachEvent("onOptionsLoad",function(){O.order={};for(var P=0;P<O.y_unit.length;P++){O.order[O.y_unit[P].key]=P}if(O.name==scheduler._mode){if(scheduler._date){scheduler.setCurrentView(scheduler._date,scheduler._mode)}}});scheduler.callEvent("onOptionsLoad",[O]);if(O.render!="cell"){var N=new Date();var M=(scheduler.date.add(N,1,O.x_unit).valueOf()-N.valueOf());scheduler["mouse_"+O.name]=function(U){var P=this._drag_event;if(this._drag_id){P=this.getEvent(this._drag_id);this._drag_event._dhx_changed=true}U.x-=O.dx;var T=0,S=0,Q=0;for(S;S<this._cols.length-1;S++){T+=this._cols[S];if(T>U.x){break}}T=0;for(Q;Q<this._colsS.heights.length;Q++){T+=this._colsS.heights[Q];if(T>U.y){break}}U.fields={};U.fields[O.y_property]=P[O.y_property]=O.y_unit[Q].key;U.x=Q/10000000;if(this._drag_mode=="new-size"&&P.start_date*1==this._drag_start*1){S++}if(S>=O._trace_x.length){var R=scheduler.date.add(O._trace_x[O._trace_x.length-1],O.x_step,O.x_unit)}else{var R=O._trace_x[S]}U.y=Math.round((R-this._min_date)/(1000*60*this.config.time_step));U.custom=true;U.shift=M;return U}}};scheduler.render_timeline_event=function(U,V,R){var N=E(U,false,this._step);var L=E(U,true,this._step);var P=scheduler.xy.bar_height;var T=2+V*P;var Q=scheduler.templates.event_class(U.start_date,U.end_date,U);Q="dhx_cal_event_line "+(Q||"");var O='<div event_id="'+U.id+'" class="'+Q+'" style="position:absolute; top:'+T+"px; left:"+N+"px; width:"+Math.max(0,L-N)+"px;"+(U._text_style||"")+'">'+scheduler.templates.event_bar_text(U.start_date,U.end_date,U)+"</div>";if(!R){return O}else{var S=document.createElement("DIV");S.innerHTML=O;var M=this.order[U[this.y_property]];var W=scheduler._els.dhx_cal_data[0].firstChild.rows[M].cells[1].firstChild;scheduler._rendered.push(S.firstChild);W.appendChild(S.firstChild)}};function K(){var N=scheduler.getEvents(scheduler._min_date,scheduler._max_date);var M=[];for(var O=0;O<this.y_unit.length;O++){M[O]=[]}if(!M[P]){M[P]=[]}for(var O=0;O<N.length;O++){var P=this.order[N[O][this.y_property]];var L=0;while(this._trace_x[L+1]&&N[O].start_date>=this._trace_x[L+1]){L++}while(this._trace_x[L]&&N[O].end_date>this._trace_x[L]){if(!M[P][L]){M[P][L]=[]}M[P][L].push(N[O]);L++}}return M}function E(S,Q,L){var T=0;var O=(Q)?S.end_date:S.start_date;if(O.valueOf()>scheduler._max_date.valueOf()){O=scheduler._max_date}var U=O-scheduler._min_date_timeline;if(U<0){M=0}else{var R=Math.round(U/(L*scheduler._cols[0]));if(R>scheduler._cols.length){R=scheduler._cols.length}for(var P=0;P<R;P++){T+=scheduler._cols[P]}var N=scheduler.date.add(scheduler._min_date_timeline,scheduler.matrix[scheduler._mode].x_step*R,scheduler.matrix[scheduler._mode].x_unit);U=O-N;var M=Math.floor(U/L)}T+=(Q)?M-14:M+1;return T}function A(S){var R="<table style='table-layout:fixed;' cellspacing='0' cellpadding='0'>";var Z=[];if(scheduler._load_mode&&scheduler._load()){return }if(this.render=="cell"){Z=K.call(this)}else{var T=scheduler.getEvents(scheduler._min_date,scheduler._max_date);for(var O=0;O<T.length;O++){var N=this.order[T[O][this.y_property]];if(!Z[N]){Z[N]=[]}Z[N].push(T[O])}}var Y=0;for(var P=0;P<scheduler._cols.length;P++){Y+=scheduler._cols[P]}var M=new Date();M=(scheduler.date.add(M,this.x_step*this.x_size,this.x_unit)-M)/Y;this._step=M;this._summ=Y;var V=scheduler._colsS.heights=[];for(var P=0;P<this.y_unit.length;P++){var Q=this._logic(this.render,this.y_unit[P],this);scheduler._merge(Q,{height:this.dy});if(this.section_autoheight){if(this.y_unit.length*Q.height<S.offsetHeight){Q.height=Math.max(Q.height,Math.floor((S.offsetHeight-1)/this.y_unit.length))}}scheduler._merge(Q,{tr_className:"",style_height:"height:"+Q.height+"px;",style_width:"width:"+(this.dx-1)+"px;",td_className:"dhx_matrix_scell "+scheduler.templates[this.name+"_scaley_class"](this.y_unit[P].key,this.y_unit[P].label,this),td_content:scheduler.templates[this.name+"_scale_label"](this.y_unit[P].key,this.y_unit[P].label,this),summ_width:"width:"+Y+"px;",table_className:""});R+="<tr class='"+Q.tr_className+"' style='"+Q.style_height+"'><td class='"+Q.td_className+"' style='"+Q.style_width+"'>"+Q.td_content+"</td>";if(this.render=="cell"){for(var O=0;O<scheduler._cols.length;O++){R+="<td class='dhx_matrix_cell "+scheduler.templates[this.name+"_cell_class"](Z[P][O],this._trace_x[O],this.y_unit[P])+"' style='width:"+(scheduler._cols[O]-1)+"px'><div style='width:"+(scheduler._cols[O]-1)+"px'>"+scheduler.templates[this.name+"_cell_value"](Z[P][O])+"<div></td>"}}else{R+="<td><div style='"+Q.summ_width+" "+Q.style_height+" position:relative;' class='dhx_matrix_line'>";if(Z[P]){Z[P].sort(function(d,c){return d.start_date>c.start_date?1:-1});var X=[];for(var O=0;O<Z[P].length;O++){var W=Z[P][O];var L=0;while(X[L]&&X[L].end_date>W.start_date){L++}X[L]=W;R+=scheduler.render_timeline_event.call(this,W,L)}}R+="<table class='"+Q.table_className+"' cellpadding='0' cellspacing='0' style='"+Q.summ_width+" "+Q.style_height+"' >";for(var O=0;O<scheduler._cols.length;O++){R+="<td class='dhx_matrix_cell "+scheduler.templates[this.name+"_cell_class"](Z[P],this._trace_x[O],this.y_unit[P])+"' style='width:"+(scheduler._cols[O]-1)+"px'><div style='width:"+(scheduler._cols[O]-1)+"px'><div></td>"}R+="</table>";R+="</div></td>"}R+="</tr>"}R+="</table>";this._matrix=Z;S.scrollTop=0;S.innerHTML=R;scheduler._rendered=[];var U=document.getElementsByTagName("DIV");for(var P=0;P<U.length;P++){if(U[P].getAttribute("event_id")){scheduler._rendered.push(U[P])}}for(var P=0;P<S.firstChild.rows.length;P++){V.push(S.firstChild.rows[P].offsetHeight)}}function D(N){N.innerHTML="<div></div>";N=N.firstChild;scheduler._cols=[];scheduler._colsS={height:0};this._trace_x=[];scheduler._min_date_timeline=scheduler._min_date;var R=scheduler._min_date;var Q=scheduler._x-this.dx-18;var P=this.dx;for(var L=0;L<this.x_size;L++){scheduler._cols[L]=Math.floor(Q/(this.x_size-L));this._trace_x[L]=new Date(R);scheduler._render_x_header(L,P,R,N);var M=scheduler.templates[this.name+"_scalex_class"](R);if(M){N.lastChild.className+=" "+M}R=scheduler.date.add(R,this.x_step,this.x_unit);Q-=scheduler._cols[L];P+=scheduler._cols[L]}var O=this._trace_x;N.onclick=function(S){var T=B(S);if(T){scheduler.callEvent("onXScaleClick",[T.x,O[T.x],S||event])}};N.ondblclick=function(S){var T=B(S);if(T){scheduler.callEvent("onXScaleDblClick",[T.x,O[T.x],S||event])}}}function C(M){if(M){scheduler.set_sizes();F();var L=scheduler._min_date;D.call(this,scheduler._els.dhx_cal_header[0]);A.call(this,scheduler._els.dhx_cal_data[0]);scheduler._min_date=L;scheduler._els.dhx_cal_date[0].innerHTML=scheduler.templates[this.name+"_date"](scheduler._min_date,scheduler._max_date);scheduler._table_view=true}}function H(){if(scheduler._tooltip){scheduler._tooltip.style.display="none";scheduler._tooltip.date=""}}function J(P,S,Q){if(P.render!="cell"){return }var R=S.x+"_"+S.y;var L=P._matrix[S.y][S.x];if(!L){return H()}L.sort(function(U,T){return U.start_date>T.start_date?1:-1});if(scheduler._tooltip){if(scheduler._tooltip.date==R){return }scheduler._tooltip.innerHTML=""}else{var O=scheduler._tooltip=document.createElement("DIV");O.className="dhx_tooltip";document.body.appendChild(O);O.onclick=scheduler._click.dhx_cal_data}var N="";for(var M=0;M<L.length;M++){N+="<div class='dhx_tooltip_line' event_id='"+L[M].id+"'>";N+="<div class='dhx_tooltip_date'>"+(L[M]._timed?scheduler.templates.event_date(L[M].start_date):"")+"</div>";N+="<div class='dhx_event_icon icon_details'>&nbsp;</div>";N+=scheduler.templates[P.name+"_tooltip"](L[M].start_date,L[M].end_date,L[M])+"</div>"}scheduler._tooltip.style.display="";scheduler._tooltip.style.top="0px";if(document.body.offsetWidth-Q.left-scheduler._tooltip.offsetWidth<0){scheduler._tooltip.style.left=Q.left-scheduler._tooltip.offsetWidth+"px"}else{scheduler._tooltip.style.left=Q.left+S.src.offsetWidth+"px"}scheduler._tooltip.date=R;scheduler._tooltip.innerHTML=N;if(document.body.offsetHeight-Q.top-scheduler._tooltip.offsetHeight<0){scheduler._tooltip.style.top=Q.top-scheduler._tooltip.offsetHeight+S.src.offsetHeight+"px"}else{scheduler._tooltip.style.top=Q.top+"px"}}function F(){dhtmlxEvent(scheduler._els.dhx_cal_data[0],"mouseover",function(M){var L=scheduler.matrix[scheduler._mode];if(L){var O=scheduler._locate_cell_timeline(M);var M=M||event;var N=M.target||M.srcElement;if(O){return J(L,O,getOffset(O.src))}}H()});F=function(){}}scheduler.renderMatrix=function(M){var L=scheduler.date[this.name+"_start"](scheduler._date);scheduler._min_date=scheduler.date.add(L,this.x_start*this.x_step,this.x_unit);scheduler._max_date=scheduler.date.add(scheduler._min_date,this.x_size*this.x_step,this.x_unit);scheduler._table_view=true;C.call(this,M)};function G(M){var N=M.parentNode.childNodes;for(var L=0;L<N.length;L++){if(N[L]==M){return L}}return -1}function B(N){N=N||event;var L=N.target?N.target:N.srcElement;while(L&&L.tagName!="DIV"){L=L.parentNode}if(L&&L.tagName=="DIV"){var M=L.className.split(" ")[0];if(M=="dhx_scale_bar"){return{x:G(L),y:-1,src:L,scale:true}}}}scheduler._locate_cell_timeline=function(O){O=O||event;var L=O.target?O.target:O.srcElement;while(L&&L.tagName!="TD"){L=L.parentNode}if(L&&L.tagName=="TD"){var N=L.className.split(" ")[0];if(N=="dhx_matrix_cell"){if(scheduler._isRender("cell")){return{x:L.cellIndex-1,y:L.parentNode.rowIndex,src:L}}else{var M=L.parentNode;while(M&&M.tagName!="TD"){M=M.parentNode}return{x:L.cellIndex,y:M.parentNode.rowIndex,src:L}}}else{if(N=="dhx_matrix_scell"){return{x:-1,y:L.parentNode.rowIndex,src:L,scale:true}}}}return false};var I=scheduler._click.dhx_cal_data;scheduler._click.dhx_cal_data=function(N){var L=I.apply(this,arguments);var M=scheduler.matrix[scheduler._mode];if(M){var O=scheduler._locate_cell_timeline(N);if(O){if(O.scale){scheduler.callEvent("onYScaleClick",[O.y,M.y_unit[O.y],N||event])}else{scheduler.callEvent("onCellClick",[O.x,O.y,M._trace_x[O.x],(((M._matrix[O.y]||{})[O.x])||[]),N||event])}}}return L};scheduler.dblclick_dhx_matrix_cell=function(M){var L=scheduler.matrix[scheduler._mode];if(L){var N=scheduler._locate_cell_timeline(M);if(N){if(N.scale){scheduler.callEvent("onYScaleDblClick",[N.y,L.y_unit[N.y],M||event])}else{scheduler.callEvent("onCellDblClick",[N.x,N.y,L._trace_x[N.x],(((L._matrix[N.y]||{})[N.x])||[]),M||event])}}}};scheduler.dblclick_dhx_matrix_scell=function(L){return scheduler.dblclick_dhx_matrix_cell(L)};scheduler._isRender=function(L){return(scheduler.matrix[scheduler._mode]&&scheduler.matrix[scheduler._mode].render==L)};scheduler.attachEvent("onCellDblClick",function(M,R,N,L,P){if(this.config.readonly||(P.type=="dblclick"&&!this.config.dblclick_create)){return }var Q=scheduler.matrix[scheduler._mode];var O={};O.start_date=Q._trace_x[M];O.end_date=(Q._trace_x[M+1])?Q._trace_x[M+1]:scheduler.date.add(Q._trace_x[M],Q.x_step,Q.x_unit);O[scheduler.matrix[scheduler._mode].y_property]=Q.y_unit[R].key;scheduler.addEventNow(O,null,P)});scheduler.attachEvent("onBeforeDrag",function(M,N,L){if(scheduler._isRender("cell")){return false}return true})})();
\ No newline at end of file

=== added file 'addons/base_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_tooltip.js'
--- addons/base_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_tooltip.js	1970-01-01 00:00:00 +0000
+++ addons/base_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_tooltip.js	2011-04-07 05:03:24 +0000
@@ -0,0 +1,1 @@
+window.dhtmlXTooltip={version:0.1};dhtmlXTooltip.config={className:"dhtmlXTooltip tooltip",timeout_to_display:50,delta_x:15,delta_y:-20};dhtmlXTooltip.tooltip=document.createElement("div");dhtmlXTooltip.tooltip.className=dhtmlXTooltip.config.className;dhtmlXTooltip.show=function(D,G){dhtmlXTooltip.tooltip.className=dhtmlXTooltip.config.className;var H=this.position(D);var E=D.target||D.srcElement;if(this.isTooltip(E)){return }var C=H.x+dhtmlXTooltip.config.delta_x||0;var B=H.y-dhtmlXTooltip.config.delta_y||0;this.tooltip.style.visibility="hidden";if(this.tooltip.style.removeAttribute){this.tooltip.style.removeAttribute("right");this.tooltip.style.removeAttribute("bottom")}else{this.tooltip.style.removeProperty("right");this.tooltip.style.removeProperty("bottom")}this.tooltip.style.left="0px";this.tooltip.style.top="0px";this.tooltip.innerHTML=G;scheduler._obj.appendChild(this.tooltip);var A=this.tooltip.offsetWidth;var F=this.tooltip.offsetHeight;if(document.body.offsetWidth-C-A<0){if(this.tooltip.style.removeAttribute){this.tooltip.style.removeAttribute("left")}else{this.tooltip.style.removeProperty("left")}this.tooltip.style.right=(document.body.offsetWidth-C+2*dhtmlXTooltip.config.delta_x||0)+"px"}else{if(C<0){this.tooltip.style.left=(H.x+Math.abs(dhtmlXTooltip.config.delta_x||0))+"px"}else{this.tooltip.style.left=C+"px"}}if(document.body.offsetHeight-B-F<0){if(this.tooltip.style.removeAttribute){this.tooltip.style.removeAttribute("top")}else{this.tooltip.style.removeProperty("top")}this.tooltip.style.bottom=(document.body.offsetHeight-B-2*dhtmlXTooltip.config.delta_y||0)+"px"}else{if(B<0){this.tooltip.style.top=(H.y+Math.abs(dhtmlXTooltip.config.delta_y||0))+"px"}else{this.tooltip.style.top=B+"px"}}this.tooltip.style.visibility="visible"};dhtmlXTooltip.hide=function(){if(this.tooltip.parentNode){this.tooltip.parentNode.removeChild(this.tooltip)}};dhtmlXTooltip.delay=function(D,B,C,A){if(this.tooltip._timeout_id){window.clearTimeout(this.tooltip._timeout_id)}this.tooltip._timeout_id=setTimeout(function(){var E=D.apply(B,C);D=obj=C=null;return E},A||this.config.timeout_to_display)};dhtmlXTooltip.isTooltip=function(B){var A=false;while(B&&!A){A=(B.className==this.tooltip.className);B=B.parentNode}return A};dhtmlXTooltip.position=function(A){var A=A||window.event;if(A.pageX||A.pageY){return{x:A.pageX,y:A.pageY}}var B=((dhtmlx._isIE)&&(document.compatMode!="BackCompat"))?document.documentElement:document.body;return{x:A.clientX+B.scrollLeft-B.clientLeft,y:A.clientY+B.scrollTop-B.clientTop}};scheduler.attachEvent("onMouseMove",function(D,F){var C=F||window.event;var E=C.target||C.srcElement;if(D||dhtmlXTooltip.isTooltip(E)){var B=scheduler.getEvent(D)||scheduler.getEvent(dhtmlXTooltip.tooltip.event_id);dhtmlXTooltip.tooltip.event_id=B.id;var G=scheduler.templates.tooltip_text(B.start_date,B.end_date,B);if(_isIE){var A=document.createEventObject(C)}dhtmlXTooltip.delay(dhtmlXTooltip.show,dhtmlXTooltip,[A||C,G])}else{dhtmlXTooltip.delay(dhtmlXTooltip.hide,dhtmlXTooltip,[])}});scheduler.templates.tooltip_text=function(C,A,B){return"<b>Event:</b> "+B.text+"<br/><b>Start date:</b> "+scheduler.templates.tooltip_date_format(C)+"<br/><b>End date:</b> "+scheduler.templates.tooltip_date_format(A)};
\ No newline at end of file

=== added file 'addons/base_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_touch.css'
--- addons/base_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_touch.css	1970-01-01 00:00:00 +0000
+++ addons/base_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_touch.css	2011-04-07 05:03:24 +0000
@@ -0,0 +1,9 @@
+/*
+dhtmlxScheduler v.2.3
+
+This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
+to use it in not GPL project. Please contact sales@xxxxxxxxxx for details
+
+(c) DHTMLX Ltd.
+*/
+.dhx_cal_prev_button,.dhx_cal_next_button,.dhx_cal_today_button,.dhx_cal_add_button{top:6px!important;left:10px;border:1px solid #575D65;border-top:1px solid #4E5052;color:#FFF;text-shadow:0 -1px 0 #65696E;background-image:-webkit-gradient(linear,left top,left bottom,from(#B2B6BC),to(#6B737E));background-color:#989B9F;background-position:0 1px;background-repeat:repeat-x;-webkit-border-radius:5px;padding:3px;text-align:center;text-decoration:none;}.dhx_cal_today_button{left:55px;}.dhx_cal_next_button{left:146px;}.dhx_cal_add_button{right:9px;left:auto;width:20px;font-size:20px;padding:1px 2px 2px 2px;}.dhx_cal_navline .dhx_cal_date{top:7px;left:160px;right:350px;padding-top:4px;width:auto;text-align:center;color:#4F5459;}.dhx_cal_navline{background:-webkit-gradient(linear,0% 0,0% 100%,color-stop(0,#F4F5F8),color-stop(0.3,#F1F2F4),color-stop(0.7,#C4C7D0),color-stop(1,#A6AAB7));border-bottom:1px solid #797F90;height:40px!important;font-family:Helvetica;font-weight:bold;font-size:13px;}.dhx_cal_tab{top:6px!important;color:#4F5459;text-align:center;padding:5px 10px;width:80px;background-image:-webkit-gradient(linear,0% 0,0% 100%,from(#F7F7F7),to(#B9BDC7));background-color:#CFD0D1;background-position:0 1px;background-repeat:repeat-x;text-decoration:none;border:1px solid #95989F;border-top:1px solid #686A6A;height:16px;}.dhx_cal_tab.active{background-image:-webkit-gradient(linear,0% 0,0% 100%,from(#B0B2B6),to(#666D74));background-color:#949799;background-position:0 1px;background-repeat:repeat-x;border:1px solid #4C4D4F;border-top:1px solid #52585C;color:#F8F8F8;text-shadow:0 -1px 0 #5E6063;text-decoration:none;height:16px;padding:5px 10px;z-index:100;}.dhx_cal_light{-webkit-transition:-webkit-transform;-webkit-transform-style:preserve-3d;}.dhx_cal_cover{opacity:.5;}.dhx_cal_ltext{padding-top:0;padding-bottom:0;}.dhx_cal_ltext textarea{-webkit-background-size:0;-webkit-border-radius:0;height:94%;}.dhx_mini_calendar .dhx_month_head{height:35px;line-height:35px;text-align:center;padding-right:0;padding-left:0;}.dhx_mini_calendar .dhx_year_month{height:35px;line-height:30px;background:-webkit-gradient(linear,0% 0,0% 100%,from(#F4F5F8),to(#8A8E9A));font-family:Helvetica;font-weight:bold;font-size:13px;}.dhx_mini_calendar .dhx_year_month .dhx_cal_prev_button,.dhx_mini_calendar .dhx_year_month .dhx_cal_next_button{line-height:normal;}
\ No newline at end of file

=== added file 'addons/base_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_touch.js'
--- addons/base_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_touch.js	1970-01-01 00:00:00 +0000
+++ addons/base_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_touch.js	2011-04-07 05:03:24 +0000
@@ -0,0 +1,9 @@
+/*
+dhtmlxScheduler v.2.3
+
+This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
+to use it in not GPL project. Please contact sales@xxxxxxxxxx for details
+
+(c) DHTMLX Ltd.
+*/
+TouchScroll=function(D,E,A,B){this.debug=!!E;this.compat=!!B;this.rough=!!A;this.axisX=this.axisY=true;if(typeof D!="object"){D=document.getElementById(D)}this._init();D.addEventListener("touchstart",this,false);D.addEventListener("webkitTransitionEnd",this,false);if(this.debug){D.addEventListener("mousedown",this,false)}this.node=D;for(var C=0;C<D.childNodes.length;C++){if(D.childNodes[C].nodeType==1){this.area=D.childNodes[C];break}}if(window.getComputedStyle(this.node).position=="static"){this.node.style.position="relative"}this.area.style.cssText+="-webkit-transition: -webkit-transform; -webkit-user-select:none; -webkit-transform-style:preserve-3d;";this.scrolls={}};TouchScroll.prototype={refresh:function(){this.node.style.webkitTransformStyle="flat";this.node.style.webkitTransformStyle="preserve-3d"},scrollTo:function(A,C,B){this.set_matrix({e:A,f:C},(B||0))},onscroll:function(A,B){},handleEvent:function(A){return this["ev_"+A.type](A)},get_matrix:function(A){return new WebKitCSSMatrix(window.getComputedStyle(A||this.area).webkitTransform)},set_matrix:function(C,B,A){(A||this.area).style.webkitTransform="translate("+Math.round(C.e)+"px,"+Math.round(C.f)+"px)";(A||this.area).style.webkitTransitionDuration=B},ev_touchstart:function(A){this.ev_mousedown(A.touches[0]);A.preventDefault();return false},ev_mousedown:function(B){var C=B;this.x=C.pageX;this.y=C.pageY;this.dx=this.node.offsetWidth;this.dy=this.node.offsetHeight;this.mx=this.area.scrollWidth;this.my=this.area.scrollHeight;this.target=C.target;if(!this.rough){var A=this.get_matrix();this.target_x=A.e;this.target_y=A.f;if(!this.scroll&&this.compat){A.e=this.node.scrollLeft*-1;A.f=this.node.scrollTop*-1;this.node.scrollTop=this.node.scrollLeft=0}this.set_matrix(A,0);this._correct_scroll(this.target_x,this.target_y)}this.scroll_x=this.scroll_y=this.scroll=false;this._init_events()},ev_touchend:function(){return this.ev_mouseup()},ev_mouseup:function(){this._deinit_events();if(!this.scroll){this._remove_scroll();var A=document.createEvent("MouseEvent");A.initMouseEvent("click",true,true);this.target.dispatchEvent(A)}this.target=null},ev_webkitTransitionEnd:function(){if(this.target||!this.scroll){return }this._remove_scroll();var B=this.get_matrix();this.node.firstChild._scrollTop=-1*B.f;if(this.compat&&(B.e||B.f)){var C=B.f;var A=B.e;B.e=B.f=0;this.set_matrix(B,0);this.node.scrollTop=-1*C;this.node.scrollLeft=-1*A}this.scroll=false},ev_touchmove:function(A){return this.ev_mousemove(A.touches[0])},ev_mousemove:function(E){if(!this.target){return }var G=E;var D=(G.pageX-this.x)*(this.axisX?5:0);var A=(G.pageY-this.y)*(this.axisY?5:0);if(Math.abs(D)<10&&Math.abs(A)<10){return }if(Math.abs(D)>50){this.scroll_x=true}if(Math.abs(A)>50){this.scroll_y=true}if(this.scroll_x||this.scroll_y){this.x=G.pageX;this.y=G.pageY;this.scroll=true;var C=this.get_matrix();D=D+(this.target_x-C.e);A=A+(this.target_y-C.f);var F="2000ms";var B="500ms";this.target_x=D+C.e;this.target_y=A+C.f;if(this.target_x>0){this.target_x=0;F=B}if(this.target_y>0){this.target_y=0;F=B}if(this.mx-this.dx+this.target_x<0){this.target_x=-this.mx+this.dx;F=B}if(this.my-this.dy+this.target_y<0){this.target_y=-this.my+this.dy;F=B}this.set_matrix({e:this.target_x,f:this.target_y},F);this._add_scroll(C.e,C.f);this._correct_scroll(this.target_x,this.target_y,F);this.onscroll(this.target_x,this.target_y)}return false},_correct_scroll:function(A,F,B){if(this.scrolls.x){var E=this.get_matrix(this.scrolls.x);var D=this.dx*A/this.mx;this.set_matrix({e:-1*D,f:0},B,this.scrolls.x)}if(this.scrolls.y){var E=this.get_matrix(this.scrolls.y);var C=this.dy*F/this.my;this.set_matrix({e:0,f:-1*C},B,this.scrolls.y)}},_remove_scroll:function(){if(this.scrolls.x){this.scrolls.x.parentNode.removeChild(this.scrolls.x)}if(this.scrolls.y){this.scrolls.y.parentNode.removeChild(this.scrolls.y)}this.scrolls={}},_add_scroll:function(){if(this.scrolls.ready){return }var C;if(this.my>5&&this.axisY){var B=this.dy*this.dy/this.my-1;this.scrolls.y=C=document.createElement("DIV");C.className="dhx_scroll_y";C.style.height=B+"px";this.node.appendChild(C)}if(this.mx>5&&this.axisX){var B=this.dx*this.dx/this.mx;this.scrolls.x=C=document.createElement("DIV");C.className="dhx_scroll_x";C.style.width=B+"px";this.node.appendChild(C)}var A=this.get_matrix();this._correct_scroll(A.e,A.f,0);this.scrolls.ready=true},_init_events:function(){document.addEventListener("touchmove",this,false);document.addEventListener("touchend",this,false);if(this.debug){document.addEventListener("mousemove",this,false);document.addEventListener("mouseup",this,false)}},_deinit_events:function(){document.removeEventListener("touchmove",this,false);document.removeEventListener("touchend",this,false);if(this.debug){document.removeEventListener("mousemove",this,false);document.removeEventListener("mouseup",this,false)}},_init:function(){document.styleSheets[0].insertRule(".dhx_scroll_x { width:50px;height:4px;background:rgba(0, 0, 0, 0.4);position:absolute; left:0px; bottom:3px; border:1px solid transparent; -webkit-border-radius:4px;-webkit-transition: -webkit-transform;}",0);document.styleSheets[0].insertRule(".dhx_scroll_y { width:4px;height:50px;background:rgba(0, 0, 0, 0.4);position:absolute; top:0px; right:3px; border:1px solid transparent; -webkit-border-radius:4px;-webkit-transition: -webkit-transform;}",0);this._init=function(){}}};scheduler._ipad_before_init=function(){scheduler._ipad_before_init=function(){};scheduler.xy.scroll_width=0;var C=scheduler._els.dhx_cal_tab;var B=42;for(var A=C.length-1;A>=0;A--){C[A].style.cssText+="top:4px;";C[A].style.left="auto";C[A].style.right=B+"px";if(A==0){C[A].style.cssText+=";-webkit-border-top-left-radius: 5px; -webkit-border-bottom-left-radius: 5px;"}if(A==C.length-1){C[A].style.cssText+=";-webkit-border-top-right-radius: 5px; -webkit-border-bottom-right-radius: 5px;"}B+=100}scheduler._els.dhx_cal_prev_button[0].innerHTML="&lt;";scheduler._els.dhx_cal_next_button[0].innerHTML="&gt;";var F=document.createElement("div");F.className="dhx_cal_add_button";F.innerHTML="+ ";F.onclick=function(){var G=new Date();if(G>scheduler._min_date&&G<scheduler._max_date){scheduler.addEventNow()}else{scheduler.addEventNow(scheduler._min_date.valueOf())}};scheduler._els.dhx_cal_navline[0].appendChild(F);this._obj.onmousedown=this._obj.onmouseup=this._obj.onmousemove=function(){};var D=null;var E=[];this._obj.ontouchmove=function(I){if(D){var H=Math.abs(I.touches[0].pageX-E[0]);var G=Math.abs(I.touches[0].pageY-E[1]);if(H>50||G>50){D=window.clearTimeout(D)}}if(scheduler.config.touch_actions){scheduler._on_mouse_move(I.touches[0])}};this._obj.ontouchstart=function(G){if(scheduler._lightbox_id){return }D=window.setTimeout(function(){scheduler._on_dbl_click(G.touches[0],(G.target.className?G.target:G.target.parentNode))},400);E=[G.touches[0].pageX,G.touches[0].pageY];if(scheduler.config.touch_actions){scheduler._on_mouse_down(G.touches[0])}};this._obj.ontouchend=function(G){if(D){D=window.clearTimeout(D)}if(scheduler.config.touch_actions){scheduler._on_mouse_up(G.touches[0])}}};scheduler._ipad_init=function(){var C=document.createElement("DIV");var B=scheduler._els.dhx_cal_data[0];C.appendChild(B);C.style.cssText="overflow:hidden; width:100%; overflow:hidden;position:relative;";this._obj.appendChild(C);B.style.overflowY="hidden";var A=new TouchScroll(C);A.axisX=false;scheduler._ipad_init=function(){B.parentNode.style.height=B.style.height;B.parentNode.style.top=B.style.top;B.style.height=B.scrollHeight+"px";B.style.top="0px";if(Math.abs(B.parentNode.offsetHeight-B.offsetHeight)<5){A.axisY=false;A.scrollTo(0,0,0)}else{A.axisY=true}A.refresh()};scheduler.attachEvent("onSchedulerResize",function(){setTimeout(function(){scheduler._ipad_init()});return true});scheduler._ipad_init()};scheduler.attachEvent("onViewChange",function(){scheduler._ipad_init()});scheduler.attachEvent("onBeforeViewChange",function(){scheduler._ipad_before_init();return true});scheduler.showCover=function(B){this.show_cover();if(B){B.style.display="block";var C=getOffset(this._obj);B.style.top=B.offsetHeight*-1+"px";B.style.left=Math.round(C.left+(this._obj.offsetWidth-B.offsetWidth)/2)+"px"}var A=this._get_lightbox();A.style.webkitTransform="translate(0px,"+(B.offsetHeight+41)+"px)";A.style.webkitTransitionDuration="500ms"};scheduler.hideCover=function(A){if(A){A.style.webkitTransform="translate(0px,"+(A.offsetHeight+41)*-1+"px)";A.style.webkitTransitionDuration="500ms"}this.hide_cover()};scheduler.config.lightbox.sections[0].height=100;if(scheduler.form_blocks.calendar_time){scheduler.config.lightbox.sections[1].type="calendar_time";scheduler._mini_cal_arrows=["&lt;","&gt;"]}scheduler.xy.menu_width=0;scheduler.attachEvent("onClick",function(){return false});scheduler.locale.labels.new_event="";scheduler._mouse_coords=function(C){var F;var A=document.body;var E=document.documentElement;if(C.pageX||C.pageY){F={x:C.pageX,y:C.pageY}}else{F={x:C.clientX+(A.scrollLeft||E.scrollLeft||0)-A.clientLeft,y:C.clientY+(A.scrollTop||E.scrollTop||0)-A.clientTop}}F.x-=getAbsoluteLeft(this._obj)+(this._table_view?0:this.xy.scale_width);var D=F.y-=getAbsoluteTop(this._obj)+this.xy.nav_height+this._dy_shift+this.xy.scale_height-(this._els.dhx_cal_data[0]._scrollTop||0);if(!this._table_view){F.x=Math.max(0,Math.ceil(F.x/this._cols[0])-1);F.y=Math.max(0,Math.ceil(F.y*60/(this.config.time_step*this.config.hour_size_px))-1)+this.config.first_hour*(60/this.config.time_step)}else{var B=0;for(B=1;B<this._colsS.heights.length;B++){if(this._colsS.heights[B]>F.y){break}}F.y=(Math.max(0,Math.ceil(F.x/this._cols[0])-1)+Math.max(0,B-1)*7)*24*60/this.config.time_step;F.x=0}return F};
\ No newline at end of file

=== added file 'addons/base_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_treetimeline.js'
--- addons/base_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_treetimeline.js	1970-01-01 00:00:00 +0000
+++ addons/base_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_treetimeline.js	2011-04-07 05:03:24 +0000
@@ -0,0 +1,1 @@
+scheduler.attachEvent("onTimelineCreated",function(A){if(A.render=="tree"){A.y_unit_original=A.y_unit;A.y_unit=scheduler._getArrayToDisplay(A.y_unit_original);scheduler.form_blocks[A.name]={render:function(C){var B="<div class='dhx_section_timeline' style='overflow: hidden; height: "+C.height+"px'></div>";return B},set_value:function(D,I,G,C){var J=scheduler._getArrayForSelect(scheduler.matrix[C.type].y_unit_original,C.type);D.innerHTML="";var F=document.createElement("select");D.appendChild(F);var H=D.getElementsByTagName("select")[0];for(var E=0;E<J.length;E++){var B=document.createElement("option");B.value=J[E].key;if(B.value==G[scheduler.matrix[C.type].y_property]){B.selected=true}B.innerHTML=J[E].label;H.appendChild(B)}},get_value:function(D,C,B){return D.firstChild.value},focus:function(B){}}}});scheduler.attachEvent("onBeforeViewRender",function(J,E,H){var F={};if(J=="tree"){var I;var D,A,B;var C;var G;if(E.children){I=H.folder_dy||H.dy;if(H.folder_dy&&!H.section_autoheight){A="height:"+H.folder_dy+"px;"}D="dhx_row_folder";B="dhx_matrix_scell folder";C="<div class='dhx_scell_expand'>"+((E.open)?"-":"+")+"</div>";G=(H.folder_events_available)?"dhx_data_table folder_events":"dhx_data_table folder"}else{I=H.dy;D="dhx_row_item";B="dhx_matrix_scell item";C="";G="dhx_data_table"}td_content="<div class='dhx_scell_level"+E.level+"'>"+C+"<div class='dhx_scell_name'>"+(scheduler.templates[H.name+"_scale_label"](E.key,E.label,H)||E.label)+"</div></div>";F={height:I,style_height:A,tr_className:D,td_className:B,td_content:td_content,table_className:G}}return F});var section_id_before;scheduler.attachEvent("onBeforeEventChanged",function(D,A,C){if(scheduler._isRender("tree")){var B=scheduler.getSection(D.section_id);if(typeof B.children!="undefined"&&!scheduler.matrix[scheduler._mode].folder_events_available){if(!C){D[scheduler.matrix[scheduler._mode].y_property]=section_id_before}return false}}return true});scheduler.attachEvent("onBeforeDrag",function(D,E,C){var A=scheduler._locate_cell_timeline(C);if(A){var B=scheduler.matrix[scheduler._mode].y_unit[A.y].key;if(typeof scheduler.matrix[scheduler._mode].y_unit[A.y].children!="undefined"&&!scheduler.matrix[scheduler._mode].folder_events_av

Follow ups